1 Introduction

Shapes having self-similar qualities that have complex and fractional number dimensions and a topological dimension smaller than their fractal dimension are explained by fractal geometry [1, 2]. Conventional metrics, which are normally applied to Euclidean geometric shapes, such as length, surface area, and volume, prove insufficient for fractal analysis because fractals have unique measurements, such as the Hausdorff measure [3, 4].

Fractals are known to be able to replicate a wide range of naturally occurring structures, but they are also frequently too irregular to have a smooth differentiable structure defined on them and ordinary calculus is usually inapplicable to them. Consequently, fractal analysis has been studied by many scholars using a variety of techniques. These include measure theory [5,6,7,8,9,10,11,12,13], fractional space [14], fractional calculus [15, 16], unconventional techniques [17], and fractal calculus [18, 19]. The integral on fractal manifolds was defined by extending the variable substitution theorem from Riemann integration to integrals on fractal sets [20, 21]. A numerical methods for solving partial differential equations on fractals was presented. It covers both strong and weak forms of the equations, including the Dirichlet problem in the Sierpinski triangle and a non-planar Hata tree [22]. Fractal calculus is the result of extending standard calculus to fractal sets in order to include differential equations whose solutions take the form of functions with fractal support, such as fractal sets and curves [23,24,25,26]. More precisely, the difference from the measure theory approach and the fractal calculus lies in the use of the Hausdorff measure and in the use of the mass function instead of the classical distance, respectively. Let us notice that the mass function differs, from the Hausdorff measure, by a multiplicative factor \(1/\Gamma (s+1)\) and by the use of finite subdvisions (see [18, Definition 3] and [27]). This allowed Fractal calculus to be used in various real-life problems, such as, for istance, modeling tumor growth and providing a double-size cancer relation with fractal temporal dimension [28]. Moreover, thin Cantor-like sets were employed for the derivation of fractional Brownian motion using non-local fractal derivatives. Furthermore, another field of applications of Fractal calculus is “non-classical Stochastic Analysis”, where stochastic differential equations are driven by fractal processes, so the processes are not semimartingales and there are in this situation no integrals of Itô -type available. In 1951 Hurst used stochastic processes to describe the long-term storage capacity in reservoirs (see [29]) and he introduced a parameter H, that in honour of Hurst was called Hurst parameter. A connection with the fractal Hurst parameter was established in [30]. Fractal random variables and their associated distribution functions and statistical properties were explored. The integration of fractal calculus with probability theory was utilized to define Shannon entropy on fractal thin Cantor-like sets [31]. The noise characteristics of electrical circuits were explored through the utilization of nonlocal fractal calculus. A foundation for understanding noise behaviors in fractal non-local calculus electrical circuits was established, demonstrating broad applicability across various large-scale configurations [32]. The constitutive relations of the resistor and inductor were reformulated following the novel capacitor relation. Fractal calculus and Laplace transformation were applied to derive responses for RL, RC, LC, and RLC circuits on the described fractal set [33]. Random walks on fractal middle-\(\xi\) Cantor sets were suggested, and the presentation of corresponding power-law variances was accompanied by the solution of a fractal stochastic differential equation [34].

In this paper we deal with self-similar fractal compact subsets of the real line with finite and positive s-dimensional Hausdorff measure, briefly called s-sets, (\(0<s<1\)). Moreover, since for compact sets, any open covers, and in particular countable open covers can be replaced by finite subcovers it follows that the mass function and the Hausdorff measure are proportional (see [18, Theorem 18]). So we denote by s-Riemann integral the Riemann type integral on an s-set of the real line defined, independently and equivalently, by Jiang–Su [7] and Parvate–Gangal [18]. Both authors demonstrate that the main properties of the Riemann integral as well as the Fundamental Theorem of Calculus are still valid for the s-Riemann integral. However, as the best version of the Fundamental Theorem of Calculus is given on the real line by Henstock–Kurzweil integral, in [10, 11] Bongiorno and Corrao extended the s-Riemann integration process to the Henstok–Kurzweil integration process by introducing an integral to real functions defined on s-sets with \(0<s<1\) named s-HK integral that was indipendently defined by Golmankhaneh and Baleanu in [35]. This integral allowed Bongiorno–Corrao to provide the best formulation of the Fundamental Theorem of Calculus on fractal subsets of the real line in terms of the following theorem.

Theorem 1

If F is a real function defined on a closed s-set E of the real line, with \(0<s<1\), such that the series \(\sum _{j=1}^{\infty }\,(F(b_j)\,-\,F(a_j))\) is absolutely convergent and such that

  1. 1.

    \(F'_s(x)\) exists at each point \(x\in E\) or

  2. 2.

    \(F'_s(x)\) exists at \({\mathcal {H}}^{s}\)-almost each point \(x\in E\) and F is \({\mathcal {H}}^{s}\)-\(ACG_{\delta }\) on E, then \(F_s^{'}\) is s-HK integrable on E with

    $$\begin{aligned} (H\!K)\!\int _{E\cap [a,b]}\,F_s^{'}\, \, d{\mathcal {H}}^{s} \,=\, F(b)\,-\,F(a)\,-\,\sum _{j=1}^{\infty }\,(F(b_j)\,-\,F(a_j)), \end{aligned}$$

    where \(\{(a_j, b_j)\}_{j\in {\mathbb {N}}}\) is the sequence of all contiguous intervals of E.

Moreover, they proved that for the s-HK integrability of \(F'_s\) and for the validity of some formulation of the Fundamental Theorem of Calculus, the absolute convergence of the series \(\sum _{j=1}^{\infty }\,(F(b_j)\,-\,F(a_j))\) is a necessary condition.

The peculiarity of the s-HK integral, with respect to the s-Riemann integral, is that the s-HK integral allows to neglect the value of the s-Riemann sums related to some partitions containing ”big” intervals in proximity of “very bad” points.

Let us remind that, given a function \(f:E\rightarrow {\mathbb {R}}\) and a finite collection \(P=\{(\widetilde{A}_{i},x_{i})\}^{p}_{i=1}\) of E-intervals \(\widetilde{A}_{i}\) and points \(x_{i}\in \widetilde{A}_i,\ i=1,2,\ldots , p\), the sum

$$\begin{aligned} S(f,P)=\sum _{i=1}^{p}f(x_{i})\,{\mathcal {H}}^{s}(\widetilde{A}_{i}), \end{aligned}$$

where \({\mathcal {H}}^{s}\) is the s-dimensional Hausdorff measure, is called the s-Riemann sum of f related to the partition P.

Therefore, the difference between the s-HK integral and the s-Riemann integral is due to the use of those s-Riemann sums in their definitions.

In fact, while the s-Riemann integral involves the s-Riemann sums related to all partitions \(\{(\widetilde{A}_{i},x_{i})\}^{p}_{i=1}\) with \({\mathcal {H}}^{s}(\widetilde{A}_{i})<\delta\), \(i=1,2,\ldots ,p\), for some appropriate constant \(\delta >0\), and for each choice of points \(x_i\) inside \(\widetilde{A}_i\), \(i=1,2,\ldots ,p;\) the s-HK integral involves the s-Riemann sums related to all partitions \(\{(\widetilde{A}_{i},x_{i})\}^{p}_{i=1}\) satisfying the condition \({\mathcal {H}}^{s}(\widetilde{A}_{i})<\delta (x_i)\), \(i=1,2,\ldots ,p\), for some appropriate gauge \(\delta :E\rightarrow {\mathbb {R}}^+\), and for the correspondent choice of points \(x_i\) inside \(\widetilde{A}_i\), \(i=1,2,\ldots ,p\).

About this, remark that, if f is an s-HK integrable function but it is not s-Riemann integrable, then \(\inf _{x\in E}\delta (x)=0\), for each gauge \(\delta :E\rightarrow {\mathbb {R}}^+\). In fact the condition \(\inf _{x\in E}\delta (x)=\delta >0\) implies that the s-Riemann sums related to all partitions \(\{(\widetilde{A}_{i},x_{i})\}^{p}_{i=1}\) with \({\mathcal {H}}^{s}(\widetilde{A}_{i})<\delta\), and with an arbitrary choice of \(x_i\) inside \(\widetilde{A}_i\), \(i=1,2,\ldots ,p\), approximate the s-HK integral of f. Therefore f is s-Riemann integrable.

The aim of this paper is to investigate the possibility of using in the previous Theorem an integral in which the gauge \(\delta :E\rightarrow {\mathbb {R}}^+\) is a positive constant, but the choice of points \(x_i\) is not arbitrary in \(\widetilde{A}_i\), for \(i=1,2,\ldots ,p\). To define a quite general integral of this type we adapt a Darji–Evans’s idea [36] to functions defined on an s-set E; i.e. we fix a countable dense subset \(\Gamma\) of E and we restrict our attention only to the s-Riemann sums related to all partitions \(\{(\widetilde{A}_{i},x_{i})\}^{p}_{i=1}\) such that \({\mathcal {H}}^{s}(\widetilde{A}_{i})<\delta\), \(i=1,2,\ldots ,p\), for some appropriate constant \(\delta >0\), and such that \(x_i\) is the first element of \(\Gamma\) that belongs to \(\widetilde{A}_i\), \(i=1,2,\ldots , p\). So, a new integration process is formulated and an integral of the first-return type, called s-first return integral of a function f on E with respect to a trajectory, is defined (see [9, 12], too). The idea of first return type goes back to Poincaré’s first return map of differentiable dynamics and already used in differentiation and integration theory [36, 37].

In this paper we prove that the s-first return integral, as well as the s-Riemann integral, includes the Lebesgue integral with respect to \({\mathcal {H}}^{s}\) and we prove that there exists a function f not s-Riemann integrable which is not s-first return integrable (see Theorem 5). However, as Bongiorno in [9] proved there are s-derivatives not s-first return integrable. Therefore, we can conclude that in order to obtain the best version of the Fundamental Theorem of Calculus on an s-set, exactly as well as in the real line, we need to consider an Henstock–Kurzweil type integral as discussed, i.e., an integral in which the gauge \(\delta\) is not a constant.

Recall that the optimal version of the Fundamental Theorem of Calculus is given on the real line by the Henstock–Kurzweil integral, which solves the primitives problem. Indeed, the Fundamental Theorem of Calculus in the real line states that if F is differentiable on [ab] and \(F'=f\), then \(\int _a^b f(x)dx= F(b)-F(a)\). It is well-known that in the case of Riemann integration it is necessary to add the additional condition that the function f must be Riemann integrable. This condition is necessary, because not every derivative turns out to be Riemann integrable. For instance the function \(F(x) ={\left\{ \begin{array}{ll}x^2 \sin (1/x^2),\, x\in (0, 1];\\ 0, x= 0;\end{array}\right. }\) is differentiable everywhere on [0, 1], but \(F'(x)={\left\{ \begin{array}{ll}2x\sin (1/x^2)-\frac{2}{x}\cos (1/x^2),\, x\in (0, 1];\\ 0, x= 0;\end{array}\right. }\) is not Riemann integrable since it is unbounded. Moreover, \(F'\) is neither Lebesgue integrable, since F is not absolutely continuous on [0, 1]. Therefore the Lebesgue integral as well as the Riemann integral does not solve the problem of primitives. On the contrary the Henstock–Kurzweil integral gives the best formulation for the Fundamental Theorem of Calculus on the real line and for this reason it has been extensively studied by many scholars for instance Russell A. Gordon [38, Preface, Chapters 7 and 9], Lee Peng Yee and Rudolf Vyborny [39], Borkowski and Bugajewska [40], Tin–Lam Toh and Tuan–Seng Chew [41].

2 Preliminaries

Throughout this paper we denote by \({\mathbb {N}}=\{1,2,\ldots \}\) the set of all natural numbers and by \({\mathbb {R}}\) the set of all real numbers.

Definition 1

Let \(0<s <1\), the s-dimensional exterior Hausdorff measure of a subset A of the real line is defined as:

$$\begin{aligned} {\mathcal {H}}^{s}(A)=\lim _{\delta \rightarrow 0}\inf \left\{ {\sum _{i=1}^{\infty }(\text{ diam }(A_{i}))^{s}:A\subset \bigcup _{i=1}^{\infty }A_{i},\, \text{ diam }(A_{i})\le \delta }\right\} . \end{aligned}$$

We recall that \({\mathcal {H}}^{s}(\cdot )\) is a Borel regular measure and that the unique number s for which \({\mathcal {H}}^{t}(A)=0\) if \(t>s\) and \({\mathcal {H}}^{t}(A)=\infty\) if \(t<s\) is called the Hausdorff dimension of A (see [27]).

Whenever A is \({\mathcal {H}}^{s}\)-measurable with \(0<{\mathcal {H}}^{s}(A)<\infty\), it is said that A is an s-set. So \({\mathcal {H}}^{s}\) is a Radon measure on each s-set.

From now on we denote by E a compact s-set of \({\mathbb {R}}\) and by \(a=\min \, E\) and \(b=\max \, E\).

Definition 2

For \(x,y\in E\) we set

$$\begin{aligned} d(x,y)=\left\{ \begin{array}{ll}{\mathcal {H}}^{s}([x,y]\cap E),&{}\quad \text{ if }\ x<y;\\ {\mathcal {H}}^{s}([y,x]\cap E),&{}\quad \text{ if }\ y<x. \end{array} \right. \end{aligned}$$
(1)

Proposition 2

The function \((x,y)\rightsquigarrow d(x,y)\) from \(E\times E\rightarrow {\mathbb {R}}^+\cup \{0\}\) is a metric, and the space (Ed) is a complete metric space.

Proposition 3

The topology of the metric space (Ed) coincide with the topology induced on E by the usual topology of  \({\mathbb {R}}\).

Definition 3

(De Guzman–Martin–Reyes [42]) Let \(F: E\rightarrow {\mathbb {R}}\) and let \(x_{0}\in E\). The s-derivatives of F at the point \(x_{0}\), on the left and on the right, are defined, respectively, as follows:

$$\begin{aligned} F'^{-}_{s}(x_{0})&= \lim _{\begin{array}{c} x\rightarrow x_{0}^{-}\\ x\in E \end{array}}\frac{F(x_{0})-F(x)}{d(x,x_0)},\\ F'^{+}_{s}(x_{0})&= \lim _{\begin{array}{c} x\rightarrow x_{0}^{+}\\ x\in E \end{array}}\frac{F(x)-F(x_{0})}{d(x,x_0)}, \end{aligned}$$

when these limits exist.

We say that the s-derivative of F at \(x_{0}\) exists if \(F'^{-}_{s}(x_{0})=F'^{+}_{s}(x_{0})\) or if the s-derivative of F on the left (respectively, right) at \(x_0\) exists and for some \(\varepsilon >0\) we have \(d([x_{0},x_{0}+\varepsilon )=0\) (respectively, \(d(x_0-\varepsilon ,x_{0})=0\)). The s-derivative of F at \(x_0\), whenever it exists, will be denoted by \(F'_{s}(x_{0})\).

Remark 1

If F is s-derivable at the point \(x_0\), then F is continuous at \(x_0\) according to the topology induced on E by the usual topology of \({\mathbb {R}}.\)

3 Riemann-type integrals on an s-set

3.1 The s-Riemann integral

Definition 4

We say that a subset \(\widetilde{A}\) of E is an E-interval whenever there exists an interval \(A\subset [a,b]\) such that \(\widetilde{A}=A\cap E\).

Definition 5

Given a finite collection \(P=\{(\widetilde{A}_{i},x_{i})\}^{p}_{i=1}\) of pairwise disjoint E-intervals \(\widetilde{A}_{i}\) and points \(x_{i}\in E\), we say that P is a partition of E if \(E=\bigcup _{i=1}^{p}\widetilde{A}_{i}\) and \(x_{i}\in \widetilde{A}_{i}\).

Jiang–Su [7] and Parvate–Gangal [18] introduced, for functions defined on a closed s-set of the real line, the following extension of the usual Riemann integral.

Definition 6

Let \(f:E \rightarrow {\mathbb {R}}\). We say that f is s-Riemann integrable on E if there exists a number I such that, for each \(\varepsilon >0\), there is a \(\delta > 0\) with

$$\begin{aligned} |S(f,P)-I|<\varepsilon , \end{aligned}$$
(2)

for each partition \(P=\{(\widetilde{A}_{i},x_{i})\}^{p}_{i=1}\) of E with \({\mathcal {H}}^{s}(\widetilde{A}_{i})<\delta\), for \(i = 1,2,\ldots , p\).

The number I is called the s-Riemann integral of f on E and we write

$$\begin{aligned} I \,=\,(s)\!\!\int _{E} f(t)\, d{\mathcal {H}}^{s}(t). \end{aligned}$$

The collection of all s-Riemann integrable functions on E will be denoted by sR(E).

By standard techniques, it follows that if f is continuous on E with respect to the induced topology, then \(f\in sR(E)\) (see Parvate–Gangal [18, Theorem 39]).

Theorem 4

[12, Theorem 3.2] If \(f\in sR(E)\), then f is Lebesgue integrable in E with respect to the Hausdorff measure \({\mathcal {H}}^{s}\), and

$$\begin{aligned} \int _{E} f(t)\, d{\mathcal {H}}^{s}(t)=(s)\!\!\int _{E} f(t)\, d{\mathcal {H}}^{s}(t). \end{aligned}$$
(3)

3.2 The s-first return integral

Definition 7

Let \(f:E \rightarrow {\mathbb {R}}\) and let \(\Gamma \subset E\) be any sequence of distinct points of E dense in E. Call \(\Gamma\) a trajectory.

We say that f is s-first return integrable on E with respect to \(\Gamma\) if there exists a number I such that, for each \(\varepsilon >0\), there is a \(\delta > 0\) such that condition (2) holds for each partition \(P=\{(\widetilde{A}_{i},x_{i})\}^{p}_{i=1}\) of E with \({\mathcal {H}}^{s}(\widetilde{A}_{i})<\delta\) and \(x_i=r(\Gamma ,\widetilde{A}_{i})\), for \(i = 1,2,\ldots , p\), where \(r(\Gamma ,\widetilde{A}_{i})\) is the first element of \(\Gamma\) that belongs to \(\widetilde{A}_{i}\).

The number I is called the s-first return integral of f on E with respect to \(\Gamma\) and we write

$$\begin{aligned} I =(sfr)_{\Gamma }\!\!\int _{E} f(t)\, d{\mathcal {H}}^{s}(t). \end{aligned}$$

The collection of all s-first return integrable with respect to \(\Gamma\) functions on E will be denoted by \(sfr(E)_{\Gamma }\).

Theorem 5

There exists \(f\not \in sR(E)\) such that one of the following conditions holds

  1. (i)

    there exist two trajectories \(\Gamma _1\) and   \(\Gamma _2\) of E such that \(f\in sfr(E)_{\Gamma _1}\), \(f\in sfr(E)_{\Gamma _2}\) and

    $$\begin{aligned} (sfr)_{\Gamma _1}\!\!\int _{E} f(t)\, d{\mathcal {H}}^{s}(t)\not = (sfr)_{\Gamma _2}\!\!\int _{E} f(t)\, d{\mathcal {H}}^{s}(t); \end{aligned}$$
  2. (ii)

    \(f\not \in sfr(E)_{\Gamma }\), for each trajectory \(\Gamma\) of E.

Theorem 6

If \(f:E\rightarrow {\mathbb {R}}\) is \({\mathcal {H}}^{s}\)-Lebesgue integrable on E, then there exists a trajectory \(\Gamma \subset E\) such that \(f\in sfr(E)_{\Gamma }\) and

$$\begin{aligned} \int _Ef\,d\, {\mathcal {H}}^{s}=(sfr)_{\Gamma }\int _Ef\,d\, {\mathcal {H}}^{s}. \end{aligned}$$

4 Proofs

4.1 Proof of Theorem 5

Let \(C\subset [0,1]\) be the ternary Cantor set, and let \(\{(a_n,b_n)\}_n\) be the sequence of its contiguous intervals. C is an s-set for \(s=\log _32\). We define a function \(f\not \in sR(C)\) satisfying condition i).

To this aim we set \(\Gamma _1=\{a_n\}_n\) and \(\Gamma _2=\{b_n\}_n\). By the definition of C it follows that \(\Gamma _i\) is dense in C, for \(i=1,2\). Define

$$f(x)=\left\{ \begin{array}{ll}1,&{}\quad x=a_n,\ n=1,2,\ldots \\ 2,&{}\quad x=b_n,\ n=1,2,\ldots \\ 0,&{}\quad \text{ otherwise } \end{array} \right.$$

Then, by the definition of function s-first return integrable on C with respect to \(\Gamma _i\), \(i=1,2\), it follows

$$\begin{aligned} (sfr)_{\Gamma _1}\!\!\int _{C} f(t)\, d{\mathcal {H}}^{s}(t)=1,\ \text{ and }\ (sfr)_{\Gamma _2}\!\!\int _{C} f(t)\, d{\mathcal {H}}^{s}(t)=2. \end{aligned}$$

So, by Theorem 4, we have \(f\not \in sR(C)\), and condition (i) is satisfied.

Now, in order to end the proof, let us show that the following function

$$\begin{aligned} f(x)=\left\{ \begin{array}{ll} \frac{(-2)^n}{n},&{}\quad x\in \widetilde{\left[ \frac{2}{3^n}, \frac{1}{3^{n-1}}\right] };\\ 0,&{}\quad x=0,\end{array}\right. \end{aligned}$$
(4)

is not s-Riemann integrable on C and that condition (ii) is satisfied.

First of all remark that

$$\begin{aligned} {\mathcal {H}}^{s}\widetilde{\left[ \frac{2}{3^n}, \frac{1}{3^{n-1}}\right] }=\frac{1}{2^n}= {\mathcal {H}}^{s}\widetilde{\left[ 0,\frac{2}{3^n}\right] }. \end{aligned}$$
(5)

Then

$$\begin{aligned} \int _C|f|\,d{\mathcal {H}}^{s}&= \sum _1^{\infty } \int _{\widetilde{\left[ \frac{2}{3^n}, \frac{1}{3^{n-1}}\right] }}|f|\,d{\mathcal {H}}^{s}= \sum _1^{\infty }\frac{2^n}{n}\cdot {\mathcal {H}}^{s}\widetilde{\left[ \frac{2}{3^n}, \frac{1}{3^{n-1}}\right] }\\&= \sum _{n=1}^{\infty }\frac{1}{n}=+\infty . \end{aligned}$$

Therefore f is not Lebesgue integrable on C with respect to the Hausdorff measure \({\mathcal {H}}^{s}\) and, by Theorem 4, \(f\not \in sR(C)\).

Moreover, given a trajectory \(\Gamma =\{t_n\}\) of C, in order to show that \(f\not \in sfr(C)_{\Gamma }\), it is enough to find, for each \(M > 0\) and each \(\delta > 0\), a finite system of pairwise disjoints C-intervals \(\widetilde{A}_{i}\), \(i=1,2,\ldots , p\), such that \(\bigcup _{i=1}^p\widetilde{A}_{i}=C\), \({\mathcal {H}}^{s}(\widetilde{A}_{i})<\delta\) and

$$\begin{aligned} \sum _{i=1}^{p}f(r(\Gamma ,\widetilde{A}_{i}))\, {\mathcal {H}}^{s}(\widetilde{A}_{i})>M. \end{aligned}$$
(6)

To this end, given two disjoint C-intervals \(\tilde{J_1},\tilde{J_2}\), we use the symbol

$$\begin{aligned} r(\Gamma ,\tilde{J_1})\prec r(\Gamma ,\tilde{J_2}) \end{aligned}$$

whenever \(r(\Gamma ,\tilde{J_1})=t_n\), \(r(\Gamma ,\tilde{J_2})=t_m\), and \(n<m\). We also define

$$\begin{aligned} {\mathbb {N}}_1=\{n\in {\mathbb {N}}:r(\Gamma ,\widetilde{[2/3^{2n},1/3^{2n-1}]})\prec r(\Gamma ,\widetilde{[2/3^{2n+1},1/3^{2n}]})\} \end{aligned}$$

and \({\mathbb {N}}_2={\mathbb {N}}{\setminus } {\mathbb {N}}_1\). Remark that

$$\begin{aligned} r(\Gamma ,\widetilde{[2/3^{2n+1},1/3^{2n-1}]})= r(\Gamma ,\widetilde{[2/3^{2n},1/3^{2n-1}]}),&\ \text{ if }\,\ n\in {\mathbb {N}}_1;\\ r(\Gamma ,\widetilde{[2/3^{2n+1},1/3^{2n-1}]}) =r(\Gamma ,\widetilde{[2/3^{2n+1},1/3^{2n}]}),&\ \text{ if }\,\ n\in {\mathbb {N}}_2. \end{aligned}$$

By the divergence of the series \(\sum _n1/n\) it follows that, at least one of the series \(\sum _{n\in {\mathbb {N}}_1}1/n\), \(\sum _{n\in {\mathbb {N}}_2}1/n\) is divergent; then, without loss of generality, we can assume that \(\sum _{n\in {\mathbb {N}}_1}1/n=+\infty\).

Now, given \(\delta > 0\), let us take \(k\in {\mathbb {N}}\) such that

$$\begin{aligned} {\mathcal {H}}^{s}(\widetilde{[2/3^{2n+1},1/3^{2n-1}]})<\delta ,\ \text{ for } \text{ each }\ n\ge k. \end{aligned}$$
(7)

Then, by (4) and (5), we have

$$\begin{aligned}{} & {} {\sum _{\begin{array}{c} n\in {\mathbb {N}}_1\\ n\ge k \end{array}}f(r(\Gamma , \widetilde{[2/3^{2n+1},1/3^{2n-1}]})) \, {\mathcal {H}}^{s} (\widetilde{[2/3^{2n+1},1/3^{2n-1}]})}\\{} & {} \quad =\sum _{\begin{array}{c} n\in {\mathbb {N}}_1\\ n\ge k \end{array}}\frac{2^{2n}}{2n}\, \left( \frac{1}{2^{2n+1}}+\frac{1}{2^{2n}}\right) =\frac{3}{2}\sum _{\begin{array}{c} n\in {\mathbb {N}}_1\\ n\ge k \end{array}}\frac{1}{2n}=+\infty . \end{aligned}$$

So, given \(M > 0\), there exists \(N\in {\mathbb {N}}\) such that \(p_1=N-k+1\) is even and such that

$$\begin{aligned}{} & {} \sum _{\begin{array}{c} n\in {\mathbb {N}}_1\\ k\le n\le N \end{array}}f(r(\Gamma , \widetilde{[2/3^{2n+1},1/3^{2n-1}]})) \, {\mathcal {H}}^{s} (\widetilde{[2/3^{2n+1},1/3^{2n-1}]})\nonumber \\{} & {} \quad >M+3+\sum _{n=2}^{\infty }\frac{(-1)^n}{n}. \end{aligned}$$
(8)

The C-intervals \(\{\widetilde{[2/3^{2n+1},1/3^{2n-1}]}\}_{n=k}^N\) are pairwise disjoint, they cover the portion of C contained in \([2/3^{2N+1},1/3^{2N-1}]\) and each of them has \({\mathcal {H}}^{s}\)-measure less than \(\delta\). They constitute a first group of \(p_1\) requested C-intervals \(\{\widetilde{A}_{i}\}_{i=1}^{p_1}\):

$$\begin{aligned} \widetilde{A}_{1}=\widetilde{[2/3^{2k+1},1/3^{2k-1}]},\quad \widetilde{A}_{2}=\widetilde{[2/3^{2k+3},1/3^{2k+1}]}, \ldots , \widetilde{A}_{p_1}=\widetilde{[2/3^{2N+1},1/3^{2N-1}]}. \end{aligned}$$

Then, by (8), we have

$$\begin{aligned} \sum _{i=1}^{p_1}f(r(\Gamma ,\widetilde{A}_{i}))\, {\mathcal {H}}^{s}(\widetilde{A}_{i}) >M+3+\sum _{n=2}^{\infty }\frac{(-1)^n}{n}. \end{aligned}$$
(9)

Now we define a second group of requested pairwise disjoint C-intervals, \(\{\widetilde{A}_{i}\}_{i=p_1+1}^{p_2}\), that cover the portions of C contained in \([0,1/3^{2N+1}]\).

There are two possible cases:

$$\begin{aligned} r(\Gamma , \widetilde{[0,1/3^{2N+1}]}) =0, \quad \text {or}\quad r(\Gamma , \widetilde{[0,1/3^{2N+1}]}) \not =0. \end{aligned}$$

In the first case we define

$$\begin{aligned} \widetilde{A}_{p_1+1}=\widetilde{[0,1/3^{2N+1}]}, \end{aligned}$$

and we have

$$\begin{aligned} f(r(\Gamma ,\widetilde{A}_{p_1+1}))\, {\mathcal {H}}^{s}(\widetilde{A}_{p_1+1})=0. \end{aligned}$$
(10)

In the second case there exists a unique \(n^*>2N+1\) such that

$$\begin{aligned} r(\Gamma , \widetilde{[0,1/3^{2N+1}]})\in \widetilde{[2/3^{n^*},1/3^{n^*-1}]}. \end{aligned}$$

If \(n^*=2N+2\) we also define \(\widetilde{A}_{p_1+1}=\widetilde{[0,1/3^{2N+1}]}\), otherwise we define

$$\begin{aligned} \widetilde{A}_{p_1+1}=\widetilde{[0,1/3^{n^*-1}]}, \widetilde{A}_{p_1+2}=\widetilde{[2/3^{n^*-1},1/3^{n^*-2}]},\ldots , \widetilde{A}_{p_2}=\widetilde{[2/3^{2N+2},1/3^{2N+1}]}. \end{aligned}$$

Hence we have

$$\begin{aligned} f(r(\Gamma ,\widetilde{A}_{p_1+1}))\, {\mathcal {H}}^{s} (\widetilde{A}_{p_1+1})=\left\{ \begin{array}{ll}1/(N+1),&{}\text{ if }\ n^*=2N+2;\\ 2\cdot (-1)^{n^*}/n^*,&{}\text{ otherwise. }\end{array}\right. \end{aligned}$$

Consequently,

$$\begin{aligned} |f(r(\Gamma ,\widetilde{A}_{p_1+1}))\, {\mathcal {H}}^{s}(\widetilde{A}_{p_1+1})|<1. \end{aligned}$$
(11)

Thus, since \(p_1\) is even, by (9) and (11), it follows

$$\begin{aligned} \left| \sum _{i=p_1+1}^{p_2}f(r(\Gamma , \widetilde{A}_{i}))\, {\mathcal {H}}^{s}(\widetilde{A}_{i})\right|< & {} 1+\sum _{n=p_1+2}^{p_2}\frac{(-1)^n}{n}\nonumber \\< & {} 2+\sum _{n=p_1+2}^{\infty }\frac{(-1)^n}{n}. \end{aligned}$$
(12)

The third group of requested pairwise disjoint C-intervals that cover the portions of C contained in \([2/3^{2N-1},1]\) can be defined taking a generic system of pairwise disjoint C-intervals, \(\{\widetilde{A}_{i}\}_{i=p_2+1}^{p}\), such that \({\mathcal {H}}^{s}(\widetilde{A}_{i})<\delta\), for each i, and such that \(\widetilde{[2/3^{n},1/3^{n-1}]}=\bigcup _{i\in I_n}\widetilde{A}_{i}\), where \(I_n\subset \{p_2+1,\ldots ,p\}\) and \(1\le n\le 2N-1\).

By definition of f it follows \(f(r(\Gamma , \widetilde{A}_{i}))=f(r(\Gamma , \widetilde{[2/3^{n},1/3^{n-1}}]))=(-2)^n/n,\) for \(1\le n\le 2N-1\) and \(i\in I_n\). Thus

$$\begin{aligned} \sum _{i=p_2+1}^{p}f(r(\Gamma , \widetilde{A}_{i})\, {\mathcal {H}}^{s} (\widetilde{A}_{i})&= \sum _{n=1}^{2N-1}\frac{(-2)^n}{n}\, {\mathcal {H}}^{s}(\widetilde{[2/3^{n},1/3^{n-1}}])\nonumber \\&= \sum _{n=1}^{2N-1}\frac{(-1)^n}{n} \end{aligned}$$
(13)

In, we have defined the required system \(\{\widetilde{A}_{i}\}_{i=1}^{p}\) of pairwise disjoint C-intervals such that \({\mathcal {H}}^{s}(\widetilde{A}_{i})<\delta\), for each i, \(\bigcup _{i=1}^p\widetilde{A}_{i}=C\), and, by (9), (12), and (13), such that

$$\begin{aligned}{} & {} {\left| \sum _{i=1}^{p}f(r(\Gamma ,\widetilde{A}_{i}))\, {\mathcal {H}}^{s}(\widetilde{A}_{i})\right| }\\{} & {} \quad =\left| \sum _{i=1}^{p_1}f(r(\Gamma ,\widetilde{A}_{i}))\, {\mathcal {H}}^{s}(\widetilde{A}_{i})+\sum _{i=p_1+1}^{p_2}f(r(\Gamma ,\widetilde{A}_{i}))\, {\mathcal {H}}^{s}(\widetilde{A}_{i})+\sum _{i=p_2+1}^{p}f(r(\Gamma ,\widetilde{A}_{i}))\, {\mathcal {H}}^{s}(\widetilde{A}_{i})\right| \\{} & {} \quad>M+3+\sum _{n=2}^{\infty }\frac{(-1)^n}{n}-\left| \sum _{i=p_1+1}^{p_2}f(r(\Gamma ,\widetilde{A}_{i}))\, {\mathcal {H}}^{s}(\widetilde{A}_{i})\right| -\left| \sum _{i=p_2+1}^{p}f(r(\Gamma ,\widetilde{A}_{i}))\, {\mathcal {H}}^{s}(\widetilde{A}_{i})\right| \\{} & {} \quad>M+3+\sum _{n=2}^{\infty }\frac{(-1)^n}{n}-2-\sum _{n=N-k+3}^{\infty }\frac{(-1)^n}{n}-\sum _{n=1}^{2N-1}\frac{(-1)^n}{n}\\{} & {} \quad >M. \end{aligned}$$

This completes the proof.

4.2 Preliminaries to the proof of Theorem 6

The Hausdorff measure \({\mathcal {H}}^{s}\) is a Radon measure on an s-set E (see Mattila [27, Corollary 4.5]). Then, since E, endowed with the induced topology, is a compact Hausdorff space, Lusin’s theorem holds (see Folland [43, Theorem 7.10]):

Theorem 7

(Lusin’s theorem) Given a \({\mathcal {H}}^{s}\)-measurable function \(f:E \rightarrow {\mathbb {R}}\) and \(\varepsilon >0\) there exists \(S\subset E\) such that \({\mathcal {H}}^{s}(E{\setminus } S)<\varepsilon\) and \(f|_S\), the restriction of f on S, is continuous.

In what follows we need the following stronger version of Lusin’s theorem:

Lemma 1

Let T be a \({\mathcal {H}}^{s}\)-measurable subset of a closed s-set E. Given a \({\mathcal {H}}^{s}\)-measurable function \(f:E \rightarrow {\mathbb {R}}\) and \(\varepsilon >0\) there is a closed nowhere dense set V in T, such that \({\mathcal {H}}^{s}(T{\setminus } V)<\varepsilon\) and \(f|_{V}\) is continuous.

Proof

By Lusin’s theorem, there exists \(S\subset T\) such that \({\mathcal {H}}^{s}(T{\setminus } S)<\varepsilon /2\) and \(f|_S\) is continuous.

We can assume that the interior of S in the topology induced by T is empty. Otherwise we remove from its interior a countable dense subset and we get a set \(S^*\subset T\) such that \({\mathcal {H}}^{s}(T{\setminus } S^*)<\varepsilon /2\), \(f|_{S^*}\) is continuous and \(S^*\) has empty interior.

Since \({\mathcal {H}}^{s}\) is a Radon measure in S, we can find a set \(V\subset S\), closed in the topology induced by S, such that \({\mathcal {H}}^{s}(S{\setminus } V)<\varepsilon /2\). So V is a closed nowhere dense subset of T with \({\mathcal {H}}^{s}(T{\setminus } V)\le {\mathcal {H}}^{s}(T{\setminus } S)+{\mathcal {H}}^{s}(S{\setminus } V)<\varepsilon\) and \(f|_V\) is continuous. \(\square\)

4.3 Proof of Theorem 6

For each \(k\in {\mathbb {N}}\) let

$$\begin{aligned} F_k=\{t\in E: |f(t)|\le k\} \end{aligned}$$

We start by finding inductively a sequence \(\{V_n\}\) of closed nowhere dense sets such that \(V_n\subset V_{n+1}\), \(V_n\subset F_n\), \({\mathcal {H}}^{s}(F_n{\setminus } V_n)<1/2^n\), and \(f|_{V_n}\) is continuous, for each \(n\in {\mathbb {N}}\):

By Lemma 1 there is a closed nowhere dense set \(V_1\subset F_1\) such that \({\mathcal {H}}^{s}(F_1{\setminus } V_1)<1/2\), and \(f|_{V_1}\) is continuous.

Now, assume that \(V_1\subset V_2\subset \cdots \subset V_{n-1}\) have been defined, we proceed as follows. We apply Lemma 1 to the \({\mathcal {H}}^{s}\)-measurable function f, to the set \(F_{n}{\setminus } V_{n-1}\), and to the constant \(1/2^{n}\). So we find a closed nowhere dense set \(W\subset (F_{n}{\setminus } V_{n-1})\) such that \({\mathcal {H}}^{s}((F_{n}{\setminus } V_{n-1}){\setminus } W)<1/2^{n}\), and \(f|_W\) is continuous. We define \(V_{n}=V_{n-1}\cup W\). Then \(V_{n}\) is closed nowhere dense, \(V_{n-1}\subset V_{n}\), \(V_{n}\subset F_{n-1}\cup W\subset F_{n}\), \({\mathcal {H}}^{s}(F_{n}{\setminus } V_{n})={\mathcal {H}}^{s}((F_{n}{\setminus } V_{n-1}){\setminus } W)<1/2^{n}\), and \(f|_{V_n}\) is continuous.

Let \(V=\bigcup _nV_n\). Since \(V_n\) is closed nowhere dense in E, then \(E{\setminus } V_n\) is open and dense in E. Therefore, since, by Proposition 2, E is a complete metric space with respect the metric defined in (1), by Baire category theorem, \(E{\setminus } V\) is dense in E.

Let \(\{t_n\}\subset E{\setminus } V\) be dense in E.

We define inductively a trajectory \(\Gamma =\{\gamma _n\}\) of E, as follows:

We define \(\gamma _0=\min V_1\). Then, assumed that \(\gamma _1,\gamma _2,\ldots ,\gamma _{n-1}\) have been defined, let \(k_n\) be the first index such that \(t_n\) belongs to some connected component \(\widetilde{J}\) of \(E{\setminus } V_{k_n}\) and one of the extreme points of \(\widetilde{J}\) is not in \(\{\gamma _1,\gamma _2,\ldots ,\gamma _{n-1}\}\). We define \(\gamma _n\) as this extreme point.

Remark that, by the density of \(\{t_n\}\), \(\Gamma\) coincide with the class of all extreme points of the connected components of the open sets \(E{\setminus } V_1, \ldots , E{\setminus } V_n, \ldots\).

Now let \(\widetilde{J}\subset E\) be a C-interval. There exists \(n_{\widetilde{J}}\in {\mathbb {N}}\) such that \(\widetilde{J}\cap V_{n_{\widetilde{J}}}\not =\emptyset\). Moreover, since \(V_{n_{\widetilde{J}}}\) is nowhere dense, it is \(\widetilde{J}\not \subset V_{n_{\widetilde{J}}}\). Let \(\widetilde{I}\) be a connected component of \(E{\setminus } V_{n_{\widetilde{J}}}\) such that \(\widetilde{I}\cap \widetilde{J}\not =\emptyset\). Then \(\widetilde{J}\) contains at least one extreme point of \(\widetilde{I}\). As remarked before, this extreme point belongs to \(\Gamma\); consequently \(\Gamma\) is dense in E.

Remark that:

v):

given an E-interval \(\widetilde{J}\) and \(n\in {\mathbb {N}}\), the condition \(r(\Gamma ,\widetilde{J})\not \in V_n\) implies \(\widetilde{J}\cap V_n=\emptyset\).

In fact, by the definition of \(\Gamma\) there exists \(m>n\) such that \(r(\Gamma ,\widetilde{J})\in V_m\). Then \(r(\Gamma ,\widetilde{J})\) is one of the endpoints of some connected component \(\widetilde{I}\) of \(E{\setminus } V_{m}.\) Moreover, since \(V_n\subset V_m,\) there exists a connected component \(\widetilde{(a,b)}\) of \(E{\setminus } V_{n}\) such that \(\widetilde{I}\subset \widetilde{(a,b)}.\) By the definition of \(\Gamma\) it follows that the endpoints of \(\widetilde{(a,b)}\) belong to \(\Gamma\) and that both precede \(r(\Gamma ,\widetilde{J})\). Then \(\widetilde{(a,b)}\supset \widetilde{J}\), so \(\widetilde{J}\cap V_n=\emptyset\).

Now we prove that \(f\in sfr(E)_{\Gamma }\) and

$$\begin{aligned} \int _Ef\,d\, {\mathcal {H}}^{s}=(sfr)_{\Gamma }\int _Ef\,d\, {\mathcal {H}}^{s}. \end{aligned}$$

Given \(\varepsilon >0\), let N be such that

$$\begin{aligned} \int _{E{\setminus } V_{N}}(|f|+1)\,d\,{\mathcal {H}}^{s}\le \varepsilon ,\ \ \text{ and }\ \ \sum _{N}^{\infty }\frac{n+1}{2^n}\le \varepsilon . \end{aligned}$$
(14)

Since \(V_N\) is closed and \(f|_{V_N}\) is continuous, there exists a continuous function \(g:E\rightarrow [-N,N]\) such that \(g(t)=f(t)\), for each \(t\in V_N\); for example, we can take for g the unique extension of f from \(V_N\) to E such that g is linear on each connected component of \(E{\setminus } V_N\).

Then, g being s-Riemann integrable, there exists a positive constant \(\delta\) such that

$$\begin{aligned} \left| \sum _{i}g(r(\Gamma ,\widetilde{J}_i))\,{\mathcal {H}}^{s} (\widetilde{J}_i)-\int _Eg\,d{\mathcal {H}}^{s}\right| <\varepsilon , \end{aligned}$$
(15)

for each partition \(P=\{(\widetilde{J}_i,x_i)\}_{i=1}^p\) of E with \(x_i=r(\Gamma , \widetilde{J}_i)\) and \({\mathcal {H}}^{s}(\widetilde{J}_i)<\delta\), for \(i=1,2,\ldots ,p\).

For \(i=1,\ldots ,p\), we define

$$\begin{aligned} f_{P}&= f(r(\Gamma ,\widetilde{J}_i)),\ \textrm{on}\ \widetilde{J}_i;\\ g_{P}&= g(r(\Gamma ,\widetilde{J}_i)),\ \textrm{on}\ \widetilde{J}_i. \end{aligned}$$

Therefore

$$\begin{aligned} \int _Ef_{P}\,d\,{\mathcal {H}}^{s}=\sum _{i}f(r(\Gamma ,\widetilde{J}_i))\,{\mathcal {H}}^{s}(\widetilde{J}_i), \\ \int _Eg_{P}\,d\,{\mathcal {H}}^{s}=\sum _{i}g(r(\Gamma ,\widetilde{J}_i))\,{\mathcal {H}}^{s}(\widetilde{J}_i). \end{aligned}$$

Let \(t\in (\bigcup _n V_n){\setminus } V_N\), then there exists \(n\ge N\) such that \(t\in V_{n+1}{\setminus } V_n\), and there exists \(i=1,2,\ldots ,p\) such that \(t\in \widetilde{J}_i\). Consequently, by v) we infer \(r(\Gamma ,\widetilde{J}_i)\in V_{n+1}\). So \(|f_{P}(t)|=|f(r(\Gamma ,\widetilde{J}_i))|\le n+1\).

Thus, since \({\mathcal {H}}^{s}(E{\setminus } \bigcup _nV_n)=0\), we have

$$\begin{aligned} \int _{E{\setminus } V_N}|f_{P}|\,d\,{\mathcal {H}}^{s}\le & {} \sum _{N}^{\infty }(n+1)\, {\mathcal {H}}^{s}(V_{n+1}{\setminus } V_n)\nonumber \\\le & {} \sum _N^{\infty }(n+1)({\mathcal {H}}^{s}(F_{n+1} {\setminus } F_n)+{\mathcal {H}}^{s}(F_n{\setminus } V_n))\nonumber \\\le & {} \int _{E{\setminus } V_N}(|f|+1)\,d\,{\mathcal {H}}^{s}+ \sum _N^{\infty }\frac{n+1}{2^n}\nonumber \\\le & {} 2\varepsilon . \end{aligned}$$
(16)

Moreover

$$\begin{aligned} \int _{E{\setminus } V_N}|g_{P}|\,d\,{\mathcal {H}}^{s}\le & {} N\cdot {\mathcal {H}}^{s}(E{\setminus } V_N)\nonumber \\\le & {} N\cdot ({\mathcal {H}}^{s}(E{\setminus } F_N)+{\mathcal {H}}^{s}(F_N{\setminus } V_N))\nonumber \\\le & {} \int _{E{\setminus } F_N}|f|\,d\,{\mathcal {H}}^{s}+\frac{N}{2^N}\nonumber \\\le & {} 2\varepsilon . \end{aligned}$$
(17)

In, if \(P=\{(\widetilde{J}_i,x_i)\}_{i=1}^p\) is a partition of E with \(x_i=r(\Gamma , \widetilde{J}_i)\) and \({\mathcal {H}}^{s}(\widetilde{J}_i)<\delta\), for \(i=1,2,\ldots ,p\), by \({\mathcal {H}}^{s}(F_N{\setminus } V_N)<1/2^N\) and by (14), (15), (16) and (17) we have:

$$\begin{aligned}{} & {} \left| \sum _{i}f(r(\Gamma ,\widetilde{J}_i))\,{\mathcal {H}}^{s} (\widetilde{J}_i)-\int _Ef\,d\,{\mathcal {H}}^{s}\right| \\{} & {} \le \left| \sum _{i}(f(r(\Gamma ,\widetilde{J}_i))-g (r(\Gamma ,\widetilde{J}_i)))\,{\mathcal {H}}^{s}(\widetilde{J}_i)\right| \\{} & {} \ \ + \left| \sum _{i}g(r(\Gamma ,\widetilde{J}_i))\, {\mathcal {H}}^{s}(\widetilde{J}_i)-\int _Eg\,d\,{\mathcal {H}}^{s}\right| + \int _E|f-g|\,d\,{\mathcal {H}}^{s}\\{} & {} \le \int _E|f_{P}-g_{P}|\,d\,{\mathcal {H}}^{s}+\varepsilon +\int _{E{\setminus } V_N}|f-g|\,d\,{\mathcal {H}}^{s}\\{} & {} \le \int _{E{\setminus } V_N}|f_{P}|\,d\,{\mathcal {H}}^{s}+\int _{E{\setminus } V_N}|g_{P}|\,d\,{\mathcal {H}}^{s}+\varepsilon \\{} & {} \ \ +\int _{E{\setminus } V_N}|f|\,d\,{\mathcal {H}}^{s}+ \int _{E{\setminus } F_N}|g|\,d\,{\mathcal {H}}^{s}+ \int _{F_N{\setminus } V_N}|g|\,d\,{\mathcal {H}}^{s}\\{} & {} \le 5\,\varepsilon +\int _{E{\setminus } V_N}|f| \,d\,{\mathcal {H}}^{s}+\int _{E{\setminus } F_N}|g| \,d\,{\mathcal {H}}^{s}+\frac{N}{2^N}\\{} & {} \le 8\,\varepsilon . \end{aligned}$$

By the arbitrariness of \(\varepsilon\), this completes the proof.

5 Conclusion

In [18] a calculus based on fractal subsets of the real line is formulated. In this calculus, called \(F^{s}\)-calculus, as mentioned in the introduction a crucial role is played by the mass function that makes the \(F^{s}\)-calculus algorithmic in nature so to be the best for the applications in various fields of science. Another crucial role, in the \(F^{s}\)-calculus, is given by s-Riemann integral. However s-Riemann integral is not the best integral to solve the problem of primitives, that is the problem of recovering a function from its derivative (i.e. the problem of whether every derivative is integrable). Therefore, our goal has been to establish an optimized version of the Fundamental Theorem of Calculus on compact fractal subset of the real line, comparable to the traditional real line framework. So, we have investigated whether an s-first return integration process, which is closely akin to that of s-Riemann integration, might solve the problem of primitives. We showed that this is not the case, but we necessitate the incorporation of a specialized type of s-Henstock–Kurzweil integral. Moreover, since, as stressed, the Fractal calculus is algorithmic in nature and it provides a more efficient method than other approaches, we can conjecture that even in the more general case of s-Henstock Kurzweil integral or of s-first return integral (through the introduction of a new measure in which the mass function appears, see [23, 35]) we can obtain various applications in the field of medicine as well as in the field of electrical and mechanical engineering. So, despite the countless applications mentioned in the introduction, by addressing the challenges associated with measures on fractal structures, we aspire to contribute to the advancement of mathematical frameworks applicable to non-differentiable and non-integrable measures, thereby enriching the broader landscape of calculus on fractal subset of the real line.