1 Introduction

A finite sequence \(R=r_1 r_2 \dots r_{2n}\) of symbols is called a repetition if \(r_i=r_{n+i}\) for all \(i\in \{1,2,\dots ,n\}\). A sequence \(S\) is called repetitive if it contains a subsequence of consecutive terms that is a repetition. Otherwise \(S\) is called nonrepetitive. Nonrepetitive sequences were first studied by Axel Thue in the beginning of the last century as a part of the investigation of word structures. In his famous paper from 1906 [16] he showed the existence of arbitrarily long nonrepetitive sequences consisting only of three different symbols. Later these sequences found widespread applications not only in mathematics, but also in informatics, data security management and others. Their first appearance in graph theory was in 1987 (see Currie [6]) but the investigation of nonrepetitive graph colourings began with the seminal paper of Alon et al. from 2002 [1].

Let \(\varphi \) be a colouring of the vertices of a graph \(G\). We say that \(\varphi \) is a nonrepetitive vertex-colouring of \(G\) if for any simple path on vertices \(v_1, v_2, \dots , v_{2n}\) in \(G\) the associated sequence of colours \(\varphi (v_1) \varphi (v_2) \dots \varphi (v_{2n})\) is not a repetition. The minimum number of colours in a nonrepetitive vertex-colouring of \(G\) is called the Thue chromatic number \(\pi (G)\). Analogously, nonrepetitive edge-colourings and the Thue chromatic index \(\pi '(G)\) are defined. The original paper [1] introduced both variants of colouring, however, it focused on the edge variant. It was proved there that for an arbitrary graph \(G\) it holds \(\pi '(G)\le (2\, {\cdot }\, e^{16}+1){ \Delta }^2\), where \({ \Delta }\) is the maximum degree of \(G\). Unhappily, the Thue chromatic index of \(G\) was in [1] called the Thue number of \(G\) and it was denoted by \(\pi (G)\). This was the cause of a lot of misunderstanding and misprints in several subsequent papers that gave more attention to the vertex-colouring variant for which the upper bound of the same form, \(C\, {\cdot }\,{ \Delta }^2\), is known. The constant \(C\) was improved several times and the best known bound today is due to Dujmović et al. [9] who showed that for large graphs \(C\) tends to \(1\). This bound is almost the best possible because it is known that there are infinitely many graphs with Thue chromatic number at least \(c\, {\cdot }{ \Delta }^2/\log \, { \Delta }\). There are some classes of graphs, where the Thue chromatic number is known exactly. In particular, the Thue chromatic number for paths was established by Thue himself [16], Currie in [7] showed that for every cycle of length \(n\in \{5, 7, 9, 10, 14, 17\},\, \pi (C_n)=4\) and for other lengths of cycles on at least three vertices \(\pi (C_n)=3\). In [11] various questions concerning nonrepetitive colourings of graphs have been formulated and as a result a lot of their variations appeared in the literature (see e.g. Barát and Czap [3], Czerwiński and Grytczuk [8], Grytczuk et al. [12, 13] or Schreyer and Škrabul’áková [15]).

The purpose of this paper is a first look at nonrepetitive total colourings of a graph. A (proper) total colouring of a graph is a colouring of its vertices and edges, where no two adjacent vertices or edges have the same colour and, moreover, no edge has the same colour as its incident vertices. We apply the concept of nonrepetitive colourings to total graph colourings in two different ways. If a colouring \(\varphi \) of vertices and edges of \(G\) has the property that the colour sequence of consecutive vertex- and edge-colours of every path in \(G\) is nonrepetitive, we call \(\varphi \) a weak total Thue colouring. If moreover, both the induced vertex- and edge colourings are nonrepetitive as well, we call \(\varphi \) a (strong) total Thue colouring of \(G\). The minimum number of colours appearing in such a colouring is called weak total Thue chromatic number \(\pi _\mathrm{T_w}(G)\) for the first case and total Thue chromatic number \(\pi _\mathrm{T}(G)\) for the latter case. Note that while every total Thue colouring is a proper total colouring, this does not need to be the case for weak total Thue colourings, because two adjacent vertices or edges may have the same colour.

In this paper we show that the total Thue chromatic number is less than \(15\, { \Delta }^{2}\), where \({ \Delta }\ge 3\) is the maximum degree of the graph. The bound is extended to \(18\, { \Delta }^2\) for the list version of the problem. For the weak total Thue chromatic number of \(G\) we show \(\pi _\mathrm{T_w}(G)\le |E(G)|-|V(G)|+5\), what for planar graphs with \(k\) faces gives \(\pi _\mathrm{T_w}(G)\le 3+k\). We also give some upper and lower bounds for these parameters considering special classes of graphs.

2 Basic observations and preliminary lemmas

Let \({\mathbb {A}}\) be some set. For a sequence of symbols \(S=a_1a_2\dots a_n,\, a_i\in {\mathbb {A}},\, 1\le k\le l\le n\), the block \(a_ka_{k+1}\dots a_{l}\) is denoted by \(S_{k,l}\).

Lemma 2.1

([14]) Let \(A=a_1 a_2 \dots a_m\) be a nonrepetitive sequence with \(a_i\in {\mathbb {A}},\, i\in \{1,2,\dots ,m\}\). Let \(B^i=b^i_1 b^i_2 \dots b^i_{m_i},\, 0\le i\le r+1\), be nonrepetitive sequences with \(b^{i}_j\in {\mathbb {B}},\, i\in \{0,1,\dots ,r+1\}\) and \(j\in \{1,2,\dots ,m_i\}\). If \({\mathbb {A}}\cap {\mathbb {B}}=\emptyset \), then

$$\begin{aligned} S=B^0A_{1,n_1}B^1A_{n_1+1,n_2}\dots B^rA_{n_r+1,m}B^{r+1} \end{aligned}$$

is a nonrepetitive sequence.

A sequence of length \(k\) consisting of \(k\) different symbols is called a rainbow sequence. A rainbow sequence is trivially nonrepetitive and if each sequence \(B^{i} \, 0\le i\le r+1\), from Lemma 2.1 consists of only one element \(b^{i}\), then it is also trivially nonrepetitive.

Corollary 2.2

Let \(A=a_1 a_2 \dots a_m\) be a rainbow sequence with \(a_i\in \mathbb {A}, i\in \{1,2,\dots ,m\}\). For \(i\in \{0,1,\dots ,r+1\}\) let \(b^i\notin \mathbb {A}\). Then

$$\begin{aligned}S=b^0 A_{1,n_1} b^1 A_{n_1+1,n_2}\dots b^r A_{n_r+1,m} b^{r+1} \end{aligned}$$

is a nonrepetitive sequence.

Moreover, it is easy to see that every nonrepetitive vertex-colouring of \(G\) with \(\pi (G)\) colours together with one additional colour (not used for the colouring of the vertices of \(G\)) used to colour all the edges of \(G\) gives a weak total Thue colouring of \(G\) according to Corollary 2.2. A similar argument holds for nonrepetitive edge-colourings of \(G\). Hence, \(\pi _\mathrm{T_w}(G)\le \pi (G)+1\) and \(\pi _\mathrm{T_w}(G)\le \pi '(G)+1\). Therefore, we have

Observation 2.3

\(\pi _\mathrm{T_w}(G)\le \min {\{\pi (G), \pi '(G)\}}+1\).

Moreover, the upper bound in Observation 2.3 is tight. To see this, it is enough to consider an arbitrary star \(K_{1,n}\) and its nonrepetitive colouring. Obviously, \(\pi (K_{1,n})=2\) and \(\pi '( K_{1,n})=n\). For \(n\ge 2\) we have

$$\begin{aligned} \pi _\mathrm{T_w}(K_{1,n})= \min {\bigl \{\pi ( K_{1,n}), \pi '(K_{1,n})\bigr \}}+1=3 \end{aligned}$$

(as there exists no nonrepetitive sequence of length \(4\) over a two symbol alphabet) and \(\pi _\mathrm{T_w}( K_{1,1})=2= \min {\bigl \{\pi ( K_{1,1}), \pi '( K_{1,1})\bigr \}}+1\).

As every total Thue colouring is also a weak total Thue colouring and in a total Thue colouring both, the edge-colouring and the vertex-colouring of the graph have to be nonrepetitive, we have

Observation 2.4

\(\pi _\mathrm{T_w}(G)\le \pi _\mathrm{T}(G), \, \pi (G)\le \pi _\mathrm{T}(G)\) and \(\pi '(G)\le \pi _\mathrm{T}(G)\).

On the other hand, if we colour all vertices of the graph \(G\) nonrepetitively with \(\pi (G)\) colours and use another \(\pi '(G)\) colours to colour all edges of \(G\) nonrepetitively, by Lemma 2.1 we obtain a total Thue colouring of \(G\). Hence, the following is true

Observation 2.5

\(\max {\{\pi '(G), \pi (G)\}}\le \pi _\mathrm{T}(G)\le \pi (G)+\pi '(G)\).

For \(n\ge 2\) we have \(\pi _\mathrm{T_w}( K_{1,n})=3\), but \(\max {\{\pi '(G), \pi (G)\}}=n\le \pi _\mathrm{T}(K_{1,n})\), which gives the next observation.

Observation 2.6

The difference between \(\pi _\mathrm{T_w}(G)\) and \(\pi _\mathrm{T}(G)\) can be arbitrarily large.

Weak total Thue colourings are closely related to nonrepetitive vertex-colourings of subdivided graphs as there is an easy 1–1 correspondence between weak total Thue colourings of a graph \(G\) and nonrepetitive vertex-colourings of the graph \(\widetilde{G}\) which is obtained from \(G\) by subdividing every edge. Hence, we have

Observation 2.7

If \(\widetilde{G}\) is the graph obtained from \(G\) by subdividing every edge by one vertex then \(\pi _\mathrm{T_w}(G)=\pi (\widetilde{G})\).

Together with Currie’s result on nonrepetitive colourings of cycles this immediately implies the following

Corollary 2.8

For the cycle \(C_n\) on \(n\) vertices it holds \(\pi _\mathrm{T_w}(C_n)=4\) if \(n=5\) or \(7\). Otherwise \(\pi _\mathrm{T_w}(C_n)=3\).

Observation 2.9

There exists a graph \(G\) with \(\pi _\mathrm{T}(G)=\pi _\mathrm{T_w}(G)=\pi (G)=\pi '(G)\).

From the above considerations it already follows that \(\pi (C_{5})=\pi '(C_{5})=\pi _\mathrm{T_w}(C_5)=4\). Fig. 1 shows, that four colours are also enough for a total Thue colouring of the cycle \(C_5\).

Fig. 1
figure 1

Strong total Thue colouring of \(C_5\)

3 Some general results

Theorem 3.1

Let \(G=G(V,E)\) be a graph with \(|V(G)|=n\) and \(|E(G)|=m\). Then \(\pi _\mathrm{T_w}(G)\le m - n+5\).

Proof

Consider a spanning tree \(T\) of \(G\). Clearly, \(\widetilde{T}\) remains a tree and, therefore, has a Thue chromatic number less or equal to \(4\) (see [5]). Hence (by Observation 2.7), there is a weak total Thue colouring of \(T\) using four colours. If the remaining \(m-n+1\) edges of \(G\) are coloured by different colours, all paths obviously remain nonrepetitive. Hence, \(\pi _\mathrm{T_w}(G)\le m-n+5\). \(\square \)

Corollary 3.2

Let \(G=G(V,E,F)\) be a plane graph with \(|F(G)|=k\). Then \(\pi _\mathrm{T_w}(G)\le 3 + k\).

Proof

By the Euler formula for every plane graph \(G=G(V,E,F)\) with \(|V(G)|=n, |E(G)|=m\), and \(|F(G)|=k\) it holds \(n+k=m+2\). Then from Theorem 3.1 it follows that \(\pi _\mathrm{T_w}(G)\le 3 + k\).\(\square \)

Theorem 3.3

Let \(G\) be an outerplanar graph on \(n\) vertices. Then for \(n\in \{1,2,3\}\), \(\pi _\mathrm{T_w}(G)=n\); for \(n=4,\, \pi _\mathrm{T_w}(G)=n-1\); and for \(n>4, \, \pi _\mathrm{T_w}(G)\le \min \,\{13, n+1\}\).

Proof

Let \(G\) be an outerplanar graph on \(n\in \{1,2,3\}\) vertices. Obviously, \(\pi (K_1)=\pi _\mathrm{T_w}(K_1)=1\). As \(\pi (P_3)=2\) and \(\pi (C_6)=3\) (Currie’s theorem [7]) according to Observation 2.7 this gives \(\pi _\mathrm{T_w}(G)=n\) for \(n\in \{1,2,3\}\).

Fig. 2
figure 2

A weak total Thue colouring of a diamond graph

If \(G\) is an outerplanar graph on four vertices, then \(G\) is a spanning subgraph of a diamond graph depicted on Fig. 2 together with its weak total Thue colouring using three colours. Hence \(\pi _\mathrm{T_w}(G)\le 3\). On the other hand, every spanning tree of the diamond graph contains as a subgraph a path on two edges. Subdividing each edge of it by one vertex one can obtain a path \(P_4, \, \pi (P_4)=3\), and from Observation 2.7 it follows that the weak total Thue number of an outerplanar graph \(G\) on four vertices is at least \(3\). Hence \(\pi _\mathrm{T_w}(G)=n-1\) for \(n=4\).

The general result \(\pi _\mathrm{T_w}(G)\le \min \{13,n+1\}\) follows from Corollary 2.2, Observation 2.3 and the fact, that every outerplanar graph admits a nonrepetitive vertex-colouring with \(12\) colours (Barát and Varjú [4]).\(\square \)

Theorem 3.4

Let \(G\) be a graph containing \(b\) bridges \(e_1,e_2,\dots ,e_b\) the removal of which separates \(G\) into \(b+1\) two-edge-connected components \(B_1, B_2,\dots ,B_{b+1}\). Then \(\pi _\mathrm{T_w}(G)\le 4\, { \Delta }(T)-4+\max \limits _i\, \bigl \{\pi _\mathrm{T_{w}}(B_i)\bigr \}\).

Proof

For the given bound we shall define a suitable colouring algorithm.

Colouring algorithm:

  1. 1.

    Denote by \(T\) the tree obtained from \(G\) by contracting the components \(B_1,\dots ,B_{b+1}\) into single vertices.

  2. 2.

    Colour the edges of \(T\) (i.e. \(e_1,\dots ,e_b\)) nonrepetitively. According to the theorem proved in [1] at most \(4 \,{\Delta }(T)-4\) colours are needed.

  3. 3.

    To obtain the weak total Thue colouring of \(G\) find a weak total Thue colouring of each component \(B_i\) (with colours different from the colours used to colour the edges of \(T\)).

As there is no repetitive path in each block \(B_i\), by Lemma 2.1 the colouring obtained by the algorithm described above gives a weak total Thue colouring of \(G\) with the claimed number of colours. \(\square \)

From Thue’s theorem and Observation 2.7 it is obvious that the weak total Thue chromatic number of paths on at least three vertices is \(3\). From Lemma 2.1 it can be seen, that a total Thue colouring of every path with six colours can be constructed by combining a nonrepetitive vertex-colouring on three colours and a nonrepetitive edge-colouring on another three colours. The following theorem improves this bound.

Theorem 3.5

For every path \(P\) on at least four vertices it holds \(4\le \pi _\mathrm{T}(P)\le 5\).

Proof

To see the lower bound, assume there is a total Thue colouring of \(P\) using only three colours \(1, 2, 3\). Consider the colour sequence of the first three vertices and edges. As such a colouring is also a proper total colouring, every colour in the sequence must differ from the two preceding colours. Then up to renaming of the colours the sequence has to be \(123123\) which is repetitive, a contradiction.

For the upper bound we construct a colouring using five colours. Let \(P=v_0,e_1,v_1,\dots ,e_n,v_n\) be a path of length \(n\ge 4\). W.l.o.g. we can suppose that \(n\) is divisible by \(4\), as every other path is subgraph of such a path.

Colouring algorithm:

  1. 1.

    For all \(m\) divisible by \(4\), colour the vertex \(v_m\) with colour \(4\).

  2. 2.

    Let \(s_0,s_1,s_2,\dots ,s_{n-1}\) be a nonrepetitive sequence on \(\{1,2,3\}\). Then for each \(0\le i<n\) colour the vertex \(v_{4i+s_i}\) with colour \(5\). That means between any two vertices of colour \(4\) there is a vertex of colour \(5\) and the sequence of distances between the colour \(5\) vertices to the preceding colour \(4\) vertices is nonrepetitive.

  3. 3.

    Whenever there are two uncoloured vertices between a vertex of colour \(4\) and \(5\), colour the edge connecting them with colour \(5\).

  4. 4.

    Colour all uncoloured edges using a nonrepetitive sequence on \(\{1,2,3\}\).

  5. 5.

    For every vertex that is adjacent to a vertex of colour \(4\) and to a vertex of colour \(5\) use a colour from \(\{1,2,3\}\) different from the colours of the neighbouring edges.

  6. 6.

    For two adjacent uncoloured vertices in between two vertices of colour \(4\) consider the edge-colours that appear between the colour \(4\) vertices. If one colour from \(\{1,2,3\}\) is missing, colour the middle vertex with this colour and the other one with a colour from \(\{1,2,3\}\) that is different from this one and the colour of the neighboring edge of colour \(1, 2\) or \(3\). If all colours of edges appear, the sequence of vertex- and edge-colours between the two vertices of colour \(4\) has to be \(a5bx5yc\), where \(a,b,c\) are different edge-colours from \(\{1,2,3\}\) and \(x\) and \(y\) are the vertex-colours to be chosen. Choose \(x=c\) and \(y=a\).

From Lemma 2.1 it immediately follows, that there is no repetitive sequence of edge-colours.

Assume there is a repetitive sequence of vertex-colours and it contains at least one vertex of colour \(4\). Then it contains an even number of vertices of colour \(4\) and exactly as many vertices of colour \(5\). If the first vertex of colour \(4\) or \(5\) has colour \(4\), then the sequence of distances from the vertices of colour \(5\) to the preceding vertex of colour \(4\) is repetitive, a contradiction. In case the first vertex of colour \(4\) or \(5\) has colour \(5\), then the sequence of distances of the vertices of colour \(5\) to the next vertex of colour \(4\) must be repetitive. This is a contradiction because if the sequence \(\{s_i\}_{i=0}^{n-1}\) is nonrepetitive then the sequence \(\{4-s_i\}_{i=0}^{n-1}\) is nonrepetitive as well. Hence, no repetitive sequence of vertex-colours can contain a vertex of colour \(4\). That means, a repetition of vertex-colours can contain only two elements and adjacent vertices are coloured differently by construction.

Now assume that there is a colour sequence of consecutive vertex- and edge-colours. If it contains colour \(4\), then this is a vertex-colour that can only be repeated by another vertex-colour. If this is the case, vertex-colours are repeated by vertex-colours and edge-colours by edge-colours. Hence, the subsequences of vertex- and edge-colours must be repetitive themselves. This is not possible as every sequence of consecutive edge-colours is nonrepetitive. Therefore, a repetition can contain at most three vertex-colours. All vertices are coloured differently from their edge neighbours, and the repetition cannot consist of two vertex- and two edge-colours because otherwise two adjacent edges would have the same colour. The only remaining possibility is a sequence of three consecutive edge- and three consecutive vertex-colours, none of which is colour \(4\). Now it is easy to see, that these repetitions are excluded by construction steps 5. and 6. Consequently, no repetition of any kind occurs and the constructed colouring is a total Thue colouring. \(\square \)

In general we conjecture the following

Conjecture 3.6

There is an integer \(n\) such that for every path \(P\) on at least \(n\) vertices \(\pi _\mathrm{T}(P)=5\).

An immediate consequence for cycles is the following

Corollary 3.7

For every cycle \(C\) on at least four vertices it holds \(4\le \pi _\mathrm{T}(C)\le 6\).

This can be achieved by choosing one edge of a unique colour and colour the remaining path as before. But in many cases, at least if the number of vertices is large enough and divisible by \(4\), the colouring strategy from the previous theorem can be applied directly to generate a colouring with five colours.

The following theorem gives the exact values of the total Thue numbers of stars.

Theorem 3.8

Let \(S_n=K_{1,n}\) be a star on \(n+1\ge 4\) vertices. Then \(\pi _\mathrm{T}(S_n)=n+1\).

Proof

All edges of \(S_n\) are adjacent to each other, and, therefore, they have to be coloured with different colours in every strong total Thue colouring \(\varphi \) of \(S_n\). They are incident with the central vertex \(v\) of the star as well, therefore, \(v\) has to be coloured with a new colour under \(\varphi \). Hence, \(\pi _\mathrm{T}(S_n)\ge n+1\). In order to obtain a strong total Thue colouring of the star \(S_n\) colour the uncoloured vertices \(w_1, w_2,\dots , w_n\) as follows: let \(\varphi (w_n)=\varphi (w_1 v)\) and for \(i\in \{1,2,\dots , n-1\}\) let \(\varphi (w_i)=\varphi (w_{i+1} v)\).

All vertices of \(S_n\) are coloured with different colours and all paths on vertices and edges of \(S_n\) are coloured with a colour sequence of the form \(abcdb\) or \(abcde\), therefore, \(\varphi \) is a strong total Thue colouring using \(n+1\) colours. \(\square \)

4 Bounds depending on the maximum degree

Theorem 4.1

Let \(G\) be a graph with maximum degree \({ \Delta }\ge 3\). Then \(\pi _\mathrm{T}(G) < 15\, { \Delta }^2\).

Proof

Let \(G\) be a graph of maximum degree \({ \Delta }\ge 3\). Dujmović et al. [9] proved that \(\pi (G)<3\, { \Delta }^2\). By considering the line graph \(H\) of \(G\) (which has the maximum degree less than \(2\, { \Delta }\)) this implies for the edge version of the problem \(\pi '(G)\le \pi (H)<12\, { \Delta }^2\). So, by Observation 2.5, \(\pi _\mathrm{T}(G)<15 \, { \Delta }^2\). \(\square \)

Note, that the upper bound \(3\, { \Delta }^2\) on the Thue chromatic number used in the proof can be improved for larger \({ \Delta }\). The actual bound given in [9] is \({\Delta }^2+o({\Delta }^2)\), which with the same arguments as above implies \(\pi _\mathrm{T}(G)<5\,{ \Delta }^2+o({ \Delta }^2)\).

Our last result is an extension of the above result to list colourings. The graph \(G\) is nonrepetitively total l-choosable if for every list assignment \(L:(V\cup E) \rightarrow 2^{\mathbb {N}}\) with minimum list size at least \(l\) there exists a total Thue colouring \(\varphi _L\) with colours from the associated lists. The total Thue choice number of \(G\) is the minimum number \(l\) such that \(G\) is nonrepetitively total \(l\)-choosable. (One can similarly define the weak total Thue choice number of a graph). A bound on this parameter cannot be proved by considering vertex- and edge-colourings separately because it cannot be guaranteed that the used colour sets of both colourings will be distinct.

We will use a probabilistic approach to prove our result. In probability theory, if a large number of events are mutually independent and each has probability less than \(1\), then there is a positive probability that none of the events will occur. The Lovász Local lemma (see Erdős and Lovász [10]) allows one to relax the independence condition slightly: As long as the events are “mostly” independent from one another and are not individually too likely, then there is a positive probability that none of them occurs. There are several different versions of this lemma, see Alon and Spencer [2]. We will use the asymmetric one formulated below.

Lemma 4.2

Let \({\mathcal {A}}=\{A_1,A_2,\dots ,A_n\}\) be a finite set of events in the probability space \(\mathrm \Omega \). For \(A\in {\mathcal {A}}\) let \(\mathrm{\Gamma }(A)\) denote a subset of \({\mathcal {A}}\) such that \(A\) is independent from the collection of events \({\mathcal {A}}\, {\setminus }\, (\{A\}\cup \mathrm{\Gamma }(A))\). If there exists an assignment of reals \(x:{\mathcal {A}}\rightarrow (0;1)\) to the events such that for all \(A \in {\mathcal {A}}\) it holds \(\mathrm{Pr}\, (A) \le x(A) \prod _{B\in \mathrm{\Gamma }(A)} (1-x(B))\) then the probability of avoiding all events in \({\mathcal {A}}\) is positive, in particular, \(\mathrm{Pr}\, (\overline{A_1}, \overline{A_2}, \dots , \overline{A_n})\ge \prod _{A\in {\mathcal {A}}} (1-x(A))\).

Theorem 4.3

For every graph with maximum degree at most \({ \Delta }, \, { \Delta }\ge 3\), the total Thue choice number is at most \(17.9856\,{ \Delta }^2\).

Proof

Let \(G\) be a graph with maximum degree at most \({ \Delta }\), where every vertex and edge is endowed with a list of at least \(17.9856\, { \Delta }^2\) colours. To fulfill the conditions of Lovász Local lemma we suppose that the colour of each vertex and edge is chosen randomly, independently and equiprobably out of its list. We consider the following types of bad events that may happen when this procedure is applied:

  • For every path \(P_t\) on \(2t\) vertices let \(A_{P_t}\) denote the event that the colour sequence of the first \(t\) vertices is the same as the colour sequence of the last \(t\) vertices. For the probability of the event we have \(\mathrm{Pr}\, (A_{P_t})\le (1/17.9856\, { \Delta }^2)^t\). We assign the number \(x_{P_t}=1/(1+a^t)\) to the event \(A_{P_t}\), where \(a=7.5\, { \Delta }^2\).

  • For every path \(Q_t\) on \(2t\) edges let \(B_{Q_t}\) denote the event that the colour sequence of the first \(t\) edges is the same as the colour sequence of the last \(t\) edges. For the probability of the event we have \(\mathrm{Pr}\, (B_{Q_t})\le (1/17.9856\, { \Delta }^2)^t\). We assign the number \(y_{P_t}=1/(1+b^t)\) to the event \(B_{Q_t}\), where \(b=7.5\, { \Delta }^2\).

  • For every path \(R_t=(v_1,e_1,v_2,e_2,\dots ,v_t,e_t)\) on \(t\) vertices together with the internal \(t-1\) edges and one edge incident with the final vertex \(v_t\) let \(C_{R_t}\) denote the event that the colour sequence of the first \(t\) elements (vertices and edges) of \(R_t\) is the same as the colour sequence of the last half. For the probability of the event we have \(\mathrm{Pr}\, (C_{R_t})\le (1/17.9856\, { \Delta }^2)^t\).We assign the number \(z_{P_t}=1/(1+c^t)\) to the event \(C_{R_t}\), where \(c=10\, { \Delta }^2\).

For an arbitrary event \(A_{P_t}\) let \(A_s\) denote the set of paths on \(2s\) vertices sharing at least one vertex with \(P_t\) and \(C_s\) the set of paths \(R_s\) on \(s\) vertices and \(s\) edges sharing at least one vertex with \(P_t\). It it easy to see, that \(|A_s|\le 2{ \Delta }^{2s}\) and \(|C_s|\le 2{ \Delta }^s\le 2{ \Delta }^{2s}\!/3\), as \({ \Delta }\ge 3\). We will show that

$$\begin{aligned} \mathrm{Pr}(A_{P_t})\le x_{P_t}\cdot \prod \limits _{s=1}^\infty \,\prod \limits _{P_s\in A_s\setminus \{P_t\}}\!\!\!\!\!\!\!(1-x_{P_s})\!\prod \limits _{R_s\in C_s}\!(1-z_{R_t}). \end{aligned}$$
(1)

Consider the right hand side \(\mathrm{RHS}_1\) of inequality (1):

$$\begin{aligned} \mathrm{RHS}_1&= \frac{1}{1+a^t}\, {\cdot }\, \frac{1+a^t}{a^t}\, \prod \limits _{s=1}^\infty \,\prod \limits _{P_s\in A_s}\!\biggl (1-\frac{1}{1+a^s}\biggr )\!\prod \limits _{R_s\in C_s}\!\biggl (1-\frac{1}{1+c^s}\biggr )\\&\ge \frac{1}{a^t}\,\prod \limits _{s=1}^\infty \,\biggl (\frac{a^s}{1+a^s}\biggr )^{\!2ts\, { \Delta }^{\!2s}} \!\biggl (\frac{c^s}{1+c^s}\biggr )^{\!2ts\, { \Delta }^{2s}\!/3}\\&\ge \frac{1}{a^t}\,\prod \limits _{s=1}^\infty \, \bigl (e^{-1/a^s}\bigr )^{2ts\, { \Delta }^{2s}}\!\bigl (e^{-1/c^s}\bigr )^{2ts\, { \Delta }^{2s}\!/3}\!, \end{aligned}$$

since for all positive \(x\) it holds that \(x/(1+x)>e^{-1/x}\). Moreover,

$$\begin{aligned} \frac{1}{a^t}\,\prod \limits _{s=1}^\infty \bigl (e^{-1/a^s}\bigr )^{2ts\, { \Delta }^{2s}}&\!\! \bigl (e^{-1/c^s}\bigr )^{2ts\, { \Delta }^{2s}\!/3}\!= \frac{1}{a^t}\cdot \!\biggl (e^{-2\!\sum \limits _{s=1}^\infty \!\! s\cdot (\, { \Delta }^2\!/a)^s- (2/3)\!\sum \limits _{s=1}^\infty \!\! s\cdot (\, { \Delta }^2\!/c)^s}\biggr )^{\!t}\\&\!\!=\frac{1}{(7.5\, { \Delta }^2)^t}\cdot \biggl (e^{-2\!\sum \limits _{s=1}^\infty s\cdot (1/7.5)^s-(2/3)\!\sum \limits _{s=1}^\infty \!\! s\cdot (1/10)^s}\biggr )^{\!t}\\&\!\!=\frac{1}{(7.5\, { \Delta }^2)^t}\cdot \bigl (e^{-4490/10266.75}\bigr )^t \!, \end{aligned}$$

as \(\sum \limits _{s=1}^{\infty }{s\cdot x^{s}}=x/(x-1)^{2}\). Hence,

$$\begin{aligned} \mathrm{RHS}_1\ge \biggl (\frac{0.6457}{7.5\, { \Delta }^2}\biggr )^{\!t} > \biggl (\frac{1}{17.9856\, { \Delta }^2}\biggr )^t\!, \end{aligned}$$

what proves inequality (1).

For an arbitrary event \(B_{Q_t}\) let \(B_s\) denote the set of paths on \(2s\) edges sharing at least one edge with \(Q_t\) and \(C_s\) the set of paths \(R_s\) on \(s\) vertices and \(s\) edges sharing at least one edge with \(Q_t\). It is easy to see that \(|B_s|\le 4 ts { \Delta }^{2s}\) and \(|C_s|\le 4 ts { \Delta }^s\le 4 ts { \Delta }^{2s}\!/3\). Similarly as in the previous case we will show that

$$\begin{aligned} \mathrm{Pr}\, (B_{Q_t})\, \le \, y_{Q_t}\cdot \prod \limits _{s=1}^\infty \,\prod \limits _{Q_s\in B_s\setminus \{Q_t\}}\!\!\!\!\!\!\!(1-y_{Q_s})\!\prod \limits _{R_s\in C_s}\!(1-z_{R_t}). \end{aligned}$$
(2)

Consider the right hand side \(\mathrm{RHS}_2\) of inequality (2):

$$\begin{aligned} \mathrm{RHS}_2&=\frac{1}{1+b^t}\, {\cdot }\, \frac{1+b^t}{b^t} \,\prod \limits _{s=1}^\infty \,\prod \limits _{Q_s\in B_s}\!\biggl (1-\frac{1}{1+b^s}\biggr )\!\prod \limits _{R_s\in C_s}\!\biggl (1-\frac{1}{1+c^s}\biggr )\\&\ge \frac{1}{b^t}\,\prod \limits _{s=1}^\infty \,\biggl (\frac{b^s}{1+b^s}\biggr ) ^{\!4ts\, { \Delta }^{2s}} \!\biggl (\frac{c^s}{1+c^s}\biggr )^{\!4ts\, { \Delta }^{2s}\!/3}\\&\ge \frac{1}{b^t}\,\prod \limits _{s=1}^\infty \, \bigl (e^{-1/b^s}\bigr )^{4ts\, { \Delta }^{2s}}\bigl (e^{-1/c^s}\bigr )^{4ts\, { \Delta }^{2s}\!/3}\\&=\frac{1}{b^t}\cdot \biggl (e^{-4\!\sum \limits _{s=1}^\infty \!\! s\cdot (\, { \Delta }^2\!/b)^s- (4/3)\!\sum \limits _{s=1}^\infty \!\! s\cdot (\, { \Delta }^2\!/c)^s}\biggr )^{\!t}\\&=\frac{1}{(7.5\, { \Delta }^2)^t}\cdot \biggl (e^{-4\!\sum \limits _{s=1}^\infty \!\! s\cdot (1/7.5)^s-(4/3)\!\sum \limits _{s=1}^\infty \!\! s\cdot (1/10)^s}\biggr )^{\!t} \\&=\frac{1}{(7.5\, { \Delta }^2)^t}\cdot \bigl (e^{-8980/10266.75}\bigr )^t\!. \end{aligned}$$

Hence,

$$\begin{aligned} \mathrm{RHS}_2\ge \biggl (\frac{ 0.4170003}{7.5\, { \Delta }^2}\biggr )^{\!t} >\biggl (\frac{1}{17.9856\, { \Delta }^2}\biggr )^{\!t}\!, \end{aligned}$$

what proves inequality (2).

For an arbitrary event \(C_{R_t}\) let \(A_s\) denote the set of paths on \(2s\) vertices sharing at least one vertex with \(R_t, \, B_s\) denote the set of paths on \(2s\) edges sharing at least one edge with \(R_t\) and \(C_s\) the set of paths \(R_s\) on \(s\) vertices and \(s\) edges sharing at least one vertex with \(R_t\). It is easy to see that \(|A_s|\le ts\, { \Delta }^{2s}, \, |B_s|\le 2\, ts\, { \Delta }^{2s}\) and \(|C_s|\le ts\, { \Delta }^s\le ts\, { \Delta }^{2s}\!/3\). We will show that

$$\begin{aligned} \mathrm{Pr}\, (C_{R_t})\, \le \, z_{R_t}\cdot \prod \limits _{s=1}^\infty \,\prod \limits _{P_s\in A_s}\!(1-x_{P_s})\!\prod \limits _{Q_s\in B_s}\!(1-y_{Q_s})\!\prod \limits _{R_s\in C_s\setminus \{R_t\}}\!\!\!\!\!\!\!(1-z_{R_t}). \end{aligned}$$
(3)

Consider the right hand side \(\mathrm{RHS}_3\) of inequality (3):

$$\begin{aligned} \mathrm{RHS}_3&= \frac{1}{1+c^t}\, {\cdot }\, \frac{1+c^t}{c^t}\, \prod \limits _{s=1}^\infty \, \prod \limits _{P_s\in A_s}\!\biggl (1-\frac{1}{1+a^s}\biggr ) \prod \limits _{Q_s\in B_s}\!\biggl (1-\frac{1}{1+b^s}\biggr )\! \prod \limits _{R_s\in C_s}\!\biggl (1-\frac{1}{1+c^s}\biggr )\\&\ge \frac{1}{c^t}\,\prod \limits _{s=1}^\infty \,\biggl (\frac{a^s}{1+a^s}\biggr )^{\!ts\, { \Delta }^{2s}} \!\biggl (\frac{b^s}{1+b^s}\biggr )^{\!2ts\, { \Delta }^{2s}}\! \biggl (\frac{c^s}{1+c^s}\biggr )^{\!ts\, { \Delta }^{2s}\!/3}\\&\ge \frac{1}{c^t}\,\prod \limits _{s=1}^\infty \, \bigl (e^{-1/a^s}\bigr )^{ts\, { \Delta }^{2s}} \!\bigl (e^{-1/b^s}\bigr )^{2ts\, { \Delta }^{2s}}\! \bigl (e^{-1/c^s}\bigr )^{ts\, { \Delta }^{2s}\!/3}\\&=\frac{1}{c^t}\cdot \biggl (e^{-\sum \limits _{s=1}^\infty \!\! s\cdot (\, { \Delta }^2\!/a)^s- 2\!\sum \limits _{s=1}^\infty \!\! s\cdot (\, { \Delta }^2\!/b)^s- (1/3)\!\sum \limits _{s=1}^\infty \!\! s\cdot (\, { \Delta }^2\!/c)^s}\biggr )^{\!t}\\&=\frac{1}{(10\, { \Delta }^2)^t}\cdot \biggl (e^{-3\!\sum \limits _{s=1}^\infty \!\! s\cdot (1/7.5)^s-(1/3)\!\sum \limits _{s=1}^\infty \!\! s\cdot (1/10)^s}\biggr )^{\!t}\\ {}&=\frac{1}{(10\, { \Delta }^2)^{t}}\, {\cdot }\, \bigl ( e^{-8980/10266.75}\bigr )^{\!t}\!. \end{aligned}$$

Hence,

$$\begin{aligned} \mathrm{RHS}_3\ge \biggl (\frac{ 0.5634}{10\, { \Delta }^2}\biggr )^{\!t} > \biggl (\frac{1}{17.9856\, { \Delta }^2}\biggr )^{\!t}\!, \end{aligned}$$

what proves inequality (3).

Since inequalities (1), (2) and (3) are valid, by the Lovász Local lemma with positive probability none of the bad events happens. Hence, there is a total Thue colouring of the graph \(G\) from lists of size \(17.9856\,{ \Delta }^2\). \(\square \)