A proposition is a statement that has a truth value.
Definitions:
| T | is the proposition that is always true | (true) |
| F | is the proposition that is always false | (false) |
| ¬ p | is true iff p is false | (not p) |
| p ∧ q | is true iff p and q are both true | (p and q) |
| p ∨ q | is true iff one or both of p and q are true | (p or q) |
| p ⇒ q | is true iff p is false or q is true | (p implies q) |
| p ⇔ q | is true iff p and q are both true or both false | (p if and only if q) |
| ∀ x. p | is true iff p is true for every x | (for all) |
| ∃ x. p | is true iff p is true for at least one x | (there exists) |
A set is an unordered collection of unique elements built according to formation rules of a rigourous axiomatic set theory (because not all such collections are sets).
Examples:
| {1, 5, 2} |
| {α, 0, {2, w, Ω {}}, {{2}, hi}, ω} |
| {p | p is prime or p = 0} |
| {(x, y, z) | x2 + y2 = z2} |
Definitions:
| ∅ = { } | (the empty set) |
| B = {true, false} | (the set of booleans) |
| N = {0, 1, 2, 3, ...} | (the set of natural numbers) |
| Z = {..., -2, -1, 0, 1, 2, ...} | (the set of integers) |
| Q = {a ÷ b | a and b are integers and b ≠ 0} | (the set of rational numbers) |
| R = {x | x is a real number} | (the set of real numbers) |
x ∈ A means x is a member of set A.
x ∉ A means ¬(x ∈ A)
| 3 ∈ N |
| 'c' ∈ {σ | σ is a letter of the Roman alphabet} |
| Manitoba ∉ AustralianStates |
Note that {x | x ∉ x} is NOT a set.
Definitions:
| A ⊆ B | =def | ∀x. x ∈ A ⇒ x ∈ B | (subset of) |
| A = B | =def | A ⊆ B ∧ B ⊆ A | (equal to) |
| A ≠ B | =def | ¬(A = B) | (not equal to) |
| A ∪ B | =def | {x | x ∈ A ∨ x ∈ B} | (union) |
| A ∩ B | =def | {x | x ∈ A ∧ x ∈ B} | (intersection) |
| A – B | =def | {x | x ∈ A ∧ x ∉ B} | (minus) |
| A × B | =def | {(x,y) | x ∈ A ∧ y ∈ B} | (cross product) |
| 2A | =def | {P | P ⊆ A} | (powerset) |
| ∪A | =def | {x | x ∈ P for some P ∈ A} | (union) |
| ∩A | =def | {x | x ∈ P for all P ∈ A} | (intersection) |
| An | =def | { (a1, ..., an) | n ≥ 1 ∧ &forall i. ai ∈ A } |
Examples: Let A = {a, b. c} and B = {b, f}. Then
| A ∪ B = {a, b, c, f} |
| A ∩ B = {b} |
| A – B = {a, c} |
| A × B = {(a,b), (a,f), (b,b), (b,f), (c,b), (c,f)} |
| B1 = B = {b, f} |
| B2 = B × B = {(b,b), (b,f), (f,b), (f,f)} |
| B3 = B × B × B = {(b,b,b), (b,b,f), (b,f,b), (b,f,f), (f,b,b), (f,b,f), (f,f,b), (f,f,f)} |
| 2B = {∅, {b}, {f}, {b,f}} |
| (6, true, 7.3) ∈ N × B × R |
| (2, 3, 8) ∈ N × N × N = N3 |
Definition: A and B are disjoint iff A ∩ B = ∅
Definition: Π = {P1, P2, ... Pn} ⊆ 2A is a partition of A iff
Example: { EVEN, ODD } is a partition of N
| A ∪ A = A | (idempotency) |
| A ∩ A = A | (idempotency) |
| A ∪ B = B ∪ A | (commutativity) |
| A ∩ B = B ∩ A | (commutativity) |
| A ∪ (B ∪ C) = (A ∪ B ∪ C) | (associativity) |
| A ∩ (B ∩ C) = (A ∩ B ∩ C) | (associativity) |
| A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C) | (distributivity) |
| A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C) | (distributivity) |
| A ∪ (A ∩ B) = A | (absorption) |
| A ∩ (A ∪ B) = A | (absorption) |
| A – (B ∪ C) = (A – B) ∩ (A – C) | (DeMorgan) |
| A – (B ∩ C) = (A – B) ∪ (A – C) | (DeMorgan) |
| ∅ ⊆ A |
| A ⊆ A |
| A ⊆ A ∪ B |
| A ∩ B ⊆ A |
| A ∪ ∅ = A |
| A ∩ ∅ = ∅ |
| A – ∅ = A |
| ∅ – A = ∅ |
| A ⊆ B iff A ∪ B = B |
| A ⊆ B iff A ∩ B = A |
| A ⊆ B ⇒ A ∪ C ⊆ B ∪ C |
| A ⊆ B ⇒ A ∩ C ⊆ B ∩ C |
| A × ∅ = ∅ |
| A × (B ∪ C) = (A × B) ∩ (A × C) |
| A × (B ∩ C) = (A × B) ∩ (A × C) |
| (A × B) ∩ (C × D) = (A ∩ C) × (B ∩ D) |
| (A × B) ∪ (C × D) ⊆ (A ∪ C) × (B ∪ D) |
A relation is a subset of a cross product, i.e. R ⊆ A × B. A is the domain and B is the codomain. If (a,b) ⊆ R we write aRb. The inverse R–1 ⊆ B × A is {(b,a) | aRb}.
Example: ≤ ⊆ N × N, and (5,7) ∈ ≤, so we can write 5 ≤ 7.
For R ⊆ A × A we define:
More definitions
If R ⊆ A × B and S ⊆ B × C then the composition of R and S is S o R = {(a,c) | ∃b. aRb ∧ bSc}
A relation f ⊆ A × B is called a function iff every element of A appears exactly once as the first element of a pair in f. In this case we write f : A → B. If f is a function and (a,b) ∈ f we write f a = b, or f(a) = b, and say b is the value of f at a. The range of f is {b | ∃a. b = f a}.
Since functions are relations and therefore sets, we can write them in set notation, but there is also a nice short-cut called lambda-notation. These examples are all equivalent:
| {...(-1,5), (0,6), (1,7), (2,8), ...} |
| {(x, y) | x ∈ Z ∧ y = x + 6} |
| {(x, x+6) | x ∈ Z} |
| λx. x+6 |
More examples of functions
| λx. x2 – x + 4 |
| λn. n log2 n |
| λ(x, y). 5x + 2y - 7 |
| λx. λ y. 5x + 2y - 7 |
| λθ. λ(x, y). (x cosθ – y sinθ, x sinθ + y cosθ) |
If f is a function, do not say "the function f(x)" unless the function f when applied to x actually yields a function. Also do not say things like "the function n2" because n2 is a number. The function you probably have in mind is λn. n2.
Function iteration
Be careful, though, because many mathematicians don't know the difference between sin2θ and (sin θ)2, or they choose to blur the distinction and expect readers to figure out what they mean by context.
For f: A → B,
If f is a bijection from A to B, then f–1 is a bijection from B to A. Also ∀ a. f–1(f a) = a and ∀ b. f(f–1b) = b.
The cardinality of a set A is denoted |A| and obeys these axioms:
A set is infinite iff there is a bijection between it and a proper subset of itself. A set is finite iff it is not infinite.
Example: N is inifinite because λn.2n is a bijection from N to {0, 2, 4, 6, 8, ...}
If A is finite then there exists a bijection from it to {1, 2, ... k} for some k ≥ 0 in which case we define |A| = k. The cardinality of N is ℵ0. A is countable iff A is finite or |A| = ℵ0.
Examples:
| | ∅ | = 0 |
| | {a, b, c} | = 3 |
| | {8, 7, {6, 2, 4}, 3 | = 4 |
| | {∅} | = 1 |
| | Z | = ℵ0 |
Z is countable because λn. if even(n) then –n/2 else (n+1)/2 is a bijection from N to Z.
N × N is countable because this picture shows a bijection:

By a similar argument, Q, Ni, and any countable union if countable sets are all countable.
Cantor's Theorem: For any set A, |A| < |2A|. Proof: Clearly |A| ≤ |2A|, so we only have to show |A| ≠ |2A|. Proceed by contradiction assuming assume |A| = |2A| which implies there is a function g mapping A onto 2A. Consider Y = {x | x ∈ A ∧ x ∉ g(x)}. Is Y ∈ 2A? No. Is Y ∉ 2A? No. Thus g does not exist.
Similar arguments to Cantor's theorem show that the following sets are uncountable
The fact that {f | f:N→N} is uncountable means that there are functions for which no computer program can be written to solve, because programs are strings of symbols from a finite alphabet and thus there are only a countably inifinite number of them.
Numbers can be defined in terms of sets, but we're not showing how do to that here. Just know about
For natural numbers
Addition, multiplication, and exponentiation work for real numbers too. There are also "inverses"
Also important:
(This section is courtesy of Phil Dorin)
Examples
Properties
| abac = ab+c | (Example: 21028 = 210+8 = 262144) |
| ab / ac = ab–c | (Example: 210/28 = 210–8 = 4) |
| abc = (ab)c | (Example: 215 = (25)3 = (32)(32)(32) = 32768) |
| logb a = 1 / loga b | (Example: log1024 2 = 1 / (log2 1024) = 1/10 = 0.1 |
| logb a = (logc a) / (logc b) | (Example: log4 256 = (log2 256) / (log2 4) = 8 / 2 = 4 |
| logc a = (logc b)(logb a) | (Example: log10 2 = (log10 1024)(log1024 2) ≈ 3 × 0.1 = 0.3 |
| logb (xy) = (logb x) + (logb y) | (Example: log10 20 = log10 (10 × 2) = log10 10 + log10 2 ≈ 1 + 0.30 = 1.30 |
| logb (x / y) = (logb x) – (logb y) | (Example: log2 (1024/16) = log2 1024 – log2 16 = 10 – 4 = 6 |
| logb (xy) = y(logb x) | (Example: log2 (43) = 3(log2 4) = 6 |
| alogc b = blogc a | (Example: 32log2 8 = 8log2 32 = 85 = 32768) |
Computing Some Logs
How well did we do?
| x | Our approximation |
True value to five decimal places |
|---|---|---|
| 1 | .00 | .00000 |
| 2 | .30 | .30103 |
| 3 | .48 | .47712 |
| 4 | .60 | .60206 |
| 5 | .70 | .69897 |
| 6 | .78 | .77815 |
| 7 | .84 | .84510 |
| 8 | .90 | .90309 |
| 9 | .95 | .95424 |
| 10 | 1.00 | 1.00000 |
Not bad! Let's keep going...
Using logs to estimate
(This section is courtesy of Phil Dorin)
Don't miss Robert P. Munafo's big numbers pages.
Also useful in computer science, but not covered here: