betaFeedback

WorksMathematics

The inverse problem for the number of connected induced subgraphs

Abstract

For a finite graph GG, let c(G)c(G) be the number of nonempty vertex sets that induce a connected subgraph. We show that a positive integer kk equals c(G)c(G) for some finite connected graph GG if and only if k∉{2,4,5,8,9,16}k\notin\{2,4,5,8,9,16\}. Every attainable value k≠25k\ne25 is attained on ⌊log⁡2k⌋+1\lfloor\log_2 k\rfloor+1 vertices, the least possible number, and 2525 needs six vertices. More precisely, for every m≥6m\ge6 each integer from 2m−12^{m-1} to 2m−12^m-1 is the value of cc on a connected graph with exactly mm vertices. The proofs of these results are short and use no computer; computer calculations serve only as independent checks, and for two auxiliary results: the values on six to eight vertices, and the result on all connected subgraphs described below. The value 1616 falls into a gap above the path: a connected graph on n≥4n\ge4 vertices other than the path PnP_n has at least n−3n-3 more connected sets than PnP_n. The values k≥17k\ge17 are realized by a recursive construction from cones, disjoint unions and a family of graphs that we call near-cones, starting from seven small graphs; it produces a graph with c(G)=kc(G)=k in time polynomial in log⁡k\log k. The question arose from a problem of Ordoñez in continuum theory, through a reduction by Camargo, Ordoñez and Ramírez, who found the values up to 255255 by a computer search. The proof is formalized in Lean 4. We also observe that a theorem of Czabarka, Székely and Wagner on subtrees reduces the corresponding problem for the number of all connected subgraphs to a finite computation, and we report its outcome. We did not find these results in the literature, but we make no claim of novelty or priority.

Introduction

Let GG be a finite simple graph. A connected set of GG is a nonempty set of vertices that induces a connected subgraph, and c(G)c(G) denotes the number of connected sets of GG. Equivalently, c(G)c(G) is the number of connected induced subgraphs of GG, where subgraphs induced by different vertex sets are counted separately even when they are isomorphic. For instance,

c(Pn)=n(n+1)2,c(Kn)=2n−1,c(K1,d)=2d+d,c(Cn)=n(n−1)+1c(P_n) = \frac{n(n+1)}{2}, \qquad c(K_n) = 2^n - 1, \qquad c(K_{1,d}) = 2^d + d, \qquad c(C_n) = n(n-1) + 1

for the path, the complete graph, the star and the cycle; these and several other closed formulas are given by Vince [23 Example 1]. For a tree, c(G)c(G) is the number of subtrees. Write T(n)=n(n+1)/2T(n) = n(n+1)/2. If GG is connected with nn vertices, then

T(n)≤c(G)≤2n−1(1)T(n) \le c(G) \le2^n - 1 \tag*{(1)}

(Lemma 2.1(f)). The inverse problem for cc asks which positive integers are of the form c(G)c(G). The question is only interesting for connected graphs: cc is additive over components, so every positive integer kk is cc of the edgeless graph on kk vertices.

Theorem 1.1. A positive integer kk equals c(G)c(G) for some finite connected graph GG if and only if

k∉{2,4,5,8,9,16}.k \notin\{2,4,5,8,9,16\}.

The upper bound in (1) shows that a connected graph with c(G)=kc(G) = k has at least ⌊log⁡2k⌋+1\lfloor\log_2 k \rfloor+ 1 vertices. This bound is attained with a single exception.

Theorem 1.2. Let kk be a positive integer with k∉{2,4,5,8,9,16}k \notin\{2,4,5,8,9,16\}. The least number of vertices of a connected graph GG with c(G)=kc(G)=k is ⌊log⁡2k⌋+1\lfloor\log_2 k \rfloor+1 if k≠25k\ne25, and 66 if k=25k=25.

Both theorems follow from a statement about graphs with a prescribed number of vertices. For m≥0m\ge0 let

Vm={c(G):G a connected graph with exactly m vertices},V_m=\{c(G):G\text{ a connected graph with exactly }m\text{ vertices}\},
Λm={c(G):G a graph with exactly m vertices}.\Lambda_m=\{c(G):G\text{ a graph with exactly }m\text{ vertices}\}.

For integers a≤ba\le b we write [a,b]={a,a+1,…,b}[a,b]=\{a,a+1,\ldots,b\}. By (1), Vm⊆[T(m),2m−1]V_m\subseteq[T(m),2^m-1].

Theorem 1.3. (a) For every m≥6m\ge6, Vm⊇[2m−1,2m−1]V_m\supseteq[2^{m-1},2^m-1]: every integer kk with 2m−1≤k≤2m−12^{m-1}\le k\le2^m-1 is c(G)c(G) for a connected graph GG with exactly mm vertices.

(b) For every m≥7m\ge7, Λm⊇[m,2m−1]\Lambda_m\supseteq[m,2^m-1].

Part (a) fails for m=5m=5, since 25∉V525\notin V_5 (Proposition 3.4). A computer search shows that part (b) fails for m=6m=6, since 26∉Λ626\notin\Lambda_6 (Section 9).

How the problem arose

Where the exceptions come from. By (1), the values of cc on connected graphs with n=1,2,3,4,5,6n=1,2,3,4,5,6 vertices lie in the intervals

[1,1],[3,3],[6,7],[10,15],[15,31],[21,63],[1,1],\quad[3,3],\quad[6,7],\quad[10,15],\quad[15,31],\quad[21,63],

and from n=4n=4 on consecutive intervals overlap. The five integers 2,4,5,8,92,4,5,8,9 lie in none of these intervals. The integer 1616 lies only in the interval for n=5n=5, and there it equals T(5)+1T(5)+1. It falls into a gap just above the path. A connected graph on n≥4n\ge4 vertices other than PnP_n has at least T(n)+n−3T(n)+n-3 connected sets (Proposition 3.2), so T(n)+1,…,T(n)+n−4T(n)+1,\ldots,T(n)+n-4 are never attained on nn vertices. For n≥6n\ge6 these gaps are covered by graphs with fewer vertices, but for n=5n=5 the gap is the single value 1616, and no other order covers it. Theorems 1.1–1.3 say that nothing else is lost.

The method. The proofs of Theorems 1.1–1.3 use no computer. Computer calculations appear in this paper only as independent checks of explicit counts (Section 9), in the census of the values on six to eight vertices (Section 6), and in Proposition 7.3 on all connected subgraphs, which is labelled as computer-assisted. The exclusions come from (1) and Proposition 3.2. For the realizations, the basic observation is that adding a universal vertex to a graph KK (taking the cone over KK) adds exactly 2∣K∣2^{|K|} connected sets. So the cones over the graphs with m−1m-1 vertices realize 2m−1+Λm−12^{m-1}+\Lambda_{m-1} on mm vertices. Every graph on m−1m-1 vertices has at least m−1m-1 connected sets, so cones miss the m−1m-1 values at the bottom of [2m−1,2m−1][2^{m-1},2^m-1]. To fill this gap we use near-cones (Definition 4.1). A near-cone is the cone over the disjoint union of a star and a graph RR, with one edge at the apex removed; removing that edge destroys exactly 2∣R∣2^{|R|} connected sets. Choosing the size of the star near log⁡2m\log_2m makes the missing values reachable from Λ∣R∣\Lambda_{|R|} by induction (Theorem 4.6). The induction starts at seven vertices and needs seven small graphs, which we call sporadic. The construction is explicit and yields a graph with c(G)=kc(G)=k on ⌊log⁡2k⌋+1\lfloor\log_2 k\rfloor+1 vertices in time polynomial in log⁡k\log k (Remark 5.1).

The work started from a question in continuum theory. A continuum is a nonempty compact connected metric space. A subcontinuum AA of a continuum XX is regular if A=cl⁡Xint⁡XAA=\operatorname{cl}_X\operatorname{int}_X A, and Ordoñez [18] introduced the hyperspace D(X)\mathcal{D}(X) of regular subcontinua of XX. He asked for which nn there is a continuum XX with exactly nn regular subcontinua [18 Problem 4.14]. Camargo, Ordoñez and Ramírez [7] showed that D(X)\mathcal{D}(X) is finite, it is determined by its minimal elements, which have pairwise disjoint interiors and cover XX [7 Theorem 3.16]. This reduces the computation of ∣D(X)∣|\mathcal{D}(X)| to a count in a graph: ∣D(X)∣|\mathcal{D}(X)| is the number of connected sets of the intersection graph of these minimal elements, a finite connected graph [7], [2, Proposition 3.2]. They proved that ∣D(X)∣∉{2,4,5,8,9}|\mathcal{D}(X)|\notin\{2,4,5,8,9\} [7 Proposition 3.18]. A computer search over all graphs with at most eight vertices showed that 1616 does not occur as a value of cc, while every integer from 17 to 255 does [7 Remark 3.20]. They asked whether every k≥256k \ge256 is the cardinality of some D(X)D(X) [7 Question 3.21].

The author was working on this question. In a companion paper [2] we answer it: the finite cardinalities of D(X)D(X) are exactly the positive integers outside {2,4,5,8,9,16}\{2, 4, 5, 8, 9, 16\}. That paper realizes every finite connected graph by copies of the Knaster continuum glued at points. Hence the topological question is equivalent to the graph-theoretic one, which is Theorem 1.1. The graph-theoretic result does not depend on continuum theory and may be of independent interest. So we present it here on its own, with complete proofs and a more detailed explanation of the construction. Compared with [2], this paper also contains a new and more conceptual treatment of five vertices (Propositions 3.2 and 3.4) and some related observations (§ 6 and § 7).

Related work and the status of the result

The invariant c(G)c(G) has been studied mainly from the extremal point of view. For trees, cc is the number of subtrees, studied by Székely and Wang [21], among others. For general graphs, Dossou-Olory [10, 11, 12], Andriantiana and Dossou-Olory [5] (Nordhaus–Gaddum inequalities), and Haslegrave [14] studied the extremal values of cc and of related counts of connected sets. Vince [23] studied the growth of cc, and of the number of partitions of the vertex set into connected sets, along infinite families of graphs; he computed cc for several families and bounded it in terms of the number of edges. The invariant is a specialization of the subgraph component polynomial of Tittmann, Averbouch and Makowsky [22], which counts vertex sets by their size and by the number of components of the induced subgraph; c(G)c(G) counts the vertex sets inducing exactly one component. Pandey and Patra [19] studied extremal problems for the number F(G)F(G) of all connected subgraphs, not necessarily induced.

Inverse problems ask which values a graph invariant takes. Linek [15] showed that every positive integer is the number of independent sets of a bipartite graph. Wang and Yu [24] showed that all but 49 positive integers are Wiener indices of trees. Czabarka, Székely and Wagner [8] solved the inverse problem for several tree parameters; in particular, every positive integer except 34 explicit values, the largest being 89, is the number of subtrees of some tree. More recently, Alizadeh et al. [1] showed that every nonnegative integer except 1 is the Mostar index of a graph, and Bernert and Shaw [6] showed that, for each fixed k≥2k \ge2, all sufficiently large integers are Steiner–Wiener kk-indices of graphs.

Status. We searched the literature for a classification of the values of cc on general connected graphs. The search used web and arXiv searches on connected sets, connected induced subgraphs, the subgraph component polynomial and inverse problems for graph invariants, and the references of the works above. We did not find Theorems 1.1–1.3. The only previous determination of these values that we know is the computational one of [7 Remark 3.20] for graphs with at most eight vertices. We also note that Theorem 1.1 can be deduced from the theorem of [8] on subtrees by a finite computation (Remark 7.1); that route uses a computer and gives neither Theorem 1.2 nor Theorem 1.3. The question is natural and the proof is elementary, so the result may be known, or folklore, in a form that we did not find. We therefore make no claim of novelty or priority, and we would be grateful for references.

Formalization, computations and organization

Theorems 1.1–1.3, the other results of § 2–§ 5 and § 6, and Lemma 7.2 are formalized in Lean 4 with Mathlib (§ 8). All explicit finite counts in this paper were also checked by computer (§ 9). The LaTeX source, the Lean formalization, the programs and their outputs are in the repository [3]. § 2 collects the counting rules. § 3 treats graphs with at most five vertices and proves the gap above the path. § 4 contains the construction, and § 5 the proofs of the main theorems. § 6 discusses the values on a fixed number of vertices. § 7 discusses subtrees, all connected subgraphs, and the topological interpretation.

Counting rules

Graphs are finite and simple; they need not be connected, and the graph with no vertices is allowed, with c=0c=0. For a graph GG we write ∣G∣|G| for its number of vertices, and G[F]G[F] for the subgraph induced by F⊆V(G)F \subseteq V(G). We write cv(G)c_v(G) for the number of connected sets containing a vertex vv. For sets A,BA,B of integers and an integer tt we write t+A={t+a:a∈A}t+A=\{t+a:a\in A\} and A+B={a+b:a∈A,b∈B}A+B=\{a+b:a\in A,b\in B\}.

A vertex is universal if it is adjacent to every other vertex. The cone over a graph HH is obtained by adding one new vertex adjacent to every vertex of HH. A pendant vertex is a vertex of degree one. A spider consists of a vertex, its centre, and paths, its legs, each joined to the centre by an edge at one of its ends and otherwise disjoint from each other. The length of a leg is its number of vertices, not counting the centre. The paw is a triangle with one pendant vertex, and the diamond is K4K_4 minus an edge.

Lemma 2.1. Let GG, HH and KK be graphs.

(a) (Disjoint union.) If GG is the disjoint union of HH and KK, then c(G)=c(H)+c(K)c(G)=c(H)+c(K).

(b) (Monotonicity.) If HH is a spanning subgraph of GG, then c(H)≤c(G)c(H)\leq c(G). If moreover some edge of GG is not an edge of HH, then c(H)<c(G)c(H)<c(G).

(c) (Gluing at a vertex.) Suppose that G=G1∪G2G=G_1\cup G_2 for subgraphs with V(G1)∩V(G2)={v}V(G_1)\cap V(G_2)=\{v\} and E(G)=E(G1)∪E(G2)E(G)=E(G_1)\cup E(G_2). Then

c(G)=cv(G1)cv(G2)+c(G1−v)+c(G2−v).c(G)=c_v(G_1)c_v(G_2)+c(G_1-v)+c(G_2-v).

(d) (Cone.) If GG is the cone over KK, then c(G)=2∣K∣+c(K)c(G)=2^{|K|}+c(K).

(e) (Almost-cone.) Let uu be a vertex of KK of degree dd in KK. If GG is obtained from KK by adding a vertex ww adjacent to every vertex of KK except uu, then

c(G)=c(K)+2∣K∣−2∣K∣−1−d.c(G)=c(K)+2^{|K|}-2^{|K|-1-d}.

(f) (Range.) If GG is connected with n≥1n\geq1 vertices, then T(n)≤c(G)≤2n−1T(n)\leq c(G)\leq2^n-1. The lower bound is attained by the path PnP_n and the upper bound by KnK_n.

Proof. (a) A connected set lies in one component.

(b) Every connected set of HH is connected in GG (compare [23 Lemma 1]). If uvuv is an edge of GG but not of HH, then {u,v}\{u,v\} is connected in GG but not in HH.

(c) No edge joins G1−vG_1-v and G2−vG_2-v, so a connected set avoiding vv lies in G1−vG_1-v or in G2−vG_2-v. Let FF be a connected set containing vv, and put Fi=F∩V(Gi)F_i=F\cap V(G_i). A path in G[F]G[F] between two vertices of FiF_i stays in V(Gi)V(G_i): it could leave V(Gi)V(G_i) only through vv, and it would have to return through vv, which a path cannot do. So each FiF_i is a connected set of GiG_i containing vv. Conversely, the union of a connected set of G1G_1 and one of G2G_2, both containing vv, is connected. This gives a bijection between the connected sets of GG containing vv and such pairs (F1,F2)(F_1,F_2).

(d) and (e) Let ww be the added vertex. The connected sets of GG avoiding ww are exactly those of KK. The sets containing ww are the sets {w}∪U\{w\}\cup U with U⊆V(K)U\subseteq V(K), and distinct sets UU give distinct sets {w}∪U\{w\}\cup U. Hence c(G)=c(K)+cw(G)c(G)=c(K)+c_w(G), where cw(G)c_w(G) is the number of sets U⊆V(K)U\subseteq V(K) such that {w}∪U\{w\}\cup U is connected. This happens if and only if every component of K[U]K[U] contains a neighbour of ww: such components are joined to ww, and a component of K[U]K[U] without a neighbour of ww would be a component of G[{w}∪U]G[\{w\}\cup U] not containing ww. In (d) the condition holds for all 2∣K∣2^{|K|} sets UU. In (e) the neighbours of ww are all vertices of KK except uu, so the condition fails exactly when {u}\{u\} is a component of K[U]K[U], that is, when u∈Uu\in U and UU contains no neighbour of uu. Such a set UU consists of uu and an arbitrary subset of the ∣K∣−1−d|K|-1-d vertices that are neither uu nor neighbours of uu, so there are 2∣K∣−1−d2^{|K|-1-d} of them.

(f) Let SS be a spanning tree of GG. For vertices x,yx,y, possibly equal, let Px,yP_{x,y} be the xx–yy path in SS. Its vertex set is connected in SS, hence in GG. Since SS is a tree, S[V(Px,y)]=Px,yS[V(P_{x,y})]=P_{x,y}: an edge of SS joining two vertices of Px,yP_{x,y} that are not consecutive on Px,yP_{x,y} would close a cycle with a segment of Px,yP_{x,y}. If x≠yx \ne y, then xx and yy are the only vertices of degree one in Px,yP_{x,y}, and if x=yx = y, then V(Px,y)={x}V(P_{x,y}) = \{x\}. So the set V(Px,y)V(P_{x,y}) determines the unordered pair {x,y}\{x,y\}, and distinct pairs give distinct sets. This gives n+(n2)=T(n)n + \binom{n}{2} = T(n) connected sets. The connected sets of PnP_n are its T(n)T(n) intervals, since a set of vertices of PnP_n that is not an interval misses a vertex lying between two of its vertices, and is then disconnected. There are only 2n−12^n - 1 nonempty sets, and all of them are connected in KnK_n. For trees, the lower bound is also part of [23 Theorem 4], where cc is bounded in terms of the number of edges.

Example 2.2. (i) A spider whose legs have lengths ℓ1,…,ℓs\ell_1,\ldots,\ell_s satisfies

c=∏i(ℓi+1)+∑iT(ℓi).c = \prod_i(\ell_i+1) + \sum_i T(\ell_i).

a connected set containing the centre takes an initial segment of each leg, possibly empty, and a connected set avoiding the centre is an interval of one leg. For the star K1,dK_{1,d} this gives 2d+d2^d+d.

(ii) Attach tv≥0t_v \ge0 pendant vertices at each vertex vv of a complete graph KaK_a. A connected set is either a single pendant vertex, or meets the clique in a nonempty set QQ, together with any pendant vertices attached at QQ. Hence c=∏v(1+2tv)−1+∑vtvc = \prod_v(1+2^{t_v})-1+\sum_v t_v. For the paw this gives 3⋅2⋅2−1+1=123\cdot2\cdot2-1+1=12.

(iii) Let Φ\Phi be a disjoint union of stars K1,s1,…,K1,spK_{1,s_1},\ldots,K_{1,s_p} with si≥1s_i \ge1 and at most nn vertices in all, and let Kn−ΦK_n-\Phi be the complete graph on nn vertices with the edges of a copy of Φ\Phi removed. A set UU is disconnected in Kn−ΦK_n-\Phi if and only if U=A∪BU=A\cup B with A,BA,B nonempty and disjoint and all pairs in A×BA\times B edges of Φ\Phi. This complete bipartite subgraph of Φ\Phi is connected, so it lies in one star, and then AA or BB is the centre alone. Hence

c(Kn−Φ)=2n−1−∑i(2si−1).c(K_n-\Phi)=2^n-1-\sum_i(2^{s_i}-1).

For the diamond K4−K1,1K_4-K_{1,1} this gives 14.

(iv) The connected sets of the cycle CnC_n, n≥3n \ge3, are the whole vertex set and the n(n−1)n(n-1) proper cyclic intervals, so c(Cn)=n(n−1)+1c(C_n)=n(n-1)+1.

At most five vertices, and the gap above the path

Lemma 3.1. (a) V1={1}V_1=\{1\}, V2={3}V_2=\{3\}, V3={6,7}V_3=\{6,7\} and V4=[10,15]V_4=[10,15].

(b) Λ2={2,3}\Lambda_2=\{2,3\}, Λ3={3,4,6,7}\Lambda_3=\{3,4,6,7\} and Λ4=[4,8]∪[10,15]\Lambda_4=[4,8]\cup[10,15].

Proof. (a) The connected graphs on at most three vertices are K1K_1, K2K_2, P3P_3 and K3K_3. The six connected graphs on four vertices are the path, the star, the paw, the cycle, the diamond and K4K_4, with c=10,11,12,13,14,15c=10,11,12,13,14,15 by Lemma 2.1 and Example 2.2.

(b) By Lemma 2.1(a), the value of cc on a disconnected graph is the sum of its values on the components. A disconnected graph on four vertices has components with 1+31+3, 2+22+2, 1+1+21+1+2 or 1+1+1+11+1+1+1 vertices, giving {7,8}\{7,8\}, {6}\{6\}, {5}\{5\} and {4}\{4\}. Together with V4V_4 this gives Λ4\Lambda_4. The sets Λ2\Lambda_2 and Λ3\Lambda_3 are found in the same way.

:::

Proposition 3.2 (The gap above the path). Let n≥4n \ge4 and let GG be a connected graph with nn vertices other than the path PnP_n. Then

c(G)≥T(n)+n−3,c(G) \ge T(n)+n-3,

with equality for the spider with legs of lengths $1$, 11 and $n-3.

Proof. Case 1: GG has a spanning tree SS that is not a path. By Lemma 2.1(b), c(G)≥c(S)c(G) \ge c(S), so it suffices to find T(n)+n−3T(n)+n-3 connected sets of $S.

Path sets. By the proof of Lemma 2.1(f), the vertex sets V(Px,y)V(P_{x,y}) of the paths of SS are T(n)T(n) distinct connected sets, and each of them induces a path in SS, so every vertex of S[V(Px,y)]S[V(P_{x,y})] has degree at most 2 there.

Branching sets. A tree whose vertices all have degree at most 2 is a path, so SS has a vertex vv of degree at least 3. Choose three distinct neighbours aa, bb, qq of vv and put Q={v,a,b,q}Q=\{v,a,b,q\}. For each of the n−4n-4 vertices y∉Qy\notin Q, put Qy=Q∪V(Pv,y)Q_y=Q\cup V(P_{v,y}). Let HyH_y be the union of the star with centre vv and leaves aa, bb, qq and the path Pv,yP_{v,y}. It is a connected subgraph of SS with vertex set QyQ_y, so QyQ_y is a connected set, and so is QQ. Moreover S[Qy]=HyS[Q_y]=H_y, because S[Qy]S[Q_y] is a tree and a tree has no connected spanning subgraph other than itself. In S[Q]S[Q] and in S[Qy]S[Q_y] the vertex vv has degree at least 3, so none of these sets is a path set.

Distinctness. The set QQ differs from every QyQ_y, since y∈Qy∖Qy\in Q_y\setminus Q. In HyH_y the vertices outside QQ are the vertices of Pv,yP_{v,y} outside QQ. The edges of the star meet only QQ, so such a vertex has degree 2 in HyH_y if it is an inner vertex of Pv,yP_{v,y}, and degree 1 if it is the end yy. Hence yy is the only vertex of degree one of S[Qy]S[Q_y] outside QQ, and QyQ_y determines yy. So QQ and the sets QyQ_y are n−3n-3 distinct connected sets of SS, none of them a path set, and c(S)≥T(n)+n−3c(S)\ge T(n)+n-3.

Case 2: every spanning tree of GG is a path. Fix one, with vertices v1,…,vnv_1,\ldots,v_n in this order, and call it PnP_n. Since GG is not a path, it has an edge vavbv_av_b that is not an edge of PnP_n, with 1≤a1\le a and a+2≤b≤na+2\le b\le n. By Lemma 2.1(b), c(G)≥c(Pn+vavb)c(G)\ge c(P_n+v_av_b). The connected sets of PnP_n are its T(n)T(n) intervals, and they remain connected in Pn+vavbP_n+v_av_b, so it suffices to count the connected sets of Pn+vavbP_n+v_av_b that are not intervals.

Let UU be such a set. As UU is not an interval, it is the union of at least two maximal intervals contained in UU, and no edge of PnP_n joins two of them. The single extra edge vavbv_av_b can join only two of them, so UU is the union of exactly two maximal intervals, one containing vav_a and the other containing vbv_b. Thus

U={vα,…,vx}∪{vy,…,vβ}with1≤α≤a≤x,x+2≤y≤b≤β≤n.U=\{v_\alpha,\ldots,v_x\}\cup\{v_y,\ldots,v_\beta\}\quad\text{with}\quad1\le\alpha\le a\le x,\quad x+2\le y\le b\le\beta\le n.

Conversely, each such set is connected in Pn+vavbP_n+v_av_b and is not an interval. The quadruple (α,x,y,β)(\alpha,x,y,\beta) is determined by UU: the indices α\alpha and β\beta are the least and the greatest index in UU, the index x+1x+1 is the least index above α\alpha missing from UU, and yy is the least index above xx in UU. So the sets UU correspond bijectively to these quadruples. Put t=b−a−1t=b-a-1; the conditions 1≤a1\le a and a+2≤b≤na+2\le b\le n give 1≤t≤n−21\le t\le n-2. There are aa choices of α\alpha and n+1−bn+1-b choices of β\beta. For x=a,…,b−2x=a,\ldots,b-2, there are b−x−1b-x-1 choices of yy, so there are ∑s=1ts=T(t)\sum_{s=1}^{t}s=T(t) choices of (x,y)(x,y). Hence the chord adds exactly a(n+1−b)T(t)a(n+1-b)T(t) connected sets. The factors satisfy a≥1a\ge1, n+1−b≥1n+1-b\ge1 and a+(n+1−b)=n−ta+(n+1-b)=n-t. Since pq≥p+q−1pq\ge p+q-1 for positive integers p,qp,q, and T(t)≥tT(t)\ge t,

a(n+1−b)T(t)≥(n−t−1)t≥n−2(1≤t≤n−2).a(n+1-b)T(t)\ge(n-t-1)t\ge n-2\qquad(1\le t\le n-2).

where the last inequality holds because (n−t−1)t(n-t-1)t is a concave function of tt that equals n−2n-2 at t=1t=1 and at t=n−2t=n-2. Hence c(G)≥c(Pn+vavb)≥T(n)+n−2c(G)\ge c(P_n+v_av_b)\ge T(n)+n-2.

Finally, by Example 2.2(i), the spider with legs 1,1,n−31,1,n-3 has c=2⋅2⋅(n−2)+T(1)+T(1)+T(n−3)=n2+3n−62=T(n)+n−3c=2\cdot2\cdot(n-2)+T(1)+T(1)+T(n-3)=\frac{n^2+3n-6}{2}=T(n)+n-3. □

Section 8 sketches a second proof of Proposition 3.2, by induction on connected sets, which is the one formalized in Lean.

Corollary 3.3. For n≥5n\ge5, none of the n−4n-4 integers T(n)+1,…,T(n)+n−4T(n)+1,\ldots,T(n)+n-4 lies in VnV_n. In particular 16=T(5)+1∉V516=T(5)+1\notin V_5, and 1616 is not a value of cc on any connected graph.

Proof. The first assertion is Proposition 3.2, since c(Pn)=T(n)c(P_n)=T(n). A connected graph with c=16c=16 has nn vertices with T(n)≤16≤2n−1T(n)\le16\le2^n-1, by Lemma 2.1(f). This forces n=5n=5. □

Proposition 3.4. V5={15}∪[17,24]∪[26,31]V_5=\{15\}\cup[17,24]\cup[26,31].

Proof. The inclusion ⊇\supseteq holds because c(P5)=15c(P_5)=15 and V5⊇[17,24]∪[26,31]V_5 \supseteq[17,24]\cup[26,31] by Lemma 4.4(b) below, whose proof does not use this proposition. For ⊆\subseteq, let GG be connected with five vertices. By Lemma 2.1(f), c(G)∈[15,31]c(G)\in[15,31], and c(G)≠16c(G)\ne16 by Corollary 3.3. It remains to show that c(G)≠25c(G)\ne25. We distinguish cases by the maximum degree Δ\Delta of GG; the table at the end of the proof summarizes them.

If Δ=4\Delta=4, then GG is the cone over a graph HH with four vertices, and c(G)=16+c(H)c(G)=16+c(H) by Lemma 2.1(d). Since 9∉Λ49\notin\Lambda_4 (Lemma 3.1), c(G)≠25c(G)\ne25.

If Δ=3\Delta=3, let ww be a vertex of degree 3, let uu be the vertex not adjacent to ww, and let K=G−wK=G-w. The degree dd of uu in KK is at least 1, since GG is connected, and at most 3. By Lemma 2.1(e) with ∣K∣=4|K|=4, c(G)=c(K)+16−23−dc(G)=c(K)+16-2^{3-d}. If c(G)=25c(G)=25, then c(K)=9+23−dc(K)=9+2^{3-d}, that is, c(K)=13c(K)=13, 11 or 10 for d=1d=1, 2 or 3. A disconnected graph on four vertices has c≤8c\le8 (Lemma 3.1(b)), so KK is connected. The six connected graphs on four vertices have the distinct values 10,…,1510,\ldots,15 (proof of Lemma 3.1), so KK is the cycle C4C_4, the star K1,3K_{1,3} or the path P4P_4, respectively. But uu has degree dd in KK, and C4C_4 has no vertex of degree 1, K1,3K_{1,3} has no vertex of degree 2, and P4P_4 has no vertex of degree 3. So c(G)≠25c(G)\ne25.

If Δ≤2\Delta\le2, then GG is P5P_5 or C5C_5, with c=15c=15 or 21. In summary, where for Δ=3\Delta=3 the vertex ww has degree 3, K=G−wK=G-w, and dd is the degree in KK of the vertex uu not adjacent to $w:

casec(G)c(G)c(G)=25c(G)=25 forcesimpossible because
Δ=4\Delta=416+c(H)16+c(H), ∣H∣=4|H|=4c(H)=9c(H)=99∉Λ49\notin\Lambda_4
Δ=3\Delta=3, d=1d=1c(K)+12c(K)+12c(K)=13c(K)=13, so K=C4K=C_4C4C_4 has no vertex of degree 1
Δ=3\Delta=3, d=2d=2c(K)+14c(K)+14c(K)=11c(K)=11, so K=K1,3K=K_{1,3}K1,3K_{1,3} has no vertex of degree 2
Δ=3\Delta=3, d=3d=3c(K)+15c(K)+15c(K)=10c(K)=10, so K=P4K=P_4P4P_4 has no vertex of degree 3
Δ≤2\Delta\le215 or 21—GG is P5P_5 or C5C_5

Table 8.

The case analysis also gives a second proof that 16∉V516\notin V_5: a cone has c≥16+4c\ge16+4, and in the case Δ=3\Delta=3, c(G)=16c(G)=16 would force c(K)=23−d≤4c(K)=2^{3-d}\le4, hence KK edgeless, contradicting d≥1d\ge1.

Corollary 3.5. The values of cc on connected graphs that are at most 16 are 1, 3, 6, 7 and the integers from 10 to 15.

Proof. Graphs with at least six vertices have c≥21c\ge21, and graphs with five vertices have c∈{15}∪[17,31]c\in\{15\}\cup[17,31], by Lemma 2.1(f) and Corollary 3.3. Apply Lemma 3.1. □\square

Near-cones and the dyadic intervals

The construction works with all graphs, not only connected ones, because of the cone. If HH has m−1m-1 vertices and c(H)=xc(H)=x, then the cone over HH is a connected graph with mm vertices and c=2m−1+xc=2^{m-1}+x. So the natural auxiliary object is the set Λm−1\Lambda_{m-1} of values of cc on all graphs with m−1m-1 vertices. Cones alone do not suffice. Every graph on m−1m-1 vertices has at least m−1m-1 connected sets, its singletons, so cones give only values 2m−1+x2^{m-1}+x with x≥m−1x\ge m-1. They miss the m−1m-1 values from 2m−12^{m-1} to 2m−1+m−22^{m-1}+m-2, at the bottom of the interval [2m−1,2m−1][2^{m-1},2^m-1]. Near-cones fill this gap.

Throughout this section we keep the two families of sets apart: VmV_m consists of values on connected graphs with mm vertices, the sets we are after, and Λm⊇Vm\Lambda_m\supseteq V_m of values on all graphs with mm vertices, the auxiliary sets. The rules (C) and (N) below produce elements of VmV_m from elements of Λm−1\Lambda_{m-1} and Λr\Lambda_r, and the rule (U) produces elements of Λm\Lambda_m.

Near-cones

Near-cones

Definition 4.1. Let d≥1d\ge1, r≥0r\ge0, and let RR be a graph with rr vertices. The near-cone N(d,R)N(d,R) is obtained as follows. Take a star K1,dK_{1,d} with centre uu and leaves ℓ1,…,ℓd\ell_1,\ldots,\ell_d and a disjoint copy of RR, and add a vertex ww adjacent to every vertex except uu (Figure 1). Thus N(d,R)N(d,R) is the cone with apex ww over K1,d⊔RK_{1,d}\mathbin{\sqcup}R, with the edge wuwu removed. It is connected and has m=d+r+2m=d+r+2 vertices.

Figure 1. The near-cone N(d,R)N(d,R). The vertex ww is joined to ℓ1,…,ℓd\ell_1,\ldots,\ell_d and to every vertex of RR; the centre uu of the star is joined only to the leaves ℓt\ell_t.

For example, N(1,K1)N(1,K_1) is the path P4P_4, and N(2,K0)N(2,K_0), where K0K_0 is the graph with no vertices, is the cycle C4C_4.

Lemma 4.2. Let m≥1m\ge1.

(U) If x∈Vax\in V_a and y∈Λm−ay\in\Lambda_{m-a} with 1≤a≤m1\le a\le m, then x+y∈Λmx+y\in\Lambda_m. In particular 1+Λm−1⊆Λm1+\Lambda_{m-1}\subseteq\Lambda_m.

(C) 2m−1+Λm−1⊆Vm2^{m-1}+\Lambda_{m-1}\subseteq V_m.

(N) If d≥1d\ge1, r≥0r\ge0 and d+r+2=md+r+2=m, then 2m−1−2r+2d+d+Λr⊆Vm2^{m-1}-2^r+2^d+d+\Lambda_r\subseteq V_m. More precisely,

c(N(d,R))=2m−1−2r+2d+d+c(R).c(N(d,R))=2^{m-1}-2^r+2^d+d+c(R).

Proof. (U) is Lemma 2.1(a); for the second statement add an isolated vertex. (C) is Lemma 2.1(d).

For (N), let G′G' be the cone with apex ww over K1,d⊔RK_{1,d}\mathbin{\sqcup}R. By Lemma 2.1(a),(d) and Example 2.2(i), c(G′)=2m−1+2d+d+c(R)c(G')=2^{m-1}+2^d+d+c(R). Now remove the edge wuwu to obtain G=N(d,R)G=N(d,R). Sets avoiding ww or uu are connected in GG exactly when they are connected in G′G'. A set {w}∪U\{w\}\cup U with u∈Uu\in U is connected in G′G'. It is disconnected in GG exactly when UU contains no leaf ℓt\ell_t, since uu is adjacent only to the leaves and every other vertex of UU is adjacent to ww. There are 2r2^r such sets UU: they contain uu, no leaf, and an arbitrary set of vertices of RR. Hence c(G)=c(G′)−2rc(G)=c(G')-2^r. This is also the case K=K1,d⊔RK=K_{1,d}\mathbin{\sqcup}R of Lemma 2.1(e). □

Seven sporadic graphs

Lemma 4.3. The seven graphs of Table 1 and Figure 2 have the stated values. Hence 19∈V519\in V_5; 25,32,35,57∈V625,32,35,57\in V_6; and 67,90∈V767,90\in V_7.

Figure 2. The seven sporadic graphs of Table 1, with their values of cc and their numbers mm of vertices. In the graph with c=57c = 57, the hexagon is drawn without four of its sides; these form the two removed paths with three vertices each.

Proof. The values 19, 25, 32 and 57 follow from Example 2.2; for 57, Φ\Phi consists of two copies of K1,2K_{1,2}.

For c=35c=35: a connected set is either one of the two pendant vertices, or a connected set QQ of the diamond K4−abK_4-ab together with any of the pendant vertices attached at QQ. The connected sets of K4−abK_4-ab are all nonempty subsets of its vertex set other than {a,b}\{a,b\}. Summing 2∣Q∩{a,z}∣2^{|Q\cap\{a,z\}|} over all nonempty QQ gives 3⋅3⋅2⋅2−1=353\cdot3\cdot2\cdot2-1=35. Removing Q={a,b}Q=\{a,b\} subtracts 2, and the pendant vertices add 2, giving 35.

For c=67c=67: glue K2,3K_{2,3} and the star K1,2K_{1,2} at xx (Lemma 2.1(c)). Let {p,q}\{p,q\} be the smaller side and {x,y,z}\{x,y,z\} the larger one. The connected sets of K2,3K_{2,3} containing xx are {x}\{x\} and the sets {x}∪S∪S′\{x\}\cup S\cup S' with ∅≠S⊆{p,q}\varnothing\ne S\subseteq\{p,q\} and S′⊆{y,z}S'\subseteq\{y,z\}; there are 1+3⋅4=131+3\cdot4=13. Also K2,3−x=C4K_{2,3}-x=C_4 has c=13c=13, and the star contributes cx=4c_x=4 and c(K1,2−x)=2c(K_{1,2}-x)=2.

For c=90c=90: let H=K6−va−vbH=K_6-va-vb and glue HH with an edge at vv. In HH, the sets containing vv that are disconnected are {v,a}\{v,a\}, {v,b}\{v,b\} and {v,a,b}\{v,a,b\}, so cv(H)=32−3=29c_v(H)=32-3=29; and H−v=K5H-v=K_5 has c=31c=31. The edge contributes cv=2c_v=2 and 1. □

ccmmgraphcount
195triangle xyzxyz with one pendant vertex at xx and one at yyEx. 2.2(ii): 3⋅3⋅2−1+23 \cdot3 \cdot2 - 1 + 2
326triangle xyzxyz with two pendant vertices at xx and one at yyEx. 2.2(ii): 5⋅3⋅2−1+35 \cdot3 \cdot2 - 1 + 3
356diamond K4−abK_4 - ab, with one pendant vertex at aa and one at a vertex zz of degree 3see the proof
576K6K_6 minus two disjoint paths with three vertices eachEx. 2.2(iii): 63−3−363 - 3 - 3
677K2,3K_{2,3} with two pendant vertices at a vertex xx of the larger sideLem. 2.1(c): 13⋅4+13+213 \cdot4 + 13 + 2
907K6K_6 minus two edges vava, vbvb, with a pendant vertex at vvLem. 2.1(c): 29⋅2+31+129 \cdot2 + 31 + 1
256spider with legs of lengths 1, 2, 2Ex. 2.2(i): 2⋅3⋅3+1+3+32 \cdot3 \cdot3 + 1 + 3 + 3

Table 1. The sporadic graphs, drawn in Figure 2. The six graphs above the line fill the gaps left by the rules (U), (C) and (N) in Lemma 4.4 (Remark 4.5). The spider below the line realizes 25 on six vertices.

The base

Lemma 4.4. (a) Λ5⊇[5,24]∪[26,31]\Lambda_5 \supseteq[5,24] \cup[26,31], Λ6⊇[6,25]∪[27,63]\Lambda_6 \supseteq[6,25] \cup[27,63] and Λ7⊇[7,127]\Lambda_7 \supseteq[7,127].

(b) V5⊇[17,24]∪[26,31]V_5 \supseteq[17,24] \cup[26,31], V6⊇[32,63]V_6 \supseteq[32,63] and V7⊇[64,127]V_7 \supseteq[64,127].

Proof. We apply the rules of Lemma 4.2 one order at a time, starting from Lemma 3.1 and Λ0={0}\Lambda_0 = \{0\}. At each order we use only the inclusions already established at smaller orders, and we record only inclusions. We give the order m=5m = 5 in full; Table 2 lists every order, including m≤4m \le4, where the rules reproduce Lemma 3.1.

mmcones (C)near-cones (N), with (d,r)(d,r)sporadicVm⊇V_m \supseteqΛm⊇\Lambda_m \supseteq by (U) and VmV_m
22+{1}={3}2+\{1\}=\{3\}——{3}\{3\}1+{1}1+\{1\}; so {2,3}\{2,3\}
34+{2,3}={6,7}4+\{2,3\}=\{6,7\}——{6,7}\{6,7\}2+{3}2+\{3\}; so {3,4,6,7}\{3,4,6,7\}
48+{3,4,6,7}={11,12,14,15}8+\{3,4,6,7\}=\{11,12,14,15\}(1,1): 10; (2,0): 13(1,1):\ 10;\ (2,0):\ 13—[10,15][10,15]1+{3,4,6,7}, 3+31+\{3,4,6,7\},\ 3+3; so [4,8]∪[10,15][4,8]\cup[10,15]
516+Λ4: [20,24]∪[26,31]16+\Lambda_4:\ [20,24]\cup[26,31](1,2): 15+{2,3}={17,18}(1,2):\ 15+\{2,3\}=\{17,18\}1919[17,24]∪[26,31][17,24]\cup[26,31][5,9]∪[11,16], 7+3[5,9]\cup[11,16],\ 7+3; so [5,24]∪[26,31][5,24]\cup[26,31]
632+Λ5: [37,56]∪[58,63]32+\Lambda_5:\ [37,56]\cup[58,63](1,3): 27+{3,4,6,7}={30,31,33,34}; (2,2): 34+{2,3}={36,37}(1,3):\ 27+\{3,4,6,7\}=\{30,31,33,34\};\ (2,2):\ 34+\{2,3\}=\{36,37\}32,35,5732,35,57[32,63][32,63][6,25]∪[27,32][6,25]\cup[27,32]; so [6,25]∪[27,63][6,25]\cup[27,63]
764+Λ6: [70,89]∪[91,127]64+\Lambda_6:\ [70,89]\cup[91,127](1,4): 51+[13,15]=[64,66]; (2,3): 62+{6,7}={68,69}(1,4):\ 51+[13,15]=[64,66];\ (2,3):\ 62+\{6,7\}=\{68,69\}67,9067,90[64,127][64,127][7,26]∪[28,64], 24+3[7,26]\cup[28,64],\ 24+3; so [7,127][7,127]

Table 2. The steps of the proof of Lemma 4.4. In the cone and near-cone columns, Λr\Lambda_r stands for the part of Λr\Lambda_r established in the previous rows. The last column lists 1+Λm−11+\Lambda_{m-1} and the sums x+yx+y with x∈Vax\in V_a, y∈Λm−ay\in\Lambda_{m-a} that are needed, for instance 3+3∈V2+Λ23+3\in V_2+\Lambda_2 and 24+3∈V5+Λ224+3\in V_5+\Lambda_2.

For m=5m = 5, the rule (C) applied to Λ4=[4,8]∪[10,15]\Lambda_4 = [4,8] \cup[10,15] gives 16+Λ4=[20,24]∪[26,31]16 + \Lambda_4 = [20,24] \cup[26,31]. The rule (N) with (d,r)=(1,2)(d,r) = (1,2) gives 24−22+21+1+Λ2=15+{2,3}={17,18}2^4 - 2^2 + 2^1 + 1 + \Lambda_2 = 15 + \{2,3\} = \{17,18\}. The sporadic graph with c=19c = 19 (Lemma 4.3) supplies the remaining value, so V5⊇[17,24]∪[26,31]V_5 \supseteq[17,24] \cup[26,31]. By (U), 1+Λ4=[5,9]∪[11,16]1 + \Lambda_4 = [5,9] \cup[11,16] and 7+3=10∈V3+Λ27 + 3 = 10 \in V_3 + \Lambda_2 lie in Λ5\Lambda_5. Together with V5V_5, this gives Λ5⊇[5,24]∪[26,31]\Lambda_5 \supseteq[5,24] \cup[26,31]. □ Remark 4.5. Two statements must be distinguished here: a value may fail to be produced by the rules (C) and (N), and a value may fail to be realized by any graph. Lemma 4.4 is sharp in the second sense. Indeed 25∉Λ525\notin\Lambda_5, because 25∉V525\notin V_5 (Proposition 3.4) and a disconnected graph with five vertices has c≤15+1c\leq15+1. Also 26∉Λ626\notin\Lambda_6, by the computation of § 9. In the first sense, even with every sporadic graph of smaller order available, the rules (C) and (N) produce on five vertices every value in [17,31][17,31] except 19 and 25, on six vertices every value in [32,63][32,63] except 32, 35 and 57, and on seven vertices every value in [64,127][64,127] except 67 and 90 (§ 9). All these values except 25 do lie in VmV_m, and the six sporadic graphs above the line in Table 1 realize them.

The induction

Theorem 4.6. For every m≥8m\geq8:

(Gm)Vm⊇[2m−1,2m−1];(G_m)\quad V_m\supseteq[2^{m-1},2^m-1];
(Hm)Λm⊇[m,2m−1].(H_m)\quad\Lambda_m\supseteq[m,2^m-1].

The two assertions play different roles. The assertion (Hm)(H_m) provides auxiliary graphs, possibly disconnected, with every count from mm to 2m−12^m-1. The assertion (Gm)(G_m) provides connected graphs for the upper half of the range. We prove (Gm)(G_m) from earlier (H)-statements, and then obtain (Hm)(H_m) by combining (Gm)(G_m) with the isolated-vertex rule (U). In the proof of (Gm)(G_m) the interval splits as

[2m−1,2m−1]=[2m−1,2m−1+m−2]⏟near-cones∪[2m−1+m−1,2m−1]⏟cones.[2^{m-1},2^m-1]=\underbrace{[2^{m-1},2^{m-1}+m-2]}_{\text{near-cones}}\cup\underbrace{[2^{m-1}+m-1,2^m-1]}_{\text{cones}}.

Proof. We use induction on m≥8m\geq8. The induction hypothesis is (Hm′)(H_{m'}) for every m′m' with 7≤m′<m7\leq m'<m; for m′=7m'=7 this is Lemma 4.4(a). The statements (Gm′)(G_{m'}) are not used.

Proof of (Gm)(G_m). By (C) and (Hm−1)(H_{m-1}), Vm⊇2m−1+[m−1,2m−1−1]=[2m−1+m−1,2m−1]V_m\supseteq2^{m-1}+[m-1,2^{m-1}-1]=[2^{m-1}+m-1,2^m-1]. It remains to realize 2m−1+j2^{m-1}+j for 0≤j≤m−20\leq j\leq m-2. By (N), a pair (d,r)(d,r) realizes 2m−1+j2^{m-1}+j if it satisfies

(P1) d≥1d\geq1, r≥0r\geq0 and d+r+2=md+r+2=m;

(P2) xj∈Λrx_j\in\Lambda_r, where

xj:=2r−2d−d+j.(2)x_j:=2^r-2^d-d+j. \tag*{(2)}

Indeed, if RR is a graph with rr vertices and c(R)=xjc(R)=x_j, then c(N(d,R))=2m−1−2r+2d+d+xj=2m−1+jc(N(d,R))=2^{m-1}-2^r+2^d+d+x_j=2^{m-1}+j. When r≥7r\ge7 and r<mr<m, the hypothesis (Hr)(\mathrm{H}_r) gives [r,2r−1]⊆Λr[r,2^r-1]\subseteq\Lambda_r. Then (P2) holds for every j∈[0,m−2]j\in[0,m-2] as soon as it holds at the two endpoints, that is, as soon as

(P3) xm−2≤2r−1x_{m-2}\le2^r-1, which is equivalent to 2d+d≥m−12^d+d\ge m-1, and

(P4) x0≥rx_0\ge r, which is 2r−2d−d≥r2^r-2^d-d\ge r.

Condition (P3) asks for dd large and (P4) for dd small compared with rr. For m≥12m\ge12 we take the least dd satisfying (P3). This keeps dd close to log⁡2m\log_2m, so that r=m−2−dr=m-2-d is large. For 8≤m≤118\le m\le11 this choice leaves r≤6r\le6, where (Hr)(\mathrm{H}_r) is not available, and we check (P2) directly from Lemmas 3.1(b) and 4.4(a), with the parameters of Table 3.

mm(d,r)(d,r)jjxj=2r−2d−d+jx_j=2^r-2^d-d+jxj∈Λrx_j\in\Lambda_r by
8(2,4)0,…,50,\ldots,510,…,1510,\ldots,15Λ4⊇[10,15]\Lambda_4\supseteq[10,15]Lemma 3.1(b)
8(3,3)633∈Λ33\in\Lambda_3Lemma 3.1(b)
9(2,5)0,…,50,\ldots,526,…,3126,\ldots,31Λ5⊇[26,31]\Lambda_5\supseteq[26,31]Lemma 4.4(a)
9(3,4)6,76,711,1211,12Λ4⊇[10,15]\Lambda_4\supseteq[10,15]Lemma 3.1(b)
10(3,5)0,…,80,\ldots,8, j≠4j\ne421,…,2921,\ldots,29, ≠25\ne25Λ5⊇[5,24]∪[26,31]\Lambda_5\supseteq[5,24]\cup[26,31]Lemma 4.4(a)
10(2,6)462Λ6⊇[27,63]\Lambda_6\supseteq[27,63]Lemma 4.4(a)
11(3,6)0,…,90,\ldots,953,…,6253,\ldots,62Λ6⊇[27,63]\Lambda_6\supseteq[27,63]Lemma 4.4(a)

Table 3. The parameters of the near-cones in the proof of Theorem 4.6 for 8≤m≤118\le m\le11, covering j=0,…,m−2j=0,\ldots,m-2. For m=10m=10 the choice (3,5)(3,5) fails only at j=4j=4, since 25∉Λ525\notin\Lambda_5. The graphs RR with c(R)=xjc(R)=x_j are those given by the proofs of Lemmas 3.1 and 4.4.

Now let m≥12m\ge12, let dd be the least integer d≥1d\ge1 with 2d+d≥m−12^d+d\ge m-1, and put r=m−2−dr=m-2-d, so that (P1) and (P3) hold. Then d≥3d\ge3, since 22+2<112^2+2<11. If d=3d=3, then m=12m=12 and r=7r=7. If d≥4d\ge4, minimality of dd gives 2d−1+d−1<m−12^{d-1}+d-1<m-1, so r=m−2−d≥2d−1−1≥7r=m-2-d\ge2^{d-1}-1\ge7 and r≥d+1r\ge d+1. In both cases 7≤r≤m−37\le r\le m-3 and r≥d+1r\ge d+1. For (P4),

x0=2r−2d−d≥2r−2r−1−(r−1)=2r−1−r+1≥r,x_0=2^r-2^d-d\ge2^r-2^{r-1}-(r-1)=2^{r-1}-r+1\ge r,

because d≤r−1d\le r-1 and 2r−1≥2r−12^{r-1}\ge2r-1 for r≥4r\ge4. Hence, for every jj with 0≤j≤m−20\le j\le m-2,

r≤x0≤xj≤xm−2=2r−2d−d+m−2≤2r−1,r\le x_0\le x_j\le x_{m-2}=2^r-2^d-d+m-2\le2^r-1,

and xj∈[r,2r−1]⊆Λrx_j\in[r,2^r-1]\subseteq\Lambda_r by the induction hypothesis (Hr)(\mathrm{H}_r), which applies since 7≤r<m7\le r<m.

Proof of (Hm)(\mathrm{H}_m). By (U) and (Hm−1)(\mathrm{H}_{m-1}), Λm⊇1+[m−1,2m−1−1]=[m,2m−1]\Lambda_m\supseteq1+[m-1,2^{m-1}-1]=[m,2^{m-1}]. By (Gm)(\mathrm{G}_m), Λm⊇Vm⊇[2m−1,2m−1]\Lambda_m\supseteq V_m\supseteq[2^{m-1},2^m-1]. □\square

Example 4.7. Take k=128=27k=128=2^7. Then m=8m=8 and j=0j=0, and the proof uses (d,r)=(2,4)(d,r)=(2,4), with x0=24−22−2=10=c(P4)x_0=2^4-2^2-2=10=c(P_4). So the near-cone N(2,P4)N(2,P_4), formed by the path P4P_4 and the vertices u,ℓ1,ℓ2,wu,\ell_1,\ell_2,w, is a connected graph with 8 vertices and

c(N(2,P4))=27−24+22+2+10=128.c(N(2,P_4))=2^7-2^4+2^2+2+10=128.

Seven vertices are not enough, since then c≤27−1c\le2^7-1.

Proofs of the main theorems

Proof of Theorem 1.3. (a) For m=6,7m=6,7 this is Lemma 4.4(b), and for m≥8m\ge8 it is Theorem 4.6. (b) For m=7m=7 this is Lemma 4.4(a), and for m≥8m\ge8 it is Theorem 4.6. □\square

Proof of Theorem 1.2. Let k∉{2,4,5,8,9,16}k\notin\{2,4,5,8,9,16\} and put m=⌊log⁡2k⌋+1m=\lfloor\log_2 k\rfloor+1, so that 2m−1≤k≤2m−12^{m-1}\le k\le2^m-1. A connected graph with fewer than mm vertices has c≤2m−1−1<kc\le2^{m-1}-1<k, by Lemma 2.1(f). It remains to show that k∈Vmk\in V_m when k≠25k\ne25, and that 25∈V625\in V_6. If k≤15k\le15, then k∈{1,3,6,7}∪[10,15]k\in\{1,3,6,7\}\cup[10,15] and k∈Vmk \in V_m by Lemma 3.1. If 17≤k≤3117 \le k \le31 and k≠25k \ne25, then m=5m=5 and k∈V5k \in V_5 by Proposition 3.4. If k≥32k \ge32, then m≥6m \ge6 and k∈Vmk \in V_m by Theorem 1.3(a). Finally 25∉V525 \notin V_5 by Proposition 3.4, and the spider with legs 1,2,21,2,2 shows 25∈V625 \in V_6 (Lemma 4.3). Table 4 lists the witnesses for the values below 3232, where the order is given by the finite base rather than by the induction. □

kkleast ordera connected graph with c=kc=k of least order
1;31;31;21;2K1;K2K_1; K_2
6;76;733P3;K3P_3; K_3
10,11,12,13,14,1510,11,12,13,14,1544P4P_4, K1,3K_{1,3}, paw, C4C_4, diamond, K4K_4 (Lemma 3.1)
[17,24]∪[26,31][17,24] \cup[26,31]55Table 2, row m=5m=5, and Appendix A; 1919 is sporadic
252566the spider with legs 1,2,21,2,2 (Lemma 4.3)
k≥32k \ge32⌊log⁡2k⌋+1\lfloor\log_2 k \rfloor+1Lemma 4.4(b) for m=6,7m=6,7; Theorem 4.6 and Remark 5.1 for m≥8m \ge8

Table 4. Least orders and witnesses (Theorem 1.2). For each k≤31k \le31 the least order is ⌊log⁡2k⌋+1\lfloor\log_2 k \rfloor+1, except for k=25k=25.

Proof of Theorem 1.1. If k=c(G)k=c(G) for a connected graph GG, then k∉{2,4,5,8,9,16}k \notin\{2,4,5,8,9,16\} by Corollary 3.5. Conversely, every positive integer outside this set is a value of cc on a connected graph by Theorem 1.2. □

Remark 5.1 (An algorithm). The proofs are constructive. For m≥7m \ge7 and v∈[m,2m−1]v \in[m,2^m-1], the following recursive procedure returns a graph Re⁡(m,v)\operatorname{Re}(m,v) with mm vertices and c=vc=v, which is connected when v≥2m−1v \ge2^{m-1}.

Input: integers m≥7m \ge7 and v∈[m,2m−1]v \in[m,2^m-1], in binary. Output: the edge list of Re⁡(m,v)\operatorname{Re}(m,v) on the vertices 0,…,m−10,\ldots,m-1.

  1. If m=7m=7, return the graph given by the proof of Lemma 4.4, from a fixed table.

  2. If v<2m−1v<2^{m-1}, return Re⁡(m−1,v−1)\operatorname{Re}(m-1,v-1) together with an isolated vertex.

  3. If v≥2m−1+m−1v \ge2^{m-1}+m-1, return the cone over Re⁡(m−1,v−2m−1)\operatorname{Re}(m-1,v-2^{m-1}).

  4. Otherwise put j=v−2m−1j=v-2^{m-1}, choose (d,r)(d,r) as in the proof of Theorem 4.6 (Table 3 for 8≤m≤118 \le m \le11, the least dd with 2d+d≥m−12^d+d \ge m-1 for m≥12m \ge12), and return N(d,R)N(d,R). Here R=Re⁡(r,xj)R=\operatorname{Re}(r,x_j) if r≥7r \ge7, and RR is the graph given by the proof of Lemma 3.1 or Lemma 4.4, from a fixed table, if r≤6r \le6.

The arguments of the recursive calls are admissible: in (2), v−1∈[m−1,2m−1−1]v-1 \in[m-1,2^{m-1}-1]; in (3), v−2m−1∈[m−1,2m−1−1]v-2^{m-1} \in[m-1,2^{m-1}-1]; and in (4), xj∈[r,2r−1]x_j \in[r,2^r-1] by the proof of Theorem 4.6. Each call makes at most one recursive call, with fewer vertices, so there are at most m−6m-6 calls. We count bit operations. Apart from its recursive call, a call compares and subtracts integers of at most m+1m+1 bits, finds dd by at most log⁡2m+1\log_2 m+1 trials on integers of O(log⁡m)O(\log m) bits, and computes xjx_j, using O(m)O(m) bit operations in all. It also adds at most 2m2m edges: none in (2), m−1m-1 in (3), and 2d+r=m−2+d2d+r=m-2+d in (4). The graph returned by the recursive call keeps its vertices 0,…,m′−10,\ldots,m'-1, and the new vertices receive the next labels, so nothing is relabelled. With vertex labels of O(log⁡m)O(\log m) bits, the new edges take O(mlog⁡m)O(m\log m) bits to write. The tables used in (1) and (4) have constant size. Hence Re⁡(m,v)\operatorname{Re}(m,v) is computed with O(m2log⁡m)O(m^2\log m) bit operations, and its output, a graph with at most (m2)\binom{m}{2} edges, has O(m2log⁡m)O(m^2\log m) bits. For k≥64k \ge64, the graph Re⁡(m,k)\operatorname{Re}(m,k), with m=⌈log⁡2k⌉+1≥7m=\lceil\log_2 k\rceil+1 \ge7, is connected, has the least possible number of vertices, and is found with O(log⁡2k⋅log⁡log⁡k)O(\log^2 k\cdot\log\log k) bit operations, in particular in time polynomial in log⁡k\log k. For 32≤k≤6332 \le k \le63 the procedure does not apply, since m=6m=6; a connected graph with six vertices and c=kc=k is given by the proof of Lemma 4.4(b). The procedure cannot simply be extended to m=6m=6, because 26∉Λ626 \notin\Lambda_6. For example, c=10100c=10^{100} is realized on 333333 vertices. § 9 reports a check of this procedure.

Values on a fixed number of vertices

Theorem 1.3 describes the upper half [2n−1,2n−1][2^{n-1},2^n-1] of the range (1). The lower half behaves less regularly. Table 5 gives VnV_n for n≤8n\le8. For n≤5n\le5 the table follows from Lemma 3.1 and Proposition 3.4; for n=6,7,8n=6,7,8 it comes from the computer census of § 9, which confirms [7 Remark 3.20].

nnT(n)T(n)2n−12^n-1integers in [T(n),2n−1][T(n),2^n-1] not in VnV_n
111—
233—
367—
41015—
5153116, 25
6216322, 23, 26
72812729, 30, 31, 35
83625537, 38, 39, 40, 43, 50, 55

Table 5. The sets VnV_n for n≤8n\le8. For n≥5n\ge5, the first n−4n-4 missing values are T(n)+1,…,T(n)+n−4T(n)+1,\ldots,T(n)+n-4 (Corollary 3.3).

Proposition 6.1. Let n≥6n\ge6. Then T(n)∈VnT(n)\in V_n and T(n)+n−3∈VnT(n)+n-3\in V_n, none of the n−4n-4 integers T(n)+1,…,T(n)+n−4T(n)+1,\ldots,T(n)+n-4 lies in VnV_n, and every integer in [2n−1,2n−1][2^{n-1},2^n-1] lies in VnV_n. In particular, at least n−4n-4 integers of [T(n),2n−1][T(n),2^n-1] are not values of cc on connected graphs with nn vertices, and all of them are smaller than 2n−12^{n-1}.

Proof. Combine Proposition 3.2, Corollary 3.3 and Theorem 1.3(a). □

So the number of missing values in [T(n),2n−1][T(n),2^n-1] grows at least linearly. For 5≤n≤85\le n\le8 the missing values are the gap above the path together with one or three further values.

Question 6.2. Determine VnV_n for all nn. In particular, is the number of integers in [T(n),2n−1]∖Vn[T(n),2^n-1]\setminus V_n bounded by a linear function of nn?

Related counts

Subtrees

For a tree TT, c(T)c(T) is the number of subtrees of TT, and Czabarka, Székely and Wagner [8] showed that every positive integer outside the set

ET={2,4,5,7,8,9,12,13,14,16,18,19,22,23,26,27,29,31,33,35,38,39,42,43,46,50,52,54,60,65,68,72,77,89}E_T=\{2,4,5,7,8,9,12,13,14,16,18,19,22,23,26,27,29,31,33,35,38,39,42,43,46,50,52,54,60,65,68,72,77,89\}

of 34 exceptions is the number of subtrees of some tree. Thus allowing cycles reduces the 34 exceptions for trees to the six exceptions of Theorem 1.1.

Remark 7.1 (A computer-assisted route). The theorem of [8] gives a second proof of Theorem 1.1. Every positive integer outside ETE_T is a value of cc on a tree. The elements of ETE_T other than 2, 4, 5, 8, 9, 16 are values of cc on connected graphs with at most seven vertices, by Lemma 3.1 and Appendix A. With Corollary 3.5, this gives Theorem 1.1. This route relies on the computer-assisted parts of [8] and on a census of small graphs, and it gives no information on the number of vertices.

All connected subgraphs

A connected subgraph of GG is a connected graph (V′,E′)(V',E') with ∅≠V′⊆V(G)\varnothing\ne V' \subseteq V(G) and E′⊆E(G[V′])E' \subseteq E(G[V']). Let F(G)F(G) be the number of connected subgraphs of GG; Pandey and Patra [19] call it the subgraph index and study its extremal values. Let L(G)L(G) denote the line graph of GG.

Lemma 7.2. Let GG be a graph with nn vertices.

(a) F(G)=n+c(L(G))F(G) = n + c(L(G)).

(b) c(G)≤F(G)c(G) \le F(G), with equality if and only if GG is a forest.

(c) If G′G' is obtained from GG by adding an edge, then F(G′)>F(G)F(G') > F(G).

Proof. (a) The connected subgraphs without edges are the nn single vertices. A connected subgraph with a nonempty edge set E′E' has vertex set V(E′)V(E'), the set of ends of edges of E′E', and the graph (V(E′),E′)(V(E'),E') is connected if and only if E′E' is a connected set of L(G)L(G).

(b) Each connected set SS gives the connected subgraph G[S]G[S]. If GG is a forest, then G[V′]G[V'] is a forest, so a connected spanning subgraph of G[V′]G[V'] must be G[V′]G[V'] itself. If GG has a cycle, the cycle minus one of its edges is a connected subgraph that is not induced.

(c) All connected subgraphs of GG remain, and the new edge with its two ends is a new one. □

Proposition 7.3. A positive integer kk equals F(G)F(G) for some finite connected graph GG if and only if

k∉EF={2,4,5,7,8,9,12,13,14,16,19,22,23,35,38,39,46}.k \notin E_F = \{2,4,5,7,8,9,12,13,14,16,19,22,23,35,38,39,46\}.

Proof (computer-assisted). By Lemma 7.2(b) and [8], every positive integer outside ETE_T is a value of FF on a tree, and max⁡ET=89\max E_T = 89. It remains to decide which elements of ETE_T are values of FF. We separate the reduction, which is proved, from the finite search, which is a computation.

Reduction. Let GG be connected with nn vertices and F(G)≤89F(G) \le89. By Lemma 7.2(b) and Lemma 2.1(f), T(n)≤c(G)≤F(G)≤89T(n) \le c(G) \le F(G) \le89, so n≤12n \le12. Let SS be a spanning tree of GG, and add the edges of E(G)∖E(S)E(G) \setminus E(S) to SS one at a time. This gives connected graphs S=G0,G1,…,Gs=GS = G_0,G_1,\ldots,G_s = G, each obtained from the previous one by adding one edge. By Lemma 7.2(c), F(G0)<F(G1)<⋯<F(Gs)≤89F(G_0) < F(G_1) < \cdots< F(G_s) \le89, and F(G0)=c(S)F(G_0) = c(S) by Lemma 7.2(b). So every connected graph with F≤89F \le89 is reached from a tree with c≤89c \le89 and at most 12 vertices by adding one edge at a time, and every intermediate graph also has F≤89F \le89. Being reachable in this way does not depend on the labeling, so the search may be carried out up to isomorphism.

Search. Level 0 consists of the trees with at most 12 vertices and c≤89c \le89, one from each isomorphism class; all trees are generated by NetworkX [13]. There are 94 of them: 1, 1, 1, 2, 3, 6, 11, 20, 24, 17, 6 and 2 trees on 1, 2, …\ldots, 12 vertices, respectively. Level i+1i+1 consists of the graphs obtained from a graph of level ii by adding one missing edge. A graph is discarded if F>89F > 89, or if it is isomorphic to a graph found before. The isomorphism test compares Weisfeiler–Lehman hashes and then tests exact isomorphism. Levels 1, 2, 3, 4 contain 69, 13, 1 and 0 graphs, so the search stops. It finds 177 pairwise non-isomorphic connected graphs with F≤89F \le89. By the reduction, every connected graph with F≤89F \le89 is isomorphic to one of them, and their values of FF are all integers in [1,89][1,89] except the elements of EFE_F. The 17 elements of ET∖EFE_T \setminus E_F are realized by the graphs of Table 6. The values of FF were computed in two independent ways, by Lemma 7.2(a) and by testing all edge subsets; Section 9 describes the programs and the machine-readable list of the 177 graphs. □

FFnnedgesFFnnedges
18401 02 03 13 (paw)54501 02 03 13 24 34
26501 02 13 24 34 (C5C_5)60701 02 12 14 23 45 56
27501 02 12 13 3465801 02 15 23 34 47 56 67
29501 02 04 13 3468701 02 05 14 23 45 46
31501 02 03 13 3472701 02 12 13 15 34 56
33401 02 03 12 13 (diamond)77701 02 03 04 15 16 56
42601 02 05 14 23 4589801 02 13 15 23 24 56 67
43601 02 14 23 25 45
50701 02 14 23 36 45 56
52601 02 03 05 14 45

Table 6. Connected graphs realizing, as values of FF, the 17 subtree exceptions of [8] that are values of FF. Each graph has the least possible number of vertices and, among those, the least number of edges. Vertices are 0,…,n−10,\ldots,n-1, and ijij denotes the edge joining ii and jj.

For instance, F(C5)=5+c(C5)=26F(C_5)=5+c(C_5)=26, the paw has F=4+c(diamond)=18F=4+c(\text{diamond})=18, and the diamond has F=4+c(W4)=4+29=33F=4+c(W_4)=4+29=33, where W4W_4, the cone over C4C_4, is the line graph of the diamond. Unlike Theorem 1.1, Proposition 7.3 depends on computer calculations, both through [8] and through our search. A proof in the spirit of Section 4 would be of interest.

The topological interpretation

As explained in § 1.1, Theorem 1.1 answers [7 Question 3.21]. Combined with the reduction of [7] and a realization of every finite connected graph by copies of the Knaster continuum glued at points, it gives the following result of the companion paper.

Theorem 7.4 ([2 Theorem A]). A positive integer kk is the number of regular subcontinua of some metric continuum if and only if k∉{2,4,5,8,9,16}k \notin\{2,4,5,8,9,16\}. For every k≥32k \ge32 such a continuum can be chosen as the union of ⌊log⁡2k⌋+1\lfloor\log_2 k\rfloor+1 copies of the Knaster continuum, any two of which meet in at most one point, and no continuum with exactly kk regular subcontinua has fewer minimal regular subcontinua.

Formal verification in Lean

The results of § 2–§ 5 and 6 and Lemma 7.2 are formalized in Lean 4 [9] with Mathlib [16], in the library ConnectedSets in the directory lean of the repository [3] of this paper. The file MANIFEST.txt there lists the SHA-256 checksums of all files of this version, including the Lean sources and the scripts of § 9. The toolchain is Lean v4.35.0 with Mathlib commit 6015dbbfc399f4548bafd46f9560ff61595fd328, both fixed in the files lean-toolchain, lakefile.toml and lake-manifest.json. In the directory lean, the commands

lake exe cache get lake build lake env lean CheckAxioms.lean

download a compiled Mathlib (this step is optional), build the library, and print the axioms of every statement of Table 7. The library has 20 modules and 4623 lines. Eleven of them (Basic, Defs, Rules, Transport, Checker, Five, Sporadic, Base, Intervals, Induction and Main; 2201 lines) are the graph-theoretic part of the formalization written for the companion paper [2], which is in the directory lean of [4]. They are copied with the namespace renamed and the comments renumbered, and the scripts in lean/gen regenerate the modules Sporadic, Base and Intervals byte for byte. The other modules are new: Gap and Path (Proposition 3.2), Spider, Small (Lemmas 2.1(b) and 3.1, Corollaries 3.3 and 3.5, Propositions 3.4 and 6.1, and Theorem 1.2 for every kk), Glue (Lemma 2.1(c)), Linegraph (Lemma 7.2), Extras, and Paper, which states the results with the numbering of this paper.

this paperdeclarations in ConnectedSets/Paper.lean
Theorems 1.1, 1.2, 1.3theorem_1_1, theorem_1_1_type, theorem_1_2, theorem_1_3, theorem_1_3_sharp
formulas of Section 1section_1_formulas (path, complete graph, star)
Lemma 2.1(a)–(f)lemma_2_1_a, . . . , lemma_2_1_f
Lemma 3.1lemma_3_1_a, lemma_3_1_b
Proposition 3.2proposition_3_2, proposition_3_2_spider
Corollaries 3.3, 3.5; Proposition 3.4corollary_3_3, corollary_3_5, proposition_3_4
Lemmas 4.2, 4.3, 4.4lemma_4_2, lemma_4_3, lemma_4_4_a, lemma_4_4_b
Remark 4.5 (25∉Λ525 \notin\Lambda_5)remark_4_5
Theorem 4.6, Example 4.7theorem_4_6, example_4_7
Proposition 6.1proposition_6_1
Lemma 7.2(a)–(c)lemma_7_2_a, lemma_7_2_b, lemma_7_2_c

Table 7. Correspondence between the results of this paper and the Lean formalization.

For a graph GG on a finite type VV, the number cGc_G is the number of finite sets SS of vertices such that the induced graph G.induce S is connected; Mathlib’s notion of a connected graph includes nonemptiness. The statement InV m k says that some connected graph on Fin m has cG=kc_G=k, that is, k∈Vmk\in V_m, and InLam m k says k∈Λmk\in\Lambda_m. Paths, forests and line graphs are Mathlib’s pathGraph, IsAcyclic and lineGraph. The number FGF_G counts the pairs (S,E)(S,E) of a finite set of vertices and a finite set of edges of GG with both ends in SS such that the graph with vertex set SS and edge set EE is connected. Two of the statements of the module Paper read as follows; there T n is T(n)T(n).

theorem theorem_1_1 (k : ℕ) (hk : 0 < k) :
  (∃ n, ∃ G : SimpleGraph (Fin n), G.Connected ∧ c G = k) ↔
    k ∉ ({2, 4, 5, 8, 9, 16} : Finset ℕ)
theorem proposition_3_2 (G : SimpleGraph V) (hG : G.Connected) :
  (IsEmpty (pathGraph (Fintype.card V) ≃g G) →
    T (Fintype.card V) + (Fintype.card V - 3) ≤ c G) ∧
  (c G = T (Fintype.card V) ↔ Nonempty (pathGraph (Fintype.card V) ≃g G))

Table 7 lists the correspondence between this paper and the module Paper; all its declarations are in the namespace ConnectedSets.Paper.

The formal proofs follow the paper, with four differences.

  1. Proposition 3.2 is proved by a different argument, an induction on connected sets that avoids spanning trees. Call a vertex yy of a connected set SS an end of SS if SS has exactly one connected subset containing yy of each size. An end forces SS to have exactly T(∣S∣)T(|S|) connected subsets, and it gives an enumeration of SS in which two vertices are adjacent exactly when they are consecutive. Conversely, if SS has exactly T(∣S∣)T(|S|) connected subsets, then every vertex whose removal leaves SS connected is an end. In the induction, remove such a vertex ww. If S∖{w}S \setminus\{w\} has the minimum number of connected subsets, it is a path, and the intervals of this path that form a connected set together with ww give at least 2∣S∣−32|S|-3 connected sets containing ww, unless SS itself has the minimum. Otherwise the induction hypothesis applies to S∖{w}S \setminus\{w\}. This gives c(G)=T(n)c(G)=T(n) or c(G)≥T(n)+n−3c(G)\ge T(n)+n-3 for every connected graph GG with nn vertices, and c(G)=T(n)c(G)=T(n) exactly when GG is isomorphic to pathGraph n.

  1. In Proposition 3.4 the values 16 and 25 are excluded by a kernel computation (decide +kernel) over all 2102^{10} labeled graphs on five vertices, not by the case analysis of the paper; for 16 the formalized Corollary 3.3 gives a second proof. The computation uses a bitmask counting procedure proved equal to cc. The same procedure checks the counts of the sporadic graphs, the 353 derivations of Lemma 4.4, the exclusions 5∉Λ35 \notin\Lambda_3 and 9∉Λ49 \notin\Lambda_4 of Lemma 3.1 (over all labeled graphs on three and four vertices), and 25∉Λ525 \notin\Lambda_5 in Remark 4.5.

  1. Lemma 2.1(c) is formalized inside one graph: the vertex set is covered by sets AA and BB with A∩B={v}A \cap B = \{v\} and no edge between A∖{v}A \setminus\{v\} and B∖{v}B \setminus\{v\}, and G[A]G[A] and G[B]G[B] play the roles of G1G_1 and G2G_2.

(4) Lemma 2.1(e) and the near-cone formula of Lemma 4.2 are stated without subtraction, for instance as c(G)+2∣K∣−1−d=c(K)+2∣K∣c(G) + 2^{|K|-1-d} = c(K) + 2^{|K|}, where dd is the size of a finite set listing the neighbours of uu.

Not formalized are the general formulas of Example 2.2, whose instances used in the proofs are checked by the kernel; the computer census behind Table 5 for n=6,7,8n = 6, 7, 8, and with it 26∉Λ626 \notin\Lambda_6; the statements of Remark 4.5 about which values the rules produce; the running time in Remark 5.1; Remark 7.1 and Proposition 7.3, which rely on the computer-assisted theorem of [8] and on our search; and Appendix A. Theorem 7.4 is formalized in the companion formalization [2].

The library uses neither sorry nor native_decide and declares no axioms. Its 31 statements in the module Paper depend only on the axioms propext, Classical.choice and Quot.sound, and one of them, theorem_1_2_minOrder, depends on none. We checked the library in four ways, recorded in the file CHECKS.txt of the formalization. It builds from an empty build directory, and a copy of the sources in a fresh directory builds with the same output. The declarations of all modules were replayed through the kernel with leanchecker, and the whole import closure, including Lean core and Mathlib, with leanchecker --fresh. Finally, the statements of Paper were exported together with everything they depend on, 10538 declarations in all, and checked by the independent type checker nanoda, with only the three axioms above permitted; no errors were reported.

Computational verification

The proofs of Theorems 1.1–1.3 do not use a computer. We checked every explicit finite count in this paper, and the computer-assisted result of [7], with programs written for this purpose. The programs for the census of small graphs, the construction and the subtrees, with their outputs, are in the repository [4] of the companion paper; the file CHECKS.md there maps each computational statement of [2] to the program that checks it. The scripts for Proposition 7.3 and Appendix A, the construction program construct.py with its certificate for Lemma 4.4, and the outputs are in the directories code and data of the repository [3] of this paper.

Counting. We compute c(G)c(G) in three ways: by testing all 2n−12^n - 1 nonempty vertex sets; by the ESU enumeration scheme [25], which lists each connected set once; and by a recurrence over vertex sets. In the recurrence, g(S)=1g(S) = 1 if G[S]G[S] is connected and g(S)=0g(S) = 0 otherwise. The component of G[S]G[S] containing min⁡S\min S is the only connected set T⊆ST \subseteq S with min⁡S∈T\min S \in T and no edge between TT and S∖TS \setminus T. Hence g(S)=1−∑g(T)g(S) = 1 - \sum g(T), the sum running over sets T≠ST \ne S with min⁡S∈T⊆S\min S \in T \subseteq S and no edge between TT and S∖TS \setminus T.

Graphs on at most eight vertices. Program A takes the graphs on at most seven vertices from the atlas of Read and Wilson [20], as distributed with NetworkX [13]. It extends each of the 1044 graphs on seven vertices, connected or not, by every nonempty neighbourhood of a new vertex, and removes isomorphic copies in two independent ways. Both give the 11117 connected graphs on eight vertices of OEIS A001349 [17]. Program B, written in C, uses no atlas and no isomorphism test. It runs over all labeled graphs on at most seven vertices, and over the graphs on eight vertices obtained by extending the labeled graphs on seven vertices with nonincreasing degree sequence. Its numbers of labeled connected graphs agree with OEIS A001187. The two programs give the same sets VnV_n for n≤8n \le8, as in Table 5. Every value in [1,255][1,255] except 2,4,5,8,9,162,4,5,8,9,16 occurs, and every value in [17,127][17,127] occurs on at most seven vertices. This confirms [7, Remark 3.20. Program B also rederives each witness of Appendix A by brute force over all labeled graphs.

The construction. We implemented Lemma 4.4 and the procedure of Remark 5.1 literally, and checked the gaps stated in Remark 4.5. An independently written program re-checked each of the 353 derivations for m≤7m \le7. For every k∈[17,70000]k \in[17,70000], and for 300 random k<222k < 2^{22}, we built the resulting graph and counted its connected sets. For every 8≤m≤168 \le m \le16 and every v∈[m,2m−1]v \in[m,2^m - 1], the graph Re⁡(m,v)\operatorname{Re}(m,v) has exactly mm vertices, is connected when v≥2m−1v \ge2^{m-1}, and has c=vc=v; in total 130708 graphs were checked.

Subtrees. We re-verified the list ETE_T of [8] from all trees with at most 18 vertices, generated and counted in two independent ways. A tree with n≥19n \ge19 vertices has at least T(19)=190T(19)=190 subtrees, so this determines the subtree counts below 190.

All connected subgraphs. The script code/f_values.py of [3] carries out the search in the proof of Proposition 7.3; the command python3 f_values.py 89 runs it, with Python 3.13 and NetworkX 3.7, in about two seconds. During the search it computes FF through Lemma 7.2(a), counting the connected sets of the line graph with the ESU scheme and stopping as soon as the count exceeds 89. For every graph found it then recomputes FF by testing all nonempty edge subsets with a union-find structure; the two methods agree on all 177 graphs. The script prints the number of trees of each order at level 0, the size of each level, and the missing values, as stated in the proof (output file f_values_output.txt). It also writes the file f_graphs_le_89.csv, which lists the 177 graphs with FF, cc, the numbers of vertices and edges, and the edge list. Together with the reduction in the proof, this list certifies both that the values in [1,89]∖EF[1,89] \setminus E_F occur and that the elements of EFE_F do not. A separate program in C, f_edge_subsets.c, recomputed cc by vertex subsets and FF by edge subsets for all 996 connected graphs with at most seven vertices of the atlas, independently of the search. It agrees with the values below 36, where those graphs suffice, since F≥T(n)≥36F \ge T(n) \ge36 for n≥8n \ge8.

AI disclosure

Artificial intelligence was used extensively in this work, both to obtain the results and to check them.

Solving and proving. The main model used to solve the problem and to prove the theorems was Claude Opus 5.5 (Anthropic). In an iterative process directed by the author, it carried out most of the exploratory proof development, including the near-cones of § 4 and the arguments of § 3. It also wrote and ran the programs of § 9, carried out the literature search of § 1.2, and generated most of the first draft of this manuscript and of the Lean 4 formalization of § 8.

Reading and checking. ChatGPT-Astra (OpenAI) was used, together with the author, to read the manuscript and check the arguments. AI was used extensively for proofreading and proof checking, and for repeated rounds of checking the arguments and comparing the proofs with one another, for instance the two proofs of Proposition 3.2 and the two exclusions of 16 on five vertices. In each round the author, with ChatGPT-Astra, reviewed the text, the proofs and the supplementary material and sent feedback, and Claude revised them.

The author's role. The author formulated the problem, which arose from Questions 3.5 and 3.21 of [7], provided the mathematical context and constraints, and steered the iterations through prompts and feedback. The author also supplied ideas and suggested strategies, selected and revised the outputs, and reviewed the final arguments.

The explicit finite counts are checked by programs (§ 9), and the results listed in Table 7 are formally verified in Lean (§ 8). No independent expert has yet verified the proofs. The author takes full responsibility for the content.

Witnesses for the values from 17 to 127

A witness for an integer kk is a connected graph GG with c(G)=kc(G)=k. We record witnesses as graph6 strings. A graph6 string is a standard printable encoding of a finite labeled graph with vertex set {0,…,n−1}\{0,\ldots,n-1\}. For n≤62n \le62 its first character is the one with ASCII code n+63n+63. The remaining characters encode the entries above the diagonal of the adjacency matrix, read column by column, that is, in the order (0,1)(0,1), (0,2)(0,2), (1,2)(1,2), (0,3)(0,3), (1,3)(1,3), (2,3),…(2,3),\ldots. These bits are padded with zeros to a multiple of six, and each group of six bits, read as a binary number bb, is written as the character with ASCII code b+63b + 63. For example, D?{ encodes the star K1,4K_{1,4} with centre 4: the bits of ? and { are 000000 and 111100, so the edges are (0,4),(1,4),(2,4),(3,4)(0, 4),(1, 4),(2, 4),(3, 4).

Canonical strings. A graph6 string depends on the labeling. For a fixed nn all graph6 strings have the same length, and we compare them lexicographically by their ASCII characters. The canonical graph6 string of a graph is the least graph6 string among all its labelings with vertex set {0,…,n−1}\{0,\ldots,n-1\}; two graphs are isomorphic if and only if their canonical strings coincide.

Witness rule. For each k∈[17,127]k \in[17,127] the table gives a witness of least possible order nn; among those, of least number of edges; and among those, the one with the least canonical graph6 string. The table lists kk, nn and the canonical string. By Theorem 1.2, n=⌊log⁡2k⌋+1n = \lfloor\log_2 k \rfloor+ 1 except for k=25k = 25. Program B of Section 9 rederives every entry by brute force over all labeled graphs on at most seven vertices. Edge lists are in the file data/witnesses_small.csv of [3]. The script code/check_witnesses.py of [3] reads this table from the \LaTeX source of the paper, decodes each string with the rule above, and checks that it gives a connected graph with nn vertices and exactly kk connected sets; all 111 rows pass.

kknngraph6kknngraph6kknngraph6
175D@s546EB~o917F?Nv_
185DJc556EFz_927F?Fno
195DBk566EFzg937F@Q~o
205D?{576EL~o947F?Fnw
215D@{586EFzw957F?]~_
225DJk596EF~w967F@Vn_
235DB{606E]~o977F@N^W
245DLs616E]~w987F?Nvo
256E@QW626E^~w997F@vf_
265DFw636E~~w1007F?B~o
275DF{647F?DnO1017F?B~w
285DN{657F??^o1027F?F~w
295D]{667F?C^W1037F?N~o
305D^{677F?KuW1047F?^vo
315D~{687F?Cng1057F@^vo
326E?NW697F?@w1067F@vv_
336E@Ug707F??Fw1077F?^~o
346EJ]G717F??Nw1087FBnnO
356E@Uw727F?Cfw1097F@vvo
366E?No737F??^w1107FBzv_
376E?Bw747F?C^w1117F@vvw
386E?Fw757F@Q^G1127F?~v_
396E@Rw767F?Cnw1137F?~vg
406E?Nw777F??~w1147F@~vg
416E@Nw787F?Dno1157F?~vw
426E?^o797F@Um_1167F?~~w
436E@Vw807F?LVw1177F@~~w
446E?^w817F@Q^W1187FFzng
456E@vg827F?Dnw1197FFzfw
466EBn_837F?@~o1207FFznw
476E@vo847F?D~o1217FFz~o
486EBz_857F?@~w1227FFz~w
496E@vw867F?Fng1237FF~~w
506EJfw877F@Umg1247F]~vw
516E?~o887F?NNg1257F]~~w
526E?~w897F?N^_1267F^~~w
536E@~w907F@]v_1277F~~~w

Table 1 (PDF p. 20).

Independent researcher

Email address: [email protected]

References

  1. [1]Y. Alizadeh, N. Bašić, I. Damnjanović, T. Došlić, T. Pisanski, D. Stevanović, and K. Xu, Solving the Mostar index inverse problem, preprint, arXiv:2312.13083.arxiv.org/abs/2312.13083
  2. [2]L. Alves de Almeida, All finite cardinalities of the hyperspace of regular subcontinua, preprint, version 2.3, 2026, available in [4].
  3. [3]L. Alves de Almeida, The inverse problem for the number of connected induced subgraphs: paper, Lean formalization and programs, GitHub repository, https://github.com/LucasAlves8Sp/THE-INVERSE-PROBLEM-FOR-THE-NUMBER-OF-CONNECTED-INDUCED-SUBGRAPHS.
  4. [4]L. Alves de Almeida, All finite cardinalities of the hyperspace of regular subcontinua: paper, programs and Lean formalization, GitHub repository, https://github.com/LucasAlves8Sp/ALL-FINITE-CARDINALITIES-OF-THE-HYPERSPACE-OF-REGULAR-SUBCONTINUA.
  5. [5]E. O. D. Andriantiana and A. A. V. Dossou-Olory, Nordhaus–Gaddum inequalities for the number of connected induced subgraphs in graphs, preprint, arXiv:2006.01187.
  6. [6]C. Bernert and J. Shaw, The inverse problem for the Steiner–Wiener index via additive number theory, preprint, 2026, arXiv:2603.17559.
  7. [7]J. Camargo, N. Ordoñez, and D. Ramírez, On the hyperspaces of meager and regular continua, Appl. Gen. Topol. 25 (2024), no. 2, 385–406. doi:10.4995/agt.2024.20116.DOI
  8. [8]É. Czabarka, L. A. Székely, and S. Wagner, The inverse problem for certain tree parameters, Discrete Appl. Math. 157 (2009), no. 15, 3314–3319. doi:10.1016/j.dam.2009.07.004.DOI
  9. [9]L. de Moura and S. Ullrich, The Lean 4 theorem prover and programming language, in: Automated Deduction – CADE 28, Lecture Notes in Comput. Sci. 12699, Springer, Cham, 2021, 625–635. doi:10.1007/978–3–030–7985–5_37.DOI
  10. [10]A. A. V. Dossou-Olory, Graphs and unicyclic graphs with extremal number of connected induced subgraphs, preprint, arXiv:1812.02422.
  11. [11]A. A. V. Dossou-Olory, Cut and pendant vertices and the number of connected induced subgraphs of a graph, preprint, arXiv:1910.04552.
  12. [12]A. A. V. Dossou-Olory, On the maximum number of connected induced subgraphs of a graph, preprint, 2023, arXiv:2303.01964.
  13. [13]A. A. Hagberg, D. A. Schult, and P. J. Swart, Exploring network structure, dynamics, and function using NetworkX, in: Proceedings of the 7th Python in Science Conference (SciPy 2008), 11–15.
  14. [14]J. Haslegrave, The number and average size of connected sets in graphs with degree constraints, preprint, arXiv:2105.13332.
  15. [15]V. Linek, Bipartite graphs can have any number of independent sets, Discrete Math. 76 (1989), 131–136. doi:10.1016/0012-365X(89)90306–3.DOI
  16. [16]The Mathlib Community, The Lean mathematical library, in: Proceedings of the 9th ACM SIGPLAN International Conference on Certified Programs and CPPC (CPP 2020), 367–381. doi:10.1145/3372885.3373824.
  17. [17]OEIS Foundation Inc., The On-Line Encyclopedia of Integer Sequences, sequences A001187 and A001349, https://oeis.org.
  18. [18]N. Ordoñez, The hyperspace of regular subcontinua, Topology Appl. 234 (2018), 415–427. doi:10.1016/j.topol.2017.11.038.DOI
  19. [19]D. Pandey and K. L. Patra, On the number of connected subgraphs of graphs, Indian J. Pure Appl. Math. 52 (2021), no. 2, 571–583. doi:10.1007/s13226–021–00061–4.DOI
  20. [20]R. C. Read and R. J. Wilson, An Atlas of Graphs, Oxford University Press, Oxford, 1998.
  21. [21]L. A. Székely and H. Wang, On subtrees of trees, Adv. in Appl. Math. 34 (2005), 138–155. doi:10.1016/j.aam.2004.07.002.
  22. [22]P. Tittmann, I. Averbouch, and J. A. Makowsky, The enumeration of vertex induced subgraphs with respect to the number of components, European J. Combin. 32 (2011), no. 7, 954–974. doi:10.1016/j.ejc.2011.03.017.DOI
  23. [23]A. Vince, Counting connected sets and connected partitions of a graph, Australas. J. Combin. 67 (2017), no. 2, 281–293.
  24. [24]H. Wang and G. Yu, All but 49 numbers are Wiener indices of trees, Acta Appl. Math. 92 (2006), 15–20. doi:10.1007/s10440–006–9037–2.DOI
  25. [25]S. Wernicke, Efficient detection of network motifs, IEEE/ACM Trans. Comput. Biol. Bioinform. 3 (2006), no. 4, 347–359. doi:10.1109/TCBB.2006.51.DOI

Paper details

vlnc:W_s9ekqtqv
Version
v1 · latest
Published
Fresh — published within the last 30 days
License
CC BY 4.0
Usage

views · 10

downloads · 2

A view counts once per browser per day, a download each time the PDF is requested.

  • Mathematics

Anthropic Claude Opus 5.5, OpenAI ChatGPT Astra

View statement
Looking for related papers…
Contents