Definition
Chain (Border, String)
Why the Shorter Border Fits Inside the Longer
Here we do not start by knowing that
The shared ends force nesting
The longer border
begins and ends with the shorter border .
Proof
- At the beginning of
: both and start at the first character. Since , the whole occurrence of lies in the beginning of . Hence is a prefix of . - At the end of
: both and finish at the last character. Since , the whole occurrence of lies in the end of . Hence is a suffix of . These are occurrences of the same string
. Together they show that begins and ends with .
Transitivity goes in a different direction: it starts with
Following the Chain
If
Consequently, repeatedly taking the longest proper border visits all proper borders in decreasing length, ending at the empty string. No shorter border is lost by moving from
Examples
Two borders of ababa
Let
. Both and are borders of . At the beginning of
, is the first character of . At the end of , is the last character of . Thus is itself a border of . The longest-proper-border chain is