Download as pdf or txt
Download as pdf or txt
You are on page 1of 39

Discrete Mathematical Structures

Language of Logic

JECRC UDML COLLEGE OF ENGINEERING (DEPARTMENT OF MATHEMATICS)

Notes
Discrete Mathematical Structures
(Subject Code: 4CS3)

Prepared By: Aisha Rafi Class: B. Tech. II Year, IV Semester

Syllabus UNIT 1: Proposition ,compound proposition, conjunction, disjunction, Implication ,converse ,inverse & contra positive ,bioconditional Statement ,tautology, contradiction & contingency, logical Equivalences, quantifiers ,arguments

Prepared by: Aisha Rafi

Page 1

Discrete Mathematical Structures Beyond the Syllabus

Language of Logic

Applications of Logical connectives

Learning Objectives Students will learn about the language of logic

Logical connective
This article is about connectives in logical systems. For connectors in natural languages, see discourse connective. For other logical symbols, see table of logic symbols. In logic, a logical connective (also called a logical operator or a truth function) is a symbol or word used to connect two or more sentences (of either a formal or a natural language) in a grammatically valid way, such that the sense of the compound sentence produced depends only on the original sentences. The most common logical connectives are binary connectives (also called dyadic connectives) which join two sentences which can be thought of as the function's operands. Also commonly, negation is considered to be a unary connective. Logical connectives along with quantifiers are the two main types of logical constants used in formal systems such as propositional logic and predicate logic.

Natural language
Prepared by: Aisha Rafi Page 2

Discrete Mathematical Structures

Language of Logic

In the grammar of natural languages two sentences may be joined by a grammatical conjunction to form a grammatically compound sentence. Some but not all such grammatical conjunctions are truth functions. For example, consider the following sentences: A: Jack went up the hill. B: Jill went up the hill. C: Jack went up the hill and Jill went up the hill. D: Jack went up the hill so Jill went up the hill. The words and and so are grammatical conjunctions joining the sentences (A) and (B) to form the compound sentences (C) and (D). The and in (C) is a logical connective, since the truth of (C) is completely determined by (A) and (B): it would make no sense to affirm (A) and (B) but deny (C). However so in (D) is not a logical connective, since it would be quite reasonable to affirm (A) and (B) but deny (D): perhaps, after all, Jill went up the hill to fetch a pail of water, not because Jack had gone up the hill at all. Various English words and word pairs express logical connectives, and some of them are synonymous. Examples (with the name of the relationship in parentheses) are:

"and" (conjunction) "or" (disjunction) "either...or" (exclusive disjunction) "implies" (implication) "if...then" (implication) "if and only if" (equivalence) "only if" (implication) "just in case" (equivalence) "but" (conjunction) "however" (conjunction) "not both" (NAND) "neither...nor" (NOR)

The word "not" (negation) and the phrases "it is false that" (negation) and "it is not the case that" (negation) also express a logical connective even though they are applied to a single statement, and do not connect two statements.

Formal languages
In formal languages, truth functions are represented by unambiguous symbols. These symbols are called "logical connectives", "logical operators", "propositional operators", or, in classical logic, "truth-functional connectives". See well-formed formula for the rules which allow new wellPrepared by: Aisha Rafi Page 3

Discrete Mathematical Structures

Language of Logic

formed formulas to be constructed by joining other well-formed formulas using truth-functional connectives. Logical connectives can be used to link more than two statements, so one can speak about "n-ary logical connective". Common logical connectives Name / Symbol Truth/Tautology Proposition P False/Contradiction Negation Binary connectives Truth table Venn P = 0 1 diagram 1 0 0 1 1 1 0 0

P= 0011 Q= 0101

Conjunction Alternative denial Disjunction Joint denial

0001 1110 0111 1000 1101 0110

Material conditional Exclusive or Biconditional

1001 1011 0011 0101

Converse implication Proposition P Proposition Q M ore

i nform at i on

Prepared by: Aisha Rafi

Page 4

Discrete Mathematical Structures

Language of Logic

List of common logical connectives


Commonly used logical connectives include:

Negation (not): , Np, ~ Conjunction (and): , Kpq, &, Disjunction (or): , Apq Material implication (if...then): , Cpq, , Biconditional (if and only if): , Epq, ,

Alternative names for biconditional are "iff", "xnor" and "bi-implication". For example, the meaning of the statements it is raining and I am indoors is transformed when the two are combined with logical connectives:

It is raining and I am indoors (P Q) If it is raining, then I am indoors (P Q) If I am indoors, then it is raining (Q P) I am indoors if and only if it is raining (P It is not raining (P)

Q)

For statement P = It is raining and Q = I am indoors. It is also common to consider the always true formula and the always false formula to be connective:

Negation.

True formula (, 1, Vpq, or T) False formula (, 0, Opq, or F)

In logic and mathematics, negation, also called logical complement, is a unary logical connective. It is an operation on propositions, truth values, or semantic values more generally. Intuitively, the negation of a proposition is true when that proposition is false, and vice versa. In classical logic negation is normally identified with the truth function that takes truth to falsity and vice versa. In intuitionistic logic, according to the BrouwerHeyting Kolmogorov interpretation, the negation of a proposition p is the proposition whose proofs are the refutations of p. In Kripke semantics where the semantic values of formulae are sets of possible worlds, negation is settheoretic complementation.

Definition Classical negation is an operation on one logical value, typically the value of a proposition, that produces a value of true when its operand is false and a value of false when its operand is true. So, if statement A is true, then A

Prepared by: Aisha Rafi

Page 5

Discrete Mathematical Structures

Language of Logic

(pronounced "not A") would therefore be false; and conversely, if A is true, then A would be false. The truth table of p is as follows: Truth table of p p p True False False True Classical negation can be defined in terms of other logical operations. For example, p can be defined as p F, where "" is logical consequence and F is absolute falsehood. Conversely, one can define F as p & p for any proposition p, where "&" is logical conjunction. The idea here is that any contradiction is false. While these ideas work in both classical and intuitionistic logic, they do not work in Brazilian logic, where contradictions are not necessarily false. But in classical logic, we get a further identity: p q can be defined as p q, where "" is logical disjunction: "not p, or q". Algebraically, classical negation corresponds to complementation in a Boolean algebra, and intuitionistic negation to pseudocomplementation in a Heyting algebra. These algebras provide a semantics for classical and intuitionistic logic respectively. Notation The negation of a proposition p is notated in different ways in various contexts of discussion and fields of application. Among these variants are the following: Notation Vocalization p not p p not p ~p not p Np en p p prime, p complement p bar, bar p bang p not p In Set Theory \ is also used to indicate 'not member of': U \ A is the set of all members of U that are not members of A.

Prepared by: Aisha Rafi

Page 6

Discrete Mathematical Structures

Language of Logic

No No matter matter how how it it is is notated notated or or symbolized, symbolized, the the negation negation p / / p can can be be read read as as "it "it is is not not the the case case that that p", ", "not "not that that p", ", or or usually usually more more simply simply (though (though not not grammatically) grammatically) as as "not "not p" " Distributivity De De Morgan's Morgan's laws laws provide provide a a way way of of distributing distributing negation negation over over conjunction conjunction and and disjunction: disjunction: , , and and . . Linearity In In Boolean Boolean algebra, algebra, a a linear linear function function is is one one such such that: that: If If there there exists exists a a0 ,a a1 , ..., ..., a an {0,1} {0,1} such such that that f(b f(b1 , ..., ..., b bn )= =a a0 0, 1, n 1, n) 0 (a1 (an bn), for all b1, ..., bn {0,1}. b1) ...

Another way to express this is that each variable always makes a difference in the truth-value of the operation or it never makes a difference. Negation is a linear logical operator. Self dual In Boolean algebra a self dual function is one such that: f(a1, ..., an) = ~f(~a1, ..., ~an) for all a1, ..., an logical operator. Rules of inference There are a number of equivalent ways to formulate rules for negation. One usual way to formulate classical negation in a natural deduction setting is to take as primitive rules of inference negation introduction (from a derivation of p to both q and q, infer p; this rule also being called reductio ad absurdum), negation elimination (from p and p infer q; this rule also being called ex falso quodlibet), and double negation elimination (from p infer p). One obtains the rules for intuitionistic negation the same way but by excluding double negation elimination. Negation introduction states that if an absurdity can be drawn as conclusion from p then p must not be the case (i.e. p is false (classically) or refutable (intuitionistically) or etc.). Negation elimination states that anything follows from an absurdity. Sometimes negation elimination is formulated using a primitive absurdity sign . In this case the rule says that from p and p follows an absurdity. Together with double negation elimination one may {0,1}. Negation is a self dual

Prepared by: Aisha Rafi

Page 7

Discrete Mathematical Structures

Language of Logic

infer our originally formulated rule, namely that anything follows from an absurdity. Typically the intuitionistic negation p of p is defined as p . Then negation introduction and elimination are just special cases of implication introduction (conditional proof) and elimination (modus ponens). In this case one must also add as a primitive rule ex falso quodlibet.

Logical conjunction

" " redirects here. For the logic gate, see AND gate. For exterior product, see Exterior algebra.

Venn diagram of

Venn diagram of In logic and mathematics, a two-place logical operator and, also known as logical conjunction[1], results in true if both of its operands are true, otherwise the value of false. The analogue of conjunction for a (possibly infinite) family of statements is universal quantification, which is part of predicate logic. Notation
Prepared by: Aisha Rafi Page 8

Discrete Mathematical Structures

Language of Logic

And is usually expressed with the prefix operator K, or an infix operator. In mathematics and logic, the infix operator is usually ; in electronics ; and in programming languages, & or and. Some programming languages have a related control structure, the short-circuit and, written &&, and then, etc. Definition Logical conjunction is an operation on two logical values, typically the values of two propositions, that produces a value of true if and only if both of its operands are true. The conjunctive identity is 1, which is to say that AND-ing an expression with 1 will never change the value of the expression. In keeping with the concept of vacuous truth, when conjunction is defined as an operator or function of arbitrary arity, the empty conjunction (AND-ing over an empty set of operands) is often defined as having the result 1.

The truth table of INPUT OUTPUT A B T T F F T F T F A B T F F F

Properties commutativity: yes

associativity: yes

Prepared by: Aisha Rafi

Page 9

Discrete Mathematical Structures

Language of Logic

distributivity: with various operations, especially with or

[show]others idempotency: yes

monotonicity: yes

truth-preserving: yes When all inputs are true, the output is true.

(to be tested) falsehood-preserving: yes When all inputs are false, the output is false.

(to be tested) Walsh spectrum: (1,-1,-1,1) Nonlinearity: 1 (the function is bent)


Prepared by: Aisha Rafi Page 10

Discrete Mathematical Structures

Language of Logic

If using binary values for true (1) and false (0), then logical conjunction works exactly like normal arithmetic multiplication.

Logical disjunction
"Disjunction" redirects here. For the logic gate, see OR gate. For separation of chromosomes, see Meiosis. For disjunctions in distribution, see Disjunct distribution.

Venn diagram of

Venn diagram of In logic and mathematics, or is a truth-functional operator also known as (inclusive) disjunction and alternation. The logical connective that represents this operator is also known as "or", and typically written as or . The "or" operator produces a result of true whenever one or more of its operands are true. For example, in this context, "A or B" is true if A is true, or if B is true, or if both A and B are true. In grammar, or is a coordinating conjunction. The "or" operator differs from the exclusive or in that the latter returns False when both of its inputs are true, while "or" returns True. In ordinary language, outside of contexts such as formal logic, mathematics and
Prepared by: Aisha Rafi Page 11

Discrete Mathematical Structures

Language of Logic

programming, "or" sometimes has the meaning of "exclusive or". For example, "Please ring me or send an email" likely means "do one or the other, but not both". On the other hand, "Her grades are so good that she's either very bright or studies hard" allows for the possibility that the person is both bright and works hard. In other words, in ordinary language "or" can mean inclusive or exclusive or. Usually the intended meaning is clear from the context. Notation Or is usually expressed with the prefix operator A, or with an infix operator. In mathematics and logic, the infix operator is usually ; in electronics, +; and in programming languages, | or or. Some programming languages have a related control structure, the short-circuit or, written ||, or else, etc. Definition Logical disjunction is an operation on two logical values, typically the values of two propositions, that produces a value of false if and only if both of its operands are false. More generally a disjunction is a logical formula that can have one or more literals separated only by ORs. A single literal is often considered to be a degenerate disjunction. The disjunctive identity is 0, which is to say that OR-ing an expression with 0 will never change the value of the expression. In keeping with the concept of vacuous truth, when disjunction is defined as an operator or function of arbitrary arity, the empty disjunction (OR-ing over an empty set of operands) is often defined as having the result 0. Truth table Disjunctions of the arguments on the left The false bits form a Sierpinski triangle The truth table of INPUT OUTPUT A B 0 0 1 1 0 1 0 1 A OR B 0 1 1 1 :

Prepared by: Aisha Rafi

Page 12

Discrete Mathematical Structures Properties commutativity: yes

Language of Logic

associativity: yes

distributivity: with various operations, especially with and

[show]others idempotency: yes

monotonicity: yes

truth-preserving: yes When all inputs are true, the output is true.
Prepared by: Aisha Rafi Page 13

Discrete Mathematical Structures

Language of Logic

(to be tested) falsehood-preserving: yes When all inputs are false, the output is false.

(to be tested) Walsh spectrum: (3,-1,-1,-1) Nonlinearity: 1 (the function is bent) If using binary values for true (1) and false (0), then logical disjunction works almost like binary addition. The only difference is that while . Symbol The mathematical symbol for logical disjunction varies in the literature. In addition to the word "or", and the formula "Apq", the symbol " ", deriving from the Latin word vel for "or", is commonly used for disjunction. For example: "A B " is read as "A or B ". Such a disjunction is false if both A and B are false. In all other cases it is true. All of the following are disjunctions: ,

The corresponding operation in set theory is the set-theoretic union.

Material conditional

Prepared by: Aisha Rafi

Page 14

Discrete Mathematical Structures

Language of Logic

A material conditional (also known as "material implication", "material consequence", or simply "implication") is a logical connective often symbolized by a forward arrow "". A single statement formed from the connection of two, for instance "pq" (called a conditional statement) is typically interpreted as "If p, then q" or "q if p". The material implication between two sentences p, q is typically symbolized as 1. 2. 3. ; ; (Although this symbol is often used for logical consequence (i.e. logical implication) rather than for material implication.)

As placed within the material conditionals above, p is known as the antecedent, and q as the consequent, of the conditional. One can also use compounds as components, for example pq (rs). There, the compound pq (short for "p and q") is the antecedent, and the compound rs is the consequent, of the larger conditional of which those compounds are components. Implication is a form of logical consequence. For instance, in an argument such as "Fred is Mike's brother's son. Therefore Fred is Mike's nephew" the statement "Fred is Mike's nephew." is a material consequence of "Fred is Mike's brother's son," not a formal consequence. The validity of the argument depends on the the meanings of the words "Fred," "Mike," "brother," "son," and "nephew," not the logical form of the argument. [1] In classical logic, the compound pq is equivalent to the negative compound: not (both p and not q). In everyday English, saying "It is false that if p then q" is not often taken as flatly equivalent to saying "p is true and q is false" but, when used within classical logic, those phrasings are taken as logically equivalent. (Other senses of English "if...then..." require other logical forms.) Definitions of the material conditional Logicians have many different views on the nature of material implication and approaches to explain its sense.[2] As a truth function In classical logic, the compound pq is logically equivalent to the negative compound: not both p and not q. Thus the compound pq is false if and only if both p is true and q is false. By the same stroke, pq is true if and only if either p is false or q is true (or both). Thus is a function from pairs of truth values of the components p, q to truth values of the compound pq, whose truth value is entirely a function of the truth values of the components. Hence, the compound pq is called truth-functional. The compound pq is logically equivalent also to p q (either not p, or q (or both)), and to q p (if not q then not p). But it is not equivalent to p q, which is equivalent to qp.
Prepared by: Aisha Rafi Page 15

Discrete Mathematical Structures Truth table

Language of Logic

The truth table associated with the material conditional not p or q (symbolized as p q) and the logical implication p implies q (symbolized as p q, or Cpq) is as follows: p T T F F q pq T F T F T F T T

As a formal connective The material conditional can be considered as a symbol of a formal theory, taken as a set of sentences, satisfying all the classical inferences involving , in particular the following characteristic rules: 1. 2. 3. 4. Modus ponens; Conditional proof; Classical contraposition; Classical reductio.

Unlike truth-functional one, this approach to logical connectives permits the examination of structurally identical propositional forms in various logical systems, where somewhat different properties may be demonstrated. For example, in intuitionistic logic which rejects proofs by contraposition as valid rules of inference, (pq) p q is not a propositional theorem, but the material conditional is used to define negation. Other properties of implication (following expressions are always true, for any logical values of variables):

distributivity: transitivity: reflexivity: truth preserving: The interpretation under which all variables are assigned a truth value of 'true' produces a truth value of 'true' as a result of material implication.

Prepared by: Aisha Rafi

Page 16

Discrete Mathematical Structures

Language of Logic

commutativity of antecedents:

Note that is logically equivalent to ; this property is sometimes called currying. Because of these properties, it is convenient to adopt a right-associative notation for where denotes .

Note also that comparison of truth table shows that is equivalent to , and it is sometimes convenient to replace one by the other in proofs. Such a replacement can be viewed as a rule of inference.

Logical biconditional
In logic and mathematics, the logical biconditional (sometimes known as the material biconditional) is the logical connective of two statements asserting "p if and only if q", where q is a hypothesis (or antecedent) and p is a conclusion (or consequent).[1] This is often abbreviated p iff q. The operator is denoted using a doubleheaded arrow (), a prefixed E (Epq), an equality sign (=), an equivalence sign (), or EQV. It is logically equivalent to (p q) (q p), or the XNOR (exclusive nor) boolean operator. It is equivalent to "(not p or q) and (not q or p)". It is also logically equivalent to "(p and q) or (not p and not q)", meaning "both or neither". The only difference from material conditional is the case when the hypothesis is false but the conclusion is true. In that case, in the conditional, the result is true, yet in the biconditional the result is false. In the conceptual interpretation, a = b means "All a 's are b 's and all b 's are a 's"; in other words, the sets a and b coincide: they are identical. This does not mean that the concepts have the same meaning. Examples: "triangle" and "trilateral", "equiangular triangle" and "equilateral triangle". The antecedent is the subject and the consequent is the predicate of a universal affirmative proposition. In the propositional interpretation, a b means that a implies b and b implies a; in other words, that the propositions are equivalent, that is to say, either true or false at the same time. This does not mean that they have the same meaning. Example: "The triangle ABC has two equal sides", and "The triangle ABC has two equal angles". The antecedent is the premise or the cause and the consequent is the consequence. When an implication is translated by a hypothetical (or conditional) judgment the antecedent is called the hypothesis (or the condition) and the consequent is called the thesis. A common way of demonstrating a biconditional is to use its equivalence to the conjunction of two converse conditionals, demonstrating these separately.
Prepared by: Aisha Rafi Page 17

Discrete Mathematical Structures

Language of Logic

When both members of the biconditional are propositions, it can be separated into two conditionals, of which one is called a theorem and the other its reciprocal. Thus whenever a theorem and its reciprocal are true we have a biconditional. A simple theorem gives rise to an implication whose antecedent is the hypothesis and whose consequent is the thesis of the theorem. It is often said that the hypothesis is the sufficient condition of the thesis, and the thesis the necessary condition of the hypothesis; that is to say, it is sufficient that the hypothesis be true for the thesis to be true; while it is necessary that the thesis be true for the hypothesis to be true also. When a theorem and its reciprocal are true we say that its hypothesis is the necessary and sufficient condition of the thesis; that is to say, that it is at the same time both cause and consequence. Definition Logical equality (also known as biconditional) is an operation on two logical values, typically the values of two propositions, that produces a value of true if and only if both operands are false or both operands are true. Truth table The truth table for follows: INPUT OUTPUT A B 0 0 1 1 0 1 0 1 A 1 0 0 1 B (also written as A B, A = B, or A EQ B) is as

More than two statements combined by

are ambiguous:

may be meant as ,

Prepared by: Aisha Rafi

Page 18

Discrete Mathematical Structures or may be used to say that all

Language of Logic

are together true or together false:

Only for zero or two arguments this is the same. The following truth tables show the same bit pattern only in the line with no argument and in the lines with two arguments:

meant as equivalent to

The central Venn diagram below, and line (ABC ) in this matrix represent the same operation.

meant as shorthand for

Properties commutativity: yes

associativity: yes

distributivity: Biconditional doesn't distribute over any binary function (not even itself), but logical disjunction (see there) distributes over biconditional.
Prepared by: Aisha Rafi Page 19

Discrete Mathematical Structures idempotency: no

Language of Logic

monotonicity: no

truth-preserving: yes When all inputs are true, the output is true.

falsehood-preserving: no When all inputs are false, the output is not false.

Rules of Inference Like all connectives in first-order logic, the biconditional has rules of inference that govern its use in formal proofs. Biconditional Introduction Biconditional introduction allows you to infer that, if B follows from A, and A follows from B, then A if and only if B. For example, from the statements "if I'm breathing, then I'm alive" and "if I'm alive, then I'm breathing", it can be inferred that "I'm breathing if and
Prepared by: Aisha Rafi Page 20

Discrete Mathematical Structures

Language of Logic

only if I'm alive" or, equally inferrable, "I'm alive if and only if I'm breathing." BA AB AB

BA AB BA

Tautology
The word tautology was used by the ancient Greeks to describe a statement that was true merely by virtue of saying the same thing twice, a pejorative meaning that is still used for rhetorical tautologies. Between 1800 and 1940, the word gained new meaning in logic, and is currently used in mathematical logic to denote a certain type of propositional formula, without the pejorative connotations it originally possessed. In 1800, Immanuel Kant wrote in his book Logic: "The identity of concepts in analytical judgments can be either explicit (explicita) or non-explicit (implicita). In the former case analytic propositions are tautological." Here analytic proposition refers to an analytic truth, a statement in natural language that is true solely because of the terms involved. In 1884, Gottlob Frege proposed in his Grundlagen that a truth is analytic exactly if it can be derived using logic. But he maintained a distinction between analytic truths (those true based only on the meanings of their terms) and tautologies (statements devoid of content).

In 1921, in his Tractatus Logico-Philosophicus, Ludwig Wittgenstein proposed that statements that can be deduced by logical deduction are tautological (empty of meaning) as well as being analytic truths. Henri Poincar had made similar remarks in Science and Hypothesis in 1905. Although Bertrand Russell at first argued against these remarks by Wittgenstein and Poincar, claiming that mathematical truths were not only non-tautologous but were synthetic, he later spoke in favor of them in 1918: "Everything that is a proposition of logic has got to be in some sense or the other like a tautology. It has got to be something that has some peculiar quality, which I do not know how to define, that belongs to logical propositions but not to others."
Prepared by: Aisha Rafi Page 21

Discrete Mathematical Structures

Language of Logic

Here logical proposition refers to a proposition that is provable using the laws of logic. During the 1930s, the formalization of the semantics of propositional logic in terms of truth assignments was developed. The term tautology began to be applied to those propositional formulas that are true regardless of the truth or falsity of their propositional variables. Some early books on logic (such as Symbolic Logic by C. I. Lewis and Langford, 1932) used the term for any proposition (in any formal logic) that is universally valid. It is common in presentations after this (such as Stephen Kleene 1967 and Herbert Enderton 2002) to use tautology to refer to a logically valid propositional formula, but to maintain a distinction between tautology and logically valid in the context of firstorder logic (see below).

Definition and examples A formula of propositional logic is a tautology if the formula itself is always true regardless of which valuation is used for the propositional variables. There are infinitely many tautologies. Examples include: ("A or not A"), the law of the excluded middle. This formula has only one propositional variable, A. Any valuation for this formula must, by definition, assign A one of the truth values true or false, and assign A the other truth value.

("if A implies B then not-B implies not-A", and vice versa), which expresses the law of contraposition. ("if not-A implies both B and its negation not-B, then not-A must be false, then A must be true"), which is the principle known as reductio ad absurdum. ("if not both A and B, then either not-A or notB", and vice versa), which is known as de Morgan's law. ("if A implies B and B implies C, then A implies C"), which is the principle known as syllogism. (if at least one of A or B is true, and each implies C, then C must be true as well), which is the principle known as proof by cases.

A minimal tautology is a tautology that is not the instance of a shorter tautology.

is a tautology, but not a minimal one, because it is an instantiation of .

Verifying tautologies
Prepared by: Aisha Rafi Page 22

Discrete Mathematical Structures

Language of Logic

The problem of determining whether a formula is a tautology is fundamental in propositional logic. If there are n variables occurring in a formula then there are 2n distinct valuations for the formula. Therefore the task of determining whether or not the formula is a tautology is a finite, mechanical one: one need only evaluate the truth value of the formula under each of its possible valuations. One algorithmic method for verifying that every valuation causes this sentence to be true is to make a truth table that includes every possible valuation. For example, consider the formula

There are 8 possible valuations for the propositional variables A, B, C, represented by the first three columns of the following table. The remaining columns show the truth of subformulas of the formula above, culminating in a column showing the truth value of the original formula under each valuation. ABC TTT TTF TFT TFF FTT FTF FFT FFF T T F F F F F F T F T T T T T T T F T T T F T T T F T T T T T T T T T T T T T T

Because each row of the final column shows T, the sentence in question is verified to be a tautology.

Contradictions
There are other propositional forms with only false substitution instances no matter what propositions you substitute for the propositional variables, you will always get a
Prepared by: Aisha Rafi Page 23

Discrete Mathematical Structures

Language of Logic

false proposition as a result. These propositional forms are called contradictions. Again recall the example of such a proposition: p p Again, it does not matter whether you substitute a true proposition or a false proposition for p, the resulting proposition will be false Definition Contradictions are propositional forms all of whose substitution instances are false.

Contingencies
Finally, there are propositional forms that do not determine the truth-value of their substitution instances they are called contingencies. When a proposition that has the propositional form of a contingency is true, the proposition is said to be contingently true, when such a proposition is false, it is said to be contingently false. Consider the following propositional form:~p Depending on whether you substitute a false or a true proposition for p, the resulting proposition will be true or false, respectively Definition Contingencies are those propositional forms some of whose substitution instances are true and some of whose substitution instances are false 4. Truth-Table Definitions of a Tautology, a Contradiction, a Contingency Logicians have invented the truth-table method for checking whether a propositional form is tautologous, contradictory or contingent. Truth tables for propositional forms allow to determine all the possible truth-values that the substitution instances of those forms can have. A propositional form that is true in all rows of its truth table is a tautology. A propositional form that is false in all rows of its truth table is a contradiction. A propositional form that is true in at least one row of its truth table and false in at
Prepared by: Aisha Rafi Page 24

Discrete Mathematical Structures least one row of its truth table is a contingency.

Language of Logic

Lets consider an example of a contingency: p (p q). Now note, however, that there are two propositional variables in that propositional form, viz. p and q. We thus need to consider more possibilities in fact, four of truth-value assignments for variables p and q:

The propositional form p (p q) is a contingency because there are at least one row (in fact there are two such rows rows 1 and 2) where it is true, and there is at least one row in fact there are two such rows rows 3 and 4) where it is false

Logically equivalent
Two sentences are Logically Equivalent if and only if they are true in precisely the same situations. Another way to think of a pair of logically equivalent sentences is as two sentences that say the exact same thing. If one of them is true, the other is true; if one of them is false, the other is false.
Prepared by: Aisha Rafi Page 25

Discrete Mathematical Structures

Language of Logic

The notion of logical equivalence can be broadened to apply to collections of sentences of any size (not just pairs). [edit] Truth Table Test for Logical Equivalence The easiest way to test whether two sentences are logically equivalent is to make a truth-table for the sentences in question. Once you fill out the truthtable for the sentences, you look at the column under the main connective of each sentence. The two sentences are logically equivalent exactly when the column under the main connective of the first sentence is identical to the column under the main connective of the second sentence. Notice that this captures in a formal way the informal idea that two sentences are logically equivalent just in case they are either both true or both false in any given situation. [edit] Examples The sentences (A B) and (A B) are logically equivalent, as the following truth-table shows: A B (A B) (A B)

T T

F F

T F

F F

F T F F

F F

T T

The sentences (A B) and (A B) are also logically equivalent, as the following truth-table shows: A B (A B) (A B)

T T

F F

T F

T T

F T T T

F F

T T

Prepared by: Aisha Rafi

Page 26

Discrete Mathematical Structures

Language of Logic

The sentences (PQ) and (QP) are not logically equivalent, as the following truth-table demonstrates:

Q (PQ) (QP)

T T

T T

T F

F T

F T T F

F F

T T

Quantifiers
The words in italics are quantifiers. There exists no simple way of reformulating any one of these expressions as a conjunction or disjunction of sentences, each a simple predicate of an individual such as That wine glass was chipped. These examples also suggest that the construction of quantified expressions in natural language can be syntactically very complicated. Fortunately, for mathematical assertions, the quantification process is syntactically more straightforward There are two quantifiers, the universal quantifier and the existential quantifier. The traditional symbol for the universal quantifier is " ", an inverted letter "A", which stands for "for all" or "all". The corresponding symbol for the existential quantifier is " ", a rotated letter "E", which stands for "there exists" or "exists". An example of quantifying an English statement would be as follows. Given the statement, "All of Peters friends either like to dance or like to go to the beach", we can identify key aspects and rewrite using symbols including quantifiers. So, let x be any one particular friend of Peter, X the set of all Peter's friends, P(x) be the predicate (mathematical logic) "x likes to dance", and lastly Q(x) the predicate "x likes to go to the beach". Then we have, : . Which is read, "for all x that's a member of X, P of x or Q of x." Some other quantified expressions are constructed as follows,

for a formula P. Variant notations include, for set

Prepared by: Aisha Rafi

Page 27

Discrete Mathematical Structures

Language of Logic

X and set members x All of these variations also apply to universal quantification. Other variations for the universal quantifier are

Equivalent Expressions If X is a domain of x and P(x) is a predicate dependent on x, then the universal proposition is expressed in Boolean algebra terms as

which equivalently reads "if x is in X, then P(x) is true." If x is not in X, then P(x) is indeterminate. Note that the truth of the expression requires only that x be in X, so it can be any x in X, independent of P(x), whereas the falsity of the expression, or the truth of

additionally requires that x be such that P(x) evaluates to false; this is the reason behind calling x a "bound variable." This last expression can thus be read as "for some x in X, P(x) is false," or "there exists an x in X such that P(x) is false." So, we now have the equivalent Boolean expression for the existential proposition:

Thus, together with negation, only one of either the universal or existential quantifier is needed to perform both tasks:

which shows that to disprove a "for all x" proposition, one needs no more than to find an x for which the predicate is false. Similarly,

to disprove a "there exists an x" proposition, one needs to show that the predicate is false for all x.

Various Normal Forms


Disjunctive Normal Forms Conjunctive Normal Forms
Prepared by: Aisha Rafi Page 28

Discrete Mathematical Structures

Language of Logic

Principal Disjunctive Normal Forms Principal Conjunctive Normal Forms VARIOUS NORMAL FORMS
In this section you will know about four kinds of normal forms i.e. Disjunctive, Conjunctive, principal Disjunctive & Principal Conjunctive normal forms. Disjunctive Normal Forms We shall use the words 'product' and 'sum' in place of the logical connectives 'conjunction' and 'disjuncdon' respectively. Before defining what is called 'disjunctive normal forms' we first introduce some other concepts needed in the sequel. In a formula, a product of the variables and their negations is called an elementary product. Similarly a sum of the variables and their negations is called an elementary sum. Let P and Q be any two variables. Then P., P Q, Q P P, P P, Q P are some examples of elementary products; and P, P Q, Q P P, P P , Q P are examples of elementary sums of two variables. A part of the elementary sum or product which is itself an elementary sum Or product is called a factor of the Original sum Or Product The elementary sums or products satisfy the following properties. We only state them without proof. 1. An elementary product is identically false if and only if it contains at least one pair of factors in which one is the negation of the other. 2. An elementary sum is identically true if and only if it contains atleast one pair of factors in which one is the negation of the other. We now discuss some examples.

Prepared by: Aisha Rafi

Page 29

Discrete Mathematical Structures

Language of Logic

It should be noted that the disjunctive normal form of a given formula is not unique. For example, consider P ( Q R ). This is already in disjunctive normal form. We can write P(QR) (PQ)(PR) (PP)(PQ)(PR)(QP) zaand this is another equivalent normal form. In subsequent sections we introduce the concepts of Principal normal forms which give unique normal form of a given formula. Conjunctive Normal Forms A formula which consists of a product of elementary sums and is equivalent to a given formula is called a conjunctive normal form of the given formula.

Principal Disjunctive Normal Forms For two Statement variables P and Q, construct all possible formulas which consist of Conjunctions of P or its negation and conjunctions of Q or its negation such that none of the formulas contain both a variable and its negation. Note that any formula which is obtained by commuting the formulas in the conduction should not be included in the list because any such formula will be equivalent to one included in the list. For example, any one of P Q or Q P is included in the list, but not the both. For two variables P and Q, there are 22 = 4 formulas included in the list these are given by P Q, P Q, P Q, P Q.
Page 30

Prepared by: Aisha Rafi

Discrete Mathematical Structures

Language of Logic

These formulas are called minterms. One can construct truth table and observe that no two minterms are equivalent. The truth table is given below :

PQ P Q TT T TF F FT F FF F

PQ F T F F

PQ F F T F

PQ F F F T

Given one formula, an equivalent formula, consisting of disjunctions of minterrns only is known as its Principal Disjunctive normal, form or sum-ofproducts canonical form.

Principal Conjunctive Normal Forms

Given a number of variables, maxterm of these variables is a formula which consists of disjunctions in which each variable or its negation but not both appear only once. Observe that the maxterms are the duals of minterms. Note that each of the minterms has the truth value T for exactly one combination of the truth values of the variables and this fact can be seen from truth table. Therefore each of the maxterms has the truth value F for exactly one combination of the truth values of the variables. This fact can be derived from the duality principle (using the properties of minterms) or can be directly obtained from truth table.

For a given formula, an equivalent formula consisting of conductions of the maxterms only is known as its principal conjunctive normal form or the product-of-sums canonical form.

Prepared by: Aisha Rafi

Page 31

Discrete Mathematical Structures

Language of Logic

VALID INFERENCE USING TRUTH TABLES AND DIRECT METHOD OF PROOF Let A and B two statement formulas. It is said that 'B follows from A' or 'B is a conclusion of the premise A' or 'B is a consequence of the premise A' iff A B is a tautology. Let { A1, A2, ...... An } be a set of formulas. It is said that a conclusion B follows from the set of premises { A1, A2, ...... An } iff A1 A2 .... An B is a tautology. Given a set of premises and a conclusion, it is possible, by using truth table, to know whether the conclusion follows from the given premises. But this methods becomes tedious and time consuming when the number of variables present in all the formulas representing premises and conclusion are large. Also there are situations where truth table technique is no longer available. Because of these facts other methods have been developed and we discuss them in following sections. RULES OF INFERENCE ( RULES P AND T) We shall describe the method by which one derives that a formula is a consequence of a set of given Premises ( also called hypotheses ). We first quote two rules of inference called the rules P and T.
Prepared by: Aisha Rafi Page 32

Discrete Mathematical Structures

Language of Logic

Rule P : A premise may be introduced at any point of the derivation.

Rule T : A formula S may be introduced in a derivation if S is tautologically implied by any, one or more of the proceeding formulas in the derivation.

We now, list some important implications and equivalences which will be used in the derivations. All the implications and equivalences which will be listed now, are not independent of each other; some of them can be derived from some others. So one could start with minimum number of them. but we will not follow such an axiomatic scheme in this introductory text. Some of these were also listed earlier while discussing implications.

Implications

3.4.2 Equivalences

Prepared by: Aisha Rafi

Page 33

Discrete Mathematical Structures

Language of Logic

Prepared by: Aisha Rafi

Page 34

Discrete Mathematical Structures

Language of Logic

CONSISTENCY OF PREMISES AND INDIRECT METHOD OF PROOF If R is any formula, note that R R is a contradiction. A set of formulas A1, A2, ...., Am. is said to be consistent if their conjunction has the truth value T for some assignment of the truth values to the atomic variables appearing in the formulas A1, A2, ...., Am. Otherwise the formulas are called inconsistent. In otherwords, A1, A2, ...., Am are said to be inconsistent if for every assignment of the truth values to the atomic variables, atleast one of the formulas A1, A2, ...., Am is false, i.e. their conjuction is identically false.
Prepared by: Aisha Rafi Page 35

Discrete Mathematical Structures

Language of Logic

To be precise, a set of formulas A1, A2, ...., Am is consistent if their conjuction is a contradiction, i.e. if A1 A2 .... Am where R is any formula. The notion of inconsistency is used in a procedure called 'proof by contradiction or reductio ad absurdum or indirect method of proof'. In order to prove that a conclusion C follows from a set of premises A1, A2, ...., Am by using the method 'proof by contradiction' the procedure is as follows : Assume that C is false and consider C as an additional premise. If the new set of premises C, A1, A2, ...., Am is inconsistent, they imply a contradiction, then the assumption that C is true does not hold simultaneously with A1 A2 ..... Am being true. Therefore C is true whenever A1 A2 ..... Am is true. Thus the conclusion C follows from the premises A1, A2, ...., Am. Proof by contradiction is sometimes very much convenient. But if required, it can be eliminated and replaced by another method, called a conditional proof (CP) ). To demonstrate this observe that 'P(QQ)'P In the proof by contradiction we show A1, A2, ...., Am C by showing A1, A2, ...., Am, C R P Now this can be converted to the following by using rule CP A1, A2, ...., Am C ( R R ) ..... (2) ..... (1) RR

From (1) and (2) by using the rule of double negation one can prove that A1, A2, ...., Am C and this is the required derivation.

AUTOMATIC PROVING OF THEOREMS In this section we reformulate the rules of inference theory for statement calculus and describe a procedure of derivation which can be conducted mechanically.
Prepared by: Aisha Rafi Page 36

Discrete Mathematical Structures

Language of Logic

Before describing this procedure, we first discuss some of the shortcomings of the procedure used in the earlier section. We shall then describe a set of 10 rules an axiom schema and rules for sequents. First of all observe that rule P permits the introduction of a premise at any point in the derivation, but it does not suggest either the Premises or the step at which it should introduced. Similarly Rule T allows us to introduce any formula which follows from the previous steps, but it does not suggest any definite choice of such a formula nor there is any guidance for the use of any particular equivalence. Similarly Rule CP does not tell anything about the stages at which an antecedent is to be introduced as an additional premise, nor does it indicate the stage at which it is again incorporated into the conditional. At every step, such decisions are taken from a large number of alternatives, with the ultimate aim of reaching the conclusion. We now describe our system which is given as follows : Variables The capital letters Of English alphabet A, B, C, ..... P, Q, R, ..... will be used to denote the statement variables. They are also used to represent the statement formulas, but these notations will be clear from the context Connectives The connectives , , , , appear in the formulas with the order of precedence as given above. String Of Formulas A string of formulas is defined as follows : i) any formula is a string of formulas,

ii) if a and b are string of formulas, then ( a , b and b , a are strings of formulas, iii) only those strings which are obtained from steps (i) and (ii) are strings of formulas; with the exception of the empty string which is also a string of formulas.

The order in which the formulas appear in a string is not important; the strings A, B, C; B, C, A; A, C, B etc. are the Same. Sequents If a and b are strings of formulas then a b is called a sequent in which a is the antecedent and b the consequent of the sequent. A sequent is true if either atleast one of the formulas of the antecedent is false or atleast one of
Prepared by: Aisha Rafi Page 37

Discrete Mathematical Structures

Language of Logic

the formulas of the consequent is true. The former case is called the vacuous proof and the latter is called the Trivial proof. Occasionally we have sequents which have empty strings of formulas anticedent or as consequent. The empty antecedent, is interpreted as the logical constant 'true' or T and the empty consequent is interpreted as the logical constant 'false' or F. Axiom Scheme If a , and b strings of formulas such that every formula in both a and b is variable only, then the sequent a b is an axiom if a and b have atleast one variable common. For example, A, B, C P, B, R where A, B, C, P, R are variables is an axiom. Theorem The following sequents are theorems of our system. i) every axiom, is a theorem.

ii) if a sequent a is a theorem and a sequent b results from cc through the use of one of the 10 rules of the system which are given below, then b is a theorem, iii) sequents obtained from (i) and (ii) are the only theorems.

Beyond the Syllabus

Applications in computer science

Operators corresponding to logical disjunction exist in most programming languages. Bitwise operation Disjunction is often used for bitwise operations. Examples:

0 or 0 = 0 0 or 1 = 1 1 or 0 = 1 1 or 1 = 1
Page 38

Prepared by: Aisha Rafi

Discrete Mathematical Structures

Language of Logic

1010 or 1100 = 1110

The or operator can be used to set bits in a bit field to 1, by or-ing the field with a constant field with the relevant bits set to 1. For example, x = x | 0b00000001 will force the final bit to 1 while leaving other bits unchanged. Logical operation Many languages distinguish between bitwise and logical disjunction by providing two distinct operators; in languages following C, bitwise disjunction is performed with the single pipe (|) and logical disjunction with the double pipe (||) operators. Logical disjunction is usually short-circuited; that is, if the first (left) operand evaluates to true then the second (right) operand is not evaluated. The logical disjunction operator thus usually constitutes a sequence point. Although in most languages the type of a logical disjunction expression is boolean and thus can only have the value true or false, in some (such as Python and JavaScript) the logical disjunction operator returns one of its operands: the first operand if it evaluates to a true value, and the second operand otherwise.

Prepared by: Aisha Rafi

Page 39

You might also like