Closed binghe closed 5 months ago
That theorem is already present in rich_listTheory
under name FINITE_prefix
, but the characterisations of prefix in terms of TAKE might still be useful.
Ah, thanks, I didn't see FINITE_prefix
. After your addition of FINITE_BOUNDED_LISTS
, I think all similar results (for suffix and sublists) are now quite obvious. I have deleted IS_PREFIX_FINITE
and only kept the IS_PREFIX_EQ_TAKE
and IS_PREFIX_EQ_TAKE'
in the code changes.
Thanks!
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: