Download as pdf or txt
Download as pdf or txt
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-simplication]
p p = p
p T = T
p F = p
p (p q) = p
Axiom 1.11 [and-simplication]
p p = p
p T = p
p F = F
p (p q) = p
Axiom 1.12 [Identity]
p = p
2
Inference Rules
p
1
= p
2
, p
2
= p
3
p
1
= p
3
Transitivity
p
1
= p
2
E(p
1
) = E(p
2
) , E(p
2
) = E(p
1
)
Substitution
q
1
, q
2
, . . . , q
n
, q
1
q
2
. . . q
n
(p
1
= p
2
)
E(p
1
) = E(p
2
) , E(p
2
) = E(p
1
)
Conditional Substitution
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]
T
Negation, Inequivalence, and False
Theorem 2.4 [Denition 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 [Denition 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 denition 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 [Denition of = ]
(p = q) = (p q) (p q)
Theorem 2.16 [Exclusive or]
(p = q) = (p q) (p q)
Implication
Theorem 2.17 [Denition 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 [Denition of ]
(m n)

i : m i < n : p
i
=
F

(m < n)

i : m i < n : p
i
=

i : m i < n 1 : p
i

p
n1

Axiom 4.2 [Denition of ]


(m n)

i : m i < n : p
i
=
T

(m < n)

i : m i < n : p
i
=

i : m i < n 1 : p
i

p
n1

11
Axiom 4.3 [Range Split]
(m
1
m
2
m
3
)

i : m
1
i < m
2
: p
i

i : m
2
i < m
3
: p
i

=
i : m
1
i < m
3
: p
i

(m
1
m
2
) (n
1
n
2
)

i : m
1
i < n
1
: p
i

i : m
2
i < n
2
: p
i

=
i : m
1
i < n
1
: p
i

(m
1
m
2
m
3
)

i : m
1
i < m
2
: p
i

i : m
2
i < m
3
: p
i

=
i : m
1
i < m
3
: p
i

(m
1
m
2
) (n
1
n
2
)

i : m
1
i < n
1
: p
i

i : m
2
i < n
2
: p
i

=
i : m
1
i < n
1
: p
i

Axiom 4.4 [Interchange of Dummies]


i : m
1
i < n
1
: (j : m
2
j < n
2
: p
i,j
)
=
j : m
2
j < n
2
: (i : m
1
i < n
1
: p
i,j
)
i : m
1
i < n
1
: (j : m
2
j < n
2
: p
i,j
)
=
j : m
2
j < n
2
: (i : m
1
i < n
1
: p
i,j
)
12
Axiom 4.5 [Dummy Renaming]
i : m i < n : p
i
= j : m j < n : p
j
Axiom 4.6 [Distributivity of over ]
(p (i : m i < n : q
i
)) = i : m i < n : (p q
i
)
Axiom 4.7 [Distributivity of over ]
(m < n)

p (i : m i < n : q
i
)
=
i : m i < n : p q
i

i : m i < n : p
i

i : m i < n : q
i

= i : m i < n : (p
i
q
i
)
Axiom 4.8 [Distributivity of over ]
(p (i : m i < n : q
i
)) = i : m i < n : (p q
i
)
Axiom 4.9 [Distributivity of over ]
(m < n)

p (i : m i < n : q
i
)
=
i : m i < n : (p q
i
)

i : m i < n : p
i

i : m i < n : q
i

= i : m i < n : (p
i
q
i
)
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 : p
i
) = i : m i < n : p
i
(i : m i < n : p
i
) = i : m i < n : p
i
Axiom 4.13 [Trading]
(m i < n) p
i
= i : m i < n : p
i
(m i < n) p
i
i : m i < n : p
i
Axiom 4.14 [Denition of Numerical Quantication]
(m n)

Ni : m i < n : p
i
=
0

(m < n) p
n1

Ni : m i < n : p
i
=
Ni : m i < n 1 : p
i

(m < n) p
n1

Ni : m i < n : p
i
=

Ni : m i < n 1 : p
i
+
1

14
Axiom 4.15 [Denition of ]
(m n)

i : m i < n : e
i
=
0

(m < n)

i : m i < n : e
i
=

i : m i < n 1 : e
i
+
e
n1

Axiom 4.16 [Denition of ]


(m n)

i : m i < n : e
i
=
1

(m < n)

i : m i < n : e
i
=

i : m i < n 1 : e
i

e
n1

15
5 Predicate Logic - Derived Theorems
Theorem 5.1 [Denition of ]
(m n)

i : m < i n : p
i
=
F

(m < n)

i : m < i n : p
i
=

i : m + 1 < i n : p
i

p
m+1

Theorem 5.2 [Denition of ]


(m n)

i : m < i n : p
i
=
T

(m < n)

i : m < i n : p
i
=

i : m + 1 < i n : p
i

p
m+1

16
Theorem 5.3 [Denition of ]
(m n)

i : m < i n : e
i
=
0

(m < n)

i : m < i n : e
i
=

i : m + 1 < i n : e
i
+
e
m+1

Theorem 5.4 [Denition of ]


(m n)

i : m < i n : e
i
=
1

(m < n)

i : m < i n : e
i
=

i : m + 1 < i n : e
i

e
m+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 simplication 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 = x
2
0
x
= 0
1
x
= 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 = 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)
(x
1
< y
1
) (x
2
< y
2
) (x
1
+ x
2
< y
1
+ y
2
)
(x
1
y
1
) (x
2
y
2
) (x
1
+ x
2
y
1
+ y
2
)
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]
((b; i : e) [j] = f) =

(i = j) (e = f)

(i = j) (b[j] = f)

Axiom 8.2 [Denition 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] = x) = (k : i k < j + 1 : b[k] = x)
x b[i : j] = (k : i k < j + 1 : x = b[k])
22

You might also like