You are on page 1of 22

1 Propositional Logic - Axioms and Inference

Rules
Axioms
Axiom 1.1 [Commutativity]

(p ∧ q) = (q ∧ p)
(p ∨ q) = (q ∨ p)
(p = q) = (q = p)

Axiom 1.2 [Associativity]

p ∧ (q ∧ r) = (p ∧ q) ∧ r
p ∨ (q ∨ r) = (p ∨ q) ∨ r

Axiom 1.3 [Distributivity]

p ∨ (q ∧ r) = (p ∨ q) ∧ (p ∨ r)
p ∧ (q ∨ r) = (p ∧ q) ∨ (p ∧ r)

Axiom 1.4 [De Morgan]

¬(p ∧ q) = ¬p ∨ ¬q
¬(p ∨ q) = ¬p ∧ ¬q

Axiom 1.5 [Negation]

¬¬p = p

Axiom 1.6 [Excluded Middle]

p ∨ ¬p = T

1
Axiom 1.7 [Contradiction]

p ∧ ¬p = F

Axiom 1.8 [Implication]

p ⇒ q = ¬p ∨ q

Axiom 1.9 [Equality]

(p = q) = (p ⇒ q) ∧ (q ⇒ p)

Axiom 1.10 [or-simplification]

p ∨ p = p
p ∨ T = T
p ∨ F = p
p ∨ (p ∧ q) = p

Axiom 1.11 [and-simplification]

p ∧ p = p
p ∧ T = p
p ∧ F = F
p ∧ (p ∨ q) = p

Axiom 1.12 [Identity]

p = p

2
Inference Rules
p1 = p2 , p2 = p3
Transitivity
p1 = p3
p1 = p2
Substitution
E(p1 ) = E(p2 ) , E(p2 ) = E(p1 )

q1 , q2 , . . . , qn , q1 ∧ q2 ∧ . . . ∧ qn ⇒ (p1 = p2 )
Conditional Substitution
E(p1 ) = E(p2 ) , E(p2 ) = E(p1 )

3
2 Propositional Logic - Derived Theorems

Equivalence and Truth

Theorem 2.1 [Associativity of = ]

((p = q) = r) = (p = (q = r))

Theorem 2.2 [Identity of = ]

(T = p) = p

Theorem 2.3 [Truth]

Negation, Inequivalence, and False

Theorem 2.4 [Definition of F ]

F = ¬T

Theorem 2.5 [Distributivity of ¬ over = ]

¬(p = q) = (¬p = q)
(¬p = q) = (p = ¬q)

Theorem 2.6 [Negation of F ]

¬F = T

4
Theorem 2.7 [Definition of ¬]

(¬p = p) = F
¬p = (p = F )

Disjunction

Theorem 2.8 [Distributivity of ∨ over = ]

(p ∨ (q = r)) = ((p ∨ q) = (p ∨ r))


((p ∨ (q = r)) = (p ∨ q)) = (p ∨ r)

Theorem 2.9 [Distributivity of ∨ over ∨ ]

p ∨ (q ∨ r) = (p ∨ q) ∨ (p ∨ r)

Conjunction

Theorem 2.10 [Mutual definition of ∧ and ∨ ]

(p ∧ q) = (p = (q = (p ∨ q)))
(p ∧ q) = ((p = q) = (p ∨ q))
((p ∧ q) = p) = (q = (p ∨ q))
((p ∧ q) = (p = q)) = (p ∨ q)
(((p ∧ q) = p) = q) = (p ∨ q)

Theorem 2.11 [Distributivity of ∧ over ∧ ]

p ∧ (q ∧ r) = (p ∧ q) ∧ (p ∧ r)

5
Theorem 2.12 [Absorption]

p ∧ (¬p ∨ q) = p ∧ q
p ∨ (¬p ∧ q) = p ∨ q

Theorem 2.13 [Distributivity of ∧ over = ]

(p ∧ q) = ((p ∧ ¬q) = ¬p)


((p ∧ q) = (p ∧ ¬q)) = ¬p
p ∧ (q = p) = (p ∧ q)

Theorem 2.14 [Replacement]

(p = q) ∧ (r = p) = (p = q) ∧ (r = q)

Theorem 2.15 [Definition of = ]

(p = q) = (p ∧ q) ∨ (¬p ∧ ¬q)

Theorem 2.16 [Exclusive or]

¬(p = q) = (¬p ∧ q) ∨ (p ∧ ¬q)

Implication

Theorem 2.17 [Definition of Implication]

(p ⇒ q) = ((p ∨ q) = q)
((p ⇒ q) = (p ∨ q)) = q
(p ⇒ q) = ((p ∧ q) = p)
((p ⇒ q) = (p ∧ q)) = p

6
Theorem 2.18 [Contrapositive]

(p ⇒ q) = (¬q ⇒ ¬p)

Theorem 2.19 [Distributivity of ⇒ over = ]

p ⇒ (q = r) = ((p ⇒ q) = (p ⇒ r))

Theorem 2.20 [Shunting]

p ∧ q ⇒ r = p ⇒ (q ⇒ r)

Theorem 2.21 [Elimination/Introduction of ⇒ ]

p ∧ (p ⇒ q) = p ∧ q
p ∧ (q ⇒ p) = p
p ∨ (p ⇒ q) = T
p ∨ (q ⇒ p) = ¬q ∨ p
(p ∨ q) ⇒ (p ∧ q) = (p = q)
p ⇒ F = ¬p
F ⇒ p = T

Theorem 2.22 [Right Zero of ⇒ ]

(p ⇒ T ) = T

Theorem 2.23 [Left Identity of ⇒ ]

(T ⇒ p) = p

7
Theorem 2.24 [Weakening/Strengthening]

p ⇒ p ∨ q
p ∧ q ⇒ p
p ∧ q ⇒ p ∨ q
p ∨ (q ∧ r) ⇒ p ∨ q
p ∧ q ⇒ p ∧ (q ∨ r)

Theorem 2.25 [Modus Ponens]

p ∧ (p ⇒ q) ⇒ q

Theorem 2.26 [Proof by Cases]

(p ⇒ r) ∧ (q ⇒ r) = (p ∨ q ⇒ r)
(p ⇒ r) ∧ (¬p ⇒ r) = r

Theorem 2.27 [Mutual Implication]

(p ⇒ q) ∧ (q ⇒ p) = (p = q)

Theorem 2.28 [Antisymmetry]

(p ⇒ q) ∧ (q ⇒ p) ⇒ (p = q)

Theorem 2.29 [Transitivity]

(p ⇒ q) ∧ (q ⇒ r) ⇒ (p ⇒ r)
(p = q) ∧ (q ⇒ r) ⇒ (p ⇒ r)
(p ⇒ q) ∧ (q = r) ⇒ (p ⇒ r)

Theorem 2.30 [Monotonicity of ∨ ]

(p ⇒ q) ⇒ (p ∨ r ⇒ q ∨ r)

8
Theorem 2.31 [Monotonicity of ∧ ]

(p ⇒ q) ⇒ (p ∧ r ⇒ q ∧ r)

Substitution

Theorem 2.32 [Leibniz]

(e = f ) ⇒ (E(e) = E(f ))

Theorem 2.33 [Substitution]

(e = f ) ∧ E(e) = (e = f ) ∧ E(f )
(e = f ) ⇒ E(e) = (e = f ) ⇒ E(f )
q ∧ (e = f ) ⇒ E(e) = q ∧ (e = f ) ⇒ E(f )

Theorem 2.34 [Replace by T ]

p ∧ E(p) = p ∧ E(T )
p ⇒ E(p) = p ⇒ E(T )
q ∧ p ⇒ E(p) = q ∧ p ⇒ E(T )

Theorem 2.35 [Replace by F ]

p ∨ E(p) = p ∨ E(F )
E(p) ⇒ p = E(F ) ⇒ p
E(p) ⇒ p ∨ q = E(F ) ⇒ p ∨ q

Theorem 2.36 [Shannon]

E(p) = (p ∧ E(T )) ∨ (¬p ∧ E(F ))

9
3 Propositional Logic - Examples and Exer-
cises

10
4 Predicate Logic - Axioms

Axiom 4.1 [Definition of ∃]


 
∃i : m ≤ i < n : pi
(m ≥ n) ⇒  = 
F
 
∃i : m ≤ i < n : pi

  = 


(m < n) ⇒ 
 ∃i : m ≤ i < n − 1 : pi 

  ∨  
pn−1

Axiom 4.2 [Definition of ∀]


 
∀i : m ≤ i < n : pi
(m ≥ n) ⇒  = 
T
 
∀i : m ≤ i < n : pi

  = 


(m < n) ⇒ 
 ∀i : m ≤ i < n − 1 : p i


  ∧  
pn−1

11
Axiom 4.3 [Range Split]
   
∀i : m1 ≤ i < m2 : pi
 
 ∧  

(m1 ≤ m2 ≤ m3 ) ⇒ 
 ∀i : m2 ≤ i < m3 : p i


 = 
∀i : m1 ≤ i < m3 : pi
   
∀i : m1 ≤ i < n1 : pi
 
 ∧  

(m1 ≤ m2 ) ∧ (n1 ≥ n2 ) ⇒ 
 ∀i : m2 ≤ i < n2 : pi 

 = 
∀i : m1 ≤ i < n1 : pi
   
∃i : m1 ≤ i < m2 : pi
 
 ∨  

(m1 ≤ m2 ≤ m3 ) ⇒ 
 ∃i : m2 ≤ i < m3 : p i


 = 
∃i : m1 ≤ i < m3 : pi
   
∃i : m1 ≤ i < n1 : pi
 
 ∨  

(m1 ≤ m2 ) ∧ (n1 ≥ n2 ) ⇒ 
 ∃i : m2 ≤ i < n2 : p i


 = 
∃i : m1 ≤ i < n1 : pi

Axiom 4.4 [Interchange of Dummies]

∀i : m1 ≤ i < n1 : (∀j : m2 ≤ j < n2 : pi,j )


=
∀j : m2 ≤ j < n2 : (∀i : m1 ≤ i < n1 : pi,j )

∃i : m1 ≤ i < n1 : (∃j : m2 ≤ j < n2 : pi,j )


=
∃j : m2 ≤ j < n2 : (∃i : m1 ≤ i < n1 : pi,j )

12
Axiom 4.5 [Dummy Renaming]

∀i : m ≤ i < n : pi = ∀j : m ≤ j < n : pj

Axiom 4.6 [Distributivity of ∨ over ∀ ]

(p ∨ (∀i : m ≤ i < n : qi )) = ∀i : m ≤ i < n : (p ∨ qi )

Axiom 4.7 [Distributivity of ∧ over ∀ ]


 
p ∧ (∀i : m ≤ i < n : qi )
(m < n) ⇒  = 
∀i : m ≤ i < n : p ∧ qi
 
∀i : m ≤ i < n : pi
 ∧  = ∀i : m ≤ i < n : (pi ∧ qi )
∀i : m ≤ i < n : qi

Axiom 4.8 [Distributivity of ∧ over ∃ ]

(p ∧ (∃i : m ≤ i < n : qi )) = ∃i : m ≤ i < n : (p ∧ qi )

Axiom 4.9 [Distributivity of ∨ over ∃ ]


 
p ∨ (∃i : m ≤ i < n : qi )
(m < n) ⇒  = 
∃i : m ≤ i < n : (p ∨ qi )
 
∃i : m ≤ i < n : pi
 ∨  = ∃i : m ≤ i < n : (pi ∨ qi )
∃i : m ≤ i < n : qi

Axiom 4.10 [Universality of T ]

∀i : m ≤ i < n : T = T

13
Axiom 4.11 [Existence of F ]

∃i : m ≤ i < n : F = F

Axiom 4.12 [Generalized De Morgan]

¬ (∃i : m ≤ i < n : pi ) = ∀i : m ≤ i < n : ¬pi


¬ (∀i : m ≤ i < n : pi ) = ∃i : m ≤ i < n : ¬pi

Axiom 4.13 [Trading]

(m ≤ i < n) ⇒ pi = ∀i : m ≤ i < n : pi
(m ≤ i < n) ∧ pi ⇒ ∃i : m ≤ i < n : pi

Axiom 4.14 [Definition of Numerical Quantification]


 
N i : m ≤ i < n : pi
(m ≥ n) ⇒  = 
0
 
N i : m ≤ i < n : pi
(m < n) ∧ ¬pn−1 ⇒  = 
N i : m ≤ i < n − 1 : pi
 
N i : m ≤ i < n : pi

  = 


(m < n) ∧ pn−1 ⇒ 
 N i : m ≤ i < n − 1 : p i


  +  
1

14
Axiom 4.15 [Definition of Σ]
 
Σi : m ≤ i < n : ei
(m ≥ n) ⇒  = 
0
 
Σi : m ≤ i < n : ei

  = 


(m < n) ⇒ 
 Σi : m ≤ i < n − 1 : ei 

  +  
en−1

Axiom 4.16 [Definition of Π]


 
Πi : m ≤ i < n : ei
(m ≥ n) ⇒  = 
1
 
Πi : m ≤ i < n : ei

  = 


(m < n) ⇒ 
 Πi : m ≤ i < n − 1 : ei


  ∗  
en−1

15
5 Predicate Logic - Derived Theorems

Theorem 5.1 [Definition of ∃]


 
∃i : m < i ≤ n : pi
(m ≥ n) ⇒  = 
F
 
∃i : m < i ≤ n : pi

  = 


(m < n) ⇒ 
 ∃i : m + 1 < i ≤ n : pi 

  ∨  
pm+1

Theorem 5.2 [Definition of ∀]

 
∀i : m < i ≤ n : pi
(m ≥ n) ⇒  = 
T
 
∀i : m < i ≤ n : pi

  = 


(m < n) ⇒ 
 ∀i : m + 1 < i ≤ n : p i


  ∧  
pm+1

16
Theorem 5.3 [Definition of Σ]
 
Σi : m < i ≤ n : ei
(m ≥ n) ⇒  = 
0
 
Σi : m < i ≤ n : ei

  = 


(m < n) ⇒ 
 Σi : m + 1 < i ≤ n : ei 

  +  
em+1

Theorem 5.4 [Definition of Π]

 
Πi : m < i ≤ n : ei
(m ≥ n) ⇒  = 
1
 
Πi : m < i ≤ n : ei

  = 


(m < n) ⇒ 
 Πi : m + 1 < i ≤ n : ei


  ∗  
em+1

17
6 Some Simple Laws of Arithmetic
Throughout this compendium, we assume the validity of all “simple” arith-
metic rules. Examples of such rules are all simplification rules, e.g. =

2+3 = 5
x+x = 2∗x
x+y−y =x
(x/3) ∗ 3 = x
0∗x = 0
1∗x = x
x ∗ x = x2
0x = 0
1x = 1
(2 ∗ x + 10 = 20) = (x = 5)
(x + y < 2 ∗ y) = (x < y)
(x + y = x + z) = (y = z)
x ∗ (y + 1) − (x + z) = (x ∗ y − z)
Following is a collection of theorems that might be used. The list is not
exhaustive but intend to show the level of complexity that you can specify
theorems on.

18
Theorems on < and ≤

(x < y) = (y > x)
(x < y) ⇒ ¬(y = x) ∧ ¬(y < x)
(x < y) ⇒ (x ≤ y)
(x < y) = (x ≤ y) ∧ (x 6= y)
(x < y) ∧ (y ≤ z) ⇒ (x < z)
(x ≤ y) = ¬(x > y)
(x ≤ x) = T
(x ≤ y) ∧ (y ≤ z) ⇒ (x ≤ z)
(x ≤ y) ∧ (y < z) ⇒ (x < z)
(x ≤ y) ∧ ¬(x < y) ⇒ (x < y)
(x ≤ y − 1) = (x < y)
(x ≤ y) ∨ (y ≤ x) = T
(x ≤ y) ∨ (y < x) = T
(x ≤ y) = (x < y) ∨ (x = y)

Theorems on properties about + and −

(x < y) ⇒ (x < y + 1)
(x < y + 1) = (x ≤ y)
(x < y) ⇒ (z − y < z − x)
(0 < x) = (−x < 0)
(x − 1 < x) = T
(x ≤ y − 1) = (x < y)
(x ≤ y) = (x − 1 < y)
(x1 < y1 ) ∧ (x2 < y2 ) ⇒ (x1 + x2 < y1 + y2 )
(x1 ≤ y1 ) ∧ (x2 ≤ y2 ) ⇒ (x1 + x2 ≤ y1 + y2 )

19
Theorems on properties about ∗ and /

(0 < x) = (0 < 2 ∗ x)
(0 < x) = (x < 2 ∗ x)
(0 < x) = (x ÷ 2 < x)
(0 ≤ x/2) = (0 ≤ x)
(x = 0) ⇒ (x ∗ y = 0)
2 ∗ (x/2) = x

Theorems on equivalence relation

(x = x) = T
(x = y) = (x ≤ y) ∧ (y ≤ x)

Theorems about odd(n) and even(n)

odd(x) ⇒ ((x − 1) ÷ 2 = (x − 1)/2)


even(x) ⇒ (x ÷ 2 = x/2)
odd(x + 2 ∗ y) = odd(x)
even(x + 2 ∗ y) = even(x)
odd(x) = ¬even(x)
odd(x) ⇒ ((x ≥ 1) = (x ≥ 0))
odd(x) ∧ (x = 0) = F

20
7 Predicate Logic - Examples and Exercises

21
8 Arrays - Axioms
8.1 Axioms
Axiom 8.1 [Assignment to Array Element]
 
(i = j) ⇒ (e = f )
((b; i : e) [j] = f ) =  ∧ 
(i 6= j) ⇒ (b[j] = f )

Axiom 8.2 [Definition of Arithmetic Relations]

(b[i : j] = x) = (∀k : i≤k <j+1 : b[k] = x)


(b[i : j] < x) = (∀k : i≤k <j+1 : b[k] < x)
(b[i : j] > x) = (∀k : i≤k <j+1 : b[k] > x)
(b[i : j] ≤ x) = (∀k : i≤k <j+1 : b[k] ≤ x)
(b[i : j] ≥ x) = (∀k : i≤k <j+1 : b[k] ≥ x)
(b[i : j] 6= x) = (∀k : i≤k <j+1 : b[k] 6= x)
x ∈ b[i : j] = (∃k : i≤k <j+1 : x = b[k])

22

You might also like