Forall X in Lurch

Total Page:16

File Type:pdf, Size:1020Kb

Forall X in Lurch forallx in Lurch An Introduction to Formal Logic in Lurch P.D. Magnus University at Albany, State University of New York Nathan Carter Bentley University http://web.bentley.edu/empl/c/ncarter/faxil, version 1.1 [171002] This book is offered under a Creative Commons license. (Attribution-ShareAlike 3.0) In his original text, P.D. Magnus thanked the people who made his project possible. Notable among these are Cristyn Magnus, who read many early drafts; Aaron Schiller, who was an early adopter and provided considerable, helpful feedback; and Bin Kang, Craig Erb, Nathan Carter, Wes McMichael, Selva Samuel, Dave Krueger, Brandon Lee, and the students of Introduction to Logic, who detected various errors in previous versions of the book. Nathan Carter thanks P.D. for creating the text in the first place and Ken Monks for being the other half of the Lurch project. Thanks also go to Bentley University for supporting me for a summer of working on this textbook, and to all my logic students, who help shape my teaching and the development of Lurch. Original copyright notice: c 2005{2017 by P.D. Magnus. Some rights reserved. You are free to copy this book, to distribute it, to display it, and to make derivative works, under the following conditions: (a) Attribution. You must give the original author credit. (b) Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one. | For any reuse or distribution, you must make clear to others the license terms of this work. Any of these conditions can be waived if you get permission from the copyright holder. Your fair use and other rights are in no way affected by the above. | This is a human-readable summary of the full license, which is available on-line at http://creativecommons.org/licenses/by-sa/3.0/ This version: c 2013{2017 by Nathan Carter. Some rights reserved; the original Creative Common license given above is preserved. Typesetting was carried out entirely in LATEX2". The style for typesetting proofs is based on fitch.sty (v0.4) by Peter Selinger, University of Ottawa. This copy of forallx in Lurch is current as of October 2, 2017. The most recent version is available on-line at http://web.bentley.edu/empl/c/ncarter/faxil Contents Preface . .6 1 Getting started with Lurch 7 1.1 What is Lurch?............................................7 1.2 Installing the software . .7 1.3 A math word processor . .9 1.4 Beyond word processing . 11 2 What is logic? 12 2.1 Arguments . 12 2.2 Sentences . 13 2.3 Two ways that arguments can go wrong . 14 2.4 Deductive validity . 15 2.5 Other logical notions . 16 2.6 Formal languages . 18 2.7 Typing arguments in Lurch ..................................... 20 Practice Exercises . 20 3 Sentential logic 23 3.1 Sentence letters . 23 3.2 Connectives . 24 3.3 Other symbolization . 31 3.4 Sentences of SL . 32 3.5 How Lurch can help . 35 Practice Exercises . 37 4 Truth tables 40 4.1 Truth-functional connectives . 40 4.2 Complete truth tables . 40 4.3 Using truth tables . 43 4.4 Partial truth tables . 44 4.5 Lurch and truth tables . 46 Practice Exercises . 48 5 Proofs in SL 51 5.1 Basic rules for SL . 52 5.2 Derived rules . 59 5.3 Derived rules of logical equivalence . 61 Practice Exercises . 61 6 Proofs in Lurch 63 6.1 Having Lurch check your work . 63 6.2 Creating your own proofs . 70 6.3 Proof-theoretic concepts . 71 3 4 CONTENTS 6.4 Proofs and truth tables . 71 Practice Exercises . 73 7 Quantified logic 75 7.1 From sentences to predicates . 75 7.2 Building blocks of QL . 76 7.3 Quantifiers . 79 7.4 Translating to QL . 82 7.5 Sentences of QL . 90 7.6 Identity . 93 Practice Exercises . 97 8 Formal semantics 103 8.1 Semantics for SL . 104 8.2 Interpretations and models in QL . 107 8.3 Semantics for identity . 110 8.4 Working with models . 111 8.5 Truth in QL . 114 Practice Exercises . 118 9 Proofs in QL 122 9.1 Rules for quantifiers . 122 9.2 Rules for identity . 126 9.3 QL Proofs in Lurch .......................................... 128 9.4 Proof-theoretic concepts . 130 9.5 Soundness and completeness . 131 Practice Exercises . 132 10 Real numbers 136 10.1 An important transition . 136 10.2 Shortcuts about statements . 137 10.3 Axioms . 139 10.4 Theorems . 139 10.5 Shortcuts in Lurch .......................................... 144 Practice Exercises . 148 11 Mathematical Induction 150 11.1 Why introduce induction? . 150 11.2 One new rule . 150 11.3 A first induction theorem . 152 11.4 Completing the example with new privileges . 153 Practice Exercises . 155 12 Calculus 157 12.1 Absolute Value . 157 12.2 Working with Limits . 158 12.3 The foundations of calculus . 162 Practice Exercises . 163 13 Abstract Mathematics 166 13.1 Sets . 166 13.2 Proofs about Sets . 170 13.3 Functions . 171 Practice Exercises . ..
Recommended publications
  • 1 Elementary Set Theory
    1 Elementary Set Theory Notation: fg enclose a set. f1; 2; 3g = f3; 2; 2; 1; 3g because a set is not defined by order or multiplicity. f0; 2; 4;:::g = fxjx is an even natural numberg because two ways of writing a set are equivalent. ; is the empty set. x 2 A denotes x is an element of A. N = f0; 1; 2;:::g are the natural numbers. Z = f:::; −2; −1; 0; 1; 2;:::g are the integers. m Q = f n jm; n 2 Z and n 6= 0g are the rational numbers. R are the real numbers. Axiom 1.1. Axiom of Extensionality Let A; B be sets. If (8x)x 2 A iff x 2 B then A = B. Definition 1.1 (Subset). Let A; B be sets. Then A is a subset of B, written A ⊆ B iff (8x) if x 2 A then x 2 B. Theorem 1.1. If A ⊆ B and B ⊆ A then A = B. Proof. Let x be arbitrary. Because A ⊆ B if x 2 A then x 2 B Because B ⊆ A if x 2 B then x 2 A Hence, x 2 A iff x 2 B, thus A = B. Definition 1.2 (Union). Let A; B be sets. The Union A [ B of A and B is defined by x 2 A [ B if x 2 A or x 2 B. Theorem 1.2. A [ (B [ C) = (A [ B) [ C Proof. Let x be arbitrary. x 2 A [ (B [ C) iff x 2 A or x 2 B [ C iff x 2 A or (x 2 B or x 2 C) iff x 2 A or x 2 B or x 2 C iff (x 2 A or x 2 B) or x 2 C iff x 2 A [ B or x 2 C iff x 2 (A [ B) [ C Definition 1.3 (Intersection).
    [Show full text]
  • Application: Digital Logic Circuits
    SECTION 2.4 Application: Digital Logic Circuits Copyright © Cengage Learning. All rights reserved. Application: Digital Logic Circuits Switches “in series” Switches “in parallel” Change closed and on are replaced by T, open and off are replaced by F? Application: Digital Logic Circuits • More complicated circuits correspond to more complicated logical expressions. • This correspondence has been used extensively in design and study of circuits. • Electrical engineers use language of logic when refer to values of signals produced by an electronic switch as being “true” or “false.” • Only that symbols 1 and 0 are used • symbols 0 and 1 are called bits, short for binary digits. • This terminology was introduced in 1946 by the statistician John Tukey. Black Boxes and Gates Black Boxes and Gates • Circuits: transform combinations of signal bits (1’s and 0’s) into other combinations of signal bits (1’s and 0’s). • Computer engineers and digital system designers treat basic circuits as black boxes. • Ignore inside of a black box (detailed implementation of circuit) • focused on the relation between the input and the output signals. • Operation of a black box is completely specified by constructing an input/output table that lists all its possible input signals together with their corresponding output signals. Black Boxes and Gates One possible correspondence of input to output signals is as follows: An Input/Output Table Black Boxes and Gates An efficient method for designing more complicated circuits is to build them by connecting less complicated black box circuits. Gates can be combined into circuits in a variety of ways. If the rules shown on the next page are obeyed, the result is a combinational circuit, one whose output at any time is determined entirely by its input at that time without regard to previous inputs.
    [Show full text]
  • Shalack V.I. Semiotic Foundations of Logic
    Semiotic foundations of logic Vladimir I. Shalack abstract. The article offers a look at the combinatorial logic as the logic of signs operating in the most general sense. For this it is proposed slightly reformulate it in terms of introducing and replacement of the definitions. Keywords: combinatory logic, semiotics, definition, logic founda- tions 1 Language selection Let’s imagine for a moment what would be like the classical logic, if we had not studied it in the language of negation, conjunction, dis- junction and implication, but in the language of the Sheffer stroke. I recall that it can be defined with help of negation and conjunction as follows A j B =Df :(A ^ B): In turn, all connectives can be defined with help of the Sheffer stroke in following manner :A =Df (A j A) A ^ B =Df (A j B) j (A j B) A _ B =Df (A j A) j (B j B) A ⊃ B =Df A j (B j B): Modus ponens rule takes the following form A; A j (B j B) . B 226 Vladimir I. Shalack We can go further and following the ideas of M. Sch¨onfinkel to define two-argument infix quantifier ‘jx’ x A j B =Df 8x(A j B): Now we can use it to define Sheffer stroke and quantifiers. x A j B =Df A j B where the variable x is not free in the formulas A and B; y x y 8xA =Df (A j A) j (A j A) where the variable y is not free in the formula A; x y x 9xA =Df (A j A) j (A j A) where the variable y is not free in the formula A.
    [Show full text]
  • CS 173: Discrete Structures, Spring 2012 Homework 1 Solutions
    CS 173: Discrete Structures, Spring 2012 Homework 1 Solutions This homework contains 3 problems worth a total of 25 points. 1. [1 point] Finding information on Piazza How many pet rats does Margaret’s family have? (Hint: see Piazza.) Solution: Margaret’s family has six pet rats. 2. [4 points] Demographic Survey 3. [20 points] Logic operators The late 19th century philosopher Charles Peirce (rhymes with ‘hearse,’ not ‘fierce’) wrote about a set of logically dual operators and, in his writings, coined the term ‘Ampheck’ to describe them. The two most common Ampheck operators, the Peirce arrow (written ↓ or ⊥ or ∨ by different people) and the Sheffer stroke (written ↑ or | or ∧ by different people), are defined by the following truth table: p q p ↑ q p ↓ q T T F F T F T F F T T F F F T T (a) (4 points) The set of operators {∧, ∨, ¬} is functionally complete, which means that every logical statement can be expressed using only these three operators. Is the smaller set of operators {∨, ¬} also functionally complete? Explain why or why not. Solution: By De Morgan’s laws, ¬(¬p∨¬q) ≡ ¬¬p∧¬¬q ≡ p∧q So every logical statement using the ∧ operator can be rewritten in terms of the ∨ and ¬ operators. Since every logical statement can be expressed in terms of the ∧, ∨, and ¬ operators, this implies that every logical statement can be expressed in terms of the ∨ and ¬ operators, and so {∨, ¬} is functionally complete. (b) (4 points) Express ¬p using only the Sheffer stroke operation ↑. Solution: Note that ¬p is true if and only if p is false.
    [Show full text]
  • Boolean Logic
    Boolean logic Lecture 12 Contents . Propositions . Logical connectives and truth tables . Compound propositions . Disjunctive normal form (DNF) . Logical equivalence . Laws of logic . Predicate logic . Post's Functional Completeness Theorem Propositions . A proposition is a statement that is either true or false. Whichever of these (true or false) is the case is called the truth value of the proposition. ‘Canberra is the capital of Australia’ ‘There are 8 day in a week.’ . The first and third of these propositions are true, and the second and fourth are false. The following sentences are not propositions: ‘Where are you going?’ ‘Come here.’ ‘This sentence is false.’ Propositions . Propositions are conventionally symbolized using the letters Any of these may be used to symbolize specific propositions, e.g. :, Manchester, , … . is in Scotland, : Mammoths are extinct. The previous propositions are simple propositions since they make only a single statement. Logical connectives and truth tables . Simple propositions can be combined to form more complicated propositions called compound propositions. .The devices which are used to link pairs of propositions are called logical connectives and the truth value of any compound proposition is completely determined by the truth values of its component simple propositions, and the particular connective, or connectives, used to link them. ‘If Brian and Angela are not both happy, then either Brian is not happy or Angela is not happy.’ .The sentence about Brian and Angela is an example of a compound proposition. It is built up from the atomic propositions ‘Brian is happy’ and ‘Angela is happy’ using the words and, or, not and if-then.
    [Show full text]
  • Logic, Proofs
    CHAPTER 1 Logic, Proofs 1.1. Propositions A proposition is a declarative sentence that is either true or false (but not both). For instance, the following are propositions: “Paris is in France” (true), “London is in Denmark” (false), “2 < 4” (true), “4 = 7 (false)”. However the following are not propositions: “what is your name?” (this is a question), “do your homework” (this is a command), “this sentence is false” (neither true nor false), “x is an even number” (it depends on what x represents), “Socrates” (it is not even a sentence). The truth or falsehood of a proposition is called its truth value. 1.1.1. Connectives, Truth Tables. Connectives are used for making compound propositions. The main ones are the following (p and q represent given propositions): Name Represented Meaning Negation p “not p” Conjunction p¬ q “p and q” Disjunction p ∧ q “p or q (or both)” Exclusive Or p ∨ q “either p or q, but not both” Implication p ⊕ q “if p then q” Biconditional p → q “p if and only if q” ↔ The truth value of a compound proposition depends only on the value of its components. Writing F for “false” and T for “true”, we can summarize the meaning of the connectives in the following way: 6 1.1. PROPOSITIONS 7 p q p p q p q p q p q p q T T ¬F T∧ T∨ ⊕F →T ↔T T F F F T T F F F T T F T T T F F F T F F F T T Note that represents a non-exclusive or, i.e., p q is true when any of p, q is true∨ and also when both are true.
    [Show full text]
  • Logic, Sets, and Proofs David A
    Logic, Sets, and Proofs David A. Cox and Catherine C. McGeoch Amherst College 1 Logic Logical Statements. A logical statement is a mathematical statement that is either true or false. Here we denote logical statements with capital letters A; B. Logical statements be combined to form new logical statements as follows: Name Notation Conjunction A and B Disjunction A or B Negation not A :A Implication A implies B if A, then B A ) B Equivalence A if and only if B A , B Here are some examples of conjunction, disjunction and negation: x > 1 and x < 3: This is true when x is in the open interval (1; 3). x > 1 or x < 3: This is true for all real numbers x. :(x > 1): This is the same as x ≤ 1. Here are two logical statements that are true: x > 4 ) x > 2. x2 = 1 , (x = 1 or x = −1). Note that \x = 1 or x = −1" is usually written x = ±1. Converses, Contrapositives, and Tautologies. We begin with converses and contrapositives: • The converse of \A implies B" is \B implies A". • The contrapositive of \A implies B" is \:B implies :A" Thus the statement \x > 4 ) x > 2" has: • Converse: x > 2 ) x > 4. • Contrapositive: x ≤ 2 ) x ≤ 4. 1 Some logical statements are guaranteed to always be true. These are tautologies. Here are two tautologies that involve converses and contrapositives: • (A if and only if B) , ((A implies B) and (B implies A)). In other words, A and B are equivalent exactly when both A ) B and its converse are true.
    [Show full text]
  • Lecture 1: Propositional Logic
    Lecture 1: Propositional Logic Syntax Semantics Truth tables Implications and Equivalences Valid and Invalid arguments Normal forms Davis-Putnam Algorithm 1 Atomic propositions and logical connectives An atomic proposition is a statement or assertion that must be true or false. Examples of atomic propositions are: “5 is a prime” and “program terminates”. Propositional formulas are constructed from atomic propositions by using logical connectives. Connectives false true not and or conditional (implies) biconditional (equivalent) A typical propositional formula is The truth value of a propositional formula can be calculated from the truth values of the atomic propositions it contains. 2 Well-formed propositional formulas The well-formed formulas of propositional logic are obtained by using the construction rules below: An atomic proposition is a well-formed formula. If is a well-formed formula, then so is . If and are well-formed formulas, then so are , , , and . If is a well-formed formula, then so is . Alternatively, can use Backus-Naur Form (BNF) : formula ::= Atomic Proposition formula formula formula formula formula formula formula formula formula formula 3 Truth functions The truth of a propositional formula is a function of the truth values of the atomic propositions it contains. A truth assignment is a mapping that associates a truth value with each of the atomic propositions . Let be a truth assignment for . If we identify with false and with true, we can easily determine the truth value of under . The other logical connectives can be handled in a similar manner. Truth functions are sometimes called Boolean functions. 4 Truth tables for basic logical connectives A truth table shows whether a propositional formula is true or false for each possible truth assignment.
    [Show full text]
  • Propositional Logic
    Mathematical Logic (Based on lecture slides by Stan Burris) George Voutsadakis1 1Mathematics and Computer Science Lake Superior State University LSSU Math 300 George Voutsadakis (LSSU) Logic January 2013 1 / 86 Outline 1 Propositional Logic Connectives, Formulas and Truth Tables Equivalences, Tautologies and Contradictions Substitution Replacement Adequate Sets of Connectives Disjunctive and Conjunctive Forms Valid Arguments, Tautologies and Satisfiability Compactness Epilogue: Other Propositional Logics George Voutsadakis (LSSU) Logic January 2013 2 / 86 Propositional Logic Connectives, Formulas and Truth Tables Subsection 1 Connectives, Formulas and Truth Tables George Voutsadakis (LSSU) Logic January 2013 3 / 86 Propositional Logic Connectives, Formulas and Truth Tables The Alphabet: Connectives and Variables The following are the basic logical connectives that we use to connect logical statements: Symbol Name Symbol Name 1 true ∧ and 0 false ∨ or ¬ not → implies ↔ iff In the same way that in algebra we use x, y, z,... to stand for unknown or varying numbers, in logic we use the propositional variables P, Q, R,... to stand for unknown or varying propositions or statements; Using the connectives and variables we can construct propositional formulas like ((P → (Q ∨ R)) ∧ ((¬Q) ↔ (1 ∨ P))). George Voutsadakis (LSSU) Logic January 2013 4 / 86 Propositional Logic Connectives, Formulas and Truth Tables Inductive (Recursive) Definition of Propositional Formulas Propositional formulas are formally built as follows: Every propositional variable P is a propositional formula; the constants 0 and 1 are propositional formulas; if F is a propositional formula, then (¬F ) is a propositional formula; if F and G are propositional formulas, then (F ∧ G), (F ∨ G), (F → G) and (F ↔ G) are propositional formulas.
    [Show full text]
  • Combinational Circuits
    Combinational Circuits Jason Filippou CMSC250 @ UMCP 06-02-2016 Jason Filippou (CMSC250 @ UMCP) Circuits 06-02-2016 1 / 1 Outline Jason Filippou (CMSC250 @ UMCP) Circuits 06-02-2016 2 / 1 Hardware design levels Hardware design levels Jason Filippou (CMSC250 @ UMCP) Circuits 06-02-2016 3 / 1 Hardware design levels Levels of abstraction for ICs Small Scale Integration: ≈ 10 boolean gates Medium Scale Integration: > 10; ≤ 100 Large Scale Integration: Anywhere between 100 and 30; 000. Very Large Scale Integration: Up to 150; 000. Very Very Large Scale Integration: > 150; 000. Jason Filippou (CMSC250 @ UMCP) Circuits 06-02-2016 4 / 1 Hardware design levels Example schematic Figure 1: VLSI schematic for a professional USB interface for Macintosh PCs. Jason Filippou (CMSC250 @ UMCP) Circuits 06-02-2016 5 / 1 Hardware design levels SSI Consists of circuits that contain about 10 gates. 16-bit adders. Encoders / Decoders. MUX/DEMUX. ::: All our examples will be at an SSI level. Logic Design is the branch of Computer Science that essentially analyzes the kinds of circuits and optimizations done at an SSI/MSI level. We do not have such a course in the curriculum, but you can expect to be exposed to it if you ever take 411. Jason Filippou (CMSC250 @ UMCP) Circuits 06-02-2016 6 / 1 Combinational Circuit Design Combinational Circuit Design Jason Filippou (CMSC250 @ UMCP) Circuits 06-02-2016 7 / 1 A sequential circuit is one where this constraint can be violated. Example: Flip-flops (yes, seriously). In this course, we will only touch upon combinational circuits. Combinational Circuit Design Combinational vs Sequential circuits A combinational circuit is one where the output of a gate is never used as an input into it.
    [Show full text]
  • Logic and Bit Operations
    Logic and bit operations • Computers represent information by bits. • A bit has two possible values, namely zero and one. This meaning of the word comes from binary digit, since zeroes and ones are the digits used in binary representations of numbers. The well-known statistician John Tuley introduced this terminology in 1946. (There were several other suggested words for a binary digit, including binit and bigit, that never were widely accepted.) • A bit can be used to represent a truth value, since there are two truth values, true and false. • A variable is called a Boolean variable if its values are either true or false. • Computer bit operations correspond to the logical connectives. We will also use the notation OR, AND and XOR for _ , ^ and exclusive _. • A bit string is a sequence of zero or more bits. The length of the string is the number of bits in the string. 1 • We can extend bit operations to bit strings. We define bitwise OR, bitwise AND and bitwise XOR of two strings of the same length to be the strings that have as their bits the OR, AND and XOR of the corresponding bits in the two strings. • Example: Find the bitwise OR, bitwise AND and bitwise XOR of the bit strings 01101 10110 11000 11101 Solution: The bitwise OR is 11101 11111 The bitwise AND is 01000 10100 and the bitwise XOR is 10101 01011 2 Boolean algebra • The circuits in computers and other electronic devices have inputs, each of which is either a 0 or a 1, and produce outputs that are also 0s and 1s.
    [Show full text]
  • Proofs and Mathematical Reasoning
    Proofs and Mathematical Reasoning University of Birmingham Author: Supervisors: Agata Stefanowicz Joe Kyle Michael Grove September 2014 c University of Birmingham 2014 Contents 1 Introduction 6 2 Mathematical language and symbols 6 2.1 Mathematics is a language . .6 2.2 Greek alphabet . .6 2.3 Symbols . .6 2.4 Words in mathematics . .7 3 What is a proof? 9 3.1 Writer versus reader . .9 3.2 Methods of proofs . .9 3.3 Implications and if and only if statements . 10 4 Direct proof 11 4.1 Description of method . 11 4.2 Hard parts? . 11 4.3 Examples . 11 4.4 Fallacious \proofs" . 15 4.5 Counterexamples . 16 5 Proof by cases 17 5.1 Method . 17 5.2 Hard parts? . 17 5.3 Examples of proof by cases . 17 6 Mathematical Induction 19 6.1 Method . 19 6.2 Versions of induction. 19 6.3 Hard parts? . 20 6.4 Examples of mathematical induction . 20 7 Contradiction 26 7.1 Method . 26 7.2 Hard parts? . 26 7.3 Examples of proof by contradiction . 26 8 Contrapositive 29 8.1 Method . 29 8.2 Hard parts? . 29 8.3 Examples . 29 9 Tips 31 9.1 What common mistakes do students make when trying to present the proofs? . 31 9.2 What are the reasons for mistakes? . 32 9.3 Advice to students for writing good proofs . 32 9.4 Friendly reminder . 32 c University of Birmingham 2014 10 Sets 34 10.1 Basics . 34 10.2 Subsets and power sets . 34 10.3 Cardinality and equality .
    [Show full text]