1 Introduction

In this paper, we study the ACL- and ACC-characterizations of Orlicz–Sobolev spaces \(W^{1,\varphi }(\varOmega )\), where \(\varphi \) has generalized Orlicz growth and \(\varOmega \subset {\mathbb {R}}^n\) is an open set. ACL stands for absolutely continuous on lines and ACC for absolutely continuous on curves. Special cases of Orlicz growth include the constant exponent case \(\varphi (x,t) = t^p\), the Orlicz case \(\varphi (x,t) = \varphi (t)\), the variable exponent case \(\varphi (x,t) = t^{p(x)}\), and the double phase case \(\varphi (x,t) = t^p + a(x) t^q\). Generalized Orlicz and Orlicz–Sobolev spaces on \({\mathbb {R}}^n\) have been recently studied for example in [4, 5, 13], and in a more general setting in [1, 12]. ACC-characterization has been used for example in [9] to study properties of capacities in the variable exponent case.

The ACL-characterization of the classical constant exponent Sobolev spaces was given by Nikodym [11]. It states that a function \(u \in L^p(\varOmega )\) belongs to \(W^{1,p}(\varOmega )\) if and only if it has representative \({\tilde{u}}\) that is absolutely continuous on almost every line segment parallel to the coordinate axes and the classical partial derivatives of \({\tilde{u}}\) belong to \(L^p(\varOmega )\). Moreover the classical partial derivatives are equal to the weak partial derivatives. Fuglede [6] gave a finer version of this characterization, namely, the ACC-characterization. The ACC-characterization states that a function \(u \in L^p(\varOmega )\) belongs to \(W^{1,p}(\varOmega )\) if and only if it has representative \({\tilde{u}}\) that is absolutely continuous on every rectifiable curve outside a family of zero p-modulus and the (classical) partial derivatives \({\tilde{u}}\) belong to \(L^p(\varOmega )\).

In [8], it was shown that variable exponent Sobolev space \(W^{1,p(\cdot )}(\varOmega )\) also has the ACL- and ACC-characterizations, if the exponent satisfies suitable conditions and \(C^1(\varOmega )\) functions are dense. In Section 8 of [12], it was shown that the results hold in the space \(W^{1,\varphi }({\mathbb {R}}^n)\), if \(C^1({\mathbb {R}}^n)\)-functions are dense and \(\varphi \) satisfies certain conditions. In this paper, we generalize the results even further. We show that the results hold for the space \(W^{1,\varphi }(\varOmega )\), and we do so using fewer assumptions than in [8] or [12]. There are two assumptions we need to make: First that \(C^1(\varOmega )\) functions are dense in \(W^{1,\varphi }(\varOmega )\). And second, that \(\varphi (x,\beta ) \ge 1\) for some \(\beta > 0\) and almost every \(x \in \varOmega \). To best of our knowledge, the results are new even in the special cases of Orlicz and double phase growth.

We base our approach on [8], but make some modifications to both make the results more general and simplify some of the results. One difference is that we use a slightly different definition for the modulus of a curve family. Our definition of is based on the norm, while the definition in [8] is based on the modular. The reason for defining the modulus differently has to do with the fact that modular convergence is a weaker concept than norm convergence. Another difference with [8] is that we do not use the theory of capacities. This has two advantages: First, the use of capacities would force us to make some extra assumptions on \(\varphi \). Second, we can prove our results directly in \(W^{1,\varphi }(\varOmega )\), for any \(\varOmega \subset {\mathbb {R}}^n\), whereas in [8] the results are first proven in the case \(\varOmega = {\mathbb {R}}^n\), and this case is then used to prove the results for \(\varOmega \subset {\mathbb {R}}^n\).

The structure of this paper is as follows: Sect. 2 covers preliminaries about generalized Orlicz and Orlicz–Sobolev spaces. In Sect. 3 we define and discuss the modulus of a curve family. In Sect. 4 we prove two lemmas, which we will need in order to prove our main results. In Sect. 5 we prove our main results, the ACL- and ACC-characterizations of \(W^{1,\varphi }(\varOmega )\).

Let us say a few words about why one might be interested in studying ACL- or ACC-characterizations. One reason is that ACL-functions have classical partial derivatives almost everywhere, and ACC-functions are a subclass of ACL-functions under the assumptions we use. ACL- and ACC-functions also have some nice closure properties, for example the product and the maximum of two ACC-funtions is an ACC-function, and the composition of an ACC-function with a Lipschitz function is an ACC-function, and similar results hold for ACL. Another reason for studying ACC-characterization in particular is that the theory can be applied in a more general setting. In a general metric space, the concept of direction does not really make sense, so the concept of an ACL-functions cannot be used. But the concept of an ACC-function can still be defined, and has been used in the study of Newtonian spaces on general metric spaces, see [3, 10] for example.

2 Preliminaries

Throughout this paper, we assume that \(\varOmega \subset {\mathbb {R}}^n\) is an open set. The following definitions are as in [7], which we use as a general reference to background theory in generalized Orlicz spaces.

Definition 2.1

We say that \(\varphi : \varOmega \times [0, \infty ) \rightarrow [0, \infty ]\) is a weak \(\varPhi \)-function, and write \(\varphi \in \varPhi _w(\varOmega )\), if the following conditions hold

  • For every measurable \(f: \varOmega \rightarrow [-\infty , \infty ]\) the function \(x \mapsto \varphi (x, |f|)\) is measurable, and for every \(x \in \varOmega \) the function \(t \mapsto \varphi (x, t)\) is non-decreasing.

  • \(\varphi (x, 0) = \lim _{t \rightarrow 0^+} \varphi (x,t) =0\) and \(\lim _{t \rightarrow \infty }\varphi (x,t)=\infty \) for every \(x\in \varOmega \).

  • The function \(t \mapsto \frac{\varphi (x, t)}{t}\) is L-almost increasing for \(t>0\) uniformly in \(\varOmega \). “Uniformly” means that L is independent of x.

If \(\varphi \in \varPhi _w(\varOmega )\) is additionally convex and left-continuous, then \(\varphi \) is a convex \(\varPhi \)-function, and we write \(\varphi \in \varPhi _c(\varOmega )\).

Two functions \(\varphi \) and \(\psi \) are equivalent, \(\varphi \simeq \psi \), if there exists \(L\ge 1\) such that \(\psi (x,\frac{t}{L})\le \varphi (x, t)\le \psi (x, Lt)\) for every \(x \in \varOmega \) and every \(t>0\). Equivalent \(\varPhi \)-functions give rise to the same space with comparable norms.

We define the left-inverse of \(\varphi \) by setting

$$\begin{aligned} \varphi ^{-1}(x,\tau ) := \inf \{t \ge 0 : \varphi (x,t) \ge \tau \}. \end{aligned}$$

2.1 Assumptions

We state some assumptions for later reference.

(A0):

There exists \(\beta \in (0,1)\) such that \(\varphi (x, \beta ) \le 1 \le \varphi (x,1/\beta )\) for almost every x.

(A1):

There exists \(\beta \in (0,1)\) such that, for every ball B and a.e. \(x,y\in B \cap \varOmega \),

$$\begin{aligned} \beta \varphi ^{-1}(x, t) \le \varphi ^{-1} (y, t) \quad \text {when}\quad t \in \left[ 1, \frac{1}{|B|}\right] . \end{aligned}$$
(A2):

For every \(s > 0\) there exist \(\beta \in (0, 1]\) and \(h \in L^1(\varOmega ) \cap L^\infty (\varOmega )\) such that

$$\begin{aligned} \beta \varphi ^{-1}(x,t) \le \varphi ^{-1}(y,t) \end{aligned}$$

for almost every \(x, y \in \varOmega \) and every \(t \in [h(x) + h(y), s]\).

(aInc)\(_p\):

There exist \(L\ge 1\) such that \(t \mapsto \frac{\varphi (x,t)}{t^{p}} \) is L-almost increasing in \((0,\infty )\).

(aDec)\(_q\):

There exist \(L\ge 1\) such that \(t \mapsto \frac{\varphi (x,t)}{t^{q}} \) is L-almost decreasing in \((0,\infty )\).

We say that \(\varphi \) satisfies (aInc), if it satisfies (aInc)\(_p\) for some \(p>1\). Similarly, \(\varphi \) satisfies (aDec), if it satisfies (aDec)\(_q\) for some \(q>1\). We write (Inc) if the ratio is increasing rather than just almost increasing, similarly for (Dec). See [7, Table 7.1] for an interpretation of the assumptions in some special cases.

2.2 Generalized Orlicz spaces

We recall some definitions. We denote by \(L^0(\varOmega )\) the set of measurable functions in \(\varOmega \).

Definition 2.2

Let \(\varphi \in \varPhi _w(\varOmega )\) and define the modular \(\varrho _\varphi \) for \(f\in L^0(\varOmega )\) by

$$\begin{aligned} \varrho _\varphi (f) := \int _\varOmega \varphi (x, |f(x)|)\,dx. \end{aligned}$$

The generalized Orlicz space, also called Musielak–Orlicz space, is defined as the set

$$\begin{aligned} L^\varphi (\varOmega ) := \big \{f \in L^0(\varOmega ) :\lim _{\lambda \rightarrow 0^+} \varrho _\varphi (\lambda f) = 0\big \} \end{aligned}$$

equipped with the (Luxemburg) norm

$$\begin{aligned} \Vert f\Vert _{L^\varphi (\varOmega )} := \inf \left\{ \lambda >0 :\varrho _\varphi \left( \frac{f}{\lambda } \right) \le 1\right\} . \end{aligned}$$
(2.1)

If the set is clear from the context we abbreviate \(\Vert f\Vert _{L^\varphi (\varOmega )}\) by \(\Vert f\Vert _{\varphi }\).

The following lemma is a direct consequence of the proof of [7, Theorem 3.3.7].

Lemma 2.3

If \((f_i)\) is a Cauchy sequence in \(L^\varphi (\varOmega )\) such that the pointwise limit \(f(x) := \lim _{i\rightarrow \infty } f_i(x)\) (\(\pm \infty \) allowed) exists for almost every \(x \in \varOmega \), then f is the limit of \((f_i)\) in \(L^\varphi (\varOmega )\).

Definition 2.4

A function \(u \in L^\varphi (\varOmega )\) belongs to the Orlicz–Sobolev space \(W^{1, \varphi }(\varOmega )\) if its weak partial derivatives \(\partial _1 u, \ldots , \partial _n u\) exist and belong to the space \(L^{\varphi }(\varOmega )\). For \(u \in W^{1,\varphi }(\varOmega )\), we define the norm

$$\begin{aligned} \Vert u \Vert _{W^{1,\varphi }(\varOmega )} := \Vert u \Vert _{\varphi } + \Vert \nabla u \Vert _{\varphi }. \end{aligned}$$

Here \(\Vert \nabla u \Vert _{\varphi }\) is short for \(\big \Vert | \nabla u | \big \Vert _{\varphi }\). Again, if \(\varOmega \) is clear from the context, we abbreviate \(\Vert u \Vert _{W^{1,\varphi }(\varOmega )}\) by \(\Vert u \Vert _{1,\varphi }\).

Many of our results need the assumption that \(C^1(\varOmega )\)-functions are dense in \(W^{1,\varphi }(\varOmega )\). A sufficient condition is given by [7, Theorem 6.4.7], which states that \(C^\infty (\varOmega )\)-functions are dense in \(W^{1,\varphi }(\varOmega )\), if \(\varphi \) satisfies (A0), (A1), (A2) and (aDec). By [7, Lemma 4.2.3], (A2) can be omitted, if \(\varOmega \) is bounded.

3 Modulus of a family of curves

By a curve, we mean any continuous function \(\gamma : I \rightarrow {\mathbb {R}}^n\), where \(I = [a,b]\) is a closed interval. If a curve \(\gamma \) is rectifiable, we may assume that \(I = [0,\ell (\gamma )]\), where \(\ell (\gamma )\) denotes the length of \(\gamma \). We denote the image of \(\gamma \) by \({\text {Im}}(\gamma )\), and by \(\varGamma _{{\textit{rect}}}(\varOmega )\) we denote the family of all rectifiable curves \(\gamma \) such that \({\text {Im}}(\gamma ) \subset \varOmega \). Let \(\varGamma \subset \varGamma _{{\textit{rect}}}(\varOmega )\). We say that a Borel function \(u: \varOmega \rightarrow [0,\infty ]\) is \(\varGamma \)-admissible, if

$$\begin{aligned} \int _\gamma u \,ds \ge 1 \end{aligned}$$

for all \(\gamma \in \varGamma \), where ds denotes the integral with respect to curve length. We denote the set of all \(\varGamma \)-admissible functions by \(F_{{\textit{adm}}}(\varGamma )\).

Definition 3.1

Let \(\varGamma \subset \varGamma _{{\textit{rect}}}(\varOmega )\). Let \(\varphi \in \varPhi _w(\varOmega )\). We define the \(\varphi \)-modulus of \(\varGamma \) by

$$\begin{aligned} {\text {M}}_{\varphi }(\varGamma ) := \inf _{u\in F_{{\textit{adm}}}(\varGamma )} \Vert u\Vert _\varphi . \end{aligned}$$

If \(F_{{\textit{adm}}}(\varGamma ) = \emptyset \), we set \({\text {M}}_{\varphi }(\varGamma ) := \infty \). A family of curves \(\varGamma \) is exceptional, if \({\text {M}}_{\varphi }(\varGamma ) = 0\).

The definition above is as in [10]. The following lemma gives some useful properties of the modulus. Items (a) and (b) are items (a) and (c) of [10, Lemma 4.5], and item (c) is a consequence of [10, Proposition 4.8]. To use the lemma, we must check that \(L^{\varphi }(\varOmega )\) satisfies conditions (P0), (P1), (P2) and (RF) stated at the beginning of section 2 in [10]. The conditions (P0), (P1) and (P2) are easy to check. For (RF) to hold, there must exists \(c \ge 1\) such that

$$\begin{aligned} \left\| \sum _{i=1}^\infty u_i \right\| _\varphi \le \sum _{i=1}^\infty c^{i}\Vert u_i\Vert _\varphi \end{aligned}$$

holds for non-negative \(u_i \in L^\varphi (\varOmega )\). This is an easy consequence of [7, Lemma 3.2.5], which states that there exists \(c \ge 1\) such that

$$\begin{aligned} \left\| \sum _{i=1}^\infty u_i \right\| _\varphi \le c\sum _{i=1}^\infty \Vert u_i\Vert _\varphi . \end{aligned}$$

Lemma 3.2

Let \(\varphi \in \varPhi _w(\varOmega )\), then the \(\varphi \)-modulus has the following properties:

  1. (a)

    if \(\varGamma _1 \subset \varGamma _2\), then \({\text {M}}_{\varphi }(\varGamma _1) \le {\text {M}}_{\varphi }(\varGamma _2)\),

  2. (b)

    if \({\text {M}}_{\varphi }(\varGamma _i) = 0\) for every \(i \in {\mathbb {N}}\), then \({\text {M}}_{\varphi }(\bigcup _{i=1}^\infty \varGamma _i) = 0\).

  3. (c)

    \({\text {M}}_{\varphi }(\varGamma ) = 0\) if and only if there exists a non-negative Borel function \(u \in L^\varphi (\varOmega )\) such that \(\int _\gamma u \,ds = \infty \) for every \(\gamma \in \varGamma \).

In [6], the \(L^p\)-modulus was originally defined by

$$\begin{aligned} {\text {M}}_p(\varGamma ) := \inf _{u \in F_{{\textit{adm}}}(\varGamma )} \int _\varOmega u^p \,dx. \end{aligned}$$

This differs from Definition 3.1 in that the infimum is taken over the modulars of admissible functions instead of their norms. A similar approach was taken in the variable exponent case in [8]. Following the original approach, we could have defined the modulus by

$$\begin{aligned} {\widetilde{{\text {M}}}_{\varphi }}(\varGamma ) := \inf _{u\in F_{{\textit{adm}}}(\varGamma )} \int _{\varOmega } \varphi (x, u(x)) \,dx. \end{aligned}$$

In the case \(\varphi (x,t) = t^p\), where \(1\le p<\infty \), we have \({\widetilde{{\text {M}}}_{\varphi }}(\varGamma ) = {\text {M}}_{\varphi }(\varGamma )^p\). Thus in this special case \({\widetilde{{\text {M}}}_{\varphi }}(\varGamma ) = 0\) if and only if \({\text {M}}_{\varphi }(\varGamma ) = 0\). Since we are only interested in whether a family of curves is exceptional or not, in this case it does not matter whether we use \({\text {M}}_{\varphi }\) or \({\widetilde{{\text {M}}}_{\varphi }}\).

In the general case, the situation is somewhat more complicated. Let \(\varphi \in \varPhi _w(\varOmega )\). By [7, Corollary 3.2.8], if \(\Vert u\Vert _\varphi < 1\), then \(\varrho _\varphi (u) \lesssim \Vert u\Vert _\varphi \). Thus \({\text {M}}_{\varphi }(\varGamma ) = 0\) implies \({\widetilde{{\text {M}}}_{\varphi }}(\varGamma ) = 0\). The converse implication does not necessarily hold, as the next example shows, which is the main reason for using norms instead of modulars in Definition 3.1.

Example 3.3

Define \(\varphi \in \varPhi _w({\mathbb {R}}^2)\) by

$$\begin{aligned} \varphi (x,t) := \left\{ \begin{array}{ll} 0 &{}\quad \text {if}\;t\le 1, \\ t-1 &{} \quad \text {if}\;t>1. \end{array}\right. \end{aligned}$$

For \(y \in [0,1]\), let \(\gamma _y:[0,1]\rightarrow {\mathbb {R}}^2,z\mapsto (y,z)\), and let \(\varGamma := \{\gamma _y: y \in [0,1]\}\). Let \(u = 1\) everywhere. Then

$$\begin{aligned} \int _\gamma u(s) \,ds = 1 \end{aligned}$$

for every \(\gamma \in \varGamma \), and therefore \(u \in F_{{\textit{adm}}}(\varGamma )\). Since \(\varphi (x,u(x)) = 0\) for every \(x \in {\mathbb {R}}^2\), we have \(\varrho _\varphi (u) = 0\), and thus \({\widetilde{{\text {M}}}_{\varphi }}(\varGamma ) = 0\).

To show that \({\text {M}}_{\varphi }(\varGamma ) > 0\), suppose on the contrary, that \({\text {M}}_{\varphi }(\varGamma ) = 0\). Then by Lemma 3.2(c) there exists some \(v \in L^\varphi ({\mathbb {R}}^2)\) such that \(\int _\gamma v \,ds = \infty \) for every \(\gamma \in \varGamma \). Thus

$$\begin{aligned} \int _{[0,1]} v(y,z) \,dz = \int _{\gamma _y} v \,ds = \infty \end{aligned}$$

for every \(y \in [0,1]\). Let \(\lambda > 0\). Since \(\varphi (x,t) \ge t-1\) for every \(x \in {\mathbb {R}}^2\) and every \(t \ge 0\), Fubini’s theorem implies that

$$\begin{aligned} \int _{{\mathbb {R}}^2} \varphi (x,\lambda v(x)) \,dx \ge \int _{[0,1]}\int _{[0,1]} \lambda v(y,z) - 1 \,dz\,dy = \infty -\int _{[0,1]}\int _{[0,1]} 1 \,dz\,dy = \infty \end{aligned}$$

Since \(\lambda > 0\) was arbitrary, it follows by (2.1) that \(\Vert v\Vert _\varphi = \infty \). But this is impossible, since \(v \in L^\varphi ({\mathbb {R}}^2)\). Thus the assumption that \({\text {M}}_{\varphi }(\varGamma ) = 0\) must be wrong and \({\text {M}}_{\varphi }(\varGamma ) > 0\).

Note that if \(\varphi \in \varPhi _w(\varOmega )\) satisfies (aDec)\(_q\) for \(1\le q<\infty \), then, by [7, Lemma 3.2.9] (since \(\varphi \) satisfies (aInc)\(_1\) by definition) we have

$$\begin{aligned} \Vert u\Vert _\varphi \lesssim \max \{\varrho _\varphi (u),\varrho _\varphi (u)^{\frac{1}{q}}\}. \end{aligned}$$

Thus, if \(\varphi \) satisfies (aDec), then \({\widetilde{{\text {M}}}_{\varphi }}(\varGamma ) = 0\) if and only if \({\text {M}}_{\varphi }(\varGamma ) = 0\).

4 Fuglede’s lemma

Lemma 4.1

(Fuglede’s lemma) Let \(\varphi \in \varPhi _w(\varOmega )\), and let \((u_i)\) be a sequence of non-negative Borel functions converging to zero in \(L^\varphi (\varOmega )\). Then there exists a subsequence \((u_{i_k})\) and an exceptional set \(\varGamma \subset \varGamma _{{\textit{rect}}}(\varOmega )\) such that for all \(\gamma \notin \varGamma \) we have

$$\begin{aligned} \lim _{k\rightarrow \infty } \int _\gamma u_{i_k} \,ds = 0. \end{aligned}$$

Proof

Let \((v_k) := (u_{i_k})\) be a subsequence of \((u_i)\), such that

$$\begin{aligned} \Vert v_k\Vert _\varphi \le 2^{-k}. \end{aligned}$$

Let \(\varGamma \subset \varGamma _{{\textit{rect}}}(\varOmega )\) be the family of curves \(\gamma \), such that \(\int _\gamma v_k \,ds \nrightarrow 0\) as \(k \rightarrow \infty \). For every \(j \in {\mathbb {N}}\), let

$$\begin{aligned} w_j := \sum _{k=1}^j v_k. \end{aligned}$$

Since every \(v_k\) is a non-negative Borel function, it follows that every \(w_j\) is also a non-negative Borel function. And since the sequence \((w_j(x))\) is increasing for every \(x\in \varOmega \), it follows that the limit \(w(x) := \lim _{j\rightarrow \infty }w_j(x)\) (possibly \(\infty \)) exists. By [7, Corollary 3.2.5], if \(j<m\), then

$$\begin{aligned} \Vert w_m-w_j\Vert _\varphi =\left\| \sum _{k=j+1}^m v_k \right\| _\varphi \le \sum _{k=j+1}^m \Vert v_k \Vert _\varphi \le \sum _{k=j+1}^m 2^{-k} < 2^{-j}, \end{aligned}$$

which implies that \((w_j)\) is a Cauchy sequence in \(L^\varphi (\varOmega )\). By Lemma 2.3, w is the limit of \((w_j)\) in \(L^\varphi (\varOmega )\), which implies that \(w \in L^\varphi (\varOmega )\), and therefore \(\Vert w \Vert _\varphi < \infty \).

Suppose now that \(\gamma \in \varGamma \). Then

$$\begin{aligned} \int _\gamma w \,ds = \sum _{k=1}^\infty \int _\gamma v_k \,ds = \infty , \end{aligned}$$

because \(\sum _{k=1}^\infty \int _\gamma v_k \,ds < \infty \) would imply that \(\lim _{k\rightarrow \infty }\int _\gamma v_k \,ds = 0\). Thus w/m is \(\varGamma \)-admissible for every \(m\in {\mathbb {N}}\). Since \(\lim _{m\rightarrow \infty } \Vert w/m\Vert _\varphi = \lim _{m\rightarrow \infty } \Vert w\Vert _\varphi / m = 0\), we have \({\text {M}}_{\varphi }(\varGamma ) = 0\). \(\square \)

Let \(E \subset \varOmega \). We denote by \(\varGamma _E\) the set of all curves \(\gamma \in \varGamma _{{\textit{rect}}}(\varOmega )\), such that the \(E \cap {\text {Im}}(\gamma )\) is nonempty.

The next lemma is, in a sense, a combination of [8, Lemma 3.1] and [2, Lemma 5.1]. The former of the aforementioned lemmas states that if \(C^1({\mathbb {R}}^n)\) functions are dense in the variable exponent Sobolev space \(W^{1,p(\cdot )}({\mathbb {R}}^n)\) and \(1< p^{-}\le p^+ < \infty \), then \(\varGamma _E\) is exceptional whenever \(E \subset {\mathbb {R}}^n\) is of capacity zero. The latter states that if \(\varphi \in \varPhi _w({\mathbb {R}}^n)\) satisfies (aInc) and (aDec), then for every Cauchy sequence in \(C({\mathbb {R}}^n) \cap W^{1,\varphi }({\mathbb {R}}^n)\) there exists a subsequence which converges pointwise outside a set of zero capacity. The beginning of the proof of our lemma is similar to [2, Lemma 5.1], but then we use the ideas from [8, Lemma 3.1] and modify the proof to replace convergence outside a set of capacity zero by convergence outside a set E, such that \(\varGamma _E\) is exceptional. The reason that we do not simply prove a direct generalization of [8, Lemma 3.1] and then use [2, Lemma 5.1] is, that our proof avoids the use of capacities. This has two advantages: First, we can drop the assumptions (aInc) and (aDec). And second, our new result works in \(W^{1,\varphi }(\varOmega )\) for any \(\varOmega \subset {\mathbb {R}}^n\), while in [8, Lemma 3.1] and [2, Lemma 5.1] we have \(\varOmega = {\mathbb {R}}^n\).

Lemma 4.2

Let \(\varphi \in \varPhi _w(\varOmega )\) and let \((u_i)\) be a Cauchy sequence of functions in \(C^1(\varOmega )\cap W^{1,\varphi }(\varOmega )\). Then there exists a set E and a subsequence \((u_{i_k})\) such that \({\text {M}}_{\varphi }(\varGamma _E) = |E| = 0\) and \((u_{i_k})\) converges pointwise everywhere outside E.

Proof

By [7, Lemma 3.3.6] there exists a subsequence of \((u_i)\) that converges pointwise almost everywhere. Thus we can choose a subsequence \((v_k) := (u_{i_k})\), such that \((v_k)\) converges pointwise almost everywhere, and

$$\begin{aligned} \Vert v_{k+1} - v_k \Vert _{1,\varphi } < 4^{-k} \end{aligned}$$

for every \(k \in {\mathbb {N}}\). For every \(k \in {\mathbb {N}}\), let \(f_k:= 2^k(v_{k+1} - v_k)\in C^1(\varOmega ) \cap W^{1,\varphi }(\varOmega )\). For every \(j \in {\mathbb {N}}\), let

$$\begin{aligned} g_j := \sum _{k=1}^j |f_k| \quad \text {and}\quad h_j := \sum _{k=1}^j |\nabla f_k|. \end{aligned}$$

Since the sequences \((g_j(x))\) and \((h_j(x))\) are increasing for every \(x \in \varOmega \), the limits \(g(x) := \lim _{j\rightarrow \infty } g_j(x)\) and \(h(x) :=\lim _{j\rightarrow \infty } h_j(x)\) (possibly \(\infty \)) exist. Since the functions \(g_j\) are continuous, g is a Borel function. If \(j<m\), then by [7, Corollary 3.2.5]

$$\begin{aligned} \Vert g_m -g_j\Vert _{\varphi } \lesssim \sum _{k=j+1}^m \Vert f_k\Vert _{\varphi } \le \sum _{k=j+1}^\infty \Vert f_k\Vert _{1,\varphi } < \sum _{k=j+1}^\infty 2^{-k} = 2^{-j}, \end{aligned}$$

which implies that \((g_j)\) is a Cauchy sequence in \(L^{\varphi }(\varOmega )\). By Lemma 2.3, g is the limit of \((g_j)\) in \(L^\varphi (\varOmega )\). Similarly, since

$$\begin{aligned} \Vert h_m-h_j\Vert _\varphi \lesssim \sum _{k=j+1}^m \Vert \nabla f_k\Vert _{\varphi } \le \sum _{k=j+1}^\infty \Vert f_k\Vert _{1,\varphi } < 2^{-j}, \end{aligned}$$

we find that h is the limit of \(h_j\) in \(L^\varphi (\varOmega )\).

Since \(f_k \in C^1(\varOmega )\), for any \(k\in {\mathbb {N}}\) we have

$$\begin{aligned} \big | |f_k(x)| - |f_k(y)|\big | \le |f_k(x) - f_k(y)| \le \int _\gamma |\nabla f_k| \,ds \end{aligned}$$

for every \(x,y\in \varOmega \) and any \(\gamma \in \varGamma _{{\textit{rect}}}(\varOmega )\) containing x and y. Thus for every \(j \in {\mathbb {N}}\) we have

$$\begin{aligned} |g_j(x)-g_j(y)| \le \sum _{k=1}^j \big | |f_k(x)| - |f_k(y)|\big | \le \sum _{k=1}^j \int _\gamma |\nabla f_k| \,ds = \int _\gamma h_j \,ds, \end{aligned}$$
(4.1)

for every \(x,y\in \varOmega \) and any \(\gamma \in \varGamma _{{\textit{rect}}}(\varOmega )\) containing x and y.

Denote by E the set of points \(x \in \varOmega \) such that the sequence \((v_k(x))\) does not converge. Since \((v_k)\) converges pointwise almost everywhere, we have \(|E| = 0\). It is easy to see that if \(x \in E\), then \(x \in \{|f_k| > 1\}\) for infinitely many \(k \in {\mathbb {N}}\), and therefore \(g(x) = \infty \). Thus

$$\begin{aligned} E \subset E_\infty := \{x \in \varOmega : g(x) = \infty \}, \end{aligned}$$

and \(\varGamma _E \subset \varGamma _{E_\infty }\). Next we construct a set \(\varGamma \subset \varGamma _{{\textit{rect}}}(\varOmega )\) such that \(\varGamma _{E_\infty } \subset \varGamma \) and \({\text {M}}_{\varphi }(\varGamma ) = 0\). It then follows by Lemma 3.2(a) that \({\text {M}}_{\varphi }(\varGamma _E) = {\text {M}}_{\varphi }(\varGamma _{E_\infty }) = 0\).

By Lemma 4.1, considering a subsequence if necessary, we find an exceptional set \(\varGamma _1 \subset \varGamma _{{\textit{rect}}}(\varOmega )\) such that

$$\begin{aligned} \lim _{j\rightarrow \infty } \int _\gamma h - h_j \,ds = 0 \end{aligned}$$

for every \(\gamma \in \varGamma _{{\textit{rect}}}(\varOmega ) {\setminus } \varGamma _1\). Let

$$\begin{aligned} \varGamma _2 := \left\{ \gamma \in \varGamma _{{\textit{rect}}}(\varOmega ) : \int _\gamma g \,ds = \infty \right\} \quad \text {and} \quad \varGamma _3 := \left\{ \gamma \in \varGamma _{{\textit{rect}}}(\varOmega ) : \int _\gamma h \,ds = \infty \right\} . \end{aligned}$$

For every \(m \in {\mathbb {N}}\), the function g/m is \(\varGamma _2\) admissible, hence \({\text {M}}_{\varphi }(\varGamma _2) \le \Vert g \Vert _\varphi / m\). Thus it follows that \({\text {M}}_{\varphi }(\varGamma _2) = 0\). Similarly, we see that \({\text {M}}_{\varphi }(\varGamma _3) = 0\). Let \(\varGamma := \varGamma _1 \cup \varGamma _2 \cup \varGamma _3\). By Lemma 3.2(b) \({\text {M}}_{\varphi }(\varGamma ) = 0\).

It remains to show that \(\varGamma _{E_\infty } \subset \varGamma \). Suppose that \(\gamma \in \varGamma _{{\textit{rect}}}(\varOmega ){\setminus }\varGamma \). Since \(\gamma \notin \varGamma _2\), there must exist some \(y \in {\text {Im}}(\gamma )\) with \(g(y) < \infty \). By (4.1), for any \(x \in {\text {Im}}(\gamma )\) and any \(j \in {\mathbb {N}}\) we have

$$\begin{aligned} g_j(x) \le g_j(y) + |g_j(x) - g_j(y)| \le g_j(y) + \int _\gamma h_j \,ds. \end{aligned}$$

Since \(\gamma \notin \varGamma _1\), it follows that

$$\begin{aligned} \lim _{j\rightarrow \infty } \int _\gamma h_j \,ds = \int _\gamma h \,ds, \end{aligned}$$

where the right-hand side is finite because \(\gamma \notin \varGamma _3\). Thus we have

$$\begin{aligned} g(x) = \lim _{j\rightarrow \infty } g_j(x) \le \lim _{j\rightarrow \infty } \left( g_j(y) + \int _\gamma h_j \,ds \right) = g(y) + \int _\gamma h \,ds < \infty . \end{aligned}$$

Since \(x \in {\text {Im}}(\gamma )\) was arbitrary, it follows that \(\gamma \notin \varGamma _{E_\infty }\). And since \(\gamma \notin \varGamma \) was arbitrary, it follows that \(\varGamma _{E_\infty } \subset \varGamma \). \(\square \)

5 Fuglede’s Theorem

We begin this section by defining some notations. Let \(k \in \{1,2,\dots ,n\}\). If \(z \in {\mathbb {R}}\) and \(y = (y_1,y_2,\dots ,y_{n-1}) \in {\mathbb {R}}^{n-1}\) we define

$$\begin{aligned} (y,z)_k := (y_1,\dots ,y_{k-1},z,y_{k},\dots ,y_{n-1}) \in {\mathbb {R}}^n. \end{aligned}$$

For every \(x = (x_1,x_2,\dots ,x_n) \in {\mathbb {R}}^n\), we write \({\tilde{x}}_k := (x_1,\dots ,x_{k-1},x_{k+1},\dots ,x_n) \in {\mathbb {R}}^{n-1}\). With these notations, we have \(x = ({\tilde{x}}_k,x_k)_k\). We define \({\widetilde{\varOmega }}_k\subset {\mathbb {R}}^{n-1}\) by

$$\begin{aligned} {\widetilde{\varOmega }}_k:= \{ {\tilde{x}}_k : x \in \varOmega \} = \{ y \in {\mathbb {R}}^{n-1} : (y,z)_k \in \varOmega \text { for some } z \in {\mathbb {R}}\}. \end{aligned}$$

The set \({\widetilde{\varOmega }}_k\) is, in a sense, the orthogonal projection of \(\varOmega \) into the space \(\{x \in {\mathbb {R}}^n: x_k = 0\}\), but strictly speaking this is not true, since a projection is a function \(P: {\mathbb {R}}^n\rightarrow {\mathbb {R}}^n\), but \({\widetilde{\varOmega }}_k\subset {\mathbb {R}}^{n-1}\). For every \(y \in {\widetilde{\varOmega }}_k\), we let \(Z_k(y) \subset {\mathbb {R}}\) be the set of points z, such that \((y,z)_k \in \varOmega \). Note that \(\varOmega = \{ (y,z)_k : y \in {\widetilde{\varOmega }}_k\text { and } z\in Z_k(y) \}\).

Since we will be using Lebesgue measures with different dimensions simultaneously, we will use subscripts to differentiate them, i.e. m-dimensional measure will be denoted by \(|\cdot |_m\).

Definition 5.1

We say that \(u : \varOmega \rightarrow {\mathbb {R}}\) is absolutely continuous on lines, \(u \in {\textit{ACL}}(\varOmega )\), if it is absolutely continuous on almost every line segment in \(\varOmega \) parallel to the coordinate axes. More formally, let \(k \in \{1,2,\dots ,n\}\) and let \(E_k \subset {\widetilde{\varOmega }}_k\) be the set of points y such that the function

$$\begin{aligned} f_y: Z_k(y) \rightarrow [-\infty ,\infty ],\, f_y(z) = u((y,z)_k) \end{aligned}$$

is absolutely continuous on every compact interval \([a,b] \subset Z_k(y)\). Then \(u \in {\textit{ACL}}(\varOmega )\) if and only if \(|{\widetilde{\varOmega }}_k{\setminus } E_k|_{n-1} = 0\) for every k.

Let \(u \in {\textit{ACL}}(\varOmega )\). Absolute continuity implies that the classical partial derivative \(\partial _k u\) of \(u \in {\textit{ACL}}(\varOmega )\) exist for every \(x \in \varOmega \) such that \({\tilde{x}}_k \in E_k\). Since \(|{\widetilde{\varOmega }}_k{\setminus } E_k|_{n-1} = 0\), it follows by Fubini’s theorem that \(\partial _k u\) exists for almost every \(x \in \varOmega \). Another application of Fubini’s theorem shows that the classical partial derivative is equal to the weak partial derivative, see [14, Theorem 2.1.4]. Since the partial derivatives exist almost everywhere, it follows that the gradient \(\nabla u\) exists almost everywhere. A function \(u \in {\textit{ACL}}(\varOmega )\) is said to belong to \({\textit{ACL}}^\varphi (\varOmega )\), if \(|\nabla u| \in L^\varphi (\varOmega )\).

The following lemma follows immediately from the definitions of \(L^\varphi (\varOmega )\), \({\textit{ACL}}^\varphi (\varOmega )\) and \( W^{1,\varphi }(\varOmega )\).

Lemma 5.2

If \(\varphi \in \varPhi _w(\varOmega )\), then \({\textit{ACL}}^\varphi (\varOmega ) \cap L^\varphi (\varOmega ) \subset W^{1,\varphi }(\varOmega )\).

Definition 5.3

For any \(u : \varOmega \rightarrow R\), we define \(\varGamma _{{\textit{NAC}}}(u) \subset \varGamma _{{\textit{rect}}}(\varOmega )\) as the family of curves \(\gamma : [0,\ell (\gamma )] \rightarrow \varOmega \) such that \(u \circ \gamma \) is not absolutely continuous on \([0,\ell (\gamma )]\). If \({\text {M}}_{\varphi }(\varGamma _{{\textit{NAC}}}(u)) = 0\), then we say that u is absolutely continuous on curves, \(u \in {\textit{ACC}}(\varOmega )\).

In the next lemma, we show that \({\textit{ACC}}(\varOmega )\) is a subset of \({\textit{ACL}}(\varOmega )\), if \(\varphi \) satisfies a suitable condition.

Lemma 5.4

Let \(\varphi \in \varPhi _w(\varOmega )\) and assume that \(\varphi \) satisfies the following condition:

$$\begin{aligned} \text {there exist }\beta > 0 \text { such that }\varphi (x,\beta )\ge 1\text { for almost every }x \in \varOmega . \end{aligned}$$
(5.1)

Then

$$\begin{aligned} {\textit{ACC}}(\varOmega ) \subset {\textit{ACL}}(\varOmega ). \end{aligned}$$

Remark 5.5

Note that (A0) implies (5.1), but not the other way around, since we do not assume that \(\varphi (x,1/\beta ) \le 1\). We also note (5.1) is equivalent to

$$\begin{aligned} \text {there exist }\beta> 0 \text { and }\delta > 0\text { such that }\varphi (x,\beta )\ge \delta \text { for almost every }x \in \varOmega . \end{aligned}$$
(5.2)

It is clear that (5.1) is just a special case of (5.2) with \(\delta = 1\). It is also clear that (5.2) implies (5.1), if \(\delta > 1\). Suppose then, that \(\varphi \) satisfies (5.2) with \(0< \delta < 1\). Then

$$\begin{aligned} \frac{\delta }{\beta } \le \frac{\varphi (x,\beta )}{\beta } \end{aligned}$$
(5.3)

for almost every \(x \in \varOmega \). By (aInc)\(_1\) (which \(\varphi \) satisfies by definition of \(\varPhi _w\)), there exist a constant \(a \ge 1\) such that

$$\begin{aligned} \frac{\varphi (x,\beta )}{\beta } \le a\frac{\varphi (x,t)}{t} \end{aligned}$$
(5.4)

for almost every \(x \in \varOmega \) and every \(t \ge \beta \). Choosing \(t := a\beta / \delta > \beta \), it follows from (5.3) and (5.4) that \(\varphi (x,a\beta /\delta ) \ge 1\) for almost every \(x \in \varOmega \), and therefore \(\varphi \) satisfies (5.1). Thus the choice \(\delta = 1\) in (5.1) has no special meaning, except for making notations simpler by getting rid of \(\delta \).

Proof of Lemma 5.4

Let \(u \in {\textit{ACC}}(\varOmega )\), and let \(k \in \{1,\dots ,n\}\) and let \(E_k \subset {\mathbb {R}}^{n-1}\) be as in Definition 5.1. By Lemma 3.2, there exists a non-negative Borel function \(v \in L^\varphi (\varOmega )\) such that \(\int _\gamma v \,ds = \infty \) for every \(\gamma \in \varGamma _{{\textit{NAC}}}(u)\). For every \(y \in {\widetilde{\varOmega }}_k{\setminus } E_k\), let \(I(y) \subset Z_k(y)\) be some compact interval such that v is not absolutely continuous on I(y), and let \(\gamma _y : [0,|I(y)|_1] \rightarrow \varOmega \) be a parametrization of I(y). Since \(\gamma _y \in \varGamma _{{\textit{NAC}}}(u)\), it follows that \(\int _{I(y)} v((y,z)_k) \, dz = \int _{\gamma _y} v(s) \,ds = \infty \).

From (5.3) (with \(\delta = 1\)) and (5.4) we get

$$\begin{aligned} \varphi (x,t) \ge \frac{t}{a\beta } \end{aligned}$$

for almost every \(x \in \varOmega \) and every \(t \ge \beta \). Since \(\varphi (x,t) \ge 0\), it follows that

$$\begin{aligned} \varphi (x,t) \ge \frac{t}{a\beta } - \frac{1}{a} \end{aligned}$$
(5.5)

for almost every \(x \in \varOmega \) and every \(t \ge 0\). Let \(\lambda > \Vert v \Vert _\varphi \). By (2.1) and Fubini’s theorem we have

$$\begin{aligned} \begin{aligned} 1&\ge \int _\varOmega \varphi \left( x, \frac{v(x)}{\lambda }\right) \,dx = \int _{{\widetilde{\varOmega }}_k}\int _{Z_k(y)} \varphi \left( (y,z)_k,\frac{v((y,z)_k)}{\lambda }\right) \,dz\,dy \\&\ge \int _{{\widetilde{\varOmega }}_k{\setminus } E_k} \int _{I(y)} \varphi \left( (y,z)_k, \frac{v((y,z)_k)}{\lambda }\right) \,dz\,dy. \end{aligned} \end{aligned}$$
(5.6)

By (5.5) we have

$$\begin{aligned} \int _{I(y)} \varphi \left( (y,z)_k, \frac{v((y,z)_k)}{\lambda }\right) \,dz \ge \int _{I(y)} \frac{v((y,z)_k)}{a\beta \lambda } \,dz - \int _{I(y)} \frac{1}{a} \, dz. \end{aligned}$$

Since \(\int _{I(y)} v((y,z)_k) \,dz = \infty \), the first integral on the right-hand side is infinite, and since I(y) is compact, the second integral is finite. Thus

$$\begin{aligned} \int _{I(y)} \varphi \left( (y,z)_k, \frac{v((y,z)_k)}{\lambda }\right) \,dz = \infty . \end{aligned}$$

Inserting this into (5.6), we get

$$\begin{aligned} 1&\ge \int _{{\widetilde{\varOmega }}_k{\setminus } E_k} \int _{I(y)} \varphi \left( (y,z)_k, \frac{v((y,z)_k)}{\lambda }\right) \,dz\,dy \\&= \int _{{\widetilde{\varOmega }}_k{\setminus } E_k} \infty \,dy. \end{aligned}$$

This is possible only if \(|{\widetilde{\varOmega }}_k{\setminus } E_k|_{n-1} = 0\). Thus \(u \in {\textit{ACL}}(\varOmega )\). \(\square \)

The next example shows that the assumption (5.1) in the preceding lemma is not redundant.

Example 5.6

Let \(\varOmega = {\mathbb {R}}^2\). For \(x = (y,z) \in {\mathbb {R}}^2\), let

$$\begin{aligned} \varphi (x,t) := \left\{ \begin{array}{ll} t &{}\quad \text {if}\;y = 0, \\ 0 &{}\quad \text {if}\;y \ne 0\;\text {and}\;t \le |y|^{-1}, \\ t &{} \quad \text {if}\;y \ne 0\;\text {and}\;t > |y|^{-1}. \end{array}\right. \end{aligned}$$

It easily follows from [7, Theorem 2.5.4] that \(\varphi \in \varPhi _w({\mathbb {R}}^2)\). Define \(u : {\mathbb {R}}^2 \rightarrow {\mathbb {R}}\) by

$$\begin{aligned} u(y,z) := \left\{ \begin{array}{ll} 0 &{}\quad \text {if}\;y < 0, \\ 1 &{}\quad \text {if}\;y = 0, \\ 2 &{}\quad \text {if}\;y > 0. \end{array}\right. \end{aligned}$$

It is trivial that \(u \notin {\textit{ACL}}({\mathbb {R}}^2)\). It is however the case that \(u \in {\textit{ACC}}({\mathbb {R}}^2)\).

It is easy to see, that \(\varGamma _{{\textit{NAC}}}(u) = \varGamma _E\), where \(E := \{ (y,z) \in {\mathbb {R}}^2 : y = 0\}\). Define \(v : {\mathbb {R}}^2 \rightarrow [0,\infty ]\) by

$$\begin{aligned} v(y,z) := \left\{ \begin{array}{ll} \infty &{}\quad \text {if}\;y = 0, \\ |y|^{-1} &{}\quad \text {if}\;y \ne 0. \end{array}\right. \end{aligned}$$

Since the set

$$\begin{aligned} \{ (y,z) \in {\mathbb {R}}^2 : v(y,z) > r \} = \{(y,z) \in {\mathbb {R}}^2 : |y| < r^{-1} \} \end{aligned}$$

is open for every \(r \in {\mathbb {R}}\), it follows that v is a Borel function. Fix \(\gamma \in \varGamma _E\). For every \(a \in [0,\ell (\gamma )]\), we write \((y_a,z_a) := \gamma (a)\). Now, there exists some \(b \in [0,\ell (\gamma )]\) with \(y_b = 0\). Since \(\gamma \) is parametrized by arc-length, we have

$$\begin{aligned} |y_a| = |y_a - y_b| \le |\gamma (a) - \gamma (b)| \le |a - b| \end{aligned}$$

for every \(a \in [0,\ell (\gamma )]\). If \(a \ne b\), then \(v(\gamma (a))\ge |a-b|^{-1}\), since if \(y_a = 0\), then \(v(\gamma (a)) = \infty \), and if \(y_a \ne 0\), then \(v(\gamma (a)) = |y_a|^{-1} \ge |a-b|^{-1}\). Thus

$$\begin{aligned} \int _\gamma v \,ds = \int _0^b v(\gamma (a)) \,da + \int _b^{\ell (\gamma )} v(\gamma (a)) \,da \ge \int _0^b \frac{1}{|a-b|} \,da + \int _b^{\ell (\gamma )} \frac{1}{|a-b|} \,da = \infty . \end{aligned}$$

Since this holds for all \(\gamma \in \varGamma _E\), by Lemma 3.2(c), to show that \({\text {M}}_{\varphi }(\varGamma _E) = 0\), it suffices to show that \(v \in L^\varphi ({\mathbb {R}}^2)\). If \(x = (y,z)\) and \(y \ne 0\), then \(\varphi (x,v(x)) = \varphi (x, |y|^{-1}) = 0\). Thus \(\varphi (x,v(x)) = 0\) almost everywhere, and \(\varrho _\varphi (v) = 0\). By (2.1), it follows that \(\Vert v\Vert _\varphi \le 1\), and therefore \(v \in L^\varphi ({\mathbb {R}}^2)\).

We know that \(\nabla u\) exists for every \(u \in {\textit{ACL}}(\varOmega )\). Thus, if \(\varphi \) satisfies (5.1), then Lemma 5.4 implies that \(\nabla u\) exists for every \(u \in {\textit{ACC}}(\varOmega )\). We say that \(u \in {\textit{ACC}}^\varphi (\varOmega )\), if \(u \in {\textit{ACC}}(\varOmega )\) and \(\nabla u \in L^\varphi (\varOmega )\).

Theorem 5.7

(Fuglede’s theorem) Let \(\varphi \in \varPhi _w(\varOmega )\) satisfy (5.1). If \(C^1(\varOmega )\)-functions are dense in \(W^{1,\varphi }(\varOmega )\), then \(u \in W^{1,\varphi }(\varOmega )\) if and only if \(u \in L^\varphi (\varOmega )\) and it has a representative that belongs to \({\textit{ACC}}^\varphi (\varOmega )\). In short

$$\begin{aligned} {\textit{ACC}}^\varphi (\varOmega ) \cap L^\varphi (\varOmega ) = W^{1,\varphi }(\varOmega ). \end{aligned}$$

Proof

By Lemmas 5.2 and 5.4 , we have

$$\begin{aligned} {\textit{ACC}}^\varphi (\varOmega ) \cap L^\varphi (\varOmega ) \subset {\textit{ACL}}^\varphi (\varOmega ) \cap L^\varphi (\varOmega ) \subset W^{1,\varphi }(\varOmega ). \end{aligned}$$

Thus it suffices to show that \(W^{1,\varphi }(\varOmega ) \subset {\textit{ACC}}^\varphi (\varOmega )\). Since \(|\nabla u| \in L^\varphi (\varOmega )\) whenever \(u \in W^{1,\varphi }(\varOmega )\), we only have to show that \(W^{1,\varphi }(\varOmega ) \subset {\textit{ACC}}(\varOmega )\).

Suppose that \(u \in W^{1,\varphi }(\varOmega )\). Let \((u_i)\) be a sequence of functions in \(C^1(\varOmega ) \cap W^{1,\varphi }(\varOmega )\) converging to u in \(W^{1,\varphi }(\varOmega )\). By Lemma 4.2, passing to a subsequence if necessary, we may assume that \((u_i)\) converges pointwise everywhere, except in a set E with \({\text {M}}_{\varphi }(\varGamma _E) =|E|_n = 0\). Let \({\tilde{u}}(x) := \liminf _{i\rightarrow \infty } u_i(x)\) for every \(x \in \varOmega \). Since the functions \(u_i\) are continuous, it follows that \({\tilde{u}}\) is a Borel function. Since \(u_i(x)\) converges for every \(x\in \varOmega {\setminus } E\), it follows that \({\tilde{u}}(x) = \lim _{i\rightarrow \infty }u_i(x)\) for \(x\in \varOmega {\setminus } E\). By Lemma 2.3, \(u_i \rightarrow {\tilde{u}}\) in \(L^\varphi (\varOmega )\), and it follows that \({\tilde{u}} = u\) almost everywhere.

Since \(u_i \rightarrow u\) in \(W^{1,\varphi }(\varOmega )\) we may assume, considering a subsequence if necessary, that

$$\begin{aligned} \Vert \nabla u_{i+1} - \nabla u_i||_\varphi < 2^{-i} \end{aligned}$$

for every \(i \in {\mathbb {N}}\). Since

$$\begin{aligned} u_i = u_1 + \sum _{j=1}^{i-1} (u_{j+1} - u_j), \end{aligned}$$

we have \(|\nabla u_i| \le g_i\) for every \(i \in {\mathbb {N}}\), where

$$\begin{aligned} g_i = |\nabla u_1| + \sum _{j=i}^{i-1}|\nabla u_{j+1} - \nabla u_j|. \end{aligned}$$

Since the sequence \((g_i(x))\) is increasing for every \(x\in \varOmega \), the limit \(g(x) := \lim _{i\rightarrow \infty } g_i(x)\) (possibly \(\infty \)) exists. Since the functions \(g_i\) are continuous, g is a Borel function. For every \(m>n\) we have

$$\begin{aligned} \Vert g_m - g_n\Vert _\varphi = \left\| \sum _{j=n}^{m-1} |\nabla u_{j+1} - \nabla u_j|\right\| _\varphi \lesssim \sum _{j=n}^\infty \Vert \nabla u_{j+1} - \nabla u_j\Vert _\varphi< \sum _{j=n}^\infty 2^{-i} < 2^{-n+1}, \end{aligned}$$

i.e. \((g_i)\) is a Cauchy sequence in \(L^\varphi (\varOmega )\). Lemma 2.3 implies that \(g_i \rightarrow g\) in \(L^\varphi (\varOmega )\).

Let

$$\begin{aligned} \varGamma _1 := \left\{ \gamma \in \varGamma _{{\textit{rect}}}(\varOmega ) : \int _\gamma g \,ds = \infty \right\} . \end{aligned}$$

Since g/j is \(\varGamma _1\)-admissible for every \(j\in {\mathbb {N}}\), we find that \({\text {M}}_{\varphi }(\varGamma _1) = 0\). By Lemma 4.1, passing to a subsequence if necessary, we find an exceptional set \(\varGamma _2 \subset \varGamma _{{\textit{rect}}}(\varOmega )\), such that

$$\begin{aligned} \lim _{i\rightarrow \infty } \int _\gamma g - g_i \,ds = 0 \end{aligned}$$

for every \(\gamma \in \varGamma _{{\textit{rect}}}(\varOmega ) {\setminus } \varGamma _2\). The set \(\varGamma _2\) has the following property: if \(\gamma \in \varGamma _{{\textit{rect}}}(\varOmega ) {\setminus } \varGamma _2\) and \(0\le a\le b\le \ell (\gamma )\), then \(\gamma |_{[a,b]} \in \varGamma _{{\textit{rect}}}(\varOmega ) {\setminus } \varGamma _2\). The reason is that, since \(g-g_i\ge 0\), we have

$$\begin{aligned} \int _\gamma g - g_i \,ds \ge \int _{\gamma |_{[a,b]}} g - g_i \,ds \ge 0, \end{aligned}$$

and since the first term tends to zero, the middle term must also tend to zero. Let \(\varGamma := \varGamma _1 \cup \varGamma _2 \cup \varGamma _E\). By Lemma 3.2(b) \({\text {M}}_{\varphi }(\varGamma ) = 0\).

We complete the proof by showing that \({\tilde{u}} \circ \gamma \) is absolutely continuous for every \(\gamma \in \varGamma _{{\textit{rect}}}(\varOmega ) {\setminus } \varGamma \). Let \(k\in {\mathbb {N}}\) and for \(j \in \{1,2,\dots ,k\}\), let \((a_j,b_j) \subset [0, \ell (\gamma )]\) be disjoint intervals. Since \({\text {Im}}(\gamma )\) does not intersect E, and \(u_i \in C^1(\varOmega )\) for every i, we have

$$\begin{aligned} \sum _{j=1}^k |{\tilde{u}}(\gamma (b_j)) - {\tilde{u}}(\gamma (a_j))|= & {} \lim _{i\rightarrow \infty } \sum _{j=1}^k |u_i(\gamma (b_j)) - u_i(\gamma (a_j))|\\\le & {} \limsup _{i\rightarrow \infty } \sum _{j=1}^k \int _{\gamma |_{[a_j,b_j]}} |\nabla u_i| \,ds. \end{aligned}$$

Using first the fact that \(|\nabla u_i| \le g_i\), and then the fact that \(\gamma |_{[a_j,b_j]} \notin \varGamma _2\), we get

$$\begin{aligned} \limsup _{i\rightarrow \infty } \sum _{j=1}^k \int _{\gamma |_{[a_j,b_j]}} |\nabla u_i| \,ds \le \limsup _{i\rightarrow \infty } \sum _{j=1}^k \int _{\gamma |_{[a_j,b_j]}} g_i \,ds = \sum _{j=1}^k\int _{\gamma |_{[a_j,b_j]}} g \,ds. \end{aligned}$$

Thus

$$\begin{aligned} \sum _{j=1}^k |{\tilde{u}}(\gamma (b_j)) - {\tilde{u}}(\gamma (a_j))| \le \sum _{j=1}^k\int _{\gamma |_{[a_j,b_j]}} g \,ds \end{aligned}$$

Since \(\gamma \notin \varGamma _1\), we have \(g\circ \gamma \in L^1[0,\ell (\gamma )]\), which together with the inequality above implies that \({\tilde{u}} \circ \gamma \) is absolutely continuous on \([0,\ell (\gamma )]\). \(\square \)

We can combine Theorem 5.7 with Lemmas 5.2 and 5.4 to get the following corollary:

Corollary 5.8

Let \(\varphi \in \varPhi _w(\varOmega )\) satisfy (5.1). If \(C^1(\varOmega )\)-functions are dense in \(W^{1,\varphi }(\varOmega )\), then

$$\begin{aligned} {\textit{ACC}}^\varphi (\varOmega ) \cap L^\varphi (\varOmega ) = {\textit{ACL}}^\varphi (\varOmega ) \cap L^\varphi (\varOmega ) = W^{1,\varphi }(\varOmega ). \end{aligned}$$

As was noted at the end of Sect. 2, \(C^\infty (\varOmega )\) functions are dense in \(W^{1,\varphi }(\varOmega )\) if \(\varphi \) satisfies (A0), (A1), (A2) and (aDec). By Remark 5.5, (A0) implies (5.1). Thus Corollary 5.8 also holds with assumptions (A0), (A1), (A2) and (aDec), instead of (5.1) and density of \(C^1(\varOmega )\)-functions.