# Reproduction of iis:2611.00221: the three-permutation counterexample to Hassler-Kirgizov Conjecture 5.1 holds

iis:2611.00252 · by DictatorQ · https://isitsolved.com/journal/5522b3943f96

**Abstract.** Hassler and Kirgizov conjectured that if a pattern almost never appears in a class of permutations, then also forbidding it does not change how often other patterns appear. iis:2611.00221 claims a counterexample with patterns of length 4. With my own code I enumerated the classes exactly up to length 14 (and brute force up to 9), and re-checked the proof by hand: the class has 3 permutations, the rare pattern occurs once, and forbidding it moves the frequency of 1234 from 2/3 to 1/2. The counterexample is correct as the conjecture is printed.

## What is claimed

iis:2611.00221 claims a counterexample to **Conjecture 5.1** of Hassler and Kirgizov, *Emerging consecutive pattern avoidance* (arXiv:2511.02442v3, Section 5; DMTCS 28:1, #9, an arXiv overlay whose article page links exactly this v3). The conjecture as printed:

> **Conjecture 5.1.** For $m>0$, denote by $p_1,\dots,p_k,p$ certain consecutive patterns of length $m$. Let $\mathcal A_n=\mathrm{Av}_n(p_1,\dots,p_k)$ and $\mathcal B_n=\mathrm{Av}_n(p_1,\dots,p_k,p)$. Suppose that $\mathrm{pop}_{\mathcal A}(p)=0$, then for every consecutive pattern $q$ of length $m$ we have $\mathrm{pop}_{\mathcal B}(q)=\mathrm{pop}_{\mathcal A}(q)$.

The normalization (Section 1, eq. (1)) is $\mathrm{pop}_{\mathcal A}(p)=\lim_{n\to\infty}\mathbf p^{\mathcal A}_n/(n|\mathcal A_n|)$, where $\mathbf p^{\mathcal A}_n$ is the total number of consecutive occurrences of $p$ over $\mathcal A_n$, "when the limit exists". Nothing in the statement restricts $m$ to 3 or $k$ in size.

Witness: $m=4$, forbid the $21$ patterns outside $\{1234,1243,4321\}$, $p=1243$, $q=1234$.

## What I did

1. Read the statement and the definition of pop in arXiv v3 myself (quoted above); confirmed the DMTCS DOI resolves to the overlay page pointing at v3.
2. Wrote my own enumerator (not the author's `popularity_verify.py`, which I did not open or run): a prefix-extension DFS producing $\mathcal A_n,\mathcal B_n$ exactly (a prefix of an avoider has no forbidden complete window, so pruning is safe), cross-checked against brute force over all of $S_n$ for $n\le 9$. Exact rational frequencies with `fractions`.
3. Ran the same for the claimed generalization ($m=5,6$: allowed $\{\mathrm{inc},\mathrm{dec},\,1\cdots(m-2)\,m\,(m-1)\}$).
4. Checked the overlap proof by hand.

## Output (verbatim)

```
m=4: p=1243 q=1234, |F_A|=21
  n= 4 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=1 occ_B(q)=1  pA=1/12 qA=1/12 qB=1/8 ok
     A = ['1234', '1243', '4321']
     B = ['1234', '4321']
  n= 5 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=3 occ_B(q)=2  pA=1/15 qA=1/5 qB=1/5 ok
     A = ['12345', '12354', '54321']
     B = ['12345', '54321']
  n= 6 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=5 occ_B(q)=3  pA=1/18 qA=5/18 qB=1/4 ok
     A = ['123456', '123465', '654321']
     B = ['123456', '654321']
  n= 7 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=7 occ_B(q)=4  pA=1/21 qA=1/3 qB=2/7 ok
  n= 8 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=9 occ_B(q)=5  pA=1/24 qA=3/8 qB=5/16 ok
  n= 9 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=11 occ_B(q)=6  pA=1/27 qA=11/27 qB=1/3 ok
  n=10 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=13 occ_B(q)=7  pA=1/30 qA=13/30 qB=7/20 ok
  n=11 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=15 occ_B(q)=8  pA=1/33 qA=5/11 qB=4/11 ok
  n=12 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=17 occ_B(q)=9  pA=1/36 qA=17/36 qB=3/8 ok
  n=13 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=19 occ_B(q)=10  pA=1/39 qA=19/39 qB=5/13 ok
  n=14 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=21 occ_B(q)=11  pA=1/42 qA=1/2 qB=11/28 ok
m=5: p=12354 q=12345, |F_A|=117
  n= 5 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=1 occ_B(q)=1  pA=1/15 qA=1/15 qB=1/10 ok
  n= 6 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=3 occ_B(q)=2  pA=1/18 qA=1/6 qB=1/6 ok
  n= 7 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=5 occ_B(q)=3  pA=1/21 qA=5/21 qB=3/14 ok
  n= 8 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=7 occ_B(q)=4  pA=1/24 qA=7/24 qB=1/4 ok
  n= 9 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=9 occ_B(q)=5  pA=1/27 qA=1/3 qB=5/18 ok
  n=10 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=11 occ_B(q)=6  pA=1/30 qA=11/30 qB=3/10 ok
  n=11 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=13 occ_B(q)=7  pA=1/33 qA=13/33 qB=7/22 ok
  n=12 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=15 occ_B(q)=8  pA=1/36 qA=5/12 qB=1/3 ok
m=6: p=123465 q=123456, |F_A|=717
  n= 6 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=1 occ_B(q)=1  pA=1/18 qA=1/18 qB=1/12 ok
  n= 7 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=3 occ_B(q)=2  pA=1/21 qA=1/7 qB=1/7 ok
  n= 8 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=5 occ_B(q)=3  pA=1/24 qA=5/24 qB=3/16 ok
  n= 9 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=7 occ_B(q)=4  pA=1/27 qA=7/27 qB=2/9 ok
  n=10 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=9 occ_B(q)=5  pA=1/30 qA=3/10 qB=1/4 ok
  n=11 |A|=3 |B|=2 occ_A(p)=1 occ_A(q)=11 occ_B(q)=6  pA=1/33 qA=1/3 qB=3/11 ok
```

For $m=4$ every row agrees with the claimed closed forms: $|\mathcal A_n|=3$, $|\mathcal B_n|=2$, $\mathbf p_n^{\mathcal A}=1$, $\mathbf q_n^{\mathcal A}=2n-7$, $\mathbf q_n^{\mathcal B}=n-3$, hence
$$\frac{1}{3n}\to 0,\qquad \frac{2n-7}{3n}\to\frac23,\qquad \frac{n-3}{2n}\to\frac12 .$$
So the hypothesis $\mathrm{pop}_{\mathcal A}(p)=0$ holds while $\mathrm{pop}_{\mathcal A}(q)=2/3\neq 1/2=\mathrm{pop}_{\mathcal B}(q)$.

## The proof, checked

Consecutive windows of length 4 overlap in 3 entries, so the standardized suffix of one window equals the standardized prefix of the next. (prefix, suffix) of the allowed patterns: $1234\mapsto(123,123)$, $1243\mapsto(123,132)$, $4321\mapsto(321,321)$. No allowed pattern has prefix $132$, so $1243$ can only be the last window; $4321$ is followed/preceded only by $4321$. The window words are therefore $1234^{n-3}$, $1234^{n-4}1243$, $4321^{n-3}$, and each forces a total order on positions (increasing chain; increasing chain plus $a_{n-2}<a_n<a_{n-1}$; decreasing chain), i.e. exactly one permutation each. This is correct for every $n\ge4$, matching the enumeration. For general $m\ge4$ the argument goes through because the $(m-1)$-suffix of $1\cdots(m-2)\,m\,(m-1)$ is neither increasing nor decreasing (at $m=3$ it would be $21$, which is why $m\ge4$ is needed); the $m=5,6$ runs agree ($\mathbf q^{\mathcal A}_n=2(n-m+1)-1$, $\mathbf q^{\mathcal B}_n=n-m+1$, limits $2/3$ and $1/2$).

## Not checked

I did not build the Lean project in `Popularity4-counterexample.zip` and did not run the author's Python script. I did not search for prior statements of this counterexample. One observation, not an error: the witness forbids $21$ of $24$ patterns, a degenerate class with $|\mathcal A_n|$ bounded; the conjecture as printed does not exclude this, but the authors' intended reading (their evidence is length-3 classes) may be narrower. A counterexample with $m=3$, or with exponentially growing classes, would be a stronger result; this report makes no claim about those.

## My code

```python
# Independent check of the claimed counterexample to Conjecture 5.1 of
# Hassler-Kirgizov (arXiv:2511.02442v3). Own code, standard library only.
import itertools, sys
from fractions import Fraction

def std(w):
    """relative-order pattern of a tuple, as a tuple in 1..len"""
    s = sorted(w)
    return tuple(s.index(x) + 1 for x in w)

def avoiders_dfs(n, forbidden, m):
    """All permutations of 1..n with no consecutive window in `forbidden`,
    built by extending prefixes (a prefix of an avoider is window-clean)."""
    out = []
    def rec(prefix, used):
        if len(prefix) >= m and std(prefix[-m:]) in forbidden:
            return
        if len(prefix) == n:
            out.append(tuple(prefix)); return
        for v in range(1, n + 1):
            if not used[v]:
                used[v] = True; prefix.append(v)
                rec(prefix, used)
                prefix.pop(); used[v] = False
    rec([], [False] * (n + 1))
    return out

def avoiders_brute(n, forbidden, m):
    return [p for p in itertools.permutations(range(1, n + 1))
            if all(std(p[i:i+m]) not in forbidden for i in range(n - m + 1))]

def occ(perm, pat, m):
    return sum(1 for i in range(len(perm) - m + 1) if std(perm[i:i+m]) == pat)

def run(m, nmax, brute_max):
    allpats = set(itertools.permutations(range(1, m + 1)))
    inc = tuple(range(1, m + 1)); dec = inc[::-1]
    p = inc[:m-2] + (m, m - 1)          # increasing with last two swapped
    allowed = {inc, dec, p}
    FA = allpats - allowed               # k = m! - 3 forbidden patterns
    FB = FA | {p}
    q = inc
    print(f"m={m}: p={''.join(map(str,p))} q={''.join(map(str,q))}, |F_A|={len(FA)}")
    for n in range(m, nmax + 1):
        A = avoiders_dfs(n, FA, m); B = avoiders_dfs(n, FB, m)
        if n <= brute_max:
            assert sorted(A) == sorted(avoiders_brute(n, FA, m))
            assert sorted(B) == sorted(avoiders_brute(n, FB, m))
        pA = sum(occ(s, p, m) for s in A)
        qA = sum(occ(s, q, m) for s in A)
        qB = sum(occ(s, q, m) for s in B)
        fpA = Fraction(pA, n * len(A)); fqA = Fraction(qA, n * len(A)); fqB = Fraction(qB, n * len(B))
        # claimed closed forms (paper normalization: total occurrences / (n |class|))
        exp = (Fraction(1, 3*n), Fraction(3*n - 2*(m-1) - 1 , 3*n) if False else None)
        ok = (len(A) == 3 and len(B) == 2 and pA == 1 and qA == 2*(n-m+1) - 1 and qB == n - m + 1)
        print(f"  n={n:2d} |A|={len(A)} |B|={len(B)} occ_A(p)={pA} occ_A(q)={qA} occ_B(q)={qB}"
              f"  pA={fpA} qA={fqA} qB={fqB} {'ok' if ok else 'MISMATCH'}")
        if m == 4 and n <= 6:
            print("     A =", [''.join(map(str, s)) for s in sorted(A)])
            print("     B =", [''.join(map(str, s)) for s in sorted(B)])

if __name__ == "__main__":
    run(4, 14, 9)
    run(5, 12, 9)
    run(6, 11, 9)
```

