Documentation

FormalConjectures.Other.SuffixPrefixAvoidance

Suffix-prefix avoidance bound #

Let $A$ and $B$ be sets of words of length $n$ over an alphabet with $q$ letters. If no (nonempty) suffix of any word in $A$ coincides with a prefix of any word in $B$, then $$|A| \cdot |B| \leq \frac{q^{2n}}{en}.$$

References:

def SuffixPrefixAvoidance.wordSuffix {n q : } (w : Fin nFin q) (k : Fin n) :
Fin (k + 1)Fin q

The suffix of a word w : Fin n → Fin q of length k + 1 (the last k + 1 characters).

Equations
Instances For
    def SuffixPrefixAvoidance.wordPrefix {n q : } (w : Fin nFin q) (k : Fin n) :
    Fin (k + 1)Fin q

    The prefix of a word w : Fin n → Fin q of length k + 1 (the first k + 1 characters).

    Equations
    Instances For

      Two sets of words $A, B$ over Fin q of length n are suffix-prefix avoiding if no nonempty suffix of any word in $A$ equals any prefix of any word in $B$ of the same length.

      Equations
      Instances For
        theorem SuffixPrefixAvoidance.words_naive_bound {n q : } (A B : Finset (Fin nFin q)) :
        A.card * B.card q ^ (2 * n)

        $A$ and $B$ are sets of words of length $n$ over alphabet with $q$ letters. Trivially then $|A| \cdot |B|$ is at most $q^{2n}$.

        theorem SuffixPrefixAvoidance.suffix_prefix_avoidance_bound {n q : } (A B : Finset (Fin nFin q)) (hq : 0 < q) (hn : 0 < n) (h : IsSuffixPrefixAvoiding A B) :
        A.card * B.card q ^ (2 * n) / (Real.exp 1 * n)

        $A$ and $B$ are sets of words of length $n$ over alphabet with $q \geq 1$ letters. No suffix of a word in $A$ coincides with a prefix of a word in $B$. Then $|A| \cdot |B|$ is at most $\frac{q^{2n}}{en}$.

        This problem is from Maximal sets of strings with no prefix-suffix overlap and was proved in An isoperimetric inequality for word overlap.

        theorem SuffixPrefixAvoidance.suffix_prefix_avoidance_weaker_bound {n q : } (A B : Finset (Fin nFin q)) (_hq : 0 < q) (hn : 0 < n) (h : IsSuffixPrefixAvoiding A B) :
        A.card * B.card q ^ (2 * n) / n

        $A$ and $B$ are sets of words of length $n$ over alphabet with $q \geq 1$ letters. No suffix of a word in $A$ coincides with a prefix of a word in $B$. Then $|A| \cdot |B|$ is at most $\frac{q^{2n}}{n}$.