1 Introduction

For terminology and notation not defined here, we refer to [2]. Let \(G=(V,E)\) be a simple graph. An edge-coloring of \(G\) is a mapping \(C: E\rightarrow \mathbb N^{+}\), where \(\mathbb N^{+}\) is the set of positive integers. We call \(G^c\) an edge-colored graph (or briefly, a colored graph) if \(G\) is assigned an edge-coloring \(C\). Let \(v\) be a vertex of \(G^c\). The color degree of \(v\) in \(G^c\), denoted by \(d^{c}_{G}(v)\) (or briefly, \(d^{c}(v)\)), is the number of colors of the edges incident to \(v\). A color neighborhood set \(N^c (v)\) of \(v\) is a subset of \(N(v)\), the neighborhood of \(v\), such that the colors of edges between \(v\) and \(N^c (v)\) are pairwise distinct. Let \(H\) be a subgraph of \(G\), then \(C(H)=\{C(e):e\in E(H)\}\) is called the color set of \(H\).

A subgraph of a colored graph is called rainbow (sometimes called heterochromatic or colorful) if all edges of it have distinct colors. The existence of rainbow subgraphs has been studied for a long time. A problem of rainbow Hamilton cycles in colored complete graphs was mentioned by Erdös et al. [6], and later studied by Hahn and Thomassen [8], Frieze and Reed [7] and Albert et al. [1], respectively. Rainbow matchings were studied by Wang and Li [16], Lesaulnier et al. [11], and Kostochka and Yancey [10]. Chen and Li [4, 5] studied the existence of long rainbow paths. A recent article on strong rainbow connection can be found in [15]. For a survey on the study of rainbow subgraphs in colored graphs, we refer to [9].

In particular, rainbow short cycles have received much attention. Broersma et al. [3] studied the existence of rainbow \(C_3\)’s and \(C_4\)’s under color neighborhood union condition. Later, Li and Wang [14] obtained two results on the existence of rainbow \(C_3\)’s and \(C_4\)’s under colored degree condition.

Theorem 1

(Li and Wang [14]) Let \(G^c\) be a colored graph of order \(n\ge 3\). If \(d^{c}(v)\ge (4\sqrt{7}/7-1)n+3-4\sqrt{7}/7\) for each \(v\in V(G)\), then \(G^c\) has either a rainbow \(C_3\) or a rainbow \(C_4\).

Theorem 2

(Li and Wang [14]) Let \(G^c\) be a colored graph of order \(n\ge 3\). If \(d^{c}(v)\ge (\sqrt{7}+1)n/6\) for each \(v\in V(G)\), then \(G^c\) has a rainbow \(C_3\).

Li and Wang [14] conjectured that every colored graph \(G^c\) of order \(n\ge 3\) has a rainbow \(C_3\) if \(d^{c}(v)\ge (n+1)/2\) for each \(v\in V(G)\). This conjecture was proved by Li [13] and stronger results were proved by Li et al. [12] with different methods as follows.

Theorem 3

(Li [13]) Let \(G^c\) be a colored graph of order \(n\ge 3\). If \(d^{c}(v)\ge (n+1)/2\) for each \(v\in V(G)\), then \(G^c\) has a rainbow \(C_3\).

Theorem 4

(Li et al. [12]) Let \(G^c\) be a colored graph of order \(n\ge 3\). If \(\sum \limits _{v\in V(G)}d^c(v)\ge n(n+1)/2\), then \(G^c\) has a rainbow \(C_3\).

Theorem 5

(Li et al. [12]) Let \(G^c\) be a colored graph of order \(n\ge 3\). If \(d^{c}(v)\ge n/2\) for each \(v\in V(G)\), then \(G^c\) has a rainbow \(C_3\) or \(G\in \{K_{n/2,n/2}, K_4-e, K_4 \}\).

The existence of rainbow \(C_4\)’s in special colored graphs has also been studied. Wang et al. [17] obtained a result on the existence of rainbow \(C_4\)’s in triangle-free colored graphs. Recently, Li [13] got a result on the existence of rainbow \(C_4\)’s in balanced bipartite colored graphs.

Theorem 6

(Wang et al. [17]) Let \(G^c\) be a triangle-free colored graph of order \(n\ge 9\). If \(d^{c}(v)\ge (3-\sqrt{5})n/2+1\) for each \(v\in V(G)\), then \(G^c\) has a rainbow \(C_4\).

Theorem 7

(Li [13]) Let \(G^c\) be a balanced bipartite colored graph of order \(2n\) with bipartition \((A,B)\). If \(d^c(v)> 3n/5+1\) for each \(v\in A\cup B\), then \(G^c\) has a rainbow \(C_4\).

While in [13], Li made a tiny error in the proof of Theorem 7. Notice that \(K_{3,3}\) is 3-edge-colorable, and a proper 3-edge-coloring of \(K_{3,3}\) satisfies the condition of Theorem 7, but it has no rainbow \(C_4\) since there are only 3 colors. We point out that, in order to correct it, the condition \(d^c(u)>3n/5+1\) should be changed into \(d^c(u)>(3n+8)/5\).

Now we turn to finite simple oriented graphs, i.e., finite graphs without multiple edges and loops in which each edge is replaced by exactly one arc. Let \(D[A,B]\) be an oriented bipartite graph with bipartition \((A,B)\). When there is no ambiguity, we use \(D\) instead of \(D[A,B]\). For \(A_1\subseteq A\) and \(B_1\subseteq B\), we denote by \(A_{D}(A_1,B_1)\) the set of arcs from \(A_1\) to \(B_1\) in \(D[A,B]\).

The study of rainbow cycles in colored graphs is largely related to the study of oriented cycles in digraphs. For a wonderful example, see the introduction of [13]. In particular, motivated by the study of short rainbow cycles in colored graphs, Li [13] proposed the following nice conjecture and proved for balanced oriented bipartite graphs.

Conjecture 1

(Li [13]) Let \(D\) be an oriented bipartite graph with bipartition \((A,B)\). If \(d^{+}(u)>|B|/3\) for each \(u\in A\) and \(d^{+}(v)>|A|/3\) for each \(v\in B\), then \(D\) has a directed \(C_4\).

Theorem 8

(Li [13]) Let \(D\) be a balanced oriented bipartite graph with bipartition \((A,B)\), where \(|A|=|B|=n\). If \(d^{+}(v)>n/3\) for each \(v\in A\cup B\), then \(D\) has a directed \(C_4\).

We state a construction from [17] to show that if Conjecture 1 holds, then it would be almost the best possible. Let \(m\) and \(n\) be two positive integers divisible by 3. Let \(|M_0|=|M_1|=|M_2|=m/3\) and \(|N_0|=|N_1|=|N_2|=n/3\). We construct an oriented bipartite graph with bipartition \((M, N)\), where \(M=M_0\cup M_1\cup M_2\) and \(N=N_0\cup N_1\cup N_2\), by creating all possible arcs from \(M_i\) to \(N_i\), and from \(N_i\) to \(M_{i+1}\), \(i=0,1,2\) (modulo 3). In the rest parts, we use \(D^*(m,n)\) to denote the construction above.

The first purpose of this paper is to confirm Conjecture 1. In fact, we prove a stronger result as follows.

Theorem 9

Let \(D\) be an oriented bipartite graph with bipartition \((A,B)\), where \(|A|=m\ge 2\) and \(|B|=n\ge 2\). If \(d^{+}(u)\ge n/3\) for each \(u\in A\) and \(d^{+}(v)\ge m/3\) for each \(v\in B\), then either \(D\) has a directed \(C_4\) or \(D=D^*(m,n)\).

By using Theorem 9, we can extend Theorem 7 as follows.

Theorem 10

Let \(G^c\) be a bipartite colored graph with bipartition \((A,B)\). If \(d^c(u)\ge (3|B|+8)/5\) for each \(u\in A\) and \(d^c(v)\ge (3|A|+8)/5\) for each \(v\in B\), then \(G^c\) has a rainbow \(C_4\).

2 Proofs

2.1 Proof of Theorem 9

Let \(\mathcal {D}(m,n)\) be the family of digraphs consisting of those oriented bipartite graphs with bipartition \((A,B)\) which satisfy the condition of Theorem 9, where \(m=|A|\) and \(n=|B|\).

First, we claim that it is sufficient to prove for those \(m\) and \(n\) which are both multiples of 3. Suppose Theorem 9 holds for \(\mathcal {D}(m,n)\) with \(m\equiv n\equiv 0~(\mathrm{mod}~3)\). For any \(D\in \mathcal {D}(m',n')\), where \(m'\) and \(n'\) are not both multiples of 3, let \(s_1=3\lceil \frac{m'}{3}\rceil -m'\), \(A^{*}=\{u_1,\ldots ,u_{s_1}\}\), and \(A'=A\cup A^{*}\). Let \(s_2=3\lceil \frac{n'}{3}\rceil -n'\), \(B^{*}=\{v_1,\ldots ,v_{s_2}\}\) and \(B'=B\cup B^{*}\). Now we construct a new oriented bipartite graph \(D'\) with bipartition \((A',B')\), where \(A(D')=A(D)\cup \{u'v,v'u: u\in A,u'\in A^{*},v\in B, v'\in B^{*}\}\). Notice that \(d^{+}_{D'}(u)\ge \lceil \frac{|B|}{3}\rceil =\frac{|B'|}{3}\) for each \(u\in A\) and \(d^{+}_{D'}(u')=n'>\frac{|B'|}{3}\) for each \(u'\in A^{*}\). Similarly, \(d^{+}_{D'}(v)\ge \lceil \frac{|A|}{3}\rceil =\frac{|A'|}{3}\) for each \(v\in B\) and \(d^{+}_{D'}(v')=m'>\frac{|A'|}{3}\) for each \(v'\in B^{*}\). It follows that \(D'\in \mathcal {D}(3\lceil \frac{m'}{3}\rceil , 3\lceil \frac{n'}{3}\rceil )\). Hence \(D'\) has a directed \(C_4\) or \(D'=D^*(3\lceil \frac{m'}{3}\rceil , 3\lceil \frac{n'}{3}\rceil )\). Since \(A^{*}\) and \(B^{*}\) are not both empty sets and the vertices in \(A^{*}\) and \(B^{*}\) only have outdegrees, \(D'\ne D^*(3\lceil \frac{m'}{3}\rceil , 3\lceil \frac{n'}{3}\rceil )\), and moreover, the directed \(C_4\) in \(D'\) is also in \(D\). The proof of our claim is complete.

Now assume \(D\in \mathcal {D}(m, n)\), where \(m=3m_1\), \(n=3n_1\), and \(m_1,n_1\) are two positive integers. Let \(D_1\) be a spanning subdigraph of \(D\) satisfying \(d_{D_1}^{+}(u)=n_1\) for each \(u\in A\) and \(d_{D_1}^{+}(v)=m_1\) for each \(v\in B\). Suppose \(D\) has no directed \(C_4\), obviously, \(D_1\) also has no directed \(C_4\). Let \(u_0\) be a vertex with maximum indegree \(k_1\) among \(A\), and \(v_0\) be a vertex with maximum indegree \(k_2\) among \(B\). Let \(B_1=N_{D_1}^{-}(u_0)\), \(B_2=N_{D_1}^{+}(u_0)\), \(A_3=N_{D_1}^{+}(B_2)\), and \(B_3=N_{D_1}^{+}(A_3)-B_2\), where \(|B_1|=k_1\), \(|B_2|=n_1\). Since \(D_1\) has no directed \(C_4\), we have \(N_{D_1}^{+}(A_3)\cap B_1=\emptyset \). Since \(k_2\) is the maximum indegree of all vertices in \(B\), we get

$$\begin{aligned} |B_3|k_2\ge |N_{D_1}^{-}(B_3)|=|A_{D_1}(A_3,B_3)|. \end{aligned}$$
(1)

Since \(D_1\) has no directed \(C_4\), there is no arc from \(A_3\) to \(B_1\), which implies all arcs starting from \(A_3\) have heads in \(B_2\cup B_3\). Hence \(|A_{D_1}(A_3,B_3)|=|A_3|n_1-|A_{D_1}(A_3,B_2)|\). Since

$$\begin{aligned} |A_{D_1}(A_3,B_2)|\le |A_3||B_2|-|A_{D_1}(B_2,A_3)|, \end{aligned}$$
(2)

we obtain

$$\begin{aligned} |A_{D_1}(A_3,B_3)|\ge |A_3|n_1-(|A_3||B_2|-|A_{D_1}(B_2,A_3)|) =|A_{D_1}(B_2,A_3)|=m_1n_1. \end{aligned}$$
(3)

Together with (1) and (3), we obtain \(|B_3|\ge \frac{m_1n_1}{k_2}\). Therefore,

$$\begin{aligned} 3n_1=|B|\ge |B_1|+|B_2|+|B_3|\ge k_1+n_1+\frac{m_1n_1}{k_2}\ge 3\root 3 \of {\frac{k_1m_1n_1^2}{k_2}}. \end{aligned}$$
(4)

It follows that \(k_2n_1\ge k_1m_1\). By symmetry, we also have \(k_1m_1\ge k_2n_1\). Thus, \(k_1m_1=k_2n_1\) and all the inequalities (1)–(4) are actually equalities. These facts imply \(|B_1|=|B_2|=|B_3|=n_1=k_1\), \(m_1=k_2\), \(|A_{D_1}(B_2,A_3)|=|A_{D_1}(A_3,B_3)|=m_1n_1\), and all vertices in \(A\) have indegree \(n_1\) in \(D_1\), all vertices in \(B\) have indegree \(m_1\) in \(D_1\).

Next we show \(|A_3|=m_1\). First, choose a vertex \(v'\in B_2\), \(d^+(v')=m_1\), so \(|A_3|\ge m_1\) by the definition of \(A_3\). Assume that \(|A_3|>m_1\). Since the inequality (2) becomes equality, the underlying graph of \(D_1[A_3,B_2]\) is a complete bipartite graph. Hence there exists a vertex, say \(u'\in A_3\), such that \(u'v'\in D_1\). Since \(u'\in A_3\), there exist a vertex \(v''\in B_2\), such that \(v''u'\in D_1\) by the choice of \(A_3\). Note that \(d^+_{D[B_2,A_3]}(v')=d^+_{D[B_2,A_3]}(v'')=m_1\) and \(u'\notin N^+(v')\). It follows that there exists a vertex, say \(u''\in A_3\), such that \(v'u''\in D_1\) and \(v''u''\notin D_1\). Since the underlying graph of \(D_1[B_2,A_3]\) is a complete bipartite graph, \(u''v''\in D_1\). Now \(C=u'v'u''v''u'\) is a directed \(C_4\) in \(D_1\), a contradiction. Hence \(|A_3|=m_1\).

Now let \(A_1=N_{D_1}^{+}(B_3)\) and \(A_2=N_{D_1}^{-}(B_2)\). Note that \(|\{vu: v\in B_2, u\in A_3\}|=m_1n_1=|A_{D_1}(B_2,A_3)|\). It follows that \(A_{D_1}(B_2, A_3)=\{vu: v\in B_2, u\in A_3\}\). Similarly, \(A_{D_1}(A_3, B_3)=\{uv: u\in A_3, v\in B_3\}\). So there is no arc with tail in \(A_3\) and head in \(B_2\), or arc with tail in \(B_3\) and head in \(A_3\), follows \(A_1\cap A_3=A_2\cap A_3=\emptyset \). Since \(D_1\) has no directed \(C_4\), \(A_1\cap A_2=\emptyset \).

Since \(d_{D_1}^+(u)=d_{D_1}^-(u)=n_1\) for each \(u\in A\) and \(d_{D_1}^+(v)=d_{D_1}^-(v)=m_1\) for each \(v\in B\), we obtain \(|A_1|\ge m_1\) by its definition, and \(n_1|A_2|\ge |A_{D_1}(A_2, B_2)|=\sum _{v\in B_2} d_{D_1}^- (v)=m_1n_1\), follows that \(|A_2|\ge m_1\). Since \(|A_1|+|A_2|+|A_3|=3m_1\) and \(A_1, A_2, A_3\) are pairwise disjoint, \(|A_1|=|A_2|=|A_3|=m_1\). Now apparently, \(A_{D_1}(A_2,B_2)=\{uv:u\in A_2,v\in B_2\}\) and \(A_{D_1}(B_3,A_1)=\{vu:v\in B_3,u\in A_1\}\). Since \(A_1\) and \(A_2\) are disjoint, \(A_{D_1}(A_1,B_2)=\emptyset \). Furthermore, \(A_{D_1}(A_1,B_3)=\emptyset \), hence \(N^+(A_1)\subset B_1\). \(\sum _{v\in A_1}d^+(v)=m_1n_1\) implies \(A_{D_1}(A_1,B_1)=\{uv:u\in A_1,v\in B_1\}\). Similarly, \(A_{D_1}(B_1,A_2)= \{vu: v\in B_1,u\in A_2\}\). Therefore \(D_1=D^{*}(m,n)\). If there is any arc in \(D\) but not in \(D_1\), then obviously, there would be a directed \(C_4\) in \(D\), a contradiction. Thus, \(D=D_1=D^{*}(m,n)\).

The proof is complete. \(\square \)

2.2 Proof of Theorem 10

First note that the color degree condition implies that \(|A|\ge 4\) and \(|B|\ge 4\).

Suppose not. Let \(G^c\) be a colored graph which satisfies the condition of Theorem 10 but has no rainbow \(C_4\). Set \(|A|=n_1\) and \(|B|=n_2\).

Choose an edge \(e=xy\in E(G^c)\) such that \(C(xy)=c_0\). Let \(N^c(x)=\{y,y_1,y_2,\ldots ,y_{r-1}\}\) and \(N^c(y)=\{x,x_1,x_2,\ldots ,x_{s-1}\}\). Since \(d^c(x)\ge \frac{3n_2+8}{5}\) and \(d^c(y)\ge \frac{3n_1+8}{5}\), we can set \(r=\lceil \frac{3n_2+8}{5}\rceil \) and \(s=\lceil \frac{3n_1+8}{5}\rceil \). Let \(A_1=\{x_1,x_2,\ldots ,x_{s-1}\}\) and \(B_1=\{y_1,y_2,\ldots ,y_{r-1}\}\). Note that \(G^c[A_1,B_1]\) is also a bipartite colored graph.

The following claim can be deduced immediately from the definition of color neighborhood set and the assumption that \(G^c\) has no rainbow \(C_4\).

Claim 1

For any edge \(x_iy_j\) and \(C(xy_j)\ne C(yx_i)\), where \(1\le i\le s-1\) and \(1\le j\le r-1\), we have \(C(x_iy_j)\in \{C(xy),C(xy_j),C(yx_i)\}\).

Now we construct an oriented bipartite graph \(D=D[A_1,B_1]\) as follows. For any edge \(x_iy_j\in E(G[A_1,B_1])\), such that \(C(x_iy_j)\ne C(xy)\) and \(C(xy_j)\ne C(yx_i)\), then \(C(x_iy_j)=C(xy_j)\) or \(C(x_iy_j)=C(yx_i)\) by Claim 1. If \(C(x_iy_j)=C(xy_j)\), we define an arc \(x_i y_j\) in \(D\), and if \(C(x_iy_j)= C(yx_i)\), we define an arc \(y_j x_i\) in \(D\). Let \(G'=G[D]\) be the underlying graph of \(D\).

In the following, for convenience, when we mention the color of an arc in \(D\), we mean the color of the corresponding edge in \(E(G')\).

Claim 2

There is no directed \(C_4\) in \(D\).

Proof

Suppose \(Q=x_iy_jx_py_qx_i\) is a directed \(C_4\) in \(D\). By the definition of \(D\), we have \(C(x_iy_j)=C(xy_j)\), \(C(y_jx_p)=C(yx_p)\), \(C(x_py_q)=C(xy_q)\), and \(C(y_qx_i)=C(yx_i)\). The existence of arcs \(x_iy_j\) and \(y_jx_p\) implies \(C(xy_j)\ne C(yx_i)\) and \(C(xy_j)\ne C(yx_p)\), hence \(C(x_iy_j)\ne C(y_qx_i)\) and \(C(x_iy_j)\ne C(y_jx_p)\). We have \(C(xy_j)\ne C(xy_q)\) from the definition of \(B_1\), hence \(C(x_iy_j)\ne C(x_py_q)\). So \(C(x_iy_j)\) is different from the colors of all other three edges in the cycle \(Q\) in \(G^c\). Similarly, we can prove that all edges in \(Q\) receive distinct colors in \(G^c\), and therefore, \(Q\) is a rainbow \(C_4\) in \(G^c\), a contradiction. \(\square \)

Claim 3

\(D\ne D^*(|A_1|,|B_1|)\).

Proof

Assume that \(D=D^*(|A_1|,|B_1|)\). Without loss of generality, set \(A_1=X_1\cup X_2\cup X_3\) and \(B_1=Y_1\cup Y_2\cup Y_3\), where \(|X_1|=|X_2|=|X_3|\) and \(|Y_1|=|Y_2|=|Y_3|\). Since \(s-1\equiv 0~(\mathrm{mod}~3)\) and \(r-1\equiv 0~(\mathrm{mod}~3)\), we have \(\lceil \frac{3n_i+3}{5}\rceil \equiv 0~(\mathrm{mod}~3)\), \(i=1, 2\). It follows that \(n_i\equiv 3\ \text {or} \ 4~(\mathrm{mod}~5)\), \(i=1, 2\).

First, we claim that \(D\ne D^*(3,3)\). Suppose not. Then \(\lceil \frac{3n_1+3}{5}\rceil =\lceil \frac{3n_2+3}{5}\rceil =3\). Hence \(n_1=n_2=4\). In this case, we may suppose that \(X_i=\{x_i\}\) and \(Y_i=\{y_i\}\) for \(i=1,2,3\). The existence of arc \(x_1y_1\) in \(D\) implies that \(C(x_1y_1)=C(xy_1)\). Hence \(d^c(y_1)\le 3< \frac{3|A|+8}{5}\), a contradiction.

Let \(v_0\) be an arbitrary vertex of \(D\). Without loss of generality, assume \(v_0\in Y_1\). If \(n_1=5k+\lambda \), \(\lambda =3\ \text {or}\ 4\), then \(|X_1|=|X_2|=|X_3|=k+1\). From the definition of \(D\), we know that each edge in \(\{uv_0:u\in X_1\}\) has the same color \(C(v_0x)\), and there are \(k+1\) different colors in \(\{v_0u: u\in X_2\}\). Since \(|A\backslash (A_1\cup \{x\})|=5k+\lambda -(3k+3)-1=2k+\lambda -4\), there are at most \(2k+\lambda -4\) different colors in the edge set \(\{v_0u:u\in A\backslash (A_1\cup \{x\})\}\). These facts mean that there are at most \(3k+\lambda -2\) different colors in the edge set \(\{v_0u:u\in A\backslash X_3\}\). Since \(d^c(v)\ge 3k+\lambda \), there exists an edge \(v_0u_0\in \{v_0u:u\in X_3\}\), such that \(v_0u_0\) has a new color and \(v_0u_0\) is not in \(E(G')\).

Next we show that any directed path of length 3 in \(D=D^*(|A_1|,|B_1|)\) is rainbow. Without loss of generality, we choose a directed path \(uv'u'v\), where \(u'\in X_1\), \(v\in Y_1\), \(u\in X_3\), and \(v'\in Y_3\). By the construction of \(D\), \(C(u'v)=C(xv)\), \(C(v'u')=C(yu')\), and \(C(uv')=C(xv')\). Since \(u'v\) exists in \(D\), \(C(xv)\ne C(yu')\). It follows that \(C(u'v)\ne C(v'u')\). Similarly, we have \(C(v'u')\ne C(uv')\). Since \(C(u'v)=C(xv)\) and \(C(uv')=C(xv')\) and \(C(xv)\ne C(xv')\) by the choice of \(N^c(x)\), we have \(C(u'v)\ne C(uv')\).

Now we fix a vertex \(v_0\in Y_1\). By the analysis above, there exists an edge \(v_0u_0\in \{v_0u\in E(G): u\in X_3\}\), which is not in \(E(G')\) and satisfies \(C(v_0u_0)\notin \{C(uv_0):u\in X_1\}\). Since \(D=D^*(|A_1|,|B_1|)\ne D^*(3,3)\), there are at least two arcs in \(A_D(Y_3,X_1)\) with distinct colors, and we can choose one of them, say \(v_0'u_0'\in A_D(Y_3,X_1)\), such that \(C(v_0'u_0')\ne C(v_0u_0)\). By the analysis before, there is an edge \(u_0v_0''\in E(G^c)\), where \(v_0''\in Y_1\), such that it is not in \(E(G')\) and satisfies \(C(u_0v_0'')\ne C(u_0v_0')\). Now we will show that \(v_0''=v_0\). First, the deletion of \(u_0v_0\) means \(C(u_0v_0)=C(xy)\) or \(C(xv_0)=C(yu_0)\). If \(C(u_0v_0)=C(xy)\), then the existence of arcs \(u_0'v_0\), \(u_0'v_0'\), and \(u_0v_0'\) in \(D\) implies \(C(xy)\ne C(u_0'v_0)\), \(C(xy)\ne C(u_0'v_0')\), and \(C(xy)\ne C(u_0v_0')\). Since colors of arcs in \(\{u_0'v_0,v_0'u_0',u_0v_0'\}\) are pairwise distinct, \(u_0'v_0'u_0v_0u_0'\) is a rainbow \(C_4\) in \(G^c\), a contradiction. Hence \(C(xv_0)=C(yu_0)\). Similarly, we may obtain \(C(xv_0'')=C(yu_0)\) from the deletion of \(u_0v_0''\) when constructing \(D\). It follows that \(C(xv_0)=C(xv_0'')\). Now we can get \(v_0=v_0''\) directly from the definition of \(N^c(x)\). From the analysis above, colors of arcs in \(\{u_0'v_0,v_0'u_0',u_0v_0'\}\) are pairwise distinct, and \(C(v_0u_0)\) is different from all of the three. Therefore, \(u_0'v_0u_0v_0'u_0'\) is also a rainbow \(C_4\) in \(G^c\), a contradiction.

\(\square \)

By Claims 2 and 3, \(D\) has no directed \(C_4\) and \(D\ne D^*(|A_1|,|B_1|)\). By Theorem 9, there exists a vertex, without loss of generality, say \(y_j\in B_1\), such that \(d^{+}_{D}(y_j)<\frac{|A_1|}{3}\). By the construction of \(D\), we know there are less than \(\frac{|A_1|}{3}+1\) different colors in \(C(E_{G'}(y_j, A_1))\). For any edge \(e\) adjacent to \(y_j\) which is in \(E(G[A_1, B_1])\backslash E(G')\), \(C(e)=C(xy)\) or there exists an edge \(yx_i\) such that \(C(yx_i)=C(xy_j)\) in \(G^c\), and in this case, \(e=x_iy_j\) and \(C(e)\) may be missed in \(C(E_{G'}(y_j, A_1))\). This implies that there are at most three colors in \(C(xy_j)\cup C(E_{G}(y_j, A_1))\backslash C(E_{G'}(y_j, A_1))\). However, \(C(xy_j)\) is also in \(C(E_{G'}(y_j,A_1))\). Hence there are less than \(\frac{|A_1|}{3}+3\) different colors in \(C(E_{G}(y_j,\{x\}\cup A_1))\). It follows that there are more than \(d^c(y_j)-3-\frac{|A_1|}{3}\ge s-3-\frac{s-1}{3}\) different colors in the color set \(\{y_jx':x'\in A\backslash (A_1\cup \{x\})\}\). Hence \(y_j\) has more than \(s-3-\frac{s-1}{3}\) different neighbors in \(A\backslash (A_1\cup \{x\})\). Now we have

$$\begin{aligned} n_1= & {} |A|\ge |A_1|+|\{x\}|+|N(y_j)\backslash (A_1\cup \{x\})|\\> & {} (s-1)+1+s-3-\frac{s-1}{3}=\frac{5s-8}{3}\ge n_1, \end{aligned}$$

a contradiction.

The proof is complete. \(\square \)