Full rainbow matchings in equivalence relations

Abstract: We show that if a multigraph $G$ with maximum edge-multiplicity of at most $\frac{\sqrt{n}}{\log^2 n}$, is edge-coloured by $n$ colours such that each colour class is a disjoint union of cliques with at least $2n + o(n)$ vertices, then it has a full rainbow matching, that is, a matching where each colour appears exactly once. This asymptotically solves a question raised by Clemens, Ehrenmüller and Pokrovskiy, and is related to problems on algebras of sets studied by Grinblat in [Grinblat 2002].

\section{Introduction}

This paper is motivated by  a question  of Grinblat which demonstrates a beautiful interplay between measure theory and  combinatorics. Recall that an algebra \(A\) on a set \(X\) is a family of subsets of this set closed under the operations of union and difference of two subsets. In his book~\cite{grinblat2002} and also later~\cite{grinblat2004,grinblat2015}  Grinblat investigated necessary and sufficient conditions under which the union of at most countably many algebras on $X$ equals to $P(X)$, the power set of $X$. In particular, one of the   questions he studied,  as observed by Nivasch and Omri~\cite{NO}, can be phrased about equivalence relations  as follows.   Let $X$ be a finite set and let A be an equivalence relation on $X$, define the \emph{kernel} of $A$, $ker(A)$ to be the set of all elements in $X$, which have non-trivial equivalence classes. Define $\nu(n)$ to  be the minimal number such that if $A_1, \dots , A_n$ are equivalence relations with $ker(A_i)\geq \nu(n)$ for all $i\in [n]$, then $A_1 \dots,  A_n$ contains a \emph{rainbow matching}, that is,  a set of $2n$ distinct elements $x_1$, $y_1$, . . . ,  $x_n$, $y_n\in X$ with $ x_i\sim y_i \in A_i$ for each $i\in [n]$.

In~\cite{grinblat2002} Grinblat showed  that $ 3n-2\leq  \nu (n) \leq 10n/3 + \sqrt{2n/3} $,  and he asked whether the lower bound is the correct answer for all $n\geq 4$. Nivasch and Omri~\cite{NO} improved Grinblat's upper bound  on $\nu(n)$  to $16n/5 + O(1)$. Finally, Clemens, Ehrenm{\"u}ller,  Pokrovskiy~\cite{CEP} improved the bound on $\nu(n)$ to asymptotically best possible, that is,  $\nu(n) = (3+o(1))n$, using  the graph theoretic language.

If $A_1, \dots, A_n$ are equivalence relations on a set $X$, let the vertices of an edge-coloured multigraph be the elements of $X$ and, for each $i\in[n]$, let $ {x, y}$ be an edge of colour $i$ if $x\sim_{A_i}y$. Each equivalence relation $A_i$ then corresponds to the colour class $i$ in the multigraph $G$  and, each colour class is a disjoint union of non-trivial cliques.  So, Grinblat's original question can be reformulated as follows: we are given  a multigraph $G$ whose  edges  are coloured with $n$ colours and each subgraph induced by a colour class has at least $3n-2$  vertices and is the disjoint union of non-trivial complete graphs. Is it true that then $G$ contains a \emph{ full rainbow matching}, i.e. a set of $n$ disjoint edges, which all have distinct colours? The authors in~\cite{CEP}  showed that  for sufficiently large $n$, if each colour class has at least $(3+o(1))n$ many vertices then such a rainbow matching exists.  Note that this is asymptotically the best bound, as  if we take a disjoint union of $n-1$ triangles, each edge with multiplicity $n$, one edge per colour,  then there is no rainbow matching of size $n$. If $n = 3$, then  $\nu(3)=9>3n-2$, demonstrated by a $3$-factorization of two disjoint $K_4$'s, as shown by Grinblat~\cite{grinblat2002} and also observed by Nivasch and Omri~\cite{NO}.

In~\cite{CEP} the authors proposed to study Grinblat's original problem when  every pair of distinct elements belongs to at most one equivalence relation (Problem 2, in~\cite{CEP}), that is, to determine $\nu'(n)$ such that  if $A_1, A_2,  \dots, A_n$ are equivalence relations with $ker(A_i) \geq \nu'(n)$ and $A_i\cap A_j\subseteq \{(x,x)| x \in X\}$ then $A_1, A_1, \dots, A_n$ contain a rainbow matching. In the graph theoretic language this is equivalent to finding the minimum $\nu'(n)$ such that every simple graph $G$ whose  edges  are coloured with $n$ colours, each subgraph induced by a colour class has at least $\nu'(n)$  vertices and is the disjoint union of non-trivial complete graphs, contains a full rainbow matching.
 The trivial upper bound is $ \nu'(n)\leq \nu(n)\leq (3+o(1)n$. As for the lower bound, the graph composed of  $n-1$ disjoint stars with $n$ edges, one edge per colour, exhibits that $\nu'(n)>2n-2$~\cite{P}.  In this paper we show that asymptotically $2n$ is the correct answer, in fact, the same result holds for multigraphs with bounded  edge multiplicity. Our main result follows.

\begin{theorem}\label{thm:main}
For every  $\delta > 0$ there exists $n_0$ such that for all $n\geq n_0$ the following holds. If $G$ is a multigraph whose edges are coloured with $n$ colours, such that each colour class is a disjoint union of non-trivial cliques with at least $(2 + \delta)n $ vertices, and the edge-multiplicity of $G$ is at most $\frac{\sqrt{n}}{\log^2 n}$ then $G$ contains a full rainbow matching.
\end{theorem}

We suspect that improving this upper bound on $\nu'(n)$ to something not of  an asymptotic  form  will be  hard. That is  because our problem is closely related to the Brualdi-Ryser-Stein conjecture on Latin squares and its generalizations.

\subsection{The Brualdi-Ryser-Stein conjecture}
A Latin square of order $n$ is an $n\times n$ square
with cells filled using $n$ symbols so that every symbol appears once in each row and once in each column.  \emph{A partial transversal} of size $k$  of a Latin square is a set of $k$ entries in the square which all come from distinct rows and columns, and contain distinct symbols. If $k=n$, where $n$ is the order of the Latin square, the partial transversal is simply called a \emph{transversal}.

\begin{conjecture}[Brualdi-Ryser-Stein]\label{BRS}
Every Latin square of order $n$ has a partial transversal of size $n-1$ and moreover, if $n$ is odd, it has a transversal.
\end{conjecture}
The history of the conjecture is as follows. In 1967, Ryser~\cite{Ryser} conjectured that the number of transversals in a Latin square of order $n$ has the same parity as $n$, so any Latin square of odd order has a transversal (see also~\cite{best2018did}).  Note that for even $n$ this is not true; for  example, the addition table of  $\mathbb{Z}_{2n}$ is a Latin square with no transversal. Brualdi~\cite{brualdi} conjectured that every Latin square of order $n$ has a partial transversal of size $n-1$ and moreover, if $n$ is odd, it has a transversal. Stein~\cite{S} conjectured that a stronger statement holds and the same outcome should hold even in an $n\times n$ array filled with the numbers $1,2, \dots, n$  such that every number occuring exactly $n$ times. Very recently this was disproved by Pokrovskiy and Sudakov~\cite{PS}. The current best bound on the size of the partial transversal in Brualdi-Ryser-Stein conjecture is $n-O(\log^2n)$ proved by Hatami and Shor~\cite{HS}.

To every Latin square one can assign an edge-colouring of the complete bipartite graph $K_{n,n}$ by colouring the edge $ij$ by the symbol in the cell $(i, j)$. This is a proper colouring, i.e., one in which any edges which share a vertex have distinct colours. Identifying the cell $(i, j)$ with the edge $ij$, a partial transversal corresponds to a rainbow matching of the same size. So Conjecture~\ref{BRS}  says that any proper edge-colouring of $K_{n,n}$ contains a rainbow matching of size $n-1$, and a perfect rainbow matching, when $n$ is odd. Aharoni and Berger conjectured  the following generalization of  Conjecture~\ref{BRS}.

 \begin{conjecture}\label{conj:aharoniberger}Let $G$ be a bipartite multigraph that is properly edge-coloured
with $n$ colours and has at least $n + 1$ edges of each colour. Then $G$ has a rainbow matching using every colour.
\end{conjecture}

Note that Conjecture~\ref{conj:aharoniberger} would imply that $\nu''(n)\leq 2n+2$ where $\nu''(n)$ can be be defined just as $\nu'(n)$ but restricted to only bipartite graphs (however, Conjecture~\ref{conj:aharoniberger} is much stronger, because it allows any edge multiplicity). Pokrovskiy~\cite{P} showed that Conjecture~\ref{conj:aharoniberger} is asymptotically true, in that the conclusion
holds if there are at least $n + o(n)$ edges of each colour.  Keevash and Yepremyan~\cite{KY1} considered the same
question without the bipartiteness assumption and obtained a result somewhat analogous to
Pokrovskiy's. They showed that any multigraph with edge multiplicities
$o(n)$ that is properly edge-coloured by $n$ colours with at least $n + o(n)$ edges of each
colour contains a rainbow matching of size $n-C$, for some large absolute constant $C>0$. A similar result was also obtained independently by Gao, Ramadurai,
Wanless and Wormald~\cite{GRWW}. They showed that every properly edge-coloured multigraph with edge-multiplicity at most $O(\sqrt{n}/\log^2{n})$  such that each colour class has at least $2n + o(n)$ vertices has a full rainbow matching (note that here the colouring is proper while in our case it is not). Our Theorem~\ref{thm:main} is a generalization of  this result.

\subsection{The Proof overview}  We  further generalize the approach developed in~\cite{GRWW}.  If a multigraph $G$ has a certain structure  we construct a full rainbow matching via some randomized algorithm. This consists of finding an almost full rainbow matching by a sequence of random iterations and then completing it to a full rainbow matching by the greedy algorithm. To show that the last part is possible, the so-called differential equation method is used. Informally saying,  one analyzes the random method to show that the graph left at the very end behaves ``nicely" enough to contain such a matching.  To describe how degrees of vertices, edges and other variables are changing in the left-over graph after each random choice, differential equations are used. The following theorem gives the types of multigraph to which the algorithm can be applied.

For a multigraph whose edges are coloured, let, for a colour $c$, $n_c$ denote the number of vertices in the colour class of $c$ and $e_c$ denote the number of edges. Let also, $d_v$ denote the number of edges incident to the vertex $v$.

\begin{theorem}\label{thm:auxthm}
For any $0 < \sigma_1 < \sigma_2$, there exists $n_0$ such that for all  $n\geq n_0$ the following is true. Suppose $G$ is a multigraph whose edges are coloured with $n$ colours, such that each colour class is a disjoint union of cliques of order at most three. If  the edge-multiplicity of $G$ is at most $ \frac{\sqrt{n}}{\log^2 n}$, and moreover,
\begin{itemize}
\item $n_c\leq 4n$ and $e_c \geq \sigma_2 n$, for every colour $c$,
    \item $d_v \leq \sigma_1 n$, for every vertex $v$,
\end{itemize}
then $G$ contains a full rainbow matching.
\end{theorem}

In order to prove our main result, Theorem~\ref{thm:main}, we show that every multigraph we are considering contains a subgraph with the structure given in Theorem~\ref{thm:auxthm}. This  is done via  a careful random sampling.

\section{Some Probability Tools}
In this section we gather some classic probability results which we use throughout our proofs.

\begin{prop} [\textbf{Chernoff bound}, \cite{DP}]
Let $X$ be a sum of $n$ independent $[0,1]$-valued random variables. Then, for all $t \geq 0$,
$$\mathbb{P}[|X-\mathbb{E}[X]| > t] \leq 2e^{-\frac{2t^2}{n}}$$
\end{prop}

\begin{prop} [\textbf{McDiarmid's Inequality}, \cite{McDiarmid}]
Let $k \in \mathbb{N}$ and $\Pi : [k] \rightarrow [k]$ be a permutation chosen uniformly at random. Let also $h$ be a non-negative real-valued function on the set of permuations of $\{1,\dots , k\}$ and define the random variable $Z := h(\Pi)$ and its median $M$. Suppose that there exist constants $c,r > 0$ such that the following two items occur for any (deterministic) permutation $\pi$:
\begin{itemize}
    \item Swapping two coordinates in the permutation $\pi$ changes $h(\pi)$ by at most $c$.
    \item If $h(\pi) = s$, then there is a set of at most $rs$ coordinates such that $h(\pi') \geq s$ for any other permutation $\pi'$ which agrees with $\pi$ on these coordinates.
\end{itemize}
Then, for all $t \geq 0$,

$$\mathbb{P}[|Z-M| \geq t] \leq 4 \exp \left(-\frac{t^2}{16rc^2(M+t)}\right)$$
\end{prop}

\begin{prop} [\textbf{Azuma's Inequality, \cite{DP}}]
Let $X_1,\dots ,X_n$ be independent random variables which take values in some set $S$ and let $f$ be real-valued on $S^n$ such that there exists a constant $c > 0$ such that for any $\mathbf{x} = (x_1, \dots , x_n) \in S^n$, changing a coordinate of $\mathbf{x}$ deviates $f(\mathbf{x})$ by at most $c$. Then, defining $Y = f(X_1,\dots,X_n)$, we have for every $t > 0$,
$$\mathbb{P}[|Y - \mathbb{E}[Y]| \geq t] \leq 2 \exp \left(-\frac{t^2}{2c^2 n}\right).$$
\end{prop}

\section{Proof of Theorem 1}

\begin{proof}
Note that we only need  to consider the case when the cliques mentioned in the statement are of order at most three. This is because any other case can be reduced to this one by deleting edges in such a way that all monochromatic $K_t$'s with $t \geq 4$ are transformed into a disjoint union of $K_3$'s and $K_2$'s without reducing the number of vertices in a colour class. We can also assume that for every colour $c$, $n_c \leq \lceil (2+\delta)n \rceil + 2$.  Finally, without loss of generality, we may assume $\delta < 2$. For any  colour $c$, let $a_c$, $b_c$ be the number of $K_3$, $K_2$ components, respectively, in the colour class of $c$. Note that $n_c = 3a_c + 2b_c$ and $e_c = 3a_c + b_c$.
\\

We construct a random subgraph $H \subseteq G$ in the following manner:
\begin{itemize}
    \item Independently, for each monochromatic $K_3$, either delete two of its edges (transforming it into $K_2$), each pair of edges having probability $\frac{1}{4}$ of being deleted or keep the $K_3$ with probability $\frac{1}{4}$.
\end{itemize}

Define for every vertex $v$, $d^{\textit{tr}}_v, d^{\textit{line}}_v$ to be respectively, the number of edges incident to $v$ which belong to a monochromatic $K_3$, $K_2$. Note that $d_v = d^{\textit{tr}}_v + d^{\textit{line}}_v$ and $Cd_v = \frac{d^{\textit{tr}}_v}{2} + d^{\textit{line}}_v$, where $Cd_v$ is colour degree of the vertex $v$. We will now show that with positive probability, $H$ will satisfy the conditions of Theorem~\ref{thm:auxthm}, thus $H$ will have having a full rainbow matching,  and so will $G$.

For every colour $c$, let $X_c$ denote the number of $K_3$ components in the colour class $c$ which remain unchanged, so that $n_c(H) = 2(a_c+b_c) + X_c$ and $e_c(H) = a_c+b_c+2X_c$. Note that $X_c \sim \text{Bin}(a_c,\frac{1}{4})$. Using the Chernoff bound, we  have that for  any $\ensuremath{\varepsilon} \geq 0$,
\begin{itemize}
    \item $\mathbb{P}(e_c(H) \leq \frac{n_c - \ensuremath{\varepsilon} a_c}{2}) \leq 2e^{-\frac{\ensuremath{\varepsilon}^2 a_c}{8}}$
\end{itemize}

Similarly, for every vertex $v$, let $Y_v$ denote the number of edges incident to $v$, belonging to a monochromatic $K_3$, which aren't deleted. We note that $d_v(H) = d_v^{\textit{line}} + Y_v$ and $Y_v \sim \text{Bin}(d_v^{\textit{tr}},\frac{1}{2})$. Again by the Chernoff bound, for any $ \ensuremath{\varepsilon} \geq 0$ we have that
\begin{itemize}
    \item $\mathbb{P}(d_v(H) \geq Cd_v + \frac{\ensuremath{\varepsilon} d_v^{\textit{tr}}}{2}) \leq 2e^{-\frac{\ensuremath{\varepsilon}^2 d_v^{\textit{tr}}}{2}}$
\end{itemize}

These two facts allow us to get the following bounds on the structure of the subgraph $H$. Let $\ensuremath{\varepsilon}_1 = \frac{3\delta}{2(2+\delta)}$ and $\ensuremath{\varepsilon}_2 = \frac{\delta}{8}$.

For colours $c$ such that $ a_c \leq \frac{ \ensuremath{\varepsilon}_1 \lceil (2+\delta)n \rceil }{3}$, note that
$$e_c(H) \geq a_c + b_c = \frac{n_c - a_c}{2} \geq \frac{\lceil (2+\delta)n \rceil - a_c}{2} \geq \frac{(3-\ensuremath{\varepsilon}_1)\lceil (2+\delta)n \rceil}{6}$$
For the rest of the colours, since $n$ is large, $a_c \geq  2$ and so,
$$\frac{(3-\ensuremath{\varepsilon}_1)\lceil (2+\delta)n \rceil}{6} \leq \frac{3n_c-\ensuremath{\varepsilon}_1 \lceil (2+\delta)n \rceil}{6} \leq \frac{n_c - \ensuremath{\varepsilon}_1 \left(a_c - \frac{2}{3} \right)}{2} \leq \frac{n_c - \frac{\ensuremath{\varepsilon}_1 a_c}{2}}{2},$$
where in the third inequality we used $3a_c \leq n_c \leq \lceil (2+\delta)n \rceil + 2$. Therefore,

$$\mathbb{P} \left(e_c(H) \leq \frac{(3-\ensuremath{\varepsilon}_1)\lceil (2+\delta)n \rceil}{6}\right) \leq \mathbb{P}\left (e_c(H) \leq \frac{n_c - \frac{a_c \ensuremath{\varepsilon}_1}{2}}{2}\right) = o\left(\frac{1}{n}\right).$$

Hence, with probability $1-o(1)$, we have that that $e_c(H) \geq \frac{(3-\ensuremath{\varepsilon}_1)\lceil (2+\delta)n \rceil}{6}$ for every colour.

Similarly, for vertices $v$ with  $\ensuremath{\varepsilon}_2 n < d_v^{\textit{tr}}$, since $Cd_v \leq n$ and $d_v^{\textit{tr}}\leq 2n$, we have
$$\mathbb{P} \left(d_v(H) \geq (1+\ensuremath{\varepsilon}_2)n \right) \leq \mathbb{P} \left(d_v(H) \geq Cd_v + \ensuremath{\varepsilon}_2 d_v^{\textit{tr}} \right) = o \left(\frac{1}{n^2} \right)$$
For the rest of the vertices, note that $d_v(H) \leq (1+\ensuremath{\varepsilon}_2)n$. Hence, since $v(G) \leq (\lceil (2+\delta)n \rceil+2)n = O(n^2)$, we have that with probability $1-o(1)$, $d_v(H) \leq (1+\ensuremath{\varepsilon}_2)n$ for every vertex.

To conclude, we have that with probability at least $1-o(1)$, for every colour $c$, by the choice of $\ensuremath{\varepsilon}_1,\ensuremath{\varepsilon}_2$,
\begin{itemize}
    \item $e_c(H) \geq \frac{(3-\ensuremath{\varepsilon}_1)\lceil (2+\delta)n \rceil}{6} \geq (2+\delta)(\frac{3-\ensuremath{\varepsilon}_1}{6})n = (1+\frac{\delta}{4})n$, for every colour $c$,
    \item $d_v(H) \leq (1+\ensuremath{\varepsilon}_2)n = (1+\frac{\delta}{8})n$, for every vertex $v$,
\end{itemize}
Then, if $n$ is sufficiently large, with positive probability $H$ will satisfy the conditions of Theorem 2 and contain a full rainbow matching.
\end{proof}

\section{Informal Treatment of Theorem 2}
The proof of Theorem 2 is technical, here we give a heuristic argument  why Theorem 2 is  true. We will formalize this in the next section.  Make a note of the following  greedy deterministic algorithm which we will use throughout the paper. Take a multigraph which is edge-coloured such that each colour class is a disjoint union of cliques and whose number of vertices is at least four times the number of colours. The greedy way of finding a full rainbow matching consists of picking an edge of each colour and deleting its vertices from the graph at each iteration. Indeed, we can check that when we do so, the number of vertices in each of the colour classes of those colours that aren't yet in the matching decreases by at most four. Given the initial assumption on the multigraph, this will then always produce a full rainbow matching. We now describe the randomized algorithm we use. Take a multigraph G which satisfies the conditions stated in Theorem 2.

Informally, the algorithm goes in the following manner:
we first randomly order the colours in order to put them into chunks $C_1,...,C_{\tau}$ of size $\ensuremath{\varepsilon} n$ (except maybe the last one), so that $\tau = \lceil \frac{1}{\ensuremath{\varepsilon}} \rceil$ - we will take $\ensuremath{\varepsilon} = \ensuremath{\varepsilon}(n)$ to be of a specific order so that the formalities work out; at each iteration $1 \leq i \leq \tau - 1$ we process the chunk $C_i$, that is, we construct a rainbow matching with the colours in $C_i$ and add it to the rainbow matching we have by the previous iterations in order to get a rainbow matching with the colours in $C_1 \cup \dots \cup C_i$; finally, iteration $\tau$ will consist of greedily finding a rainbow matching with the colours in $C_{\tau}$ and adding it to the previous rainbow matching  with the colours in $C_1 \cup \dots \cup C_{\tau - 1}$, thus constructing a full rainbow matching.
\\
At each iteration $1 \leq i \leq \tau - 1$, we will process chunk $C_i$ in such a way that after finishing iteration $i$, we expect to have:
\begin{itemize}
    \item [1)] For every vertex $v$ that survived and $j > i$, $d_v^{C_j}(i) \leq \ensuremath{\varepsilon} d(i\ensuremath{\varepsilon}) \sigma_1 n$, where $d_v^{C_j}(i)$ denotes the number of edges of colours in $C_j$ that are incident to $v$ after finishing iteration $i$.
    \item [2)] For every unprocessed  colour $c$, the number of edges in its colour class graph is $\geq e(i\ensuremath{\varepsilon}) n$.
\end{itemize}
These functions $d,e$ will be defined in Section 5, but here, we will informally guess  what they should be. We first note that we should be able to have $d(0) = 1$ and $e(0) = \sigma_2$, given our assumptions on $G$ and since we randomly order the colours at the beginning of the algorithm.

Let's describe how we will process chunk $C_{i+1}$ in iteration $1 \leq i+1 \leq \tau - 1$ of the algorithm:
\begin{itemize}
    \item [1)] First, we pick independently and u.a.r an edge of each colour in $C_{i+1}$. Let's say these are the edges that are chosen and that their vertices are marked. From these, we delete (as well as their vertices) from our graph the non-colliding ones and process them into our rainbow matching. Let's call these edges killed.
    \item [2)] We then zap (that is, delete from the graph) each vertex that survives the previous step, independently with some probability (specific to each vertex), so that overall, every vertex has the same probability $p_i$ (which will be defined later in Section 5) of being marked or zapped (let's call this condemned).
    \item [3)] Finally, we greedily process the rest of the colours that were involved in collisions in 1). In the end, we will have constructed a rainbow matching with the colours in $C_{i+1}$ and we add it to the previous rainbow matching with colours in $C_1 \cup \dots \cup C_i$ given by the previous iterations.
\end{itemize}
We will prove in the next section that the effect of the collisions occurring in 1) will be negligible and so, we will be able to perform 3). \

Because of this negligible effect of the collisions, for this informal analysis, we can think of a vertex being deleted as being equivalent to a vertex being condemned.
\

Note that for a vertex v, we have
$$P(\text{v is chosen in step 1}) \leq \frac{d_v^{C_{i+1}}(i)}{\min_{c \in C_{i+1}} e^c(i)} \leq \ensuremath{\varepsilon} \sigma_1 \frac{d(i\ensuremath{\varepsilon})}{e(i\ensuremath{\varepsilon})}$$
where $e^c(i)$ denotes the number of edges in the colour class graph of $c$ after iteration $i$.
Hence, we should be able to take $p_i := \ensuremath{\varepsilon} \sigma_1 \frac{d(i\ensuremath{\varepsilon})}{e(i\ensuremath{\varepsilon})}$.

Let's now take a look at what we expect to happen to our parameters during iteration $i+1$. Let $a^c(i),b^c(i)$ denote, respectively, the number of $K_3$'s,$K_2$'s in the colour class graph of $c$ after iteration $i$. We ignore cases where 2 vertices in the same component are deleted, since again, we will show this to be negligible in the next section. We can then see that we should have:

\begin{itemize}
    \item [1)] For every unprocessed  colour $c$, $a^c(i+1) \approx a^c(i)(1-3p_i)$ and $b^c(i+1) \approx b^c(i) + p_i(3a^c(i)-2b^c(i))$
    \item [2)] For every vertex $v$ surviving the iteration and $j > i+1$, $d_v^{C_j}(i+1) \approx d_v^{C_j}(i)(1-p_i)$
\end{itemize}
\

Note that step 2) tells us that we should be able to have $d((i+1)\ensuremath{\varepsilon}) = d(i\ensuremath{\varepsilon})(1-p_i)$. Further, note that for every unprocessed colour, the number of edges in its colour class after iteration $i+1$ is $e^c(i+1) = 3a^c(i+1) + b^c(i+1) \approx (3a^c(i) + b^c(i))(1-2p_i) = e^c(i)(1-2p_i)$. Hence, we should also be able to have $e((i+1)\ensuremath{\varepsilon}) = e(i\ensuremath{\varepsilon})(1-2p_i)$.

Since we will choose $\ensuremath{\varepsilon} = \ensuremath{\varepsilon}(n)$ so that it tends to 0 as $n$ tends to $\infty$ we should be able to take the derivatives of $d,e$ at $x = i\ensuremath{\varepsilon}$ where $0 \leq i \leq \tau - 1$. We then can get, given our choice of $p_i$, that:

\begin{itemize}
    \item $d' = -\sigma_1 \frac{d^2}{e}$
    \item  $e' = -2\sigma_1 d$
\end{itemize}
We can solve this to get $d(x) = 1 - (\frac{\sigma_1}{\sigma_2})x$ and $e(x) = \sigma_2 d(x)^2$.

We are now in position to see if we expect to indeed be able to greedily process the last chunk $C_{\tau}$. For this, we need to check the values of these functions at $x = (\tau - 1)\ensuremath{\varepsilon} \in [1-\ensuremath{\varepsilon},1]$. Note $d((\tau - 1)\ensuremath{\varepsilon}) \geq 1 - \frac{\sigma_1}{\sigma_2} > 0$, by assumption.
\

The number of vertices in the colour class of a colour $c \in C_{\tau}$ after iteration $\tau - 1$ is at least the number of edges, which is at least $e((\tau - 1)\ensuremath{\varepsilon})n \geq \sigma_2 (1 - \frac{\sigma_1}{\sigma_2})^2 n$. Since $\ensuremath{\varepsilon} \rightarrow 0$, if $n$ is large then this will be larger than $4\ensuremath{\varepsilon} n \geq 4|C_{\tau}|$ and therefore, by the discussion in the beginning of this section, we will be able to greedily find a rainbow matching with the colours in $C_{\tau}$. Concluding, we get a full rainbow matching in $G$.

\section{Proof of Theorem 2}
\begin{proof}
We first give some notation and define in detail the algorithm. Our setup is a graph G with the conditions stated. We will also take $\ensuremath{\varepsilon} = \ensuremath{\varepsilon}(n) \in [\frac{1}{2\log \log n}, \frac{1}{\log \log n}]$ and moreover, such that $\ensuremath{\varepsilon} n \in \mathbb{N}$. Note this exists provided that $n$ is large enough.
\\
Initially, take a random permutation of the colours,  which results in a partition of them into sets (which we shall call "chunks") $C_1,...,C_{\tau}$, where $\tau = \lceil \frac{1}{\ensuremath{\varepsilon}} \rceil$ and every chunk has size $\ensuremath{\varepsilon} m$ except for maybe the last chunk (which has size at most $\ensuremath{\varepsilon} m$). We then start with our iterations.
\\
Let at the start $M = \emptyset$, $G_0 = G$ and denote the random permutation we performed above as iteration 0. At iteration $1 \leq i \leq \tau - 1$, we ''process'' the chunk $C_i$ in the following way. We look at the graph $G_{i-1}$ that we have, that is, the one that we are left with after iteration $i-1$; For each vertex $v$ in this graph, there is a probability $P_{i-1}(v) \in [0,1]$ such that if we pick independently and u.a.r an edge of each colour in $C_i$, the probability that $v$ is incident to one of these edges is $P_{i-1}(v)$; Given this, define for every vertex $v$ the probability $Q_{i-1} (v)$ to be such that $P_{i-1}(v) + Q_{i-1}(v) (1-P_{i-1}(v)) = p_{i-1}$, which we will later define; If there exists such a $Q_{i-1}(v) \in [0,1]$ for every vertex $v$, we continue - if not, the algorithm breaks; We now randomly assign to each vertex a bit $Z_v \in \{0,1\}$; We do this independently across all vertices and such that $Z_v \sim \text{Ber}(Q_{i-1}(v))$; We then proceed with the following steps:
\begin{itemize}
    \item [\textit{Step 1}] First, pick independently and u.a.r an edge of each colour in $C_i$. Denote these edges by the \textbf{chosen} ones and say that their vertices are the \textbf{marked} vertices. Note by before that $P_{i-1}(v) = \mathbb{P}(v \text{ is marked})$ for every vertex $v$.
    \\

    \item [\textit{Step 2}] From the chosen edges, say that two of them \textbf{collide} if they share a vertex. Delete from $G_{i-1}$, along with their vertices, those chosen edges which don't collide with any other. Say that these are the \textbf{killed} edges and their vertices are also \textbf{killed}. Add the killed edges to $M$ and say that the colours of these edges were processed into $M$.
    \\

    \item [\textit{Step 3}] For each vertex $v \in V(G_{i-1})$ that survived Step 2 (i.e, wasn't killed), we look at the value of $Z_v$. If this is $1$, then we \textbf{zap} (i.e, delete from $G_{i-1}$) the vertex $v$. Otherwise, we do nothing.
    \\

    \item [\textit{Step 4}] Let $\Phi_i \subseteq C_i$ denote the set of colours which haven't yet been processed into $M$ because their chosen edges collide with others. Greedily find a rainbow matching of these colours and delete it from the graph along with its vertices. Add the rainbow matching to $M$, thus processing the colours in $\Phi_i$. Denote the graph resulting from these 4 steps by $G_i$.
    \\
\end{itemize}

Say that a vertex $v$ was \textbf{condemned} if it was \textbf{zapped} or \textbf{marked}. Note then that $\mathbb{P}(v \text{ condemned}) = \mathbb{P}(v \text{ marked}) + \mathbb{P}(v \text{ zapped} | \text{$v$ not marked})$ $\mathbb{P}(v \text{ not marked})= P_{i-1}(v) + \mathbb{P}(Z_v = 1) (1-P_{i-1}(v)) = P_{i-1}(v) + Q_{i-1} (v) (1-P_{i-1}(v)) = p_{i-1}$.
\

To finish the algorithm, iteration $\tau$ consists of greedily finding a rainbow matching in $G_{\tau - 1}$ of the colours in $C_{\tau}$ and adding it to $M$, thus processing the colours in $C_{\tau}$.
\\

Note that if the algorithm is successful, $M$ will be a full rainbow matching. However, there are many things that can break the algorithm. Specifically, each of the iterations $1 \leq i \leq \tau - 1$ doesn't break if and only if we can find the probabilities $Q_{i-1}(v)$ and perform Step 4. Moreover, for the algorithm not to break, we also need to be able to perform iteration $\tau$.
\\

Let's now give some notation which we will need in the analysis of the algorithm: Define $\gamma = \frac{\sigma_1}{\sigma_2} < 1$ and $d(x) = 1-\gamma x \in [1-\gamma,1]$ for $0 \leq x \leq 1$. For each colour $c$, let $e_c(x) = e_c(0)d(x)^2$ where $e_c(0) := \frac{e_c}{n}$ (note that $4 \geq e_c(0) \geq \sigma_2$). Let $e^c(i)$ denote the number of edges of colour $c$ in the graph $G_i$, that is in the graph we have after finishing iteration $i$. Define also $e_i := \max_{c \in C_j, j > i} |e_c(i\ensuremath{\varepsilon})n - e^c(i)|$. For a vertex $v \in V(G_i)$, that is, one which survived iterations 1 through $i$, let $d_v^{C_j} (i)$ denote the degree of $v$ in $G_i$ with respect to colours in $C_j$. Let then $d_i := \max_{j > i,v \in G_i} (d_v^{C_j} (i) - \ensuremath{\varepsilon} \sigma_1 d(i\ensuremath{\varepsilon}) n)^+$. Note that $2 \ensuremath{\varepsilon} n \geq d_v$ and so, $d_i \leq (2 + 4 \sigma_1)\ensuremath{\varepsilon} n$. Take for $0 \leq j \leq \tau - 2$, $p_j := \frac{\ensuremath{\varepsilon} \gamma}{d(j\ensuremath{\varepsilon})} + c_j$, where $c_j = \frac{2d_j d(j\ensuremath{\varepsilon}) + 2\ensuremath{\varepsilon} \gamma e_j}{\sigma_2 d(j\ensuremath{\varepsilon})^3 n} \geq 0$. Let also $\mu := \frac{\sqrt{n}}{\log ^2 n }$, which by assumption is an upper bound on the edge multiplicity between each pair of vertices.
\\

We now begin with the analysis of the algorithm.
\begin{lemma}

There exist constants $t_j = t_j(\sigma_1, \sigma_2) > 0$, ($2 \leq j \leq 5)$ and some $n(\sigma_1, \sigma_2) \in \mathbb{N}$, such that if $n \geq n(\sigma_1, \sigma_2)$ then for every $0 \leq i \leq \tau - 2$, if we have just finished iteration $i$ with $e_i \leq t_2 n$, then with positive probability we can perform iteration $i+1$ (that is we can successfully process the chunk $C_{i+1}$) and get, at the end,
\begin{itemize}
    \item $d_{i+1} \leq d_i + t_3 \ensuremath{\varepsilon}^3 n$
    \item $e_{i+1} \leq e_i(1+\frac{t_4 \ensuremath{\varepsilon}}{d(i\ensuremath{\varepsilon})}) + t_5 \ensuremath{\varepsilon}^2 n + \frac{16d_i}{\sigma_2}$
\end{itemize}
\end{lemma}
\begin{proof}
See Section 6.
\end{proof}

\begin{lemma}
There exists some $n'(\sigma_1, \sigma_2) \in \mathbb{N}$ such that if $n \geq n'(\sigma_1, \sigma_2)$, with positive probability we have $d_0 \leq \ensuremath{\varepsilon}^2 n$
\end{lemma}
\begin{proof}
Note that for a vertex $v$ and $1 \leq j \leq \tau$, $d_v^{C_j} (0)$ is determined by the random permutation of the colours performed in the beginning. Note by swapping two colours in that permutation we change $d_v^{C_j} (0)$ by at most $2$. Further, if $d_v^{C_j} (0) = s$, there is a set of at most $s$ colours, which for any other permutation in which these are left unchanged, guarantee that $d_v^{C_j} (0) \geq s$. Then, by McDiarmid's inequality, we have that if $M$ is the median of $d_v^{C_j} (0)$, then for $t \geq 0$,
\begin{equation} \label{ineq:1}
\mathbb{P}(|d_v^{C_j} (0) - M| \geq t) \leq 4e^{-\frac{t^2}{64(M+t)}}
\end{equation}
Note then, by integrating, we have that $\mathbb{E}[|d_v^{C_j} (0) - M|] \leq 4 \int_0^{\infty} \mathbb{P}(|d_v^{C_j} (0) - M| \geq t) dt \leq 4 \int_0^{\infty} e^{-\frac{t^2}{64(M+t)}} dt \leq 4\int_0^M e^{-\frac{t^2}{128M}} dt + 4\int_M^{\infty} e^{-\frac{t}{128}} dt \leq 32 \sqrt{2 \pi M} + 512e^{-\frac{M}{128}} \leq 2 \sqrt{512 \pi M} + 512 \pi$.
Now, note this in particular, gives us that $M - \mathbb{E}[d_v^{C_j} (0)] \leq 2 \sqrt{512 \pi M} + 512 \pi$ and thus, $$(\sqrt{M} - \sqrt{512 \pi})^2 - 1024\pi \leq \mathbb{E}[d_v^{C_j} (0)] $$
Since $\mathbb{E}[d_v^{C_j} (0)] \leq \ensuremath{\varepsilon} d_v \leq \ensuremath{\varepsilon} \sigma_1 n$, by assumption, we can see then that if $n$ is large enough, $M \leq \ensuremath{\varepsilon} \sigma_1 n + O(\sqrt{\ensuremath{\varepsilon} \sigma_1 n})$. Hence, by (\ref{ineq:1}) with $t = \sqrt{\ensuremath{\varepsilon} n} \log n$, we get
$$\mathbb{P}(d_v^{C_j} (0) \geq \sqrt{\ensuremath{\varepsilon} n} \log n + \ensuremath{\varepsilon} \sigma_1 n + O(\sqrt{\ensuremath{\varepsilon} \sigma_1 n})) \leq 4e^{-\frac{\ensuremath{\varepsilon} n \log^2 n}{O(\ensuremath{\varepsilon} n)}} = o(n^{-4})$$

Concluding, we get with probability $1-o(m^{-4})$,
$$d_v^{C_j} (0) \leq \ensuremath{\varepsilon} \sigma_1 n + O(\sqrt{\ensuremath{\varepsilon} n} \log n)$$
Since we have $O(n^3)$ pairs $v,j$, then, with positive probability, we have $d_0 = O(\sqrt{\ensuremath{\varepsilon} n} \log n) \leq \ensuremath{\varepsilon}^2 n$ if $n$ is large enough.
\end{proof}

\begin{lemma}
Take the positive constants $t = t_3$, $s = t_4$ and $r = t_5 + \frac{16(t_3 + 1)}{\sigma_2}$. There exists some $n''(\sigma_1, \sigma_2) \in \mathbb{N}$ such that if $n \geq n''(\sigma_1, \sigma_2)$, then with positive probability, we can perform the algorithm up to iteration $\tau - 1$ (that is, we can successfully process all but the last chunk) and get, $\forall \text{ } 0 \leq i \leq \tau - 2$,
\begin{itemize}
    \item $d_0 \leq \ensuremath{\varepsilon}^2 n$
    \item $d_{i+1} \leq d_i + t \ensuremath{\varepsilon}^3 n$
    \item $e_{i+1} \leq e_i(1+\frac{s \ensuremath{\varepsilon}}{d(i\ensuremath{\varepsilon})}) + r \ensuremath{\varepsilon}^2 n$
\end{itemize}
\end{lemma}
\begin{proof}
Take $n''(\sigma_1, \sigma_2) \geq n'(\sigma_1, \sigma_2),n(\sigma_1, \sigma_2)$ and moreover, such that we have $\frac{1}{\log \log n''} \leq \frac{t_2(1-\gamma)^{\frac{s}{\gamma}}}{r}$. We prove the lemma inductively on $k \geq -1$. The statement of the lemma is the case $k = \tau - 2$. The base case $k = -1$ follows by Lemma 2. Suppose then that it is true for some $\tau - 2 > k \geq -1$. That is, if $n \geq n''(\sigma_1, \sigma_2)$ then with positive probability, we can perform the algorithm up to iteration $k+1$ (that is, we can successfully process all chunks $C_j$ with $j \leq k+1$) and get, $\forall \text{ } 0 \leq i \leq k$,
\begin{itemize}
    \item $d_0 \leq \ensuremath{\varepsilon}^2 n$
    \item $d_{i+1} \leq d_i + t \ensuremath{\varepsilon}^3 n$
    \item $e_{i+1} \leq e_i(1+\frac{s \ensuremath{\varepsilon}}{d(i\ensuremath{\varepsilon})}) + r \ensuremath{\varepsilon}^2 n$
\end{itemize}

Note that by iterating the above bounds we get that $e_{k+1} \leq (k+1) r \ensuremath{\varepsilon}^2 n$ $\prod_{j = 1}^{k} (1+\frac{s\ensuremath{\varepsilon}}{d(j\ensuremath{\varepsilon})}) \leq (k+1) r \ensuremath{\varepsilon}^2 n \text{ exp } (s\ensuremath{\varepsilon} \sum_{j=1}^{k} \frac{1}{d(j\ensuremath{\varepsilon})})$. By comparing the sum to the integral, this is at most $ (k+1) r\ensuremath{\varepsilon}^2 n \text{ exp } (s \int_{\ensuremath{\varepsilon}}^{(k+1)\ensuremath{\varepsilon}} \frac{dx}{1-\gamma x}) $ which since $ \ensuremath{\varepsilon} , (k+1)\ensuremath{\varepsilon} \in (0,1)$, is at most $r\ensuremath{\varepsilon} n \text{ exp } (\frac{s}{\gamma} \log (\frac{1}{1-\gamma})) = \frac{r \ensuremath{\varepsilon} n}{(1-\gamma)^{\frac{s}{\gamma}}} \leq t_2 n$ as $\ensuremath{\varepsilon} \leq \frac{t_2(1-\gamma)^{\frac{s}{\gamma}}}{r}$. Also by iterating, we get $d_{k+1} \leq (t+1) \ensuremath{\varepsilon}^2 n$.

Then, by Lemma 1, with positive probability (conditional on the previous iterations), we can successfully perform iteration $k+2$ and get
\begin{itemize}
    \item $d_{k+2} \leq d_{k+1} + t \ensuremath{\varepsilon}^3 n$
    \item $e_{k+2} \leq e_{k+1}(1+\frac{s \ensuremath{\varepsilon}}{d((k+1)\ensuremath{\varepsilon})}) + t_5 \ensuremath{\varepsilon}^2 n + \frac{16d_{k+1}}{\sigma_2} \leq e_{k+1}(1+\frac{s \ensuremath{\varepsilon}}{d((k+1)\ensuremath{\varepsilon})}) + r \ensuremath{\varepsilon}^2 n$
\end{itemize}
Thus, case $k+1$ is also true and therefore, the Lemma follows by induction.
\end{proof}

Note that Theorem 2 will follow immediately from this last Lemma 3. Indeed, we get that if $n$ is large enough, with positive probability, the algorithm is successful in processing all chunks $C_j$ with $j \leq \tau - 1$. Further, by the same argument as in the proof of Lemma 3, we can also have that $e_{\tau - 1} \leq \frac{r \ensuremath{\varepsilon} n}{(1-\gamma)^{\frac{s}{\gamma}}}$. That is, for every colour $c \in C_{\tau}$
$$e^c(\tau - 1) \geq e_c((\tau - 1)\ensuremath{\varepsilon})n - \frac{r\ensuremath{\varepsilon} n}{(1-\gamma)^{\frac{s}{\gamma}}} \geq \sigma_2 (1-\gamma)^2 n - \frac{r\ensuremath{\varepsilon} n}{(1-\gamma)^{\frac{s}{\gamma}}}$$
Hence, we can take $n$ large enough so that $e^c(\tau - 1) \geq 4\ensuremath{\varepsilon} n$ for every colour, implying that the last chunk can be greedily processed. Theorem 2 then follows.
\end{proof}

\section{Proof of Lemma 1}
\begin{proof}
Take $t_2 = \frac{\sigma_2(1-\gamma)^2}{2}$.
Let us recall that the setup is that we just finished iteration $i$ with $e_i \leq t_2 n$. We then work with the graph $G_i$ we have after iteration $i$. Therefore, when we talk about vertices, we always mean a vertex in this graph. We are performing iteration $i+1$.

\begin{lemma}
There exists a constant $s_1 = s_1(\sigma_1, \sigma_2) > 0$ such that for every vertex $v$,

$$s_1 \ensuremath{\varepsilon} \geq p_i \geq \frac{\ensuremath{\varepsilon} \sigma_1 d(i\ensuremath{\varepsilon}) n + d_i}{\sigma_2 d(i\ensuremath{\varepsilon})^2 n - e_i} \geq P_i(v)$$
\end{lemma}
\begin{proof}
Note that by a union bound on the events that a specific edge incident to $v$ that has colours in $C_{i+1}$ is chosen in Step 1 and the definitions of $d_i,e_i$, we get

$$P_i(v) \leq \frac{\max_v d_v^{C_{i+1}}(i)}{\min_{c \in C_{i+1}} e^c(i)} \leq \frac{\ensuremath{\varepsilon} \sigma_1 d(i\ensuremath{\varepsilon}) n + d_i}{\sigma_2 d(i\ensuremath{\varepsilon})^2 n - e_i}$$
Note since $e_i \leq t_2 n \leq \frac{\sigma_2 d(i\ensuremath{\varepsilon})^2 n}{2}$ then $\sigma_2 d(i\ensuremath{\varepsilon})^2 n - e_i > 0$ and so the last inequality is valid. Further, we also have that
$$\frac{\ensuremath{\varepsilon} \sigma_1 d(i\ensuremath{\varepsilon}) n + d_i}{\sigma_2 d(i\ensuremath{\varepsilon})^2 n - e_i} - \frac{\ensuremath{\varepsilon} \gamma}{d(i\ensuremath{\varepsilon})} = \frac{d_i d(i\ensuremath{\varepsilon}) + \ensuremath{\varepsilon} \gamma e_i}{d(i\ensuremath{\varepsilon})(\sigma_2 d(i\ensuremath{\varepsilon})^2 n - e_i)} \leq c_i $$ where we are using that $\gamma = \frac{\sigma_1}{\sigma_2}$ and that $e_i \leq \frac{\sigma_2 d(i\ensuremath{\varepsilon})^2 n}{2}$. Hence,
$$p_i = c_i + \frac{\ensuremath{\varepsilon} \gamma}{d(i\ensuremath{\varepsilon})} \geq \frac{\ensuremath{\varepsilon} \sigma_1 d(i\ensuremath{\varepsilon}) n + d_i}{\sigma_2 d(i\ensuremath{\varepsilon})^2 n - e_i}$$
Finally, note that by recalling that $d_i \leq (2+4\sigma_1)\ensuremath{\varepsilon} n $ and using that $e_i \leq \frac{\sigma_2 d(i\ensuremath{\varepsilon})^2 n}{2}$ and that $d(i\ensuremath{\varepsilon}) \in [1-\gamma,1]$,
$$c_i = \frac{2d_i d(i\ensuremath{\varepsilon}) + 2\ensuremath{\varepsilon} \gamma e_i}{\sigma_2 d(i\ensuremath{\varepsilon})^3 n} \leq (\frac{2 (2+4\sigma_1) + \gamma \sigma_2}{\sigma_2 (1-\gamma)^3})\ensuremath{\varepsilon}$$
Thus, take $s_1 = \frac{2 (2+4\sigma_1) + \gamma \sigma_2}{\sigma_2 (1-\gamma)^3} + \frac{\gamma}{1-\gamma}$ to get $p_i = c_i + \frac{\ensuremath{\varepsilon} \gamma}{d(i\ensuremath{\varepsilon})} \leq s_1 \ensuremath{\varepsilon}$.
\end{proof}
Note this Lemma 4 shows that if $n$ is large enough, we can find probabilities $Q_i(v)$ for every vertex $v$. Indeed, by the Lemma 4, we get that $\frac{1}{2} \geq p_i \geq \max_v P_i(v)$ and so, we can always find $Q_i(v)$ uniquely for every vertex $v$.
\begin{lemma}
There exists a constant $s_2 = s_2(\sigma_1, \sigma_2) > 0$ such that with probability $1-o(1)$,
$$|\Phi_{i+1}| \leq s_2 \ensuremath{\varepsilon}^2 n$$
\end{lemma}

\begin{proof}
For every vertex $u$, define $X_u$ to be the number of chosen edges (in Step 1 of iteration $i+1$) incident to $u$. Let also $Y_u := X_u 1_{X_u \geq 2}$. This counts the number of edge collisions that the vertex $u$ creates. Since $|\Phi_{i+1}|$ counts the number of colours whose chosen edge collides with others, we have that $|\Phi_{i+1}| \leq \sum_{u} Y_u$ where the sum is over all vertices $u$. Moreover, note that for every such $u$, by definition, $Y_u \leq X_u(X_u - 1)$ giving that $|\Phi_{i+1}| \leq \sum_{u} X_u(X_u - 1)$.
\\
Denote the set of edges of colours in the chunk $C_{i+1}$ which are incident to $u$ (after iteration $i$) by $\Gamma_u^{C_{i+1}} (i)$, so that $d_u^{C_{i+1}}(i) = |\Gamma_u^{C_{i+1}} (i)|$. Then, note that for distinct edges $e_1, e_2$ in $\Gamma_u^{C_{i+1}} (i)$,
$$\mathbb{P} (e_1,e_2 \text{ are both chosen}) \leq \frac{1}{(\min_{c \in C_{i+1}} e^c(i))^2} \leq \frac{1}{t_2^2 n^2}$$ where we are using that $e^c(i) \geq e_c(i\ensuremath{\varepsilon})n - e_i \geq \sigma_2 (1-\gamma)^2 n - e_i \geq  \sigma_2 (1-\gamma)^2 n - t_2 n = t_2 n$ by definition of $t_2$. Further, $X_u(X_u-1)$ counts the number of ordered pairs of distinct chosen edges in $\Gamma_u^{C_{i+1}} (i)$. Thus, by a union bound on the events that a specific pair is chosen, we can see that $\mathbb{E} [X_u(X_u-1)] \leq \frac{d_u^{C_{i+1}}(i) ^2}{t_2^2 n^2}$. Using that $d_u^{C_{i+1}} (i) \leq 2\ensuremath{\varepsilon} n$ (which we have since $|C_{i+1}| \leq \ensuremath{\varepsilon} n$ and each colour class is a disjoint union of $K_3$'s and $K_2$'s), we can also see that $\mathbb{E} [X_u(X_u-1)] \leq (\frac{2 \ensuremath{\varepsilon}}{t_2^2 n})d_u^{C_{i+1}}(i)$. Summing up over the vertices we get
$$\mathbb{E}[|\Phi_{i+1}|] \leq \frac{2 \ensuremath{\varepsilon}}{t_2^2 n} \sum_{u} d_u^{C_{i+1}}(i) \leq \frac{2 \ensuremath{\varepsilon}}{t_2^2 n} \times 2 \ensuremath{\varepsilon} n \times \max_{c \in C_{i+1}} e^c(i) \leq \frac{16}{t_2^2} \ensuremath{\varepsilon}^2 n$$
the second inequality following by the Handshaking Lemma and the last inequality following since $e^c(i) \leq e_c \leq n_c \leq 4n$.
\\
We now prove concentration. Note that $|\Phi_{i+1}|$ is a function of the $\ensuremath{\varepsilon} n$ chosen edges in Step 1. Further, changing a chosen edge of a certain colour in $C_{i+1}$ will deviate $|\Phi_{i+1}|$ by at most $3$. Hence, by Azuma's Inequality, we have

$$\mathbb{P} (||\Phi_{i+1}| - \mathbb{E}[|\Phi_{i+1}|]| \geq \sqrt{\ensuremath{\varepsilon} n} \log n) \leq \frac{2}{n^{\frac{\log n}{18}}}$$

Since $\sqrt{\ensuremath{\varepsilon} n} \log n = o(\ensuremath{\varepsilon}^2 n)$ (as $\ensuremath{\varepsilon} \asymp \frac{1}{\log \log n}$), we have with probability $1-o(1)$,
$$|\Phi_{i+1}| \leq s_2 \ensuremath{\varepsilon}^2 n$$
where $s_2 := \frac{16}{t_2^2} + 1$.
\end{proof}
Let's introduce some notation for the next Lemma. Define for a colour $c$, $e^c(i+\frac{1}{2})$ to be the number of edges of that colour that still remain after Step 3 of iteration $i+1$. Similarly, define $d_v^{C_j} (i+\frac{1}{2})$.

\begin{lemma}
There exists a constant $s_3 = s_3(\sigma_1, \sigma_2) > 0$ such that with probability $1-o(1)$, we have:
\begin{itemize}
    \item $|e^c(i+\frac{1}{2}) - e^c(i)(1-2p_i)| \leq s_3(\ensuremath{\varepsilon}^2 n + |\Phi_{i+1}|)$ for every unprocessed colour $c$ after Step 3, that is every $c \in \Phi_{i+1} \cup \cup_{j=i+2}^{\tau} C_j$.
    \item $d_v^{C_j} (i+\frac{1}{2}) \leq d_v^{C_j} (i)(1-p_i) + s_3 \ensuremath{\varepsilon}^3 n$ for every vertex $v$ surviving Steps 1,2 and 3 (of iteration $i+1$) and $j > i+1$.
\end{itemize}
\end{lemma}
\begin{proof}
This is the most technical part of the proof and we include it in the Appendix.
\end{proof}
\begin{lemma}
There exists a constant $s_4 = s_4(\sigma_1, \sigma_2) > 0$ such that with probability $1-o(1)$, we can successfully perform iteration $i+1$ and get
\begin{itemize}
    \item $|e^c(i+1) - e^c(i)(1-2p_i)| \leq s_4\ensuremath{\varepsilon}^2 n$ for every $c \in \cup_{j=i+2}^{\tau} C_j$.
    \item $d_v^{C_j} (i+1) \leq d_v^{C_j} (i)(1-p_i) + s_3 \ensuremath{\varepsilon}^3 n$ for every vertex $v$ that survives iteration $i+1$ (that is, $v \in V(G_{i+1})$) and $j > i+1$.
\end{itemize}
\end{lemma}
\begin{proof}
We first need to show that Step 4 is successfully performed (note by Lemma 4, we have already shown that the algorithm doesn't break initially when we are assigning the probabilities $Q_i(u)$). Indeed, by Lemmas 5 and 6, we have that with probability $1-o(1)$,
\begin{itemize}
    \item $|e^c(i+\frac{1}{2}) - e^c(i)(1-2p_i)| \leq (s_3+s_3s_2)\ensuremath{\varepsilon}^2 n$ for every $c \in \Phi_{i+1} \cup \cup_{j=i+2}^{\tau} C_j$.
    \item $d_v^{C_j} (i+\frac{1}{2}) \leq d_v^{C_j} (i)(1-p_i) + s_3 \ensuremath{\varepsilon}^3 n$ for every vertex $v$ that survives Steps 1,2 and 3 and $j > i+1$.
\end{itemize}
Note that from the first bound, using Lemma 4 (which in particular also shows that for $n$ large $p_i \leq s_1 \ensuremath{\varepsilon} \leq \frac{1}{2}$) and that $e^c(i) \geq t_2 n$ (which follows by $e_i \leq t_2 n$ as we've seen in the proof of Lemma 5), we can get that
$e^c(i+\frac{1}{2}) \geq e^c(i)(1-2p_i) - (s_3+s_3s_2)\ensuremath{\varepsilon}^2 n \geq t_2 n(1-2p_i) - (s_3 +s_3s_2)\ensuremath{\varepsilon}^2 n \geq t_2 n - (2s_1 t_2 + s_3 \ensuremath{\varepsilon} + s_3 s_2 \ensuremath{\varepsilon})\ensuremath{\varepsilon} n$.
\\
Therefore, since $\ensuremath{\varepsilon} \rightarrow 0$ when $n \rightarrow \infty$ we have that if $n$ is large enough, then $e^c(i+\frac{1}{2}) \geq 4\ensuremath{\varepsilon} n \geq 4|\Phi_{i+1}|$ and so, we can greedily process the colours in $\Phi_{i+1}$, that is, Step 4 is successfully performed and so, the iteration is successfully performed.

Further, when we do perform Step 4, we greedily delete $2|\Phi_{i+1}|$ vertices from the graph. Therefore, we have that $d^{C_j}_v (i+1) \leq d^{C_j}_v (i+\frac{1}{2})$ for every vertex $v$ surviving the iteration and $j > i+1$ as well as $|e^c(i+1) - e^c(i+\frac{1}{2})| \leq 4|\Phi_{i+1}| \leq 4s_2 \ensuremath{\varepsilon}^2 n$ (by Lemma 5) for every colour $c \in \cup_{j=i+2}^{\tau} C_j$. Therefore, Lemma 7 follows by taking $s_4 := 4s_2 + s_3 + s_3s_2$.

\end{proof}

To conclude the proof of Lemma 1, define $t_3 = s_3$, $t_4 = \frac{16}{\sigma_2} - 2 > 0$ and $t_5 = s_4 + 4\gamma^2$.
Note then that if the bounds in Lemma 7 are satisfied, then we have the following:

\begin{itemize}
    \item [i)] Take a vertex $v$ surviving iteration $i+1$ and $j > i+1$. Then, $d_v^{C_j} (i+1) - \ensuremath{\varepsilon} \sigma_1 d((i+1)\ensuremath{\varepsilon})n \leq d_v^{C_j} (i)(1-p_i) + s_3 \ensuremath{\varepsilon}^3 n - \ensuremath{\varepsilon} \sigma_1 d(i\ensuremath{\varepsilon}) n(1-p_i) + \ensuremath{\varepsilon} \sigma_1 n(\gamma \ensuremath{\varepsilon} - p_i d(i\ensuremath{\varepsilon})) \leq d_i(1-p_i) + s_3\ensuremath{\varepsilon}^3 n $, where we have used that $p_i \geq \frac{\ensuremath{\varepsilon} \gamma}{d(i\ensuremath{\varepsilon})}$ and $d((i+1)\ensuremath{\varepsilon}) = d(i\ensuremath{\varepsilon}) - \gamma \ensuremath{\varepsilon}$. Therefore, $d_{i+1} \leq d_i + s_3 \ensuremath{\varepsilon}^3 n$.

    \item [ii)] Take a colour $c \in \cup_{j=i+2}^{\tau} C_j$. Note that by the bound in Lemma 7 and the triangle inequality, $|e^c(i+1) - e_c((i+1)\ensuremath{\varepsilon}) n| \leq s_4 \ensuremath{\varepsilon}^2 n + |e^c(i)(1-2p_i) - e_c((i+1)\ensuremath{\varepsilon}) n|$. Further, this second term is equal to $|(e^c(i)-e_c(i\ensuremath{\varepsilon})n)(1-2p_i) - 2p_i e_c(i \ensuremath{\varepsilon})n + (e_c(i \ensuremath{\varepsilon}) - e_c((i+1) \ensuremath{\varepsilon}))n|$. Since $e_c(i \ensuremath{\varepsilon}) - e_c((i+1) \ensuremath{\varepsilon}) = e_c(0)\gamma \ensuremath{\varepsilon} (2d(i\ensuremath{\varepsilon}) - \gamma \ensuremath{\varepsilon})$,  $p_i = \frac{\ensuremath{\varepsilon} \gamma}{d(i\ensuremath{\varepsilon})} + c_i$ and $e_c(0)n = e_c \leq n_c \leq 4n$ this is at most $|(e^c(i)-e_c(i\ensuremath{\varepsilon})n)(1-2p_i) - 2c_i e_c(i\ensuremath{\varepsilon}) n| + 4 \gamma^2 \ensuremath{\varepsilon} ^2 n \leq e_i(1-2p_i) + 2c_i e_c(i\ensuremath{\varepsilon})n + 4 \gamma^2 \ensuremath{\varepsilon} ^2 n$. Recalling the definition of $c_i$, note that
    $$2 c_i e_c(i\ensuremath{\varepsilon}) n = \frac{4e_c(0) d_i}{\sigma_2} + \frac{4 \ensuremath{\varepsilon} \gamma e_c(0) e_i}{\sigma_2 d(i\ensuremath{\varepsilon})} \leq \frac{16 d_i}{\sigma_2} + \frac{16}{\sigma_2} \frac{\ensuremath{\varepsilon} \gamma e_i}{d(i\ensuremath{\varepsilon})}$$
    Therefore, since $p_i \geq \frac{\ensuremath{\varepsilon} \gamma}{d(i\ensuremath{\varepsilon})}$, we have
    $$e_{i+1} \leq e_i(1+(\frac{16}{\sigma_2} - 2)\frac{\ensuremath{\varepsilon} \gamma}{d(i\ensuremath{\varepsilon})}) + (s_4 + 4\gamma^2)\ensuremath{\varepsilon}^2 n + \frac{16 d_i}{\sigma_2}$$
\end{itemize}
By how $t_3,t_4, t_5$ where defined, this gives us what we need, thus finishing the proof of Lemma 1.
\end{proof}

\section{Concluding Remarks}
In this paper we showed that every multigraph  with  maximum edge-multiplicity  at most $\frac{\sqrt{n}}{\log^2 n}$, edge-coloured by $n$ colours such that each colour class  is a disjoint union of cliques with at least $2n + o(n)$ vertices  has a full rainbow matching.  It would be interesting to know  what is the right  multiplicity bound? For general multigraphs,
the graph composed of $n$ disjoint  triangles with each edge of multiplicity $n-1$, and all edges of a $i$th triangle being  of colour $i$ shows that  there is no full rainbow  matching. We suspect that our bound on the multipliclity bound on the edges is close to the right answer up to the logarithmic factor.  In particular,  we would like to pose the following problem.

\textbf{Problem 1:} Is there a multigraph $G$  with  maximum edge-multiplicity of at most $\sqrt{n}$, edge-coloured by $n$ colours such that each colour class  has at least $2n+o(n)$ vertices and is a disjoint union of non-trivial cliques,  contains no full rainbow matching?

Another problem is to improve the asymptotic  error term on the number of vertices in a colour class. We note that  our proof  can be modified so that the result holds when the size of each colour class is $2n+n^{1-\alpha}$, for some absolute $\alpha>0$. So we would like to ask for a sub-polynomial improvement.  The question below is natural to ask because of the known lower bound~\cite{HS} on the Brualdi-Ryser-Stein conjecture.

\textbf{Problem 2:} Is  it true that  for some constant $C>0$  every simple graph $G$ edge-coloured by $n$ colours such that each colour class  has at least $2n+C\log^2n$ vertices and is a disjoint union of non-trivial cliques, contains a full rainbow matching?

\bibliographystyle{amsplain}

\section{Acknowledgements}
The first author would like to thank the support provided by the London Mathematical Society and the Mathematical Institute at the University of Oxford through an Undergraduate Research Bursary.   The second author would like to thank Alexey Pokrovskiy for introducing her to Grinblat's original problem on multigraphs and for valuable discussions on the topic.

\bibliographystyle{abbrv}


Irreducibility over the Max-Min Semiring

Abstract: For sets $A, B\subset \mathbb N$, their sumset is $A + B := \{a+b: a\in A, b\in B\}$. If we cannot write a set $C$ as $C = A+B$ with $|A|, |B|\geq 2$, then we say that $C$ is $\textit{irreducible}$. The question of whether a given set $C$ is irreducible arises naturally in additive combinatorics. Equivalently, we can formulate this question as one about the irreducibility of boolean polynomials, which has been discussed in previous work by K. H. Kim and F. W. Roush (2005) and Y. Shitov (2014). We prove results about the irreducibility of polynomials and power series over the max-min semiring, a natural generalization of the boolean polynomials.We use combinatorial and probabilistic methods to prove that almost all polynomials are irreducible over the max-min semiring, generalizing work of Y. Shitov (2014) and proving a 2011 conjecture by D. L. Applegate, M. Le Brun, and N. J. A. Sloane. Furthermore, we use measure-theoretic methods and apply Borel's result on normal numbers to prove that almost all power series are asymptotically irreducible over the max-min semiring. This result generalizes work of E. Wirsing (1953).

\section{Introduction}\label{sec:intro}
The max-min semiring is defined as $\mathcal N = (\mathbb N\cup \{\infty\}, \oplus, \otimes)$, where $a\oplus b = \max(a,b), a\otimes b = \min(a,b)$. Previous work (\cite{KR05}, \cite{Shi14}) has discussed the factorization of polynomials over the \textit{Boolean Semiring}, that is, the subsemiring $\mathcal B_2 = \{0,1\}$. In this restricted case, the two questions we hope to settle in general have already been resolved.

\begin{defn}
Let $f\in \mathcal N[[x]]$. If $f = gh$ implies that either $g$ or $h$ is a monomial, then $f$ is \textit{irreducible}.
\end{defn}

\begin{theorem}[Shitov, 2014]\label{thm:Shitov}
As $n\to \infty$, the proportion of degree $n$ polynomials in $\mathcal B_2[x]$ which are irreducible tends to 1.
\end{theorem}

This result answers a 2005 question of K. H. Kim and F. W. Roush. Remarkably, the proof uses only elementary combinatorics and probability.

\begin{defn}
Let $f,g\in \mathcal N[[x]]$. If $f$ and $g$ differ in only finitely many coefficients, then we say $f\sim g$.
\end{defn}

\begin{defn}
Let $f\in \mathcal N[[x]]$. If $f \sim gh$ implies that either $g$ or $h$ is a monomial, then $f$ is \textit{asymptotically irreducible}.
\end{defn}

\begin{theorem}[Wirsing, 1953]\label{thm:Wirsing}
Almost every element of $\mathcal B_2[[x]]$ is asymptotically irreducible.
\end{theorem}

This proof is measure-theoretic and builds heavily off the work of Borel, in particular the result that almost every number is \textit{normal} (\cref{defn:normal}) in base 2. Interestingly, Wirsing and Shitov phrased these results in two different settings. Wirsing in fact writes that almost every set $A\subset \mathbb N$ is asymptotically irreducible.

\begin{defn}\label{defn:sumset}
Let $A, B\subset G$ for some group $G$. Then $A+B = \{a+b: a\in A, b\in B\}$.
\end{defn}

\begin{defn}\label{defn:irreducible}
Let $S\subset \mathbb N$. If $S = A+B$ implies either $A$ or $B$ is a singleton, then $S$ is irreducible. Similarly, if $S \sim A+B$ implies $A$ or $B$ is a monomial, then $S$ is asymptotically irreducible. Here, $\sim$ denotes difference in finitely many elements just like before.
\end{defn}

We restate Shitov and Wirsing's results in these terms: almost every finite subset of $\mathbb N$ is irreducible, and almost every subset of $\mathbb N$ is asymptotically irreducible. The semiring of sets under union and set addition is isomorphic to the semiring of boolean polynomials \cite{Gro19}, hence these two formulations are equivalent.

\ \\

Our contribution is to generalize these results to the wider setting of the max-min semiring.

\begin{theorem}\label{thm:gen-Shitov}
Fix $b$, and set $\mathcal B_b = \{0, 1, \dots, b-1\}\subset \mathcal N$. Then as $n\to \infty$, the proportion of degree $n$ polynomials in $\mathcal B_b[x]$ which are irreducible tends to 1.
\end{theorem}

\begin{theorem}\label{thm:gen-wirsing}
Almost every element of $\mathcal B_b[[x]]$ is asymptotically irreducible.
\end{theorem}

Just as products of boolean polynomials correspond to sums of sets, products of min-max polynomials correspond to sums of \textit{multisets}. For more details on this correspondence, see \cite{Gro19}.

In Section 2, we prove \Cref{thm:gen-Shitov} by partitioning the collection of reducible polynomials in $\mathcal B_b[[x]]$ into several subcollections and bounding the size of each. We do this by applying Hoeffding's inequality and a generalization of a lemma from \cite{Shi14}. In Section 3, we prove \Cref{thm:gen-wirsing} by partitioning the set of reducible elements of $\mathcal B_b[[x]]$ into subcollections and bounding the size of each. This is done via applications of the Borel-Cantelli Lemma and the result that almost all numbers are normal in every base \cite{Wei21}.

\section{Proof of \Cref{thm:gen-Shitov}}\label{sec:Shitov}
In this section, we generalize Shitov's result to polynomials over the max-min semiring.
We begin with some conventions.

\begin{defn}
    Let $f\in \mathcal N[x]$. Then $\abs{f}$ denotes the number of nonzero coefficients of $f$.
\end{defn}

\begin{defn}[\cite{ALS11}]
    A \textit{digit map} is a nondecreasing function $\mathbb N\to \mathbb N$. If $d$ is a digit map and $f = a_0 \oplus a_1x \oplus a_2x^2\oplus \cdots\in \mathcal N[[x]]$, then we let $d(f) = d(a_0) \oplus d(a_1)x \oplus d(a_2)x^2\oplus \cdots$.
\end{defn}

\begin{prop}[\cite{ALS11}]
    If $d$ is a digit map, then $d: \mathcal N[[x]]\to \mathcal N[[x]]$ is a semiring homomorphism. In particular, if $f = gh$ is a nontrivial factorization and $d(1) \geq 1$, then $d(f)=d(g)d(h)$ is a nontrivial factorization of $d(f)$.
\end{prop}

This key idea provides a powerful framework for our proof, allowing us to partially reduce the problem of factoring a polynomial over $\mathcal B_b$ to factoring one over $\mathcal B_2$.

\begin{defn}\label{defn:canonical-digit-maps}
    We define the digit maps maps $s_i$ for each $i\in \mathbb Z^+$.
    \begin{align}
        s_i(n)\ :=\ \begin{cases}
        0 & n < i\\
        i & n \geq i.
        \end{cases}
    \end{align}
    For $f\in \mathcal N[[x]]$, we additionally define $f_i = s_1(s_i(f))$. These polynomials, which we refer to as the ``$i$-level support of $f$'', are indicator functions for where the coefficients of $f$ are at least $i$.
\end{defn}

Finally, to conclude our setup, we use the following convention for referencing the coefficients of polynomials.

\begin{defn}
Throughout the remainder of this paper, let
    \begin{align*}
        f\ =\ \bigoplus_{k=0}^\infty \alpha_kx^k,\ \,\ \, g\ =\ \bigoplus_{k=0}^{\infty} \beta_kx^k,\ \,\ \, h\ =\ \bigoplus_{k=0}^\infty \gamma_kx^k,\ \,\ \, \sigma = \bigoplus_{k=0}^\infty \delta_kx^k.\\
    \end{align*}
Additionally, set $\alpha'_i = \alpha_i\otimes 1$ and similarly for each other coefficient. This way we have, for instance:
\[
f_1\ =\ \bigoplus_{k=0}^\infty \alpha'_kx^k,\ \,\ \, g_1\ =\ \bigoplus_{k=0}^{\infty} \beta'_kx^k,\ \,\ \, h_1\ =\ \bigoplus_{k=0}^\infty \gamma'_kx^k,\ \,\ \, \sigma_1 = \bigoplus_{k=0}^\infty \delta'_kx^k.
\]
\end{defn}

In the proof of another lemma, Shitov shows the following statement, which will be of great use to us.

\begin{cor}[\cite{Shi14}]\label{cor:close-factors}
 For any $d>0$, the number of pairs of boolean polynomials $(f,g)$ satisfying the following conditions is at most $n^{2d+1}2^{(k,n)}$.
\begin{enumerate}
    \item The constant terms of $f,g$ are nonzero;
    \item $\deg f = k > 0, \deg g = n-k$;
    \item $\abs{f\otimes g} \leq \abs{f} + \abs{g} + d$.
\end{enumerate}
\end{cor}

Due to our slightly different convention about irreducibility, we require a version of this lemma when the condition (1) is not necessarily satisfied. We now address the opposing conventions of irreducibility.

Our definition of irreducible is slightly broader than the traditional notion of irreducibility over a semiring ($f = gh\implies g$ is a unit). The advantages of our definition are as follows.

\begin{itemize}
    \item If $f\in \mathcal B_b[[x]]$ is irreducible, then $f$ is also irreducible over $\mathcal N[[x]]$. In contrast, $f = (b-1)\otimes f$ is trivial factorization over $B_b[[x]]$, but a nontrivial factorization over $\mathcal N[[x]]$ as $b-1$ is no longer a unit. Thus, despite introducing no new factors, $f$ is now reducible.

    \item The Taylor series $f$ such that $g\mapsto f\otimes g$ is an injective endomorphism of any semiring $\mathcal B_b[[x]]$ are precisely the monomials. Thus, despite not having multiplicative inverses, multiplication by monomials is invertible in the sense that we have cancellation.

    \item This definition lines up with the additive combinatorics. For instance, the set $\{1,2,4\}$ is additively indecomposible, but the polynomial $x \oplus x^2\oplus x^4$ is reducible as $x(1\oplus x\oplus x^3)$ under previous authors' definitions.
\end{itemize}

We now generalize \Cref{cor:close-factors} to our setting.

\begin{lemma}\label{lemma:close-factors-2}
    The number of pairs boolean polynomials $(f,g)$ satisfying the following conditions is at most $n^{2d+2}2^k$ for any $d>0$.
    \begin{enumerate}
        \item The constant term of $f$ is nonzero;
        \item $\deg f = k>0, \deg g = n-k$;
        \item $\abs{f\otimes g} \leq \abs{f} + \abs{g} + d$.
    \end{enumerate}
\end{lemma}

\begin{proof}
     Write $g = x^j\otimes (1 + \cdots + x^{n-k-j})$ and define $\bar g$ by $g = x^j\otimes \bar g$. Then clearly $\abs{f\otimes g} = \abs{f\otimes \bar g}$ and $\abs{g} = \abs{\bar g}$. By \Cref{cor:close-factors}, there are at most $n^{2d+1}2^{(k,n-j)}$ pairs $(f,\bar g)$ satisfying the hypotheses of the corollary. Since there are at most $n$ choices for $j$, the number of pairs $(f,g)$ satisfying the hypotheses of this lemma is at most $\sum_{j=0}^{n-1} n^{2d+1}2^{(k,n-j)} \leq n^{2d+2}2^k$.
\end{proof}

The final ingredient for our proof is Hoeffding's inequality: a probabilistic lemma which Shitov used, in conjunction with \Cref{cor:close-factors}, to prove \Cref{thm:Shitov}.

\begin{prop}[Hoeffding's Inequality]
Let $X_n$ be a sum of $n$ independent Bernoulli random variables $X$ with $\mathbb E[X] = p$. Then $P(\abs{X_n-np} > \epsilon n) \leq 2e^{-2\epsilon^2 n}$.
\end{prop}

\begin{proof}
See \cite{Hoe63}, Theorem 2.
\end{proof}

When we choose a degree $n-1$ polynomial $f$ at random from $\mathcal B_b[x]$, the quantity $\abs{f_i}$ is a sum of $n$ independent Bernoulli random variables $Z_i$ with $\mathbb E[Z_i] = \frac{b-i}{b}$. As a consequence, if $f$ is a degree $n-1$ polynomial chosen randomly from $\mathcal B_b[x]$, then
\begin{equation}\label{eqn:hoeffding-support}
 P\left(\abs{\abs{f_i}- \frac{(b-i)n}{b}} > \epsilon n\right) \leq 2e^{-2\epsilon^2n}.
\end{equation}

\begin{defn}
If $f, g$ are nonnegative real-valued functions and there exists a constant $c>0$ such that $f \leq cg$, then we write $f\lesssim g$.
\end{defn}

We now prove a quantitative version of \Cref{thm:gen-Shitov}.

\begin{prop}\label{prop:quantitative-gen-Shitov}
Let $b>1$ and $a = \lfloor b/2\rfloor$ and let $\Sigma_{b,n}$ denote the set of reducible degree $n-1$ polynomials in $\mathcal B_b[x]$. Then for any $d,v>0$ we have
\begin{align*}
    \abs{\Sigma_{b,n}}\ \lesssim b^n\ \left (ne^{-d^2/4(n+1)} + vn^{2d+1}2^vb^{-n} + n^22^{-v} + n^{2d+3}2^{\frac{d}{2}-\frac{n}{3}}\right).
\end{align*}
\end{prop}

\begin{proof}
     We partition $\Sigma_{b,n}$ into 7 sets $\Sigma_{b,n}\subset E^1_n(d,v) \cup \cdots \cup E^7_n(d,v)$. Our proposition follows from the bound $\abs{\Sigma_{b,n}} \leq \abs{E^1_n(d,v)} + \cdots + \abs{E^7_n(d,v)}$.

\label{defn:5-set-partition}
     We now detail the partition. Though we will not write this after each set, we stipulate that $h\in E^i_n(d,v)$ only if $h\notin E^j_n(d,v)$ for any $j<i$.

         \begin{itemize}
             \item[] $E^1_n(d,v)$ is the set of polynomials $h$ such that $\abs{\abs{h_1} - \frac{(b-1)n}{b}} > \frac{d}{2}$.
             \item[] $E^2_n(d,v)$ is those $h = f\otimes g$ such that $\abs{\abs{f_1} + \abs{g_1} - \frac{(b-1)(n+1)}{b}} > \frac{d}{2}$.
             \item[] $E^3_n(d,v)$ is those $h$ such that $\abs{\abs{h_a} - \frac{(b-a)n}{b}} > \frac{d}{2}$.
             \item[] $E^4_n(d,v)$ is those $h = f\otimes g$ such that $\abs{\abs{f_a} + \abs{g_a} - \frac{(b-a)(n+1)}{b}} > \frac{d}{2}$.\\
             \item[] The size of each of these sets can be bounded using \Cref{eqn:hoeffding-support}. We start by considering these sets in order to control the size of the supports of the polynomials in the remaining sets. In particular, we want $|h_i| \leq |f_i| + |g_i| + d$ for $i = 1, a$. This is so that when $h_i = f_i\otimes g_i$ is a nontrivial factorization, the hypotheses of \Cref{lemma:close-factors-2} apply and we can conclude that there are few possible pairs $(f, g)$.\\
             \item[] $E^5_n(d,v)$ is those $h = f\otimes g$ with $\deg f\leq v$.
             \item[] $E^6_n(d,v)$ is those $h = f\otimes g$ with $\abs{f_a} \leq 1$ or $\abs{g_a}\leq 1$. \\
             \item[]The set $E^6_n(d,v)$ contains polynomials $h = f \otimes g$ where $h_a = f_a \otimes g_a$ is a trivial factorization. However, if $\deg f\leq v$, then $h \in E^5_n(d,v)$, and thus not in $E^6_n(d,v)$. Using this fact allows us to achieve the necessary upper bound on the size of $E^6_n(d,v)$.
             \\
             \item[] $E^7_n(d,v)$ is all remaining reducible degree $n-1$ polynomials $h$. Once the first 6 sets are considered, every remaining reducible polynomial $h = f\otimes g$ satisfies $|h_a| \leq |f_a| + |g_a| + d$, and $h_a = f_a\otimes g_a$ is a nontrivial factorization. Thus, we are able to apply \Cref{lemma:close-factors-2} to conclude that the number of remaining reducible polynomials is small.
         \end{itemize}

     Now, we are ready to bound the size of each of these sets.

     \begin{enumerate}
         \item By \Cref{eqn:hoeffding-support} with $\epsilon = \frac{d}{2n}$, we obtain
         \[\abs{E^1_n(d,v)}, \abs{E^3_n(d,v)} \leq 2e^{-d^2/4n}b^n\lesssim e^{-d^2/4n}b^n \leq e^{-d^2/4(n+1)}b^n.\]
         \item[]

         \item Each pair $(f,g)$ corresponds to only one choice of $h$, thus it suffices to bound the number of pairs $(f,g)$. If we fix $\deg f = k$, then we must have $\deg g = n-k-1$ as $\deg (f\otimes g) = n-1$. The set of pairs $(f,g)\in (\mathcal B_b[x])^2$ such that $\deg f = k, \deg g = n-k-1$ is in bijection with the set of degree $n$ polynomials of $\mathcal B_b[x]$, with the bijection given below:
         \begin{align*}
            \phi(f,g) & \ =\  f \oplus \left(((b-1) x^{k+1})\otimes g\right)\\
            \phi^{-1}(h) &\ = \ \left(\bigoplus_{j=0}^k \gamma_jx^j, \bigoplus_{j=k+1}^n \gamma_jx^{j-k-1}\right).
         \end{align*}
         Moreover, $\abs{f_i} + \abs{g_i} = \abs{(\phi(f,g))_i}$.
         Thus, choosing $\epsilon = \frac{d}{2n+2}$ and applying \Cref{eqn:hoeffding-support}, we obtain that there are at most $2e^{-d^2/4(n+1)}b^{n+1}$ such pairs $(f,g)$. Since there are $n/2$ choices for $\deg f$, we use this bound for each choice and obtain
         \[
         \abs{E^2_n(d,v)}, \abs{E^4_n(d,v)}\ \leq\ ne^{-d^2/4(n+1)}b^{n+1} \ \lesssim\ ne^{-d^2/4(n+1)}b^n.
         \]
         \item[]
         \item Let $h = f\otimes g\in E^5_n(d,v)$. Since $h\notin E^1_n(d,v)\cup E^3_n(d,v)$, we have $\abs{h_1} \leq \frac{(b-1)n}{b} + \frac{d}{2}, \abs{f_1} + \abs{g_1} \geq \frac{(b-1)(n+1)}{b} - \frac{d}{2}$. Thus $\abs{h_1} \leq \abs{f_1} + \abs{g_1} + d$. If $\abs{f_1} \leq 1$ or $\abs{g_1}\leq 1$, then $f$ or $g$ is a monomial in contradiction to the assumption that $f\otimes g$ is a nontrivial factorization, hence $(f_1,g_1)$ satisfy every hypothesis of \Cref{lemma:close-factors-2}. We apply this lemma once for each choice of $1\leq \deg f \leq v$, and conclude
         \[
            \abs{E^5_n(d,v)}\ \leq\ \sum_{\deg f = 1}^vn^{2d+1}2^{\deg f}\ \leq\ vn^{2d+1}2^v.
        \]
         \item[]
         \item Suppose $\abs{f_a}\leq 1$. Then fix $\deg f = k$. Since $h\notin E^5_n(d,v)$, we can assume $k>v$. Then there are $(k+1)(b-a)(a-1)^{k}$ choices\footnote{Pick the index of the coefficient to be at least $a$, then pick its value, then pick the remaining coefficients from $\{0,\cdots, a-1\}$.} for $f$ and $b^{n-k}$ choices for $g$, hence there are $\leq (k+1)(a-1)^kb^{n-k+1}$ pairs $(f,g)$. There are at most $n$ choices for $k$, hence
         \begin{align*}
            \abs{E^6_n(d,v)} &\ \leq\ \sum_{k=v}^n (k+1)(a-1)^kb^{n-k+1}\ \leq\ n(n+1) (a-1)^vb^{n-v+1} \\
            &\ \lesssim\ n^2 (a-1)^vb^{n-v}\ \leq\
            n^2\left(\frac{b}{2}\right)^vb^{n-v} \ \leq  n^22^{-v}b^n.
         \end{align*}
         If instead $\abs{g_a}\leq 1$, then we have that $\deg(g) \geq \deg(f)\geq v$. By symmetry, there are at most twice as many pairs with either $|f_a| \leq 1$ or $|g_a| \leq 1$ as there are with $|f_a|\leq 1$. This doubles the size of our upper bound, but this is only a constant factor.
         \item[]
         \item Let $h = f\otimes g$. Since $h\notin E^3_n(d,v)\cup E^4_n(d,v)$, we have $\abs{h_a} < \frac{(b-a)n}{b} + \frac{d}{2}$ and $\abs{f_a} + \abs{g_a} > \frac{(b-a)(n+1)}{b}$, hence $\abs{h_a}\leq \abs{f_a} + \abs{g_a} + d$. Moreover, as $h\notin E^6_n(d,v)$, neither $f_a$ nor $g_a$ is a monomial and thus the pair $(f_a, g_a)$ is a nontrivial factorization of $h_a$ and satisfies the hypotheses of \Cref{lemma:close-factors-2}. Thus, using the fact that $(\deg f_a, n-1) \leq \frac{n-1}{2}\leq \frac{n}{2}$ for $1\leq \deg f\leq n-2$, the number of possible choices for $h_a$ is at most
         \[\sum_{\deg f_a = 1}^{n-2} n^{2d+2}2^{(\deg f_a,n-1)} \ \leq\ n^{2d+3}2^{\frac{n}{2}}.\]
         Once $h_a$ is known, if $\abs{h_a} = k$, there are $a^{n-k}(b-a)^k$ choices for $h$. This is because each 0 coefficient of $h_a$ can correspond to any coefficient in $\{0,\ldots, a-1\}$, and any 1 corresponds to a coefficient in $\{a, \ldots, b-1\}$. Since $h\notin E^3_n(d,v)$, we can say $k\leq \frac{(b-a)n}{b} + \frac{d}{2}$, a quantity which we denote by $s$ to clean up our expressions. Recalling that $a := \floor{b/2}$, we have $a \leq b/2\leq (b-a)$, with equality of all terms when $b$ is even. This gives the following upper bound:
         \begin{align*}
           a^{n-k}(b-a)^k&\ \leq\ a^{n-s}(b-a)^s
         \\&\ \leq\  a^{\frac{a n}{b}}(b-a)^{\frac{(b-a)n}{b}}
        \left(\frac{b-a}{a}\right)^{\frac{d}{2}}
        \\&\ \leq\ a^{\frac{n}{2}}(b-a)^{\frac{n}{2}}\left(\frac{b-a}{a}\right)^{\left(\frac{b-a}{b}-\frac{1}{2}\right)n}
        \left(\frac{b-a}{a}\right)^{\frac{d}{2}}
        \\&\ \leq\
        \left(\frac{b}{2}\right)^n\left(\frac{b-a}{a}\right)^{\left(\frac{b-a}{b}-\frac{1}{2}\right)n} \left(\frac{b-a}{a}\right)^{\frac{d}{2}}.
         \end{align*}
        For $b\geq 2$, we have the bounds $1\leq \frac{b-a}{a}\leq 2$ and $0\leq \frac{b-a}{b} - \frac{1}{2} \leq \frac{1}{6}$, both of which are achieved when $b = 3$. Moreover, for $b = 2$, we have $\left(\frac{b-a}{b}^{\frac{b-a}{b}-\frac{1}{2}}\right) = 1$, thus for any $b\geq 2$ we have $\left(\frac{b-a}{b}\right)^{(\frac{b-a}{b}-\frac{1}{2})n}\leq 2^{\frac{n}{6}}$. Altogether, this yields:
        \begin{align*}
            \abs{E^7_n(d,v)} &\ \leq\ n^{2d+3}2^{\frac{n}{2}}\left(\frac{b}{2}\right)^n \left(\frac{b-a}{a}\right)^{\frac{d}{2}}\left(\frac{b-a}{b}\right)^{(\frac{b-a}{b}-\frac{1}{2})n} \\
            &\ \leq\  n^{2d+3}2^{\frac{n}{2}}\left(\frac{b}{2}\right)^n 2^{\frac{n}{6}}2^{\frac{d}{2}} \ \leq\ n^{2d+3}2^{\frac{d}{2}-\frac{n}{3}}b^n.
        \end{align*}
     \end{enumerate}
\end{proof}

With the right choice of $d,v$, this gives us a proof of \Cref{thm:gen-Shitov}.

\begin{proof}
     Our goal is to show that $\frac{\abs{\Sigma_{b,n}}}{b^n}\to 0$, from which the result follows. Set $d = 2\sqrt{n+1}\log n$ and $v = 3\log_2 n$ then apply \Cref{prop:quantitative-gen-Shitov}. We show that each summand of the upper bound on $\frac{\abs{\Sigma_{b,n}}}{b^n}$ vanishes.
     \begin{enumerate}
         \item We have $ne^{-d^2/4(n+1)} = ne^{-(\log n)^2} = n^{1-\log n}$, which vanishes as $n\to \infty$.
         \item[]
         \item We have $\log (vn^{2d+1}2^vb^{-n})  = \log v + (4\sqrt{n+1}\log n + 2)\log n + 3\log_2 n\log 2 - n\log b$. Each summand of this expression is sub-linear except for the one which is negative, therefore this diverges to $-\infty$. It follows that
         \[(vn^{2d+1}2^vb^{-n}) = e^{\log (vn^{2d+1}2^vb^{-n})} \to 0.\]
         \item[]
         \item We have $n^22^{-v} = n^22^{-3\log_2 n} = n^{-1} \to 0$.
         \item[]
         \item We have $\log \left(n^{2d+3}2^{\frac{d}{2}-\frac{n}{3}}\right) = 4\sqrt{n+1}\log n + (\sqrt{n+1}\log n - \frac{n}{3})\log 2$. By the same reasoning as the bound on the second summand, we conclude $n^{2d+3}2^{\frac{d}{2}-\frac{n}{3}}\to 0$.
     \end{enumerate}
\end{proof}

This result in hand, we are now prepared to state and prove the conjecture of Applegate, LeBrun, and Sloane \cite{ALS11}. Their conjecture refers to prime elements of the semiring, which we define below, and is in some ways a more natural definition.

\begin{defn}\label{defn:prime-polynomial}
    A polynomial $h\in \mathcal B_b[x]$ is \textit{prime} if $h = f\otimes g$ implies either $f,g = b-1$.
\end{defn}

\begin{conjecture}\label{conj:lunar-prime-conj}
Let $\pi_b(n)$ denote the number of degree $n-1$ prime polynomials of $\mathcal B_b[x]$. Then $\pi_b(n)\sim (b-1)^2b^{n-2}$.
\end{conjecture}

Motivating their conjecture, Applegate et al. observed that only certain polynomials can be prime.

\begin{defn}\label{defn:prime-candidate}
    A \textit{prime candidate} of $\mathcal B_b[x]$ is a polynomial with nonzero constant term and maximum coefficient $b-1$.
\end{defn}

It is easy enough to see that a polynomial is prime only if it is a prime candidate. If $h = a_jx^j \oplus \cdots \oplus a_{n-1}x^{n-1}$ for $j>1$, then $h = (b-1)x^j\otimes (a_j \oplus \cdots \oplus a_{n-1}x^{n-j-1})$ which is a nontrivial factorization in their convention. Moreover, if $c<b-1$ is the maximum coefficient of $h$, then $h = c\otimes h$.

They showed that the number of prime candidates is asymptotic to $(b-1)^2b^{n-2}$, and from their data\footnote{OEIS sequences \href{https://oeis.org/A169912}{(A169912)}, \href{https://oeis.org/A087636}{(A087636)} show the number of prime elements of $\mathcal B_2[x], \mathcal B_{10}[x]$ of each degree $n$.}, as $k\to \infty$, almost all prime candidates are in fact prime. As evidence for this fact, Applegate et al. produced the following lower bound:
\begin{equation*}
    (b-1)^{n-2} + 2(b-2)^{n-2} + \cdots \leq \pi_b(n).
\end{equation*}
Moreover, they observed the following, which we will re-prove here.
\begin{lemma}[\cite{ALS11}]\label{lemma:irreducible-prime-candidate}
    An irreducible prime candidate is prime.
\end{lemma}
\begin{proof}
     If $h$ is irreducible, then $h = fg$ implies either $f,g$ is a monomial, without loss of generality, $f$ is. Since the constant term of $h$ is nonzero, we must have that $f$ is a constant. Since the maximum coefficient of $h$ is $b-1$, we must also have that $f = b-1$, thus $h$ is prime.
\end{proof}
With this lemma, \Cref{conj:lunar-prime-conj} is a simple corollary of \Cref{thm:gen-Shitov}.

\begin{proof}
     The proportion of degree $n-1$ prime candidates of $\mathcal B_b[x]$ which are irreducible is at most a quantity which vanishes as $n\to\infty$:
     \begin{equation}\label{eqn:vanishing-candidates}
         \frac{\abs{\Sigma_{b,n}}}{(b-1)^2b^{n-2}} \lesssim  \frac{\abs{\Sigma_{b,n}}}{b^n} \to 0.
     \end{equation}It follows that almost all prime candidates are prime.
\end{proof}

\section{Proof of \Cref{thm:gen-wirsing}}
Before we prove this, we first must clarify what we mean by ``almost all.'' It turns out, there is a very natural measure to associate to the set $\mathcal B_b[[x]]$.

\begin{defn}
    To each element of $\mathcal B_b[[x]]$ we associate a real number in $[0, b]$, given by
    \begin{equation}
\rho_b\left(\bigoplus_{k=0}^\infty a_kx^k\right) \ := \ \sum_{k=0}^{\infty}a_kb^{-n}.
\end{equation}
\end{defn}

In other words, each power series corresponds to a string of digits in $[0,1,\dots,b-1]$, which we can interpret as the base-$b$ expansion of a number. This allows us to define a probability measure $m$ on $\mathcal B_b[[x]]$.

\begin{defn}\label{defn:measure}
    For a set $A \subset \mathcal B_b[[x]]$ such that $\rho_b(A)$ is a measurable subset of $\mathbb R$, let $m(A) = b^{-1}{\mathcal L(\rho_b(A))}$, where $\mathcal L$ denotes the Lebesgue measure.
\end{defn}

This reframing allows us to ask and answer questions about these polynomials measure-theoretically.  For example, we will use Borel's theorem that every number is normal, regardless of base \cite{Wei21}.

We deduce \Cref{thm:gen-wirsing} from a second theorem.

\begin{theorem} \label{thm:gen-wirsing-measure}
    Let $\mathcal C^b\subset \mathcal B_b[[x]]$ denote the set of reducible polynomials. Then $m(\mathcal C^b) = 0$.
\end{theorem}

We show first how \Cref{thm:gen-wirsing} follows from \Cref{thm:gen-wirsing-measure}.

\begin{proof}
    For $f\in \mathcal B_b[[x]]$, let $[f]$ denote the set of all $g$ such that $f\sim g$. The set of asymptotically reducible $f$ is precisely the set $[\mathcal C^b]$. Fix a natural number $n$, and notice the set of functions which differ in exactly $n$ coefficients from some element of $C^b$ has measure 0. Thus, $[C^b]$ is a countable union of measure 0 sets, hence it has measure 0 and almost all power series over $\mathcal B_b[[x]]$ are irreducible.
\end{proof}

We now prove \Cref{thm:gen-wirsing-measure}. Our proof parallels Wirsing's original argument to a great extent, but as the authors are not aware of an English translation of Wirsing's result \cite{Wir53}, we reproduce it here for the sake of completeness.

\begin{defn}\label{defn:A(x)}
    For $n\in\mathbb N$ and $f = \bigoplus_{k=0}^\infty a_kx^k \in \mathcal N[[x]]$, define $f(n) := \bigoplus_{k=0}^n a_kx^k \in \mathcal N[x]$.
\end{defn}

First, partition $\mathcal{C}^b$ into three sets $T^b_1,T^b_2,T^b_3$:
\begin{align*}
    T^b_1 & \ :=\  \left\{h:h=f\otimes g \textrm{ with } 2\leq \abs{g_1}<\infty\right\}\\
    T^b_2 &\ :=\  \left\{h:h=f\otimes g \textrm{ with } \liminf_{n\rightarrow\infty}\frac{\abs{f_1(n)}+\abs{g_1(n)}}{n}<\frac{1}{5} \textrm{ and } \abs{f_1}=\infty=\abs{g_1}\right\}\\
    T^b_3 & \ :=\  \left\{ h:h=f\otimes g \textrm{ with } \liminf_{n\rightarrow\infty}\frac{\abs{f_1(n)}+\abs{g_1(n)}}{n}\geq\frac{1}{5} \textrm{ and } \abs{f_1}=\infty=\abs{g_1} \right\}.
    \end{align*}
Since $T^b_1 \cup T^b_2 \cup T^b_2 = C^b$, it suffices to show that $\mathcal L(T^b_1) = \mathcal L(T^b_2) = \mathcal L(T^b_3) = 0$.  In proving that the measures of $T^b_1$ and $T^b_3$ are 0, we rely extensively on the following idea.

\begin{defn}\label{defn:normal}
    A number $\lambda\in\mathbb R$ is \textit{normal} in base $b$ if the base $b$ representation of $\lambda$ contains an equal proportion of each finite sequence of digits base $b$.  That is, if for all positive integers $n$, all possible strings of $n$ digits  have density $b^{-n}$ in the base $b$ representation.

    More formally, let $s = (\delta_1, \dots, \delta_k)$ be a string of digits in $\{0, \dots, b-1\}$. Fix a real number $\lambda$ and let $N_\lambda(n, s)$ denote the number of occurences of the string $s$ in the first $n$ digits of the base-$b$ expansion of $\lambda$. Then the following holds:
    \[
    \lim_{n\to\infty} \frac{N_\lambda(n,s)}{n}\ =\ b^{-k}.
    \]
    An equivalent formulation of this is the following: let $Z \subset \{0, \dots, b-1\}^k$ and let $N_\lambda(n,Z) = \sum_{s\in Z} N(n,s)$. Then
    \begin{equation}\label{eqn:normality-expression}
        \lim_{n\to\infty}\frac{N(n,Z)}{n} = |Z|b^{-k}.
    \end{equation}
\end{defn}

\begin{theorem} \label{thm:normal}
(Borel, 1909 for base 2; Wirsing, 1953 for the general case)
    For any $b\geq2$, almost every $\lambda\in\mathbb R$ is normal base $b$. Consequently, almost every $\lambda \in \mathbb R$ is absolutely normal, that is, normal in every base.
\end{theorem}

We now state an important lemma with an elementary proof.

\begin{lemma}\label{lemma:summand-inequality}
    If $h = f\otimes g$, then $\bigoplus_{k=0}^n \alpha_k\otimes \beta_{n - k} = \gamma_n$.
\end{lemma}

\begin{proof} To elucidate this fact, all we need to do is rewrite the product $f\otimes g$:
\[
f\otimes g\ =\ \bigoplus_{i=0}^\infty \alpha_ix^i \bigoplus_{j=0}^\infty \beta_jx^j\ =\ \bigoplus_{n=0}^\infty \left(\bigoplus_{k=0}^n \alpha_k\otimes \beta_{n-k}\right)x^n\ =\  \bigoplus_{n=0}^\infty \gamma_nx^n.
\]
\end{proof}

\begin{lemma} \label{lem: t1} We have
    $m(T^b_1) = 0$.
\end{lemma}

\begin{proof}
    We show that no element of $T^b_1$ is normal, whence the result follows.  Specifically, we claim that the following sequence of digits can never occur in $\rho_b(h)$ for any $h = f\otimes g\in T^b_1$:
    \begin{align}\label{eqn:digit-string}
        \underbrace{00\dots0}_{\deg g+1}1 \underbrace{00\dots0}_{\deg g+1}.
    \end{align}
    Let $f_1 = \bigoplus_{k=0}^\infty \alpha_kx^k, g_1 = \bigoplus_{k=0}^{\deg g_1} \beta_kx^k, h_1 = \bigoplus_{k=0}^\infty \gamma_kx^k$. We can write
    \[
    h_1\ =\ g_1\otimes f_1\ =\ \bigoplus_{k=0}^{\deg g} \beta_kx^k\otimes f_1.
    \]
    If $\gamma_k = 1$, then by \Cref{lemma:summand-inequality} there exist $i, j$ such that $\alpha_i = \beta_j = 1$ and $i+j = k$. Since $g_1$ is not a monomial, there exists another index $j'\neq j$ such that $\beta_{j'} = 1$. Then by \Cref{lemma:summand-inequality}: $1\leq \gamma_{i+j'}$ and $\gamma_{i+j'}' = 1$. The gap between the two indices $i+j, i+j'$ is at most $\deg g_1$ (but either index can come first), thus $\rho_b(h_1)$ does not have a ``1'' without another ``1'' at most $\deg g$ indices away. Thus the string \Cref{eqn:digit-string} does not occur in $\rho_b(h_1)$.
\end{proof}

\begin{lemma} \label{lem: t2}
   We have $m(T^b_2) = 0$.
\end{lemma}

\begin{proof}
    We begin by defining a finite counterpart to $T^b_2$:
    \begin{equation*}
        T^b_2(n) \ :=\ \left\{\rho_b(h): h=f\otimes g:\frac{\abs{f_1(n)}+\abs{g_1(n)}}{n}<\frac{1}{5} \textrm{ and } \abs{f_1}=\infty=\abs{g_1}\right\}.
    \end{equation*}
    Notice that
    \begin{equation*}
        T^b_2 \subseteq \limsup (\{T^b_2(n)\})\ =\ \bigcap_{N\geq1}\bigcup_{n\geq N} T^b_2(n).
    \end{equation*}
    By the Borel-Cantelli Lemma, we know that if $$\sum_{n=1}^{\infty}m(T^b_2(n))<\infty,$$ then
    $$m\left(\limsup_{n \to \infty}(T^b_2(n))\right) = m(T^b_2) = 0.$$
    As such, it suffices to show that $\sum_{n=1}^{\infty}m(T^b_2(n))<\infty$.

    Fix an integer $k$ and consider all possible $f$ and $h$ such that $\abs{f_1(n)} + \abs{g_1(n)} = k$. There are $\binom{2n+2}{k}$ possibilities for $f_1(n)$  and $g_1(n)$: each has $n+1$ coefficients, and we distribute $k$ nonzero coefficients among them. Additionally, for a given choice of $f_1(n)$ and $g_1(n)$, there are $(b-1)^k$ polynomials $f(n)$ and $g(n)$ since each 1 coefficient of $f_1$ or $g_1$ can correspond to any value in $\{1, \dots, b-1\}$. Thus, for a given $k$, there are at most $(b-1)^k\binom{2n+2}{k}$ possibilities for $f(n) \otimes g(n)$. Therefore, $T^b_2(n)$ is a subset of a union of  at most $\sum_{0\leq k\leq\frac{n}{5}}(b-1)^k\binom{2n+2}{k}$ intervals, each of length $b^{-n}$.

    We then compute
    \begin{align*}
        m(T^b_2(n)) & \ \leq\ \frac{1}{b^n}\sum_{0\leq k\leq\frac{n}{5}}(b-1)^k\binom{2n+2}{k} \\ &\ \le \  \frac{n}{5b^n}(b-1)^{n/5}\binom{2n+2}{\floor{n/5}} \\
        &\ \le \  \frac{n}{b^n}(b-1)^{n/5}\binom{2n}{\floor{n/5}} \\
        &\ \le \  \frac{n}{b^n}(b-1)^{n/5}\left(\frac{2ne}{n/5}\right)^{n/5} \\
        &\ \le \  \frac{n}{b^n}(10e(b-1))^{n/5} \\
        &\ \le \  n\left(\frac{1.94(b-1)^{1/5}}{b}\right)^n.
    \end{align*}
    Notice that $\frac{1.94(b-1)^{1/5}}{b} < 1$ for $b \geq 2$. Hence, the sum $\sum_{n=1}^\infty m(T^b_2(n))$ converges, so $m(T^b_2) = 0$.

\end{proof}

\begin{lemma} \label{lem: t3}
    We have $m(T^b_3) = 0$.
\end{lemma}

\begin{proof}
As in the case of $T^b_1$, we will show that no element of $T^b_3$ is normal, from which the result will follow.

Without loss of generality, we know that $\liminf_{n \to \infty}\frac{\abs{f_1(n)}}{n} \geq \frac{1}{10}$. Let $k$ be a positive integer such that
\begin{equation*}
   \left(\frac{b-1}{b}\right)^k\ <\ \frac{1}{10}.
\end{equation*}
Pick a positive integer $r$ such that $|g_1(r-1)| = k$. This is equivalent to choosing $r$ such that $\rho_b(g_1(r-1))$ has exactly $k$ ones. Let $Z$ denote the set of degree $r-1$ polynomials in $\sigma\in \mathcal B_b[x]$ such that $\sigma_1 \oplus g_1 = \sigma_1$. In other words, $Z$ is the set of degree $r-1$ polynomials of $\sigma\in \mathcal B_b[x]$ such that $\beta_i\neq 0\implies \delta_i \neq 0$. We can compute $\abs{Z}$ using a counting argument: If $\beta_i \neq 0$, then $\delta_i \in \{1,\dots, b-1\}$, otherwise $\delta_i\in \{0, \dots, b-1\}$. As $|g_1| = k$ and $\sigma$ has $r$ coefficients, there are  $(b-1)^kb^{r-k}$ possible choices for $\sigma$.

If $\rho_b(h)$ is normal, we expect the digit strings in $\rho_b(Z)$ to occur at a frequency of $\frac{(b-1)^kb^{r-k}}{b^r} = \left(\frac{b-1}{b}\right)^k$ in $\rho_b(h)$. We show that they instead occur at a frequency of at least $\frac{1}{10}$, from which it follows that $\rho_b(h)$ is not normal.

Suppose $\alpha'_s = 1$. Then from \Cref{lemma:summand-inequality}, it follows that:
\[
\left(\gamma'_s x^s \oplus \cdots \oplus \gamma'_{s+r-1}x^{s+r-1}\right) \oplus \left(\alpha'_s x^s \otimes g_1(r-1)\right) = \left(\alpha'_s x^s \otimes g_1(r-1)\right) .
\]
Thus $\gamma_s \oplus \cdots \oplus \gamma_{s+r-1}x^{r-1} \in Z$. This observation allows us to lower-bound the frequency of these strings in $\rho_b(h)$:
\begin{align*}
   \frac{1}{10}\ \le \  \liminf_{n \to \infty} \left( \frac{|f_1(n)|}{n} \right) &\ \le \   \liminf_{n \to \infty} \left( \frac{N_{\rho(h)}(n+r-1, Z)}{n} \right) = \liminf_{n \to \infty} \left( \frac{N_{\rho(h)}(n, Z)}{n} \right).
\end{align*}
The above contradicts \Cref{eqn:normality-expression}, thus $h$ is not normal.
\end{proof}

We now prove \Cref{thm:gen-wirsing-measure}, from which \Cref{thm:gen-wirsing} is a corollary.
\begin{proof}
By construction, $\mathcal C^b = T^b_1\cup T^b_2\cup T^b_3$. As a consequence of \Cref{lem: t1}, \Cref{lem: t2}, and \Cref{lem: t3}, we have
\[ m(\mathcal C^b) \ \le \  m(T^b_1) + m(T^b_2) + m(T^b_3) = 0.\]

\end{proof}
\printbibliography
\end{document}

Combinatorics (math.CO); Number Theory (math.NT)