< Home

1

Proof by contradiction works because

[P[P¬Q    false]]    Q \left[P \land \left[P \land \neg Q \implies \text{false}\right] \right] \implies Q

Naïve axioms of set theory

  1. Sets and objects can be defined and can be identified using the definition
  2. For any object and any set, we can determine if the object is in the set (xAx \in A)
  3. Sets can be formed by specifying the elemetns of the set, e.g. $X = \left{ \text{people with blue eyes} \right} or A={xR:x29}A = \left\{ x \in \R : x^2 \ge 9 \right\}

#proof:

SFAC, 1-3 are true.

let B={xx is a set and x∉x}B = \left\{x | x \text{ is a set and }x \not\in x \right\}

By ax. 2, we can determine if BBB \in B or B∉BB \not\in B.

Claims:

B∉BB \not\in B SFAC BBB \in B, then BB is a set and BB is an element of itself, but BB should not contain sets which are elements of themselves. So B∉BB \not\in B. Contradiction

Since B∉BB \not\in B, then BB is a set and B∉BB \not\in B. So, by def of BB, BBB \in B. Contraction. So at least one of our assumptions is not true.


Formal Languages

#def:

In CSC 310 the term language is defined to be "a set of strings of characters"

Syntax - form taken by various valid expressions
Semantics - meaning associated with those valid expressions

In this class, our goal is to know which words are associated with certain formal languages.

#def:

How can we precisely define an infinite language?

Using English

"All odd length strings of 1s"

English is often vague and/or ambiguous

#Side Note:

Λ\Lambda used to represent the empty string

List enough to establish a pattern

For "all odd length string of 1s":

L1={1,111,11111,} L_1 = \{1, 111, 11111, \dots\}

For "all even length string of 1s":

L2={Λ,11,1111,111111,} L_2 = \{\Lambda, 11, 1111, 111111, \dots\}

Using mathematical expressions

for "all even length strings of 1s"

L1={12N for N=0,1,2,3,} L_1 = \left\{1^{2N} \text{ for } N = 0, 1, 2, 3, \dots\right\}

but then notations must be explained

12N1^{2N} is not mathematical (in this case), the exponent is the number of times the character must be repeated

Operations

#def:

Closure of a language under concatenation is the set of all strings that can be derived from applying the concatenation operation to the characters int he alphabet in all possible combinations

For an alphabet Σ\Sigma, we generally denote this closure language as Σ\Sigma^\ast, sometimes called "Sigma Star" or "Kleene Star"

Ex: given Σ={a}\Sigma = \{a\}, then Σ={Λ,a,aa,aaa,}\Sigma^\ast = \{\Lambda, a, aa, aaa, \dots\}

Ex: given Σ={a,b}\Sigma = \{a, b\}, then Σ={Λ,a,b,aa,ab,ba,bb,aaa,aab,aba,abb,}\Sigma^\ast = \{\Lambda, a, b, aa, ab, ba, bb, aaa, aab, aba, abb, \dots\}

#ex:

If S={a,bb}S = \{a, bb\}, find SS\ast.

S={Λ,a,aa,bb,aaa,abb,bba,aaaa,abba,bbaa,aabb,bbbb,}S^\ast = \{\Lambda, a, aa, bb, aaa, abb, bba, aaaa, abba, bbaa, aabb, bbbb, \dots\}

#ex:

If S={ab,b}S = \{ab, b\}, find SS\ast.

S={Λ,b,ab,bb,bab,bbb,abb,bbab,bbbb,babb,abbb,abab}S^\ast = \{\Lambda, b, ab, bb, bab, bbb, abb, bbab, bbbb, babb, abbb, abab \dots\}

Proving that a word is in a language

"Constructive Proof/Algorithm"

Prove by constructive algorithm that "abba" is a word in SS^\ast where S={a,bb,ba,ba}S = \{a, bb, ba, ba\}

  1. By definition of the \ast operator, SS\ast contains all words that can be constructed from the underlying factors of SS.
  2. "abba" is thus a word in SS\ast because "abba" can be constructed by the concatenation seq (ab) (ba).

#def:

Modified Kleene closure using ++ as superscript:

For S={a,b}S = \{a, b\}

S={Λ,a,b,aa,ab,ba,bb,}S^\ast = \{\Lambda, a, b, aa, ab, ba, bb, \dots\}
S+={a,b,aa,ab,ba,bb,}S^+ = \{a, b, aa, ab, ba, bb, \dots\}

#ex:

Prove by constructive algorithm that for S={xx,xxx}S = \{xx, xxx\} that S+S^+ contains all words of the form xNx^N for N>1N > 1

In general, any word in the form xNx^N where N>3N > 3 can be constructed from (xN2)(xx)(x^{N-2})(xx)

This

a

#def: (Axiom of extension)

Two sets are equal iff they have the same elements.

#proof: (Prove that (AB)(AB)=AB(A \cup B) \cap (A \setminus B) = A \setminus B)

Let x(AB)(AB)x \in (A \cup B) \cap (A \setminus B). So by def of intersection, xABx \in A \cup B and xABx \in A \setminus B. So xABx \in A \setminus B which shows (AB)(AB)AB(A \cup B) \cap (A \setminus B) \subseteq A \setminus B Let xABx \in A \setminus B. Then xAx \in A and xBx \in B. Since xAx \in A, then xABx \in A \cup B. So xABx\in A \cup B and xABx \in A \setminus B. So $x \in (A \cup B)\ap (A \setminus B).

[there's more that I don't feel like writing ...]

#thm: (For any set of strings SS, S=SS^\ast = S^{\ast\ast})

Recursive Definitions of Languages

Recursive definitions can be used to define lnaguages

Each recursive language definition consists of three parts

  1. We explicitly define some elements of the set (base case)
  2. We provide one or more rules for constructing additional elts of the set from known elts
  3. We specify that no other words are allowed

Example

Consider language L1L_1 which can be defined in English as "all strings of x's length one or greater"

Here is a recursive def:

  1. "x" is a word in L1L_1
  2. If QQ is a word in L1L_1 the concat("x", QQ) is also a word in L1L_1
  3. L1L_1 contains only those words that can be generated from rules 1 and 2

RegExp

Definition

Every individual character when bold is a regex, Λ\Lambda when written in boldface is a regex

If R1R_1 and R2R_2 are regexps then so are:

  1. (R1)(R_1) - define scope
  2. R1R2R_1R_2 - concat
  3. R1+R2R_1 + R_2 - or
  4. R1R_1^* - {0,}