4
1. Proving Techniques (a) Direct proof (b) Exhaustion proof (c) Construction proof (d) Existential proof (e) Contradiction proof (f) Contrapositive proof (g) Induction proof (h) Pigeonhole principle (i) Combinatorial proof (j) Inclusion Exclusion principle 2. Natural Deduction (a) Conjunction introduction: F 1 ,F 2 F 1 F 2 (b) Conjunction elimination: F 1 F 2 F 1 (c) Conjunction elimination: F 1 F 2 F 2 (d) Disjunction introduction: F 1 F 1 F 2 (e) Disjunction introduction: F 2 F 1 F 2 (f) Disjunction elimination: F 1 F 2 ,F 1 F 3 ,F 2 F 3 F 3 (g) Negation introduction: F 2 (F 1 ∧¬F 1 ) ‘¬F 2 (h) Double negation elimination: ¬¬F 1 F 1 (i) Implication introduction: (F 1 F 2 ) F 1 F 2 (j) Double negation introduction: F 1 ‘ ¬¬F 1 (k) Implication elimination (Modus Ponens): F 1 ,F 1 F 2 F 2 (l) Modus Tollens: F 1 F 2 , ¬F 2 ‘¬F 1 (m) Universal quantifier elimination: XF F [t/X ] (n) Universal quantifier introduction: F [Y/X ] XF (o) Existential quantifier introduction: F [t/X ] XF (p) Existential quantifier elimination: XF 1 , (F 1 [Y/X ] F 2 ) F 2 3. Model Semantics (a) Model: An interpretation I is a model of a for- mula F iff I (F ) is true. (b) Tautology: A formula F is a tautology iff all interpretation are models. (c) Contradiction: A formula F is a contradiction iff no interpretation is model. (d) Contingency: A formula F is a contingency iff it is neither a tautology nor a contradiction. (e) Logical Consequence: F 1 | = F 2 iff all models of F 1 are models of F 2 (f) Logically Equicalent: F 1 F 2 iff they have the same models. (g) I (XF )= I ( W cU H F [c/X ]) (h) I (XF )= I ( V cU H F [c/X ]) 4. Boolean Algebra (a) Identity of ×: x × 1= x (b) Identity of +: x +0= x (c) Complementation of ×: x × ¯ x =0 (d) Complementation of +: x x =1 (e) Associativity of ×: x × (y × z )=(x × y) × z = x × y × z (f) Associativity of +: x +(y + z )=(x + y)+ z = x + y + z (g) Commutativity of ×: x × y = y × x (h) Commutativity of +: x + y = y + x (i) Distributivity of × over +: x × (y + z )=(x × y)+(x × z ) (j) Distributivity of + over ×: x +(y × z )=(x + y) × (x + z ) (k) Idempotence of ×: x × x = x (l) Idempotence of +: x + x = x (m) Annihilator of ×: x × 0=0 (n) Annihilator of +: x +1=1 (o) Absorption of ×: x × (x + y)= x (p) Absorption of +: x +(x × y)= x (q) Unicity of complement: If x×y = 0 and x+y =1 then y x 5. Set Theory (a) Axiom 1: Empty set. There exist a set with no elements X (Y (¬(Y X ))) (b) Axiom 2: Extensionality: Two sets are equal if and only if they have the same elements X Y ((Z (Z X Z Y )) X = Y ) (c) Axiom 3: Pairing: There exists a set Z that contains X and Y . X Y Z T ((T = X T = Y ) T Z ) (d) Axiom 4: Unions: S T Y ((Y T ) Z ((Z S ) (Y Z ))) (e) Axiom 5: Power Sets: S T X ((X T ) (X S )) (f) Axiom 6: Regularity: X (X 6= (Y (Y X ∧∀Z (Z X ⇒¬(Z Y ))))) (g) Axiom 7: Infinity: X (X (Y (Y X Y ∪{Y }∈ X )))

Summary of CS1231

Embed Size (px)

Citation preview

Page 1: Summary of CS1231

1. Proving Techniques

(a) Direct proof

(b) Exhaustion proof

(c) Construction proof

(d) Existential proof

(e) Contradiction proof

(f) Contrapositive proof

(g) Induction proof

(h) Pigeonhole principle

(i) Combinatorial proof

(j) Inclusion Exclusion principle

2. Natural Deduction

(a) Conjunction introduction: F1, F2 ` F1 ∧ F2

(b) Conjunction elimination: F1 ∧ F2 ` F1

(c) Conjunction elimination: F1 ∧ F2 ` F2

(d) Disjunction introduction: F1 ` F1 ∨ F2

(e) Disjunction introduction: F2 ` F1 ∨ F2

(f) Disjunction elimination: F1∨F2, F1 ⇒ F3, F2 ⇒F3 ` F3

(g) Negation introduction: F2 ⇒ (F1 ∧ ¬F1) ` ¬F2

(h) Double negation elimination: ¬¬F1 ` F1

(i) Implication introduction: (F1 ` F2) ` F1 ⇒ F2

(j) Double negation introduction: F1 ` ¬¬F1

(k) Implication elimination (Modus Ponens):F1, F1 ⇒ F2 ` F2

(l) Modus Tollens: F1 ⇒ F2,¬F2 ` ¬F1

(m) Universal quantifier elimination: ∀XF ` F [t/X]

(n) Universal quantifier introduction: F [Y/X] `∀XF

(o) Existential quantifier introduction: F [t/X] `∃XF

(p) Existential quantifier elimination:∃XF1, (F1[Y/X] ` F2) ` F2

3. Model Semantics

(a) Model: An interpretation I is a model of a for-mula F iff I(F ) is true.

(b) Tautology: A formula F is a tautology iff allinterpretation are models.

(c) Contradiction: A formula F is a contradictioniff no interpretation is model.

(d) Contingency: A formula F is a contingency iffit is neither a tautology nor a contradiction.

(e) Logical Consequence: F1 |= F2 iff all models ofF1 are models of F2

(f) Logically Equicalent: F1 ≡ F2 iff they have thesame models.

(g) I(∃XF ) = I(∨

c∈UHF [c/X])

(h) I(∀XF ) = I(∧

c∈UHF [c/X])

4. Boolean Algebra

(a) Identity of ×: x× 1 = x

(b) Identity of +: x + 0 = x

(c) Complementation of ×: x× x̄ = 0

(d) Complementation of +: x + x̄ = 1

(e) Associativity of ×: x× (y × z) = (x× y)× z =x× y × z

(f) Associativity of +: x + (y + z) = (x + y) + z =x + y + z

(g) Commutativity of ×: x× y = y × x

(h) Commutativity of +: x + y = y + x

(i) Distributivity of × over +: x × (y + z) = (x ×y) + (x× z)

(j) Distributivity of + over ×: x + (y × z) = (x +y)× (x + z)

(k) Idempotence of ×: x× x = x

(l) Idempotence of +: x + x = x

(m) Annihilator of ×: x× 0 = 0

(n) Annihilator of +: x + 1 = 1

(o) Absorption of ×: x× (x + y) = x

(p) Absorption of +: x + (x× y) = x

(q) Unicity of complement: If x×y = 0 and x+y = 1then y = x̄

5. Set Theory

(a) Axiom 1: Empty set. There exist a set with noelements ∃X(∀Y (¬(Y ∈ X)))

(b) Axiom 2: Extensionality: Two sets are equalif and only if they have the same elements∀X∀Y ((∀Z(Z ∈ X ⇔ Z ∈ Y ))⇔ X = Y )

(c) Axiom 3: Pairing: There exists a set Z thatcontains X and Y . ∀X∀Y ∃Z∀T ((T = X ∨ T =Y )⇔ T ∈ Z)

(d) Axiom 4: Unions: ∀S∃T∀Y ((Y ∈ T ) ⇔∃Z((Z ∈ S) ∧ (Y ∈ Z)))

(e) Axiom 5: Power Sets: ∀S∃T∀X((X ∈ T ) ⇔(X ⊂ S))

(f) Axiom 6: Regularity: ∀X(X 6= ∅ ⇒ (∃Y (Y ∈X ∧ ∀Z(Z ∈ X ⇒ ¬(Z ∈ Y )))))

(g) Axiom 7: Infinity: ∃X(∅ ∈ X ∧ (∀Y (Y ∈ X ⇒Y ∪ {Y } ∈ X)))

Page 2: Summary of CS1231

(h) Axiom 8: Separation: ∀X∃Y ∀Z(Z ∈ Y ⇔ (Z ∈X ∧ P (Z)))

(i) Useful propositions and definitions:

i. Empty set is the subset of all sets:∀X∀Z((∀Y ¬(Y ∈ X))⇒ (X ⊂ Z))

ii. Definition of subset: ∀X∀Y (X ⊂ Y ⇔(∀Z(Z ∈ X ⇒ Z ∈ Y )))

iii. Another test for equality: ∀X∀Y ((X ⊂ Y ∧Y ⊂ X)⇔ X = Y )

iv. Intersection: Let S be a set of sets. Tis the intersection of the sets in sets if∀S∃T∀Y ((Y ∈ T ) ⇔ ∀Z((Z ∈ S) ⇒ (Y ∈Z)))

6. Relations

(a) The binary relation R is a subset of the Carte-sian product S × T

(b) sRt⇔< s, t >∈ R(c) Dom(R) = {s ∈ S | ∃t ∈ T (sRt)}, Im(R) ={t ∈ T | ∃s ∈ S(sRt)}, coDom(R) = T

(d) Inverse: If R ⊂ S × T , then ∀s ∈ S∀t ∈T (tR−1s⇔ sRt)

(e) Composition: If R ⊂ S × T,R′ ⊂ T × U , then∀x ∈ S∀z ∈ U(xR′ ◦ Rz ⇔ (∃y ∈ T (xRy ∧yR′z))).

(f) Composition is associative, and (R′ ◦ R)−1 =R−1 ◦ R′−1

(g) Reflexive: ∀X ∈ A(xRx)

(h) Symmetric: ∀x, y ∈ A(xRy ⇒ yRx)

(i) Transitive: ∀x, y, z ∈ A((xRy ∧ yRz)⇒ xRz)

(j) Equivalence relation: R is reflexive, symmetricand transitive.

(k) If R is an equivalence relation on a set A, thenthe equivalence class of x, ERx = {y ∈ A|xRy}.A/R is the set of equivalence classes.

(l) If R is an equivalence relation on a set A, thenA/R is a partition of A.

(m) The transitive closure of R, R∗ satisfies theproperties that R∗ is transitive and R ∈ R∗.Furthermore if S is another transitive relation,then R ∈ S ⇒ R∗ ∈ S

(n) Repeated composition: Rn =⊙

1≤i≤nR

(o) R∗ =⋃∞

i=1Ri

(p) Anti-symmetric: ∀x ∈ A∀y ∈ A((xRy∧yRx)⇒x = y)

(q) R is a partial order if it is anti-symmetric, reflex-ive and transitive. A relation that is a partialorder is denoted as �

(r) Two elements are comparable if a � b∨b � a. Atotal order is a partial order where all elementsare comparable.

(s) Maximal element: ∀y ∈ A(x � y ⇒ x = y).Maximum element, >: ∀x ∈ A(x � >)

(t) Minimal element: ∀y ∈ A(y � x ⇒ x = y).Maximum element, ⊥: ∀x ∈ A(⊥ � x)

(u) A is well ordered iff every non-empty subset ofA as a minimum element.

7. Functions (f ⊂ S × T unless stated otherwise)

(a) Uniqueness: ∃!x ∈ Tp(x) ≡ ∃x ∈ T (p(x) ∧ ∀y ∈T (p(y)⇒ x = y))

(b) Definition of function: f : S → T ⇔ ∀x ∈S ∃y ∈ T (x f y ∧ (∀z ∈ T (x f z ⇒ y = z)))or ∀x ∈ S ∃!y ∈ T (x f y)

(c) Notation: f(x) = y ⇔< x, y >∈ f

(d) Dom(f) = S

(e) x is a pre-image of y if f(x) = y while the inverseimage of y is the set of all its pre-images.

(f) The restriction of f to U is the set {< x, y >∈U × T | f(x) = y}

(g) Injection: ∀y ∈ T ∀x1 ∈ S ∀x2 ∈ S ((f(x1) =y ∧ f(x2) = y)⇒ x1 = x2)

(h) Surjection: ∀y ∈ T ∃x ∈ S (f(x) = y), Im(f) =T

(i) Bijection = Injection + Surjection

(j) f is bijective iff f−1 is a function

(k) Notation: g(f(x)) = (g ◦ f)(x). If f : S → Tand g : T → U are both functions, then g ◦ f isa function.

(l) Identity function, IA: ∀x ∈ A(IA(x) = x)

(m) If f : A→ A is injective, then f−1 ◦ f = IA(n) A n-ary operation on a set A is a function f :∏n

1 A→ A

(o) Proving injectivity: Suppose f(x1) = f(x2),then prove x1 = x2

(p) Proving surjectivity: Express x in terms of yand then check if it is within the domain.

8. Number systems

(a) Peano’s Axioms: The set of natural numbers isthe smallest set such that:

i. ∃0 (0 ∈ N)

ii. There exist a function s on N. s(n) = n′,the successor of n.

iii. ∀n ∈ N (n′ 6= 0)

iv. n ∈ N ∀m ∈ N (n′ = m′ ⇒ n = m)

Page 3: Summary of CS1231

v. ∀K ⊂ N ∀n ∈ N ((0 ∈ K ∧ (n ∈ K ⇒ n′ ∈K))⇒ K = N)

(b) Ordering Lemma: Let m ∈ Nc. Then n ≤ m ∨m ≤ n.

(c) Addition is the smallest binary operation on Nsuch that:

i. ∀n ∈ N (n + 0 = n)

ii. ∀n ∈ N ∀m ∈ N(n + m′ = (n + m)′)

(d) Multiplication is the smallest binary operationon N such that:

i. ∀n ∈ N (n× 0 = 0)

ii. ∀n ∈ N∀m ∈ N(n×m′ = (n×m) + n)

(e) Integers

i. Let ≈ be a relation on N × N such that∀n1 ∈ N ∀n2 ∈ N ∀m1 ∈ N ∀m2 ∈N (< n1, n2 >≈< m1,m2 >⇔ n2 + m1 =m2 + n1). The set of integers is given byZ = (N× N)/ ≈

ii. a + b =< a1 + b1, a2 + b2 >

iii. a− b =< a1 + b2, a2 + b1 >

iv. a×b =< a1×b2+a2×b1, a1×b1+a2×b2 >

(f) Rationals

i. Let ≈ be a relation on N×N\{0} such that∀n1 ∈ N ∀n2 ∈ N\{0} ∀m1 ∈ N ∀m2 ∈N\{0} (< n1, n2 >≈< m1,m2 >⇔ n2 ×m1 = m2×n1). The set of rationals is givenby Z = (N× N\{0})/ ≈

ii. a× b =< a1 × b1, a2 × b2 >

iii. a + b =< (a1 × b2 + b1 × a2, a2 × b2 >

iv. a− b =< (a1 × b2 − b1 × a2, a2 × b2 >

v. a/b =< a1 × b2, a2 × b1 >

9. Number Theory

(a) Let n ∈ N and m ∈ N+. m|n ⇔ ∃q ∈ N (n =m× q)

(b) Division algorithm: Let n ∈ N, m ∈ N+, ∃!q ∈N ∃!r ∈ N (n = q ×m + r ∧ r < m)

(c) n and m are relatively prime (n ⊥ m) iff ∀c ∈N+(((c|n) ∧ (c|m))⇒ c = 1)

(d) p is prime if p > 1 ∧ (∀n ∈ N+ (n|p ⇒ (n =p ∨ n = 1)))

(e) The gcd of n and m is defined suchthat (gcd(n,m)|n) ∧ (gcd(n,m)|m) ∧ (∀q ∈N+ (((q|n) ∧ (q|m))⇒ q ≤ gcd(n,m)))

(f) The lcm of n and m is defined suchthat (n|lcm(n,m)) ∧ (m|lcm(n,m)) ∧ (∀q ∈N+ (((n|q) ∧ (m|q))⇒ lcm(n,m) ≤ q))

(g) Bezout’s Identity: Let n ∈ N+, m ∈ N+. ∃a ∈Z ∃b ∈ Z (n× a + m× b = gcd(m,n))

(h) Euclid’s Lemma: Let n ∈ N+, m ∈ N+. Letp ∈ N+. (prime(p) ∧ (p|n×m))⇒ (p|n ∨ p|m)

(i) Factorisation: n =∏

i∈I pi

(j) Fundamental theorem of arithmetic: Every pos-itive natural number has a unique factorisation.

(k) n ≡ m (mod c) ⇔ (m < n ∧ c|n − m) ∨ (n <m ∧ c|m− n) ∨ (n = m)

(l) If n1 ≡ m1 (mod c) ∧ n2 ≡ m2 (mod c), thenn1 + n2 ≡ m1 + m2 (mod c)

(m) If n1 ≡ m1 (mod c) ∧ n2 ≡ m2 (mod c), thenn1 × n2 ≡ m1 ×m2 (mod c)

(n) Fermat’s Little Theorem: If p is prime then ap ≡a (mod p)

10. Cardinality

(a) A set is finite iff it is the empty set or there is abijection from the set to some Zn

(b) Cardinality of a finite set is 0 if the set is emptyset or n if there is a bijection from the set tosome Zn.

(c) ℵ0 ≡ |Z+|(d) A set is countably infinite iff |S| = ℵ0. Other-

wise it is uncountable. A set is countably infiniteiff its elements can be arranged without dupli-cation and omission in an infinite list.

(e) Given n countably infinite sets, the cartesianproduct of these sets are also countably infinite

(f) The union of countably many countable sets iscountable

(g) The set of real numbers is uncountable

(h) |A| < |P(A)|(i) |R| = |P(Z)|

11. Counting

(a) Product Rule: If A1, A2, · · ·An are finite sets,then |

∏ni=1Ai| =

∏ni=1 |Ai|.

(b) Sum Rule: If A1, A2, · · ·An are disjoint finitesets, then |

⋃ni=1Ai| =

∑ni=1 |Ai|.

(c) Difference Rule: if A is a finite set and B is asubset of A, then |A−B| = |A| − |B|.

(d) Principle of Inclusion and Exclusion:|⋃n

i=1Ai| =∑

1≤i≤n |Ai| −∑

1≤i≤j≤n |Ai ∩Aj | +

∑1≤i≤j≤k≤n |Ai ∩ Aj ∩ Ak| − · · · +

(−1)n+1|⋂n

i=1Ai|(e) The number of permutations of a set of n dis-

tinct elements is n!

(f) The number of ordered selection of r objectsfrom n objects is P (n, r) = n!

(n−r)!

Page 4: Summary of CS1231

(g) The number of unordered selection of r objectsfrom n objects is C(n, r) = n!

(r!(n−r)!

(h) The number of permutations of n objects wherethere are ni indistinguishable objects of type ifor i = 1, 2, · · · k and

∑ki=1 n1 = n, is n!

n1!n2!···nk!

(i) The number of r-combinations with repetitionallowed that can be selected from n items isC(n + r − 1, r)

(j) Binomial theorem: (x + y)n =∑n

r=0

(nr

)xn−ryr

(k) Pascal’s identity:(n+1k

)=(

nk−1)

+(nk

)(l) Generalised Pigeonhole Principle: If N objects

are placed into k boxes, there is at least 1 boxwhich contain at least dNk e objects.

12. Graphs

(a) A pseudograph G = (V (G), E(G), fG) consistsof

i. A non-empty vertex set of vertices

ii. An edge set of edges

iii. An incidence function fG : E(G) →{{u, v}|u, v ∈ V (G)}

(b) An edge e is called a loop if fG(e) = {u} forsome u ∈ V (G)

(c) If fG(e1) = fG(e2), then the two edges are calledmultiple or parallel edges

(d) A simple graph has no loops or parallel edges, amultigraph has no loops

(e) An edge e is incident with vertices u and v iffG(e) = {u, v}. The two vertices are adjacent.Two edges are called adjacent if they have areincident with a common vertex.

(f) A directed multigraph G = (V (G), E(G), fG)consists of

i. A non-empty vertex set of vertices

ii. An edge set of directed edges

iii. An incidence function fG : E(G) →{(u, v)|u, v ∈ V (G)}

(g) A complete graph is a simple graph where everytwo distinct vertices are adjacent

(h) A complete bipartite graph on (m,n) ver-tices, denoted by Km,n is a simple graph withV (Km,n) = {u1, u2, · · ·um} ∪ {v1, · · · vn} andE(Km,n) = {{ui, vj}|i = 1, · · · ,m; j = 1, · · ·n}

(i) A graph H is a subgraph of G if V (H) ⊆ V (G),E(H) ⊆ E(G) and ∀e ∈ E(H) (fH(e) = fG(e))

(j) The vertex degree dG(v) of vertex v is the num-ber of edges incident with v

(k) Handshake Theorem: Let G be an undirectedgraph. Then

∑v∈V (G) dG(v) = 2|E(G)|

(l) A walk of length n in G is defined as an al-ternating sequence of vertices and edges of Gv0e1v1e2 · · · envn where ei connects its endpointsvi−1 and vi. A trail is a walk of distinct edgeswhile a path is a trail with distinct vertices.

(m) A graph is connected if there is a walk betweenany two vertices in the graph.

(n) An undirected graph H is called a connectedcomponent of G if H is a subgraph of G, H isconnected and no connected subgraph of G hasH as its proper subgraph.

(o) An Euler trail is a trial traversing all edges in agraph. A closed walk is a walk that starts andends at the same vertex. A tour is a closed walkthat traverse all edges in a graph at least once.An Euler tour is a tour that traverse each edgeexactly once.

(p) A graph has an Euler tour if and only if it hasno vertices of odd degree. A graph has an Eulertrail but not an Euler tour if and only if it hasexactly two vertices of odd degree.

(q) A Hamiltonian path is a path containing all ver-tices in G. A cycle is a closed trail whose originand internal vertices are distinct. A Hamilto-nian cycle is a cycle which contains all verticesof G.

(r) Let G be an undirected graph and the verticesare ordered as V (G) = {v1, v2, · · · vn}. The ad-jacency matrix of G is the n×n matrix A(G) =[aij ] such that aij = |{e ∈ E(G)|fG(e) ={vi, vj}}|

13. Trees

(a) A tree is an acyclic connected undirected graph.A forest is an acyclic undirected graph.

(b) There is a unique path between any two distinctvertices in a graph iff the graph is a tree

(c) If G is a tree iff |E(G)| = |V (G)| − 1

(d) A graph H is a subgraph of graph G if V (H) ⊆v(G), E(H) ⊆ E(G) and ∀E(H) fH(e) = fG(e)

(e) A spanning subgraph of a graph is a subgraph ofa graph which contains all vertices in the graph.A spanning tree is a spanning subgraph whichis a tree

(f) A graph is connected if and only if there is aspanning tree

(g) A weighted graph is a graph where all edges hasan associated real valued weight

(h) A minimum spanning tree of a connectedweighted graph is the spanning tree that has thesmallest possible sum of weights in its edges