ScholarQuill logoScholarQuillUniversity Notes
  • Notes
  • Past Papers
  • Blogs
  • Todo
Login
ScholarQuill logoScholarQuillUniversity Notes
Login
NotesPast PapersBlogsTodo
More
SubjectsDiscussionCGPA CalculatorGPA CalculatorStudent PortalCourse Outline
About
About usPrivacy PolicyReportContact
Notes
Past Papers
Blogs
Todo
Analytics
    Current Subject
    🧩
    Discrete Structures
    CSI-303
    Progress0 / 21 topics
    Topics
    1. Introduction to Logic and Proofs2. Direct Proofs3. Proof by Contradiction4. Sets5. Combinatorics6. Sequences7. Formal Logic8. Propositional and Predicate Calculus9. Methods of Proof10. Mathematical Induction and Recursion11. Loop Invariants12. Relations and Functions13. Pigeonhole Principle14. Trees and Graphs15. Elementary Number Theory16. Optimization and Matching17. Fundamental Structures18. Functions19. Relations (Recursions)20. Cardinality and Countability21. Probabilistic Methods
    CSI-303›Formal Logic
    Discrete StructuresTopic 7 of 21

    Formal Logic

    9 minread
    1,579words
    Intermediatelevel

    Formal Logic

    Formal logic is a branch of logic that deals with the structure and validity of arguments using formal systems and symbols. It is used to analyze and represent reasoning in a precise and rigorous manner. Unlike informal logic, which deals with natural language arguments, formal logic abstracts reasoning into a symbolic language to ensure clarity and eliminate ambiguity. Formal logic plays a central role in mathematics, philosophy, computer science, and artificial intelligence.

    Key Concepts in Formal Logic

    1. Propositions and Statements

    A proposition (also called a statement) is a declarative sentence that is either true or false, but not both. Propositions are the basic building blocks in formal logic.

    • Examples of propositions:
      • "The sky is blue" (true or false)
      • "5 is greater than 3" (true)
      • "2 + 2 = 5" (false)

    Propositions are often represented by letters like ppp, qqq, or rrr.

    2. Logical Connectives (Operators)

    Logical connectives are symbols used to combine or modify propositions. The main logical connectives are:

    • Negation (¬\neg¬): The negation of a proposition ppp is denoted ¬p\neg p¬p, and it means "not ppp." If ppp is true, then ¬p\neg p¬p is false, and vice versa.

      Example: If ppp is "It is raining," then ¬p\neg p¬p is "It is not raining."

    • Conjunction (∧\land∧): The conjunction of two propositions ppp and qqq is denoted p∧qp \land qp∧q, and it means "both ppp and qqq." This is true only when both ppp and qqq are true.

      Example: If ppp is "It is raining" and qqq is "It is cold," then p∧qp \land qp∧q is "It is raining and it is cold."

    • Disjunction (∨\lor∨): The disjunction of two propositions ppp and qqq is denoted p∨qp \lor qp∨q, and it means "either ppp or qqq (or both)." This is true if at least one of ppp or qqq is true.

      Example: If ppp is "It is raining" and qqq is "It is snowing," then p∨qp \lor qp∨q is "It is raining or it is snowing."

    • Implication (→\rightarrow→): The implication p→qp \rightarrow qp→q means "if ppp, then qqq." This is true unless ppp is true and qqq is false.

      Example: If ppp is "It is raining" and qqq is "The ground is wet," then p→qp \rightarrow qp→q is "If it is raining, then the ground is wet."

    • Biconditional (↔\leftrightarrow↔): The biconditional p↔qp \leftrightarrow qp↔q means " ppp if and only if qqq." This is true when both ppp and qqq are either both true or both false.

      Example: If ppp is "It is raining" and qqq is "The ground is wet," then p↔qp \leftrightarrow qp↔q means "It is raining if and only if the ground is wet."

    3. Truth Tables

    A truth table is a table used to show the truth values of a logical expression based on all possible truth values of the components (propositions) involved. Truth tables help in analyzing the validity of logical connectives and logical formulas.

    For example, here’s the truth table for conjunction (p∧qp \land qp∧q):

    ppp qqq p∧qp \land qp∧q
    T T T
    T F F
    F T F
    F F F

    For implication (p→qp \rightarrow qp→q):

    ppp qqq p→qp \rightarrow qp→q
    T T T
    T F F
    F T T
    F F T

    4. Logical Equivalences

    Two logical expressions are logically equivalent if they have the same truth table, meaning they always yield the same truth values for all possible assignments of truth values to their propositions.

    Some common logical equivalences include:

    • Double Negation: ¬(¬p)≡p\neg(\neg p) \equiv p¬(¬p)≡p
    • De Morgan’s Laws:
      • ¬(p∧q)≡¬p∨¬q\neg(p \land q) \equiv \neg p \lor \neg q¬(p∧q)≡¬p∨¬q
      • ¬(p∨q)≡¬p∧¬q\neg(p \lor q) \equiv \neg p \land \neg q¬(p∨q)≡¬p∧¬q
    • Implication: p→q≡¬p∨qp \rightarrow q \equiv \neg p \lor qp→q≡¬p∨q
    • Commutative Laws:
      • p∧q≡q∧pp \land q \equiv q \land pp∧q≡q∧p
      • p∨q≡q∨pp \lor q \equiv q \lor pp∨q≡q∨p

    5. Arguments and Validity

    An argument in formal logic is a sequence of statements (propositions), where the last statement (called the conclusion) is derived from the previous statements (called premises).

    • A valid argument is one in which the conclusion must be true if the premises are true. In formal logic, an argument is valid if the truth of the premises guarantees the truth of the conclusion.

    • A sound argument is a valid argument with all true premises. A valid argument can be unsound if one or more premises are false.

    6. Proof Techniques in Formal Logic

    There are several methods used to prove logical statements:

    • Direct Proof: In a direct proof, we assume the premises are true and use logical reasoning to directly show that the conclusion follows.

    • Proof by Contradiction: In a proof by contradiction, we assume that the negation of the statement to be proven is true, and then show that this leads to a contradiction. Hence, the original statement must be true.

    • Proof by Contrapositive: To prove an implication p→qp \rightarrow qp→q, we prove its contrapositive ¬q→¬p\neg q \rightarrow \neg p¬q→¬p. This is logically equivalent to the original implication.

    • Inductive Proof: Mathematical induction is used to prove statements about natural numbers. It involves proving a base case, and then proving that if the statement holds for an arbitrary case nnn, it holds for n+1n+1n+1.

    7. Quantifiers

    In formal logic, quantifiers are used to express statements involving "all" or "some" elements of a set:

    • Universal Quantifier (∀\forall∀): ∀x P(x)\forall x \, P(x)∀xP(x) means "for all xxx, P(x)P(x)P(x) is true."
    • Existential Quantifier (∃\exists∃): ∃x P(x)\exists x \, P(x)∃xP(x) means "there exists an xxx such that P(x)P(x)P(x) is true."

    These are commonly used in predicate logic, where propositions involve variables.

    8. Predicate Logic

    Predicate logic (also known as first-order logic) extends propositional logic by including predicates, which are functions that return true or false based on the value of their variables. It also uses quantifiers to generalize propositions.

    • For example:
      • ∀x (P(x)→Q(x))\forall x \, (P(x) \rightarrow Q(x))∀x(P(x)→Q(x)) means "for all xxx, if P(x)P(x)P(x) is true, then Q(x)Q(x)Q(x) is also true."
      • ∃x P(x)\exists x \, P(x)∃xP(x) means "there exists an xxx such that P(x)P(x)P(x) is true."

    9. Applications of Formal Logic

    • Mathematics: Formal logic is the foundation for mathematical proofs, set theory, and number theory.
    • Computer Science: Logic forms the basis for algorithms, database queries, programming languages, and artificial intelligence.
    • Philosophy: Formal logic is used in philosophical reasoning, especially in the analysis of arguments, theories of truth, and ethical arguments.
    • Artificial Intelligence: Formal logic is used in knowledge representation, automated reasoning, and theorem proving.

    Conclusion

    Formal logic is a powerful tool used to model reasoning and mathematical proof. Through propositions, logical connectives, truth tables, and various proof techniques, formal logic provides a clear and precise framework for understanding and analyzing arguments. It is essential not only in mathematics but also in fields like computer science, philosophy, and artificial intelligence.

    Previous topic 6
    Sequences
    Next topic 8
    Propositional and Predicate Calculus

    Past Papers

    Open this section to load past papers

    Click on Show Past Papers to see past papers.
    On This Page
      Reading Stats
      Est. reading time9 min
      Word count1,579
      Code examples0
      DifficultyIntermediate