FormalConjectures/Other/SuffixPrefixAvoidance.lean

GitHub source file

Explanation legend Lean4 Domain Explanation Language (L4DEL)

L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.

L4DEL
Lean4 Domain Explanation Language

Credit: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.

Project sources: Pinned project documentation, Formal Conjectures paper, arXiv v1

6 declarations, 2 contain sorry, 0 declared as axioms

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:

Imports (1)
  1. def SuffixPrefixAvoidance.wordSuffix The suffix of a word w : Fin n → Fin q of length k + 1 (the last k + 1 characters) line 45 source

    Source documentation

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

    standard axioms: Quot.sound, propext what this means

    Statement uses: Nat, Fin, HAdd.hAdd, OfNat.ofNat

    Proof uses: Fin.mk, HSub.hSub

    11 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.

    def wordSuffix (w : Fin n → Fin q) (k : Fin n) : Fin (k + 1) → Fin q :=
    …
  2. def SuffixPrefixAvoidance.wordPrefix The prefix of a word w : Fin n → Fin q of length k + 1 (the first k + 1 characters) line 49 source

    Source documentation

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

    standard axioms: Quot.sound, propext what this means

    Statement uses: Nat, Fin, HAdd.hAdd, OfNat.ofNat

    Proof uses: Fin.mk

    9 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.

    def wordPrefix (w : Fin n → Fin q) (k : Fin n) : Fin (k + 1) → Fin q :=
    …
  3. def SuffixPrefixAvoidance.IsSuffixPrefixAvoiding 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 line 54 source

    Source documentation

    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.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, Finset, Fin

    Proof uses: Membership.mem, Ne, HAdd.hAdd, OfNat.ofNat, SuffixPrefixAvoidance.wordSuffix, SuffixPrefixAvoidance.wordPrefix

    6 instances, coercions and auxiliary constants left out.

    def IsSuffixPrefixAvoiding (A B : Finset (Fin n → Fin q)) : Prop :=
    …
  4. theorem SuffixPrefixAvoidance.words_naive_bound $A$ and $B$ are sets of words of length $n$ over alphabet with $q$ letters line 62 source

    Source documentation

    $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}$.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, Finset, Fin, LE.le, HMul.hMul, Finset.card, HPow.hPow, OfNat.ofNat

    Proof uses: of_eq_true, Eq.trans, True, congrArg, HAdd.hAdd, two_mul, pow_add, Fintype, Eq, Fintype.card, eq_true, LE.le.trans_eq, Finset.card_le_univ, congrFun', Finset.prod, Finset.univ, Fintype.card_pi, Finset.prod_congr, Eq.refl, Membership.mem and 3 more

    32 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.

    theorem words_naive_bound
        (A B : Finset (Fin n → Fin q)) :
        A.card * B.card ≤ q ^ (2 * n) := by
    …
  5. theorem SuffixPrefixAvoidance.suffix_prefix_avoidance_bound $A$ and $B$ are sets of words of length $n$ over alphabet with $q \geq 1$ letters sorry line 76 source

    Source documentation

    $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.

    depends on sorry what this means

    Statement uses: Nat, Finset, Fin, LT.lt, OfNat.ofNat, SuffixPrefixAvoidance.IsSuffixPrefixAvoiding, LE.le, Real, HMul.hMul, Finset.card, HDiv.hDiv, HPow.hPow, Real.exp

    Proof uses: sorryAx, Lean.Name, Bool.false, Lean.Name.num, Lean.Name.str, Lean.Name.anonymous

    34 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.

    theorem suffix_prefix_avoidance_bound
        (A B : Finset (Fin n → Fin q))
        (hq : 0 < q) (hn : 0 < n)
        (h : IsSuffixPrefixAvoiding A B) :
        (A.card : ℝ) * B.card ≤ (q : ℝ) ^ (2 * n) / (exp 1 * n) := by
    …

    Mentions: SuffixPrefixAvoidance.IsSuffixPrefixAvoiding

  6. theorem SuffixPrefixAvoidance.suffix_prefix_avoidance_weaker_bound sorry line 90 source

    depends on sorry what this means

    Statement uses: Nat, Finset, Fin, LT.lt, OfNat.ofNat, SuffixPrefixAvoidance.IsSuffixPrefixAvoiding, LE.le, Rat, HMul.hMul, Finset.card, HDiv.hDiv, HPow.hPow

    Proof uses: sorryAx, Lean.Name, Bool.false, Lean.Name.num, Lean.Name.str, Lean.Name.anonymous

    24 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.