In this example, we prove that the map [ entry "OH":"Ohio", [ entry "AK":"Alaska", [ entry "IA":"Iowa", [ ] ] ] ] contains key "AK." If there is an entry with key "AK," then the map contains "AK."

At each step, we observe the first entry in the map. If the key in the first entry is equal to "AK," then we have shown that the map contains key "AK." If not, pop the first entry off of the map and repeat.

For instance, the following:

map [ entry "OH": "Ohio", [ entry "AK": "Alaska", [ entry "IA": "Iowa", [ ] ] ] ] contains key "AK"

is equal to:

map [ entry "AK": "Alaska", [ entry "IA": "Iowa", [ ] ] ] contains key "AK"

which is True.

Quiz (1 point)

Prove that:
map [ entry "OH": "Ohio", [ entry "AK": "Alaska", [ entry "IA": "Iowa", [ ] ] ] ] contains key "AK" = True

The following properties may be helpful:

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.

Step Claim Reason (optional) Error Message (if any)
1
2
3
4
5
6
7
8
9
10

Become a subscriber to save your progress, see the correct answer, and more!