MATHEMATICAL LOGIC Narrowly Construed, Mathematical Logic Is the Study of Definition and Inference in YIANNIS N
Total Page:16
File Type:pdf, Size:1020Kb
MATHEMATICAL LOGIC Narrowly construed, mathematical logic is the study of definition and inference in YIANNIS N. MOSCHOVAKIS mathematical models of fragments of lan- guage, especially the first order logic frag- ment. Logic has made critical contributions I. Propositional Logic, PL . to the foundations of science, especially L II. First Order Logic, FO . through the work of Kurt G¨odel, and it III. G¨odel’s Incompleteness Theorem. also has numerous applications. For set the- IV. Computability. ory theoretical computer science V. Recursion and Programming. and , these VI. Alternative Logics. applications are so important, that parts VII. Set Theory. of these fields are normally included in the modern, broad conception of the discipline. Glossary I. Propositional Logic, PL Church-Turing Thesis: Claim that ev- ery computable function can be computed Each logic L has a syntax which delin- by a Turing machine. eates the grammatically correct linguistic Computability theory: Study of com- expressions of L, a semantics which assigns putable functions on the natural numbers. meaning to the correct expressions, and a Continuum hypothesis: Conjecture structured system of proofs which specifies that there are only two sizes of infinite sets the rules by which some L-expressions can of real numbers. be inferred from others. Database: Finite, typically relational There are other words to describe these structure. things: formal language is sometimes used First order logic: Mathematical model to describe a plain syntax, formal system of the part of language built up from the pro- often identifies a syntax together with an positional connectives and the quantifiers. inference system (but without an interpre- Incompleteness phenomenon: G¨odel’s tation), and abstract logic has been used to discovery, that sufficiently strong axiomatic refer to a syntax together with an interpreta- theories cannot decide all propositions which tion, leaving inference aside. It is, however, they can express. a fundamental feature of logic that it draws Model theory: Study of formal defin- clean distinctions and studies the connec- ability in first order structures. tions among these three aspects of language. Paradox: Counterintuitive truth. We explain them first in the simplest exam- Peano arithmetic: Axiomatic theory of ple of the “logic of propositions”, which is natural numbers. part of many important logics. Proof theory: Study of inference in for- A. Propositional Syntax mal systems independently of their interpre- tation. The symbols of PL are the connectives Propositional connectives: The lin- ¬ (not) & (and) ∨ (or) guistic constructs “and”, “not”, “or” and “implies”. → (implies, if-then) Quantifiers: The linguistic constructs the two parentheses ‘(’, ‘)’, and an infi- “there exists” and “for all”. nite list of (formal) propositional variables Turing machine: Mathematical model P0, P1, P2,... which intuitively stand for of computing device with unbounded mem- declarative propositions, things like ‘John ory. loves Mary’ or ‘3 is a prime number’. It has Unsolvable problem: A problem whose only one category of grammatically correct solution requires a non-existent algorithm. expressions, the formulas, which are strings 1 2 YIANNIS N. MOSCHOVAKIS (finite sequences) of symbols defined induc- what the truth value of B, so that ‘if the tively by the following conditions: moon is made of cheese, then 1 + 1 = 5’ is F1. Each Pi is a formula. true (on the plausible assumption that the F2. If A and B are formulas, then so are moon is not made of cheese). This material the expressions implication assumed by Propositional Logic has been attacked as counterintuitive, but it ¬A (A & B) (A ∨ B) (A → B) agrees with mathematical practice and it is For example, if P and Q are propositional the only useful interpretation of implication variables, then (P → Q) and (P ∨¬P ) are which accords with the Compositionality formulas, which we read as “if P then Q” Principle. and “either P or not P ”. Using these rules, we can construct for The inductive definition gives a precise each formula A a truth table which tabulates specification of exactly which strings of sym- its truth value under all assignments of truth bols are formulas, and also insures that each values to the variables. For example, the formula is either prime, i.e., just a variable truth table for (Q → P ) consists of the first Pi, or it can be constructed in exactly one three columns of Table 2 while the first two way from its simpler immediate parts, by one of the connectives. This makes it possible to P Q (Q → P ) (P → (Q → P )) prove properties of formulas and to define 1 1 1 1 operations on them by structural induction 1 0 1 1 on their definition. 0 0 1 1 More propositional connectives can be in- 0 1 0 1 troduced as “abbreviations” of formula com- Table 2. binations, e.g., and the last column give the truth table for A ↔ B ≡ ((A → B)&(B → A)) (P → (Q → P )) . A ∨ B ∨ C ≡ (A ∨ (B ∨ C)). If n variables occur in a formula A, then the truth table for A has 2n rows and de- B. Propositional Semantics termines an n-ary bit function vA, with ar- If B stands for some true proposition, guments and values in the two-element set then ¬B is false, independently of the {1, 0}. By the Definitional Completeness “meaning” or internal structure of B. This Theorem, every n-ary bit function is vA for is an instance of a general Compositional- some A, so that the formulas of PL provide ity Principle for PL: The truth value of a definitions (or “symbolic representations”) formula depends only on the truth values for all bit functions. of its immediate parts. The semantics of A formula A is a semantic consequence PL comprise the rules for computing truth of a set of formulas T (or T -valid) if every values, and they can be summarized in Ta- assignment to the variables which satisfies ble 1, where 1 stands for ‘truth’ and 0 for (makes true) all the formulas in T also sat- ‘falsity’. By the first line of this table, for isfies A,. We write A B ¬A (A & B) (A ∨ B) (A → B) T |= A ⇔ A is T -valid, 1 1 0 1 1 1 and |= A, in the important special case when 1 0 0 0 1 0 T is empty, in which case A is called a tau- 0 1 1 0 1 1 tology. A formula A is satisfiable if some 0 0 1 0 0 1 assignment satisfies it, i.e., if ¬A is not a Table 1. Truth value semantics. tautology. Let example, if A and B are both true, then ¬A A ∼ B ⇔ {A} |= B and {B} |= A is false while (A & B), (A ∨ B) and (A → B) ⇔ |= A ↔ B, are all true. Notice that if A is false, then (A → B) is reckoned to be true no matter and call A and B equivalent if A ∼ B. MATHEMATICAL LOGIC 3 Equivalent formulas define the same bit the computation of bit functions by appeal- function, and they can be substituted for ing to the formula representations of the cir- each other without changing truth values. cuits which realize them. For example, using Clearly disjunctive normal forms, one sees immedi- ately that (if we do not care about cost), (A → B) ∼ (¬A ∨ B), every n-ary bit function can be computed by so that the implication connective is super- an unbounded fan-in circuit in no more than fluous. In fact, every formula is equivalent 3 time units. There is, in general, a sub- to one in disjunctive normal form, i.e., a dis- stantial trade-off between the size and time junction A1 ∨···∨ Ak where each Ai is a complexity of the circuits which compute a conjunction of variables or negations of vari- given bit function. ables (literals). D. The Satisfiability Problem C. Applications to Circuits The assertion that “C(A) and C(B) Each formula A with n variables can be never give the same output on the same realized by a switching circuit C(A) with n inputs” means precisely that “(A ↔¬B) is inputs and one output, so that C(Pi) con- a tautology”, so that to detect that A and B sists of just one input-output edge, C(A&B) do not have this safety property we need to is constructed by joining C(A) and C(B) determine whether the formula ¬(A ↔¬B) with an and-gate, etc. Figure 1 exhibits the is satisfiable. Because of such natural formulations P 1 s of “error detection” for circuits relative & - ¬ > s - to given specifications, it is very impor- P ∨ 2 > tant to find efficient algorithms for deter- P 3 mining whether a given formula is satisfi- able. The problem is of non-deterministi- Fig. 1. The circuit for (¬((P1 & P2) ∨ P3). cally polynomial time complexity (NP), be- circuit for ((P1 &P2) → P3) using the equiv- cause it can be resolved by guessing (“non- alent formula without implications, so that deterministically”) some assignment and only ¬-, &- and ∨-gates are required. These then verifying that it satisfies A in a number are restricted circuits, of fan-in (maximum of steps which is bounded by a polynomial number of edges into a node) 2 and fan-out in the length of A; and it is NP-complete, 1, but the Definitional Completeness The- i.e., every NP-problem can be “reduced” to orem implies that every n-ary bit function it by a polynomial reduction. This is a ba- can be computed by some formula circuit sic result of S. Cook, who introduced the C(A). complexity class NP, showed that it con- There are basically two useful measures tains a large number of important problems, of circuit complexity, and both of them are and asked if it coincides with the (seem- faithfully mirrored in formulas.