⊆ × , 0 ∈ • is a preserved invariant if ∀ ∈ . ∧ ( → ) ∈ ⟹ () • Invariant Principle: If is preserved invariant and (0 ) is true it is true for all reachable states.
: 1. Model it as a state machine M 2. Show it eventually terminates 3. Show partial correctness (if it ends it is correct) a) Find a “good” preserved invariant P for M b) Show ()=true for final state q implies correct output c) Show 0 =true for start state
Base case(s) that specify some elements are in – Constructor case(s) that specify how to construct new data element ∈ from previously constructed 1 , 2 , … ∈ • To define (new) operators on we again use base and constructor cases!
there is a bijection between and ℕ. is infinite, if there is no bijection between and any ℕ . Equivalent : ℕ ≤ || : there is a surjective function from to ℕ is Countable : ≤ |ℕ| : there is a surjective function from ℕ to . A set is uncountable iff it is not countable.
is finite. • Set of all words using English letters… is an infinite set. It includes all the finite sequences of a,b, which by interpreting = 0, = 1 we get all the natural numbers written in binary (and a lot more). So there is a surjective function from this set to ℕ.