[rich_list] Added IS_PREFIX_FINITE, etc. (The set of prefixes is finite) #1184
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,
Today I was in the need of the following theorem stating that "the set of all prefixes of a given list, is finite":
My idea of the proof is based on rewriting
IS_PREFIX
toTAKE
(and then useIMAGE_FINITE
to finish the proof):The above theorems are to be added into
rich_listTheory
.But then this makes me wonder how to prove that "the set of all sublists of a list is finite", i.e.
∀l. FINITE {l1 | IS_SUBLIST l l1}
? (I can imagine that a sublist may be obtained by first do aTAKE
and then aDROP
, or in reversed order, thus leads to finite number of possibilities, but this proof seems not easy)This will subsume the above IS_PREFIX_FINITE, since we have:
Furthermore, IS_SUFFIX_FINITE can be easily proved too, if we know "the set of all subsets of a list is finite", before suffix is also a sublist: