[lambda] agree_upto_lemma (enhanced) #1354
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
This PR follows #1348 and fixed the involved definitions and proofs. Previously, the definition of
agree_upto
requires literal equivalent of corresponding Böhm tree notes between two terms (ltree_el (BT' X M r) q = ltree_el (BT' X N r) q
). This turns out to be wrong (not general enough). Instead, the concept ofsubtree_equiv
(based onhead_equivalent
) should be used:In short words, previously the equivalence of corresponding tree nodes is
y1 = y2 /\ n1 = n2 /\ m1 = m2
, now it's relaxed toy1 = y2 ∧ n1 + m2 = n2 + m1
, which essentially captures the idea of η-equivalence between λ-terms.The proof of
agree_upto_lemma
(for the previously proved conclusions) becomes even more tedious, requiring some more devices on head reductions, which now involves "suffix" of lists:For this reason, I have also added a few new lemmas into
rich_listTheory
regardingIS_SUFFIX
, etc.Now the statements of
agree_upto_lemma
is slightly extended to the following:Note that the only difference between the above form and the final full form, is that the last logical implication
⇒
(between twosubtree_equiv
s) will be an "if and only if" in the full form.Chun