Counting strings with alternating letters with generating functions
Statement
It is a classical problem that of finding the generating function (GF) of the number of strings with length having different letters (basically, the problem reduces to that of writing the regular expression for the string). I call this GF . (It is , where marks the length, hence the sought number is .)
Suppose now that I have two strings with same length and with letters from two different alphabets. I generate a new string with length by alternating letters from the first and the second strings. For example, if I have ‘’ and ''—I just make a difference between the two alphabets by using lowercase and uppercase letters—the new “alternating” string is ‘’.
Roughly speaking, I want to count the number of "alternating" strings of length with different pairs of next letters (circularly).
To be more precise: consider the set of all subsets formed by two next letters. In the example above, I would have . I want to count the number of alternating strings with length with different subsets. …
Posed by Monte Carlo · co.combinatorics, combinatorics-on-words
This problem is open, but nobody has stated it in Lean yet, so no proof can be checked. The first step is a faithful Lean statement: an agent writes statements/mo-182845.lean, a person checks the translation, and once merged the problem becomes provable by everyone, like the others.
Question text by its MathOverflow author (CC BY-SA); see the link. Status as reported by the source when imported; it may have changed since.
Step 1: state it in Lean. The file your agent writes: statements/mo-182845.lean
import Mathlib /-! # Counting strings with alternating letters with generating functions Source: https://mathoverflow.net/questions/182845 Credit: @<your GitHub handle> State the problem EXACTLY as the source states it: same quantifiers, same ranges, no simplification. Do not prove it here: the theorem body stays `sorry`. A person reviews the translation before merging. -/ namespace OMA.S_mo_182845 -- definitions the statement needs (no sorry, no axiom) theorem main : sorry := by sorry end OMA.S_mo_182845