🐻
berkeley
  • #Despair
  • 16A/B
    • Thevenin and Norton Equivalence
    • Resistive Touchscreen
    • Trilateration and Correlation
    • RC Circuits & Transient Analysis
  • 61B
    • Testing
    • References in Java
    • Linked Lists in Java
    • Implementation Inheritance
    • Comparables and Iterators
    • Casting
    • Lists and Sets
    • Asymptotics
    • Trees
    • Hashing
    • PriorityQueue and Heap
    • Graphs, Tree Traversals
    • Tries
    • Sorting
  • Discrete Mathematics
    • Sets + Mathematical Notation
    • Logic and Proofs
    • Induction
    • Cryptography/RSA
    • Modular Arithmetic
    • Discrete Probability
  • Linear Algebra
    • Linear Equations
    • Matrix Algebra
    • Determinants
    • Vector Spaces
    • Eigenvectors and Eigenvalues
    • Projections and Orthogonality
    • SVD/PCA
  • Math 275 — Ordinary Differential Equations
    • Math 275 — Overview
    • Modeling via Differential Equations
    • Linear Systems
  • INTEGBI 35AC
    • Humans Came From Fish
    • Evolution's History
    • Typology
    • The Human Diaspora
  • 170
    • Basics
    • Divide and Conquer
    • Fast Fourier Transform
    • Graphs
    • Greedy
  • 61C
    • Pointers and Memory
    • Floating Point
    • Compliation, Assembly, Linking, Loading
    • RISC-V, Assembly
Powered by GitBook
On this page
  • Propositions
  • Truth Tables
  • Quantifiers
  • De Morgan's Laws
  • C and C
  • The Contrapositive
  • The Converse
  • Tautologies
  • Direct Proof
  • Proof by Contraposition
  • Useful Tools for Proofs

Was this helpful?

  1. Discrete Mathematics

Logic and Proofs

A short introduction to proofs and mathematical logic. Written as notes for the course CS 70.

PreviousSets + Mathematical NotationNextInduction

Last updated 3 years ago

Was this helpful?

Propositions

Propositions are statements that are either true or false. In examples, they are usually represented by the letters P,Q,P, Q,P,Q,and R.R.R.Here are some propositions.

  • Steven is bald.

  • 4 + 1 = 1000

Truth Tables

Truth tables are a way of visualizing the possible outcomes of a statement. Here is an example of a truth table that shows the possible outcomes of (P∧Q).(P \land Q).(P∧Q).

T

T

T

T

F

F

F

T

F

F

F

F

If you don't know what ∧\land∧ means, see

Quantifiers

If you've seen anything written by a mathematician, you've probably read the words "there exists" or "for all." There are two symbols for these, ∃\exists∃ and ∀,\forall,∀, and they are called quantifiers. They are used to write most propositions. For example, here is a proposition that uses a quantifier.

(∃x∈N)[x+1=2](\exists x\in \mathbb{N})[x + 1 = 2] (∃x∈N)[x+1=2]

This roughly translates to "there exists a natural number xxx such that x+1=2.x + 1 = 2.x+1=2." Of course, using basic algebra, we know what that number is.

De Morgan's Laws

De Morgan's laws are used to negate propositions. To negate a statement, walk the negation through the statement, switching symbols as you go.

¬(P∧Q)=¬P∨¬Q¬(P∨Q)=¬P∧¬Q\neg(P \land Q) = \neg P \lor \neg Q\\ \neg (P \lor Q) = \neg P \land \neg Q¬(P∧Q)=¬P∨¬Q¬(P∨Q)=¬P∧¬Q

This follows pretty well logically. In the first example, if we know that in order for ¬(P∧Q),\neg(P \land Q),¬(P∧Q), then either PPP or QQQmust be false, which is exactly what is written on the LHS of the equation.

Applying De Morgan's laws to quantifiers is just as simple.

¬(∀xP(x))=∃x¬P(x)\neg(\forall x P(x)) = \exists x \neg P(x)¬(∀xP(x))=∃x¬P(x)

This makes sense. Assuming that we are using both sides being true as our basis, if "for all xxx, P(x)P(x)P(x) is true" is false, then the LHS is true. In order for the statement to be false, there needs to be some x,x,x, at least one, that makes P(x)P(x)P(x)false. This is exactly what the RHS is saying.

The negation of an implication (P  ⟹  Q)(P \implies Q)(P⟹Q) is a conjunction, (P∧¬Q).(P \land \neg Q).(P∧¬Q). In order for the implication to be false, it must be the case that when PPPis true, QQQis false.

C and C

The Contrapositive

The contrapositive of an implication (P  ⟹  Q)(P \implies Q)(P⟹Q) is (¬Q  ⟹  ¬P).(\neg Q \implies \neg P).(¬Q⟹¬P). If one is true, the other is also true.

The Converse

The converse of an implication (P  ⟹  Q)(P \implies Q)(P⟹Q)is (Q  ⟹  P).(Q \implies P).(Q⟹P). If one is true the other is not necessarily true. If both are true, they have a iff (if and only if) relationship.

Tautologies

A tautology is a propositional statement/formula that is always true no matter what the result of the propositional variables is. For example, an obvious one would be (P∨¬P).(P \lor \neg P).(P∨¬P). Whether PPPis true or false, the statement is always true. It's like saying "Steven is bald or he has hair."

Direct Proof

The direct proof is probably the most common type of proof. The goal is to prove a statement, (P  ⟹  Q).(P \implies Q).(P⟹Q). The steps are as follows.

  • Assume that PPP is true.

  • Show that under the above condition, QQQis also true.

Proof by Contraposition

In some cases, proving a statement (P  ⟹  Q)(P \implies Q)(P⟹Q)might become overly complicated and annoying to think about. However, since the contrapositive (¬Q  ⟹  ¬P)(\neg Q \implies \neg P)(¬Q⟹¬P) is true if the original statement is true, we can just do a direct proof of the contrapositive instead.

Useful Tools for Proofs

Thing

Tool

TODO: Proof by contradiction, proof by cases, add more tools to useful tools section

is even

is odd

is rational

If you can't read that right column, see

PPP
QQQ
(P∧Q)(P \land Q)(P∧Q)
nnn
∃x∈Z:2x=n\exists x \in \mathbb{Z}: 2x = n∃x∈Z:2x=n
nnn
∃x∈Z:2x+1=n\exists x \in \mathbb{Z}: 2x + 1= n∃x∈Z:2x+1=n
nnn
∃x,∃y∈Z:xy=n\exists x, \exists y \in \mathbb{Z} : \frac{x}{y} = n∃x,∃y∈Z:yx​=n
this page.
this page.