1 Introduction and main results

Our notations and terminology follow [2]. A symmetric graph (or more simply graph) is an ordered pair \(G:= (V, \mathcal E)\), where \(\mathcal E\) is a subset of \([V]^2\), the set of pairs \(\{x,y\}\) of distinct elements of V. Elements of V are the vertices of G and elements of \(\mathcal E\) its edges. If K is a subset of V, the restriction of G to K, also called the induced graph on K is the graph \(G_{\restriction K}:= (K, [K]^2\cap \mathcal E)\). The complement of G is the graph \(\overline{G}:= (V, [V]^2\setminus \mathcal E)\). We denote by V(G) the vertex set of a graph G, by E(G) its edge set and by \(e(G):=\vert E(G)\vert \) the number of edges. Let \(G:=(V,E)\) be a graph. A 3-element subset T of V such that all pairs belong to E(G) is a triangle of G. A 3-element subset of V which is a triangle of G or of \(\overline{G}\) is a 3-homogeneous subset of G. We denote by \(K_3\) the complete graph on 3 vertices and by \(K_{1,3}\) the graph made of a vertex linked to a \(\overline{K_{3}}\). The graph \(K_{1,3}\) is called a claw, the graph \(\overline{K_{1,3}}\) a co-claw. For these graphs, see Fig. 1.

Given two graphs \(G:=(V,E)\) and \(G':=(V',E')\). A bijection f from V onto \(V'\) is an isomorphism from G onto \(G'\) provided that for any \(x, y \in V\), \(\{x,y\}\in E\) if and only if \(\{f(x),f(y)\}\in E'\). The graphs G and \(G'\) are isomorphic, which is denoted by \(G \simeq G'\), if there exists an isomorphism from one onto the other, otherwise \(G \not \simeq G'\).

Let G, \(G'\) be two graphs on the same vertex set V. We say that G and \(G'\) are equal up to complementation if \(G'=G\) or \(G'=\overline{G}\). If \(G'\) has the same number of edges as G or \({\overline{G}}\), we say that G and \(G'\) have the same number of edges up to complementation. We say that G and \(G'\) are isomorphic up to complementation if \(G'\) is isomorphic to G or to \(\overline{G}\). Let k be a non-negative integer, G and \(G'\) are k-hypomorphic up to complementation if for every k-element subset K of V, the induced subgraphs \(G_{\restriction K}\) and \(G'_{\restriction K}\) are isomorphic up to complementation.

Ulam’s Reconstruction Conjecture [3, 12] asserts that two graphs G and \(G'\) on the same finite set V of v vertices, \(v \ge 3\), are isomorphic provided that the restrictions \(G_{\restriction K}\) and \(G'_{\restriction K}\) of G and \(G'\) to the \((v-1)\)-element subsets K of V are isomorphic. If this latter condition holds for the k-element subsets of V for some k, \(2 \le k \le v - 2\), then \(G'=G\). This conclusion does not require the isomorphy of \(G_{\restriction K}\) and \(G'_{\restriction K}\), but only requires that \(G_{\restriction K}\) and \(G'_{\restriction K}\) have the same number of edges for all k-element subsets K of V. In [4], a work has been done where the conditions are \(G'_{\restriction K}\) and \(G_{\restriction K}\) are isomorphic up to complementation for all k-element subsets K of V, or \(G'_{\restriction K}\) and \(G_{\restriction K}\) have the same number of edges up to complementation for all k-element subsets K of V. Let v be a non negative integer and \(\vartheta (v):= 4l\) if \(v\in \{ 4l+2, 4l+3\}\), \(\vartheta (v):=4l-3\) if \(v\in \{4l, 4l+1\}\). The following theorems was obtained in [4].

Fig. 1
figure 1

\(K_3\), \(K_{1,3}\), \(\overline{K_{1,3}}\), \(P_4\)

Theorem 1.1

[4] Let v, k be two integers with \(4\le k \le \vartheta (v)\). Then, for every pair of graphs G and \(G'\) on the same set V of v vertices, if \(G_{\restriction K}\) and \(G'_{\restriction K}\) have the same number of edges, up to complementation, and the same number of 3-homogeneous subsets, for all k-element subsets K of V, then \(G'= G\) or \(G'= \overline{G}\).

Theorem 1.2

[4] Let k be an integer, \(4\le k\le v-2\), \(k\equiv 0\) (mod 4). Let G and \(G'\) be two graphs on the same set V of v vertices.

We assume that \(e(G_{\restriction K})\) has the same parity as \(e(G'_{\restriction K})\) for all k-element subsets K of V.

Then \(G'=G\) or \(G'=\overline{G}\).

It is also shown in [4] that two graphs G and \(G'\) on the same set of v vertices are equal up to complementation whenever they are k-hypomorphic up to complementation and \(4\le k\le v-4\) (for the case \(k=v-3\), the conclusion obtained is \(G'\simeq G\) or \(G'\simeq \overline{G}\) [5]). Later, an extension of this result was obtained for uniform hypergraphs [9].

Theorem 1.3

[9] Let h be a non-negative integer. There are two non-negative integers k and t, \(k\le t\) such that two h-uniform hypergraphs \({\mathcal H}\) and \({\mathcal H}'\) on the same set V of vertices, \(\vert V\vert \ge t\), are equal up to complementation whenever \({\mathcal H}\) and \({\mathcal H}'\) are k-hypomorphic up to complementation.

In this paper, we look for similar results on graphs if the conditions on the restrictions \(G_{\restriction K}\) and \(G'_{\restriction K}\) are that they have the same numbers of 3-homogeneous subsets, the same numbers of \(P_4\)’s, and the same numbers of claws or co-claws, we obtain Theorem 1.4. Whenever the same numbers (cited above) are modulo a prime, we obtain Theorem 1.7. This last theorem is a consequence of Theorem 1.4 and Proposition 4.3 which is inspired by a result of Pouzet on monomorphic relations (Proposition 4.2).

Let \(G:=(V,E)\) be a graph. We set:

$$\begin{aligned}&H^{(3)}(G):=\{\{a,b,c\}\subset V : G_{\restriction \{a,b,c\}} \simeq K_3 \text{ or } {{G_{\restriction \{a,b,c\}}}} \simeq {\overline{K_3}} \}\\&P^{(4)}(G):=\{\{a,b,c,d\}\subset V : G_{\restriction \{a,b,c,d\}} \simeq P_4 \}\\&S^{(4)}(G):=\{\{a,b,c,d\}\subset V : G_{\restriction \{a,b,c,d\}} \simeq K_{1,3} \text{ or } G_{\restriction \{a,b,c,d\}} \simeq {\overline{ K_{1,3} }} \}\\&h^{(3)}(G):=\mid H^{(3)}(G)\mid , p^{(4)}(G):=\mid P^{(4)}(G)\mid , s^{(4)}(G):=\mid S^{(4)}(G)\mid . \end{aligned}$$

Our first result is:

Theorem 1.4

Let G, \(G'\) be two graphs on the same finite set V of \(v\ge 4\) vertices.

  1. (1)

    If \(H^{(3)}(G)=H^{(3)}(G')\), \(P^{(4)}(G)=P^{(4)}(G')\) and \(S^{(4)}(G)=S^{(4)}(G')\), then \(G'=G\) or \(G'=\overline{G}\).

  2. (2)

    Let k be a integer, \(4\le k\le v-4\).

    If \(h^{(3)}(G_{\restriction K})=h^{(3)}(G'_{\restriction K})\), \(p^{(4)}(G_{\restriction K})=p^{(4)}(G'_{\restriction K})\) and \(s^{(4)}(G_{\restriction K})=s^{(4)}(G'_{\restriction K})\) for all k-element subsets K of V, then \(G'=G\) or \(G'=\overline{G}\).

The proof of Theorem 1.4 will be given in Sect. 3. The following propositions show that Theorem 1.4 is optimal.

Proposition 1.5

For every integer \(v\ge 4\) and every integer k, \(4\le k\le v\), there are two graphs G and \(G'\) on the same set of v vertices, nonisomorphic up to complementation, satisfying \(p^{(4)}(G_{\restriction K})=p^{(4)}(G'_{\restriction K})\) and \(s^{(4)}(G_{\restriction K})=s^{(4)}(G'_{\restriction K})\) for all k-element subsets K of V.

Proof

Let \(V:=\{1,2,\ldots ,v\}\) with \(v\ge 4\). Let G and \(G'\) be two graphs on the same vertex set V defined by \(G_{\restriction \{2,3,\ldots ,v\}}\) and \(G'_{\restriction \{2,3,\ldots ,v\}}\) are complete graphs, \(\{1,x\}\in E(G)\) if \(x\ne 2\); \(\{1,x\}\in E(G')\) if \(x\notin \{2,3\}\). Clearly \(p^{(4)}(G_{\restriction K})=p^{(4)}(G'_{\restriction K})=0\) and \(s^{(4)}(G_{\restriction K})=s^{(4)}(G'_{\restriction K})=0\) for all k-element subsets K of V. But G and \(G'\) are not isomorphic up to complementation. \(\square \)

Proposition 1.6

For every integer \(n\ge 4\), there are two graphs G and \(G'\) on the same set of 2n vertices, nonisomorphic up to complementation, satisfying \(h^{(3)}(G)=h^{(3)}(G')\) and \(p^{(4)}(G)\ne p^{(4)}(G')\).

Proof

We set \(G:=M_{2n}\) and \(G':=M'_{2n}\) (For the definition of the graphs \(M_{2n}\) and \(M'_{2n}\), see Sect. 3, Fig. 3). Clearly, G and \(G'\) are not isomorphic up to complementation. We have \(h^{(3)}(G)=h^{(3)}(G')\), but \(p^{(4)}(G)\ne p^{(4)}(G')\) since \(p^{(4)}(G)=n(n-1)(n-2)\) and \(p^{(4)}(G')=(n-1)(n-2)^2+(n-1)^2\). \(\square \)

Let kp be positive integers, the decomposition of \(k=\sum _{i=0}^{k(p)} k_i p^i\) in the basis p is also denoted \([k_0,k_1,\ldots ,k_{k(p)}]_p\) where \(k_{k(p)}\ne 0\) if and only if \(k\ne 0\).

As an application of Theorem 1.4, our second result is:

Theorem 1.7

Let G, \(G'\) be two graphs on the same set V of v vertices. Let p be a prime number, \(p\ge 5\) and \(k=[k_0,k_1,\ldots ,k_{k(p)}]_p\) be an integer, \(4\le k\le v-4\); (\(k_0=0\) or \(k_0\ge 4\)).

If \(h^{(3)}(G_{\restriction K})\equiv h^{(3)}(G'_{\restriction K})\) (mod p), \(p^{(4)}(G_{\restriction K})\equiv p^{(4)}(G'_{\restriction K})\) (mod p) and \(s^{(4)}(G_{\restriction K})\equiv s^{(4)}(G'_{\restriction K})\) (mod p) for all k-element subsets K of V, then \(G'=G\) or \(G'=\overline{G}\).

The proof of Theorem 1.7 will be given in Sect. 4.

2 Sketch of the proofs of Theorems 1.4 and 1.7

Let G, \(G'\) be two graphs on the same vertex set V. The Boolean sum \(G\dot{+} G'\) of G and \(G'\) is the graph U on V whose edges are pairs e of vertices such that \(e\in E(G)\) if and only if \(e\notin E(G')\). Indeed, \(G'=G\) or \(G'= \overline{G}\) amounts to the fact that U is either the empty graph or the complete graph. The intersection graph of G and \(G'\) is the graph \(G\cap G':= (V, E(G)\cap E(G'))\).

Observation 2.1

[5] Let G and \(G'\) be two graphs on the same finite set V of v vertices, and let \(U:=G\dot{+} G'\). Then

  1. (1)

    \(e(U)=e(G)+e(G')-2e(G\cap G')\).

  2. (2)

    e(G) and \(e(G')\) have the same parity if and only if e(U) is even.

To prove (1) of Theorem 1.4, we consider \(U:= G\dot{+} G'\). From Theorem 1.2, it is sufficient to prove that \(e(G_{\restriction X})\) has the same parity as \(e(G'_{\restriction X})\) for all 4-element subsets X of V that is, from Observation 2.1, \(e(U_{\restriction X})\) is even for all 4-element subsets X of V. For this we proceed by contradiction, assuming that \(e(U_{\restriction X})\) is odd. As \(H^{(3)}(G)=H^{(3)}(G')\), Theorem 3.1 says that \(U_{\restriction X}\) is a path of length 1 or 3. If the length is one, we study two cases. If the length is 3, we conclude using Theorem 3.2.

To prove item (2), and also Theorem 1.7, we will prove that item (1) of Theorem 1.4 holds. For this, we will use linear algebra. The incidence matrix \(W_{t\;k}(v)\) used by Wilson [13], or more simply \(W_{t\;k}\), is defined as follows : Let V be a finite set, with v elements. Given non-negative integers \(t\le k\le v\), let \(W_{t\;k}\) be the \({v \atopwithdelims ()t}\) by \({v \atopwithdelims ()k}\) matrix of 0’s and 1’s, the rows of which are indexed by the t-element subsets T of V, the columns are indexed by the k-element subsets K of V, and where the entry \(W_{t\;k}(T,K)\) is 1 if \(T\subseteq K\) and is 0 otherwise. The matrix transpose of \(W_{t\;k}\) is denoted \(^tW_{t\;k}\). We denote by \(rank_{\mathbb {Q}}\ W_{t\; k}\), the rank of \(W_{t\; k}\) over the field \(\mathbb {Q}\). Whenever p is a prime, we denote by \(rank_{p}\ W_{t\; k}\), the rank of \(W_{t\; k}\) over the field \(\mathbb {F}_p\), and by \(Ker_{p}(^tW_{t\; k})\) the kernel of \(^tW_{t\; k}\) in \(\mathbb {F}_p\).

First, \(rank_{\mathbb {Q}}\ W_{t\; k}\) is given by Theorem 2.2 due to Gottlieb [7].

Theorem 2.2

[7] For \(t\le min{(k,v-k)}\), the rank of \(W_{t\; k}\) over the field \(\mathbb {Q}\) of rational numbers is \({v \atopwithdelims ()t}\) and thus \(Ker(^tW_{t\; k})=\{0\}\).

Let \(G:=(V,E)\) be a graph with v vertices, \(v\ge 6\). Let \(t\in \{3,4\}\), and k be an integer, \(k\le v\) and \(t\le min(k,v-k)\).

Let \(T_1,T_2,\ldots ,T_{{v\atopwithdelims ()t}}\) be an enumeration of the t-element subsets of V.

Let \(K_1,K_2,\ldots ,K_{{v\atopwithdelims ()k}}\) be an enumeration of the k-element subsets of V.

We set:

$$\begin{aligned}&w_G^h:=(g_1^h,g_2^h,\ldots ,g_{{v\atopwithdelims ()3}}^h) \hbox { where } g_i^h=1 \quad \hbox { if } \quad T_i\in H^{(3)}(G), 0 \quad \hbox { otherwise }.\\&w_G^p:=(g_1^p,g_2^p,\ldots ,g_{{v\atopwithdelims ()4}}^p) \hbox { where } g_i^p=1 \quad \hbox { if } \quad T_i\in P^{(4)}(G), 0 \quad \hbox { otherwise }.\\&w_G^s:=(g_1^s,g_2^s,\ldots ,g_{{v\atopwithdelims ()4}}^s) \hbox { where } g_i^s=1 \quad \hbox { if } \quad T_i\in S^{(4)}(G), 0 \quad \hbox { otherwise }. \end{aligned}$$

We have:

$$\begin{aligned}&w_G^h W_{3\;k}=(h^3(G_{\restriction K_1}),h^3(G_{\restriction K_2}),\ldots ,h^3(G_{\restriction K_{{v\atopwithdelims ()k}}})),\\&w_G^p W_{4\;k}=(p^{(4)}(G_{\restriction K_1}),p^{(4)}(G_{\restriction K_2}),\ldots ,p^{(4)}(G_{\restriction K_{{v\atopwithdelims ()k}}})). \\&w_G^s W_{4\;k}=(s^{(4)}(G_{\restriction K_1}), s^{(4)}(G_{\restriction K_2}),\ldots ,s^{(4)}(G_{\restriction K_{{v\atopwithdelims ()k}}})). \end{aligned}$$

Observation 2.3

Let G and \(G'\) be two graphs on the same finite set V of v vertices.

  1. (1)

    If \(h^{(3)}(G_{\restriction K_i})= h^{(3)}(G'_{\restriction K_i})\) (resp. \(h^{(3)}(G_{\restriction K_i})\equiv h^{(3)}(G'_{\restriction K_i})\) (mod p)) for all \(i\in \{1,2,\dots ,{v \atopwithdelims ()k}\}\), then \(w_G^h-w_{G'}^h\in Ker_{\mathbb {Q}}(^tW_{3\;k})\) (resp. \(w_G^h-w_{G'}^h\in Ker_p(^tW_{3\;k})\)).

  2. (2)

    If \(p^{(4)}(G_{\restriction K_i})= p^{(4)}(G'_{\restriction K_i})\) (resp. \(p^{(4)}(G_{\restriction K_i})\equiv p^{(4)}(G'_{\restriction K_i})\) (mod p)) for all \(i\in \{1,2,\ldots ,{v \atopwithdelims ()k}\}\), then \(w_G^p-w_{G'}^p\in Ker_{\mathbb {Q}}(^tW_{4\;k})\) (resp. \(w_G^p-w_{G'}^p\in Ker_p(^tW_{4\;k})\)).

  3. (3)

    If \(s^{(4)}(G_{\restriction K_i})= s^{(4)}(G'_{\restriction K_i})\) (resp. \(s^{(4)}(G_{\restriction K_i})\equiv s^{(4)}(G'_{\restriction K_i})\) (mod p)) for all \(i\in \{1,2,\ldots ,{v \atopwithdelims ()k}\}\), then \(w_G^s-w_{G'}^s\in Ker_{\mathbb {Q}}(^tW_{4\;k})\) (resp. \(w_G^s-w_{G'}^s\in Ker_p(^tW_{4\;k})\)).

Now for the end of the proof of item (2), from Observation 2.3, \(w_G^h-w_{G'}^h\in Ker_{\mathbb {Q}}(^tW_{3\;k})\). From Theorem 2.2, \(Ker_{\mathbb {Q}}(^tW_{3\;k})=\{0\}\), then \(w_G^h=w_{G'}^h\). Thus, \(H^{(3)}(G)=H^{(3)}(G')\). For the other parameters, we do the same. Thus, we get the hypotheses of item (1).

For Theorem 1.7, there are two cases according to the value of \(k_0\). If \(k_0\ge 4\), we proceed as above. If \(k_0 = 0\), we use Theorem 4.1 which gives the dimension and a basis of \(Ker_{p}(^tW_{t\;k})\).

3 Proof of Theorem 1.4

A description of the Boolean sum \(G\dot{+} G'\), of graphs G and \(G'\) having the same 3-element homogeneous subsets, is given by Theorem 3.1 below.

We denote by \(P_9\) the Paley graph on 9 vertices (cf. Fig. 2). Note that \(P_9\) is isomorphic to its complement \(\overline{P_9}\).

Fig. 2
figure 2

\(P_9\)

Theorem 3.1

[10] Let U be a graph. The following properties are equivalent:

  1. (1)

    There are two graphs G and \(G'\) having the same 3-element homogeneous subsets such that \(U:=G\dot{+} G'\);

  2. (2)

    Either (i) U is an induced subgraph of \(P_9\), or (ii) the connected components of U, or of its complement \(\overline{U}\), are cycles of even length or paths.

For graphs G and \(G'\) having the same 3-element homogeneous subsets, Theorem 3.2 below gives the form of their restrictions on a connected component of \(G\dot{+} G'\).

Theorem 3.2

[5] Let G and \(G'\) be two graphs on the same vertex set V and \(U:= G\dot{+} G'\). We assume \(H^{(3)}(G)=H^{(3)}(G')\) and U not connected. If C is a connected component of U of cardinality n, then the pair \(\{G_{\restriction V(C)},G'_{\restriction V(C)}\}\) is one of the following:

  1. (1)

    \(\{M_n, M'_n\}\), \(\{\overline{M_n}, \overline{M'_n}\}\), if C is a path.

  2. (2)

    \(\{M_n, M''_n\}\), \(\{\overline{M_n}, \overline{M''_n}\}\), \(\{D_4, D'_4\}\), \(\{\overline{D_4}, \overline{D'_4}\}\), if C is a cycle.

The graphs mentioned in the conclusion of Theorem 3.2 are defined as follows (see Fig. 3).

Let \(n\ge 2\). Let \(X_n\) be an n-element set, \(v_0,\cdots , v_{n-1}\) be an enumeration of \(X_n\), \(X_n^{0}:= \{v_i\in X_n: i \equiv 0 \ (mod \ 2)\}\) and \(X_{n}^{1}:= X_n\setminus X_{n}^{0}\). Set \(R_n:=[X_{n}^{0}]^2\cup [X_n^{1}]^2\), \(S_n:=\{\{v_{2i},v_{2i+1}\}: 2i+1<n\}\), \(S'_n:=\{\{v_{2i+1}, v_{2i+2}\}: 2i+2< n\}\). Let \(M_n\) and \(M'_n\) be the graphs with vertex set \(X_n\) and edge sets \(E(M_n):= R_n\cup S_n\) and \(E(M'_n):= R_n\cup S'_n\), respectively. Let \(M''_n:= (X_n, R_n\cup S'_n\cup \{\{v_0,v_{n-1}\}\})\) for n even, \(n\ge 4\). Finally, let \(D_4:= (X_4, \{\{v_{0},v_{1}\}, \{v_{0},v_{2}\}, \{v_{2},v_{3}\}\})\) and \(D'_4:= (X_4, \{\{v_{0},v_{2}\}, \{v_{0},v_{3}\}, \{v_{1},v_{2}\}\})\).

Fig. 3
figure 3

\(M_n\), \(M'_n\), \(M''_n\), \(D_4\), \(D'_4\)

Let \(G=(V,E)\) be a graph. For \(x\ne y \in V\), \(x \sim _{G} y\) means \(\{x,y\}\in E\), \(x\not \sim _{G} y\) means \(\{x,y\}\notin E\). For \(X, Y\subseteq V\), \(X\sim _{G}Y\) signifies that for every \(x\in X\) and \(y\in Y\), \(x\sim _{G} y\). Similarly, \(X\not \sim _{G} Y\) signifies that for every \(x\in X\) and \(y\in Y\), \(x\not \sim _{G} y\). Whenever \(X=\{x\}\), \(X\sim _{G}Y\) and \(X\not \sim _{G} Y\) are, respectively, denoted \(x\sim _{G}Y\) and \(x\not \sim _{G} Y\).

Now we prove Theorem 1.4.

  1. (1)

    Let \(U:=G\dot{+} G'\). Using Theorem 1.2, it is sufficient to prove that \(e(G_{\restriction X})\) has the same parity as \(e(G'_{\restriction X})\) for all 4-element subsets X of V that is, from Observation 2.1, \(e(U_{\restriction X})\) is even for all 4-element subsets X of V. Let \(X:=\{v_0,v_1,v_2,v_3\}\) be a subset of V. By contradiction, we assume that \(e(U_{\restriction X})\) is odd, then \(e(U_{\restriction X})\in \{1,3,5\}\). As \(H^{(3)}(G)=H^{(3)}(G')\) then, by Theorem 3.1, \(E(U_{\restriction X})=\{\{v_0,v_1\}, \{v_1,v_2\}, \{v_{2},v_{3}\}\}\) or \(\{\{v_0,v_1\}\}\).

    • If \(E(U_{\restriction X})=\{\{v_0,v_1\}, \{v_1,v_2\}, \{v_{2},v_{3}\}\}\), we apply (1) of Theorem 3.2. So \(\{G_{\restriction X}, G'_{\restriction X}\} =\{M_4, M'_4\}\) or \(\{\overline{M_4}, \overline{M'_4}\}\). We get a contradiction with \(P^{(4)}(G)=P^{(4)}(G')\) since \(M_4\notin P^{(4)}(G)\cup P^{(4)}(G')\) and \(M'_4\in P^{(4)}(G)\cap P^{(4)}(G')\).

    • If \(E(U_{\restriction X})= \{\{v_0,v_1\}\}\), we can suppose \(v_0\sim _{G}v_1\) and \(v_0\not \sim _{G'}v_1\). Without loss of generality, we assume \(v_0\sim _{G}v_2\). As \(v_0\not \sim _{U}v_2\), \(v_0\sim _{G'}v_2\). We have \(v_0\sim _{G}\{v_1,v_2\}\), \(v_0\not \sim _{G'}v_1\) and \(v_0\sim _{G'}v_2\). As \(H^3(G)=H^3(G')\), \(v_2\not \sim _{G}v_1\). Since \(v_2\not \sim _{U}v_1\) then \(v_2\not \sim _{G'}v_1\).

    Case 1. \(v_0\sim _{G}v_3\). Since \(v_0\not \sim _{U}v_3\) then \(v_0\sim _{G'}v_3\). Consider \(\{v_0,v_1,v_3\}\), as \(H^{(3)}(G)=H^{(3)}(G')\) we have \(v_1\not \sim _{G}v_3\), thus \(v_1\not \sim _{G'}v_3\). If \(v_2\not \sim _{G}v_3\), then \(v_2\not \sim _{G'}v_3\). So \(\{v_0,v_1,v_2,v_3\}\in S^{(4)}(G)\) and \(\{v_0,v_1,v_2,v_3\}\notin S^{(4)}(G')\). That contradicts \(S^{(4)}(G)=S^{(4)}(G')\). If \(v_2\sim _{G}v_3\), then \(v_2\sim _{G'}v_3\). So \(\{v_0,v_1,v_2,v_3\}\in S^{(4)}(G')\) and \(\{v_0,v_1,v_2,v_3\}\notin S^{(4)}(G)\). That contradicts \(S^{(4)}(G)=S^{(4)}(G')\). Case 2. \(v_0\not \sim _{G}v_3\). Since \(v_0\not \sim _{U}v_3\) then \(v_0\not \sim _{G'}v_3\). Consider \(\{v_0,v_1,v_3\}\), as \(H^{(3)}(G)=H^{(3)}(G')\) we have \(v_1\sim _{G'}v_3\), thus \(v_1\sim _{G}v_3\). If \(v_2\not \sim _{G}v_3\), then \(v_2\not \sim _{G'}v_3\). Then \(\{v_0,v_1,v_2,v_3\}\in P^{(4)}(G)\) and \(\{v_0,v_1,v_2,v_3\}\notin P^{(4)}(G')\). That contradicts \(P^{(4)}(G)=P^{(4)}(G')\). If \(v_2\sim _{G}v_3\), then \(v_2\sim _{G'}v_3\). Then \(\{v_0,v_1,v_2,v_3\}\notin P^{(4)}(G)\) and \(\{v_0,v_1,v_2,v_3\}\in P^{(4)}(G')\). That contradicts \(P^{(4)}(G)=P^{(4)}(G')\).

  2. (2)

    We will prove \(H^{(3)}(G)=H^{(3)}(G')\), \(P^{(4)}(G)=P^{(4)}(G')\), \(S^{(4)}(G)=S^{(4)}(G')\) and conclude using (1). From Observation 2.3, \(w_G^h-w_{G'}^h\in Ker_{\mathbb {Q}}(^tW_{3\;k})\). From Theorem 2.2, \(Ker_{\mathbb {Q}}(^tW_{3\;k})=\{0\}\), then \(w_G^h=w_{G'}^h\). Thus \(H^{(3)}(G)=H^{(3)}(G')\). From Observation 2.3, \(w_G^p-w_{G'}^p\in Ker_{\mathbb {Q}}(^tW_{4\;k})\) and \(w_G^s-w_{G'}^s\in Ker_{\mathbb {Q}}(^tW_{4\;k})\). From Theorem 2.2, \(Ker_{\mathbb {Q}}(^tW_{4\;k})=\{0\}\), then \(w_G^p=w_{G'}^p\) and \(w_G^s=w_{G'}^s\). Thus \(P^{(4)}(G)=P^{(4)}(G')\) and \(S^{(4)}(G)=S^{(4)}(G')\).

\(\square \)

4 Proof of Theorem 1.7

The following result is one of the keys to our proof.

Theorem 4.1

[1] Let p be a prime number. Let vt and k be non-negative integers, \(k\le v\), \(k=[k_0,k_1,\ldots , k_{k(p)}]_p\), \(t=[t_0,t_1,\ldots , t_{t(p)}]_p\), \(t\le \min {(k,v-k)}\). We have:

  1. (1)

    \(k_j=t_j\) for all \(j<t(p)\) and \(k_{t(p)}\ge t_{t(p)}\) if and only if \(Ker_{p} (^tW_{t\; k})=\{0\}\).

  2. (2)

    \(t=t_{t(p)}p^{t(p)}\) and \(k=\sum _{i={t(p)}+1}^{k(p)}k_ip^i\) if and only if \(dim \ Ker_{p}(^tW_{t\; k})= 1\) and \(\{(1,1,\ldots ,1)\}\) is a basis of \(Ker_{p} (^tW_{t\; k})\).

Let \(k\ge 1\) be an integer and G be a graph. We say that G is k-monomorphic (resp. k-monomorphic up to complementation) if \(G_{\restriction X} \simeq G_{\restriction Y}\) (resp. \(G_{\restriction X} \simeq G_{\restriction Y}\) or \(G_{\restriction X} \simeq {\overline{G}}_{\restriction Y}\)) for all k-element subsets X and Y of V. The notion of monomorphy was introduced by Fraïssé [6].

The following result on monomorphy, due to Pouzet, is very useful since it is the origin of Proposition 4.3, which is a key in the proof of Theorem 1.7.

Proposition 4.2

[8] Let vtk be integers, \(t\le \min (k, v- k)\) and G be a graph on a set V of v vertices. If G is k-monomorphic then G is t-monomorphic.

We give a similar result (Proposition 4.3) in the case of the monomorphy up to complementation.

Proposition 4.3

Let vtk be integers, \(t\le \min (k, v- k)\) and G be a graph on a set V of v vertices. If G is k-monomorphic up to complementation then G is t-monomorphic up to complementation.

Proof

Let \(T_1,T_2,\ldots , T_{v\atopwithdelims ()t}\) be the t-element subsets of V, and \(K_1,K_2,\ldots ,K_{{v\atopwithdelims ()k}}\) be the k-element subsets of V. Let \(H:=G_{\restriction {T_1}}\). Set \(Isc(H,G):=\{L\subseteq V: G_{\restriction L}\simeq H \ \text{ or } \ G_{\restriction L}\simeq {\overline{H}}\}\) and \(w_{H,G}\) the row vector indexed by the t-element subsets \(T_1,T_2,\ldots , T_{v\atopwithdelims ()t}\) of V whose coefficient of \(T_i\) is 1 if \(T_i\in Isc(H,G)\) and 0 otherwise.

We have \(w_{H,G} W_{t \; k}= \left( \alpha _1,\alpha _2,\ldots ,\alpha _{v\atopwithdelims ()k}\right) \) where

$$\begin{aligned} \alpha _j:=\left| \{T_i:\; T_i\subseteq K_j,\ 1\le i \le {v\atopwithdelims ()t},\ T_i\in Isc(H,G)\}\right| . \end{aligned}$$

Since G is k-monomorphic up to complementation, \(\alpha _1=\alpha _2=\cdots =\alpha _{v\atopwithdelims ()k}\). Thus \(w_{H,G} W_{t \; k}= \alpha _1(1,1,\cdots ,1)\). Now \((1,1,\ldots ,1) W_{t \; k}= ({k\atopwithdelims ()t},{k\atopwithdelims ()t}, \ldots , {k\atopwithdelims ()t})={k\atopwithdelims ()t}(1,1,\ldots ,1)\). It follows that \({k\atopwithdelims ()t}w_{H,G} W_{t \; k}=\alpha _1(1,1,\ldots ,1) W_{t \; k}\). From Theorem 2.2, \(Ker_{\mathbb {Q}}(^tW_{t\;k})=\{0\}\). Thus \({k\atopwithdelims ()t}w_{H,G}=\alpha _1(1,1,\ldots ,1)\). Since \(H=G_{\restriction {T_1}}\), then \(w_{H,G}\ne (0,0,\ldots ,0)\), this implies \(\alpha _1\ne 0\). Then from \(w_{H,G}=\frac{\alpha _1}{{k\atopwithdelims ()t}}(1,1,\ldots ,1)\), we deduce that \(w_{H,G} =(1,1,\ldots ,1)\). So \(T_i\in Isc(H,G)\) for all \(i\in \{1,2,\ldots , {v\atopwithdelims ()t}\}\). Thus G is t-monomorphic up to complementation. \(\square \)

Now we prove Theorem 1.7.

We have \(w_G^h W_{3\;k}=w_{G'}^h W_{3\;k}\), \(w_G^p W_{4\;k}=w_{G'}^p W_{4\;k}\) and \(w_G^s W_{4\;k}=w_{G'}^s W_{4\;k}\).

By Theorem 1.4, it is sufficient to prove that \(H^{(3)}(G)=H^{(3)}(G')\), \(P^{(4)}(G)=P^{(4)}(G')\) and \(S^{(4)}(G)=S^{(4)}(G')\). Let \(t\in \{3,4\}\). According to the value of \(k_0\), we have two cases.

Case 1. \(k_0\ge 4\). As \(t\in \{3,4\}\) and \(p\ge 5\) then \(t(p)=0\), \(t=t_0\le 4 \le k_0\). From (1) of Theorem 4.1, \({\text {Ker}}_p(^tW_{3\;k})= \{0\}\) and \({\text {Ker}}_p(^tW_{4\;k})= \{0\}\). Then from Observation 2.3, we obtain \(H^{(3)}(G)=H^{(3)}(G')\), \(P^{(4)}(G)=P^{(4)}(G')\) and \(S^{(4)}(G)=S^{(4)}(G')\).

Case 2. \(k_0=0\). As \(t=t_0\ne 0\) then, from (2) of Theorem 4.1, \({\text {dim}} \ {\text {Ker}}_{p}(^tW_{t\;k}) = 1\) and \((1,1,\ldots ,1)\) is a basis of \(Ker_{p}(^tW_{t\;k})\). By Observation 2.3, there are \(\lambda _h, \lambda _p, \lambda _s \in \{0,1,-1\}\) such that \(w_G^h-w_{G'}^h=\lambda _h(1,1,\ldots ,1)\), \(w_G^p-w_{G'}^p=\lambda _p(1,1,\ldots ,1)\), \(w_G^s-w_{G'}^s=\lambda _s(1,1,\ldots ,1)\).

If \(\lambda _h =1\), then \(w_G^h=(1,1,\ldots ,1)\) and \(w_{G'}^h=(0,0,\ldots ,0)\). Then in \(G'\) there is no 3-homogeneous set, that is impossible according to Ramsey’s theorem [11] which ensures that Ramsey’s number r(3, 3) is equal to 6. If \(\lambda _h =-1\), \(w_G^h=(0,0,\ldots ,0)\) and we conclude as above. Then \(\lambda _h =0\) and thus \(H^{(3)}(G)=H^{(3)}(G')\).

If \(\lambda _p =1\), then \(w_G^p=(1,1,\ldots ,1)\). So for all 4-element subsets X of V, \(G_{\restriction X}\simeq P_4\), thus G is 4-monomorphic. Then by Proposition 4.2, G is 2-monomorphic, that implies G is the empty graph or the complete graph, so G does not contain a subgraph isomorphic to \(P_4\), a contradiction. If \(\lambda _p =-1\), then \(w_{G'}^p=(1,1,\ldots ,1)\) and we conclude as above. Then \(\lambda _p =0\) and thus \(P^{(4)}(G)=P^{(4)}(G')\).

If \(\lambda _s =1\), then \(w_G^s=(1,1,\dots ,1)\). So for all 4-element subsets X of V, \(G_{\restriction X}\simeq K_{1,3}\) or \(G_{\restriction X}\simeq {\overline{K_{1,3}}}\), thus G is 4-monomorphic up to complementation. Then by Proposition 4.3, G is 3-monomorphic up to complementation. Let \(v_0,v_1,v_2,v_3\in V\) such that \(G_{\restriction \{v_0,v_1,v_2,v_3\}}\) or \({\overline{G}}_{\restriction \{v_0,v_1,v_2,v_3\}}\) is the claw \((\{v_0,v_1,v_2,v_3\}, \{\{v_0,v_1\}, \{v_0,v_2\}, \{v_0,v_3\}\})\). We have \(G_{\restriction \{v_0,v_1,v_2\}} \not \simeq G_{\restriction \{v_1,v_2,v_3\}}\) and \(G_{\restriction \{v_0,v_1,v_2\}} \not \simeq {\overline{G}}_{\restriction \{v_1,v_2,v_3\}}\), this contradicts the fact that G is 3-monomorphic up to complementation. If \(\lambda _s =-1\), then \(w_{G'}^s=(1,1,\dots ,1)\), we conclude as above. Then \(\lambda _s =0\) and thus \(S^{(4)}(G)=S^{(4)}(G')\). \(\square \)