[lambda] The "congruence" of subterm properties w.r.t different excluded lists #1200
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,
given a solvable term, the concept of "subterm", along a path of numbers, is the specified (by the path) children term of the principle hnf converted from the original term, so on until the last path element:
Due to alpha-conversion, the returned subterm may contain some fresh variables generated according to an "excluded list" given as input parameter. The definition guarantees (see the part
vs = FRESH_list n (X ∪ FV M0)
) that whateverX
(the excluded list) will give the "correct" result, in the sense that the principle hnf ofM0 ·· MAP VAR vs
is indeed the inner body ofM0
without variable captures (becausevs
is fresh, disjoint withFV M0
).In general,
FRESH_list
(orNEW_TAC
) is like a blackbox: nothing can be said betweenFRESH_list n X
andFRESH_list n Y
except for their size of lists are the same. Therefore, in many related proofs, properties aboutsubterm X M p
cannot be directly used ifsubterm Y M p
is to be discussed, evenX
andY
themselves have some relationships.Here I proved a hard result saying that, for any
X
andY
, the actual term returned bysubterm X M p
andsubterm Y M p
differ only by a "term permutation" (tpm
), or they are bothNONE
(either both unsolvable or the path itself is invalid, accessing out bound of the hnf children lists):Actually the above theorem cannot be directly proved, without first generalizing to the following lemma involving
tpm
:Here, it's interesting to see (if taking both X and Y as X) that
subterm' X (tpm pi M) p
is nottpm pi (subterm' X p)
but with another different permutation list. This is because, although all free variables in M are permuted bypi
, the fresh binding list is completely different, and thereforesubterm' X (tpm pi M) p
actually contains two permutations: one is thepi
fromtpm pi M
, the other isZIP (vs,vs')
wherevs
andvs'
are the two internal fresh lists generated forM
andtpm pi M
. To prove the above lemma, a lot of new small theorems abouttpm
of existing concepts are added.Once the above results are obtained, all functions built upon this concept of "subterms" but only returning some numbers, can be proved to be independent with the input excluded list, e.g. the number of hnf children:
Another more interesting application is the following concept of "subterm (tree) width", i.e. the maximal number of hnf children along the given path
p
:Note that, when defining
subterm_width
, the empty set{}
has been used to withsubterm
. But then we can prove that this width is independent with this excluded list (actually a set, same for all above places), i.e. this number is the same for all possibleX
used in place ofsubterm X ...
:P. S. There are other related minor additions in core theories (
rich_list
andltree
) in this PR.Chun