Define the integers ℤ inductively in the following way:
If n ∈ ℕ, then non-neg
(n) ∈ ℤ.
If n ∈ ℕ, then neg-suc
(n) ∈ ℤ.
The idea is that non-neg
(n) stands for n, and that neg-suc
(n) stands for -(1 + n).
(2p) Which of the following proof methods, if any, are correct? (The variable P stands for an arbitrary integer predicate.)
(∀ n ∈ ℕ. P(non-neg
(n))) ∧ (∀ n ∈ ℕ. P(neg-suc
(n))) ⇒ ∀ i ∈ ℤ. P(i).
(∀ n ∈ ℕ. P(non-neg
(n)) ⇒ P(non-neg
(n + 1))) ∧
(∀ n ∈ ℕ. P(neg-suc
(n)) ⇒ P(neg-suc
(n + 1))) ⇒
∀ i ∈ ℤ. P(i).
(∀ n ∈ ℕ. P(non-neg
(n)) ⇒ P(non-neg
(n + 1))) ∧
(∀ n ∈ ℕ. n ≥ 1 ∧ P(neg-suc
(n)) ⇒ P(neg-suc
(n - 1))) ⇒
∀ i ∈ ℤ. P(i).
Let us say that we want to prove that ℤ is in bijective correspondence with Bool × ℕ. Define the function f ∈ ℤ → Bool × ℕ in the following way:
non-neg
(n)) = (true
, n)neg-suc
(n)) = (false
, n + 1)(1p) Which of the following functions, if any, are inverses of f?
g(true
, n) = non-neg
(n)
g(false
, n) = neg-suc
(n)
h(true
, n) = non-neg
(n)
h(false
, 0) = neg-suc
(0)
h(false
, n + 1) = neg-suc
(n)
i(true
, n) = non-neg
(n + 1)
i(false
, 0) = non-neg
(0)
i(false
, n + 1) = neg-suc
(n)
Now on to alphabets, strings and languages:
(1p) Which of the following statements, if any, are correct? (Σ is the alphabet {0, 1}, |w| is the length of the string w.)
ε ∈ Σ*.
ε ∈ Σ+.
11 ∈ Σ11.
11 ∈ Σ|11|.
(1p) Which of the following statements, if any, are correct? (Σ is the alphabet {0, 1}.)
Σ+ ⊆ Σ*.
{ε} ⊆ ∅.
{ww|w ∈ Σ*} ⊆ Σ*.
{ww|w ∈ Σ*} ⊆ Σ+.