Refactoring 2
If
So what is this mysterious
For any
- The first case is that
where and such that . By the definition of reduction, by consistency of . hence selecting , we have . - The next case is
. By induction whenever , we have such that . Hence . But . By definition any is equal to for some , completing this part. - There will be two cases if
. - one where
. In this case, where . By induction, there exists such that . which means that and - The other case where
has a proof symmetric to the above case.
- one where
- Now, consider
. Take some for any . By induction, there exists such that . but of course , by def. - The cases of primitive, index, and all lambda is vacuous.
Theorem 4: Completeness of
Statement:
Let
Proof:
We proceed by structural induction on
-
Base Case:
There exists asuch that . By induction on , combined with the definition of , we have
,
which is what we needed to show. -
Inductive Case: Assume
. From the definition of
, at least one of the following cases must hold: -
Case 1:
and
Since, we can invoke the completeness of to construct a such that and . Combining these facts with the definition of , we get:
. -
Case 2:
and where
Becauseand by assumption , we know that and . By induction, . Combining with the definition of , we get:
. -
Case 3:
and where
This case is symmetric to the previous case and follows a similar argument.
-
Theorem 5: Consistency and Completeness of
Statement:
Let
if and only if
Proof:
We proceed by induction on
-
Base Case:
In this case,and . The theorem holds immediately. -
Inductive Step: Assume
.
If, then there exists a such that
.
By induction on, we have . Combined with , we can invoke the completeness of to get:
. Conversely, if
, by unrolling the definitions, reduces to in at most steps. This completes the proof.