# Branching Densities of Cube-Free and Square-Free Words
## 3 Positions Fixed by Big Cubes  
The aim of this section is to prove the following upper bound on the density of positions fixed by big cubes in a cube-free word. Theorem 1: _For any integer \(h\geq 2\) and any infinite cube-free word \(\mathbf{w}\), the density of positions fixed by cubes with periods \(\geq h\) in \(\mathbf{w}\) is at most \(\frac{6}{5h}\)._  
Theorem 1 is based on the following result, describing the restrictions on the cubes of similar length fixing closely located letters. Theorem 2: _Suppose that \(t,l\geq 1\), \(p,q\geq 2\) are integers, \(w\) is a word of length \(t+l\) such that \(w[1..t+l-1]\) is cube-free, the position \(t\) is fixed by a \(p\)-cube, and \(w\) ends with a \(q\)-cube. Then \(q\) is outside the red zone in Figure 2._  
Remark 1: _Theorem 2 and Figure 2 improve and correct their earlier analogs, Theorem 7 and Figure 1 of [23]. The improvement can be seen as a few additional red patches in Figure 2 w.r.t. Figure 1: A fragment of the prefix tree of the binary cube-free language CF. Branching nodes and free edges are green, while fixed nodes and fixed edges are red. Nodes can be restored from the labels of paths. Figure 2: The restrictions on fixed positions in a cube-free word. If \(t\) is fixed by a \(p\)-cube and \((t+l)\) is fixed by a \(q\)-cube, then \(q\) (as a function of \(l\) with parameter \(p\)) must be outside the red polygon, including red border lines. The cases \(q>2p\) and \(q<p/2\) are not considered. to ([23] Figure 1), and the correction is that the triangle with vertices \((2p,p)\), \((4p,2p)\), and \((5p,2p)\) in ([23] Figure 1) should have been painted in green. This error does not affect the proofs of the main results of [23]: in those proofs, only a part of the red area is used. This part is drawn in ([23] Figure 8) and is strictly inside the red area in our Figure 2. Thus, in [23], only Theorem 7 and Remark 8 are (partially) incorrect._  
**Remark 2**. : _We believe that the boundary of the red area in Figure 2 is exact for \(p/2\leq q\leq 2p\), and so the result of Theorem 2 is optimal. We do not prove this claim, because it is not important for the aims of this paper. To substantiate the claim, we provide Table 1 with the examples of the words \(w\) corresponding to green points in the corners of the boundary in Figure 2._  
Proof of Theorem 2.: Let \(P=w[t-3p+1..t-2p]\), \(P^{\prime}=w[t-p+1..t]\). Then, \(w[t-3p+1..t]=PPP^{\prime}\). W.l.o.g. \(P\) ends with \(a\); so \(w[t-2p]=w[t-p]=a,w[t]=P^{\prime}[p]=b\). We write \(QQQ\) for the \(q\)-cube, which is a suffix of \(w\). We begin with a few observations. **O1**. If \(q=p/2\), the condition \(w[t-p]\
eq w[t]\) implies that the suffix \(QQQ\) of \(w\) does not contain \(w[t-p]\). Hence, \(l\geq 3q-p=p/2\), giving us the red segment of the line \(q=p/2\) in Figure 2. To get the red parts of the lines \(q=p\) and \(q=2p\), note that for \(q=p\), the same argument gives \(l\geq 2p\), and for \(q=2p\), the condition \(w[t-2p]\
eq w[t]\) implies \(l\geq 4p\). From now on, we assume \(p/2<q<2p\) and \(q\
eq p\). **O2**. Let \(i\) be the bigger of the positions of \(PPP^{\prime}\) and \(QQQ\) in \(w\) and consider the factor \(w[i..t-1]\), having both periods \(p\) and \(q\). If its length \(t-i\) is big enough to apply Lemma 2, the words \(P,Q\) are integral powers of shorter words, contradicting the condition that \(w[1..t+l-1]\) is cube-free. Thus, Lemma 2 must be inapplicable, giving us \(t-i<p+q-\gcd(p,q)\leq 3p-2\) (recall that \(q<2p\)). Hence, the position of \(QQQ\) in \(w\) is bigger than the position of \(PPP^{\prime}\), implying \(QQQ=w[i..t+l]\), so that \(3q=t+l-i+1<l+1+p+q-\gcd(p,q)\). From this, \(l>2q-p\), meaning that all green points with \(q<2p\) are strictly below the line \(q=\frac{l+p}{2}\) shown in Figure 2.  
**O3**. If the factor \(w[i..t-1]\) considered in O2 is shorter than \(\max\{p,q\}\), then we are unable to restrict \(q\): the \(p\)-periodic factor \(PPP^{\prime}\) and the \(q\)-periodic suffix \(QQQ\) have too short an overlap to \"interact\" inside \(w\).