I need help executing a mathematical Induction for the following equation:
add(x,succ(y)) = succ(add(x,y))
I know that I have to either substitute n or m for "zero" for the Base Case, but I don't know what exactly I have to do after this.
To show: add(x,succ(y)) = succ(add(x,y))
Proof: Induction over x
Base Case: x = zero
To show: add(zero,succ(y)) = succ(add(x,y))
Proof
add(zero,succ(y))
add(succ(y))
This is my attempt so far but I don't know how to follow up on this. I would really appreciate if someone could help me with this one.
Your base case framing is about right, but the steps you are taking are a little unclear.
Base case to show: $\text{add}(0,\text{succ}(y)) = \text{succ}(\text{add}(0,y))$
$\begin{align} \text{we know }\qquad\text{add}(0,k) &=k\\ \text{so }\quad\text{add}(0,\text{succ}(y)) &= \text{succ}(y) \\ \text{and }\quad\text{succ}(\text{add}(0,y)) &= \text{succ}(y) \end{align}$
Therefore the two expressions in the base case are the same, as required.
Inductive hypothesis: $\text{add}(x,\text{succ}(y)) = \text{succ}(\text{add}(x,y))$
Need to show: $\text{add}(\text{succ}(x),\text{succ}(y)) = \text{succ}(\text{add}(\text{succ}(x),y))$
$\begin{align} \text{we know }\qquad\text{add}(\text{succ}(a),b) &= \text{succ}(\text{add}(a,b))\\ \text{so }\quad\text{add}(\text{succ}(x),\text{succ}(y)) &= \text{succ}(\text{add}(x,\text{succ}(y))) \\ &= \text{succ}(\text{succ}(\text{add}(x,y))) \quad\text{by the hypothesis}\\ &= \text{succ}(\text{add}(\text{succ}(x),y)) \quad\text{as required}\\ \end{align}$
which completes the inductive proof.