In this example, we prove that the list [2, [4, [6,[]]]] contains 4.
At each step, we observe the first element in the list. If the first element is 4, then we have shown that the list contains 4. If not, then pop the first element off the list and start over.
For instance, the first element of the following:
[ 2, [ 4, [ 6, [ ] ] ] ]
is 2, which is not 4. After we pop 2, the list becomes:
[ 4, [ 6, [ ] ] ]
The first element is 4, so we have found our value, and the proof is complete.
Quiz (1 point)
- not (2 = 4)
- a = a
if not (x = value), then stack [ x, y ] contains value = stack y contains value
if x = value, then stack [ x, y ] contains value = True
if the following are true:
- a = b
- b = c
then a = c
Please write your proof in the table below. Each row should contain one claim. The last claim is the statement that you are trying to prove.