← Math · Publications

Research preprint · Version 1

Four diagonals suffice: completeness of Parikh matrices when letters occur at most twice

Christopher Yamba

If every letter other than the first and the last occurs at most twice, the first four diagonals determine the Parikh matrix. A sharpness family with ballot and Catalan numbers, a conjecture for higher multiplicities, and Lean 4 proofs.

Abstract

The Parikh matrix of a word over an ordered alphabet records, diagonal by diagonal, the numbers of occurrences of the scattered subwords made of consecutive letters. For permutations the pair counts on the third diagonal determine the whole matrix (the completeness theorem of the author’s 2006 thesis, and a special case of Salomaa’s γ\gamma-property theorem of 2005), while Salomaa showed that in general no fixed number of diagonals suffices. We prove that if every letter other than the first and the last letter of the alphabet occurs at most twice, the first four diagonals determine the Parikh matrix, and we give the long counts explicitly: the count of j(j+1)⋯lj(j+1)\cdots l factorises across every edge ee at which ww avoids the scattered subword e(e+1)e(e+1)e(e+1)e(e+1), and along a chain of interleaved pairs it is a bilinear expression in four counts of length 22 and 33. This proves, for such words, a statement that Salomaa reports was sometimes conjectured in general, and it contains Simpson’s result for palindromes in which every letter occurs twice; in particular, the Parikh classes of words in which each letter occurs twice are the sets of words with given third and fourth diagonals. Salomaa’s construction shows that counts of length at most nn do not suffice when the inner letters occur nn times; we show that one copy of the first letter is enough, giving for every n≥2n\ge2 two words of content (1,n,…,n)(1,n,\dots,n) whose Parikh matrices differ only in the corner. Their window counts are ballot numbers, among them the Catalan number CnC_n, by a reflection argument. We conjecture that counts of length at most n+1n+1 always suffice when the inner letters occur at most nn times, and support it by exhaustive computation for n=3n=3 and n=4n=4. The main theorem, the rectangle rule, the crossing chain and the corner statement of the sharpness family for n=3,4n=3,4 are formalised in Lean 4 at the level of words.

What the paper proves

  • Completeness for doubled letters. If every letter other than the first and the last occurs at most twice, the counts of length at most three (the first four diagonals) determine the whole Parikh matrix. This extends the completeness theorem of the author's 2006 thesis, where letters occur once.
  • Explicit formulas. A long count factorises across every edge whose two letters meet as a rectangle (the rectangle rule), and along a chain of interleaved pairs it is a bilinear expression in four short counts (the crossing chain).
  • Sharpness. For every n, two words of content (1, n, …, n) whose Parikh matrices differ only in the corner. Their counts are ballot numbers, with the Catalan number Cn among them. A conjecture says that counts of length at most n + 1 always suffice when the inner letters occur at most n times, and exhaustive tests support it for n = 3 and n = 4.

The complete statements and proofs are in the 9-page paper.

Lean 4 proofs and verification

The main theorem, the rectangle rule and the crossing chain are formalised in Lean 4 at the level of words (core library only, no sorry). Every numerical statement is re-checked by a standard-library Python script. The Lean files, the checks and the sources are in the verification package and in the Yamba AI Math repository.

This is an author-published preprint and has not been peer reviewed. Generative AI tools assisted with the research and the writing, as the paper records; mathematical responsibility rests with the author. It continues the author's 2006 thesis and the companion article From Euler numbers to the golden ratio.

Suggested citation

Christopher Yamba. Four diagonals suffice: completeness of Parikh matrices when letters occur at most twice. Research preprint, version 1, 23 October 2026. https://www.christopheryamba.com/math/parikh-four-diagonals/

© 2026 Christopher Yamba. All rights reserved.