\documentclass[11pt,a4paper,oneside,openany]{book} \usepackage[T1]{fontenc} \usepackage{lmodern,amsmath,amssymb,amsthm,microtype} \usepackage[a4paper,margin=29mm,headheight=14pt]{geometry} \setlength{\emergencystretch}{1em} \usepackage{xcolor} \definecolor{navy}{RGB}{26,55,98} \definecolor{cellgray}{RGB}{205,211,221} \definecolor{rowblue}{RGB}{150,172,205} \definecolor{cutred}{RGB}{196,84,60} \usepackage{tikz} \usetikzlibrary{arrows.meta,positioning} \usepackage{enumitem} \usepackage{booktabs,longtable} \usepackage{fancyhdr} \usepackage[colorlinks=true,allcolors=navy,linktoc=all]{hyperref} \hypersetup{pdftitle={Functions of bounded variation on fractals}} \pagestyle{fancy} \fancyhf{} \fancyhead[L]{\small\nouppercase{\leftmark}} \fancyhead[R]{\small\thepage} \renewcommand{\headrulewidth}{0.3pt} \renewcommand{\chaptermark}[1]{\markboth{\thechapter.\ #1}{}} \fancypagestyle{plain}{\fancyhf{}\fancyfoot[C]{\small\thepage}\renewcommand{\headrulewidth}{0pt}} \numberwithin{equation}{chapter} \newtheorem{theorem}{Theorem}[chapter] \newtheorem{proposition}[theorem]{Proposition} \newtheorem{lemma}[theorem]{Lemma} \newtheorem{corollary}[theorem]{Corollary} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \newtheorem{example}[theorem]{Example} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} % The summary which opens each chapter. \newenvironment{overview}{\begin{quote}\small\textbf{In this chapter.}\ }{\end{quote}} % The paragraph which precedes a long proof. \newcommand{\idea}{\paragraph{Idea of the proof.}} \DeclareMathOperator{\Var}{Var} \DeclareMathOperator{\Per}{Per} \DeclareMathOperator{\interior}{int} \DeclareMathOperator{\diam}{diam} \DeclareMathOperator{\dist}{dist} \DeclareMathOperator{\ch}{ch} \newcommand{\ind}{\mathbf 1} \newcommand{\N}{\mathbb N_0} \newcommand{\Z}{\mathbb Z} \newcommand{\R}{\mathbb R} \newcommand{\TT}{\mathbb T} \newcommand{\Qc}{\mathcal Q} \newcommand{\Rc}{\mathcal R} \newcommand{\Cc}{\mathcal C} \newcommand{\Ac}{\mathcal A} \newcommand{\Pc}{\mathcal P} \newcommand{\Nc}{\mathcal N} \newcommand{\Gc}{\mathcal G} \newcommand{\Tc}{\mathcal T} \newcommand{\Hc}{\mathcal H} \newcommand{\K}{\mathsf K} \newcommand{\SG}{\mathsf{SG}} \newcommand{\MS}{\mathsf{MS}} \newcommand{\Hd}{\mathcal H^{d_h}} \newcommand{\Hb}{\mathcal H^{d_b}} % The Besov class of order #1 in L^1. \newcommand{\Bes}[1]{B^{#1}_{1,\infty}} % The set of pairs of points separated by a set. \newcommand{\Pair}{\Pi} % The hypotheses. \newcommand{\hP}{\textup{(P)}} \newcommand{\hC}{\textup{(C)}} \newcommand{\hCp}{\textup{(C$^+$)}} % The hypotheses at small scales of Section 3.6: upper perimeter (I), (II) and lower perimeter (I'), (II'). \newcommand{\hI}{\textup{(I)}} \newcommand{\hII}{\textup{(II)}} \newcommand{\hIl}{\textup{(I$'$)}} \newcommand{\hIIl}{\textup{(II$'$)}} % The unit carpet after three steps of the construction, filled with the colour #1. \newcommand{\carpetpicture}[1]{% \fill[#1] (0,0) rectangle (1,1); \fill[white] (1/3,1/3) rectangle (2/3,2/3); \foreach \k in {1,4,7}{\foreach \l in {1,4,7}{\fill[white] (\k/9,\l/9) rectangle ({(\k+1)/9},{(\l+1)/9});}} \foreach \k in {1,4,...,25}{\foreach \l in {1,4,...,25}{\fill[white] (\k/27,\l/27) rectangle ({(\k+1)/27},{(\l+1)/27});}}} % The same after four steps. \newcommand{\carpetpicturefine}[1]{% \carpetpicture{#1} \foreach \k in {1,4,...,79}{\foreach \l in {1,4,...,79}{\fill[white] (\k/81,\l/81) rectangle ({(\k+1)/81},{(\l+1)/81});}}} % The 64 squares of side h contained in a square of side 9h whose lower left corner is at (#1,0). \newcommand{\blockpicture}[1]{% \foreach \a in {0,...,8}{\foreach \b in {0,...,8}{% \pgfmathtruncatemacro{\hole}{((mod(\a,3)==1)&&(mod(\b,3)==1))||((div(\a,3)==1)&&(div(\b,3)==1))}% \ifnum\hole=0 \fill[cellgray,draw=white,line width=.4pt] ({#1+\a},\b) rectangle ++(1,1);\fi}}} % The gasket after #1 steps: lower left vertex (#2,#3), side #4, colour #5. \newcommand{\gasketpicture}[5]{% \ifnum#1=0 \fill[#5] (#2,#3) -- ++(#4,0) -- ++(120:#4) -- cycle; \else \begingroup \pgfmathtruncatemacro{\gd}{#1-1}% \pgfmathsetmacro{\gs}{#4/2}% \pgfmathsetmacro{\gxa}{#2+\gs}% \pgfmathsetmacro{\gxb}{#2+\gs/2}% \pgfmathsetmacro{\gyb}{#3+\gs*0.8660254}% \edef\gnext{\noexpand\gasketpicture{\gd}{#2}{#3}{\gs}{#5}\noexpand\gasketpicture{\gd}{\gxa}{#3}{\gs}{#5}\noexpand\gasketpicture{\gd}{\gxb}{\gyb}{\gs}{#5}}% \expandafter\endgroup\gnext \fi} % The 400 cubes of the second step of the construction of the sponge, seen from the direction (1,1,1). \newcommand{\spongepicture}{% \foreach \c in {0,...,8}{\foreach \b in {0,...,8}{\foreach \a in {0,...,8}{% \pgfmathtruncatemacro{\keep}{(((mod(\a,3)==1)+(mod(\b,3)==1)+(mod(\c,3)==1))<2)&&(((div(\a,3)==1)+(div(\b,3)==1)+(div(\c,3)==1))<2)}% \ifnum\keep=1 \fill[navy!28,draw=white,line width=.1pt,line join=round] (\a,\b,\c+1)--(\a+1,\b,\c+1)--(\a+1,\b+1,\c+1)--(\a,\b+1,\c+1)--cycle; \fill[navy!62,draw=white,line width=.1pt,line join=round] (\a+1,\b,\c)--(\a+1,\b+1,\c)--(\a+1,\b+1,\c+1)--(\a+1,\b,\c+1)--cycle; \fill[navy,draw=white,line width=.1pt,line join=round] (\a,\b+1,\c)--(\a+1,\b+1,\c)--(\a+1,\b+1,\c+1)--(\a,\b+1,\c+1)--cycle; \fi}}}} % The Hausdorff measure of codimension #1. \newcommand{\Hcod}[1]{\Hc^{\mathrm{cod}\,#1}} \DeclareMathOperator{\Lip}{Lip} \DeclareMathOperator{\codim}{codim} \newcommand{\hPI}{\textup{(PI)}} \setcounter{tocdepth}{1} \begin{document} \frontmatter \hypersetup{pageanchor=false} \begin{titlepage} \centering \vspace*{42mm} {\Huge\bfseries Functions of bounded variation\par\vspace{3mm} on fractals\par} \vspace{16mm} {\large\bfseries Fabrice Baudoin\par} \vspace{4mm} {\small Department of Mathematics, Aarhus University\par Ny Munkegade 118, 8000 Aarhus C, Denmark\par \href{mailto:fbaudoin@math.au.dk}{\texttt{fbaudoin@math.au.dk}}\par } \vspace{16mm} \begin{tikzpicture} \begin{scope}[x=30mm,y=30mm] \carpetpicturefine{navy} \end{scope} \begin{scope}[shift={(40mm,0mm)},x=34.6mm,y=34.6mm] \gasketpicture{6}{0}{0}{1}{navy} \end{scope} \end{tikzpicture} \vfill \end{titlepage} \hypersetup{pageanchor=true} \chapter*{Acknowledgment} \markboth{Foreword}{} This memoir was generated under my supervision using the models Astra 6.2, Sol 6.2 and Fable 5.2. The sources I explicitly supplied to the models as context were my paper \cite{Bau} the three papers in the series \emph{Besov class via heat semigroup on Dirichlet spaces}, written in collaboration with Patricia Alonso Ruiz, Li Chen, Luke G. Rogers, Nageswari Shanmugalingam and Alexander Teplyaev~\cite{ABI,ABII,AB}. \vspace{0.6cm} The starting point was the critical-exponent assertion of Conjecture~5.4 in~\cite{AB} for the Sierpi\'nski carpet. The conjecture was solved by Astra 6.2. From there, the aim was to identify a class of spaces on which it holds. This led to hypotheses~\hP{} and~\hC{}, which form the basis of the theory. The guiding objectives of the theory were to obtain the Federer-type characterization of sets of finite perimeter, relate the critical exponent to the topological Hausdorff dimension, and establish isoperimetric inequalities. \vspace{0.6cm} I used Astra 6.2 for mathematical proofs, Fable 5.2 for writing with the \href{https://github.com/amelieloher/math-paper-skills/blob/main/skills/latex-math-writing/SKILL.md}{LaTeX writing skill} by Am\'elie Loher and Scott Armstrong, and Sol 6.2 for proofreading and polishing. \vspace{0.6cm} \paragraph{Funding.} I am supported in part by the Independent Research Fund Denmark (grant 10.46540/4283-00175B) and the Villum Investigator grant \emph{Stochastic Analysis in Aarhus}. I also acknowledge funding from the European Research Council (ERC) through RanGe (Grant Agreement No.~101199772), under the European Union's Horizon Europe research and innovation programme. \chapter*{Preface} \markboth{Preface}{} \paragraph{The subject.} A function of bounded variation on~$\R^n$ is an integrable function whose distributional gradient is a finite measure. Sets of finite perimeter, the coarea formula, the isoperimetric and Sobolev inequalities and the structure theorems of De~Giorgi and Federer all belong to this theory. Since the work of Miranda and Ambrosio, the same theory is available on a metric measure space, provided that the measure is doubling and that a Poincar\'e inequality relates the oscillation of a Lipschitz function to the integral of its slope. Fractals such as the Sierpi\'nski carpet or the Sierpi\'nski gasket are doubling, but they do not satisfy this Poincar\'e inequality, and on them the slope of a Lipschitz function is not the right object to integrate. This memoir shows that the theory nevertheless survives, with one change: the number~$1$, which is the codimension of the boundary of a smooth set in~$\R^n$, is replaced by an exponent $\lambda\ge1$, which depends on the space. For instance $\lambda=\log_34$ on the Sierpi\'nski carpet. The radius~$R$ in the Poincar\'e inequality becomes~$R^\lambda$, the Hausdorff measure of codimension one becomes the Hausdorff measure of codimension~$\lambda$, and the Sobolev exponent $\frac{Q}{Q-1}$ becomes $\frac{Q}{Q-\lambda}$. \paragraph{The method.} The proofs of the metric results use the family of integrals \begin{equation*} J_r(f)\asymp\int_X\frac1{m(B(x,r))}\int_{B(x,r)}|f(x)-f(y)|\,dm(y)\,dm(x)\,,\qquad r>0\,, \end{equation*} which measure the mean oscillation of~$f$ at scale~$r$. The metric theory rests on two hypotheses on these integrals, stated in Section~\ref{sec:twohyp}. The first one is a lower bound for $J_r(f)$ in terms of the oscillation of~$f$ on balls. The second one asserts that the lower bound is attained, up to a constant, by the indicator of a suitable set around every ball. The exponent~$\lambda$ is the power of~$r$ which appears in both. When the space also carries a diffusion, Section~\ref{sec:heat-BV} relates these integrals to the amount of heat that crosses the boundary of a set. \paragraph{The reader.} We assume a working knowledge of measure theory and of the basic tools of analysis in doubling metric spaces: the covering lemma, the Lebesgue differentiation theorem and Hausdorff measures, as presented in the first chapter of~\cite{Hei} and in~\cite{Mat}. Familiarity with the classical theory of functions of bounded variation~\cite{AFP} is useful for motivation and is not needed for the proofs. The proofs of the metric results use three theorems from the recent literature: the theorem of Eriksson-Bique on the Hausdorff content of limsup sets (Theorem~\ref{th:EB}), a result of Lahti on the existence of strong boundary points (in the proof of Lemma~\ref{lem:strongpoint}), and, for one corollary on the gasket, an edge-isoperimetric theorem of Harper (Corollary~\ref{gask-profile}). Apart from these, and from standard facts which are quoted with precise references, the metric theory is self-contained. \paragraph{How the text is written.} Each chapter opens with a short summary and states its main theorem in its first pages. Longer arguments are divided into steps and are often preceded by a paragraph headed \emph{Idea of the proof}. The letters $c$ and $C$ denote positive constants which depend only on the constants of the standing assumptions and of the hypotheses in force; the precise convention is in Section~\ref{sec:conventions}. An index of notation is at the end. \paragraph{How to read this memoir.} Figure~\ref{fig:leitfaden} shows how the chapters depend on each other. \begin{itemize} \item \emph{For a first overview}, read Chapter~\ref{sec:intro}. It states the two hypotheses, computes the exponent of the Sierpi\'nski carpet by hand in Section~\ref{sec:exponent}, and describes all the results. \item \emph{For the general theory}, read Chapters~\ref{sec:prelim} to~\ref{sec:measures} in order. Chapters~\ref{sec:prelim}, \ref{sec:wm} and~\ref{sec:bv} are the core, and the later chapters all use them. \item \emph{For the relation with the classical theory}, Chapter~\ref{sec:classical} can be read directly after Chapter~\ref{sec:wm}. \item \emph{For the examples}, Sections~\ref{sec:cells-def} to~\ref{sec:cells-edges} of Chapter~\ref{sec:cells} and the verification of the two hypotheses on the carpet in Sections~\ref{sec:carpet-squares} to~\ref{sec:rectangles} use only Chapters~\ref{sec:prelim} and~\ref{sec:wm} and the notation of Section~\ref{sec:ahlfors-hyp}. A reader who wants to see a complete example early can read them immediately after Chapter~\ref{sec:wm}. \end{itemize} \begin{figure}[ht] \centering \begin{tikzpicture}[>={Latex[length=5pt,width=4pt]}, ch/.style={draw=navy,rounded corners=2pt,align=center,font=\footnotesize,inner sep=3pt,text width=27mm,minimum height=10.5mm}, core/.style={ch,fill=cellgray}] \node[core] (c2) at (0,0) {\ref{sec:prelim}. Setting}; \node[core] (c3) at (3.6,0) {\ref{sec:wm}. Comparison\\ of scales}; \node[core] (c4) at (7.2,0) {\ref{sec:bv}. Isoperimetric,\\ Sobolev}; \node[ch] (c5) at (10.8,0) {\ref{sec:top}. Topological\\ boundary}; \node[ch] (c9) at (3.6,-2.1) {\ref{sec:classical}. Exponent one}; \node[ch] (c6) at (10.8,-2.1) {\ref{sec:federer}. Measure-theoretic\\ boundary}; \node[ch] (c7) at (7.2,-2.1) {\ref{sec:charact}. Two further\\ descriptions}; \node[ch] (c8) at (7.2,-4.2) {\ref{sec:measures}. BV measures}; \node[ch] (c10) at (10.8,-4.2) {\ref{sec:ahlfors}. Ahlfors\\ regular spaces}; \node[ch] (c11) at (10.8,-6.3) {\ref{sec:cells}. Cell structures}; \node[ch] (c12) at (7.2,-6.3) {\ref{sec:carpet}. Carpets}; \node[ch] (c13) at (3.6,-6.3) {\ref{sec:sponge}. Sponge}; \node[ch] (c14) at (7.2,-8.4) {\ref{sec:gasket}. Gasket}; \node[ch] (c15) at (10.8,-8.4) {\ref{sec:nocommon}. Two exponents}; \draw[->] (c2) -- (c3); \draw[->] (c3) -- (c4); \draw[->] (c4) -- (c5); \draw[->] (c3) -- (c9); \draw[->] (c5) -- (c6); \draw[->] (c6) -- (c7); \draw[->] (c6) -- (c10); \draw[->] (c6.south west) -- (c8.north east); \draw[->,dashed] (c8.west) -| (c9.south); \draw[->] (c10) -- (c11); \draw[->] (c11) -- (c12); \draw[->] (c12) -- (c13); \draw[->] (c11.south west) -- (c14.north east); \draw[->] (c11) -- (c15); \end{tikzpicture} \caption{The dependence of the chapters. The three chapters in grey are used everywhere. The dashed arrow means that a single statement of Chapter~\ref{sec:classical}, Proposition~\ref{prop:mirandameasure}, uses Chapter~\ref{sec:measures}. Chapters~\ref{sec:carpet} and~\ref{sec:gasket} also use the results on variation measures in Chapter~\ref{sec:measures}.}\label{fig:leitfaden} \end{figure} \tableofcontents \mainmatter \chapter{Introduction}\label{sec:intro} \begin{overview} We explain why the functions of bounded variation of a metric measure space can be defined without a gradient, why on a fractal the relevant exponent is larger than one, and which two hypotheses make the classical theory work with this exponent. The exponent of the Sierpi\'nski carpet is computed by hand in Section~\ref{sec:exponent}. Section~\ref{sec:intro-results} describes the results of the memoir, with references to the precise statements, and Section~\ref{sec:intro-examples} describes the examples. \end{overview} \section{Bounded variation without a gradient} A function $f\in L^1(\R^n)$ has bounded variation if its distributional gradient $Df$ is a finite measure. By the classical characterization of $BV(\R^n)$ through difference quotients (see~\cite[Chapter~3]{AFP}), this holds if and only if \begin{equation}\label{eq:euclid} \sup_{r>0}\ \frac1r\int_{\R^n}\frac1{|B(x,r)|}\int_{B(x,r)}|f(x)-f(y)|\,dy\,dx<\infty\,, \end{equation} and the supremum is then comparable to $|Df|(\R^n)$. The left-hand side of~\eqref{eq:euclid} involves only the distance and the measure. It is therefore meaningful on any metric space which carries a measure. \paragraph{Why the power of $r$ is one.} Let $f=\ind_E$ be the indicator of a bounded open set $E\subset\R^n$ with smooth boundary. Then $|f(x)-f(y)|=1$ if exactly one of the points $x,y$ belongs to~$E$, and $|f(x)-f(y)|=0$ otherwise. For a fixed~$x$, the inner average in~\eqref{eq:euclid} is at most~$1$, and it vanishes unless the ball $B(x,r)$ meets both $E$ and its complement, that is, unless $\dist(x,\partial E)0$, of the functions $f\in L^1(X,m)$ with \begin{equation*} \sup_{r>0}\ \frac1{r^{\beta}}\int_X\frac1{m(B(x,r))}\int_{B(x,r)}|f(x)-f(y)|\,dm(y)\,dm(x)<\infty\,, \end{equation*} These classes decrease as $\beta$ increases. In $\R^n$ we have $\Bes1=BV$, and $\Bes\beta$ contains only constant functions if $\beta>1$. \section{The classical theory in metric measure spaces} Miranda~\cite{Mir} defined the functions of bounded variation of a complete doubling metric measure space by relaxation: the total variation of~$f$ is the smallest lower limit of the integrals of the slopes of locally Lipschitz functions which converge to~$f$ in $L^1_{\mathrm{loc}}$. When the space supports a $(1,1)$-Poincar\'e inequality in the sense of Heinonen and Koskela~\cite{HeKo}, the resulting theory is as rich as the Euclidean one. \begin{itemize} \item The total variation is a measure, and the coarea formula and the relative isoperimetric inequality hold~\cite{AmbrosioAR,Ambrosio,Mir}. \item The Sobolev inequalities hold with an exponent determined by the growth of the measure~\cite{HK}. \item The perimeter of a set is comparable to the Hausdorff measure of codimension one of its measure-theoretic boundary~\cite{Ambrosio,AMP,Lahti}. \end{itemize} In these spaces the functions of bounded variation are again the elements of $\Bes1(X)$; see~\cite{DMS,LPZ,MMS} and Chapter~\ref{sec:classical}. \section{Fractals and the critical exponent} On fractals such as the Sierpi\'nski carpet, the Menger sponge and the Sierpi\'nski gasket (Figure~\ref{fig:three}), the $(1,1)$-Poincar\'e inequality fails, and the class $\Bes\beta$ contains non-constant functions for some $\beta>1$. Lipschitz functions are no longer the right dense class: on the carpet the coordinate functions have infinite variation (Theorem~\ref{th:coordinateprofiles}). Alonso Ruiz, Baudoin, Chen, Rogers, Shanmugalingam and Teplyaev~\cite{AB} therefore defined the functions of bounded variation of such a space as the elements of the Besov class at a \emph{critical exponent}, beyond which the classes are trivial, and they raised the problem of computing this exponent for carpets. \begin{figure}[ht] \centering \begin{tikzpicture} \begin{scope}[x=40mm,y=40mm] \carpetpicturefine{navy} \end{scope} \begin{scope}[shift={(69mm,19.8mm)},x={(-1.905mm,-1.1mm)},y={(1.905mm,-1.1mm)},z={(0mm,2.2mm)}] \spongepicture \end{scope} \begin{scope}[shift={(98mm,0mm)},x=46mm,y=46mm] \gasketpicture{6}{0}{0}{1}{navy} \end{scope} \node[below,align=center] at (20mm,-2mm) {\small Sierpi\'nski carpet $F$\\[1pt] \small $Q=\log_38$,\ \ $\lambda=\log_34$}; \node[below,align=center] at (69mm,-2mm) {\small Menger sponge $\MS$\\[1pt] \small $Q=\log_320$,\ \ $\lambda=\log_35$}; \node[below,align=center] at (121mm,-2mm) {\small Sierpi\'nski gasket $\SG$\\[1pt] \small $Q=\lambda=\log_23$}; \end{tikzpicture} \caption{The three examples, after four, two and six steps of their constructions, with their Hausdorff dimension~$Q$ and their critical $L^1$ Besov exponent~$\lambda$ (Theorem~\ref{th:examples}).}\label{fig:three} \end{figure} The remark of the first section suggests what the critical exponent should be: the codimension of the smallest sets which separate the space. On the carpet, a vertical line through the centre meets the carpet in a Cantor set of dimension $\log_32$, whereas the carpet has dimension $\log_38$. The codimension is $\log_38-\log_32=\log_34$, and this is indeed the critical exponent of the carpet. The purpose of this memoir is to turn this heuristic into a theory. \section{Two hypotheses}\label{sec:intro-hyp} Let $(X,d)$ be a proper metric space with a doubling measure~$m$. For $r>0$ and a measurable function $f$ on a measurable set~$W$ we write $J_r(f;W)$ for the integral of $|f(x)-f(y)|$ over the pairs of points $x,y\in W$ with $d(x,y)0$ and consider two hypotheses. Their precise statements, with the ranges of the radii, are in Section~\ref{sec:twohyp}. \begin{enumerate}[leftmargin=3.2em] \item[\hP] \emph{Poincar\'e inequality.} For every ball $B$ of radius~$R$, every scale $h\le R$ and every locally integrable function~$f$, with $f_B$ the mean of $f$ on~$B$ and $\Lambda B$ the ball with the same centre and radius~$\Lambda R$, \begin{equation*} \int_B|f-f_B|\,dm\le C_P\,\Big(\frac Rh\Big)^{\lambda}J_h(f;\Lambda B)\,. \end{equation*} \item[\hC] \emph{Sets of small perimeter.} For every ball $B(x,R)$ there is a measurable set $G$ with $B(x,R)\subset G\subset B(x,MR)$ and \begin{equation*} J_r(\ind_G)\le C_C\,m(B(x,R))\,\Big(\frac rR\Big)^{\lambda}\qquad\text{for every scale }r\,. \end{equation*} \end{enumerate} \paragraph{What they say.} Both hypotheses are statements about the same quantity, and they are opposite bounds. \begin{itemize} \item Hypothesis~\hP{} is a \emph{lower bound for the energy}. Apply it to $f=\ind_E$, where $E$ and $X\setminus E$ both fill a fixed proportion of the ball~$B$. The left-hand side is then comparable to $m(B)$, and~\hP{} gives $J_h(\ind_E;\Lambda B)\ge c\,m(B)\,(h/R)^\lambda$. No set can divide a ball into two substantial parts with less energy than this. \item Hypothesis~\hC{} is the \emph{matching upper bound}: around every ball there is a set which attains this energy, up to a constant. By the inequality displayed above, it suffices that the part of $G$ within distance~$r$ of its complement fills a proportion at most $C\,(r/R)^\lambda$ of~$G$. In other words, the boundary of~$G$ behaves like a set of codimension~$\lambda$ and diameter~$R$. \end{itemize} In $\R^n$ both hypotheses hold with $\lambda=1$: the first one follows from the usual Poincar\'e inequality applied to a mollification of~$f$ at scale~$h$, and in the second one $G$ is a ball. More generally, hypothesis~\hC{} with $\lambda=1$ holds in every doubling space, with balls of suitable radii, and hypothesis~\hP{} with $\lambda=1$ is equivalent to the $(1,1)$-Poincar\'e inequality (Theorem~\ref{th:classical}). The spaces of interest in this memoir have $\lambda>1$. \paragraph{The exponent is unique.} If~\hP{} holds for an exponent, it holds for every larger one, and if~\hC{} holds for an exponent, it holds for every smaller one. Moreover an exponent for which~\hC{} holds is never larger than an exponent for which~\hP{} holds (Proposition~\ref{prop:unique}). Hence at most one exponent satisfies both hypotheses (Figure~\ref{fig:ranges}), and when it exists it is a number attached to the space $(X,d,m)$. We shall see that it is the critical exponent of~\cite{AB}. \begin{figure}[ht] \centering \begin{tikzpicture}[x=10mm,y=10mm] \draw[line width=.4pt,-{Latex[length=5pt,width=4pt]}] (0,0) -- (12.4,0); \draw[navy,line width=3pt] (0.05,0) -- (5,0); \draw[cutred,line width=3pt] (7.2,0) -- (12,0); \fill[navy] (5,0) circle (2.4pt); \fill[cutred] (7.2,0) circle (2.4pt); \draw[line width=.4pt] (0,-.12) -- (0,.12); \node[below] at (0,-.15) {\small $0$}; \node[below] at (5,-.15) {\small $\lambda_C$}; \node[below] at (7.2,-.15) {\small $\lambda_P$}; \node[above] at (2.5,.15) {\small exponents for which \hC{} holds}; \node[above] at (9.6,.15) {\small exponents for which \hP{} holds}; \node[right] at (12.4,0) {\small $\beta$}; \end{tikzpicture} \caption{The exponents for which~\hC{} holds form an interval which starts at~$0$, the exponents for which~\hP{} holds form an interval which is unbounded above, and the first interval lies to the left of the second. The two hypotheses hold for a common exponent~$\lambda$ exactly when the two intervals are closed and $\lambda_C=\lambda_P=\lambda$. In the spaces of Chapter~\ref{sec:nocommon}, $\lambda_C<\lambda_P$.}\label{fig:ranges} \end{figure} \section{Where the exponent comes from}\label{sec:exponent} Before describing the theory, we compute the exponent of the Sierpi\'nski carpet by hand. The computation contains, in a simple form, the proofs of both hypotheses on all the examples of this memoir. The details are in Chapter~\ref{sec:carpet}. Let $F\subset[0,1]^2$ be the standard carpet: divide the unit square into nine squares of side~$\frac13$, remove the open middle one, and repeat in each of the eight remaining squares. We use the distance $d(x,y)=\max\{|x_1-y_1|,|x_2-y_2|\}$ and the Hausdorff measure~$m$ of dimension $Q=\log_38$, normalized by $m(F)=1$. Let $h=3^{-j}$ with $j\ge1$. The carpet is the union of $8^j=h^{-Q}$ \emph{cells} of side~$h$, each of measure $h^{Q}$. The line $\{x_1=\frac12\}$ passes through the centres of the removed squares, and it meets few cells: \begin{equation*} \#\{\text{cells of side $h$ meeting }\{x_1=\tfrac12\}\}=2^j=h^{-s}\,,\qquad\frac{8^j}{2^j}=4^j=h^{-\lambda}\,,\qquad\lambda=\log_34\,. \end{equation*} These cells form the middle column, shown in red in Figure~\ref{fig:block}(a) for $j=2$. For comparison, in the full square $[0,1]^2$ the same count gives $9^j$ cells, $3^j$ of which meet the line, and the ratio is $3^j=h^{-1}$: the exponent is~$1$. On the carpet the ratio $4^j=h^{-\lambda}$ governs the energies in two opposite ways. \begin{figure}[t] \centering \begin{tikzpicture}[x=3.5mm,y=3.5mm] \blockpicture{0} \foreach \a in {0,2,6,8}{\foreach \b in {0,2,6,8}{\fill[navy,draw=white,line width=.4pt] (\a,\b) rectangle ++(1,1);}} \foreach \b in {0,2,6,8}{\fill[cutred,draw=white,line width=.4pt] (4,\b) rectangle ++(1,1);} \node at (4.5,-1.5) {\small (a)}; \begin{scope}[shift={(13,0)}] \blockpicture{0} \blockpicture{9} \foreach \b in {0,2,6,8}{\foreach \c in {0,...,17}{\fill[rowblue,draw=white,line width=.4pt] (\c,\b) rectangle ++(1,1);}} \foreach \o in {0,9}{\foreach \a in {0,2,6,8}{\foreach \b in {0,2,6,8}{\fill[navy,draw=white,line width=.4pt] ({\o+\a},\b) rectangle ++(1,1);}}} \draw[black,line width=.6pt] (9,-.35) -- (9,9.35); \foreach \a/\b in {0/8,2/6,6/2,8/0}{% \draw[white,line width=2.6pt] (\a+.5,\b+.5) -- (\a+9.25,\b+.5); \draw[cutred,line width=1.3pt,{Circle[length=3.2pt,width=3.2pt]}-{Latex[length=5pt,width=4.4pt]}] (\a+.5,\b+.5) -- (\a+9.5,\b+.5);} \node at (4.5,9.9) {\small $[P]$}; \node at (13.5,9.9) {\small $[P']$}; \node at (9,-1.5) {\small (b)}; \end{scope} \end{tikzpicture} \caption{(a) The $8^2$ cells of side~$h$ contained in a cell $P$ of side $9h$ of the carpet. The middle column, in red, has only $2^2$ cells; the $4^2$ dark cells have both coordinates in the discrete Cantor set $\Cc_2=\{0,2,6,8\}$. (b)~Two adjacent cells $P$ and $P'$. The rows with second coordinate in $\Cc_2$, in blue, meet no hole. The arrows show four of the $4^2$ paths, from a dark cell of $P$ to the corresponding cell of~$P'$, used in the proof of Lemma~\ref{lem:cross}; each edge belongs to at most $2^2$ of these paths.}\label{fig:block} \end{figure} \paragraph{A set with small energy.} Let $A=\{x\in F:\ x_1<\frac12\}$ and $0\lambda$. If~\hC{} holds as well, $BV(X)$ is dense in $L^1(X,m)$, and $\lambda$ is the critical exponent of~\cite{AB}. This is Theorem~\ref{th:metric}. The two hypotheses can be tested on sets, in the limit of small scales. They hold if and only if there are constants $C$, $\Lambda$ and~$M$ with the following two properties: every ball~$B$ of radius~$R$ and every set~$E$ satisfy the relative isoperimetric inequality \begin{equation*} \min\{m(B\cap E),\,m(B\setminus E)\}\le C\,R^{\lambda}\Per(E;\Lambda B)\,, \end{equation*} and every ball $B(x,R)$ is contained in a set $G\subset B(x,MR)$ with $\Per(G)\le C\,m(B(x,R))\,R^{-\lambda}$. The lower limits which define these perimeters may be replaced by upper limits in both conditions, and not in the first one alone (Theorem~\ref{th:onescale} and Proposition~\ref{prop:mixed}). \paragraph{Isoperimetric and Sobolev inequalities (Chapter~\ref{sec:bv}).} Let $Q\ge\lambda$ be an exponent such that $m(B(y,r))\ge c\,(r/R)^Q\,m(B(x,R))$ for $y\in B(x,R)$ and $r\le R$; such an exponent exists because $m$ is doubling, and it is the dimension when $m$ is Ahlfors regular. Under~\hP, for every set~$E$ and every ball~$B$ of radius~$R$, \begin{equation*} \Big(\frac{\min\{m(B\cap E),\,m(B\setminus E)\}}{m(B)}\Big)^{1-\frac\lambda Q}\le C\,\frac{R^{\lambda}}{m(B)}\Per(E;B')\,, \end{equation*} where $B'$ is a fixed dilate of~$B$. Together with a coarea inequality, this gives a Sobolev inequality in the Lorentz space $L^{q,1}$ with $q=\frac{Q}{Q-\lambda}$, and the Gagliardo--Nirenberg and Nash inequalities (Theorem~\ref{th:isop} and Corollary~\ref{cor:gn}). When $Q=\lambda$ the functions of bounded variation are essentially bounded on every ball. On compact Ahlfors $Q$-regular spaces satisfying both hypotheses with $Q>\lambda$, $L^{q,1}$ is the smallest rearrangement-invariant Banach target of this embedding (Proposition~\ref{prop:optimallorentz}). \paragraph{Boundaries of sets (Chapters~\ref{sec:top} and~\ref{sec:federer}).} Let $\Hcod\lambda$ be the \emph{Hausdorff measure of codimension~$\lambda$}, defined by coverings with balls $B(x,r)$ of cost $m(B(x,r))\,r^{-\lambda}$. Let $\partial^*E$ be the measure-theoretic boundary of~$E$, the set of points at which both $E$ and $X\setminus E$ have positive upper density. Under~\hP{} and~\hC, \begin{equation*} C^{-1}\,\Hcod\lambda(\partial^*E)\le\Per(E)\le C\,\Hcod\lambda(\partial^*E) \end{equation*} for every measurable set~$E$ (Theorem~\ref{th:federer}). This is the analogue of Federer's characterization of the sets of finite perimeter. For the topological boundary, the two hypotheses imply that $\lambda$ is the supremum of the numbers~$\beta$ such that $X$ has a basis of open sets~$U$ with $\Hcod\beta(\partial U)=0$. We call this supremum the topological Hausdorff codimension (Theorem~\ref{th:dimension}). Chapter~\ref{sec:charact} contains two further descriptions of the perimeter: by the small-scale lower limit of $r^{-\lambda}$ times the measure of the set of centres of the balls of radius~$r$ in which $E$ and $X\setminus E$ both fill a fixed proportion, and by approximation with open sets whose boundaries have controlled Hausdorff measure. \paragraph{Variation measures (Chapter~\ref{sec:measures}).} In the classical theory the total variation is a measure. Here the normalized energy $r^{-\lambda}J_r(f)$ is the mass of a measure $m_{r,f}$, and a \emph{BV measure} of~$f$ is a limit of $m_{r_k,f}$ along a sequence $r_k\downarrow0$. In general $f$ has several BV measures. Under~\hP{} any two of them are comparable, and they have a greatest lower bound $\mu_f^-$ and a least upper bound $\mu_f^+$, which are obtained by Carath\'eodory's construction from the lower and upper limits of the local energies. Under~\hP{} and~\hC{} all these measures are comparable to the coarea measure \begin{equation*} \nu_f(A)=\int_{\R}\Hcod\lambda\big(A\cap\partial^*\{f>u\}\big)\,du\,. \end{equation*} The comparison is Theorem~\ref{th:measures}. On the jump set of $f$, the density of $\nu_f$ with respect to $\Hcod\lambda$ is the difference of the approximate upper and lower limits of $f$. Off the jump set, $\nu_f$ vanishes on every Borel set of $\sigma$-finite $\Hcod\lambda$-measure (Proposition~\ref{prop:coareajump}). Under~\hP{} and~\hC{}, Theorem~\ref{th:relaxed} constructs the relaxed coarea measure $\overline\nu_f$. It is comparable to $\nu_f$, satisfies the coarea formula and is lower semicontinuous on open sets and subadditive with constant one. For sets it is the largest lower semicontinuous measure below $\Hcod\lambda\llcorner\partial^*E$. In $\R^n$ it is a constant multiple of the classical variation measure. In the plane with the maximum norm, the relaxed coarea measure, Miranda's total variation and the BV measures have different direction-dependent densities (Section~\ref{sec:coarea-one}). The lower semicontinuous envelope of $\Var(\cdot;U)$ in $L^1_{\mathrm{loc}}(U)$ can fail to be additive even on positively separated open sets. In the example of Proposition~\ref{prop:phase}, two jumps attain their smallest normalized energies along different sequences of radii. Their sum has variation strictly larger than the integral of the perimeters of its superlevel sets. \paragraph{The exponent one (Chapter~\ref{sec:classical}).} No exponent smaller than~$1$ can satisfy~\hP. The exponent $\lambda=1$ satisfies~\hP{} exactly in the spaces with a $(1,1)$-Poincar\'e inequality, and in these spaces $\Var(f)$ is comparable to the total variation of Miranda and the BV measures are comparable to the total variation measure (Theorem~\ref{th:classical}). With $\lambda=1$, the results above are the known results of the classical theory, up to the values of the constants; the correspondence is described in Section~\ref{sec:intro-classical}. \paragraph{Ahlfors regular spaces (Chapter~\ref{sec:ahlfors}).} If $m$ is Ahlfors regular of dimension~$Q$, then $\Hcod\lambda$ is comparable to the Hausdorff measure of dimension $s=Q-\lambda$, and the two hypotheses imply that \begin{equation*} d_{tH}(X)=Q-\lambda+1\,, \end{equation*} where $d_{tH}$ is the topological Hausdorff dimension of Balka, Buczolich and Elekes~\cite{BBE}. Moreover, if $s>0$, the infimum of the perimeters of the sets of measure~$w$ is comparable to $\min\{w,m(X)-w\}^{s/Q}$ (Theorem~\ref{th:ahlfors}). \paragraph{A dictionary.} The following table summarizes the correspondence with the Euclidean and the classical theories. Here $\mu$ ranges over the BV measures of~$f$, and the last line is the topological Hausdorff codimension. \begin{center} \renewcommand{\arraystretch}{1.3} \begin{tabular}{lccc} \toprule & $\R^n$ & classical theory & under \hP{} and \hC\\ \midrule critical exponent & $1$ & $1$ & $\lambda$\\ Poincar\'e constant, radius $R$ & $C\,R$ & $C\,R$ & $C\,R^{\lambda}$\\ perimeter $\Per(E)$ & $\asymp\Hc^{n-1}(\partial^*E)$ & $\asymp\Hcod1(\partial^*E)$ & $\asymp\Hcod\lambda(\partial^*E)$\\ variation measures & $|Df|$ & $\|Df\|$ & $\mu_f^-\le\mu\le\mu_f^+$\\ isoperimetric exponent & $1-\frac1n$ & $1-\frac1Q$ & $1-\frac\lambda Q$\\ Sobolev exponent & $\frac n{n-1}$ & $\frac Q{Q-1}$ & $\frac Q{Q-\lambda}$\\ topological codimension & $1$ & $1$ & $\lambda$\\ \bottomrule \end{tabular} \end{center} If $m$ is Ahlfors regular of dimension~$Q$, the last line states that the topological Hausdorff dimension of~$X$ is $Q-\lambda+1$. \section{The examples}\label{sec:intro-examples} Let $F$ be the standard Sierpi\'nski carpet, $F_\infty$ the unbounded carpet, $\MS\subset[0,1]^3$ the standard Menger sponge and $\SG\subset\R^2$ the standard Sierpi\'nski gasket, with Hausdorff measure normalized to give mass one to a unit cell. The carpets and the sponge carry the distance $d(x,y)=\max_i|x_i-y_i|$ and the gasket the Euclidean distance; replacing a distance by a bi-Lipschitz equivalent one changes neither the hypotheses nor the class $BV(X)$ (Remark~\ref{rem:bilip}). \begin{theorem}\label{th:examples} The spaces $F$, $F_\infty$, $\MS$ and $\SG$ are Ahlfors regular and satisfy~\hP{} and~\hC{} with the following exponents. \begin{center} \renewcommand{\arraystretch}{1.25} \begin{tabular}{l|c|c|c|c} & $Q$ & $\lambda$ & $s=Q-\lambda$ & $q=Q/s$\\\hline $F$, $F_\infty$ & $\log_38$ & $\log_34$ & $\log_32$ & $3$\\ $\MS$ & $\log_320$ & $\log_35$ & $\log_34$ & $\log_420$\\ $\SG$ & $\log_23$ & $\log_23$ & $0$ & $\infty$ \end{tabular} \end{center} Consequently Theorems~\ref{th:metric}, \ref{th:isop}, \ref{th:federer}, \ref{th:dimension} and~\ref{th:ahlfors} hold on these spaces. On $F$, $F_\infty$ and $\MS$, Theorem~\ref{th:ahlfors}\ref{it:ahl-fed} holds with $D_\eta(E)$ replaced by $\Sigma_\gamma(E)$, for some $\gamma>0$. \end{theorem} The proof is in Chapters~\ref{sec:carpet}, \ref{sec:sponge} and~\ref{sec:gasket}: see Theorems~\ref{th:carpet} and~\ref{th:sponge} and Proposition~\ref{prop:gasketaxioms}. In particular $\lambda_1^*=\lambda_1^\#=\log_34$ on the carpets, $\log_35$ on the sponge and $\log_23$ on the gasket, where $\lambda_1^*$ and $\lambda_1^\#$ are the two critical exponents of Section~\ref{sec:defs}; the $(1,1)$-Poincar\'e inequality fails on these spaces, and \begin{equation*} d_{tH}(F)=1+\log_32\,,\qquad d_{tH}(\MS)=1+\log_34\,,\qquad d_{tH}(\SG)=1\,. \end{equation*} The value of $d_{tH}(F)$ is~\cite[Theorem~5.4]{BBE}. The Sobolev inequality holds in $L^{3,1}$ on the carpet, where $s/Q=\frac13$, and in $L^\infty$ on the gasket. \paragraph{Which sets have finite perimeter?} On the compact standard carpet, for $0<\tau<1$ (Proposition~\ref{prop:lines} and Figure~\ref{fig:lines}), \begin{equation*} \Per\big(\{x\in F:\ x_1<\tau\}\big)<\infty\quad\Longleftrightarrow\quad\tau=(k+\tfrac12)\,3^{-n}\ \text{ with integers }n\ge0,\ 0\le k<3^n\,, \end{equation*} that is, if and only if the line $\{x_1=\tau\}$ passes through the centres of squares of the construction. Each proper construction cell has infinite perimeter, because it shares a whole side with a neighbouring cell (Remark~\ref{rem:cellperimeter}). For the central cut, the energy measure divided by its mass converges to the uniform Cantor measure on $F\cap\{x_1=\tfrac12\}$, with error at most $12r$ in the $1$-Wasserstein distance (Proposition~\ref{prop:carpetaverage}). The same cuts characterize the entire class of BV functions of one coordinate. Let $T$ be the set of midpoints in the preceding display and let $N(\tau)$ count the ternary digits of $\tau\in T$ that differ from~$1$. Every such function has, almost everywhere, the form \[ f(x)=c+\sum_{\tau\in T}b_\tau\ind_{\{x_1>\tau\}},\qquad \Var(f)=\Per(\{x_1<\tfrac12\})\sum_{\tau\in T}(3/2)^{N(\tau)}|b_\tau|. \] Conversely, every series with finite weighted sum gives a BV function. In particular every continuous critical BV function depending on a single coordinate is constant (Theorem~\ref{th:coordinateprofiles}). \paragraph{A family of carpets.} Let $F_{b,a}$ be the planar carpet obtained by subdividing each square into $b^2$ equal squares and removing the central $a\times a$ block, where $a,b$ are odd and $1\le a\le b-2$. Theorem~\ref{th:centralcarpets} gives \begin{equation*} \lambda_1^*(F_{b,a})=\lambda_1^\#(F_{b,a})=\log_b(b+a)\,, \qquad d_{tH}(F_{b,a})=1+\log_b(b-a)\,. \end{equation*} At generation $j$ this carpet has $(b^2-a^2)^j$ cells and $(b-a)^j$ complete rows, and their ratio $(b+a)^j$ gives the scale dependence of the Poincar\'e inequality on the graph of cells. Complete rows and columns also give a strong boundary characterization on every $F_{b,a}$, with $s=\log_b(b-a)$. For every measurable $E$, \[ \Per(E)\asymp\Hc^s(\partial^*E)\asymp\Hc^s(\Sigma_\gamma(E)) \] for some $\gamma>0$ depending only on the carpet (Corollary~\ref{cor:centralstrong}). When $a\ge3$, distribution functions of Cantor measures on the central digits give continuous critical BV functions separating points. Their algebra is uniformly dense in $C(F_{b,a})$ (Proposition~\ref{prop:carpetcontinuous}). \paragraph{The gasket.} On the Sierpi\'nski gasket $\lambda=Q$, the measure $\Hcod\lambda$ is comparable to the counting measure, and the theory becomes completely explicit (Theorem~\ref{th:gasket}). A set has finite perimeter precisely when it agrees almost everywhere with a finite union of cells. Its perimeter counts its boundary junctions with a fixed weight. The coarea formula is exact, and the variation is the same constant times the sum of the jumps at the junctions. On open sets the jump measure is recovered by taking the supremum of the local variations on relatively compact open subsets (Corollary~\ref{cor:gasketlocalization}). In particular a continuous function of bounded variation on the gasket is constant, as conjectured in~\cite[Conjecture~5.3(2)]{AB}. \paragraph{Two different exponents.} Chapter~\ref{sec:nocommon} treats the two examples of Cao and Chen~\cite{CC} and the same construction in every dimension $n\ge2$. Each cube is divided into $5^n$ cubes, and the $2n$ face-neighbours of the central cube are removed. Write $Q=\log_5(5^n-2n)$ and $t=\log_5(5^{n-1}-2n+1)$. On the resulting space $X_n$, the sharp ranges of the two hypotheses are given by \begin{align*} \hP\text{ at }\beta&\quad\Longleftrightarrow\quad \beta\ge Q-n+2 \,,\\ \hC\text{ at }\beta&\quad\Longleftrightarrow\quad 0<\beta\le Q-t\,, \qquad d_{tH}(X_n)=1+t\,. \end{align*} Both critical Besov exponents are equal to $Q-n+2$, and the critical Besov class is dense in $L^1(X_n,m)$. Since $t>n-2$, the geometric quantity $Q-d_{tH}(X_n)+1$ equals the strictly smaller exponent $Q-t$. The central cells, which are attached to the others only along faces of dimension $n-2$, account for the critical Besov exponent. The complete rows of fine cells, and the sets which separate their two ends, account for the largest exponent of~\hC{} (Proposition~\ref{prop:nocommon}). These spaces show that the sharp exponents of the two hypotheses can differ, and that the identity $\lambda_1^*=Q-d_{tH}+1$ then fails. \section{Related work} \paragraph{Functions of bounded variation in metric measure spaces.} The relation with the theory of Miranda and Ambrosio is the subject of Chapter~\ref{sec:classical}. For strictly local Dirichlet spaces with a doubling measure, a $2$-Poincar\'e inequality and a weak Bakry--\'Emery estimate, the functions of bounded variation were identified in~\cite{ABII} with a Besov class defined through the heat semigroup, and in~\cite{AB} this approach was extended to Dirichlet spaces with sub-Gaussian heat kernel estimates, which include the fractals considered here; see Remark~\ref{rem:AB}. For the characterization of sets of finite perimeter by the heat semigroup under the $(1,1)$-Poincar\'e inequality see~\cite{MMS}. BV measures were introduced in~\cite[Section~4.6]{AB}, where the BV measures of a bounded function of bounded variation are shown to have bounded densities with respect to each other~\cite[Theorem~4.23]{AB}, by means of the heat semigroup and under a weak Bakry--\'Emery estimate; Theorem~\ref{th:measures}\ref{it:meas-exist} obtains this under~\hP{} alone, without the boundedness of the function. The periodic profiles of heat energies and of ball energies with the normalization $r^{-d_h}$ on unbounded nested fractals are studied in~\cite{Osc}. The property that the supremum of the normalized energies is bounded by their lower limit is the property $\mathcal P(1,\lambda)$ of~\cite[Section~4.2]{Bau}, called there weak monotonicity. \paragraph{Poincar\'e inequalities on graphs.} The inequality on the graphs of cells is the case $p=1$ of the Poincar\'e inequalities on approximating graphs which underlie the construction of Dirichlet forms on fractals by Kusuoka and Zhou~\cite{KZ} and of $p$-energies for $p>1$ by Kigami~\cite{Kig}, Shimizu~\cite{Shi} and Murugan and Shimizu~\cite{MS}; compare the notion of conductive homogeneity of~\cite{Kig}. Related isoperimetric and separation estimates on the graphs of carpets were obtained by Osada~\cite{Osada}, Gibson and Pivarski~\cite{GibsonPivarski} and Gladkova and Shum~\cite{Gladkova}. \paragraph{Poincar\'e inequalities with two scales.} Hypothesis~\hP{} bounds the oscillation of a function at one scale by its oscillations at a smaller positive scale, without a gradient. In doubling spaces which support a $(1,p)$-Poincar\'e inequality, an inequality of this type was introduced by Hyt\"onen and Korte under the name of macroscopic Poincar\'e inequality~\cite[Theorem~3.4]{HyKo}, and shown to be equivalent to the Poincar\'e inequality for every $p\ge1$~\cite[Proposition~10.2]{HyKo}. For $p=1$ this is the relation between~\hP{} with $\lambda=1$ and the $(1,1)$-Poincar\'e inequality of Proposition~\ref{prop:PI}. For strongly local $p$-energy forms with $p>1$ and a general scale function, a macroscopic Poincar\'e inequality is derived in~\cite{BPY} from a Poincar\'e inequality for the energy measures and an upper bound for capacities. Theorem~\ref{th:onescale} is the corresponding statement for the variation: \hP{} and~\hC{} together are equivalent to a relative isoperimetric inequality and a bound for the perimeter of the cutoff sets. \begin{remark}[The conjecture of~\cite{AB}]\label{rem:AB} In~\cite{AB} the space carries a Dirichlet form whose heat kernel satisfies sub-Gaussian estimates with a walk dimension~$d_w$. The Besov classes of~\cite{AB} are defined through the heat semigroup and indexed by an exponent~$\alpha$; under these estimates they are the classes $\Bes\beta(X)$ with $\beta=\alpha\,d_w$~\cite[Section~2.3]{AB}, and the class $BV(X)$ of~\cite[Definition~4.4]{AB} is $\Bes\beta(X)$ at the critical exponent $\beta=\lambda_1^\#$. In this correspondence, \cite[Conjecture~5.4]{AB} predicts for generalized Sierpi\'nski carpets that \begin{equation}\label{eq:conj} \lambda_1^*=d_h-d_{tH}+1\,, \end{equation} where $d_h$ is the Hausdorff dimension and $d_{tH}$ the topological Hausdorff dimension; the inequality $\lambda_1^*\ge d_h-d_{tH}+1$ was obtained in~\cite[Section~5.1]{AB}. Theorems~\ref{th:metric} and~\ref{th:ahlfors} give $\lambda_1^*=\lambda=Q-d_{tH}(X)+1$, hence~\eqref{eq:conj}, for every Ahlfors regular space satisfying~\hP{} and~\hC, in particular for the standard carpet, the planar carpets $F_{b,a}$ of Theorem~\ref{th:centralcarpets}, and the Menger sponge. For the gasket, and more generally for nested fractals, the value $\lambda_1^*=d_h$ was obtained in~\cite[Theorem~5.1]{AB}. For a doubling measure which is not Ahlfors regular the relation~\eqref{eq:conj} is replaced by $\lambda_1^*=\codim_{tH}(X,d,m)$ (Theorems~\ref{th:metric} and~\ref{th:dimension}). Section~\ref{sec:carpet-heat} explains the upper bound that this value of $\lambda_1^\#$ imposes on the weak Bakry--\'Emery exponent of the standard carpet. \end{remark} \begin{remark}[Points and resistance]\label{rem:resistance} For $p$ larger than the Ahlfors regular conformal dimension, the $p$-energy forms $(\mathcal E_p,\mathcal F_p)$ constructed in~\cite{Kig,Shi} are $p$-resistance forms in the sense of Kajino and Shimizu~\cite{KS}: the functions of $\mathcal F_p$ are continuous, and $\sup_u|u(x)-u(y)|^p/\mathcal E_p(u)<\infty$ for all points $x,y$. There is no such structure for $\Var$. Let $m$ be Ahlfors regular of dimension~$Q$ and $s=Q-\lambda$. If $s>0$, hypothesis~\hC{} provides sets $G\supset B(x,R)$ with $\Per(G)\le C\,R^s\to0$ as $R\downarrow0$, and $BV(X)$ contains unbounded functions. If $s=0$, Theorem~\ref{th:ahlfors}\ref{it:ahl-isop} bounds the essential oscillation of $f\in BV(X)$ on every ball by $C\Var(f)$, but the sets $G$ of~\hC{} around arbitrarily small balls have perimeter at most $C$ and their indicators have oscillation~$1$, so that this bound does not improve at small distances; on the gasket no non-constant function of bounded variation is continuous (Theorem~\ref{th:gasket}). In both cases the geometric information is carried by the perimeter of sets and not by a distance between points. \end{remark} \section{An open question on the strong boundary}\label{sec:open} For $0<\gamma\le\frac12$, let $\Sigma_\gamma(E)$ denote the set of points at which both $E$ and its complement have lower density at least $\gamma$ (Section~\ref{sec:federer-intro}). Do \hP{} and \hC{} alone imply that there exist $\gamma>0$ and $C<\infty$ such that \[ \Per(E)\le C\,\Hcod\lambda(\Sigma_\gamma(E))\qquad\text{for every measurable }E\subset X\,? \] The endpoint $Q=\lambda$ follows from Theorem~\ref{th:federer}\ref{it:fed-zero}. For $Q>\lambda$, Theorem~\ref{th:strong} and Corollary~\ref{cor:strongselection} give sufficient conditions on a cell structure. They cover the standard bounded and unbounded carpets, every central-block carpet $F_{b,a}$, and the Menger sponge (Theorems~\ref{th:carpet} and~\ref{th:sponge} and Corollary~\ref{cor:centralstrong}). The question concerns the general doubling case without these additional conditions. \section{Organization of the memoir} Figure~\ref{fig:leitfaden} in the preface shows the dependence of the chapters, and Figure~\ref{fig:plan} shows how the two hypotheses enter the main results. \paragraph{Part~I: the general theory.} Chapter~\ref{sec:prelim} fixes the setting, defines the energies and the two hypotheses, and records the covering and kernel estimates. Chapter~\ref{sec:wm} proves the comparison of scales and the critical-exponent theorem, a compactness criterion which allows the sets of~\hC{} to depend on the scale, and the equivalence of the two hypotheses with their limits at small scales. Chapter~\ref{sec:bv} establishes the coarea, isoperimetric and Sobolev inequalities. Chapters~\ref{sec:top} and~\ref{sec:federer} treat the topological and the measure-theoretic boundaries. Chapter~\ref{sec:charact} gives the two further descriptions of the perimeter. Chapter~\ref{sec:measures} constructs the lower and upper envelopes of the BV measures, identifies the jump part of the coarea measure, gives the counterexample for relaxation on open sets, and constructs the relaxed coarea measure. \paragraph{Part~II: two special settings.} Chapter~\ref{sec:classical} identifies the case $\lambda=1$ with the classical theory. Chapter~\ref{sec:ahlfors} translates the results into the language of Hausdorff dimension when the measure is Ahlfors regular, and computes the isoperimetric profile and the approximation numbers of the embedding of $BV(X)$ into $L^1(X,m)$. Its final section compares the metric variation with heat flow on Dirichlet spaces. \paragraph{Part~III: examples.} Chapter~\ref{sec:cells} passes from graph estimates to the metric space and characterizes BV functions by the differences of medians on adjacent cells (Theorem~\ref{th:cellmedians}). Chapters~\ref{sec:carpet}, \ref{sec:sponge} and~\ref{sec:gasket} apply this method to carpets, to the sponge and to the gasket. Chapter~\ref{sec:nocommon} computes the two different exponents of the spaces~$X_n$. \begin{figure}[ht] \centering \begin{tikzpicture}[>={Latex[length=5pt,width=4pt]}, box/.style={draw=navy,rounded corners=2pt,align=center,font=\footnotesize,inner sep=3pt,text width=42mm}, hyp/.style={draw=navy,fill=cellgray,rounded corners=2pt,font=\small,inner sep=4pt,minimum width=13mm}] \node[box] (graph) at (0,0) {graph Poincar\'e inequality\\ with constant $C\,b_0^{\,j\lambda}$\\ (Chapters~\ref{sec:carpet} to~\ref{sec:gasket})}; \node[box,text width=45mm] (pi) at (5.3,0) {$\lambda=1$: $(1,1)$-Poincar\'e\\ inequality for \hP, balls for \hC\\ (Theorem~\ref{th:classical})}; \node[box] (rect) at (10.6,0) {sets $G$ with small energy\\ between $B(x,R)$ and $B(x,MR)$\\ (Chapters~\ref{sec:carpet} to~\ref{sec:gasket})}; \node[hyp] (P) at (0,-1.8) {\hP}; \node[hyp] (C) at (10.6,-1.8) {\hC}; \node[box] (wm) at (0,-3.6) {$S_\lambda(f)\le C\Var(f)$,\\ Poincar\'e inequality for $\Var$\\ (Chapter~\ref{sec:wm})}; \node[box,text width=45mm] (crit) at (5.3,-3.6) {$BV(X)=\Bes\lambda(X)$ dense,\\ $\lambda_1^*=\lambda_1^\#=\lambda$\\ (Theorem~\ref{th:metric})}; \node[box] (basis) at (10.6,-3.6) {open sets $U$ with\\ $\Hcod\beta(\partial U)=0$ for $\beta<\lambda$\\ (Proposition~\ref{prop:basis})}; \node[box] (isop) at (0,-5.6) {coarea, isoperimetric and\\ Sobolev inequalities\\ (Theorem~\ref{th:isop})}; \node[box,text width=45mm] (top) at (5.3,-5.6) {isoperimetric inequality for\\ the content of $\partial E$\\ (Proposition~\ref{prop:topiso})}; \node[box] (dim) at (10.6,-5.6) {$\codim_{tH}(X,d,m)=\lambda$\\ (Theorem~\ref{th:dimension})}; \node[box] (prof) at (0,-7.4) {isoperimetric profile,\\ Ahlfors regular case\\ (Theorem~\ref{th:profiles})}; \node[box,text width=45mm] (lim) at (5.3,-7.4) {isoperimetric inequality for\\ the content of $D_\eta(E)$\\ (Proposition~\ref{prop:limsup})}; \node[box] (fed) at (10.6,-7.4) {$\Per(E)\asymp\Hcod\lambda(\partial^*E)$\\ (Theorem~\ref{th:federer})}; \draw[->] (graph) -- node[right,font=\footnotesize] {Proposition~\ref{prop:transfer}} (P); \draw[->] (rect) -- (C); \draw[->] (pi.south) -- (P.north east); \draw[->] (pi.south) -- (C.north west); \draw[->] (P) -- (wm); \draw[->] (P) -- (crit); \draw[->] (C) -- (crit); \draw[->] (C) -- (basis); \draw[->] (wm) -- (isop); \draw[->] (isop) -- node[above,font=\footnotesize] {\hC} (top); \draw[->] (basis) -- (dim); \draw[->] (top) -- (dim); \draw[->] (isop) -- node[right,font=\footnotesize] {\hC} (prof); \draw[->] (top) -- node[right,font=\footnotesize] {\cite{EB}} (lim); \draw[->] (lim) -- (fed); \end{tikzpicture} \caption{The logical structure of the general theory. An arrow labelled~\hC{} uses this hypothesis in addition to its source. The notation $S_\lambda$, $D_\eta(E)$ and $\codim_{tH}$ is introduced in Sections~\ref{sec:defs}, \ref{sec:federer-intro} and~\ref{sec:top-intro}.}\label{fig:plan} \end{figure} \part{The general theory} \chapter{The setting}\label{sec:prelim} \begin{overview} We fix the class of spaces, define the energies $J_r$, state the two hypotheses~\hP{} and~\hC{} precisely, and define the variation, the perimeter and the space $BV(X)$. We also record the tools which are used in every later chapter: the consequences of the doubling property, nets and Voronoi partitions, the elementary properties of the energies, and the Hausdorff measures of given codimension. Nothing in this chapter is deep, and a reader who is familiar with analysis in doubling spaces can read Sections~\ref{sec:energies} to~\ref{sec:defs} and return to the rest when needed. \end{overview} \section{Standing assumptions}\label{sec:hyp} For the ball energies studied throughout the memoir, $(X,d)$ is a proper metric space with at least two points. Recall that a metric space is \emph{proper} if its closed bounded subsets are compact. We write \begin{equation*} B(x,r)=\{y\in X:\ d(x,y)0\,. \end{equation} The space may be compact, in which case $D<\infty$ and $X=B(x,2D)$ for every~$x$, or unbounded. No other assumption is made in this chapter: in particular $X$ need not be connected. \paragraph{The exponent $Q$.} A doubling measure cannot decay too fast: iterating~\eqref{eq:doubling} one obtains constants $Q>0$ and $c_Q\in(0,1]$ such that \begin{equation}\label{eq:decay} \frac{m(B(y,r))}{m(B(x,R))}\ge c_Q\,\Big(\frac rR\Big)^{Q}\qquad\text{for }x\in X,\ y\in B(x,R),\ 00,\ t\ge1\,. \end{equation} If $y\in B(x,R)$ and $00$, and choose $y\in X$ with $\rho=d(x,y)\ge4R$. The balls $B(x,\rho/2)$ and $B(y,\rho/2)$ are disjoint and contained in $B(x,2\rho)\subset B(y,4\rho)$, and $m(B(y,4\rho))\le C_d^{\,3}\,m(B(y,\rho/2))$. Hence \begin{equation*} m(B(x,R))\le m(B(x,\rho/2))\le m(B(x,2\rho))-m(B(y,\rho/2))\le\big(1-C_d^{-3}\big)\,m(X)\,, \end{equation*} and letting $R\to\infty$ we see that $m(X)$ cannot be finite. Conversely, if $D<\infty$ then $X=B(x,2D)$. The space $X$ may have isolated points, and $m$ may have atoms. This is excluded by hypothesis~\hP, which implies that $X$ is connected (Lemma~\ref{lem:continua}). \paragraph{Nets and Voronoi partitions.} Nets replace the dyadic cubes of~$\R^n$: they provide, at every scale~$h$, a covering of~$X$ by balls of radius~$h$ with bounded overlap, and a partition of~$X$ into sets of size comparable to~$h$. For $h>0$, a set $\Xi\subset X$ is \emph{$h$-separated} if $d(z,z')\ge h$ for distinct $z,z'\in\Xi$, and an \emph{$h$-net} is a maximal $h$-separated set. Every $h$-separated set is contained in an $h$-net. For $t\ge1$ let \begin{equation*} \kappa(t)=C_d\,(4t+1)^{Q_d}\,. \end{equation*} \begin{lemma}\label{lem:nets} Let $h>0$. \begin{enumerate}[label=\textup{(\roman*)}] \item\label{it:packing} If $\Xi$ is $h$-separated, $x\in X$ and $t\ge1$, then $\#\big(\Xi\cap B(x,th)\big)\le\kappa(t)$. \item\label{it:netcover} If $\Xi$ is an $h$-net, then $X=\bigcup_{z\in\Xi}B(z,h)$, and for every $t\ge1$ each point of $X$ belongs to at most $\kappa(t)$ of the balls $B(z,th)$, $z\in\Xi$. \item\label{it:voronoi} If $\Xi$ is an $h$-net, there are pairwise disjoint Borel sets $V_z$, $z\in\Xi$, which cover $X$ and satisfy \begin{equation}\label{eq:voronoi} B(z,h/2)\subset V_z\subset B(z,h)\,,\qquad C_d^{-1}\,m(B(z,h))\le m(V_z)\le m(B(z,h))\,. \end{equation} \end{enumerate} \end{lemma} \begin{proof} \ref{it:packing} Let $F$ be a finite subset of $\Xi\cap B(x,th)$, and let $z\in F$ be a point for which $m(B(z,h/2))$ is smallest. The balls $B(z',h/2)$, $z'\in F$, are pairwise disjoint and contained in $B(x,(t+\frac12)h)\subset B(z,(2t+\frac12)h)$. By~\eqref{eq:dbl}, \begin{equation*} \#F\ m(B(z,h/2))\le m\big(B(z,(2t+\tfrac12)h)\big)\le C_d\,(4t+1)^{Q_d}\,m(B(z,h/2))\,. \end{equation*} \ref{it:netcover} If $y\in X$ had distance at least $h$ from every point of $\Xi$, then $\Xi\cup\{y\}$ would be $h$-separated. The second assertion follows from~\ref{it:packing}, because $y\in B(z,th)$ means $z\in B(y,th)$. \ref{it:voronoi} By~\ref{it:packing}, $\Xi$ is countable and every ball contains finitely many of its points. Enumerate $\Xi=\{z_1,z_2,\dots\}$ and let \begin{equation*} V'_z=\{y\in X:\ d(y,z)=\dist(y,\Xi)\}\,,\qquad V_{z_k}=V'_{z_k}\setminus\bigcup_{ld(y,z)$, hence $y\in V_z$. The bounds on the measure follow from~\eqref{eq:doubling}. \end{proof} We call the sets $V_z$ of~\ref{it:voronoi} a \emph{Voronoi partition} for~$\Xi$. \paragraph{Means.} For a set $W$ with $00$ let \begin{equation}\label{eq:Jdef} J_r(f;W)=\iint_{W\times W}k_r(x,y)\,|f(x)-f(y)|\,dm(x)\,dm(y)\,,\qquad J_r(f)=J_r(f;X)\,, \end{equation} where \begin{equation*} k_r(x,y)=\frac{2\,\ind_{\{d(x,y)0\,. \end{equation*} More generally, if $E$ is a finite union of intervals with disjoint closures and $r$ is smaller than the lengths of these intervals and of the gaps between them, each of the endpoints contributes $r/2$, so that $J_r(\ind_E)=\frac r2\,\#\partial E$. Thus, with the exponent $\lambda=1$, the perimeter defined in Section~\ref{sec:defs} is $\Per(E)=\frac12\,\#\partial E$. Two features of this example are general. The energies are normalized differently from the classical total variation, which is $\#\partial E$ here, so that all comparisons with the classical theory hold only up to constants. And on the line the perimeter counts the boundary points: this is what happens whenever $Q=\lambda$ (Theorem~\ref{th:federer}\ref{it:fed-zero}), for instance on the Sierpi\'nski gasket. \end{example} \paragraph{Pairs separated by a set.} For $r>0$ let $\mu_r$ be the measure on $X\times X$ with the density $k_r$ with respect to $m\otimes m$, so that \begin{equation*} J_r(f;W)=\iint_{W\times W}|f(x)-f(y)|\,d\mu_r(x,y)\,. \end{equation*} Since $k_r(x,y)=k_r(y,x)$, the measure $\mu_r$ is invariant under the exchange of the two variables. For measurable sets $E,W\subset X$, the set of pairs of points of $W$ at distance less than~$r$ which are separated by~$E$ is \begin{equation*} \Pair_r(E;W)=\{(x,y)\in(W\cap E)\times(W\setminus E):\ d(x,y)0$. \begin{enumerate}[label=\textup{(\roman*)}] \item\label{it:Jsub} \emph{Subadditivity.} $J_r(f+g;W)\le J_r(f;W)+J_r(g;W)$, and for measurable sets $E_1,E_2,\dots$, \begin{equation}\label{eq:Junion} J_r\big(\ind_{\bigcup_iE_i};W\big)\le\sum_iJ_r(\ind_{E_i};W)\,. \end{equation} \item\label{it:JL1} \emph{Continuity in $L^1$.} $J_r(g;W)\le4\,\|g\|_{L^1(W)}$. Consequently \begin{equation*} |J_r(f;W)-J_r(g;W)|\le4\,\|f-g\|_{L^1(W)}\qquad\text{if }J_r(g;W)<\infty\,. \end{equation*} \item\label{it:Jsuper} \emph{Bounded overlap.} If $W_1,W_2,\dots\subset W$ are measurable and $m$-almost every point of $W$ belongs to at most $\kappa$ of them, then $\sum_iJ_r(f;W_i)\le\kappa\,J_r(f;W)$. \item\label{it:Jkernel} \emph{The kernel.} If $z\in X$, $t\ge1$, and $x,y\in B(z,tr)$ with $d(x,y)0$. Since~\eqref{eq:decay} remains true when $Q$ is increased, we may and do assume that \begin{equation*} Q\ge\lambda\,,\qquad\text{and we let}\qquad q=\frac{Q}{Q-\lambda}\in(1,\infty]\,,\qquad\frac1q=1-\frac\lambda Q\,. \end{equation*} Under the two hypotheses below, every exponent $Q$ for which~\eqref{eq:decay} holds satisfies $Q\ge\lambda$ (Remark~\ref{rem:Qlambda}), so that this assumption is then automatic. For a ball $B=B(x,R)$ and $t>0$ we write $tB=B(x,tR)$, and for a set $W$ with $01$ such that, for every $x\in X$ and $00$ of a ball $B$ of radius $R\le D$, then the left-hand side of~\eqref{eq:P} for $f=\ind_E$ is at least $\theta\,m(B)$ by~\eqref{eq:indicator2}, so that \begin{equation*} J_h(\ind_E;\Lambda B)\ge\frac{\theta}{C_P}\,\frac{m(B)}{R^{\lambda}}\,h^{\lambda}\qquad\text{for }01$. \paragraph{Uniqueness of the exponent.} If~\hP{} holds for $\lambda$ it holds for every larger exponent, if~\hC{} holds for $\lambda$ it holds for every smaller one, and \begin{equation*} \text{\hP{} for }\lambda_P\ \text{ and }\ \text{\hC{} for }\lambda_C\quad\Longrightarrow\quad\lambda_C\le\lambda_P \end{equation*} (Proposition~\ref{prop:unique}). Hence at most one exponent satisfies both hypotheses. \section{Variation, perimeter and the critical exponents}\label{sec:defs} For $\beta>0$, a measurable set $W\subset X$ and a measurable function $f\colon W\to\R$ we define \begin{equation*} S_\beta(f)=\sup_{0u\})\,du\le\Var(f)$ holds with the constant~$1$ and without any hypothesis (Proposition~\ref{prop:coarea}). \paragraph{Lower semicontinuity.} By Lemma~\ref{lem:Jbasic}\ref{it:JL1}, the functional $S_\beta$ is lower semicontinuous on $L^1(X,m)$ for every $\beta>0$: if $f_k\to f$ in $L^1(X,m)$ and $00:\ \Bes\beta(X)\text{ is dense in }L^1(X,m)\}\,,\\ \lambda_1^\#&=\sup\{\beta>0:\ \Bes\beta(X)\text{ contains a non-constant function}\}\,. \end{align*} Here and below, a function is called constant if it is constant $m$-almost everywhere. The first exponent measures how regular a dense class of functions can be, and the second one how regular a single non-constant function can be; we have $\lambda_1^*\le\lambda_1^\#$, because a dense subspace of $L^1(X,m)$ contains a non-constant function. In $\R^n$ both are equal to~$1$. \section{Hausdorff measures of given codimension}\label{sec:hausdorff} In $\R^n$ the perimeter of a set is the Hausdorff measure of dimension $n-1$ of its boundary. In a space which is only doubling there is no dimension to subtract from, and the natural boundary measure is defined by a \emph{codimension}: a ball of radius~$r$ is charged its measure divided by $r^\beta$. For $\beta>0$ and a ball $B=B(x,r)$ with a specified centre and radius let \begin{equation*} \xi_\beta(B)=\frac{m(B(x,r))}{r^{\beta}}\,, \end{equation*} and for $A\subset X$ and $0<\delta<\infty$ let \begin{equation*} \Hcod\beta_\delta(A)=\inf\Big\{\sum_\iota\xi_\beta(B_\iota):\ A\subset\bigcup_\iota B_\iota,\ B_\iota=B(x_\iota,r_\iota),\ x_\iota\in X,\ 00}\Hcod\beta_\delta$ is a Borel regular measure, by the argument of~\cite[Theorem~4.2]{Mat}: a ball of radius at most~$\delta$ cannot meet two sets whose distance is larger than~$2\delta$, so that $\Hcod\beta$ is additive on sets at positive distance from each other, and the balls are Borel sets. We record four properties. \begin{itemize} \item \emph{Doubling.} By~\eqref{eq:dbl}, \begin{equation}\label{eq:gaugedbl} \xi_\beta(B(x,tr))\le C_d\,t^{Q_d-\beta}\,\xi_\beta(B(x,r))\qquad\text{for }x\in X,\ r>0,\ t\ge1\,. \end{equation} Moreover, if $B(x,r)\subset B(x',r')$ and $r\le r'\le2r$, then $B(x',r')\subset B(x,4r)$, and therefore \begin{equation}\label{eq:gaugeEB} 2^{-\beta}\,\xi_\beta(B(x,r))\le\xi_\beta(B(x',r'))\le C_d^{\,2}\,\xi_\beta(B(x,r))\,. \end{equation} \item \emph{Measure.} If $A$ is covered by balls $B_\iota$ of radii $r_\iota\le\delta$, then $m(A)\le\sum_\iota r_\iota^{\beta}\,\xi_\beta(B_\iota)$, hence \begin{equation}\label{eq:contentmass} m(A)\le\delta^{\beta}\,\Hcod\beta_\delta(A)\,. \end{equation} In particular $m(A)=0$ if $\Hcod\beta(A)<\infty$. \item \emph{Comparison of codimensions.} If $\beta<\beta'$, then $\xi_{\beta'}(B)\ge\delta^{\beta-\beta'}\,\xi_\beta(B)$ for every ball $B$ of radius at most~$\delta$, hence \begin{equation}\label{eq:codimcompare} \Hcod{\beta'}_\delta(A)\ge\delta^{\beta-\beta'}\,\Hcod\beta_\delta(A)\,,\qquad\text{and}\qquad\Hcod\beta(A)>0\ \Longrightarrow\ \Hcod{\beta'}(A)=\infty\,. \end{equation} \item \emph{Neighbourhoods.} For every $A\subset X$ and $t>0$, \begin{equation}\label{eq:minkowski} \Hcod\beta_t(A)\le C_d\,t^{-\beta}\,m\big(B(A,t)\big)\,. \end{equation} Indeed, let $\{a_i\}$ be a maximal $t$-separated subset of~$A$. The balls $B(a_i,t)$ cover~$A$, and the balls $B(a_i,t/2)$ are pairwise disjoint and contained in $B(A,t)$, so that $\sum_i\xi_\beta(B(a_i,t))\le C_d\,t^{-\beta}\sum_im(B(a_i,t/2))\le C_d\,t^{-\beta}\,m(B(A,t))$. \end{itemize} The content $\Hcod\beta_\delta$ is not considered for $\delta=\infty$: if $D<\infty$, or if $D=\infty$ and $m(B(x,r))=o(r^\beta)$ as $r\to\infty$, the cost $\xi_\beta(B(x,r))$ of a single large ball tends to zero as $r\to\infty$, and the content with unrestricted radii vanishes identically. \section{Notation and conventions}\label{sec:conventions} We write $\partial E$ for the topological boundary of a set $E\subset X$. The other conventions are the following. \begin{itemize} \item $\N=\{0,1,2,\dots\}$, and $\#S$ is the cardinality of a set~$S$. \item Sets and functions are measurable with respect to the completion of the Borel $\sigma$-algebra for~$m$, and $\int_Wf\,dm$ is also written for functions defined on a larger set. \item $B(A,t)=\{y\in X:\ \dist(y,A)0$, with $B(\emptyset,t)=\emptyset$. \item A ball $B=B(x,R)$ is given with its centre and its radius, which need not be determined by the set~$B$; the notations $tB$, $\xi_\beta(B)$ and ``a ball of radius~$R$'' refer to them. \item The letters $c$ and $C$ denote positive constants whose value may change from line to line. Unless a dependence is indicated they are \emph{structural}: they depend only on $\lambda$, the constant $C_d$ of~\eqref{eq:doubling}, the constants $Q$ and $c_Q$ of~\eqref{eq:decay} when $Q$ occurs in the statement, and the constants of those among the hypotheses \hP, \hC, \hCp, \hPI{} and the hypotheses of Section~\ref{sec:onescale} which are assumed in the statement at hand; in Chapters~\ref{sec:ahlfors} to~\ref{sec:nocommon} they may also depend on the constants $c_A$, $C_A$ of~\eqref{eq:ahlfors} and on the constants of the cell structure. They depend neither on the functions, sets, points and scales involved. We write $A\asymp B$ if $cA\le B\le CA$. \item For $v\ge0$ we write $v^0=1$ if $v>0$ and $0^0=0$, so that $v^{1/q}=\ind_{\{v>0\}}$ when $Q=\lambda$. \end{itemize} \chapter{Comparison of scales and the critical exponent}\label{sec:wm} \begin{overview} Hypothesis~\hP{} compares the oscillation of a function on a ball of radius~$R$ with its energy at a smaller scale~$r$. We show that it implies a comparison between the energies themselves: $R^{-\lambda}J_R(f)\le C\,r^{-\lambda}J_r(f)$ for $r\le R$. Consequently the variation, which is a lower limit at small scales, controls the energies at all scales, a function of zero variation is constant, and, when~\hC{} holds as well, $\lambda$ is the critical exponent. We also show that~\hP{} makes the space connected in a quantitative sense, that at most one exponent satisfies both hypotheses, and that the sets of~\hC{} may be allowed to depend on the scale. In the last section we show that the two hypotheses are equivalent to their limits at small scales: a relative isoperimetric inequality, and a bound for the perimeter of the cutoff sets. \end{overview} \section{The main result} The critical exponents $\lambda_1^*$ and $\lambda_1^\#$ and the functionals $S_\beta$ and $\Var$ were defined in Section~\ref{sec:defs}. \begin{theorem}\label{th:metric} Assume~\hP. There is a constant $C$ such that the following holds for every $f\in L^1_{\mathrm{loc}}(X,m)$. \begin{enumerate}[label=\textup{(\roman*)}] \item\label{it:metric-scales} For all $0\lambda$, then $f$ is constant. \end{enumerate} If~\hC{} holds as well, then \begin{equation*} BV(X)=\Bes\lambda(X)\ \text{ is dense in }L^1(X,m)\qquad\text{and}\qquad\lambda_1^*=\lambda_1^\#=\lambda\,. \end{equation*} \end{theorem} Inequality~\eqref{eq:scales} would hold with $C=1$ if $r\mapsto r^{-\lambda}J_r(f)$ were non-increasing. The resulting bound $S_\lambda\le C\Var$ of a supremum over all scales by a lower limit at small scales is the property $\mathcal P(1,\lambda)$ of~\cite[Section~4.2]{Bau}, called there weak monotonicity. Inequality~\eqref{eq:poincare-ball} is a $(1,1)$-Poincar\'e inequality for $BV$ functions in which $R^\lambda$ replaces the factor $R$ of the classical inequality. \paragraph{How to read the theorem.} Part~\ref{it:metric-scales} controls the energy at a larger scale by the energy at a smaller one. For the indicator of the left half of the carpet and for the indicator of a cell of the gasket, the normalized energy $r^{-\lambda}J_r(f)$ is periodic in $\log r$ at small scales (Proposition~\ref{prop:carpetaverage} and Theorem~\ref{gask-exact}). Proposition~\ref{prop:phase} gives a nonconstant oscillation for the kernel $k_r$ on a snowflaked interval. Parts~\ref{it:metric-const} and the last assertion explain the word \emph{critical}. By~\ref{it:metric-const}, hypothesis~\hP{} alone shows that nothing but constants survives above the exponent~$\lambda$. Hypothesis~\hC{} provides, at the exponent~$\lambda$ itself, enough functions to approximate every integrable function: the indicators of the cutoff sets. \section{Comparison of scales}\label{sec:scales} \idea Let $r\le R$. The energy $J_R(f)$ is an integral over the pairs of points at distance less than~$R$. Cover the space by balls of radius~$2R$ centred at the points of an $R$-net. Every such pair lies in one of these balls, so $J_R(f)$ is bounded by the sum of the mean oscillations of~$f$ on these balls. Hypothesis~\hP{} bounds each mean oscillation by $(R/r)^\lambda$ times the energy at scale~$r$ on a dilated ball, and the dilated balls have bounded overlap. The statement is local: the energy at scale~$R$ on a set~$W$ is controlled by the energy at scale~$r$ on a neighbourhood of~$W$ of width comparable to~$R$. \begin{theorem}[Comparison of scales]\label{th:scales} Assume~\hP. There is a constant $C$ such that, for every $f\in L^1_{\mathrm{loc}}(X,m)$, all $00$, \begin{equation*} \frac{J_R\big(f;B(x_0,\rho)\big)}{R^{\lambda}}\le C\,\frac{J_r\big(f;B(x_0,\rho+3\Lambda R)\big)}{r^{\lambda}}\,,\qquad\text{and}\qquad\frac{J_R(f)}{R^{\lambda}}\le C\,\frac{J_r(f)}{r^{\lambda}}\,. \end{equation*} \end{theorem} \begin{proof} Let $W'=B(W,3\Lambda R)$, let $\Xi$ be an $R$-net, and let $\Xi_W=\{z\in\Xi:\ B(z,R)\cap W\ne\emptyset\}$. \emph{Step 1: covering of the pairs.} If $x,y\in W$ and $d(x,y)0$ and a point~$x$, and let $A$ be the set of the points which can be reached from~$x$ by a chain of points with steps smaller than~$\varepsilon$. No pair of points at distance less than~$\varepsilon$ is separated by~$A$, so the energy of $\ind_A$ at every scale $h<\varepsilon$ vanishes, and~\hP{} forces $\ind_A$ to be constant. Hence every point can be reached from~$x$ by chains with arbitrarily small steps, and a limiting argument turns these chains into a connected set. \begin{lemma}\label{lem:continua} Assume~\hP. \begin{enumerate}[label=\textup{(\roman*)}] \item\label{it:continua} Any two points of a ball $B$ of radius at most $4D$ are contained in a compact connected subset of~$\overline{\Lambda B}$. \item\label{it:connected} The space $X$ is connected and has no isolated point, and for every $x\in X$ and $0<\rho0$, and let $A$ be the set of the points $z\in\Lambda B$ for which there is a finite sequence $x=z_0,z_1,\dots,z_n=z$ in $\Lambda B$ with $d(z_{i-1},z_i)<\varepsilon$. A point of $\Lambda B$ at distance less than $\varepsilon$ from $A$ belongs to~$A$. Hence $J_h(\ind_A;\Lambda B)=0$ for $00$ from each other, then for large~$j$ the set $P_j$ would be contained in the union of their $\varepsilon'$-neighbourhoods and would meet both, which is impossible when $1/j<\varepsilon'$. Hence $P$ is connected. \ref{it:connected} Two points $x,y\in X$ belong to the ball $B(x,2d(x,y))$, whose radius is at most~$4D$, hence to a connected subset of~$X$ by~\ref{it:continua}. Thus $X$ is connected, and it has no isolated point because it has at least two points. The continuous function $d(x,\cdot)$ maps $X$ onto an interval which contains~$0$ and whose supremum is at least $D/2$. \ref{it:reverse} By~\ref{it:connected} there is $z\in X$ with $d(x,z)=\frac34r$. Then $B(z,r/4)\subset B(x,r)\setminus B(x,r/2)$ and $B(x,r)\subset B(z,2r)$, so that $m(B(x,r))-m(B(x,r/2))\ge m(B(z,r/4))\ge C_d^{-3}\,m(B(x,r))$ by~\eqref{eq:doubling}. Iterating~\eqref{eq:reverse} we get $m(\{x\})\le\lim_jm(B(x,2^{-j}r))=0$. \end{proof} \section{Density and the uniqueness of the exponent} We now use hypothesis~\hC. A finite union of cutoff sets has finite $S_\lambda$ seminorm by the subadditivity~\eqref{eq:Junion}, and such unions approximate every set of finite measure from outside. \begin{proposition}\label{prop:dense} Assume~\hC. Then $\Bes\lambda(X)$ is dense in $L^1(X,m)$. \end{proposition} \begin{proof} By Lemma~\ref{lem:Jbasic}\ref{it:Jsub}, $\Bes\lambda(X)$ is a linear subspace. Since the simple functions $\sum_j\gamma_j\ind_{E_j}$ with $m(E_j)<\infty$ are dense in $L^1(X,m)$, it suffices to approximate $\ind_E$ for a measurable set $E$ of finite measure. Let $\varepsilon>0$. Since $m$ is a Radon measure, there are a compact set $K$ and an open set $O$ with \begin{equation*} K\subset E\subset O\,,\qquad m(O\setminus K)<\varepsilon\,. \end{equation*} For each $x\in K$ choose $R_x\in(0,D]$ with $B(x,MR_x)\subset O$. Finitely many balls $B_i=B(x_i,R_{x_i})$ cover~$K$. Let $G_i$ be a set given by~\hC{} for the ball $B_i$, and let $G=\bigcup_iG_i$. Then $K\subset G\subset O$ modulo null sets, hence, by~\eqref{eq:Junion} and~\eqref{eq:C}, \begin{equation*} \|\ind_G-\ind_E\|_{L^1(X)}\le m(O\setminus K)<\varepsilon\,,\qquad S_\lambda(\ind_G)\le\sum_iS_\lambda(\ind_{G_i})\le C_C\sum_i\xi_\lambda(B_i)<\infty\,.\qedhere \end{equation*} \end{proof} The next proposition is the precise form of Figure~\ref{fig:ranges}. Its last part is a short argument which is worth remembering: if a cutoff set had energy $o(r^{\lambda_P})$, its indicator would be constant by the rigidity statement of Corollary~\ref{cor:wm}, which is impossible because the set contains a ball and misses another one. \begin{proposition}\label{prop:unique} \begin{enumerate}[label=\textup{(\roman*)}] \item\label{it:Pup} If~\hP{} holds for the exponent $\lambda$, it holds for every exponent $\lambda'\ge\lambda$. \item\label{it:Cdown} If~\hC{} holds for the exponent $\lambda$, it holds for every exponent $\lambda'\in(0,\lambda]$. \item\label{it:PC} If~\hP{} holds for the exponent $\lambda_P$ and~\hC{} holds for the exponent $\lambda_C$, then $\lambda_C\le\lambda_P$. \end{enumerate} In particular, at most one exponent satisfies both hypotheses. \end{proposition} \begin{proof} \ref{it:Pup} holds because $R/h\ge1$ in~\eqref{eq:P}. \ref{it:Cdown} Let $G$ be given by~\hC{} for $B=B(x,R)$ and $\lambda$, and let $0R$, \begin{equation*} J_r(\ind_G)\le \begin{cases} C_C\,m(B)\,(r/R)^{\lambda}\le C_C\,m(B)\,(r/R)^{\lambda'}&\text{if }r\le R\,,\\[2pt] 4\,m(G)\le4\,C_d\,M^{Q_d}\,m(B)\le4\,C_d\,M^{Q_d}\,m(B)\,(r/R)^{\lambda'}&\text{if }r>R\,. \end{cases} \end{equation*} \ref{it:PC} Suppose that $\lambda_C>\lambda_P$. Choose points $x,y\in X$ and $R\in(0,D]$ with $MR\le d(x,y)/2$, and let $G$ be given by~\hC{} for $B(x,R)$ and $\lambda_C$. Then $J_r(\ind_G)=O(r^{\lambda_C})=o(r^{\lambda_P})$, and Corollary~\ref{cor:wm}\ref{it:rigidity} for the exponent $\lambda_P$ shows that $\ind_G$ is constant. This is impossible, because $G$ contains $B(x,R)$ and is disjoint from $B(y,d(x,y)/2)$ modulo null sets, and both balls have positive measure. \end{proof} \begin{proof}[Proof of Theorem~\ref{th:metric}] Part~\ref{it:metric-scales} is Theorem~\ref{th:scales} and Corollary~\ref{cor:wm}\ref{it:wmspatial}, and parts~\ref{it:metric-poincare} and~\ref{it:metric-const} are Corollary~\ref{cor:wm}\ref{it:wmpoincare} and~\ref{it:rigidity}; note that $J_r(f)=O(r^\beta)$ with $\beta>\lambda$ implies $\Var(f)=0$. Assume now~\hP{} and~\hC. Then $BV(X)=\Bes\lambda(X)$ by~\eqref{eq:BVBesov}, and this space is dense in $L^1(X,m)$ by Proposition~\ref{prop:dense}. It remains to compute the critical exponents. \emph{The classes decrease.} Let $f\in L^1(X,m)$ and $0<\beta'<\beta$. By Lemma~\ref{lem:Jbasic}\ref{it:JL1}, for $0\lambda$.} If $f\in\Bes\beta(X)$, then $J_r(f)\le S_\beta(f)\,r^\beta=o(r^\lambda)$, and $f$ is constant by Corollary~\ref{cor:wm}\ref{it:rigidity}. Therefore $\lambda_1^*=\lambda_1^\#=\lambda$. \end{proof} \section{Compactness and cutoffs at a single scale}\label{sec:cap-compact} Theorem~\ref{th:scales} also applies to a sequence of functions whose energies are bounded at a single scale which depends on the function. This gives a compactness statement in the spirit of the Rellich--Kondrachov theorem; it has a counterpart for Korevaar--Schoen energies on Cheeger spaces in~\cite[Theorem~5.3]{KScompact}. We use it to show that, in hypothesis~\hC, the cutoff set may be allowed to depend on the scale, which is convenient when the sets are constructed by an approximation procedure. \begin{proposition}[Compactness]\label{prop:cap-compact} Assume \hP{}. Let $K\subset X$ be bounded, let $h_j\downarrow0$, and let $f_j\in L^1(X,m)$ vanish almost everywhere off $K$. If \begin{equation*} \sup_j\bigl(\|f_j\|_1+h_j^{-\lambda}J_{h_j}(f_j)\bigr)<\infty, \end{equation*} then $(f_j)$ is relatively compact in $L^1(X,m)$. For every $L^1$-convergent subsequence $f_{j_k}\to f$, \begin{equation*} S_\lambda(f)\le C\liminf_{k\to\infty} h_{j_k}^{-\lambda}J_{h_{j_k}}(f_{j_k}). \end{equation*} \end{proposition} \idea A function whose energy at scale~$2\delta$ is small is close in $L^1$ to its averages over the cells of a partition of size~$\delta$. By the comparison of scales, the energy of $f_j$ at the fixed scale~$2\delta$ is at most $C\,\delta^\lambda$ as soon as $h_j\le2\delta$. Hence the sequence is, up to an error $C\,\delta^\lambda$, contained in a bounded subset of a finite-dimensional space. \begin{proof} Let $A=\sup_j\big(\|f_j\|_1+h_j^{-\lambda}J_{h_j}(f_j)\big)$. \emph{Step 1: averages over a Voronoi partition.} Let $0<2\delta\le D$, let $\Xi$ be a $\delta$-net with a Voronoi partition $(V_z)_{z\in\Xi}$ as in Lemma~\ref{lem:nets}, and for $g\in L^1(X,m)$ let $P_\delta g$ be the function which equals the mean $g_{V_z}$ on each cell~$V_z$. We claim that \begin{equation}\label{eq:cap-averages} \|g-P_\delta g\|_1 \le\sum_{z\in\Xi}\frac1{m(V_z)}\iint_{V_z\times V_z}|g(x)-g(y)|\,dm(x)\,dm(y) \le C_d^{\,4}\,J_{2\delta}(g)\,. \end{equation} The first inequality holds because $|g(x)-g_{V_z}|\le m(V_z)^{-1}\int_{V_z}|g(x)-g(y)|\,dm(y)$ for $x\in V_z$. For the second one, let $x,y\in V_z$. Then $d(x,y)<2\delta$, and by~\eqref{eq:voronoi} and~\eqref{eq:doubling} \begin{equation*} m(B(x,2\delta))\le m(B(z,4\delta))\le C_d^{\,3}\,m(B(z,\delta/2))\le C_d^{\,3}\,m(V_z)\,. \end{equation*} By~\eqref{eq:kernel}, $k_{2\delta}(x,y)\ge C_d^{-1}\,m(B(x,2\delta))^{-1}\ge C_d^{-4}\,m(V_z)^{-1}$. Since the sets $V_z\times V_z$ are pairwise disjoint, \eqref{eq:cap-averages} follows. \emph{Step 2: total boundedness.} Fix $\delta$ with $0<2\delta\le D$. For every~$j$ with $h_j\le2\delta$, Theorem~\ref{th:scales} with $r=h_j$ and $R=2\delta$ and~\eqref{eq:cap-averages} give \begin{equation*} \|f_j-P_\delta f_j\|_1\le C_d^{\,4}\,J_{2\delta}(f_j)\le C\,(2\delta)^{\lambda}\,h_j^{-\lambda}J_{h_j}(f_j)\le C\,A\,\delta^\lambda\,. \end{equation*} The function $P_\delta f_j$ vanishes on the cells which do not meet~$K$, because $f_j$ vanishes almost everywhere off~$K$; only finitely many cells meet~$K$, by Lemma~\ref{lem:nets}\ref{it:packing}, since $K$ is bounded; and $\|P_\delta f_j\|_1\le\|f_j\|_1\le A$. Hence the functions $P_\delta f_j$ lie in a bounded subset of a finite-dimensional subspace of $L^1(X,m)$, which is totally bounded. Given $\varepsilon>0$, choose $\delta$ with $C\,A\,\delta^\lambda<\varepsilon$. All the functions $f_j$ with $h_j\le2\delta$, that is, all but finitely many, lie within distance~$\varepsilon$ of a totally bounded set. Therefore $(f_j)$ is totally bounded, hence relatively compact, in the complete space $L^1(X,m)$. \emph{Step 3: the limit.} Let $f_{j_k}\to f$ in $L^1(X,m)$ and fix $01$ and $A<\infty$ such that, for every ball $B=B(x,R)$ with $0t\}}-\ind_{\{b>t\}}|\,dt$, and Tonelli's theorem gives \begin{equation*} J_h(u)=\int_0^1J_h(\ind_{\{u>t\}})\,dt\,. \end{equation*} Every set $\{u>t\}$ with $01$ such that, for every $x\in X$ and $01$. In~\cite{BPY}, a two-scale inequality of the type of~\hP, called there a macroscopic Poincar\'e inequality, is derived from a Poincar\'e inequality for the energy measures and an upper bound for the capacity between concentric balls. Here~\hI{} plays the role of the Poincar\'e inequality and~\hII{} that of the capacity bound. In doubling spaces which support a Poincar\'e inequality for upper gradients, macroscopic Poincar\'e inequalities were introduced by Hyt\"onen and Korte~\cite{HyKo}; see Section~\ref{sec:PI} for the case $\lambda=1$. \idea The first assertion implies the other two by letting the small scale tend to zero. To pass from~\ref{it:os-lower} to~\ref{it:os-upper}, we cover the pairs of points at distance less than~$R$ by the balls of a net, as in the proof of Theorem~\ref{th:scales}, and apply~\hIl{} in each of these balls. A sum of lower limits is at most the lower limit of the sum, and this bounds the energy of a set at every scale by its perimeter (Lemma~\ref{lem:netfatou}); the cutoff sets of~\hIIl{} then satisfy~\hC. The main step is the passage from~\ref{it:os-upper} to~\hP. Given a function~$f$ and a scale~$h$, we replace~$f$ by a function~$f_\delta$ which is constant on the pieces of a partition of~$X$ into sets of size $\delta\asymp h$, obtained from cutoff sets (Lemma~\ref{lem:atoms}); on the carpet, such pieces are the rectangles of Definition~\ref{def:rect}. A superlevel set of~$f_\delta$ is a union of pieces, and its upper perimeter is at most the total cost of the pieces which have a neighbour outside the set. This is where upper limits are needed: the upper limit of a finite sum is at most the sum of the upper limits. Integrated over the levels, these costs add up to at most $C\,h^{-\lambda}J_h(f)$, and~\hI, applied to each superlevel set, gives the Poincar\'e inequality for~$f_\delta$. The argument is the one which proves that~\hPI{} implies~\hP{} for $\lambda=1$ (Proposition~\ref{prop:PI}), with the pieces of the partition in place of a Lipschitz partition of unity. \begin{lemma}[From the perimeter to all scales]\label{lem:netfatou} Assume~\hIl. There is a constant $C$ such that, for all measurable sets $E,W\subset X$ and every $0b\})\le\frac12m(B)$ and $m(\{x\in B:\ g(x)u\}\big)\,du\,. \end{equation} \end{lemma} \begin{proof} By Tonelli's theorem, $\int_B(g-b)_+\,dm=\int_b^\infty m(B\cap\{g>u\})\,du$ and $\int_B(b-g)_+\,dm=\int_{-\infty}^bm(B\setminus\{g>u\})\,du$. If $u>b$, then $m(B\cap\{g>u\})\le m(B\cap\{g>b\})\le\frac12m(B)$. If $uu\})\le m(B\cap\{gu\})$. \end{proof} \begin{proof}[Proof of Theorem~\ref{th:onescale}] \emph{\ref{it:os-PC} implies~\ref{it:os-upper} and~\ref{it:os-lower}.} Let $B$ be a ball of radius $R\le4D$ and $E\subset X$ a measurable set. By~\eqref{eq:indicator2} and~\hP{} for $f=\ind_E$, \begin{equation*} v_B(E)\le C_P\,\Big(\frac Rh\Big)^{\lambda}J_h(\ind_E;\Lambda B)\qquad\text{for }0u\}$, so that $\{f_\delta>u\}=E_{S_u}$ in the notation of Lemma~\ref{lem:atoms}. Let $W=\Lambda_IB$, and let $K$ be the finite set of the indices~$k$ such that $A_k$ meets~$W$. An index $k\in K$ belongs to $\partial_WS_u$ if and only if $a_k>u$ and $a_l\le u$ for some $l\sim k$. The levels~$u$ with this property form an interval of length at most $\sum_{l\sim k}|a_k-a_l|$. By~\eqref{eq:atom-union}, \begin{equation}\label{eq:os-levels} \Per^+\big(\{f_\delta>u\};W\big)\le C\,N(u)\,,\qquad\text{where}\quad N(u)=\sum_{k\in K}\xi_\lambda\big(B(z_k,\delta)\big)\,\ind_{\partial_WS_u}(k)\,, \end{equation} and $N$ is a step function with \begin{equation}\label{eq:os-steps} \int_{\R}N(u)\,du\le\frac1{\delta^{\lambda}}\sum_{k\in K}\ \sum_{l\sim k}m(B(z_k,\delta))\,|a_k-a_l|\,. \end{equation} Let $k\sim l$. If $a\in B(z_k,\delta)$ and $a'\in B(z_l,\delta)$, then $d(a,a')<(2M+3)\delta=h$ and $B(a,h)\subset B(z_l,(4M+5)\delta)$, so that $m(B(z_l,\delta))^{-1}\le C\,k_h(a,a')$, as in Step~1. Therefore \begin{align*} m(B(z_k,\delta))\,|a_k-a_l|&\le\frac{1}{m(B(z_l,\delta))}\iint_{B(z_k,\delta)\times B(z_l,\delta)}|f(a)-f(a')|\,dm(a)\,dm(a')\\ &\le C\,\mu_h^f\big(B(z_k,\delta)\times B(z_l,\delta)\big)\,, \end{align*} where $\mu_h^f$ is the measure with the density $|f(a)-f(a')|$ with respect to~$\mu_h$. If $k\in K$ and $l\sim k$, the balls $B(z_k,\delta)$ and $B(z_l,\delta)$ are contained in $B(W,(3M+2)\delta)$, hence in $(\Lambda_I+2)B$, because $(3M+2)\delta<2h\le2R$. Each point of $X\times X$ belongs to at most $\kappa(1)^2$ of the products $B(z_k,\delta)\times B(z_l,\delta)$. Summing over $k\in K$ and $l\sim k$ we obtain from~\eqref{eq:os-steps} \begin{equation}\label{eq:os-coarea} \int_{\R}N(u)\,du\le\frac{C}{h^{\lambda}}\,J_h\big(f;(\Lambda_I+2)B\big)\,. \end{equation} \emph{Step 3: the Poincar\'e inequality for $f_\delta$.} Let $b$ be a median of $f_\delta$ on~$B$. By Lemma~\ref{lem:median}, by~\hI{} for the sets $\{f_\delta>u\}$, and by~\eqref{eq:os-levels} and~\eqref{eq:os-coarea}, \begin{equation*} \int_B|f_\delta-b|\,dm=\int_{\R}v_B\big(\{f_\delta>u\}\big)\,du\le C_I\,R^\lambda\int_{\R}C\,N(u)\,du\le C\,\Big(\frac Rh\Big)^{\lambda}J_h\big(f;(\Lambda_I+2)B\big)\,. \end{equation*} Only the bound~\eqref{eq:os-levels} by the step function~$N$ is integrated here: no upper limit is exchanged with the integral over the levels. \emph{Step 4: conclusion.} By~\eqref{eq:mean}, \eqref{eq:os-approx} and Step~3, \begin{equation*} \int_B|f-f_B|\,dm\le2\int_B|f-f_\delta|\,dm+2\int_B|f_\delta-b|\,dm\le C\,\Big(\frac Rh\Big)^{\lambda}J_h\big(f;(\Lambda_I+2)B\big)\,, \end{equation*} because $R/h\ge1$. This is~\hP{} with $\Lambda=\Lambda_I+2$. \emph{\ref{it:os-upper} implies~\hC.} We have proved~\hP. Let $G$ be a set given by~\hII{} for the ball $B(x,R)$. By Corollary~\ref{cor:wm}\ref{it:wmspatial} for the function~$\ind_G$, \begin{equation*} S_\lambda(\ind_G)\le C\Per(G)\le C\Per^+(G)\le C\,C_{II}\,\frac{m(B(x,R))}{R^{\lambda}}\,, \end{equation*} which is~\eqref{eq:C}. \end{proof} \begin{remark}[Other limits]\label{rem:os-limits} Let $r_n\downarrow0$. Theorem~\ref{th:onescale} remains true if the lower limits which define the perimeters in~\hIl{} and in~\hIIl{} are both taken along the sequence~$(r_n)$, and also if the upper limits in~\hI{} and in~\hII{} are both taken along~$(r_n)$. The proofs of Lemma~\ref{lem:netfatou}, of Lemma~\ref{lem:atoms} and of the theorem apply without change, because all these limits lie between $\Per$ and~$\Per^+$. In each of these statements, the quantity which is bounded for the cutoff sets is at least the quantity which appears in the isoperimetric inequality. This order cannot be reversed, by Proposition~\ref{prop:mixed}\ref{it:mixed-pair}. \end{remark} \begin{remark}[Sets, functions, and hypothesis~\hIl{} alone]\label{rem:os-functions} Lemma~\ref{lem:median} and the identity $J_h(f;W)=\int_{\R}J_h(\ind_{\{f>u\}};W)\,du$, which is~\eqref{eq:layer} below, show that~\hP{} holds for all functions as soon as it holds for indicators, with $2C_P$ in place of~$C_P$. In the same way, the first inequality of Proposition~\ref{prop:coarea}, which requires no hypothesis, shows that~\hIl{} implies \begin{equation*} \int_B|f-f_B|\,dm\le2\,C_I\,R^\lambda\,\Var(f;\Lambda_IB) \end{equation*} for every ball $B$ of radius $R\le4D$ and every $f\in L^1_{\mathrm{loc}}(X,m)$. This is the inequality~\eqref{eq:poincare-ball} of Theorem~\ref{th:metric}. Repeating the proof of Lemma~\ref{lem:netfatou} with this inequality we obtain, under~\hIl{} alone, \begin{equation*} \frac{J_R(f;W)}{R^{\lambda}}\le C\,\Var\big(f;B(W,3\Lambda_IR)\big)\qquad\text{for every measurable }W\subset X\text{ and }01$ this ball is~$X$. By~\eqref{eq:phislopes}, $\phi^{-1}(2h)\le16\,\phi^{-1}(h)$ if $2h\le1$, and $\phi^{-1}(h)\ge\frac1{16}$ if $h\le1<2h$. Hence $m$ is doubling for~$d$, with the constant~$32$. \emph{Step 2: the energies.} Let $J^{\mathrm e}_t$ denote the energies of the space $X$ with the Euclidean distance and the measure~$m$. For $00$. \item\label{E3} If $E=[0,\frac12)$, then $J^{\mathrm e}_t(\ind_E)=t/2$ for $0\frac12$, hence $2B=X$, if $2T>1$. \emph{Step 4: proof of~\ref{it:mixed-pair}.} Here $a=-\frac12\varrho\le0$, with $a(n^2)=0$ and $a(n^2+n+\frac12)=-\frac14(2n+1)$. Let $t_n=e^{-n^2}$ and $t'_n=e^{-(n^2+n+1/2)}$, and let $h_n=\phi(t_n)$ and $h'_n=\phi(t'_n)$. \emph{Hypothesis~\hI{} holds.} Let $B$ and $T$ be as in Step~3, and let $E\subset X$ be measurable. Since $a\le0$, we have $T=\phi(T)^2\,e^{a(\log(1/T))}\le\phi(T)^2\le R^2$. For the indices~$n$ with $t_n\le T$, \ref{E1}, \eqref{eq:mixed-energy} with $a(n^2)=0$, and~\eqref{eq:mixed-balls} give \begin{equation*} v_B(E)\le C_{\mathrm e}\,T\,\frac{J^{\mathrm e}_{t_n}\big(\ind_E;B^{\mathrm e}(x,2T)\big)}{t_n}=C_{\mathrm e}\,T\,\frac{J_{h_n}\big(\ind_E;B^{\mathrm e}(x,2T)\big)}{h_n^2}\le C_{\mathrm e}\,R^2\,\frac{J_{h_n}(\ind_E;2B)}{h_n^2}\,. \end{equation*} Letting $n\to\infty$ we get $v_B(E)\le C_{\mathrm e}\,R^2\,\Per^+(E;2B)$, which is~\hI{} with $C_I=C_{\mathrm e}$ and $\Lambda_I=2$. \emph{Hypothesis~\hIIl{} holds, and~\hP{} fails.} Let $G\subset X$ be an interval. By~\eqref{eq:mixed-energy} and~\ref{E2}, \begin{equation*} \Per(G)\le\liminf_{n\to\infty}\frac{J_{h'_n}(\ind_G)}{(h'_n)^2}\le\liminf_{n\to\infty}8\,e^{-(2n+1)/4}=0\,. \end{equation*} Since the balls of $(X,d)$ are intervals, \hIIl{} holds with $G=B(x,R)$, for every $M>1$ and every $C_{II}>0$. On the other hand, the indicator of $E=[0,\frac12)$ is not constant and satisfies $\Var(\ind_E)=\Per(E)=0$. By Corollary~\ref{cor:wm}\ref{it:rigidity}, \hP{} fails. \emph{Step 5: proof of~\ref{it:mixed-alone}.} Here $a(s)=\frac18s-\frac38\varrho(s)$. Since $\varrho(s)\le\sqrt s+\frac12$, we have $a(s)\to\infty$ as $s\to\infty$, and \begin{equation}\label{eq:mixed-drops} a(n^2)-a\big(n^2+n+\tfrac12\big)=\frac{2n+1}8\qquad\text{for every }n\in\N\,. \end{equation} \emph{Hypothesis~\hIl{} holds.} Let $B$ and $T$ be as in Step~3, and let $E\subset X$ be measurable with $v_B(E)>0$. For $00$, and~\hIl{} holds with $\Lambda_I=2$ and any constant~$C_I$. \emph{Hypothesis~\hP{} fails.} Suppose that~\hP{} holds, with constants $C_P$ and~$\Lambda$. Let $E=[0,\frac12)$ and $0u\}\big)^{1/q}\,du\,, \end{equation*} with the convention that $v^{1/\infty}=v^0$ equals $1$ if $v>0$ and $0$ if $v=0$. For $q<\infty$ this is a norm of the Lorentz space $L^{q,1}(W)$, and for $q=\infty$ it is the norm of $L^\infty(W)$; see Section~\ref{sec:sobolev}. As in Section~\ref{sec:onescale}, a \emph{median} of $g$ on $W$ is a number $b$ with \begin{equation*} m(\{x\in W:\ g(x)>b\})\le\tfrac12m(W)\qquad\text{and}\qquad m(\{x\in W:\ g(x)0$ such that $m(B(x,r))\ge c_0\,r^Q$ for all $x\in X$ and $r>0$, then, for $m(E)<\infty$ and $f\in L^1(X,m)$, with a constant $C_0$ which depends also on~$c_0$, \begin{equation*} m(E)^{1-\frac\lambda Q}\le C_0\Per(E)\,,\qquad \|f\|_{L^{q,1}(X)}\le C_0\Var(f)\,. \end{equation*} Conversely, if $D=\infty$, \hC{} holds, and $m(E)^{1-\frac\lambda Q}\le C_0\Per(E)$ for every measurable set $E$ of finite measure, then $m(B(x,r))\ge c_0\,r^Q$ for all $x\in X$ and $r>0$, with $c_0=(C_0C_C)^{-Q/\lambda}$. \end{enumerate} \end{theorem} The inequalities of~\ref{it:isop-local} are invariant under changes of scale; the factor $R^\lambda/m(B)$ replaces the factor $R/m(B)$ of the classical inequalities, and it cannot be improved (Remark~\ref{rem:sharp}). Part~\ref{it:isop-bounded} is the case $B=B(x,2D)=X$ of part~\ref{it:isop-local}. The unnormalized inequalities of part~\ref{it:isop-global} require a lower bound for the measure of all balls, which holds in Ahlfors regular spaces; without it, part~\ref{it:isop-local} for large balls and Theorem~\ref{th:relisop}\ref{it:isop-volume} are the substitutes. When $Q=\lambda$ the theorem states that \begin{equation*} v_B(E)>0\ \Longrightarrow\ \Per(E;B')\ge\frac{m(B)}{C\,R^\lambda}\,,\qquad\|f-b\|_{L^\infty(B)}\le C\,\frac{R^{\lambda}}{m(B)}\Var(f;B')\,. \end{equation*} The chapter also contains the coarea inequality (Proposition~\ref{prop:coarea}) and the Gagliardo--Nirenberg and Nash inequalities which follow from Theorem~\ref{th:isop} (Corollary~\ref{cor:gn}). \paragraph{Where the exponent comes from.} The exponent $1-\frac\lambda Q$ can be guessed from the sets of hypothesis~\hC. A cutoff set $G$ for a ball of radius~$t$ has measure about $m(B(x,t))$ and perimeter about $m(B(x,t))\,t^{-\lambda}$. If the measure of a ball of radius~$t\le R$ inside a ball~$B$ of radius~$R$ is of order $m(B)\,(t/R)^Q$, as for an Ahlfors regular measure, eliminating~$t$ gives \begin{equation*} \Per(G)\approx\frac{m(B)}{R^\lambda}\,\Big(\frac{m(G)}{m(B)}\Big)^{1-\frac\lambda Q}\,. \end{equation*} The isoperimetric inequality states that no set of the same measure has a smaller perimeter, up to a constant. In a doubling space only the lower bound~\eqref{eq:decay} for the measure of small balls is available, and it is exactly what the proof uses. \paragraph{Plan.} Section~\ref{sec:coarea} proves the coarea inequality, which reduces statements about functions to statements about their level sets. Section~\ref{sec:relisop} proves the relative isoperimetric inequality by a covering argument. Section~\ref{sec:sobolev} integrates the isoperimetric inequality over the level sets and obtains the Sobolev inequality. Sections~\ref{sec:gn} and~\ref{sec:sharp} contain the consequences and the discussion of sharpness. \section{The coarea inequality}\label{sec:coarea} Two real numbers $a,b$ satisfy $|a-b|=\int_\R|\ind_{\{a>u\}}-\ind_{\{b>u\}}|\,du$. Hence the energy of a function is \emph{exactly} the integral of the energies of its superlevel sets $E_u=\{f>u\}$: \begin{equation*} J_r(f;W)=\int_\R J_r(\ind_{E_u};W)\,du\qquad\text{for every }r>0\,. \end{equation*} We divide by $r^\lambda$ and let $r\downarrow0$. Fatou's lemma gives one inequality between the integral of the perimeters $\Per(E_u;W)$ and the variation $\Var(f;W)$, without any hypothesis. The other inequality requires to bound a lower limit of integrals by the integral of the lower limits, which is false in general. Here the comparison of scales helps: under~\hP{} the normalized energy of each level set at a fixed scale~$R$ is bounded by its perimeter, and this bound can be integrated. \begin{proposition}[Coarea]\label{prop:coarea} Let $W\subset X$ be measurable, $f\in L^1(W,m)$ and $E_u=\{x\in W:\ f(x)>u\}$ for $u\in\R$. Then $u\mapsto\Per(E_u;W)$ is measurable and \begin{equation*} \int_{\R}\Per(E_u;W)\,du\le\Var(f;W)\,. \end{equation*} Assume~\hP. Then \begin{align*} \Var(f)&\le C\int_{\R}\Per(E_u)\,du&&\text{if }W=X\,,\\ \Var\big(f;B(x_0,\rho)\big)&\le C\int_{\R}\Per(E_u;W)\,du&&\text{if }W=B(x_0,\rho')\text{ and }0<\rho<\rho'\,. \end{align*} \end{proposition} \begin{proof} For $a,b\in\R$ we have $|a-b|=\int_{\R}|\ind_{\{a>u\}}-\ind_{\{b>u\}}|\,du$. By Tonelli's theorem, for every $r>0$ and every measurable $W'\subset W$, the function $u\mapsto J_r(\ind_{E_u};W')$ is measurable and \begin{equation}\label{eq:layer} J_r(f;W')=\int_{\R}J_r(\ind_{E_u};W')\,du\,. \end{equation} By Lemma~\ref{lem:Jbasic}\ref{it:Jcont}, $\Per(E_u;W)$ is the lower limit of $r^{-\lambda}J_r(\ind_{E_u};W)$ along the rational numbers $r\downarrow0$; this proves the measurability. Let $r_i\downarrow0$ be a sequence with $r_i^{-\lambda}J_{r_i}(f;W)\to\Var(f;W)$. Fatou's lemma and~\eqref{eq:layer} give \begin{equation*} \int_{\R}\Per(E_u;W)\,du\le\int_{\R}\liminf_{i\to\infty}\frac{J_{r_i}(\ind_{E_u};W)}{r_i^{\lambda}}\,du\le\liminf_{i\to\infty}\frac{J_{r_i}(f;W)}{r_i^{\lambda}}=\Var(f;W)\,. \end{equation*} For the converse, let first $W=X$. By Corollary~\ref{cor:wm}\ref{it:wmspatial}, applied to $\ind_{E_u}\in L^1_{\mathrm{loc}}(X,m)$, we have $R^{-\lambda}J_R(\ind_{E_u})\le C\Per(E_u)$ for every $R\in(0,D]$. Integrating in $u$ and using~\eqref{eq:layer} we get $R^{-\lambda}J_R(f)\le C\int_{\R}\Per(E_u)\,du$, and we let $R\downarrow0$. Let now $W=B(x_0,\rho')$ and $\rho<\rho'$. For $0u\})\,du<\Var(f)$. On the compact Sierpi\'nski gasket exact coarea holds for every $f\in BV(X)$ by Theorem~\ref{th:gasket}. \section{The relative isoperimetric inequality}\label{sec:relisop} \idea Let $E$ divide a ball~$B$ of radius~$R$ into two parts, and suppose that $B\cap E$ is the smaller one. At a point of density of $B\cap E$, the set $E$ fills almost all of the very small balls, whereas at the scale~$R$ it fills at most a fixed proportion. Hence there is an intermediate radius~$t_y$ at which both $E$ and its complement fill a fixed proportion of the ball $B(y,t_y)$. By~\hP{} this ball carries a perimeter at least $c\,m(B(y,t_y))\,t_y^{-\lambda}$. The covering lemma selects disjoint balls of this kind which, after dilation, cover $B\cap E$. This is the first assertion of the theorem, a \emph{boxing inequality}. The isoperimetric inequality follows by comparing $m(B(y,t))\,t^{-\lambda}$ with a power of $m(B(y,t))$ by means of~\eqref{eq:decay}. \begin{theorem}[Relative isoperimetric inequality]\label{th:relisop} Assume~\hP. There are constants $c>0$ and $C$ such that the following holds for every measurable set $E\subset X$. \begin{enumerate}[label=\textup{(\roman*)}] \item\label{it:isop-ball} Let $B$ be a ball of radius $R\le2D$ with $v_B(E)>0$, and let $B'=(1+2\Lambda)B$. There are countably many balls $B_i=B(y_i,t_i)$ with $y_i\in B$ and $00$, then \begin{equation*} m(E)^{1/q}\le C\,c_0^{-\lambda/Q}\Per(E)\,. \end{equation*} \end{enumerate} \end{theorem} The inequalities~\eqref{eq:boxing} are a boxing inequality in codimension~$\lambda$: most of the smaller of the sets $B\cap E$ and $B\setminus E$ is covered by balls $5\Lambda B_i$ whose cost $\sum_i\xi_\lambda(B_i)$ is controlled by the perimeter. The proof is the covering argument of the boxing inequality of Kinnunen, Korte, Shanmugalingam and Tuominen~\cite[Theorem~3.1]{KKST}, which is the case $\lambda=1$ (Figure~\ref{fig:boxing}): around almost every point $y$ of the smaller of the two sets there is a ball $B(y,t_y)$ in which both $E$ and $X\setminus E$ fill a fixed proportion, and~\hP{} bounds the perimeter of $E$ in the ball $B(y,\Lambda t_y)$ from below by $c\,\xi_\lambda(B(y,t_y))$. Part~\ref{it:isop-volume} is a global inequality in terms of the smallest measure of a ball of a given radius; no relation between the measures of balls of different radii is used in it. \begin{figure}[t] \centering \begin{tikzpicture}[scale=.85] \draw[dashed,line width=.5pt] (0,0) circle (3.5); \draw[line width=.8pt] (0,0) circle (2.5); \draw[cellgray,line width=9mm,line cap=round] (-1.7,-0.7) .. controls (-0.6,0.7) and (0.6,-0.7) .. (1.7,0.6); \foreach \x/\y in {-1.367/-0.3585, 0/-0.0125, 1.367/0.2855}{ \draw[cutred,line width=.7pt] (\x,\y) circle (0.69); \fill[cutred] (\x,\y) circle (1.1pt);} \node at (0.27,-0.3) {\small $E$}; \node at (1.45,-1.65) {\small $B$}; \node at (3.45,-2.85) {\small $(1+2\Lambda)B$}; \draw[line width=.3pt] (1.8,0.82) -- (4.0,1.7); \node[right] at (3.95,1.7) {\small $B(y_i,t_i)$}; \end{tikzpicture} \caption{The proof of Theorem~\ref{th:relisop}\ref{it:isop-ball} when $v_B(E)=m(B\cap E)$; the set $E$ is in grey. Each point $y$ of density of $B\cap E$ is the centre of a ball $B(y,t_y)$ in which $E$ and $X\setminus E$ both have relative measure at least~$\theta$. The covering lemma selects balls $B_i=B(y_i,t_i)$, in red, such that the balls $\Lambda B_i$ are pairwise disjoint and $m(B\cap E)\le C\sum_im(B_i)$, and~\hP{} gives $\Per(E;(1+2\Lambda)B)\ge c\sum_im(B_i)\,t_i^{-\lambda}$.}\label{fig:boxing} \end{figure} \begin{proof} \ref{it:isop-ball} Let $B=B(x,R)$ and $v=v_B(E)>0$. Exchanging $E$ and $X\setminus E$, which changes neither $v_B(E)$ nor the energies, we may assume that $v=m(B\cap E)$. Then $m(B\setminus E)\ge\frac12m(B)$. \emph{Step 1: balls in which both sets are present.} Let $y\in B\cap E$ be a point of density of~$E$. For $k\ge0$ let \begin{equation*} \rho_k=2^{1-k}R\,,\qquad\varphi_k=\theta_{X\setminus E}(y,\rho_k)\,. \end{equation*} Since $B\subset B(y,2R)\subset B(x,3R)$, \eqref{eq:doubling} gives $\varphi_0\ge\frac12m(B)/m(B(x,4R))\ge2\theta$ with $\theta=\frac14C_d^{-2}$, and $\varphi_k\to0$ as $k\to\infty$. Let $k_y\ge1$ be the smallest index with $\varphi_{k_y}<\theta$, and let $t_y=\rho_{k_y-1}\le2R$. Then $\varphi_{k_y-1}\ge\theta$, and by the doubling property \begin{align*} m\big(B(y,t_y)\cap E\big)&\ge m\big(B(y,t_y/2)\cap E\big)>(1-\theta)\,m\big(B(y,t_y/2)\big)\\ &\ge\frac{1-\theta}{C_d}\,m\big(B(y,t_y)\big)\ge\theta\,m\big(B(y,t_y)\big)\,. \end{align*} Hence $v_{B(y,t_y)}(E)\ge\theta\,m(B(y,t_y))$. The ball $B(y,t_y)$ has radius $t_y\le2R\le4D$. By~\eqref{eq:indicator2} and~\hP, for every $0\lambda$, then $\sum_im(B_i)^{1/q}\ge(\sum_im(B_i))^{1/q}\ge c\,v^{1/q}$ by~\eqref{eq:boxing}, because $0<1/q\le1$. If $Q=\lambda$, then $\sum_im(B_i)^{1/q}$ is the number of the balls, which is at least~$1=v^{1/q}$. In both cases~\eqref{eq:boxing} gives \begin{equation*} \Per(E;B')\ge c\,\frac{m(B)^{\lambda/Q}}{R^{\lambda}}\,v^{1/q}=c\,\frac{m(B)}{R^{\lambda}}\,\Big(\frac{v}{m(B)}\Big)^{1/q}\,, \end{equation*} which is~\eqref{eq:relisop}; this inequality is trivial if $v_B(E)=0$. \ref{it:isop-volume} We may assume that $v=v_X(E)=m(E)>0$, since $J_r(\ind_E)=J_r(\ind_{X\setminus E})$. Let $00$. Since $m(X)=\infty$, we have $v_X(E)=m(E)$. Let $t=(2\,m(E)/c_0)^{1/Q}$, so that $m(B(z,t))\ge c_0\,t^Q=2\,m(E)$ for every $z\in X$. By~\ref{it:isop-volume}, \begin{equation*} m(E)\le C\,t^{\lambda}\Per(E)=C\,\Big(\frac{2\,m(E)}{c_0}\Big)^{\lambda/Q}\Per(E)\,.\qedhere \end{equation*} \end{proof} \begin{remark}[The relative isoperimetric inequality and hypothesis~\hIl]\label{rem:relisop-I} The proof of Theorem~\ref{th:relisop}\ref{it:isop-ball} uses~\hP{} only through hypothesis~\hIl{} of Section~\ref{sec:onescale}, which follows from~\hP{} by Theorem~\ref{th:onescale}. Indeed, \hIl{} gives $\theta\,m(B(y,t_y))\le C_I\,t_y^{\lambda}\,\Per(E;B(y,\Lambda_It_y))$ in place of~\eqref{eq:stopping}. If the balls $\Lambda_IB_i$ are pairwise disjoint and contained in $B'=(1+2\Lambda_I)B$, Fatou's lemma for sums and Lemma~\ref{lem:Jbasic}\ref{it:Jsuper} give $\sum_i\Per(E;\Lambda_IB_i)\le\Per(E;B')$, and the rest of the proof is unchanged. Conversely, \eqref{eq:relisop} implies~\hIl. Since $v_B(E)\le m(B)$ and $\frac1q\le1$, its left-hand side is at least $v_B(E)/m(B)$, so that $v_B(E)\le C\,R^{\lambda}\Per(E;(1+2\Lambda)B)$ for every ball of radius $R\le2D$; if $D<\infty$ and $2Du\})^{1/q}\,du$, and this is why the natural target space is the Lorentz space $L^{q,1}$, which is smaller than~$L^q$. A median is used instead of the mean because, for a level~$u$ above a median, the superlevel set is the smaller of the two parts of the ball, so that the isoperimetric inequality bounds its measure. Recall that $q=Q/(Q-\lambda)\in(1,\infty]$ and $\|g\|_{L^{q,1}(W)}=\int_0^\infty m(\{x\in W:\ |g(x)|>u\})^{1/q}\,du$. If $q<\infty$, this is $\frac1q\int_0^\infty t^{1/q-1}g^*(t)\,dt$ in terms of the decreasing rearrangement $g^*$ of~$g$, which is $1/q$ times the usual norm of the Lorentz space $L^{q,1}(W)$; see~\cite[Chapter~4, Section~4]{BS}. If $q=\infty$, it is $\|g\|_{L^\infty(W)}$. We shall only use three elementary properties. If $m(W)<\infty$ and $\gamma\in\R$, then \begin{equation}\label{eq:lorentz} \|g+\gamma\|_{L^{q,1}(W)}\le\|g\|_{L^{q,1}(W)}+|\gamma|\,m(W)^{1/q}\,,\qquad\|g\|_{L^1(W)}\le m(W)^{1-1/q}\,\|g\|_{L^{q,1}(W)}\,, \end{equation} because $\{|g+\gamma|>u\}\subset\{|g|>u-|\gamma|\}$ and $\|g\|_{L^1(W)}=\int_0^\infty m(\{x\in W:\ |g(x)|>u\})\,du$. Moreover, Minkowski's inequality applied to $|g|=\int_0^\infty\ind_{\{|g|>u\}}\,du$ gives \begin{equation}\label{eq:Lq} \|g\|_{L^q(W)}\le\|g\|_{L^{q,1}(W)}\,. \end{equation} \begin{theorem}[Sobolev inequality]\label{th:sobolev} Assume~\hP. There is a constant $C$ with the following properties. \begin{enumerate}[label=\textup{(\roman*)}] \item\label{it:sob-ball} Let $B$ be a ball of radius $R\le2D$ and $B'=(1+2\Lambda)B$. Let $f\in L^1(B',m)$ and let $b$ be a median of $f$ on~$B$. Then \begin{gather*} \|f-b\|_{L^{q,1}(B)}\le C\,R^{\lambda}\,m(B)^{\frac1q-1}\Var(f;B')\,,\\ \|f-f_B\|_{L^{q,1}(B)}\le2C\,R^{\lambda}\,m(B)^{\frac1q-1}\Var(f;B')\,. \end{gather*} \item\label{it:sob-global} If $D=\infty$, $m(B(x,r))\ge c_0\,r^Q$ for all $x\in X$ and $r>0$, and $f\in L^1(X,m)$, then \begin{equation*} \|f\|_{L^{q,1}(X)}\le C\,c_0^{-\lambda/Q}\Var(f)\,. \end{equation*} \end{enumerate} \end{theorem} \begin{proof} \ref{it:sob-ball} Let $E_u=\{x\in B':\ f(x)>u\}$ and $A=C\,R^{\lambda}\,m(B)^{\frac1q-1}$, where $C$ is the constant of~\eqref{eq:relisop}. By~\eqref{eq:relisop}, every measurable set $E$ satisfies \begin{equation}\label{eq:relU} v_B(E)^{1/q}\le A\Per(E;B')\,. \end{equation} Let $u>0$. By the definition of a median, \begin{align*} m(B\cap E_{b+u})&\le m(\{x\in B:\ f(x)>b\})\le\tfrac12m(B)\,,\\ m(B\setminus E_{b-u})&\le m(\{x\in B:\ f(x)b+u\})^{1/q}&\le A\Per(E_{b+u};B')\,,\\ m(\{x\in B:\ f(x)0$ the set $\{|f|>u\}$ has finite measure. By Theorem~\ref{th:relisop}\ref{it:isop-lowermass} and Proposition~\ref{prop:coarea} for the function $|f|$, \begin{equation*} \|f\|_{L^{q,1}(X)}\le C\,c_0^{-\lambda/Q}\int_0^\infty\Per(\{|f|>u\})\,du\le C\,c_0^{-\lambda/Q}\Var(|f|)\le C\,c_0^{-\lambda/Q}\Var(f)\,, \end{equation*} where the last inequality holds because $\big||f(x)|-|f(y)|\big|\le|f(x)-f(y)|$. \end{proof} \begin{proof}[Proof of Theorem~\ref{th:isop}] Part~\ref{it:isop-local} is~\eqref{eq:relisop} and Theorem~\ref{th:sobolev}\ref{it:sob-ball}, and part~\ref{it:isop-bounded} is the case $B=B(x,2D)=X$, for which $B'=X$. The first assertion of part~\ref{it:isop-global} is Theorem~\ref{th:relisop}\ref{it:isop-lowermass} and Theorem~\ref{th:sobolev}\ref{it:sob-global}. For the converse, let $x\in X$ and $R>0$, and let $G$ be given by~\hC{} for $B=B(x,R)$. Then $m(B)\le m(G)<\infty$ and $\Per(G)\le C_C\,m(B)\,R^{-\lambda}$ by~\eqref{eq:C}, so that the assumed inequality gives \begin{equation*} m(B)^{1/q}\le m(G)^{1/q}\le C_0\,C_C\,\frac{m(B)}{R^{\lambda}}\,,\qquad\text{that is,}\qquad m(B)^{\lambda/Q}\ge\frac{R^{\lambda}}{C_0\,C_C}\,.\qedhere \end{equation*} \end{proof} \section{The Gagliardo--Nirenberg and Nash inequalities}\label{sec:gn} The Sobolev inequality and H\"older's inequality give the following interpolation inequalities. \begin{corollary}[Gagliardo--Nirenberg and Nash inequalities]\label{cor:gn} Assume~\hP{} and let $f\in L^1(X,m)$. Suppose either that $D=\infty$ and $m(B(x,r))\ge c_0\,r^Q$ for all $x\in X$ and $r>0$, and let $g=f$ and $A=c_0^{-\lambda/Q}$; or that $D<\infty$, and let $g=f-b$ with a median $b$ of~$f$ on~$X$ and $A=D^{\lambda}\,m(X)^{-\lambda/Q}$. Let $1\le p\le\infty$, $0<\theta\le1$ and $\frac1\sigma=\frac\theta q+\frac{1-\theta}p$. Then \begin{equation*} \|g\|_{L^\sigma(X)}\le\big(C\,A\Var(f)\big)^\theta\,\|g\|_{L^p(X)}^{1-\theta}\,. \end{equation*} In particular, if $2\lambda\ge Q$, then \begin{equation*} \|g\|_{L^2(X)}\le\big(C\,A\Var(f)\big)^{\frac{Q}{2\lambda}}\,\|g\|_{L^1(X)}^{1-\frac{Q}{2\lambda}}\,. \end{equation*} Moreover, if $m(\{f\ne0\})<\infty$ and $D=\infty$, or if $m(\{f\ne0\})\le\frac12m(X)$ and $D<\infty$, then \begin{equation*} \|f\|_{L^1(X)}\le C\,A\,m(\{f\ne0\})^{\lambda/Q}\Var(f)\,. \end{equation*} \end{corollary} \begin{proof} By~\eqref{eq:Lq} and Theorem~\ref{th:sobolev}, $\|g\|_{L^q(X)}\le C\,A\Var(f)$; in the second case this is part~\ref{it:sob-ball} of that theorem for $B=B(x,2D)=X$, since $\frac1q-1=-\frac\lambda Q$. H\"older's inequality gives $\|g\|_{L^\sigma}\le\|g\|_{L^q}^\theta\,\|g\|_{L^p}^{1-\theta}$, which is the first assertion; compare~\cite[Corollary~4.2]{ABGN}. The Nash inequality is the case $p=1$, $\sigma=2$, for which $\theta=Q/(2\lambda)$. For the last assertion, $0$ is a median of $f$ when $D<\infty$ and $m(\{f\ne0\})\le\frac12m(X)$, and H\"older's inequality gives $\|f\|_{L^1}\le m(\{f\ne0\})^{1-1/q}\|f\|_{L^q}$, with $1-1/q=\lambda/Q$. \end{proof} \section{Sharpness}\label{sec:sharp} When~\hC{} holds, the cutoff sets show that neither the factor $R^\lambda/m(B)$ nor, in an Ahlfors regular space, the exponent $1-\frac\lambda Q$ can be improved. This is the rigorous form of the heuristic computation of the first section. \begin{remark}[Sharpness]\label{rem:sharp} Assume~\hP{} and~\hC. \emph{The factor $R^\lambda/m(B)$.} Let $x\in X$ and $0\lambda$ then $L^{q,1}$ cannot be replaced by $L^{\sigma}$ with $\sigma>q$ in Theorem~\ref{th:isop}. On compact Ahlfors regular spaces Proposition~\ref{prop:optimallorentz} gives optimality among all rearrangement-invariant Banach function spaces. \end{remark} \chapter{The topological boundary}\label{sec:top} \begin{overview} The perimeter of a set depends only on its class modulo null sets. In this chapter we study the topological boundary, which depends on the set itself, and we show that the exponent~$\lambda$ can also be read from the open sets of the space: it is the supremum of the numbers~$\beta$ such that the space has a basis of open sets whose boundaries are null sets for the Hausdorff measure of codimension~$\beta$. Hypothesis~\hC{} provides open sets with small boundaries, and hypothesis~\hP{} shows that no boundary can be smaller. \end{overview} \section{The main result}\label{sec:top-intro} The \emph{topological Hausdorff dimension} of Balka, Buczolich and Elekes~\cite{BBE} is \begin{equation*} d_{tH}(X)=\inf\big\{t:\ X\text{ has a basis }\mathcal U\text{ of open sets with }\dim_H\partial U\le t-1\text{ for every }U\in\mathcal U\big\}\,, \end{equation*} with the convention $\dim_H\emptyset=-1$. It depends only on the metric space $(X,d)$, whereas $\lambda$ depends also on the measure. The quantity which is determined by~$\lambda$ is the \emph{topological Hausdorff codimension} \begin{align*} \codim_{tH}(X,d,m)=\sup\big\{\beta>0:\ &X\text{ has a basis }\mathcal U\text{ of open sets}\\ &\text{with }\Hcod\beta(\partial U)=0\text{ for every }U\in\mathcal U\big\}\,, \end{align*} with $\sup\emptyset=0$. If $m$ is Ahlfors regular of dimension~$Q$ and $X$ is connected, then $\codim_{tH}(X,d,m)=Q-d_{tH}(X)+1$ (Lemma~\ref{lem:codimdim}). \paragraph{Two examples.} If $X$ has a basis of sets which are open and closed, for instance if $X$ is a Cantor set, then the boundaries of these sets are empty and $d_{tH}(X)=0$. At the other extreme $d_{tH}(\R^n)=n$~\cite{BBE}: balls have boundaries of dimension $n-1$, and no basis does better. The topological Hausdorff dimension thus measures how thick a set must be in order to separate a neighbourhood of a point from the rest of the space. On the Sierpi\'nski carpet, the rectangles of Figure~\ref{fig:hyp}(b) are bounded by pieces of Cantor sets of dimension $\log_32$, and indeed $d_{tH}(F)=1+\log_32$~\cite[Theorem~5.4]{BBE}. \begin{theorem}\label{th:dimension} \begin{enumerate}[label=\textup{(\roman*)}] \item\label{it:dim-upper} Assume~\hC. Then $X$ has a basis $\mathcal U$ of open sets such that, for every $U\in\mathcal U$ and every $\varepsilon>0$, \begin{equation*} m\big(\{x\in X:\ \dist(x,\partial U)\lambda$, and let $K\ge1$. There are constants $C$ and $L$ such that, for every measurable set $E\subset X$ and every ball $B$ of radius $R\le D$, \begin{equation}\label{eq:topiso} \Big(\frac{v_B(E)}{m(B)}\Big)^{1-\frac\lambda Q}\le C\,\frac{R^{\lambda}}{m(B)}\,\Hcod\lambda_{KR}(\partial E\cap LB)\,. \end{equation} \end{enumerate} \end{theorem} Inequality~\eqref{eq:topiso} is a relative isoperimetric inequality in which the perimeter is replaced by a Hausdorff content of the topological boundary; in codimension one, inequalities of this type are studied by Korte and Lahti~\cite{KL}. The radii of the covering balls must be restricted in~\eqref{eq:topiso}: if $D<\infty$, the ball $B(x,r)=X$ has $\xi_\lambda(B(x,r))=m(X)\,r^{-\lambda}\to0$ as $r\to\infty$, so that the content with unrestricted radii vanishes identically. \paragraph{How to read the theorem.} Part~\ref{it:dim-upper} says that the space has many open sets with small boundaries: for every $\varepsilon>0$ the neighbourhoods of~$\partial U$ shrink at the rate $t^{\lambda-\varepsilon}$, almost as fast as the neighbourhoods of the boundary of a cutoff set. Parts~\ref{it:dim-equal} and~\ref{it:dim-content} say that this cannot be improved: under~\hP{} and~\hC{} the topological boundary of a set which divides a ball into two substantial parts has a Hausdorff content of codimension~$\lambda$ which is bounded from below. \section{Open sets with small boundary}\label{sec:smallboundary} \idea A single set $G$ given by~\hC{} has small energy, but it is only a measurable set, defined modulo null sets, and nothing is assumed about its topological boundary. We therefore build an open set~$U$ as an increasing union of sets $A_k$, each of which is a finite union of Voronoi cells at a scale~$h_k$, where the scales decrease rapidly. The set $A_{k+1}$ is obtained from $A_k$ by adding cutoff sets around the cells of $A_k$ and then taking the cells of scale $h_{k+1}$ which lie at least half in this union (Figure~\ref{fig:refine}). The quantity which is controlled along the construction is the total cost $\sum_w\xi_\lambda(B(w,h_{k}))$ of the cells of scale~$h_k$ near the boundary of~$A_k$. By~\eqref{eq:C} this cost is multiplied by at most a constant at each refinement, and the rapid decrease of the scales absorbs these constants, at the price of an arbitrarily small loss~$\varepsilon$ in the exponent. Let $L_0=10\,(M+2)$. For $h>0$, an $h$-net $\Xi$ with a Voronoi partition $(V_z)_{z\in\Xi}$ as in Lemma~\ref{lem:nets}, and a finite set $\Xi^+\subset\Xi$, we write \begin{align*} A(\Xi^+)&=\bigcup_{z\in\Xi^+}V_z\,,\\ \partial\Xi^+&=\big\{z\in\Xi:\ \text{there is }w\in\Xi\text{ with }d(z,w)\le L_0h\text{ and }\ind_{\Xi^+}(w)\ne\ind_{\Xi^+}(z)\big\}\,,\\ \mathsf P_h(\Xi^+)&=\sum_{z\in\partial\Xi^+}\xi_\lambda\big(B(z,h)\big)=\frac1{h^{\lambda}}\sum_{z\in\partial\Xi^+}m(B(z,h))\,. \end{align*} Thus $\partial\Xi^+$ consists of the points of $\Xi^+$ and of $\Xi\setminus\Xi^+$ at distance at most $L_0h$ from the other set; it is finite by Lemma~\ref{lem:nets}\ref{it:packing}. If $m$ is Ahlfors regular of dimension~$Q$, then $\mathsf P_h(\Xi^+)$ is comparable to $\#\partial\Xi^+\,h^{Q-\lambda}$. \begin{figure}[t] \centering \begin{tikzpicture}[x=8.5mm,y=8.5mm] \foreach \i in {-7,...,14}{\foreach \j in {-7,...,14}{% \pgfmathsetmacro{\fx}{(\i+.5)/4}\pgfmathsetmacro{\fy}{(\j+.5)/4}% \pgfmathtruncatemacro{\fin}{(((\fx-.5)^2+(\fy-.5)^2)<4)||(((\fx-1.5)^2+(\fy-.5)^2)<4)||(((\fx-1.5)^2+(\fy-1.5)^2)<4)}% \ifnum\fin=1 \fill[rowblue,draw=white,line width=.25pt] (\i/4,\j/4) rectangle ++(.25,.25);\fi}} \draw[gray,line width=.3pt,step=1] (-2,-2) grid (4,4); \foreach \p in {(0,0),(1,0),(1,1)}{\fill[navy,draw=white,line width=.5pt] \p rectangle ++(1,1);} \foreach \p in {(.5,.5),(1.5,.5),(1.5,1.5)}{\draw[cutred,dashed,line width=.7pt] \p circle (2);\fill[white] \p circle (1.1pt);} \draw[line width=.3pt] (1.5,0.25) -- (4.4,0.25); \node[right] at (4.35,0.25) {\small $A=A(\Xi^+)$}; \draw[line width=.3pt] (3.2,1.6) -- (4.4,1.6); \node[right] at (4.35,1.6) {\small $A'=A(\Xi'^+)$}; \draw[line width=.3pt] (2.9,2.95) -- (4.4,2.95); \node[right] at (4.35,2.95) {\small $\partial B(z,2h)$,\ $z\in\Xi^+$}; \end{tikzpicture} \caption{Lemma~\ref{lem:refine}, drawn in the plane with square cells and with $G_z=B(z,2h)$. The set $A$ is the union of three cells $V_z$ of scale~$h$; the set $A'$ is the union of the cells $V'_w$ of scale~$h'$ which lie at least half in $G=\bigcup_{z\in\Xi^+}G_z$. The picture is not to scale: the lemma requires $h'0$. In particular $\Hcod\beta(\partial U)=0$ for every $\beta\in(0,\lambda)$. \end{proposition} \begin{proof} \emph{Step 1: construction.} Let \begin{equation*} b=8(L_0+3)\,,\qquad h_k=h_0\,b^{-k}\,2^{-k^2}\quad(k\ge0)\,,\qquad\text{so that}\qquad h_{k+1}<\frac{h_k}{4(L_0+3)}\,. \end{equation*} Moreover $\sum_{j\ge k}h_j\le2h_k$. For each $k$ choose an $h_k$-net $\Xi_k$ with a Voronoi partition, with $x_0\in\Xi_0$, and let $\Xi_0^+=\{x_0\}$. Applying Lemma~\ref{lem:refine} inductively we obtain finite sets $\Xi_k^+\subset\Xi_k$ such that $A_k=A(\Xi_k^+)$ satisfies \begin{equation}\label{eq:iterate} B(A_k,h_k/3)\subset A_{k+1}\subset B\big(A_k,(2M+3)h_k\big)\,,\qquad\mathsf P_{h_k}(\Xi_k^+)\le C_1^{\,k}\,\mathsf P_{h_0}(\Xi_0^+)\,, \end{equation} where $C_1$ is the constant of~\eqref{eq:contain}. Let $U=\bigcup_{k\ge0}A_k$. The sets $A_k$ increase, and every point of $A_k$ has a neighbourhood contained in $A_{k+1}$; hence $U$ is open. By the second inclusion of~\eqref{eq:iterate} and $(2M+3)\sum_{j\ge k}h_j\le(4M+6)h_k$, \begin{equation}\label{eq:Uclose} A_k\subset U\subset B\big(A_k,(4M+6)h_k\big)\qquad\text{for every }k\ge0\,. \end{equation} For $k=0$, and since $B(x_0,h_0/2)\subset V_{x_0}=A_0\subset B(x_0,h_0)$, this gives the asserted inclusions. \emph{Step 2: covering of the boundary.} We claim that \begin{equation*} \partial U\subset\bigcup_{w\in\partial\Xi_k^+}B(w,h_k)\qquad\text{for every }k\ge0\,. \end{equation*} Let $y\in\partial U$, and let $w\in\Xi_k$ be the point with $y\in V_w$. Since $U$ is open, $y\notin U$, hence $w\notin\Xi_k^+$. By~\eqref{eq:Uclose}, $\dist(y,A_k)\le(4M+6)h_k$, so there is $z\in\Xi_k^+$ with $d(w,z)\lambda$, and let $K\ge1$. There is a constant $C$, depending also on~$K$, such that, for every measurable set $E\subset X$ and every ball $B$ of radius $R\le D$, \begin{equation*} \Big(\frac{v_B(E)}{m(B)}\Big)^{1/q}\le C\,\frac{R^{\lambda}}{m(B)}\,\Hcod\lambda_{KR}\big(\partial E\cap(2+2\Lambda)B\big)\,. \end{equation*} \end{proposition} The right-hand side depends on the set $E$ itself and not only on its equivalence class modulo null sets. Since~\eqref{eq:decay} holds for every exponent larger than~$Q$, the assumption $Q>\lambda$ is not a restriction on the space: if~\eqref{eq:decay} is known only for $Q=\lambda$, the proposition applies with any larger exponent in place of~$Q$, for instance $\lambda+1$. \begin{proof} Let $B=B(x,R)$, $\Lambda_0=1+2\Lambda$, $K_0=\overline{\Lambda_0B}$ and $v=v_B(E)$; we may assume that $v>0$. Let $(B_\iota)_\iota$ be a countable family of balls $B_\iota=B(x_\iota,r_\iota)$ with $r_\iota\le KR$ which covers $\partial E\cap(\Lambda_0+1)B$ and whose elements meet $(\Lambda_0+1)B$, and let \begin{equation*} T=\sum_\iota\xi_\lambda(B_\iota)\,. \end{equation*} We show that $T\ge\varepsilon\,m(B)\,R^{-\lambda}\,(v/m(B))^{1/q}$ for a constant $\varepsilon>0$, depending only on $K$ and the structural constants, which is fixed below. Suppose that $T$ is smaller than this number. \emph{Step 1: the radii are smaller than $R$.} If $r_\iota\ge R$ for some $\iota$, then $B\subset(\Lambda_0+3)B_\iota$, hence $m(B)\le C\,m(B_\iota)$ by~\eqref{eq:dbl}, and \begin{equation*} T\ge\xi_\lambda(B_\iota)\ge\frac{m(B)}{C\,(KR)^{\lambda}}\ge\varepsilon\,\frac{m(B)}{R^{\lambda}}\,\Big(\frac{v}{m(B)}\Big)^{1/q} \end{equation*} if $\varepsilon\le1/(CK^\lambda)$, because $v\le m(B)$. This contradicts our assumption; hence $r_\iota0$ such that $d(x',y')\ge h_0$ for all $x'\in K_1$ and $y'\in K_2$. Let $00$ form a basis of the topology of~$X$, and they satisfy $\Hcod\beta(\partial U)=0$ for every $\beta<\lambda$. Hence $\codim_{tH}(X,d,m)\ge\lambda$. \ref{it:dim-content} is Proposition~\ref{prop:topiso}, with $L=2+2\Lambda$. \ref{it:dim-equal} It remains to prove that $\codim_{tH}(X,d,m)\le\lambda$. Let $\mathcal U$ be a basis of open sets. We show that \begin{equation}\label{eq:basispositive} \Hcod\lambda(\partial U)>0\qquad\text{for some }U\in\mathcal U\,. \end{equation} By~\eqref{eq:codimcompare} this implies $\Hcod\beta(\partial U)=\infty$ for every $\beta>\lambda$, and since $\mathcal U$ was arbitrary, $\codim_{tH}(X,d,m)\le\lambda$. By Lemma~\ref{lem:continua}\ref{it:connected}, $X$ has no isolated point, so there are distinct points $x,y\in X$ with $2d(x,y)\le D$. Let \begin{equation*} \rho=d(x,y)/8\,,\qquad B=B(x,2d(x,y))\,,\qquad U\in\mathcal U\ \text{ with }\ x\in U\subset B(x,\rho)\,. \end{equation*} The sets $U$ and $B(y,\rho)$ are open, non-empty and disjoint, and both are contained in~$B$; hence $v_B(U)>0$. Let $Q'=\max\{Q,\lambda+1\}$. Since~\eqref{eq:decay} holds with $Q'$ in place of~$Q$, Proposition~\ref{prop:topiso}, applied with the exponent $Q'$, with $K=1$, and to $E=U$ and the ball~$B$, gives $\Hcod\lambda_{R}(\partial U)>0$ for the radius $R$ of~$B$. This implies~\eqref{eq:basispositive}. \end{proof} \chapter{The measure-theoretic boundary}\label{sec:federer} \begin{overview} Federer's theorem states that a subset of~$\R^n$ has finite perimeter if and only if its measure-theoretic boundary has finite Hausdorff measure of dimension~$n-1$. We prove the corresponding statement in codimension~$\lambda$: under~\hP{} and~\hC, the perimeter of a set is comparable to the Hausdorff measure of codimension~$\lambda$ of its measure-theoretic boundary. The lower bound for the perimeter is a covering argument. The upper bound uses the content inequality for topological boundaries of Chapter~\ref{sec:top} and a theorem of Eriksson-Bique on limsup sets. When $Q=\lambda$, points have positive measure for $\Hcod\lambda$ and the perimeter counts the boundary points. \end{overview} \section{Three boundaries and the main result}\label{sec:federer-intro} For a measurable set $E\subset X$, $x\in X$ and $r>0$ let \begin{equation*} \theta_E(x,r)=\frac{m(E\cap B(x,r))}{m(B(x,r))}\,,\qquad\vartheta_E(x,r)=\min\{\theta_E(x,r),\,\theta_{X\setminus E}(x,r)\}=\frac{v_{B(x,r)}(E)}{m(B(x,r))}\,. \end{equation*} Thus $\theta_E(x,r)$ is the proportion of the ball $B(x,r)$ which lies in~$E$, and $\vartheta_E(x,r)$ is the proportion occupied by the smaller of the two parts $E\cap B(x,r)$ and $B(x,r)\setminus E$. The \emph{measure-theoretic boundary} of $E$ is the set of points at which $E$ and $X\setminus E$ both have positive upper density, \begin{equation*} \partial^*E=\Big\{x\in X:\ \limsup_{r\downarrow0}\theta_E(x,r)>0\ \text{ and }\ \limsup_{r\downarrow0}\theta_{X\setminus E}(x,r)>0\Big\}\,. \end{equation*} For $0<\eta\le\frac12$ we also consider the sets \begin{equation*} D_\eta(E)=\Big\{x\in X:\ \limsup_{r\downarrow0}\vartheta_E(x,r)\ge\eta\Big\}\,,\qquad \Sigma_\eta(E)=\Big\{x\in X:\ \liminf_{r\downarrow0}\vartheta_E(x,r)\ge\eta\Big\}\,, \end{equation*} so that \begin{equation*} \Sigma_\eta(E)\subset D_\eta(E)\subset\partial^*E\subset\partial E\,. \end{equation*} Up to an arbitrarily small loss in~$\eta$, a point belongs to $D_\eta(E)$ if both parts fill a proportion at least~$\eta$ of the balls centred at this point at \emph{arbitrarily small} scales, and to $\Sigma_\eta(E)$ if they do so at \emph{all sufficiently small} scales. The set $\Sigma_\eta(E)$ is the strong boundary of Lahti~\cite{LahtiStrong}. All these sets depend only on the class of~$E$ modulo null sets, unlike the topological boundary~$\partial E$. \begin{theorem}\label{th:federer} Assume~\hP. \begin{enumerate}[label=\textup{(\roman*)}] \item\label{it:fed-pos} If~\hC{} holds, there are constants $\eta\in(0,\frac12]$ and $C\ge1$ such that, for every measurable set $E\subset X$, \begin{equation*} C^{-1}\,\Hcod\lambda(\partial^*E)\le\Per(E)\le C\,\Hcod\lambda(D_\eta(E))\,. \end{equation*} In particular $\Per(E)<\infty$ if and only if $\Hcod\lambda(\partial^*E)<\infty$, and in this case $\Hcod\lambda(\partial^*E\setminus D_\eta(E))=0$. \item\label{it:fed-zero} If~\eqref{eq:decay} holds with $Q=\lambda$, there are constants $\gamma\in(0,\frac12]$ and $C\ge1$ such that, for every measurable set $E\subset X$, \begin{equation*} C^{-1}\,\Hcod\lambda(\partial^*E)\le\Per(E)\le C\,\Hcod\lambda(\Sigma_\gamma(E))\,. \end{equation*} If $\Per(E)<\infty$, then $\partial^*E=\Sigma_\gamma(E)$, and $\#(\partial^*E\cap B)\le C\,R^\lambda\,m(B)^{-1}\Per(E)$ for every ball $B$ of radius~$R$. \end{enumerate} \end{theorem} In $\R^n$, Federer's theorem~\cite[4.5.11]{Fed} states that a set has finite perimeter if and only if its measure-theoretic boundary has finite $(n-1)$-dimensional Hausdorff measure. In complete doubling metric measure spaces supporting a $(1,1)$-Poincar\'e inequality, the corresponding statements are due to Ambrosio~\cite{Ambrosio} and Lahti~\cite{Lahti,LahtiStrong}, and Eriksson-Bique~\cite{EB} gave a proof based on a Hausdorff content bound for limsup sets. His bound holds for general doubling gauges on balls, and we use it in part~\ref{it:fed-pos} with the gauge~$\xi_\lambda$. In Theorem~\ref{th:federer} the Hausdorff measure of codimension one is replaced by that of codimension~$\lambda$. No relation between $\lambda$ and the local dimensions of~$m$ is assumed in part~\ref{it:fed-pos}: at a point~$x$ where $\xi_\lambda(B(x,r))\to\infty$ as $r\downarrow0$ the measure $\Hcod\lambda$ has an infinite atom, and the theorem then states that $\Per(E)=\infty$ whenever $x\in\partial^*E$. Part~\ref{it:fed-zero} is the endpoint at which points have positive $\Hcod\lambda$-measure; it does not use~\hC, and for an Ahlfors regular measure of dimension~$\lambda$ it states that $\Per(E)$ is comparable to the number of points of~$\partial^*E$. Whether $D_\eta(E)$ can be replaced by $\Sigma_\gamma(E)$ in part~\ref{it:fed-pos} under~\hP{} and~\hC{} alone is the question of Section~\ref{sec:open}. Sufficient conditions on the graphs of cells are given by Theorem~\ref{th:strong} and Corollary~\ref{cor:strongselection}. They apply to the bounded and unbounded standard carpets, all the central-block carpets $F_{b,a}$, and the Menger sponge. \section{Strategy of the proof} \paragraph{The lower bound for the perimeter.} The inequality $\Hcod\lambda(D_\eta(E))\le C\eta^{-1}\Per(E)$ is a covering argument which uses only~\hP: a ball $B$ of radius~$r$ with $\vartheta_E(x,r)\ge\eta/2$ contributes $c\,\eta\,\xi_\lambda(B)$ to the perimeter. \paragraph{The upper bound for the perimeter.} The reverse inequality requires a relative isoperimetric inequality in which the perimeter is replaced by the Hausdorff content of $D_\eta(E)$, \begin{equation*} \Big(\frac{v_B(E)}{m(B)}\Big)^{\alpha}\le C\,\frac{R^{\lambda}}{m(B)}\,\Hcod\lambda_{KR}\big(D_\eta(E)\cap LB\big)\,, \end{equation*} for some exponent $\alpha\in[0,1]$. Under~\hP{} and~\hC{} we deduce it from the inequality for the topological boundary, Proposition~\ref{prop:topiso}. Let $F_h$ be the superlevel set $\{u_h>\frac12\}$ of a continuous average $u_h$ of $\ind_E$ at scale~$h$. Every point $y\in\partial F_h$ satisfies $v_{B(y,h)}(E)\ge\delta_0\,m(B(y,h))$, and Proposition~\ref{prop:topiso} bounds the content of $\partial F_h$ from below. The theorem of Eriksson-Bique~\cite{EB} on limsup sets transfers these bounds, as $h\downarrow0$, to the set of the points which lie close to such points~$y$ at infinitely many scales, and this set is contained in $D_\eta(E)$. When~\eqref{eq:decay} holds with $Q=\lambda$ we use instead the fact that~\hP{} makes $X$ quasiconvex in the sense of continua, and a result of Lahti~\cite{LahtiStrong} on the existence of points of $\Sigma_\gamma(E)$; in this case every point has positive $\Hcod\lambda$-measure, and no content estimate is needed. \section{Densities} We first check that the sets under consideration are Borel sets, and that the measure-theoretic boundary is exhausted by the sets $D_\eta(E)$. \begin{lemma}\label{lem:borel} Let $E\subset X$ be measurable. \begin{enumerate}[label=\textup{(\roman*)}] \item\label{it:borel} For each $r>0$ the function $x\mapsto\theta_E(x,r)$ is Borel, and for each $x\in X$ the function $r\mapsto\theta_E(x,r)$ is left-continuous. The sets $\partial^*E$, $D_\eta(E)$ and $\Sigma_\eta(E)$, $0<\eta\le\frac12$, are Borel. \item\label{it:dyadic} $\partial^*E=\bigcup_{\eta>0}D_\eta(E)$. \end{enumerate} \end{lemma} \begin{proof} \ref{it:borel} Since $\ind_{B(x,r)}(y)=\ind_{\{d(x,y)0$, which we take so small that $(C_d+1)\tau<1$, such that \begin{equation*} \theta_k>\tau\ \text{ for infinitely many }k\qquad\text{and}\qquad1-\theta_k>\tau\ \text{ for infinitely many }k\,. \end{equation*} We claim that $\tau\le\theta_k\le1-\tau$ for infinitely many~$k$, which gives $x\in D_\tau(E)$. Otherwise there are arbitrarily large $k$ such that one of $\theta_k,\theta_{k+1}$ is smaller than $\tau$ and the other is larger than $1-\tau$. Exchanging $E$ and $X\setminus E$ if necessary, suppose that $\theta_k<\tau$ and $\theta_{k+1}>1-\tau$. Then \begin{equation*} \theta_k\ge\frac{m(E\cap B(x,2^{-k-1}))}{m(B(x,2^{-k}))}\ge\frac{\theta_{k+1}}{C_d}>\frac{1-\tau}{C_d}>\tau\,, \end{equation*} a contradiction. \end{proof} \section{Perimeter and Hausdorff measure}\label{sec:comparison} The next proposition reduces Theorem~\ref{th:federer}, and its variant with $\Sigma_\gamma(E)$ in place of $D_\eta(E)$, to a relative isoperimetric inequality for the Hausdorff measure of a subset of the measure-theoretic boundary. \idea For the lower bound~\ref{it:comp-lower}, cover $D_\eta(E)$ by small balls in which both parts fill a proportion at least $\eta/2$. By~\hP, each such ball~$B_i$ carries a perimeter at least $c\,\eta\,\xi_\lambda(B_i)$ in its dilate $\Lambda B_i$, and the covering lemma makes these dilates disjoint. For the upper bound~\ref{it:comp-upper}, the energy $J_h(\ind_E)$ is at most the sum, over the balls $2B_z$ of an $h$-net, of the measures $v_{2B_z}(E)$ of the smaller parts. The assumed inequality~\eqref{eq:weakcontent} bounds each of them by $h^\lambda$ times the Hausdorff measure of~$\mathcal S$ in a dilated ball, and these dilated balls have bounded overlap. The last assertion of~\ref{it:comp-upper} is the classical density argument for Hausdorff measures. \begin{proposition}\label{prop:comparison} Assume~\hP, and let $E\subset X$ be measurable. \begin{enumerate}[label=\textup{(\roman*)}] \item\label{it:comp-lower} For every $\eta\in(0,\frac12]$ and every open set $U\subset X$, \begin{equation*} \Hcod\lambda\big(D_\eta(E)\cap U\big)\le C\,\eta^{-1}\Per(E;U)\,. \end{equation*} In particular $\Hcod\lambda(D_\eta(E))\le C\,\eta^{-1}\Per(E)$. \item\label{it:comp-upper} Let $\mathcal S\subset X$ be a Borel set, and suppose that there are constants $\alpha\in[0,1]$, $C_0$, $L\ge1$ and $R_0\in(0,D]$ such that \begin{equation}\label{eq:weakcontent} \Big(\frac{v_B(E)}{m(B)}\Big)^{\alpha}\le C_0\,\frac{R^{\lambda}}{m(B)}\,\Hcod\lambda(\mathcal S\cap LB)\qquad\text{for every ball }B\text{ of radius }R\le R_0\,. \end{equation} Then, for every measurable set $W\subset X$ and $00$ and $0$ otherwise. Part~\ref{it:comp-upper} does not use~\hP. \begin{proof} \ref{it:comp-lower} Let $\delta>0$. Every $x\in D_\eta(E)\cap U$ admits a radius $r_x<\min\{\delta/(5\Lambda),D\}$ with $B(x,\Lambda r_x)\subset U$ and $\vartheta_E(x,r_x)\ge\eta/2$. By the covering lemma there are countably many of these points, $x_i$ with $r_i=r_{x_i}$, such that the balls $B_i=B(x_i,r_i)$ have pairwise disjoint dilates $\Lambda B_i\subset U$ and the balls $5\Lambda B_i$ cover $D_\eta(E)\cap U$. By~\eqref{eq:indicator2} and~\hP, for $00\qquad\text{for every }x\in\partial^*E\,. \end{equation} By Lemma~\ref{lem:borel}\ref{it:dyadic} there are $\tau>0$ and arbitrarily small radii $r$ with $v_{B(x,r)}(E)\ge\tau\,m(B(x,r))$. For such $r\le R_0$, \eqref{eq:weakcontent} and~\eqref{eq:gaugedbl} give \begin{equation*} \tau^{\alpha}\,\xi_\lambda(B(x,r))\le C_0\,\nu(B(x,Lr))\,,\qquad\xi_\lambda(B(x,Lr))\le C_d\,L^{Q_d}\,\xi_\lambda(B(x,r))\,, \end{equation*} which proves~\eqref{eq:upperdensity}. Let $N=\partial^*E\setminus\mathcal S$, which is a Borel set by Lemma~\ref{lem:borel} with $\nu(N)=0$, and for $t>0$ let $N_t$ be the set of the points $x\in N$ at which the upper limit in~\eqref{eq:upperdensity} is larger than~$t$. We show that $\Hcod\lambda(N_t)=0$ by the classical density argument~\cite[Theorem~6.9]{Mat}. Let $\varepsilon,\delta>0$. Since $\nu$ is a finite Borel measure, there is an open set $U\supset N$ with $\nu(U)<\varepsilon$. For each $x\in N_t$ choose $r_x\in(0,\delta/5)$ with $B(x,r_x)\subset U$ and $\nu(B(x,r_x))>t\,\xi_\lambda(B(x,r_x))$. By the covering lemma, there is a countable family of pairwise disjoint balls $B_i=B(x_i,r_{x_i})$ such that the balls $5B_i$ cover~$N_t$. By~\eqref{eq:gaugedbl}, \begin{equation*} \Hcod\lambda_\delta(N_t)\le\sum_i\xi_\lambda(5B_i)\le C_d\,5^{Q_d}\sum_i\xi_\lambda(B_i)\le\frac{C_d\,5^{Q_d}}t\sum_i\nu(B_i)\le\frac{C_d\,5^{Q_d}}t\,\nu(U)\,, \end{equation*} and the right-hand side is smaller than $C_d\,5^{Q_d}\,\varepsilon/t$. Letting $\varepsilon\downarrow0$ and then $\delta\downarrow0$ we get $\Hcod\lambda(N_t)=0$. By~\eqref{eq:upperdensity}, $N=\bigcup_{j\ge1}N_{1/j}$, hence $\Hcod\lambda(N)=0$. \ref{it:comp-both} The second inequality is~\ref{it:comp-upper}. For the first one we may assume that $\Per(E)<\infty$. Then $\Hcod\lambda(\mathcal S)\le\Hcod\lambda(D_\eta(E))\le C\eta^{-1}\Per(E)<\infty$ by~\ref{it:comp-lower}, hence $\Hcod\lambda(\partial^*E\setminus\mathcal S)=0$ by~\ref{it:comp-upper}, and $\Hcod\lambda(\partial^*E)=\Hcod\lambda(\mathcal S)\le C\eta^{-1}\Per(E)$. \end{proof} \section{From the topological to the measure-theoretic boundary}\label{sec:limsup} By Proposition~\ref{prop:comparison}, Theorem~\ref{th:federer}\ref{it:fed-pos} follows from an inequality of the form~\eqref{eq:weakcontent} for the set $\mathcal S=D_\eta(E)$. We know such an inequality for the topological boundary (Proposition~\ref{prop:topiso}), and the task is to transfer it to~$D_\eta(E)$. The tool is a theorem on the Hausdorff content of limsup sets. We use the following theorem of Eriksson-Bique, for the gauge~$\xi_\lambda$ and the inflation factor~$2$. A \emph{gauge} is a function $\xi$ which assigns a number $\xi(B)\in(0,\infty)$ to every ball $B=B(x,r)$ with a specified centre and radius; it is \emph{doubling} with the constant $A\ge1$ if \begin{equation*} A^{-1}\,\xi(B)\le\xi(B')\le A\,\xi(B)\qquad\text{whenever }B=B(x,r)\subset B'=B(x',r')\text{ and }r\le r'\le2r\,. \end{equation*} For $t>0$, $\Hc^\xi_t(S)$ is the infimum of the costs $\sum_\iota\xi(B_\iota)$ of the countable coverings of~$S$ by open balls of radii at most~$t$. A \emph{closed ball} is a set $\overline B(y,r)=\{z:\ d(y,z)\le r\}$ with a specified centre and radius; we let $\xi(\overline B(y,r))=\xi(B(y,r))$ and $2\overline B(y,r)=\overline B(y,2r)$. \begin{theorem}[{\cite[Theorem~4.1]{EB}}]\label{th:EB} Let $\xi$ be a doubling gauge with the constant~$A$ on a complete metric space, and let $\mathcal B_1\supset\mathcal B_2\supset\cdots$ be families of closed balls such that the supremum of the radii of the balls of $\mathcal B_j$ tends to zero as $j\to\infty$. For a closed ball $V$ let $\mathcal B_j|_V=\{V'\in\mathcal B_j:\ V'\subset V\}$. Suppose that there is $\Delta\in(0,1]$ such that, for every $i\ge1$, every $V\in\mathcal B_i$ of radius $t$ and every $j\ge i$, \begin{equation}\label{eq:EBhyp} \Hc^\xi_t\Big(\bigcup\mathcal B_j|_V\Big)\ge\Delta\,\xi(V)\,. \end{equation} Then, for every $V\in\bigcup_i\mathcal B_i$ of radius~$t$, \begin{equation}\label{eq:EBconcl} \Hc^\xi_t\Big(\bigcap_{j\ge1}\ \bigcup_{V'\in\mathcal B_j|_V}2V'\Big)\ge c_{\mathrm{EB}}\,\Delta\,\xi(V)\,, \end{equation} where $c_{\mathrm{EB}}>0$ depends only on~$A$. \end{theorem} In~\cite{EB} the gauge is not assumed to be monotone with respect to inclusion, which is essential here: the function $r\mapsto\xi_\lambda(B(x,r))$ may be increasing, decreasing or neither. By~\eqref{eq:gaugeEB}, the gauge $\xi_\lambda$ is doubling with the constant $A=\max\{C_d^{\,2},2^\lambda\}$, and $\Hc^{\xi_\lambda}_t=\Hcod\lambda_t$. \paragraph{How the theorem is used.} Replace $E$ by a set $F_h$ with a tame topological boundary: $F_h$ is the set where a continuous average of $\ind_E$ at scale~$h$ exceeds~$\frac12$. Every point~$y$ of $\partial F_h$ is \emph{balanced at scale~$h$}, in the sense that $E$ and $X\setminus E$ both fill a fixed proportion of $B(y,h)$. Proposition~\ref{prop:topiso}, applied to~$F_h$, shows that the balanced points at scale~$h$ have a large content in every ball in which $E$ itself is balanced. This holds for every small~$h$, but a point of $D_\eta(E)$ must be balanced at infinitely many scales. The families $\mathcal B_j$ of Theorem~\ref{th:EB} are the balls centred at the balanced points at the scales smaller than $2^{-j}R$; the hypothesis~\eqref{eq:EBhyp} is the content bound just described, and the set in the conclusion~\eqref{eq:EBconcl} consists of points which are close to balanced points at infinitely many scales, hence of points of $D_\eta(E)$. \begin{proposition}\label{prop:limsup} Let $L\ge1$, $\Theta=2L+3$, $\alpha\in(0,1]$ and $c_0>0$, and suppose that every measurable set $F\subset X$ and every ball $b$ of radius $t\le D$ satisfy \begin{equation}\label{eq:topcontent} \Hcod\lambda_{\Theta t}(\partial F\cap Lb)\ge c_0\,\frac{m(b)}{t^{\lambda}}\,\Big(\frac{v_b(F)}{m(b)}\Big)^{\alpha}\,. \end{equation} Then there are $\eta\in(0,\frac12]$ and $c>0$, depending only on $L$, $c_0$, $\alpha$, $\lambda$ and $C_d$, such that \begin{equation*} \Hcod\lambda_{\Theta R}\big(D_\eta(E)\cap(2L+4)b\big)\ge c\,\frac{m(b)}{R^{\lambda}}\,\Big(\frac{v_b(E)}{m(b)}\Big)^{\alpha} \end{equation*} for every measurable set $E\subset X$ and every ball $b$ of radius $R\le D$. \end{proposition} \begin{proof} \emph{Step 1: continuous averages.} For $h>0$ let $\psi_h(x,y)=(1-d(x,y)/h)_+$ and \begin{equation*} u_h(x)=\frac{\int_X\psi_h(x,y)\,\ind_E(y)\,dm(y)}{\int_X\psi_h(x,y)\,dm(y)}\,,\qquad F_h=\{x\in X:\ u_h(x)>\tfrac12\}\,. \end{equation*} The denominator is at least $\frac12m(B(x,h/2))\ge\frac12C_d^{-1}\,m(B(x,h))$ and at most $m(B(x,h))$. Since $|\psi_h(x,y)-\psi_h(x',y)|\le d(x,x')/h$, numerator and denominator are continuous in~$x$; hence $u_h$ is continuous, $F_h$ is open and $u_h=\frac12$ on $\partial F_h$. At every Lebesgue point $x$ of $\ind_E$ we have $u_h(x)\to\ind_E(x)$ as $h\downarrow0$, so that \begin{equation*} \ind_{F_h}\to\ind_E\qquad\text{$m$-almost everywhere and in }L^1_{\mathrm{loc}}(X,m)\,. \end{equation*} Let $\delta_0=\frac14C_d^{-1}$. If $y\in\partial F_h$, then $\int\psi_h(y,\cdot)\ind_E\,dm=\int\psi_h(y,\cdot)\ind_{X\setminus E}\,dm\ge\delta_0\,m(B(y,h))$, and since $\psi_h(y,\cdot)\le\ind_{B(y,h)}$, \begin{equation}\label{eq:balanced} v_{B(y,h)}(E)\ge\delta_0\,m(B(y,h))\qquad\text{for every }y\in\partial F_h\,. \end{equation} \emph{Step 2: the families of balls.} Fix a ball $b=B(x,R)$ with $R\le D$, and let $v=v_b(E)$; we may assume that $v>0$. Let $B_0=\overline B(x,\Theta R)$. For $j\ge1$ let \begin{equation*} \mathcal B_j=\big\{\overline B(y,\Theta h):\ y\in X,\ 00$, for every exponent~$\lambda$. The proof uses the connectedness properties of Lemma~\ref{lem:continua}: after a change to a comparable distance for which the space is quasiconvex in the sense of continua, the lemma is a result of Lahti~\cite{LahtiStrong}. \begin{lemma}\label{lem:strongpoint} Assume~\hP. There are constants $\gamma\in(0,\frac12]$ and $L\ge1$ such that, for every measurable set $E\subset X$ and every ball $B$ of radius at most~$D$, \begin{equation*} v_B(E)>0\quad\Longrightarrow\quad\Sigma_\gamma(E)\cap LB\ne\emptyset\,. \end{equation*} \end{lemma} \begin{proof} For $x,y\in X$ let $d_M(x,y)$ be the infimum of the diameters, with respect to~$d$, of the compact connected sets which contain $x$ and~$y$. By Lemma~\ref{lem:continua}\ref{it:continua} for the ball $B(x,2d(x,y))$, \begin{equation*} d\le d_M\le4\Lambda\,d\,. \end{equation*} Hence $d_M$ is a distance which induces the topology of~$X$, the space $(X,d_M)$ is complete, and $m$ is doubling on $(X,d_M)$ with a structural constant. A compact connected set has the same diameter for $d$ and for $d_M$; therefore $d_M$ coincides with the distance obtained from it by the same procedure. This is the assumption of~\cite[Section~3]{LahtiStrong}, and~\cite[Corollary~3.8]{LahtiStrong} states the following: there is $\beta_0>0$, depending only on the doubling constant, such that if a ball $B_M$ of $(X,d_M)$ satisfies $00$. Since $B\subset B_{d_M}(x,4\Lambda R)$, the latter ball contains parts of positive measure of $E$ and of $X\setminus E$, and we obtain a point $w\in B_{d_M}(x,36\Lambda R)\subset B(x,36\Lambda R)$ as above. Since $B(w,r/(4\Lambda))\subset B_{d_M}(w,r)\subset B(w,r)$, \eqref{eq:dbl} gives $m(B_{d_M}(w,r))\ge c\,m(B(w,r))$, and therefore $w\in\Sigma_\gamma(E)$ with a structural $\gamma>0$. This proves the lemma with $L=36\Lambda$. \end{proof} A first consequence is that the exponent~$\lambda$ can never exceed an exponent~$Q$ of~\eqref{eq:decay}, as announced in Section~\ref{sec:twohyp}. \begin{remark}[The exponents $Q$ and $\lambda$]\label{rem:Qlambda} Assume~\hP{} and~\hC. Then every exponent $Q$ for which~\eqref{eq:decay} holds satisfies $Q\ge\lambda$; in particular $\lambda\le Q$ if $m$ is Ahlfors regular of dimension~$Q$. Indeed, choose distinct points $x,y\in X$ with $2d(x,y)\le D$ and $R>0$ with $MR\le d(x,y)/2$, and let $G$ be given by~\hC{} for $B(x,R)$. Then $\Per(G)<\infty$, and $v_B(G)>0$ for the ball $B=B(x,2d(x,y))$, as in the proof of Proposition~\ref{prop:unique}. Let $w\in\Sigma_\gamma(G)$ be a point given by Lemma~\ref{lem:strongpoint}. For all sufficiently small $t>0$ we have $v_{B(w,t)}(G)\ge\frac12\gamma\,m(B(w,t))$, and~\eqref{eq:indicator2} and~\hP{} give, as in~\eqref{eq:stopping}, \begin{equation*} \tfrac12\gamma\,m(B(w,t))\le C_P\,\Big(\frac th\Big)^{\lambda}J_h(\ind_G)\qquad\text{for }00$ independent of~$t$. Letting $t\downarrow0$ we get $Q\ge\lambda$. The same argument shows that $\limsup_{t\downarrow0}\xi_\lambda(B(w,t))\le C\Per(E)$ at every point $w\in\Sigma_\gamma(E)$, for every measurable set~$E$. \end{remark} When~\eqref{eq:decay} holds with $Q=\lambda$, the gauge $\xi_\lambda(B(x,r))$ does not tend to zero as $r\downarrow0$, so that every point has positive $\Hcod\lambda$-measure. A single point of $\Sigma_\gamma(E)$ in a dilated ball is then enough for the inequality~\eqref{eq:weakcontent}, with the exponent $\alpha=0$, and no content estimate is needed. \begin{proposition}\label{prop:endpoint} Assume~\hP, suppose that~\eqref{eq:decay} holds with $Q=\lambda$, and let $\gamma$ be the constant of Lemma~\ref{lem:strongpoint}. For every measurable set $E\subset X$, \begin{equation*} C^{-1}\,\Hcod\lambda(\partial^*E)\le\Per(E)\le C\,\Hcod\lambda(\Sigma_\gamma(E))\,. \end{equation*} If $\Per(E)<\infty$, then $\partial^*E=\Sigma_\gamma(E)$, and $\#(\partial^*E\cap B)\le C\,R^{\lambda}\,m(B)^{-1}\Per(E)$ for every ball $B$ of radius~$R$. \end{proposition} \begin{proof} \emph{Step 1: points have positive measure.} Let $B=B(x,R)$ be a ball. We claim that \begin{equation}\label{eq:pointmass} \Hcod\lambda(S)\ge c\,\xi_\lambda(B)\ \#S\qquad\text{for every }S\subset B\,. \end{equation} It suffices to consider a finite set~$S$. Let $0<\delta\le R$ be smaller than half the least distance between two distinct points of~$S$, and let $B(a,\rho)$ be a ball of radius $\rho\le\delta$ which meets~$S$. It contains exactly one point of~$S$. Moreover $a\in2B$ and $\rho\le2R$, so that~\eqref{eq:decay} with $Q=\lambda$ gives $m(B(a,\rho))\ge c_Q\,(\rho/2R)^{\lambda}\,m(2B)$, that is, $\xi_\lambda(B(a,\rho))\ge c_Q\,2^{-\lambda}\,\xi_\lambda(B)$. Hence a covering of $S$ by balls of radii at most~$\delta$ has cost at least $c_Q\,2^{-\lambda}\,\xi_\lambda(B)\,\#S$, and~\eqref{eq:pointmass} follows from $\Hcod\lambda\ge\Hcod\lambda_\delta$. \emph{Step 2: hypothesis~\eqref{eq:weakcontent}.} Let $L$ be the constant of Lemma~\ref{lem:strongpoint}, and let $B$ be a ball of radius $R\le D$ with $v_B(E)>0$. By that lemma the set $\Sigma_\gamma(E)\cap LB$ is not empty, and~\eqref{eq:pointmass} for the ball $LB$ gives \begin{equation*} \Hcod\lambda\big(\Sigma_\gamma(E)\cap LB\big)\ge c\,\xi_\lambda(LB)\ge c\,L^{-\lambda}\,\frac{m(B)}{R^{\lambda}}\,. \end{equation*} Thus~\eqref{eq:weakcontent} holds with $\alpha=0$, $R_0=D$ and $\mathcal S=\Sigma_\gamma(E)$, which is a Borel subset of $D_\gamma(E)$ by Lemma~\ref{lem:borel}. \emph{Step 3: conclusion.} The two inequalities follow from Proposition~\ref{prop:comparison}\ref{it:comp-both}. If $\Per(E)<\infty$, the same proposition gives $\Hcod\lambda(\partial^*E\setminus\Sigma_\gamma(E))=0$; by~\eqref{eq:pointmass} this set is empty, and for every ball $B$ of radius~$R$ \begin{equation*} c\,\xi_\lambda(B)\ \#(\partial^*E\cap B)\le\Hcod\lambda(\partial^*E)\le C\Per(E)\,.\qedhere \end{equation*} \end{proof} Theorem~\ref{th:federer}\ref{it:fed-zero} is Proposition~\ref{prop:endpoint}. If~\eqref{eq:decay} holds with $Q=\lambda$, then $\xi_\lambda(B(x,r))\ge c_Q\,\xi_\lambda(B(x,R))$ for $00$ let \begin{equation*} M_r^\eta(E)=\{x\in X:\ \vartheta_E(x,r)\ge\eta\}=\{x\in X:\ \eta\le\theta_E(x,r)\le1-\eta\}\,, \end{equation*} which is Borel by Lemma~\ref{lem:borel}. Eriksson-Bique uses the corresponding family of balls in his Hausdorff content proof of Federer's theorem~\cite[Section~6]{EB}. The set $M_r^\eta(E)$ is the boundary of~$E$ as it is seen at the resolution~$r$. In $\R^n$, for a bounded set with smooth boundary, for $\eta<\frac12$ and for small~$r$, it is a neighbourhood of $\partial E$ of width comparable to~$r$, and its measure is comparable to $r\,\Hc^{n-1}(\partial E)$. For sufficiently small~$\eta$, the next theorem compares the perimeter with the lower limit of $r^{-\lambda}m(M_r^\eta(E))$ as $r\downarrow0$. It gives an upper bound for $r^{-\lambda}m(M_r^\eta(E))$ for all $00$ such that, for every measurable $E\subset X$ and every $0<\eta\le(2C_d^2)^{-1}$, \begin{equation*} c\Per(E)\le \liminf_{r\downarrow0}\frac{m(M_r^\eta(E))}{r^\lambda} \le \sup_{00$ let \begin{equation*} u_h(x)= \begin{cases} 1&\text{if }m(E\cap B(x,h))\ge\tfrac12\,m(B(x,h))\,,\\ 0&\text{otherwise.} \end{cases} \end{equation*} This is a Borel function by Lemma~\ref{lem:borel}. By the Lebesgue differentiation theorem, $\theta_E(x,h)\to\ind_E(x)$ as $h\downarrow0$ for almost every~$x$, hence $u_h\to\ind_E$ almost everywhere. \emph{Step 2: the energy of $u_h$.} Let $0<\eta\le(2C_d^{\,2})^{-1}$. We claim that \begin{equation*} J_h(u_h)\le2\,m\big(M_{2h}^\eta(E)\big)\qquad\text{for every }h>0\,. \end{equation*} Let $d(x,y)0$ when $Q=\lambda$, \begin{equation*} \eta^{1-\lambda/Q}\,m(B_i)\le m(B_i)\,\Big(\frac{v_{B_i}(E)}{m(B_i)}\Big)^{1-\lambda/Q}\le C\,r^\lambda\Per\big(E;(1+2\Lambda)B_i\big)\,. \end{equation*} By Lemma~\ref{lem:nets}\ref{it:packing}, each point of~$X$ belongs to at most $\kappa(1+2\Lambda)$ of the balls $(1+2\Lambda)B_i$. For every $h>0$, Lemma~\ref{lem:Jbasic}\ref{it:Jsuper} gives $\sum_iJ_h(\ind_E;(1+2\Lambda)B_i)\le\kappa(1+2\Lambda)\,J_h(\ind_E)$, and Fatou's lemma for sums gives \begin{equation*} \sum_i\Per\big(E;(1+2\Lambda)B_i\big)\le\liminf_{h\downarrow0}\sum_i\frac{J_h(\ind_E;(1+2\Lambda)B_i)}{h^\lambda}\le\kappa(1+2\Lambda)\Per(E)\,. \end{equation*} Summing over~$i$ we get $\eta^{1-\lambda/Q}\,m(M_r^\eta(E))\le\eta^{1-\lambda/Q}\sum_im(B_i)\le C\,r^\lambda\Per(E)$. \end{proof} The dependence on $\eta$ is sharp already in $\R^n$. Take $E=B(0,1)$ and $r=(2\eta)^{-1/n}\ge2$. For $x\in B(0,r/2)$ the ball $B(x,r)$ contains $E$ up to a null set, so that its proportion in $E$ is $2\eta$. Thus $r^{-1}m(M_r^\eta(E))\ge c_n\eta^{-(1-1/n)}$ for all sufficiently small $\eta$. Integrating over the level sets of a function, we obtain a description of the variation by a difference of quantiles. For a ball~$B$, the number $\omega_\eta(f;B)$ defined below is the length of the set of the levels~$t$ such that both $\{f>t\}$ and $\{f\le t\}$ fill a proportion at least~$\eta$ of~$B$; it is the distance between the quantiles of order $\eta$ and $1-\eta$ of~$f$ on~$B$. \begin{corollary}\label{cor:quantile} For a real-valued $f\in L^1_{\mathrm{loc}}(X,m)$ and a ball $B$, let \begin{equation*} \omega_\eta(f;B)=\mathcal L^1\bigl(\{t\in\R: \min\{m(B\cap\{f>t\}),m(B\cap\{f\le t\})\}\ge\eta m(B)\}\bigr). \end{equation*} Under the hypotheses and in the range of $\eta$ of Theorem~\ref{th:mixed}, \begin{align*} c\Var(f)&\le \liminf_{r\downarrow0} r^{-\lambda}\int_X\omega_\eta(f;B(x,r))\,dm(x)\\ &\le \sup_{0t\}$. For a ball $B=B(x,r)$, the level~$t$ is counted in $\omega_\eta(f;B)$ if and only if $\vartheta_{E_t}(x,r)\ge\eta$, that is, $x\in M_r^\eta(E_t)$. The function $(x,t)\mapsto\vartheta_{E_t}(x,r)$ is Borel on $X\times\R$ by Tonelli's theorem, as in the proof of Lemma~\ref{lem:sections}\ref{it:sec-borel} below. Hence, by Tonelli's theorem and by the identity $|a-b|=\int_\R|\ind_{\{a>t\}}-\ind_{\{b>t\}}|\,dt$, \begin{equation*} \int_X\omega_\eta(f;B(x,r))\,dm(x)=\int_\R m(M_r^\eta(E_t))\,dt\,, \qquad J_r(f)=\int_\R J_r(\ind_{E_t})\,dt\,. \end{equation*} \emph{Lower bound.} Let $r_i\downarrow0$ be a sequence along which $r_i^{-\lambda}\int_X\omega_\eta(f;B(x,r_i))\,dm(x)$ converges to its lower limit as $r\downarrow0$. For $01$ such that, for every $x\in X$ and $00$, so $m(\partial G)=0$. Replacing $G$ by its interior preserves its indicator almost everywhere and its two inclusions, and $\partial(\interior G)\subset\partial G$. For $\lambda=1$ hypothesis~\hCp{} holds in every space satisfying the standing assumptions, and the sets $G$ are balls (Proposition~\ref{prop:balls}). On the carpet, the sponge and the gasket the sets $G$ are finite unions of rectangles, boxes and cells, and~\hCp{} holds; see Chapters~\ref{sec:carpet} to~\ref{sec:gasket}. \begin{theorem}\label{th:approx} Assume~\hP{} and~\hCp, and let $E\subset X$ be measurable. \begin{enumerate}[label=\textup{(\roman*)}] \item\label{it:approx} Suppose that $\Per(E)<\infty$. For every $0u\}\big)\,du\,. \end{equation*} \begin{theorem}\label{th:measures} Assume~\hP, and let $f\in L^1_{\mathrm{loc}}(X,m)$ with $\Var(f)<\infty$. \begin{enumerate}[label=\textup{(\roman*)}] \item\label{it:meas-exist} BV measures of~$f$ exist. Every BV measure $\mu$ of~$f$ satisfies $\Var(f)\le\mu(X)\le C\Var(f)$, there is one with $\mu(X)=\Var(f)$, and any two BV measures $\mu,\mu'$ of~$f$ satisfy $\mu\le C\mu'$. In the order of finite Borel measures, $\mu_f^-$ is their greatest lower bound and $\mu_f^+$ their least upper bound. For $g\in L^1_{\mathrm{loc}}(X,m)$ of finite variation, \begin{equation*} \mu_{f+g}^+\le\mu_f^++\mu_g^+\,. \end{equation*} \item\label{it:meas-local} Let $\mu$ be a BV measure of~$f$. For every ball $B$ of radius $R\le4D$, \begin{equation*} \int_B|f-f_B|\,dm\le C\,R^{\lambda}\,\mu(2\Lambda B)\,. \end{equation*} If $U\subset X$ is open, $f_k\in L^1_{\mathrm{loc}}(X,m)$ with $\Var(f_k)<\infty$, $f_k\to f$ in $L^1(K,m)$ for every compact set $K\subset U$, and $\mu_k$ is a BV measure of~$f_k$, then $\mu(U)\le C\liminf_k\mu_k(U)$. \item\label{it:meas-coarea} If~\hC{} holds, or if~\eqref{eq:decay} holds with $Q=\lambda$, then $\nu_f$ is a finite Borel measure, and every BV measure $\mu$ of~$f$ satisfies \begin{equation*} C^{-1}\,\nu_f(A)\le\mu(A)\le C\,\nu_f(A)\qquad\text{for every Borel set }A\subset X\,. \end{equation*} In particular, if $\Per(E)<\infty$, every BV measure of $\ind_E$ is comparable to $\Hcod\lambda\llcorner\partial^*E$; and $\mu(A)=0$ for every Borel set $A$ with $\Hcod\lambda(A)=0$. \end{enumerate} \end{theorem} The energy measures $m_{r,f}$ converge weakly as $r\downarrow0$ precisely when $\mu_f^-=\mu_f^+$ (Proposition~\ref{tri:envelope}). Part~\ref{it:meas-coarea} compares these extremal measures with the integral of the boundary measures of the level sets. Proposition~\ref{prop:coareajump} identifies the restriction of $\nu_f$ to every Borel set of $\sigma$-finite $\Hcod\lambda$-measure. The local inequalities of Theorem~\ref{th:isop} hold with a BV measure on the right-hand side (Corollary~\ref{cor:localineq}). \paragraph{Why three constructions.} The BV measures are the most direct objects, but a function may have several of them, because the normalized energies oscillate with the scale (Remark~\ref{rem:unique}). The measures $\mu_f^-$ and $\mu_f^+$ are canonical: they do not depend on a choice of scales, they bound all the BV measures from below and from above, and they are themselves comparable. The coarea measure is geometric: it is built from the measure-theoretic boundaries of the superlevel sets, without any limit of energies. The theorem says that, up to constants, the three constructions give the same measure: \begin{equation*} C^{-1}\,\mu_f^+\le\mu_f^-\le\mu\le\mu_f^+\qquad\text{and}\qquad C^{-1}\,\nu_f\le\mu\le C\,\nu_f\,. \end{equation*} \paragraph{A fourth measure.} For all these measures the lower semicontinuity on open sets is known only up to a constant (Proposition~\ref{prop:quasilsc}). Under~\hP{} and~\hC, the lower semicontinuous envelope of the coarea measure is again a measure, the relaxed coarea measure $\overline\nu_f$. It is comparable to the three others, it satisfies the coarea formula, and it is lower semicontinuous on open sets and subadditive with the constant one (Theorem~\ref{th:relaxed}). The price is that it is no longer related to the energies by a limit, and that it depends on the gauge which defines the Hausdorff measure (Remark~\ref{rem:rel-limits}). \begin{example}[The real line]\label{ex:line-measures} In the setting of Example~\ref{ex:line}, let $f=\ind_E$ with $E=(-\infty,0)$ and $\lambda=1$. The measure $m_{r,f}$ has mass $r^{-1}J_r(f)=\frac12$ and is carried by the interval $(-r,r)$. Hence $m_{r,f}$ converges to $\frac12\delta_0$ as $r\downarrow0$, and $f$ has a unique BV measure. On the other hand every ball has the cost $\xi_1(B(x,r))=2$, so that $\Hcod1(\{0\})=2$ and $\nu_f=2\,\delta_0$. The two measures are comparable and not equal: the comparison of Theorem~\ref{th:measures}\ref{it:meas-coarea} holds up to constants only. \end{example} \paragraph{Plan.} Throughout the chapter we write $E_u=\{f>u\}$ for the superlevel sets of a function~$f$. Sections~\ref{sec:whitney} and~\ref{sec:caratheodory} contain the measure-theoretic tools and the construction of $\mu_f^\pm$. Section~\ref{sec:clusters} proves the existence and the comparability of the BV measures, and Section~\ref{sec:extremal} identifies $\mu_f^-$ and $\mu_f^+$ as their extremal bounds. Section~\ref{sec:coareameasure} treats the coarea measure; its first step, the measurability of the Hausdorff measures of the boundaries with respect to the level, is the most technical point of the chapter. Section~\ref{sec:localineq} contains the local inequalities and the lower semicontinuity. Section~\ref{sec:measures-remarks} treats uniqueness, averages over scales and the relaxation of the variation. Section~\ref{sec:relaxed} constructs the relaxed coarea measure. \section{Whitney coverings and comparison of measures}\label{sec:whitney} Two measures which satisfy an inequality on balls, with a dilation, satisfy the same inequality on all Borel sets. This is proved by covering an open set with small balls whose dilates stay inside the set and have bounded overlap. \begin{lemma}[Whitney covering]\label{lem:whitney} Let $U\subset X$ be a non-empty open set, $\delta>0$ and $L\ge1$. There are countably many balls $B_j=B(x_j,\rho_j)$ with $\rho_j\le\delta$ such that \begin{equation*} U=\bigcup_jB_j\,,\qquad\overline{LB_j}\ \text{ is a compact subset of }U\,, \end{equation*} and each point of $X$ belongs to at most $\kappa_W(L)=\kappa(15L)$ of the balls $LB_j$. \end{lemma} \begin{proof} For $x\in U$ let $t(x)=\min\{\delta,\dist(x,X\setminus U)\}$, with $t(x)=\delta$ if $U=X$, and $\rho(x)=t(x)/(10L)$. The function $t$ is $1$-Lipschitz. By the covering lemma there are countably many points $x_j\in U$ such that the balls $B(x_j,\rho(x_j))$ are pairwise disjoint and the balls $B_j=B(x_j,\rho_j)$ with $\rho_j=5\rho(x_j)$ cover~$U$. We have $\rho_j\le\delta$, and $\overline{LB_j}$ is contained in the closed ball of centre $x_j$ and radius $t(x_j)/2$, which is compact and contained in~$U$. Let $y\in X$, and let $i$ be an index with $y\in LB_i$. Then $d(y,x_i)0$ such that \begin{equation*} \alpha(B)\le A\,\beta(LB)\qquad\text{for every ball }B\text{ of radius at most }\delta_0\,. \end{equation*} Then $\alpha(S)\le A\,\kappa_W(L)\,\beta(S)$ for every Borel set $S\subset X$. \end{lemma} \begin{proof} Let $U\supset S$ be open, and let $(B_j)$ be the covering of Lemma~\ref{lem:whitney} with $\delta=\delta_0$. Then \begin{equation*} \alpha(S)\le\alpha(U)\le\sum_j\alpha(B_j)\le A\sum_j\beta(LB_j)\le A\,\kappa_W(L)\,\beta(U)\,, \end{equation*} and $\beta(S)$ is the infimum of $\beta(U)$ over these open sets, because a finite Borel measure on a metric space is outer regular. \end{proof} The proofs of the two lemmas use only the covering lemma and Lemma~\ref{lem:nets}\ref{it:packing}. They hold therefore, with other constants, in every proper metric space which carries a doubling measure. We shall use them also in the space $X\times\R$ with the distance $\max\{d(x,x'),|u-u'|\}$ and the measure $m\otimes\mathcal L^1$, which is proper and doubling with the constant $2C_d$; its balls are the products $B(x,\rho)\times(u-\rho,u+\rho)$. \section{Carath\'eodory's construction}\label{sec:caratheodory} For a measurable set $W\subset X$ let \begin{equation*} \Var^+(f;W)=\limsup_{r\downarrow0}\frac{J_r(f;W)}{r^{\lambda}}\,,\qquad\text{so that}\quad\Var(f;W)\le\Var^+(f;W)\,. \end{equation*} For an indicator, $\Var^+(\ind_E;W)$ is the upper perimeter $\Per^+(E;W)$ of Section~\ref{sec:onescale}. For $A\subset X$ and $\delta>0$ let $\mu^+_{f,\delta}(A)$ be the infimum of the sums $\sum_i\Var^+(f;U_i)$ over the countable coverings of~$A$ by open sets $U_i$ of diameter at most~$\delta$, and let \begin{equation*} \mu_f^+(A)=\lim_{\delta\downarrow0}\mu^+_{f,\delta}(A)=\sup_{\delta>0}\mu^+_{f,\delta}(A)\,. \end{equation*} Define $\mu_{f,\delta}^-$ and $\mu_f^-$ by the same construction using $\Var(f;U_i)$ in place of $\Var^+(f;U_i)$. Both constructions give metric outer measures and hence Borel regular measures, by~\cite[Theorem~4.2]{Mat}. They are defined for every $f\in L^1_{\mathrm{loc}}(X,m)$ and satisfy $\mu_f^-\le\mu_f^+$. The local energies $U\mapsto\Var^+(f;U)$ are not additive, and Carath\'eodory's construction is the standard way to extract a measure from them: the measure of a set is the smallest total cost of its coverings by small open sets. The next proposition shows that, under~\hP, nothing essential is lost: the resulting measure is comparable to the costs from which it was built. \begin{proposition}\label{prop:caratheodory} Let $f\in L^1_{\mathrm{loc}}(X,m)$. \begin{enumerate}[label=\textup{(\roman*)}] \item\label{it:car-local} $\mu^+_{cf}=|c|\,\mu_f^+$ for $c\in\R$. If $g\in L^1_{\mathrm{loc}}(X,m)$ and $f=g$ almost everywhere on an open set~$U$, then $\mu_f^+(A)=\mu_g^+(A)$ for every $A\subset U$; in particular $\mu_f^+(U)=0$ if $f$ is almost everywhere constant on~$U$. \item\label{it:car-upper} Assume~\hP. For every open set $U\subset X$, \begin{equation*} \mu_f^+(U)\le C\Var(f;U)\,. \end{equation*} \item\label{tri:local} For every measurable $W$ with compact closure, $\Var^+(f;W)\le\mu_f^+(\overline W)$. \item\label{it:car-lower} Assume~\hP. For every measurable set $W\subset X$ and $00$, and let $(B_j)$ be the covering of~$U$ given by Lemma~\ref{lem:whitney} with $L=2$ and with $\delta/2$ in place of~$\delta$, so that $B_j=B(x_j,\rho_j)$ has diameter at most~$\delta$. For $01$. The set $B(X\setminus B(x_0,\rho),r)$ is contained in $W_\rho=X\setminus\overline{B(x_0,\rho-1)}$, and $\overline{B(W_\rho,3\Lambda r)}$ is contained in $X\setminus B(x_0,\rho-1-3\Lambda)$. By~\eqref{eq:mrf} and~\eqref{eq:car-lower}, \begin{equation}\label{eq:tight} m_{r,f}\big(X\setminus B(x_0,\rho)\big)\le r^{-\lambda}J_r(f;W_\rho)\le C\,\mu_f^+\big(X\setminus B(x_0,\rho-1-3\Lambda)\big)\,, \end{equation} and the right-hand side tends to zero as $\rho\to\infty$, uniformly in~$r$. \emph{Limits.} The measures $m_{r_k,f}$ have total mass at most $S_\lambda(f)$, and $X$ is a proper metric space. Hence a subsequence converges, in the sense of Definition~\ref{def:bvmeasure}, to a finite Borel measure~$\mu$. By~\eqref{eq:tight} the convergence holds for every bounded continuous function~$\varphi$. For $\varphi=1$ we get $\mu(X)=\lim_km_{r_k,f}(X)=\lim_kr_k^{-\lambda}J_{r_k}(f)$ along the subsequence, and this number lies between $\Var(f)$ and $S_\lambda(f)$. The same argument applies to the sequence of an arbitrary BV measure. For the last assertion we start from a sequence with $r_k^{-\lambda}J_{r_k}(f)\to\Var(f)$. \ref{it:bvm-compare} Let $m_{r_k,f}\rightharpoonup\mu$ and let $U$ be open. If $0\le\varphi\le1$ is continuous with compact support in $U$, every pair contributing to $\int\varphi\,dm_{r_k,f}$ belongs to $U^2$ for all large $k$. Taking the supremum over $\varphi$ gives \begin{equation}\label{tri:withinopen} \mu(U)\le \liminf_{k\to\infty}r_k^{-\lambda}J_{r_k}(f;U)\le\Var^+(f;U). \end{equation} Applying this to open covers gives $\mu\le\mu_f^+$. Conversely, for a ball $B$, Proposition~\ref{prop:caratheodory}\ref{it:car-upper},~\eqref{eq:mrf} and the compact-set inequality for weak convergence give \[ \mu_f^+(B)\le C\Var(f;B) \le C\limsup_k m_{r_k,f}(\overline B)\le C\mu(\overline B). \] Lemma~\ref{lem:compare} now gives $\mu_f^+\le C\mu$. \ref{it:bvm-local} This follows from~\ref{it:bvm-compare} and Proposition~\ref{prop:caratheodory}\ref{it:car-upper} and~\ref{it:car-lower}. \end{proof} \section{The extremal measures}\label{sec:extremal} Theorem~\ref{th:bvmeasures} shows that $\mu_f^+$ is an upper bound of all the BV measures of~$f$. We now show that it is the smallest one, and that $\mu_f^-$ is the largest lower bound. \begin{proposition}\label{tri:envelope} Assume~\hP{} and $\Var(f)<\infty$. Among finite Borel measures, $\mu_f^-$ is the greatest lower bound and $\mu_f^+$ the least upper bound of all BV measures of~$f$. In particular, \[ C^{-1}\mu_f^+\le\mu_f^-\le\mu\le\mu_f^+ \qquad\text{for every BV measure $\mu$ of $f$.} \] The measures $m_{r,f}$ converge weakly as $r\downarrow0$ if and only if $\mu_f^-=\mu_f^+$. \end{proposition} \begin{proof} By Proposition~\ref{prop:caratheodory}\ref{it:car-mass}, $\mu_f^+$ is a finite measure, and so is $\mu_f^-\le\mu_f^+$. \emph{Step 1: a comparison principle for Carath\'eodory's construction.} Let $b$ be one of the two cost functions $U\mapsto\Var^+(f;U)$ and $U\mapsto\Var(f;U)$, and let $\beta$ be the corresponding measure $\mu_f^+$ or $\mu_f^-$. We claim: if $\sigma$ is a finite Borel measure with \begin{equation*} b(V)\le\sigma(\overline V)\qquad\text{for every bounded open set }V\subset X\,, \end{equation*} then $\beta\le\sigma$. Let $O\subset X$ be open and $\delta>0$. For each centre~$x$ the spheres $\{y:\ d(x,y)=\rho\}$, $\rho>0$, are pairwise disjoint, so at most countably many of them have positive measure for the finite measure $\sigma+\beta$. Hence $O$ is covered by countably many balls $B_i$ with $\overline{B_i}\subset O$, $\diam B_i<\delta$ and $(\sigma+\beta)(\partial B_i)=0$. The open sets \begin{equation*} V_i=B_i\setminus\bigcup_{j0$. The function $(x,u,y)\mapsto\ind_{\{f(y)>u\}}\ind_{\{d(x,y)0$. We claim that $u\mapsto\Hcod\lambda_\delta(K_u)$ is upper semicontinuous. Let $u_0\in\R$ and $a>\Hcod\lambda_\delta(K_{u_0})$. The compact set $K_{u_0}$ is covered by finitely many balls of radii at most~$\delta$ and of total cost less than~$a$; let $O$ be their union. If $u_i\to u_0$ and $x_i\in K_{u_i}\setminus O$, a subsequence of $(x_i)$ converges to a point of $K_{u_0}\setminus O$, which is empty. Hence $K_u\subset O$, and $\Hcod\lambda_\delta(K_u)t\}\text{ has density zero at }x\}. \end{align*} These extended real functions are Borel, since the supremum and infimum can be taken over rational $t$ and the densities are Borel by Lemma~\ref{lem:borel}. Their values satisfy $f^\wedge\le f^\vee$. Let $J_f=\{f^\wedgeu\}$ have positive upper density at~$x$. If $uf^\vee(x)$, one phase has density zero. Thus $\{u:x\in\partial^*E_u\}$ agrees with $(f^\wedge(x),f^\vee(x))$ up to at most its two endpoints. By finiteness of $\nu_f(X)$, there is a countable dense set of levels $u$ with $\Hcod\lambda(\partial^*E_u)<\infty$. The corresponding boundaries cover $J_f$. This level-set description is also used in~\cite[Proposition~5.2]{AMP}. On $A\times\R$ the measures $\Hcod\lambda\llcorner A$ and $\mathcal L^1$ are $\sigma$-finite. Applying Tonelli's theorem to the indicator of the Borel set $\{(x,u):x\in\partial^*E_u\}$ of Lemma~\ref{lem:sections}\ref{it:sec-borel} and integrating first in $u$ gives~\eqref{eq:coareajump}. The interval in the integrand is empty if the two approximate limits are equal, including when both are infinite. \end{proof} Under the hypotheses of Proposition~\ref{prop:coareajump}, a continuous $f$ has $J_f=\emptyset$. Hence a nonconstant continuous function of finite variation has a nonzero coarea measure which vanishes on every Borel set of $\sigma$-finite $\Hcod\lambda$-measure. Nonvanishing follows from Theorem~\ref{th:coareameasure} and Corollary~\ref{cor:wm}\ref{it:rigidity}. Proposition~\ref{prop:carpetcontinuous} supplies such functions on the carpets $F_{b,a}$ with $a\ge3$. \section{Local inequalities and lower semicontinuity}\label{sec:localineq} The inequalities of Chapters~\ref{sec:wm} and~\ref{sec:bv} hold with a BV measure on the right-hand side. \begin{corollary}\label{cor:localineq} Assume~\hP. Let $f\in L^1_{\mathrm{loc}}(X,m)$ with $\Var(f)<\infty$, and let $\mu$ be a BV measure of~$f$, or $\mu=\mu_f^\pm$, or $\mu=\nu_f$ if the boundary content inequality holds. \begin{enumerate}[label=\textup{(\roman*)}] \item\label{it:li-poincare} For every ball $B$ of radius $R\le4D$, \begin{equation*} \int_B|f-f_B|\,dm\le C\,R^{\lambda}\,\mu(2\Lambda B)\,. \end{equation*} \item\label{it:li-sobolev} For every ball $B$ of radius $R\le2D$ and every median $b$ of $f$ on~$B$, with $B''=(2+4\Lambda)B$, \begin{equation*} \frac{\|f-b\|_{L^{q,1}(B)}}{m(B)^{1/q}}\le C\,\frac{R^{\lambda}}{m(B)}\,\mu(B'')\,. \end{equation*} In particular, if $f=\ind_E$, then $\big(v_B(E)/m(B)\big)^{1-\frac\lambda Q}\le C\,R^{\lambda}\,m(B)^{-1}\,\mu(B'')$. \end{enumerate} \end{corollary} \begin{proof} By Theorem~\ref{th:bvmeasures} and Propositions~\ref{tri:envelope} and~\ref{prop:caratheodory}\ref{it:car-lower}, and by Theorem~\ref{th:coareameasure}\ref{it:cm-compare} in the case of~$\nu_f$, every ball $B_1$ satisfies $\Var(f;B_1)\le\Var^+(f;B_1)\le C\,\mu(\overline{B_1})\le C\,\mu(2B_1)$. We apply this to $B_1=\Lambda B$ in Corollary~\ref{cor:wm}\ref{it:wmpoincare} and to $B_1=(1+2\Lambda)B$ in Theorem~\ref{th:isop}\ref{it:isop-local}. \end{proof} The functional $S_\lambda$ is lower semicontinuous in $L^1$, and so is the variation, up to a constant. The next proposition is the local version of this fact: the measure $\mu_f^+$ of an open set is lower semicontinuous, up to a constant, with respect to convergence in $L^1$ on the compact subsets of this set. \begin{proposition}[Lower semicontinuity up to a constant]\label{prop:quasilsc} Assume~\hP. Let $U\subset X$ be open, and let $f,f_k\in L^1_{\mathrm{loc}}(X,m)$ be such that $\|f_k-f\|_{L^1(K)}\to0$ for every compact set $K\subset U$. Then \begin{equation*} \mu_f^+(U)\le C\liminf_{k\to\infty}\mu_{f_k}^+(U)\,. \end{equation*} Consequently, if $\Var(f)<\infty$ and $\Var(f_k)<\infty$, and if $\mu$ and $\mu_k$ are BV measures of $f$ and of~$f_k$, then $\mu(U)\le C\liminf_k\mu_k(U)$. \end{proposition} \begin{proof} Let $\delta>0$, and let $(B_j)$ be the covering of~$U$ given by Lemma~\ref{lem:whitney} with $L=3$ and with $\delta/2$ in place of~$\delta$; write $B_j=B(x_j,\rho_j)$. Fix $j$ and $0-3/2\}}$ in Proposition~\ref{prop:phase}, the measure $m_{r,f}$ is carried by $B(-3/2,r)$ and has mass $\tfrac12(1-\epsilon\sin(\log r))$ for all sufficiently small~$r$. Taking radii for which $\sin(\log r)=\pm1$ gives the two BV measures $\tfrac12(1\mp\epsilon)\delta_{-3/2}$. Under~\hP{} Proposition~\ref{tri:envelope} identifies the two extremal measures. Under the boundary content inequality, each is comparable to $\nu_f$ by Theorem~\ref{th:coareameasure}. One may also average over the scales. For $b>1$ the measures \begin{equation*} \overline m_{r,f}=\frac1{\log b}\int_r^{br}m_{t,f}\,\frac{dt}t \end{equation*} satisfy $\inf_{r\le t\le br}t^{-\lambda}J_t(f;W)\le\overline m_{r,f}(W)\le\sup_{r\le t\le br}t^{-\lambda}J_t(f;B(W,br))$. For $r$ sufficiently small that $br\le D$, their masses are uniformly bounded, and~\eqref{eq:tight} gives tightness. Every weak limit lies between $\mu_f^-$ and $\mu_f^+$. Indeed, for $0\le\varphi\in C_c(X)$, all limit points of $\int\varphi\,dm_{t,f}$ as $t\downarrow0$ are integrals against BV measures. Proposition~\ref{tri:envelope} bounds them between $\int\varphi\,d\mu_f^-$ and $\int\varphi\,d\mu_f^+$, and the same bounds hold after averaging. Proposition~\ref{prop:carpetaverage} gives convergence for the centered cut of the compact Sierpi\'nski carpet with $b=3$. Theorem~\ref{gask-exact} gives convergence for every BV function on the compact gasket with $b=2$. \end{remark} \begin{definition}[Relaxation on an open set]\label{rem:relaxation} For $f\in L^1_{\mathrm{loc}}(X,m)$ and an open set $U\subset X$ put \begin{equation*} \mathsf V(f;U)=\inf\left\{\liminf_{k\to\infty}\Var(f_k;U): f_k\in L^1_{\mathrm{loc}}(X,m),\quad f_k\to f\text{ in }L^1_{\mathrm{loc}}(U,m)\right\}. \end{equation*} \end{definition} Under~\hP{}, Propositions~\ref{prop:quasilsc} and~\ref{prop:caratheodory}\ref{it:car-upper} give \begin{equation*} C^{-1}\mu_f^+(U)\le\mathsf V(f;U)\le\Var(f;U). \end{equation*} On disjoint open sets $U_1,U_2$ one has $\mathsf V(f;U_1\cup U_2)\ge\mathsf V(f;U_1)+\mathsf V(f;U_2)$, by superadditivity of $J_r(f;\cdot)$ and the lower limit inequality for sums. For the classical variation obtained by relaxing the integrals of Lipschitz slopes, Miranda proves additivity via the De~Giorgi--Letta criterion~\cite[Theorem~3.4]{Mir}, \cite{DGL}. The two examples below show how strict superadditivity arises for $\mathsf V$. On the compact gasket let $E$ be a first-level cell and $S$ its two boundary junctions. For the disjoint open sets $U_1=E\setminus S$ and $U_2=\SG\setminus E$, Corollary~\ref{cor:gasketrelaxation} gives \begin{equation*} \mathsf V(\ind_E;U_1)=\mathsf V(\ind_E;U_2)=0,\qquad \mathsf V(\ind_E;U_1\cup U_2)=\Per(E)>0. \end{equation*} Indeed $m(S)=0$, so removing $S$ preserves every $J_r$. The gasket proof uses global lower semicontinuity to pass this identity to the relaxation. In the following example the sets are at positive distance, and the obstruction comes from the lower limit over a common radius. \begin{proposition}\label{prop:phase} There is a compact Ahlfors $2$-regular space on the interval $[-3,3]$ satisfying~\hP{} and~\hC{} with $\lambda=2$ for which $\mathsf V(f;\cdot)$ fails to be additive on two positively separated open intervals. On the same space there are $u,v\in BV(X)$ such that \begin{equation*} \Var(u+v)>\Var(u)+\Var(v)=\int_{\R}\Per(\{u+v>t\})\,dt . \end{equation*} \end{proposition} \begin{proof} Put $\epsilon=1/10$ and $h_\pm(r)=r^2(1\pm\epsilon\sin(\log r))$ for $r>0$, with $h_\pm(0)=0$. These functions are increasing and convex, since \begin{align*} h'_\pm(r)&=r\big[2\pm\epsilon(2\sin(\log r)+\cos(\log r))\big],\\ h''_\pm(r)&=2\pm\epsilon(\sin(\log r)+3\cos(\log r)). \end{align*} On the two closed halves of $X=[-3,3]$ use the distances $h_-^{-1}(|x-y|)$ on the left and $h_+^{-1}(|x-y|)$ on the right. The inverses are increasing, concave and zero at zero, hence subadditive. Join the two metrics at zero by taking the sum of the distances to zero for points on opposite halves. Equip $X$ with Lebesgue measure. Its metric is bi-Lipschitz equivalent to $|x-y|^{1/2}$, so $X$ is Ahlfors $2$-regular. On the ordinary Euclidean interval, \hP{} and~\hC{} hold at exponent one by Theorem~\ref{th:classical}. For the metric $|x-y|^{1/2}$, a ball or kernel of radius $r$ is its Euclidean counterpart of radius $r^2$, which gives both hypotheses at exponent two. For a ball with squared radius greater than twice the Euclidean diameter, apply the Euclidean estimate to the whole interval at twice its diameter. Remark~\ref{rem:bilip} transfers the hypotheses to the joined metric. Let $U_-=(-2,-1)$, $U_+=(1,2)$, and write $T_\pm=|Dg|(U_\pm)$ for ordinary distributional variation. For all sufficiently small $r$, on either $U_\pm$ the kernel is \[ (2h_\pm(r))^{-1}\ind_{\{|x-y|0). \] Testing the difference quotients against compactly supported smooth functions on $I$ of supremum norm at most one gives $|Dg|(I)\le\liminf_{t\downarrow0}D_t(g)$. If $|Dg|(I)<\infty$, integrating $|Dg|([x,x+t])$ gives the reverse bound $D_t(g)\le |Dg|(I)$. The Euclidean energy with the displayed kernel of radius $h$, divided by $h$, is $\int_0^1 zD_{hz}(g)\,dz$. It tends to $|Dg|(I)/2$, by dominated convergence for finite variation and by Fatou's lemma for infinite variation. This is the one-dimensional difference-quotient argument underlying D\'avila's formula~\cite{Dav}. Dividing the two contributions by $r^2$ and taking the lower limit gives \begin{align*} \Var(g;U_-\cup U_+) &=\tfrac12\min_{s=\pm1}\big[(1-s\epsilon)T_-+(1+s\epsilon)T_+\big],\\ \Var(g;U_\pm)&=\tfrac12(1-\epsilon)T_\pm . \end{align*} Indeed $h_\pm(r)/r^2=1\pm\epsilon\sin(\log r)$, and each extremum of the sine occurs along a sequence tending to zero. The coefficients are strictly positive. Each linear combination of the variations displayed above is lower semicontinuous in $L^1_{\mathrm{loc}}(U_-\cup U_+)$, as is the minimum of two such functions. Thus the same formulas hold for $\mathsf V$. For $g(x)=x$, the union has relaxed variation $1$ and the sum of the two separate values is $1-\epsilon$. Finally take $u=\ind_{\{x>-3/2\}}$ and $v=\ind_{\{x>3/2\}}$. At sufficiently small radii the left and right jumps contribute $h_-(r)/2$ and $h_+(r)/2$, respectively, to $J_r(u+v)$, by the calculation in Example~\ref{ex:line}. Their sum is $r^2$. The nontrivial superlevel sets of $u+v$ are the two half-intervals, each for a set of levels of length one. Consequently \[ \Var(u+v)=1>1-\epsilon=\Var(u)+\Var(v) =\int_{\R}\Per(\{u+v>t\})\,dt.\qedhere \] \end{proof} \section{The relaxed coarea measure}\label{sec:relaxed} The lower semicontinuity of the measures $\mu_f^\pm$ and $\nu_f$ on open sets is known only up to a constant (Proposition~\ref{prop:quasilsc}), and the relaxation of the localized variation is not a measure (Proposition~\ref{prop:phase}). In this section we relax the coarea measure instead. For sets, this is the lower semicontinuous envelope of $E\mapsto\Hcod\lambda(U\cap\partial^*E)$ on each open set~$U$. It is a measure, because the boundary measures $\Hcod\lambda\llcorner\partial^*E$ are local in a way in which the lower limits $\Per(E;U)$ are not: two sets can be glued along the boundary of a third one, and the gluing is paid by the part of this boundary on which the two sets differ. For functions, the measure is then defined by the coarea formula. It is lower semicontinuous on open sets and subadditive, with the constant one in both cases. Throughout the section we assume~\hP{} and~\hC. A \emph{set of finite perimeter} is a measurable set $E\subset X$ with $\Per(E)<\infty$. By~\eqref{eq:Junion} and Corollary~\ref{cor:wm}\ref{it:wmspatial}, finite unions, finite intersections and complements of sets of finite perimeter have finite perimeter. The boundary content inequality of Definition~\ref{def:bci} holds, and for a set $E$ of finite perimeter we write \begin{equation*} \nu_E=\nu_{\ind_E}=\Hcod\lambda\llcorner\partial^*E\,, \end{equation*} which is a finite Borel measure by Theorem~\ref{th:coareameasure}\ref{it:cm-measure}. For a measurable set $D\subset X$ let \begin{equation*} D^{(0)}=\Big\{x\in X:\ \lim_{r\downarrow0}\theta_D(x,r)=0\Big\} \end{equation*} be the set of the points at which $D$ has density zero. It is a Borel set by Lemma~\ref{lem:borel}\ref{it:borel}, and $X$ is the disjoint union of $D^{(0)}$, $(X\setminus D)^{(0)}$ and $\partial^*D$. If $U\subset X$ is open, we say that $f_k\to f$ in $L^1_{\mathrm{loc}}(U)$ if $\|f_k-f\|_{L^1(K)}\to0$ for every compact set $K\subset U$, and that $E_j\to E$ in $L^1_{\mathrm{loc}}(U)$ if $\ind_{E_j}\to\ind_E$ in $L^1_{\mathrm{loc}}(U)$. \begin{definition}[Relaxation of the coarea measure]\label{def:relaxed} Let $E\subset X$ be a set of finite perimeter. For an open set $U\subset X$ let \begin{equation}\label{eq:relaxed} \overline\nu_E(U)=\inf\Big\{\liminf_{j\to\infty}\Hcod\lambda(U\cap\partial^*E_j):\ E_j\to E\text{ in }L^1_{\mathrm{loc}}(U)\Big\}\,, \end{equation} where the infimum is over the sequences of sets $E_j$ of finite perimeter. \end{definition} The constant sequence gives $\overline\nu_E(U)\le\nu_E(U)<\infty$. Convergence in $L^1_{\mathrm{loc}}(U)$ is defined by a distance, and a diagonal argument shows that the infimum in~\eqref{eq:relaxed} is attained by a sequence $(E_j)$ along which $\Hcod\lambda(U\cap\partial^*E_j)$ converges. We call it a \emph{recovery sequence} for $E$ in~$U$. \begin{theorem}[The relaxed coarea measure]\label{th:relaxed} Assume~\hP{} and~\hC. \begin{enumerate}[label=\textup{(\roman*)}] \item\label{it:rel-measure} \emph{Sets.} For every set $E$ of finite perimeter, the set function $U\mapsto\overline\nu_E(U)$ of~\eqref{eq:relaxed} is the restriction to the open sets of a unique finite Borel measure~$\overline\nu_E$, and \begin{equation*} C^{-1}\,\nu_E\le\overline\nu_E\le\nu_E\,. \end{equation*} Moreover $\overline\nu_{X\setminus E}=\overline\nu_E$, and if two sets $E,F$ of finite perimeter coincide almost everywhere on an open set~$U$, then $\overline\nu_E(A)=\overline\nu_F(A)$ for every Borel set $A\subset U$. \item\label{it:rel-lsc} \emph{Lower semicontinuity and maximality.} Let $U\subset X$ be open. If $E_j$ and $E$ are sets of finite perimeter and $E_j\to E$ in $L^1_{\mathrm{loc}}(U)$, then \begin{equation*} \overline\nu_E(U)\le\liminf_{j\to\infty}\overline\nu_{E_j}(U)\,. \end{equation*} If $E\mapsto\mu_E$ associates with every set of finite perimeter a finite Borel measure in such a way that, for every open set~$U$, $\mu_E(U)\le\nu_E(U)$ and $\mu_E(U)\le\liminf_j\mu_{E_j}(U)$ whenever $E_j\to E$ in $L^1_{\mathrm{loc}}(U)$, then $\mu_E\le\overline\nu_E$ for every~$E$. \item\label{it:rel-sub} \emph{Submodularity.} If $E$ and $F$ are sets of finite perimeter, then \begin{equation*} \overline\nu_{E\cup F}+\overline\nu_{E\cap F}\le\overline\nu_E+\overline\nu_F\,. \end{equation*} \item\label{it:rel-functions} \emph{Functions.} Let $f\in L^1_{\mathrm{loc}}(X,m)$ with $\Var(f)<\infty$. For every Borel set $A\subset X$ the function $u\mapsto\overline\nu_{E_u}(A)$, which is defined for almost every~$u$, is Lebesgue measurable, and \begin{equation*} \overline\nu_f(A)=\int_{\R}\overline\nu_{E_u}(A)\,du \end{equation*} defines a finite Borel measure with $C^{-1}\,\nu_f\le\overline\nu_f\le\nu_f$. It is comparable to every BV measure of~$f$, and $C^{-1}\Var(f)\le\overline\nu_f(X)\le C\Var(f)$. If $U\subset X$ is open, $\Var(f_k)<\infty$ and $f_k\to f$ in $L^1_{\mathrm{loc}}(U)$, then \begin{equation*} \overline\nu_f(U)\le\liminf_{k\to\infty}\overline\nu_{f_k}(U)\,. \end{equation*} If $g\in L^1_{\mathrm{loc}}(X,m)$ with $\Var(g)<\infty$ and $a,b\in\R$, then \begin{equation*} \overline\nu_{f+g}\le\overline\nu_f+\overline\nu_g\,,\qquad\overline\nu_{af+b}=|a|\,\overline\nu_f\,. \end{equation*} \item\label{it:rel-relax} \emph{Relaxation for functions.} Let $f\in L^1_{\mathrm{loc}}(X,m)$ with $\Var(f)<\infty$, and let $U\subset X$ be open. Then \begin{equation*} \overline\nu_f(U)=\inf\Big\{\liminf_{k\to\infty}\nu_{f_k}(U):\ \Var(f_k)<\infty,\ f_k\to f\text{ in }L^1_{\mathrm{loc}}(U)\Big\}\,. \end{equation*} \end{enumerate} \end{theorem} We call $\overline\nu_f$ the \emph{relaxed coarea measure} of~$f$. For an indicator, $\overline\nu_{\ind_E}=\overline\nu_E$. \paragraph{How to read the theorem.} By~\ref{it:rel-functions}, $f\mapsto\overline\nu_f(X)$ is a seminorm on the functions of finite variation which is comparable to $\Var$ and lower semicontinuous in $L^1_{\mathrm{loc}}(X,m)$, and it is the total mass of a measure which satisfies the coarea formula by its definition. The variation has none of these three properties in general: it can fail to be lower semicontinuous in $L^1$ (Example~\ref{ex:strict-relaxation}), it is not subadditive (Proposition~\ref{prop:phase}), and it is not the total mass of a measure which depends locally on the function (Remark~\ref{rem:rel-limits}). By~\ref{it:rel-lsc}, the measure $\overline\nu_E$ is determined by the Hausdorff measure $\Hcod\lambda$: it is the largest lower semicontinuous measure below $\Hcod\lambda\llcorner\partial^*E$. By~\ref{it:rel-relax}, the same relaxation can be performed directly on the coarea measures of functions. \idea The upper bound in~\ref{it:rel-measure} is trivial, and the lower bound is Proposition~\ref{prop:quasilsc}. That $\overline\nu_E$ is a measure follows from the criterion of De~Giorgi and Letta, as for the total variation of Miranda~\cite[Theorem~3.4]{Mir}. There, two approximating sequences $u_j$ and $v_j$ are glued with a Lipschitz cutoff function~$\varphi$, and the cost of the gluing is the integral of $|u_j-v_j|\Lip\varphi$. Here the cutoff function is replaced by a set $G$ given by~\hC, the glued set is $(E_j\cap G)\cup(F_j\setminus G)$, and the cost is the Hausdorff measure of the part of $\partial^*G$ where $D_j=E_j\triangle F_j$ does not have density zero (Lemma~\ref{lem:glue}). Lemma~\ref{lem:cost} bounds this cost by the Hausdorff measure of $\partial^*D_j$ in a neighbourhood, with a constant which does not depend on~$G$. Indeed, at almost every such point the set $D_j$ fills a fixed proportion of arbitrarily small balls, by Theorem~\ref{th:federer}\ref{it:fed-pos}, and a vanishing proportion of the balls of a fixed radius, because $D_j$ tends to the empty set. In between there is a ball in which $D_j$ and its complement both fill a fixed proportion, and the boundary content inequality charges the gauge of this ball to $\partial^*D_j$. Only the sets $D_\eta$ of Theorem~\ref{th:federer} are used, and not the strong boundary of Section~\ref{sec:open}. Finally, the boundaries of $E_j$ and $F_j$ in $N$ disjoint bands have a bounded total measure, so that in one of the bands the cost is at most $C/N$; this is the slicing argument of De~Giorgi. The passage from sets to functions uses the submodularity~\ref{it:rel-sub}: a lower semicontinuous functional which satisfies the coarea formula and is submodular on sets is convex; compare Visintin~\cite{Vis} and Chambolle, Giacomini and Lussardi~\cite[Proposition~3.4]{CGL}. \begin{lemma}[Gluing]\label{lem:glue} Let $E,F,G\subset X$ be measurable, and let $H=(E\cap G)\cup(F\setminus G)$. Then \begin{equation}\label{eq:glue} \partial^*H\subset\big(\partial^*E\setminus G^{(0)}\big)\cup\big(\partial^*F\cap G^{(0)}\big)\cup\big(\partial^*G\setminus(E\triangle F)^{(0)}\big)\,. \end{equation} Moreover the sets $\partial^*(E\cup F)$, $\partial^*(E\cap F)$ and $\partial^*(E\triangle F)$ are contained in $\partial^*E\cup\partial^*F$, and \begin{equation}\label{eq:submod-boundary} \ind_{\partial^*(E\cup F)}+\ind_{\partial^*(E\cap F)}\le\ind_{\partial^*E}+\ind_{\partial^*F}\,. \end{equation} \end{lemma} \begin{proof} If $A,A'\subset X$ are measurable and $x\in(A\triangle A')^{(0)}$, then $\theta_A(x,r)-\theta_{A'}(x,r)\to0$ and $\theta_{X\setminus A}(x,r)-\theta_{X\setminus A'}(x,r)\to0$ as $r\downarrow0$, so that $x\in\partial^*A$ if and only if $x\in\partial^*A'$. Let $x\in\partial^*H$. If $x\in G^{(0)}$, then $x\in\partial^*F$, because $H\triangle F\subset G$. If $x\notin G^{(0)}$ and $x$ belongs to $(X\setminus G)^{(0)}$ or to $(E\triangle F)^{(0)}$, then $x\in\partial^*E$, because $H\triangle E\subset(E\triangle F)\setminus G$. In the remaining case $x$ belongs to none of the sets $G^{(0)}$, $(X\setminus G)^{(0)}$ and $(E\triangle F)^{(0)}$, that is, $x\in\partial^*G\setminus(E\triangle F)^{(0)}$. This proves~\eqref{eq:glue}. Let $x\in\partial^*(E\cup F)$. Since $\theta_{E\cup F}\le\theta_E+\theta_F$, one of the sets $E$, $F$ has positive upper density at~$x$, and both complements have positive upper density at~$x$, because they contain $X\setminus(E\cup F)$. Hence $x\in\partial^*E\cup\partial^*F$. Since $\partial^*(X\setminus A)=\partial^*A$, the same holds for $E\cap F=X\setminus\big((X\setminus E)\cup(X\setminus F)\big)$, and for $E\triangle F=(E\setminus F)\cup(F\setminus E)$. If $x$ belongs to both $\partial^*(E\cup F)$ and $\partial^*(E\cap F)$, then $E\cap F$ and $X\setminus(E\cup F)$ have positive upper density at~$x$, so that $x\in\partial^*E\cap\partial^*F$. This proves~\eqref{eq:submod-boundary}. \end{proof} \begin{lemma}[Sets of finite perimeter around a compact set]\label{lem:interface} Let $K\subset X$ be compact and let $O\supset K$ be open. There are a set $G$ of finite perimeter, an open set $O'\supset K$ and a compact set $K'\subset O$ such that $m(O'\setminus G)=0$ and $m(G\setminus K')=0$. Consequently \begin{equation*} O'\subset(X\setminus G)^{(0)}\,,\qquad X\setminus K'\subset G^{(0)}\,,\qquad\partial^*G\subset K'\setminus O'\,. \end{equation*} \end{lemma} \begin{proof} If $K=\emptyset$ we take $G=O'=K'=\emptyset$. Otherwise let $00$, and let $U\supset A$ be an open set with $\beta(U)\le\beta(A)+\varepsilon$. For each $x\in A$ choose $r_x\in(0,\delta/5)$ with $B(x,r_x)\subset U$ and $\beta(B(x,r_x))>2\,C_1\,\xi_\lambda(B(x,r_x))$. By the covering lemma there are countably many pairwise disjoint balls $B_i=B(x_i,r_{x_i})$ such that the balls $5B_i$ cover~$A$, and~\eqref{eq:gaugedbl} gives \begin{equation*} \Hcod\lambda_\delta(A)\le\sum_i\xi_\lambda(5B_i)\le C_1\sum_i\xi_\lambda(B_i)\le\frac12\sum_i\beta(B_i)\le\frac12\,\beta(U)\le\frac12\big(\Hcod\lambda(A)+\varepsilon\big)\,. \end{equation*} Letting $\varepsilon\downarrow0$ and $\delta\downarrow0$ we get $\Hcod\lambda(A)\le\frac12\Hcod\lambda(A)$. Since $\Hcod\lambda(A)\le\Hcod\lambda(\partial^*G)<\infty$, this gives $\beta(A)=\Hcod\lambda(A)=0$. For $n\ge1$ let $A_n$ be the set of the points $x\in X$ such that $\beta(B(x,r))\le3\,C_1\,\xi_\lambda(B(x,r))$ for all $00$. Choose $n$ with $\beta(X\setminus A_n)<\varepsilon$ and a radius $00$. Let $c_1=\eta_0/(2C_d^{\,2})$, and choose $j_0$ such that $m(D_j\cap K')0$. Since $X$ is proper, the finite Borel measure $\beta$ is inner regular with respect to compact sets, and for $0<\varepsilon<\beta(W)$ we can choose the compact set $K\subset W$ in Step~2 with $\beta(W\setminus K)<\varepsilon$. Then Step~3 gives \begin{equation*} \limsup_{j\to\infty}\Hcod\lambda\big(W\cap\partial^*G\setminus D_j^{(0)}\big)\le C\limsup_{j\to\infty}\Hcod\lambda(W\cap\partial^*D_j)+2\varepsilon\,, \end{equation*} and we let $\varepsilon\downarrow0$. \end{proof} \begin{lemma}[Subadditivity on nested open sets]\label{lem:nested} Let $E$ be a set of finite perimeter, and let $U',U,V\subset X$ be open sets such that $\overline{U'}$ is a compact subset of~$U$. Then \begin{equation*} \overline\nu_E(U'\cup V)\le\overline\nu_E(U)+\overline\nu_E(V)\,. \end{equation*} \end{lemma} \begin{proof} We may assume that $U'\ne\emptyset$. Let $K_0=\overline{U'}$ and $N\ge1$, and choose $\rho>0$, with $2N\rho<\dist(K_0,X\setminus U)$ if $U\ne X$. For $1\le i\le N$ let \begin{equation*} Q_i=\{x:\ \dist(x,K_0)\le(2i-1)\rho\}\,,\qquad O_i=\{x:\ \dist(x,K_0)<2i\rho\}\,,\qquad W_i=O_i\setminus Q_i\,. \end{equation*} The sets $Q_i$ are compact because $X$ is proper, and the sets $W_i$ are open, pairwise disjoint and contained in $U\setminus K_0$. Let $G_i$, $O'_i\supset Q_i$ and $K'_i\subset O_i$ be given by Lemma~\ref{lem:interface} for $K=Q_i$ and $O=O_i$, so that $\partial^*G_i\subset K'_i\setminus O'_i\subset W_i$. Let $(E_j)$ and $(F_j)$ be recovery sequences for $E$ in $U$ and in~$V$, let $D_j=E_j\triangle F_j$, and let \begin{equation*} a_j=\Hcod\lambda(U\cap\partial^*E_j)+\Hcod\lambda(V\cap\partial^*F_j)\,,\qquad\text{so that}\quad a_j\to\overline\nu_E(U)+\overline\nu_E(V)\,. \end{equation*} Then $\ind_{D_j}\to0$ in $L^1_{\mathrm{loc}}(U\cap V)$. By Lemma~\ref{lem:glue}, $\partial^*D_j\subset\partial^*E_j\cup\partial^*F_j$, and since the sets $W_i\cap V$ are pairwise disjoint subsets of $U\cap V$, \begin{equation*} \sum_{i=1}^N\Hcod\lambda(W_i\cap V\cap\partial^*D_j)\le a_j\,. \end{equation*} Hence there are an index~$i$ and an infinite set $\mathcal J$ of integers such that $\Hcod\lambda(W_i\cap V\cap\partial^*D_j)\le a_j/N$ for $j\in\mathcal J$. We fix them, write $G=G_i$, $O'=O'_i$ and $K'=K'_i$, and let \begin{equation*} H_j=(E_j\cap G)\cup(F_j\setminus G)\qquad\text{for }j\in\mathcal J\,. \end{equation*} These are sets of finite perimeter. \emph{Convergence.} Let $K\subset U'\cup V$ be compact. Modulo null sets, $G\subset K'$ and $X\setminus G\subset X\setminus O'$, hence \begin{equation*} \|\ind_{H_j}-\ind_E\|_{L^1(K)}\le\|\ind_{E_j}-\ind_E\|_{L^1(K')}+\|\ind_{F_j}-\ind_E\|_{L^1(K\setminus O')}\,. \end{equation*} The set $K'$ is a compact subset of~$U$, and $K\setminus O'$ is a compact subset of~$V$, because $U'\subset K_0\subset O'$. Hence $H_j\to E$ in $L^1_{\mathrm{loc}}(U'\cup V)$ as $j\to\infty$ in~$\mathcal J$. \emph{The boundary.} By Lemma~\ref{lem:interface}, the complement of $G^{(0)}$ is contained in $K'\subset U$, the set $G^{(0)}$ does not meet $O'\supset U'$, and $\partial^*G\subset W_i$ does not meet~$K_0\supset U'$. Hence~\eqref{eq:glue} gives \begin{equation*} (U'\cup V)\cap\partial^*H_j\subset\big(U\cap\partial^*E_j\big)\cup\big(V\cap\partial^*F_j\big)\cup\big(V\cap W_i\cap\partial^*G\setminus D_j^{(0)}\big)\,. \end{equation*} By the definition of $\overline\nu_E$ and by Lemma~\ref{lem:cost} for the open set $W=V\cap W_i$ and the sets $D_j$, $j\in\mathcal J$, \begin{align*} \overline\nu_E(U'\cup V)&\le\liminf_{j\in\mathcal J}\Hcod\lambda\big((U'\cup V)\cap\partial^*H_j\big)\\ &\le\lim_{j\to\infty}a_j+C\limsup_{j\in\mathcal J}\Hcod\lambda(V\cap W_i\cap\partial^*D_j)\le\Big(1+\frac CN\Big)\big(\overline\nu_E(U)+\overline\nu_E(V)\big)\,. \end{align*} We let $N\to\infty$. \end{proof} \begin{lemma}[Sorting]\label{lem:sorting} Let $\Phi$ be a function with values in $[0,\infty)$ on the sets of finite perimeter such that $\Phi(E\cup F)+\Phi(E\cap F)\le\Phi(E)+\Phi(F)$ for all $E$ and~$F$. Let $B_1,\dots,B_N$ be sets of finite perimeter, and for $1\le i\le N$ let $S_i$ be the set of the points which belong to at least~$i$ of the sets $B_1,\dots,B_N$. Then \begin{equation*} \sum_{i=1}^N\Phi(S_i)\le\sum_{k=1}^N\Phi(B_k)\,. \end{equation*} \end{lemma} \begin{proof} We argue by induction on~$N$; the case $N=1$ is trivial. Let $N\ge2$, let $S'_1\supset\dots\supset S'_{N-1}$ be the sets associated in the same way with $B_1,\dots,B_{N-1}$, and let $T_0=B_N$ and $T_i=S'_i\cap B_N$ for $1\le i\le N-1$. A point belongs to at least $i$ of the sets $B_1,\dots,B_N$ if and only if it belongs to $S'_i$, or to $S'_{i-1}$ and to~$B_N$. Since the sets $S'_i$ decrease, this gives \begin{equation*} S_i=S'_i\cup T_{i-1}\,,\qquad T_i=S'_i\cap T_{i-1}\qquad\text{for }1\le i\le N-1\,,\qquad\text{and}\qquad S_N=T_{N-1}\,. \end{equation*} Hence $\Phi(S_i)+\Phi(T_i)\le\Phi(S'_i)+\Phi(T_{i-1})$ for $1\le i\le N-1$. Summing these inequalities we get $\sum_{i=1}^N\Phi(S_i)\le\sum_{i=1}^{N-1}\Phi(S'_i)+\Phi(B_N)$, and the induction hypothesis gives the claim. \end{proof} \begin{proof}[Proof of Theorem~\ref{th:relaxed}] \ref{it:rel-measure} \emph{Step 1: elementary properties.} Let $E$ be a set of finite perimeter. If $U\subset V$ are open, a sequence which converges in $L^1_{\mathrm{loc}}(V)$ converges in $L^1_{\mathrm{loc}}(U)$, hence $\overline\nu_E(U)\le\overline\nu_E(V)$; and $\overline\nu_E(\emptyset)=0$. If $U$ and $V$ are disjoint open sets and $E_j\to E$ in $L^1_{\mathrm{loc}}(U\cup V)$, then \begin{equation*} \liminf_{j\to\infty}\Hcod\lambda\big((U\cup V)\cap\partial^*E_j\big)\ge\liminf_{j\to\infty}\Hcod\lambda(U\cap\partial^*E_j)+\liminf_{j\to\infty}\Hcod\lambda(V\cap\partial^*E_j)\,, \end{equation*} hence $\overline\nu_E(U\cup V)\ge\overline\nu_E(U)+\overline\nu_E(V)$. \emph{Step 2: inner regularity.} Let $U$ be open and $\varepsilon>0$. Since $\nu_E$ is a finite Borel measure and $X$ is proper, there is a compact set $K_0\subset U$ with $\nu_E(U\setminus K_0)<\varepsilon$. Choose open sets $U'\supset K_0$ and $U''\supset\overline{U'}$ such that $\overline{U'}$ and $\overline{U''}$ are compact subsets of~$U$. Since $U=U'\cup(U\setminus K_0)$, Lemma~\ref{lem:nested} gives \begin{equation*} \overline\nu_E(U)\le\overline\nu_E(U'')+\overline\nu_E(U\setminus K_0)\le\overline\nu_E(U'')+\nu_E(U\setminus K_0)\le\overline\nu_E(U'')+\varepsilon\,. \end{equation*} Thus $\overline\nu_E(U)$ is the supremum of $\overline\nu_E(U'')$ over the open sets $U''$ whose closure is a compact subset of~$U$. \emph{Step 3: subadditivity.} Let $U,V$ be open, and let $W$ be an open set whose closure is a compact subset of $U\cup V$. The compact set $\overline W\setminus V$ is contained in~$U$, and we choose an open set $U'\supset\overline W\setminus V$ whose closure is a compact subset of~$U$. Then $W\subset U'\cup V$, and Lemma~\ref{lem:nested} gives $\overline\nu_E(W)\le\overline\nu_E(U)+\overline\nu_E(V)$. By Step~2, $\overline\nu_E(U\cup V)\le\overline\nu_E(U)+\overline\nu_E(V)$. \emph{Step 4: the measure.} By Steps~1 to~3, the set function $\overline\nu_E$ on the open sets is increasing, subadditive, additive on disjoint open sets and inner regular. By the criterion of De~Giorgi and Letta~\cite{DGL}, in the form of~\cite[Theorem~1.53]{AFP}, the formula $\overline\nu_E(A)=\inf\{\overline\nu_E(U):\ U\supset A\text{ open}\}$ defines a Borel measure, and it is the only Borel measure with the given values on the open sets, because these values are finite. Since $\overline\nu_E\le\nu_E$ on the open sets and the finite Borel measure $\nu_E$ is outer regular, $\overline\nu_E\le\nu_E$. \emph{Step 5: the lower bound.} Let $U$ be open and $E_j\to E$ in $L^1_{\mathrm{loc}}(U)$. By Theorem~\ref{th:coareameasure}\ref{it:cm-compare} and Proposition~\ref{prop:quasilsc}, \begin{equation*} \nu_E(U)\le C\,\mu^+_{\ind_E}(U)\le C\liminf_{j\to\infty}\mu^+_{\ind_{E_j}}(U)\le C\liminf_{j\to\infty}\nu_{E_j}(U)\,. \end{equation*} Hence $\nu_E(U)\le C\,\overline\nu_E(U)$ for every open set~$U$, and $\nu_E\le C\,\overline\nu_E$ by outer regularity. \emph{Step 6: complements and locality.} Since $\partial^*(X\setminus E)=\partial^*E$, and since $X\setminus E_j\to X\setminus E$ if $E_j\to E$, we have $\overline\nu_{X\setminus E}=\overline\nu_E$ on the open sets. If $E$ and $F$ coincide almost everywhere on the open set~$U$, then $\overline\nu_E(V)=\overline\nu_F(V)$ for every open set $V\subset U$ by~\eqref{eq:relaxed}, and the same follows for the Borel subsets of~$U$. \ref{it:rel-lsc} We may assume that $\overline\nu_{E_j}(U)$ converges to a finite limit. Let $K_1\subset K_2\subset\dots$ be compact subsets of~$U$ such that every compact subset of~$U$ is contained in one of them. By~\eqref{eq:relaxed} there are sets $E'_j$ of finite perimeter with \begin{equation*} \Hcod\lambda(U\cap\partial^*E'_j)\le\overline\nu_{E_j}(U)+\frac1j\,,\qquad\|\ind_{E'_j}-\ind_{E_j}\|_{L^1(K_j)}\le\frac1j\,. \end{equation*} Then $E'_j\to E$ in $L^1_{\mathrm{loc}}(U)$, and $\overline\nu_E(U)\le\liminf_j\Hcod\lambda(U\cap\partial^*E'_j)\le\lim_j\overline\nu_{E_j}(U)$. For the second assertion, let $E_j\to E$ in $L^1_{\mathrm{loc}}(U)$. Then $\mu_E(U)\le\liminf_j\mu_{E_j}(U)\le\liminf_j\nu_{E_j}(U)$, hence $\mu_E(U)\le\overline\nu_E(U)$ for every open set~$U$, and $\mu_E\le\overline\nu_E$ by outer regularity. \ref{it:rel-sub} Let $U$ be open, and let $(E_j)$ and $(F_j)$ be recovery sequences for $E$ and for $F$ in~$U$. Then $E_j\cup F_j\to E\cup F$ and $E_j\cap F_j\to E\cap F$ in $L^1_{\mathrm{loc}}(U)$, and~\eqref{eq:submod-boundary} gives \begin{equation*} \Hcod\lambda\big(U\cap\partial^*(E_j\cup F_j)\big)+\Hcod\lambda\big(U\cap\partial^*(E_j\cap F_j)\big)\le\Hcod\lambda(U\cap\partial^*E_j)+\Hcod\lambda(U\cap\partial^*F_j)\,. \end{equation*} Taking the lower limit we get $\overline\nu_{E\cup F}(U)+\overline\nu_{E\cap F}(U)\le\overline\nu_E(U)+\overline\nu_F(U)$. The inequality for Borel sets follows by outer regularity. \ref{it:rel-functions} \emph{Step 1: the measure.} As in the proof of Theorem~\ref{th:coareameasure}\ref{it:cm-measure}, the set $\mathcal U$ of the levels~$u$ such that $E_u$ has finite perimeter is measurable, and its complement is a null set. Let $U$ be open, and let $g(u)=\overline\nu_{E_u}(U)$ for $u\in\mathcal U$. The set $\mathcal N$ of the levels~$u$ with $m(\{f=u\})>0$ is countable, because $m$ is $\sigma$-finite. If $u_0\notin\mathcal N$ and $u_k\to u_0$, then $\ind_{E_{u_k}}\to\ind_{E_{u_0}}$ almost everywhere, hence in $L^1_{\mathrm{loc}}(X)$. By~\ref{it:rel-lsc}, $g(u_0)\le\liminf_kg(u_k)$ if $u_0\in\mathcal U\setminus\mathcal N$ and $u_k\in\mathcal U$. Therefore, for every $a\in\R$, the set $\{u\in\mathcal U:\ g(u)>a\}$ is the union of a countable set and of the intersection of~$\mathcal U$ with an open set, and $g$ is measurable. The Borel sets $A$ for which $u\mapsto\overline\nu_{E_u}(A)$ is measurable on~$\mathcal U$ form a class which contains the open sets and is stable under complements and under countable disjoint unions, because the measures $\overline\nu_{E_u}$ are finite. Since the intersection of two open sets is open, this class contains all Borel sets. By the monotone convergence theorem $\overline\nu_f$ is a Borel measure. The inequalities $C^{-1}\nu_f\le\overline\nu_f\le\nu_f$ follow from~\ref{it:rel-measure} and from $\nu_f=\int_\R\nu_{E_u}\,du$. The comparison with the BV measures and with $\Var(f)$ is then Theorem~\ref{th:coareameasure}\ref{it:cm-compare} and Theorem~\ref{th:measures}\ref{it:meas-exist}. \emph{Step 2: lower semicontinuity.} Let $f_k\to f$ in $L^1_{\mathrm{loc}}(U)$. We may assume that $\overline\nu_{f_k}(U)$ converges. For every compact set $K\subset U$, \begin{equation*} \int_{\R}\big\|\ind_{\{f_k>u\}}-\ind_{\{f>u\}}\big\|_{L^1(K)}\,du=\|f_k-f\|_{L^1(K)}\to0\,. \end{equation*} By a diagonal argument over an increasing sequence of compact sets which exhausts~$U$, there is a subsequence along which $\{f_k>u\}\to\{f>u\}$ in $L^1_{\mathrm{loc}}(U)$ for almost every~$u$. For almost every~$u$ all these sets have finite perimeter, and~\ref{it:rel-lsc} and Fatou's lemma give \begin{equation*} \overline\nu_f(U)\le\int_{\R}\liminf_{k\to\infty}\overline\nu_{\{f_k>u\}}(U)\,du\le\liminf_{k\to\infty}\overline\nu_{f_k}(U)\,. \end{equation*} \emph{Step 3: homogeneity.} If $a>0$, then $\{af+b>u\}=E_{(u-b)/a}$, and a change of variable gives $\overline\nu_{af+b}=a\,\overline\nu_f$. If $a<0$, then $\{af+b>u\}=X\setminus\{f\ge(u-b)/a\}$, the sets $\{f\ge t\}$ and $E_t$ coincide almost everywhere for all but countably many~$t$, and $\overline\nu_{X\setminus E}=\overline\nu_E$. The case $a=0$ is trivial. \emph{Step 4: step functions.} Let $B_1,\dots,B_N$ be sets of finite perimeter, $h>0$, $c\in\R$, and $s=c+h\sum_{k=1}^N\ind_{B_k}$. Then $\Var(s)<\infty$. With the sets $S_i$ of Lemma~\ref{lem:sorting}, the superlevel set $\{s>u\}$ is $X$ for $u0$, and let $N$ be an integer with $Nh\ge b-a$. For $0\le\sigma0$. Then $\Var(T_Mf)\le\Var(f)$, the superlevel set $\{T_Mf>u\}$ is $E_u$ for $-M\le u0$, a function $g$ of finite variation with \begin{equation}\label{eq:rel-recovery} \|g-f\|_{L^1(K)}\le\varepsilon\,,\qquad\nu_g(U)\le\overline\nu_f(U)+\varepsilon\,. \end{equation} Suppose first that $f=c+h\sum_{i=1}^N\ind_{A_i}$ with sets $A_1\supset\dots\supset A_N$ of finite perimeter, and let $(B_i^j)_j$ be a recovery sequence for $A_i$ in~$U$. Let $g_j=c+h\sum_i\ind_{B_i^j}$. Then $g_j\to f$ in $L^1_{\mathrm{loc}}(U)$, and by~\eqref{eq:rel-step} \begin{equation*} \nu_{g_j}(U)\le h\sum_{i=1}^N\nu_{B_i^j}(U)\longrightarrow h\sum_{i=1}^N\overline\nu_{A_i}(U)=\overline\nu_f(U)\,, \end{equation*} so that $g=g_j$ satisfies~\eqref{eq:rel-recovery} for large~$j$. If $f$ is essentially bounded, we apply this to the step function $f_h$ of Step~5, with $h\,m(K)\le\varepsilon/2$, and use~\eqref{eq:rel-approx}. In the general case we apply the bounded case to $T_Mf$, with $M$ so large that $\|T_Mf-f\|_{L^1(K)}\le\varepsilon/2$, and use $\overline\nu_{T_Mf}\le\overline\nu_f$. \end{proof} \begin{example}[Strictness of the coarea relaxation]\label{ex:strict-relaxation} Equip $X=[-1,1]$ with the Euclidean distance and the measure $dm=w\,dx$, where $w=1$ on the intervals $I_j=(2^{-j},2^{-j}+4^{-j-1})$, $j\ge1$, and $w=2$ elsewhere. Let $a_j$ be the midpoint of~$I_j$, $E_j=[-1,a_j)$ and $E=[-1,0)$. Then $E_j\to E$ in $L^1(X,m)$ and, at $\lambda=1$, \begin{equation*} \Per(E_j)=\tfrac12,\qquad \Per(E)=1,\qquad \nu_{E_j}=2\delta_{a_j},\qquad \nu_E=4\delta_0,\qquad \overline\nu_E=2\delta_0\,. \end{equation*} \end{example} \begin{proof} Since $1\le w\le2$, the interval satisfies the $(1,1)$-Poincar\'e inequality with respect to~$m$. By Corollary~\ref{cor:PIspaces}, hypotheses~\hP{} and~\hC{} hold at $\lambda=1$. Let $a\in(-1,1)$ and suppose that $w(a+r\,\cdot)\to c$ in $L^1(-2,2)$. Then $m(B(z,r))/r\to2c$ uniformly for $|z-a|\le r$. The change of variables $x=a+ru$, $y=a+rv$ in the crossing pairs, as in Example~\ref{ex:line}, gives \begin{equation*} \lim_{r\downarrow0}r^{-1}J_r(\ind_{[-1,a)})=\frac{c}{2}\,. \end{equation*} Indeed the rescaled kernel $r k_r(a+ru,a+rv)$ converges uniformly to $1/(2c)$ on the crossing triangle $u<00$ for all sufficiently large~$k$. The lemma then gives a point of $\partial^*F_k$ in $LB$. Its singleton has $\Hcod1$-measure at least $2$, since $w\ge1$ and all sufficiently small covering balls at this point are interior to the interval. Thus $\overline\nu_E(X)\ge2$. The domination $\overline\nu_E\le\nu_E$ in Theorem~\ref{th:relaxed}\ref{it:rel-measure} gives $\overline\nu_E=2\delta_0$. \end{proof} The direct method of the calculus of variations applies to the relaxed coarea measure. We state the simplest consequence. \begin{corollary}[Sets of least relaxed perimeter]\label{cor:rel-min} Assume~\hP{} and~\hC, and let $D<\infty$. Let $0-\frac32\}$, $E_2=\{x<\frac32\}$ and $E=E_1\cap E_2$. The proof of that proposition gives $\Per(E_1)=\Per(E_2)=\frac12(1-\epsilon)$ and $\Per(E)=1$. On the other hand $E$ coincides with $E_1$ on $\{x<1\}$ and with $E_2$ on $\{x>-1\}$, and the measures $\overline\nu_{E_1}$, $\overline\nu_{E_2}$ and $\overline\nu_E$ are carried by $\{-\frac32\}$, by $\{\frac32\}$ and by $\{-\frac32,\frac32\}$. By Theorem~\ref{th:relaxed}\ref{it:rel-measure}, \begin{equation*} \overline\nu_E(X)=\overline\nu_{E_1}(X)+\overline\nu_{E_2}(X)\,,\qquad\text{whereas}\qquad\Per(E)>\Per(E_1)+\Per(E_2)\,. \end{equation*} The same argument applies to every map $E\mapsto\mu_E$ with values in the measures carried by $\partial^*E$ which is local in the sense of Theorem~\ref{th:relaxed}\ref{it:rel-measure}: its total mass cannot be the perimeter. \item \emph{Hypothesis~\hC{} is used twice.} It gives the boundary content inequality, and it provides the sets of finite perimeter of Lemma~\ref{lem:interface} along which the approximating sequences are glued. The proof uses nothing else: Theorem~\ref{th:relaxed} holds under~\hP, the boundary content inequality, and the conclusion of Lemma~\ref{lem:interface}. \item \emph{The relaxation may be trivial.} If $E\mapsto\nu_E(U)$ is lower semicontinuous with respect to convergence in $L^1_{\mathrm{loc}}(U)$ for every open set~$U$, then $\overline\nu_E=\nu_E$ and $\overline\nu_f=\nu_f$. This is the case in $\R^n$ with Lebesgue measure (Proposition~\ref{prop:euclid-measures}). Example~\ref{ex:strict-relaxation} gives a strict inequality on a weighted interval. We do not know whether it is the case on the Sierpi\'nski carpet. \end{itemize} \end{remark} \part{Two special settings} \chapter{The exponent one and the classical theory}\label{sec:classical} \begin{overview} This chapter relates the theory of this memoir to the classical one. The exponent $\lambda=1$ is the smallest one for which~\hP{} can hold. It is attained exactly in the spaces which support a $(1,1)$-Poincar\'e inequality, and in these spaces hypothesis~\hC{} is automatic, the variation is comparable to the total variation of Miranda, and the BV measures are comparable to the total variation measure. In $\R^n$ the BV measures and the coarea measures are constant multiples of the classical variation measure; for the maximum norm in the plane they are not proportional to the total variation measure. In the ball energies of this chapter $\lambda=1$, and the standing assumptions are those of Section~\ref{sec:hyp}. Section~\ref{sec:heat-classical} gives exact heat-flow formulas for classical variation and treats Gaussian measures beyond the globally doubling setting. \end{overview} \section{The classical objects and the main result} We now make precise the statement that the theory of this memoir extends the classical theory of functions of bounded variation in metric measure spaces. For a function $u\colon X\to\R$ let \begin{equation*} \Lip u(x)=\limsup_{y\to x}\frac{|u(x)-u(y)|}{d(x,y)} \end{equation*} be its slope, with $\Lip u(x)=0$ if $x$ is an isolated point. Following Miranda~\cite{Mir}, the \emph{total variation} of $f\in L^1_{\mathrm{loc}}(X,m)$ is \begin{equation}\label{eq:miranda} \|Df\|(X)=\inf\Big\{\liminf_{k\to\infty}\int_X\Lip u_k\,dm:\ u_k\to f\text{ in }L^1_{\mathrm{loc}}(X,m)\Big\}\,, \end{equation} where the infimum is over the sequences of locally Lipschitz functions $u_k\colon X\to\R$, and $f\in L^1(X,m)$ has bounded variation in the sense of~\cite{Mir} if $\|Df\|(X)<\infty$; see Remark~\ref{rem:variants} for the variants of this definition. The classical theory is developed under the following hypothesis. \begin{enumerate}[leftmargin=3.2em] \item[\hPI] \emph{$(1,1)$-Poincar\'e inequality.} There are constants $C_{PI}$ and $\Lambda_{PI}\ge1$ such that, for every ball $B$ of radius $R>0$ and every Lipschitz function $u\colon X\to\R$, \begin{equation}\label{eq:PI} \int_B|u-u_B|\,dm\le C_{PI}\,R\int_{\Lambda_{PI}B}\Lip u\,dm\,. \end{equation} \end{enumerate} By a theorem of Keith~\cite[Theorem~2]{Keith}, in a complete doubling metric measure space~\hPI{} is equivalent to the $(1,1)$-Poincar\'e inequality of Heinonen and Koskela~\cite{HeKo} for arbitrary functions and their upper gradients. The spaces which satisfy the standing assumptions and~\hPI{} include $\R^n$ with a Muckenhoupt $A_1$ weight, the complete Riemannian manifolds of non-negative Ricci curvature, the Carnot groups, and many spaces without any smooth structure; see~\cite{HK,HKST}. \begin{theorem}\label{th:classical} Let $(X,d,m)$ satisfy the standing assumptions. \begin{enumerate}[label=\textup{(\roman*)}] \item\label{it:cl-C} Hypothesis~\hC{} holds with $\lambda=1$ and $M=2$, and so does~\hCp: for every $x\in X$ and $R>0$ there is a set $T\subset(R,2R)$ of Lebesgue measure at least $R/2$ such that, for every $t\in T$, the ball $G=B(x,t)$ satisfies \begin{equation*} J_r(\ind_G)\le C\,\frac{m(B(x,R))}{R}\,r\quad\text{for all }r>0\,,\qquad\Hcod1(\partial G)\le C\,\frac{m(B(x,R))}{R}\,. \end{equation*} \item\label{it:cl-lower} If~\hP{} holds with an exponent $\lambda$, then $\lambda\ge1$. \item\label{it:cl-PI} Hypothesis~\hP{} holds with $\lambda=1$ if and only if~\hPI{} holds. \item\label{it:cl-BV} If~\hPI{} holds, then, with $\lambda=1$, every $f\in L^1_{\mathrm{loc}}(X,m)$ satisfies \begin{equation*} c\,\|Df\|(X)\le\Var(f)\le S_1(f)\le C\,\|Df\|(X)\,. \end{equation*} The first inequality holds without~\hPI. If~\hPI{} holds and $\|Df\|(X)<\infty$, then every BV measure $\mu$ of~$f$ satisfies $C^{-1}\,\|Df\|\le\mu\le C\,\|Df\|$, where $\|Df\|$ is the total variation measure of~\cite{Mir}. \end{enumerate} \end{theorem} Thus $\lambda=1$ is the smallest exponent for which~\hP{} can hold; it is attained exactly in the spaces of the classical theory, and in these spaces both hypotheses hold with $\lambda=1$, the space $BV(X)=\Bes1(X)$ is the space of~\cite{Mir}, and $\Per(E)$ is comparable to the perimeter $\|D\ind_E\|(X)$. The identification of the functions of bounded variation with $\Bes1(X)$ under~\hPI{} is known; see Marola, Miranda and Shanmugalingam~\cite{MMS}, Di~Marino and Squassina~\cite{DMS}, and Lahti, Pinamonti and Zhou~\cite{LPZ}. \section{Comparison with the classical theory}\label{sec:intro-classical} \paragraph{The classical results as the case $\lambda=1$.} With $\lambda=1$, the statements of Chapters~\ref{sec:wm} to~\ref{sec:measures} are the following results of the classical theory, up to the values of the constants. \begin{itemize} \item Theorem~\ref{th:metric}\ref{it:metric-poincare} is the Poincar\'e inequality $\int_B|f-f_B|\,dm\le C\,R\,\|Df\|(\Lambda B)$ for functions of bounded variation, and Proposition~\ref{prop:coarea} corresponds to the coarea formula of~\cite[Proposition~4.2]{Mir}. \item Theorem~\ref{th:isop}\ref{it:isop-local} contains the relative isoperimetric inequality of~\cite{Ambrosio,Mir} and the Sobolev--Poincar\'e inequality with the exponent $Q/(Q-1)$ of Haj\l asz and Koskela~\cite[Theorem~5.1]{HK}; their hypothesis on the measure is~\eqref{eq:decay}. Its proof is the covering argument of the boxing inequality of Kinnunen, Korte, Shanmugalingam and Tuominen~\cite{KKST}. \item Theorem~\ref{th:federer}\ref{it:fed-pos} is the theorem of Ambrosio~\cite{Ambrosio} that $\Hcod1(\partial^*E)\le C\,\|D\ind_E\|(X)$, together with the converse of Lahti~\cite{Lahti}, in the form proved in~\cite{EB}; Lemma~\ref{lem:strongpoint} is taken from~\cite{LahtiStrong}; and~\eqref{eq:topiso} is an inequality of the type studied in~\cite{KL}. \item The BV measures of Theorem~\ref{th:measures} are comparable to the total variation measure $\|Df\|$ (Theorem~\ref{th:classical}\ref{it:cl-BV}), and Theorem~\ref{th:measures}\ref{it:meas-coarea} corresponds to the coarea formula together with the representation $\|D\ind_E\|=\theta_E\,\Hcod1\llcorner\partial^*E$, with a density $\theta_E$ bounded from above and from below, of Ambrosio~\cite{Ambrosio} and Ambrosio, Miranda and Pallara~\cite{AMP}. In $\R^n$ the BV measure of~$f$ is unique and is a constant multiple of~$|Df|$, by a theorem of D\'avila~\cite{Dav}, and so are the coarea measure and the relaxed coarea measure of Section~\ref{sec:relaxed}; the constants are given in Proposition~\ref{prop:euclid-measures}. In general the density $\theta_E$ is not constant, and the three measures are not proportional (Example~\ref{ex:maxnorm}). \end{itemize} \paragraph{What changes when $\lambda>1$.} \begin{itemize} \item \emph{There is no Poincar\'e inequality for slopes.} If~\hP{} and~\hC{} hold with an exponent $\lambda>1$, then~\hP{} fails for the exponent~$1$ by the uniqueness of the exponent, and~\hPI{} fails by Theorem~\ref{th:classical}\ref{it:cl-PI}. Lipschitz functions satisfy $J_r(u)=O(r)$ on bounded sets, which is weaker than the bound $O(r^\lambda)$ required of a function of bounded variation, and they need not belong to $BV(X)$: on the carpet the coordinate functions have infinite variation (Theorem~\ref{th:coordinateprofiles}), and on the gasket every continuous function of bounded variation is constant (Theorem~\ref{th:gasket}). A definition by relaxation from Lipschitz functions, as in~\eqref{eq:miranda}, is therefore not available. Simple functions built from finite unions of the cutoff sets in~\hC{} are dense in $L^1$ (Proposition~\ref{prop:dense}). On the carpets $F_{b,a}$ with $a\ge3$, continuous BV functions are uniformly dense in $C(F_{b,a})$ (Proposition~\ref{prop:carpetcontinuous}). The place of the Poincar\'e inequality for slopes is taken by the two-scale inequality~\hP, which, in the presence of~\hC, is equivalent to the relative isoperimetric inequality~\hIl{} (Theorem~\ref{th:onescale}). \item \emph{Hypothesis~\hC{} is no longer automatic.} For $\lambda=1$ it is satisfied by balls. For $\lambda>1$ the sets $G$ must be adapted to the space, and there are Ahlfors regular spaces in which the exponents allowed by~\hP{} and by~\hC{} are separated by a gap (Chapter~\ref{sec:nocommon}). \item \emph{Codimension one becomes codimension $\lambda$.} The factor~$R$ of the Poincar\'e and isoperimetric inequalities becomes $R^\lambda$, the Sobolev exponent $Q/(Q-1)$ becomes $Q/(Q-\lambda)$, and the measure $\Hcod1$ becomes $\Hcod\lambda$. \item \emph{Coarea and lower semicontinuity.} The raw variation $\Var$ is comparable to the lower semicontinuous seminorm $S_\lambda$ and to the integral of the perimeters of the level sets. On the compact gasket these perimeters give an exact coarea formula for $\Var$, which is itself lower semicontinuous in $L^1$ (Theorem~\ref{th:gasket}). The local relaxation can fail additivity on open sets, both on the gasket (Corollary~\ref{cor:gasketrelaxation}) and on positively separated intervals in the example of Proposition~\ref{prop:phase}. The relaxed coarea measure of Theorem~\ref{th:relaxed} is lower semicontinuous and subadditive with the constant one, but its total mass is only comparable to the variation. \end{itemize} \section{Plan of the proof} Apart from Proposition~\ref{prop:mirandameasure}, which uses Chapter~\ref{sec:measures}, the proof of Theorem~\ref{th:classical} is independent of Chapters~\ref{sec:bv} to~\ref{sec:measures}. \begin{itemize} \item Section~\ref{sec:balls}: in every doubling space, balls of suitable radii satisfy~\hC{} and~\hCp{} with $\lambda=1$. This is a consequence of the weak type $(1,1)$ of the maximal function on the line, applied to the distribution of the distance to the centre. \item Section~\ref{sec:PI}: hypothesis~\hP{} with $\lambda=1$ is equivalent to the $(1,1)$-Poincar\'e inequality~\hPI. One direction is obtained by letting $h\downarrow0$ in~\eqref{eq:P} for a Lipschitz function, the other one by applying~\hPI{} to a discrete convolution of~$f$ at scale~$h$. \item Section~\ref{sec:miranda}: under~\hPI, $\Var(f)$ is comparable to the total variation $\|Df\|(X)$ of~\eqref{eq:miranda}, and the BV measures of~$f$ are comparable to the total variation measure~$\|Df\|$. \item Section~\ref{sec:weights}: weighted Euclidean spaces, which illustrate the features of the doubling setting. \item Section~\ref{sec:heat-classical} identifies classical perimeter through short-time heat flow on Riemannian, RCD and Gaussian spaces. \end{itemize} \section{Balls}\label{sec:balls} In $\R^n$ every ball satisfies~\hC{} with $\lambda=1$, because a shell of width~$h$ around a sphere of radius~$t$ has volume comparable to $t^{n-1}h$. In a doubling space the measure of a shell $\{y:\ |d(x,y)-t|0$. There is a measurable set $T\subset(R,2R)$ of Lebesgue measure at least $R/2$ such that every $t\in T$ satisfies \begin{equation}\label{eq:shell} m\bigl(\{y:\ |d(x,y)-t|0)\,, \qquad\Hcod1(\partial G)\le8\,C_d^{\,3}\,\frac{m(B(x,R))}{R}\,. \end{equation*} Consequently~\hCp{} and~\hC{} hold with $\lambda=1$, $M=2$ and $C_C=80\,C_d^{\,3}$. \end{proposition} \idea The function $y\mapsto d(x,y)$ transports the measure~$m$ on a ball to a finite measure~$\nu$ on the line, and the measure of a shell around the sphere of radius~$t$ is the $\nu$-measure of an interval centred at~$t$. The radii~$t$ for which some interval $(t-h,t+h)$ has $\nu$-measure larger than $a\,h$ form a set of length at most $4\,\nu(\R)/a$: this is the weak type $(1,1)$ inequality for the maximal function of~$\nu$, which we prove directly by a covering argument. \begin{proof} \emph{Step 1: a covering lemma on the line.} Let $\nu$ be a finite Borel measure on~$\R$ and $a>0$, and let \begin{equation*} T_a=\big\{t\in(R,2R):\ \nu((t-h,t+h))>a\,h\ \text{ for some }0a\,h$. If $|t'-t|a\,h_i$, and we choose such a family with the smallest possible number of intervals. Among three intervals with a common point, the one whose left endpoint is smallest and the one whose right endpoint is largest cover the third one. Hence no point belongs to three of the intervals $I_i$, and \begin{equation*} \mathcal L^1(K)\le\sum_i2h_i<\frac2a\sum_i\nu(I_i)\le\frac4a\,\nu(\R)\,. \end{equation*} The claim follows because $\mathcal L^1(T_a)$ is the supremum of the measures of its compact subsets. \emph{Step 2: the choice of the radii.} For $b=2,3$ let $\nu_b$ be the image of the restriction of~$m$ to $B(x,bR)$ under the function $d(x,\cdot)$, so that $\nu_b(\R)=m(B(x,bR))$. We apply Step~1 to $\nu_2$ with $a=20\,\nu_2(\R)/R$ and to $\nu_3$ with $a=16\,\nu_3(\R)/R$. The two sets $T_a$ have lengths at most $R/5$ and $R/4$, so that the complement~$T$ of their union in $(R,2R)$ is a measurable set of length at least $R-\frac R5-\frac R4\ge\frac R2$. For every $t\in T$ and $0R$, Lemma~\ref{lem:Jbasic}\ref{it:JL1} gives $J_r(\ind_G)\le4\,m(G)\le4\,C_d\,m(B(x,R))$, which is smaller than the right-hand side above. \emph{Step 5: the boundary.} Since $G$ is open and its closure is contained in $\{y:\ d(x,y)\le t\}$, we have $\partial G\subset\{y:\ d(x,y)=t\}$. Let $00$ and $f\in L^1_{\mathrm{loc}}(X,m)$. There is a function $f_\varepsilon\colon X\to\R$ which is Lipschitz on bounded sets and satisfies, for every $x_0\in X$ and $\rho>0$, with $W=B(x_0,\rho)$ and $W'=B(x_0,\rho+6\varepsilon)$, \begin{equation}\label{eq:convolution} \int_W|f-f_\varepsilon|\,dm\le C\,J_{6\varepsilon}(f;W')\,,\qquad\int_W\Lip f_\varepsilon\,dm\le\frac C\varepsilon\,J_{6\varepsilon}(f;W')\,. \end{equation} \end{lemma} \begin{proof} Let $\Xi$ be an $\varepsilon$-net with a Voronoi partition $(V_z)_{z\in\Xi}$, and for $z\in\Xi$ let \begin{equation*} \psi_z(y)=\min\big\{1,\,(2-d(y,z)/\varepsilon)_+\big\}\,,\qquad\varphi_z=\frac{\psi_z}{\sum_{w\in\Xi}\psi_w}\,,\qquad f_\varepsilon=\sum_{z\in\Xi}f_{B(z,\varepsilon)}\,\varphi_z\,. \end{equation*} The function $\psi_z$ equals $1$ on $B(z,\varepsilon)$, vanishes outside $B(z,2\varepsilon)$, and has the Lipschitz constant $1/\varepsilon$. By Lemma~\ref{lem:nets}, at each point at least one and at most $\kappa(2)$ of the functions $\psi_w$ do not vanish. Hence $1\le\sum_w\psi_w\le\kappa(2)$, the functions $\varphi_z$ form a partition of unity with $\varphi_z=0$ outside $B(z,2\varepsilon)$, and each $\varphi_z$ has the Lipschitz constant $(2\kappa(2)+1)/\varepsilon$. On a bounded set only finitely many terms of the sum which defines $f_\varepsilon$ do not vanish, so that $f_\varepsilon$ is Lipschitz on bounded sets. \emph{The first estimate.} Let $y\in X$. If $\varphi_z(y)\ne0$ and $a\in B(z,\varepsilon)$, then $d(y,a)<3\varepsilon$ and $m(B(z,\varepsilon))\ge c\,m(B(y,3\varepsilon))$, so that $m(B(z,\varepsilon))^{-1}\le C\,k_{3\varepsilon}(y,a)$ by~\eqref{eq:kernel}. Since $\sum_z\varphi_z=1$, \begin{align*} |f(y)-f_\varepsilon(y)|&\le\sum_{z\in\Xi\cap B(y,2\varepsilon)}\frac1{m(B(z,\varepsilon))}\int_{B(z,\varepsilon)}|f(y)-f(a)|\,dm(a)\\ &\le C\int_Xk_{3\varepsilon}(y,a)\,|f(y)-f(a)|\,dm(a)\,. \end{align*} Integrating over $y\in W$ we get $\int_W|f-f_\varepsilon|\,dm\le C\,J_{3\varepsilon}(f;B(x_0,\rho+3\varepsilon))\le C\,J_{6\varepsilon}(f;W')$, by Lemma~\ref{lem:Jbasic}\ref{it:Jkernel}. \emph{The second estimate.} Let $w\in\Xi$, $y\in V_w$ and $d(y,y')<\varepsilon$. Since $\sum_z(\varphi_z(y')-\varphi_z(y))=0$, \begin{equation*} f_\varepsilon(y')-f_\varepsilon(y)=\sum_{z\in\Xi}\big(f_{B(z,\varepsilon)}-f_{B(w,\varepsilon)}\big)\big(\varphi_z(y')-\varphi_z(y)\big)\,, \end{equation*} and a term of this sum vanishes unless $d(z,w)<4\varepsilon$. Hence \begin{equation*} \Lip f_\varepsilon(y)\le\frac{2\kappa(2)+1}\varepsilon\sum_{z\in\Xi\cap B(w,4\varepsilon)}\big|f_{B(z,\varepsilon)}-f_{B(w,\varepsilon)}\big|\qquad\text{for }y\in V_w\,. \end{equation*} If $a\in B(z,\varepsilon)$ and $b\in B(w,\varepsilon)$ with $d(z,w)<4\varepsilon$, then $d(a,b)<6\varepsilon$ and $m(B(z,\varepsilon))^{-1}\le C\,k_{6\varepsilon}(a,b)$ by~\eqref{eq:kernel}. Thus \begin{align*} m(V_w)\,\big|f_{B(z,\varepsilon)}-f_{B(w,\varepsilon)}\big|&\le\frac{1}{m(B(z,\varepsilon))}\iint_{B(z,\varepsilon)\times B(w,\varepsilon)}|f(a)-f(b)|\,dm(a)\,dm(b)\\ &\le C\,\mu_{6\varepsilon}^{f}\big(B(z,\varepsilon)\times B(w,\varepsilon)\big)\,, \end{align*} where $\mu^f_{6\varepsilon}$ is the measure with the density $|f(a)-f(b)|$ with respect to $\mu_{6\varepsilon}$. If $V_w$ meets $W$, then $B(w,\varepsilon)$ and the balls $B(z,\varepsilon)$ with $d(z,w)<4\varepsilon$ are contained in~$W'$. Each point of $X\times X$ belongs to at most $\kappa(1)^2$ of the products $B(z,\varepsilon)\times B(w,\varepsilon)$. Summing over $z$ and over the points $w$ such that $V_w$ meets~$W$, we obtain \begin{equation*} \int_W\Lip f_\varepsilon\,dm\le\frac C\varepsilon\,\mu^f_{6\varepsilon}(W'\times W')=\frac C\varepsilon\,J_{6\varepsilon}(f;W')\,.\qedhere \end{equation*} \end{proof} \begin{proposition}\label{prop:PI} Hypothesis~\hP{} holds with $\lambda=1$ if and only if~\hPI{} holds. \end{proposition} \begin{proof} \emph{\hP{} implies~\hPI.} Let $u\colon X\to\R$ be Lipschitz with the constant~$\ell$, and let $B$ be a ball of radius~$R$. If $R>4D$, then $B=X$ is also a ball of radius $2D$; hence we may assume that $R\le4D$. For $h>0$ let \begin{equation*} g_h(x)=\sup\Big\{\frac{|u(x)-u(y)|}{d(x,y)}:\ y\in X,\ 00$. In particular $S_1(f)\le C\,\|Df\|(X)$. \end{enumerate} \end{proposition} \begin{proof} We first note that \begin{equation}\label{eq:Jvanish} \lim_{r\downarrow0}J_r(f;W)=0\qquad\text{for every bounded measurable set }W\subset X\,. \end{equation} Indeed, if $g$ is continuous with compact support, then $J_r(g;W)\le2\,m(W)\sup\{|g(x)-g(y)|:\ d(x,y)0$ and $W=B(x_0,\rho)$, and let $\Xi$ be an $h$-net. As in Step~1 of the proof of Theorem~\ref{th:scales}, and by~\eqref{eq:PI} and Lemma~\ref{lem:nets}\ref{it:netcover}, \begin{align*} J_h(u_k;W)&\le2\,C_d^{\,3}\sum_{z\in\Xi}\int_{B(z,2h)}|u_k-(u_k)_{B(z,2h)}|\,dm\\ &\le4\,C_d^{\,3}\,C_{PI}\,h\sum_{z\in\Xi}\int_{B(z,2\Lambda_{PI}h)}\Lip u_k\,dm\le C\,h\int_X\Lip u_k\,dm\,. \end{align*} By Lemma~\ref{lem:Jbasic}\ref{it:JL1}, $J_h(u_k;W)\to J_h(f;W)$ as $k\to\infty$. Hence $J_h(f;W)\le C\,h\,\|Df\|(X)$, and we let $\rho\to\infty$. \end{proof} \begin{remark}[Variants of the definition]\label{rem:variants} In~\cite{Mir} and in much of the later literature the slope $\Lip u_k$ in~\eqref{eq:miranda} is replaced by the lower slope of~$u_k$, defined with a lower limit as the radius tends to zero, or by an arbitrary upper gradient of~$u_k$. Since $\Lip u_k$ dominates the lower slope and is an upper gradient of the locally Lipschitz function~$u_k$ (see~\cite{HKST}), the functionals obtained in this way are at most $\|Df\|(X)$. Under~\hPI{} they are comparable to it: by the theorem of Keith~\cite[Theorem~2]{Keith}, the inequality~\eqref{eq:PI} then holds with any upper gradient of~$u$ in place of $\Lip u$, and the lower slope of a locally Lipschitz function is an upper gradient; the proof of Proposition~\ref{prop:miranda}\ref{it:mir-upper} therefore applies to these functionals, and part~\ref{it:mir-lower} bounds $\|Df\|(X)$. For the equivalence of several definitions of the total variation in general metric measure spaces see Ambrosio and Di~Marino~\cite{ADM}. \end{remark} For an open set $U\subset X$ let $\|Df\|(U)$ be defined as in~\eqref{eq:miranda}, with $U$ in place of~$X$: the infimum is over the sequences of locally Lipschitz functions $u_k\colon U\to\R$ which converge to~$f$ in $L^1_{\mathrm{loc}}(U)$. If $\|Df\|(X)<\infty$, the set function $U\mapsto\|Df\|(U)$ is the restriction to the open sets of a finite Borel measure, the \emph{total variation measure} $\|Df\|$; see~\cite[Theorem~3.4]{Mir} and~\cite{ADM}. Under~\hPI{} it is comparable to the measures of Chapter~\ref{sec:measures}. \begin{proposition}[BV measures and the total variation measure]\label{prop:mirandameasure} Assume~\hPI{} and let $\lambda=1$. Let $f\in L^1_{\mathrm{loc}}(X,m)$ with $\|Df\|(X)<\infty$. Then, for every ball~$B$, \begin{equation*} \|Df\|(B)\le C\,\mu_f^+(2B)\,,\qquad\mu_f^+(B)\le C\,\|Df\|(2B)\,. \end{equation*} Consequently $C^{-1}\,\|Df\|\le\mu\le C\,\|Df\|$ for $\mu=\mu_f^+$, for the coarea measure $\mu=\nu_f$, and for every BV measure $\mu$ of~$f$. \end{proposition} \begin{proof} By Propositions~\ref{prop:balls} and~\ref{prop:PI}, hypotheses~\hP{} and~\hC{} hold with $\lambda=1$, and $\Var(f)<\infty$ by Proposition~\ref{prop:miranda}; hence $\mu_f^+$ is finite and the results of Chapter~\ref{sec:measures} apply. Let $B=B(x_0,\rho)$. \emph{The first inequality.} Let $\varepsilon_k\downarrow0$ with $12\,\varepsilon_k\le\rho$, and let $u_k=f_{\varepsilon_k}$ be the functions of Lemma~\ref{lem:convolution}. They are locally Lipschitz and converge to~$f$ in $L^1_{\mathrm{loc}}(X,m)$, by~\eqref{eq:convolution} and~\eqref{eq:Jvanish}. By~\eqref{eq:convolution} for $W=B$ and Proposition~\ref{prop:caratheodory}\ref{it:car-lower}, \begin{equation*} \|Df\|(B)\le\liminf_{k\to\infty}\int_B\Lip u_k\,dm\le\liminf_{k\to\infty}\frac C{\varepsilon_k}\,J_{6\varepsilon_k}\big(f;\tfrac32B\big)\le6\,C\Var^+\big(f;\tfrac32B\big)\le C\,\mu_f^+(2B)\,. \end{equation*} \emph{The second inequality.} Let $u_k\colon2B\to\R$ be locally Lipschitz functions which converge to~$f$ in $L^1_{\mathrm{loc}}(2B)$ and satisfy $\int_{2B}\Lip u_k\,dm\to\|Df\|(2B)$. Let $h>0$ with $(2\Lambda_{PI}+1)\,h\le\rho/2$, let $\Xi$ be an $h$-net and $\Xi_B=\{z\in\Xi:\ B(z,h)\cap B\ne\emptyset\}$. For $z\in\Xi_B$ the ball $B(z,2\Lambda_{PI}h)$ is contained in $\frac32B$. The function $u_k$ is Lipschitz on the compact set $\overline{\frac32B}\subset2B$, hence it coincides on $\frac32B$ with a Lipschitz function on~$X$, and~\eqref{eq:PI} applies to the balls $B(z,2h)$, $z\in\Xi_B$. As in the proof of Proposition~\ref{prop:miranda}\ref{it:mir-upper}, \begin{align*} J_h(u_k;B)&\le2\,C_d^{\,3}\sum_{z\in\Xi_B}\int_{B(z,2h)}|u_k-(u_k)_{B(z,2h)}|\,dm\\ &\le C\,h\sum_{z\in\Xi_B}\int_{B(z,2\Lambda_{PI}h)}\Lip u_k\,dm\le C\,h\int_{2B}\Lip u_k\,dm\,. \end{align*} Since $u_k\to f$ in $L^1(B,m)$, Lemma~\ref{lem:Jbasic}\ref{it:JL1} gives $J_h(f;B)\le C\,h\,\|Df\|(2B)$ for all small~$h$. Hence $\Var^+(f;B)\le C\,\|Df\|(2B)$, and $\mu_f^+(B)\le C\Var(f;B)\le C\,\|Df\|(2B)$ by Proposition~\ref{prop:caratheodory}\ref{it:car-upper}. \emph{The measures.} Lemma~\ref{lem:compare} gives $C^{-1}\,\|Df\|\le\mu_f^+\le C\,\|Df\|$, and the remaining assertions follow from Theorems~\ref{th:bvmeasures}\ref{it:bvm-compare} and~\ref{th:coareameasure}\ref{it:cm-compare}. \end{proof} \begin{proof}[Proof of Theorem~\ref{th:classical}] Part~\ref{it:cl-C} is Proposition~\ref{prop:balls}, part~\ref{it:cl-lower} is Corollary~\ref{cor:lambda1}, part~\ref{it:cl-PI} is Proposition~\ref{prop:PI}, and part~\ref{it:cl-BV} is Proposition~\ref{prop:miranda} together with the inequality $\Var(f)\le S_1(f)$, and Proposition~\ref{prop:mirandameasure}. \end{proof} \begin{corollary}\label{cor:PIspaces} Assume~\hPI. Then~\hP, \hC{} and~\hCp{} hold with $\lambda=1$. Consequently, with $\lambda=1$: \begin{enumerate}[label=\textup{(\roman*)}] \item $BV(X)=\Bes1(X)=\{f\in L^1(X,m):\ \|Df\|(X)<\infty\}$, and $\lambda_1^*=\lambda_1^\#=1$; \item the coarea, relative isoperimetric and Sobolev inequalities of Chapter~\ref{sec:bv} hold; \item $c\,\Hcod1(\partial^*E)\le\|D\ind_E\|(X)\le C\,\Hcod1(D_\eta(E))$ for every measurable set~$E$, and $\codim_{tH}(X,d,m)=1$; \item Theorems~\ref{th:mixed} and~\ref{th:approx} hold, and the sets $E_h$ of Theorem~\ref{th:approx} are unions of locally finite families of balls. \end{enumerate} \end{corollary} \begin{proof} This follows from Propositions~\ref{prop:balls}, \ref{prop:PI} and~\ref{prop:miranda} and from Theorems~\ref{th:metric}, \ref{th:isop}, \ref{th:federer}, \ref{th:dimension}, \ref{th:mixed} and~\ref{th:approx}. \end{proof} \section{Weighted Euclidean spaces}\label{sec:weights} The simplest spaces which satisfy the standing assumptions and~\hPI{} without being Ahlfors regular are the weighted Euclidean spaces. They show which statements of the Ahlfors regular theory do not extend to doubling measures. \begin{remark}[Weights]\label{rem:weights} Let $w$ be a Muckenhoupt $A_1$ weight on $\R^n$, that is, a non-negative locally integrable function whose maximal function satisfies $Mw\le A\,w$ almost everywhere, and let $X=\R^n$ with the Euclidean distance and the measure $m=w\,dx$. Then $m$ is doubling, and~\hPI{} holds: for a Lipschitz function~$u$, a ball $B$ of radius~$R$ and the mean $\bar u$ of $u$ on $B$ for the Lebesgue measure, the classical estimate $|u(x)-\bar u|\le C\int_B|\nabla u(y)|\,|x-y|^{1-n}\,dy$ for $x\in B$, the bound $\int_Bw(x)\,|x-y|^{1-n}\,dx\le C\,R\,Mw(y)$ and~\eqref{eq:mean} give $\int_B|u-u_B|\,w\,dx\le C\,A\,R\int_B|\nabla u|\,w\,dx$. Hence the results of this memoir hold with $\lambda=1$ (Corollary~\ref{cor:PIspaces}). Consider the weights $w(x)=|x|^{\alpha}$ with $-n<\alpha<0$, which belong to~$A_1$. Then $m(B(0,r))$ is a multiple of $r^{n+\alpha}$, and $m(B(x,r))\asymp|x|^{\alpha}\,r^n$ for $r\le|x|/2$. \begin{itemize} \item \emph{The gauge is not monotone, and points may have infinite measure.} For $x\ne0$, the function $r\mapsto\xi_1(B(x,r))$ is comparable to $|x|^{\alpha}\,r^{n-1}$ for $r\le|x|/2$ and to $r^{n+\alpha-1}$ for $r\ge2|x|$. If $n\ge2$ and $n+\alpha<1$, it is not monotone. If $n+\alpha<1$, then $\Hcod1(\{0\})=\infty$, and by Theorem~\ref{th:federer} every set $E$ with $0\in\partial^*E$ has infinite perimeter. An example is the plane with the weight $|x|^{-3/2}$. \item \emph{The endpoint $Q=\lambda$.} On the line, $n=1$, \eqref{eq:decay} holds with $Q=1=\lambda$. Every point has positive measure $\Hcod1(\{x\})\asymp|x|^{\alpha}$, and Proposition~\ref{prop:endpoint} states that $\Per(E)\asymp\sum_{x\in\partial^*E}|x|^{\alpha}$. \item \emph{The global inequalities fail.} For every $r>0$ we have $\inf_xm(B(x,r))=0$, and the isoperimetric profile vanishes identically: the Euclidean balls $E=B(x,\rho)$ with $\rho\le|x|/2$ and $m(E)=v$ satisfy $\Per(E)\le C\,v/\rho$ by~\eqref{eq:Jset}, and $\rho\to\infty$ as $|x|\to\infty$. Hence an inequality $m(E)^{\alpha'}\le C\Per(E)$ fails for every exponent~$\alpha'$, in accordance with Theorem~\ref{th:isop}\ref{it:isop-global}, whereas the scale-invariant inequalities of Theorem~\ref{th:isop}\ref{it:isop-local} hold with $Q=n$. \item \emph{The topological Hausdorff dimension.} We have $d_{tH}(\R^n)=n$~\cite{BBE}, and by Corollary~\ref{cor:PIspaces} the topological Hausdorff codimension of~$\R^n$ with the measure~$m$ is~$1$ for every weight in~$A_1$. Thus $d_{tH}(X)=Q-\lambda+1$ holds with $Q=n$, which is the Hausdorff dimension of~$X$ and the smallest exponent in~\eqref{eq:decay}, and not with the local dimension $n+\alpha$ of~$m$ at the origin. In general, let $X$ be connected and let~\eqref{eq:decay} hold with the exponent~$Q$. For every bounded set $A\subset X$ there is $c>0$ such that $\xi_\beta(B(x,r))\ge c\,r^{Q-\beta}$ for all balls $B(x,r)$ with $r\le1$ which meet~$A$. Hence, if $A\ne\emptyset$ and $\Hcod\beta(A)=0$, then $\beta\le Q$ and $\Hc^{Q-\beta}(A)=0$ for the spherical Hausdorff measure of Section~\ref{sec:ahlfors-hyp}, and the second half of the proof of Lemma~\ref{lem:codimdim} gives \begin{equation*} d_{tH}(X)\le Q-\codim_{tH}(X,d,m)+1\,. \end{equation*} The reverse inequality uses the upper bound $m(B(x,r))\le C\,r^Q$ of an Ahlfors regular measure. \end{itemize} Another instructive example is the cylinder $\R\times S^1$ with its Riemannian distance and measure, which satisfies~\hPI. Here $m(B(x,r))\asymp\min\{r^2,r\}$, \eqref{eq:decay} holds with $Q=2$, and Theorem~\ref{th:relisop}\ref{it:isop-volume} gives $\Per(E)\ge c\min\{m(E)^{1/2},1\}$ for $m(E)<\infty$. Both regimes are attained, by small discs and by the sets $[0,\ell]\times S^1$, so that the isoperimetric profile is comparable to $\min\{v^{1/2},1\}$ and not to a power of~$v$. \end{remark} \section{The coarea measures for the exponent one}\label{sec:coarea-one} Under~\hPI{} a function $f$ with $\|Df\|(X)<\infty$ carries four kinds of measures: the total variation measure $\|Df\|$, its BV measures, the coarea measure~$\nu_f$, and the relaxed coarea measure $\overline\nu_f$ of Section~\ref{sec:relaxed}. They are mutually comparable, by Proposition~\ref{prop:mirandameasure} and Theorem~\ref{th:relaxed}. In~$\R^n$ they are constant multiples of the classical variation measure~$|Df|$, and the relaxation is trivial. For a distance defined by a norm which is not Euclidean this is no longer true: on a hyperplane the densities of these measures are three different functions of the normal. Let $\omega_k$ be the volume of the unit ball of~$\R^k$, with $\omega_0=1$. \begin{proposition}[Euclidean spaces]\label{prop:euclid-measures} Let $X=\R^n$ with the Euclidean distance and the Lebesgue measure, let $\lambda=1$, and let $f\in L^1_{\mathrm{loc}}(\R^n)$ with $|Df|(\R^n)<\infty$. Then $\|Df\|=|Df|$, \begin{equation*} \nu_f=\overline\nu_f=\frac{\omega_n}{\omega_{n-1}}\,|Df|\,, \end{equation*} and $f$ has the unique BV measure $\dfrac{2\,\omega_{n-1}}{(n+1)\,\omega_n}\,|Df|$. \end{proposition} For $n=1$ the three constants are $1$, $2$ and $\frac12$, in accordance with Example~\ref{ex:line-measures}. \begin{proof} \emph{The total variation.} Let $U\subset\R^n$ be open. A locally Lipschitz function $u$ on~$U$ satisfies $\Lip u=|\nabla u|$ almost everywhere, by Rademacher's theorem. Hence $\|Df\|(U)\ge|Df|(U)$ by the lower semicontinuity of the classical variation, and $\|Df\|(U)\le|Df|(U)$ by the approximation of functions of bounded variation by smooth functions~\cite[Theorem~3.9]{AFP}, whose proof applies to locally integrable functions of finite variation in~$U$. \emph{The coarea measure.} Since $\xi_1(B(x,r))=\omega_n\,r^{n-1}$, we have $\Hcod1=\frac{\omega_n}{\omega_{n-1}}\,\mathcal S^{n-1}$, where $\mathcal S^{n-1}$ is the spherical Hausdorff measure of dimension $n-1$~\cite[2.10.2]{Fed}. Let $E$ be a set of finite perimeter. By the theorems of De~Giorgi and Federer~\cite[Theorems~3.59 and~3.61]{AFP}, the reduced boundary $\mathcal FE$ is countably $(n-1)$-rectifiable, it is contained in $\partial^*E$, and \begin{equation*} |D\ind_E|=\Hc^{n-1}\llcorner\mathcal FE\,,\qquad\Hc^{n-1}(\partial^*E\setminus\mathcal FE)=0\,. \end{equation*} On rectifiable sets the measures $\mathcal S^{n-1}$ and $\Hc^{n-1}$ coincide~\cite[3.2.26]{Fed}, and $\mathcal S^{n-1}\le2^{n-1}\,\Hc^{n-1}$. Hence $\nu_E=\Hcod1\llcorner\partial^*E=\frac{\omega_n}{\omega_{n-1}}\,|D\ind_E|$, and the coarea formula~\cite[Theorem~3.40]{AFP} gives $\nu_f=\frac{\omega_n}{\omega_{n-1}}\,|Df|$. \emph{The relaxed coarea measure.} If $U$ is open and $E_j\to E$ in $L^1_{\mathrm{loc}}(U)$, then $|D\ind_E|(U)\le\liminf_j|D\ind_{E_j}|(U)$, that is, $\nu_E(U)\le\liminf_j\nu_{E_j}(U)$. Hence $\overline\nu_E(U)\ge\nu_E(U)$ in~\eqref{eq:relaxed}, so that $\overline\nu_E=\nu_E$ and $\overline\nu_f=\nu_f$. \emph{The BV measures.} We have \begin{equation*} \frac{k_r(x,y)}r=\frac{\rho_r(x-y)}{|x-y|}\,,\qquad\text{where}\quad\rho_r(z)=\frac{|z|\,\ind_{\{|z|0$ and $N\ge1$, the set $A$ is therefore covered by $N$ squares of radius $(1+\varepsilon)\,|I|/(2N)$, of total cost $2\,(1+\varepsilon)\,|I|$. Letting $N\to\infty$ and $\varepsilon\downarrow0$ we get $\Hcod1(A)\le2\,|I|=2\,\|n\|_\infty\,\Hc^1(A)$, and this inequality extends from these sets to all Borel subsets of~$\ell$. Thus $\Hcod1\llcorner\ell=2\,\|n\|_\infty\,\Hc^1\llcorner\ell$. Since a line through the centre of a square divides it into two parts of equal measure, $\partial^*E\cap U=\ell\cap U$, and $\nu_E(A)=2\,\|n\|_\infty\,\Hc^1(A\cap\ell)$ for every Borel set $A\subset U$. \emph{Step 3: the relaxed coarea measure.} Let $V\subset U$ be open and let $F$ be a set of finite perimeter. For $t\in\R$ let $F^t=\{s\in\R:\ (t,s)\in F\}$ and $V^t=\{s\in\R:\ (t,s)\in V\}$. By the slicing theory of functions of bounded variation~\cite[Section~3.11]{AFP}, for almost every~$t$ the points of the essential boundary of $F^t$ in the open set~$V^t$ belong to $\{s:\ (t,s)\in\partial^*F\}$, and their number $g_F(t)\in[0,\infty]$ satisfies \begin{equation*} \int_{\R}g_F(t)\,dt=|D_2\ind_F|(V)\,, \end{equation*} where $D_2\ind_F$ is the distributional derivative of $\ind_F$ with respect to~$x_2$ and $|D_2\ind_F|$ its total variation. By~\eqref{eq:maxnorm-proj} for the set $V\cap\partial^*F$, with $i=1$ and $g=g_F$, \begin{equation*} \nu_F(V)=\Hcod1(V\cap\partial^*F)\ge2\,|D_2\ind_F|(V)\,. \end{equation*} Let $F_j\to E$ in $L^1_{\mathrm{loc}}(V)$. Since $|D_2\ind_F|(V)$ is lower semicontinuous with respect to this convergence, and $D\ind_E=-n\,\Hc^1\llcorner\ell$ in~$U$, \begin{equation*} \liminf_{j\to\infty}\nu_{F_j}(V)\ge2\,|D_2\ind_E|(V)=2\,|n_2|\,\Hc^1(V\cap\ell)=\nu_E(V)\,. \end{equation*} Hence $\overline\nu_E(V)\ge\nu_E(V)$ for every open set $V\subset U$, and $\overline\nu_E$ and $\nu_E$ coincide on the Borel subsets of~$U$. \emph{Step 4: the total variation measure.} A locally Lipschitz function $u$ satisfies $\Lip u=\|\nabla u\|_1=|\partial_1u|+|\partial_2u|$ almost everywhere, because the slope is taken with respect to the maximum norm. Let $V\subset U$ be open and bounded. If the functions $u_k$ are locally Lipschitz on~$V$ and $u_k\to\ind_E$ in $L^1_{\mathrm{loc}}(V)$, the lower semicontinuity of the variations of the two partial derivatives gives \begin{equation*} \liminf_{k\to\infty}\int_V\Lip u_k\,dm\ge|D_1\ind_E|(V)+|D_2\ind_E|(V)=\|n\|_1\,\Hc^1(V\cap\ell)\,. \end{equation*} On the other hand the functions $u_k(x)=\min\{1,\max\{0,k\,(c-\langle x,n\rangle)\}\}$ converge to $\ind_E$ in $L^1_{\mathrm{loc}}(U)$, and $\Lip u_k=k\,\|n\|_1$ on the strip $\{0|\tau|\}\big)\,. \end{equation*} The function $g$ is bounded with compact support, and $\int_\R g(\tau)\,d\tau=\frac12\int_{(-1,1)^2}\langle z,n\rangle_+\,dz=\psi(n)$. Hence \begin{equation*} \int\varphi\,dm_{r,\ind_E}=\int_{\R^2}\varphi(x)\,\frac1r\,g\Big(\frac{\langle x,n\rangle-c}r\Big)\,dx\longrightarrow\psi(n)\int_\ell\varphi\,d\Hc^1\qquad\text{as }r\downarrow0\,, \end{equation*} and every BV measure of $\ind_E$ coincides with $\psi(n)\,\Hc^1\llcorner\ell$ on the Borel subsets of~$U$. \end{proof} \begin{example}[A square and a rotated square]\label{ex:maxnorm} In the setting of Proposition~\ref{prop:maxnorm}, let $S=(0,1)^2$ and $T=\{x\in\R^2:\ |x_1|+|x_2|<1\}$. The unit normals to the sides of~$S$ are $\pm e_1$ and $\pm e_2$, and those to the sides of~$T$ are the four vectors $(\pm1,\pm1)/\sqrt2$. We have $\psi(e_1)=\frac12$ and $\psi\big((1,1)/\sqrt2\big)=\frac{\sqrt2}3$. A point has $\Hcod1$-measure zero, because $\xi_1(B(x,r))=4r$; hence the measures $\nu_E$, and the measures which are comparable to them, do not charge the vertices. Proposition~\ref{prop:maxnorm}, applied near the sides, gives the following measures. \begin{center} \renewcommand{\arraystretch}{1.3} \begin{tabular}{lccc} \toprule & $\nu_E=\overline\nu_E$ & $\|D\ind_E\|$ & BV measure of $\ind_E$\\ \midrule $E=S$ & $2\,\Hc^1\llcorner\partial S$ & $\Hc^1\llcorner\partial S$ & $\tfrac12\,\Hc^1\llcorner\partial S$\\ $E=T$ & $\sqrt2\,\Hc^1\llcorner\partial T$ & $\sqrt2\,\Hc^1\llcorner\partial T$ & $\tfrac{\sqrt2}3\,\Hc^1\llcorner\partial T$\\ \bottomrule \end{tabular} \end{center} The relaxed coarea measure is twice the total variation measure for the square~$S$, and it is equal to it for the rotated square~$T$; the BV measure is one half of the total variation measure for~$S$ and one third of it for~$T$. Thus no two of the three measures $\overline\nu_E$, $\|D\ind_E\|$ and the BV measure of $\ind_E$ are proportional with a constant which does not depend on the set. \end{example} The three densities $2\,\|n\|_\infty$, $\|n\|_1$ and $\psi(n)$ are norms of the normal vector. The second one is the dual of the norm which defines the distance, and the third one is the support function of the moment body of the unit ball, up to a constant; for the fractional perimeters defined by a norm, Ludwig~\cite{Lud} proved that they converge to the perimeter defined by the moment body, and not by the unit ball itself. In the Euclidean case the three norms are invariant under rotations, hence proportional, and this is why the measures of Proposition~\ref{prop:euclid-measures} differ only by constants. In general, among the measures of this memoir, the relaxed coarea measure is the one which is determined by the Hausdorff measure $\Hcod1$, the total variation measure is the one which is determined by the slopes, and the BV measures are the ones which are determined by the energies. \section{Classical variation from the heat flow}\label{sec:heat-classical} On a closed Riemannian manifold let $m$ be Riemannian volume and let $p_t$ be the heat kernel of the Laplace--Beltrami operator, with the normalization $\partial_t u=\Delta u$. For every $f\in L^1(X,m)$, \begin{equation}\label{eq:heat-classical} \lim_{t\downarrow0}\frac{1}{\sqrt t} \iint_{X\times X}|f(x)-f(y)|p_t(x,y)\,dm(x)\,dm(y) =\frac{2}{\sqrt\pi}\,\|Df\|(X)\,. \end{equation} For functions of bounded variation, Alonso Ruiz and Baudoin prove this formula on closed manifolds~\cite[Theorem~1.1]{ABmanifold}. Brena, Pasqualetto and Pinamonti prove the formula for all integrable functions with the canonical heat kernel on every $\mathrm{RCD}(K,N)$ space, where $K\in\R$ is the synthetic Ricci lower bound and $1\le N<\infty$ is the dimension bound~\cite[Theorem~1.2]{BPPheat}. The equality holds in $[0,\infty]$, so finiteness of the lower limit characterizes classical bounded variation. For a set $E$ of finite measure, symmetry gives \begin{equation*} \lim_{t\downarrow0}\frac{1}{\sqrt t}\int_{X\setminus E}P_t\ind_E\,dm =\frac{1}{\sqrt\pi}\,\|D\ind_E\|(X)\,, \end{equation*} where $P_t$ is the heat semigroup. The constant uses the normalization of~\eqref{eq:miranda}. For a bounded nondegenerate interval in $\R$ there are two endpoints, so that the classical perimeter is~$2$, the one-sided heat limit is $2/\sqrt\pi$, and the perimeter $\Per(E)$ of Example~\ref{ex:line} is~$1$. \begin{example}[Gaussian measure]\label{ex:heat-gaussian} Let $\gamma$ be standard Gaussian measure on $\R^n$. It fails global doubling. Indeed, the balls $B(Re_1,R/2)$ have measure tending to zero as $R\to\infty$, while the balls $B(Re_1,R)$ increase to the half-space $\{x_1>0\}$. The Ornstein--Uhlenbeck generator $\mathcal L=\Delta-x\cdot\nabla$ satisfies the classical Bakry--\'Emery condition $\mathrm{BE}(1,\infty)$, since its iterated carr\'e du champ on smooth functions is $\Gamma_2(g)=\|\nabla^2g\|_{\mathrm{HS}}^2+|\nabla g|^2$. Its semigroup is given by Mehler's formula \begin{equation*} T_t g(x)=\int_{\R^n}g\big(e^{-t}x+\sqrt{1-e^{-2t}}\,y\big)\,d\gamma(y)\,. \end{equation*} Differentiating gives $\nabla T_tg=e^{-t}T_t(\nabla g)$ on smooth functions. Integrating the resulting gradient bound against the invariant measure $\gamma$ and passing to the relaxation gives \begin{equation*} \|D_\gamma T_t f\|(\R^n)\le e^{-t}\|D_\gamma f\|(\R^n)\,, \end{equation*} where $\|D_\gamma f\|$ denotes Gaussian total variation. The contraction factor is sharp for every $t>0$, since $f(x)=x_1$ has variation one and $T_tf=e^{-t}f$. For a set $E$ of finite Gaussian perimeter $\Per_\gamma(E)=\|D_\gamma\ind_E\|(\R^n)$ one also has \begin{equation}\label{eq:heat-OU} \lim_{t\downarrow0}\frac{1}{\sqrt t}\int_{E^c}T_t\ind_E\,d\gamma =\frac{1}{\sqrt\pi}\,\Per_\gamma(E)\,. \end{equation} The same formula holds on an abstract Wiener space for its Ornstein--Uhlenbeck semigroup, with perimeter defined by variation in the Cameron--Martin directions~\cite[Section~3]{AMPwiener}. Thus Gaussian perimeter admits an exact heat-flow formula even in infinite dimension. \end{example} \chapter{Ahlfors regular spaces}\label{sec:ahlfors} \begin{overview} In this chapter and in Part~III the measure $m$ is Ahlfors regular of dimension $Q>0$, that is, \eqref{eq:ahlfors} holds, except where Section~\ref{sec:heat-BV} explicitly returns to a general doubling measure. Codimensions then become dimensions: the Hausdorff measure of codimension~$\lambda$ is comparable to the Hausdorff measure of dimension $s=Q-\lambda$. We translate the results of Chapters~\ref{sec:wm} to~\ref{sec:charact} into this language, and we prove the statements which use the Ahlfors regularity: the value $d_{tH}(X)=Q-\lambda+1$ of the topological Hausdorff dimension, and the isoperimetric profile. When $X$ is compact we determine the optimal rearrangement-invariant target of the Sobolev embedding and the approximation numbers of the inclusion of $BV(X)$ into $L^1(X,m)$. Section~\ref{sec:heat-BV} treats spaces with a heat kernel and compares the conclusions of~\hP{} with those of the weak Bakry--\'Emery estimate. \end{overview} \section{The main result} Let $m$ be Ahlfors regular of dimension~$Q$, as in~\eqref{eq:ahlfors}, and let \begin{equation*} s=Q-\lambda\,. \end{equation*} Then, for $00$ and $C$ such that the following holds for every measurable set $E\subset X$. \begin{enumerate}[label=\textup{(\roman*)}] \item\label{it:ahl-isop} If $B$ is a ball of radius $R\le D$, $B'=(1+2\Lambda)B$, $f\in L^1(B',m)$ and $b$ is a median of $f$ on~$B$, then \begin{equation*} v_B(E)^{s/Q}\le C\Per(E;B')\,,\qquad\|f-b\|_{L^{q,1}(B)}\le C\Var(f;B')\,. \end{equation*} The same inequalities hold with $B=B'=X$ if $D<\infty$. If $D=\infty$, $m(E)<\infty$ and $f\in L^1(X,m)$, then $m(E)^{s/Q}\le C\Per(E)$ and $\|f\|_{L^{q,1}(X)}\le C\Var(f)$. \item\label{it:ahl-fed} If~\hC{} holds, then $C^{-1}\,\Hc^s(\partial^*E)\le\Per(E)\le C\,\Hc^s(D_\eta(E))$ for some $\eta\in(0,\frac12]$. If $s=0$, then, without~\hC, \begin{equation*} C^{-1}\,\#\partial^*E\le\Per(E)\le C\,\#\Sigma_\gamma(E) \end{equation*} for some $\gamma\in(0,\frac12]$, and $\Sigma_\gamma(E)=\partial^*E$ if these sets are finite. \item\label{it:ahl-dim} If~\hC{} holds, then $X$ has a basis $\mathcal U$ of open sets with $\overline{\dim}_{\mathrm M}\,\partial U\le s$ for every $U\in\mathcal U$, and \begin{equation*} d_{tH}(X)=1+s=Q-\lambda+1\,. \end{equation*} If moreover $s>0$, then $v_B(E)^{s/Q}\le C\,\Hc^s_\infty(\partial E\cap LB)$ for every ball $B$ of radius $R\le D$, with $L=2+2\Lambda$. \item\label{it:ahl-profile} If~\hC{} holds and $s>0$, then, for $00$ in part~\ref{it:ahl-profile} is necessary: on the Sierpi\'nski gasket, where $s=0$, the measures of the sets of finite perimeter form a countable set (Theorem~\ref{th:gasket}). Without Ahlfors regularity the isoperimetric profile need not be comparable to a power, and of the relation $d_{tH}(X)=Q-\lambda+1$ only the inequality $d_{tH}(X)\le Q-\lambda+1$ remains, for the exponents~$Q$ of~\eqref{eq:decay}; see Remark~\ref{rem:weights}. On a compact Ahlfors $Q$-regular space satisfying~\hP{} and~\hC, the embedding $BV(X)\hookrightarrow L^p(X,m)$ is compact for $1\le pD$, \begin{equation}\label{eq:allr} c_A\min\{r,D\}^Q\le m(B(x,r))\le C_A\,r^Q\qquad\text{for all }x\in X\text{ and }r>0\,. \end{equation} This has the following consequences. \begin{itemize} \item \emph{The standing assumptions.} The measure $m$ is doubling, with $C_d=2^QC_A/c_A$, and~\eqref{eq:decay} holds with the exponent~$Q$ and $c_Q=c_A/C_A$. If $D=\infty$, then $m(B(x,r))\ge c_A\,r^Q$ for all $x\in X$ and $r>0$. \item \emph{The energies.} For $0Q$, then $\Hcod\lambda(A)=\infty$ for every non-empty set~$A$. \item \emph{Dimensions.} The Hausdorff dimension of~$A$ is denoted by $\dim_HA$. Its upper Minkowski dimension is \begin{equation*} \overline{\dim}_{\mathrm M}A=\limsup_{t\downarrow0}\frac{\log N(A,t)}{\log(1/t)}\,, \end{equation*} where $N(A,t)$ is the smallest number of balls of radius~$t$ which cover~$A$. We have $\dim_HA\le\overline{\dim}_{\mathrm M}A$. A maximal $t$-separated subset of~$A$ has at least $N(A,t)$ elements, and the balls of radius $t/2$ centred at its points are pairwise disjoint and contained in $B(A,t)$. Hence, by~\eqref{eq:ahlfors}, \begin{equation}\label{eq:coveringnumber} N(A,t)\le\frac{2^Q}{c_A}\,t^{-Q}\,m\big(B(A,t)\big)\qquad\text{for }0d_{tH}(X)$, and let $\mathcal U$ be a basis of open sets with $\dim_H\partial U\le t-1$ for every $U\in\mathcal U$. Then $t\ge1$. If $0<\beta\dim_H\partial U$, hence $\Hc^{Q-\beta}(\partial U)=0$ and $\Hcod\beta(\partial U)=0$ by~\eqref{eq:HA}, for every $U\in\mathcal U$. Thus $\codim_{tH}(X,d,m)\ge Q-t+1$, and letting $t\downarrow d_{tH}(X)$ we get $\codim_{tH}(X,d,m)\ge Q-d_{tH}(X)+1$. Conversely, let $0<\beta<\codim_{tH}(X,d,m)$, and let $\mathcal U$ be a basis of open sets with $\Hcod\beta(\partial U)=0$ for every $U\in\mathcal U$. Since some $\partial U$ is not empty, we have $\beta\le Q$. By~\eqref{eq:HA}, $\Hc^{Q-\beta}(\partial U)=0$ and $\dim_H\partial U\le Q-\beta$ for every $U\in\mathcal U$, hence $d_{tH}(X)\le Q-\beta+1$. Letting $\beta\uparrow\codim_{tH}(X,d,m)$ we get $d_{tH}(X)\le Q-\codim_{tH}(X,d,m)+1$. \end{proof} \section{Sets of prescribed measure}\label{sec:profile} The isoperimetric inequality bounds the perimeter of a set of given measure from below. Is this bound attained, up to a constant, for every prescribed measure? Hypothesis~\hC{} gives sets of small perimeter whose measures are comparable to those of balls, and not sets of exactly prescribed measure. The next theorem shows that, when $s>0$, the gap can be filled. \begin{theorem}[Isoperimetric profile]\label{th:profiles} Assume~\hP{} and~\hC{} with $s=Q-\lambda>0$. Let $00$. \begin{lemma}\label{lem:prescribed} Assume~\hC{} with $s>0$. Let $02m(F)$. Then $m(B(z_j,\rho)\cap F)<\frac12c_A\rho^Q$ for some~$j$, and $m(B(z_j,\rho)\setminus F)\ge\frac12c_A\rho^Q\ge c_1\rho^Q$. \emph{Step 2: construction.} We define by induction measurable sets $\emptyset=E_0\subset E_1\subset\cdots$ and numbers $v_k=v-m(E_k)\ge0$, starting with $v_0=v$. If $v_k=0$ we stop. Otherwise let \begin{equation*} \rho_k=\frac1M\Big(\frac{v_k}{C_A}\Big)^{1/Q}\,,\qquad\text{so that}\qquad\rho_k\le D\quad\text{and}\quad C_A\,(M\rho_k)^Q=v_k\,. \end{equation*} By Step~1 for $F=E_k$ there is $x_k$ with $m(B(x_k,\rho_k)\setminus E_k)\ge c_1\rho_k^Q$. Let $G_k$ be a set given by~\hC{} for the ball $B(x_k,\rho_k)$, and let $E_{k+1}=E_k\cup G_k$. Since $m(G_k)\le m(B(x_k,M\rho_k))\le v_k$, we have $m(E_{k+1})\le v$, and \begin{equation*} v_{k+1}=v_k-m(G_k\setminus E_k)\le v_k-c_1\rho_k^Q=(1-c_2)\,v_k\,,\qquad c_2=\frac{c_1}{C_AM^Q}\in(0,1)\,. \end{equation*} Let $E=\bigcup_kE_k$. Then $m(E)=v-\lim_kv_k=v$. \emph{Step 3: the energy.} Let $00$. Since $\ind_{E_n}\to\ind_E$ in $L^1(X,m)$, Lemma~\ref{lem:Jbasic}\ref{it:JL1} gives $J_r(\ind_E)\le C\,v^{s/Q}r^\lambda$. \end{proof} \begin{proof}[Proof of Theorem~\ref{th:profiles}] Let $v=\min\{w,m(X)-w\}$, so that $v_X(E)=v$ for every measurable set $E$ with $m(E)=w$. By Theorem~\ref{th:ahlfors}\ref{it:ahl-isop}, proved below, $v^{s/Q}\le C\Per(E)$ for every such set. Conversely, let $E_v$ be the set of Lemma~\ref{lem:prescribed}, and let $E^w=E_v$ if $w=v$ and $E^w=X\setminus E_v$ otherwise. Then $m(E^w)=w$ and, since $J_r(\ind_{E})=J_r(\ind_{X\setminus E})$, \begin{equation*} \Per(E^w)\le S_\lambda(\ind_{E^w})=S_\lambda(\ind_{E_v})\le C\,v^{s/Q}\,.\qedhere \end{equation*} \end{proof} \section{Proof of Theorem~\ref{th:ahlfors}} \ref{it:ahl-isop} Let $B$ be a ball of radius $R\le D$, or $B=X$ and $R=2D$ if $D<\infty$. In both cases $m(B)\ge c\,R^Q$ by~\eqref{eq:allr}. Since $\frac1q=\frac sQ$ and $\frac1q-1=-\frac\lambda Q$, Theorem~\ref{th:isop}\ref{it:isop-local} gives \begin{equation*} v_B(E)^{s/Q}\le C\,R^{\lambda}\,m(B)^{-\lambda/Q}\Per(E;B')\le C\Per(E;B')\,, \end{equation*} and in the same way $\|f-b\|_{L^{q,1}(B)}\le C\Var(f;B')$. If $D=\infty$, the lower bound $m(B(x,r))\ge c_A\,r^Q$ holds for all $r>0$, and Theorem~\ref{th:isop}\ref{it:isop-global} applies. \ref{it:ahl-fed} The first assertion is Theorem~\ref{th:federer}\ref{it:fed-pos} and~\eqref{eq:HA}. If $s=0$, then~\eqref{eq:decay} holds with $Q=\lambda$, and $\Hcod\lambda$ is comparable to the counting measure by~\eqref{eq:HA}. Proposition~\ref{prop:endpoint} gives the two inequalities, and it shows that $\Sigma_\gamma(E)=\partial^*E$ if $\Per(E)<\infty$, which is the case when $\Sigma_\gamma(E)$ is finite. \ref{it:ahl-dim} Let $U$ be one of the open sets of Proposition~\ref{prop:basis}, and let $\varepsilon>0$. By~\eqref{eq:coveringnumber}, \begin{equation*} N(\partial U,t)\le C\,t^{-Q}\,m\big(B(\partial U,t)\big)=O\big(t^{-s-\varepsilon}\big)\qquad\text{as }t\downarrow0\,, \end{equation*} hence $\overline{\dim}_{\mathrm M}\,\partial U\le s$. These sets form a basis of the topology, and since $\dim_H\le\overline{\dim}_{\mathrm M}$ we get $d_{tH}(X)\le1+s$. Conversely, let $\mathcal U$ be a basis of open sets. By~\eqref{eq:basispositive} and~\eqref{eq:HA} there is $U\in\mathcal U$ with $\Hc^s(\partial U)>0$, hence $\dim_H\partial U\ge s$. Since $\mathcal U$ was arbitrary, $d_{tH}(X)\ge1+s$. Let now $s>0$, so that $Q>\lambda$, let $B$ be a ball of radius $R\le D$, and let $L=2+2\Lambda$. By Proposition~\ref{prop:topiso} with $K=1$, by~\eqref{eq:HA} and by $m(B)\ge c_A\,R^Q$, \begin{equation*} v_B(E)^{s/Q}\le C\,R^{\lambda}\,m(B)^{-\lambda/Q}\,\Hcod\lambda_R(\partial E\cap LB)\le C\,\Hc^s_R(\partial E\cap LB)\,. \end{equation*} A covering of $\partial E\cap LB$ which contains a ball of radius larger than~$R$ has cost at least $R^s\ge c\,v_B(E)^{s/Q}$, by~\eqref{eq:allr}. Hence $v_B(E)^{s/Q}\le C\,\Hc^s_\infty(\partial E\cap LB)$. \ref{it:ahl-profile} is Theorem~\ref{th:profiles}. \qed \section{Optimal Sobolev embeddings and approximation numbers}\label{sec:width} For $q=Q/(Q-\lambda)<\infty$, the compact Sobolev inequality determines the smallest rearrangement-invariant Banach function space containing $BV(X)$. We use the usual definition of a Banach function space, including the Fatou property~\cite[Chapter~1]{BS}. Rearrangement invariance means that equimeasurable functions have the same norm. See also~\cite{CPS} for the derivation of optimal Sobolev targets from isoperimetric inequalities. \begin{proposition}[Optimal Lorentz target]\label{prop:optimallorentz} Suppose $X$ is compact and satisfies~\hP{} and~\hC{} with $0<\lambdau\})\big)\,du \le C_Y\|g\|_{L^{q,1}(X)}.\qedhere \end{equation*} \end{proof} At $\lambda=Q$, Theorem~\ref{th:sobolev} likewise gives $BV(X)\hookrightarrow L^\infty(X)$. This target is minimal because $\|g\|_Y\le\|\ind_X\|_Y\|g\|_\infty$ on a finite measure space. The Sobolev inequality has a compact form: on a compact space, the embedding of $BV(X)$ into $L^p(X,m)$ is compact below the Sobolev exponent~$q$ and not at~$q$. The same averaging operators which prove the compactness give the rate at which a function of bounded variation can be approximated in $L^1$ by functions from a space of dimension~$n$: this rate is $n^{-\lambda/Q}$, and it is sharp. \begin{proposition}\label{prop:cap-width} Suppose $X$ is compact and satisfies~\hP{} and~\hC. Equip $BV(X)$ with the norm $\|f\|_1+S_\lambda(f)$. For the inclusion $I\colon BV(X)\to L^1(X,m)$, \begin{equation*} \inf_{\operatorname{rank} T0$ is so small that $C_A\,(2Mc)^Q\le m(X)$, and let $n$ be so large that $h\le D$. Let $Z$ be a maximal $2Mh$-separated subset of~$X$. The balls $B(z,2Mh)$, $z\in Z$, cover~$X$, and each has measure at most $C_A\,(2Mh)^Q$ by~\eqref{eq:allr}; hence $\#Z\ge m(X)\,C_A^{-1}(2Mh)^{-Q}\ge n$. Choose points $z_1,\dots,z_n\in Z$, and let $G_i$ be a set given by~\hC{} for the ball $B(z_i,h)$. The sets $G_i$ are pairwise disjoint modulo null sets, because the balls $B(z_i,Mh)$ are pairwise disjoint, and by~\eqref{eq:CA} \begin{equation*} m(G_i)\ge c_A\,h^Q\,,\qquad S_\lambda(\ind_{G_i})\le C\,h^{Q-\lambda}\,. \end{equation*} For $f=\sum_ia_i\ind_{G_i}$ with real coefficients $a_i$ we get $\|f\|_1\ge c_A\,h^Q\sum_i|a_i|$ and $S_\lambda(f)\le C\,h^{Q-\lambda}\sum_i|a_i|$, hence \begin{equation*} \|f\|_1+S_\lambda(f)\le C\,h^{-\lambda}\,\|f\|_1\,. \end{equation*} These functions form a subspace of $BV(X)$ of dimension~$n$. If $T$ has rank less than~$n$, there is $f\ne0$ in this subspace with $Tf=0$, and $\|(I-T)f\|_1=\|f\|_1\ge c\,h^\lambda\,(\|f\|_1+S_\lambda(f))$. Hence $\|I-T\|_{BV\to L^1}\ge c\,h^\lambda=c\,n^{-\lambda/Q}$. \emph{Step 3: compactness for $p0$, with $t_0^{1/d_w}\le D$, such that for $0D$, all balls at this radius are $X$, hence $J_{2^jr}(f)\le2\int_X|f-f_X|\,dm$. Applying~\hP{} to $X=B(x,2D)$ at scale $r$ bounds this integral by $C(D/r)^\lambda J_r(f)$. Summing the annuli proves the comparison. The inequalities for the limits follow from the definition of $\Var$ and~\eqref{eq:scales}. For an indicator, symmetry gives $H_t(\ind_E)=2Q_E(t)$. \end{proof} For $\beta>0$, the heat Besov class of order $\beta$ consists of the $f\in L^1$ for which $\sup_{t>0}t^{-\beta}H_t(f)<\infty$. Already under~\eqref{eq:heat-bounds} alone this class equals $\Bes{d_w\beta}(X)$, as in the Ahlfors regular case of~\cite[Section~2.3]{AB}. Indeed the lower kernel bound controls the ball energies at small radii. Conversely, insert $J_{2^jr}(f)\le (2^jr)^{d_w\beta}S_{d_w\beta}(f)$ in the annular sum for $2^jr\le D$. For $2^jr>D$ use $J_{2^jr}(f)\le4\|f\|_1$ and $1\le(2^jr/D)^{d_w\beta}$. The resulting series after division by $t^\beta$ converges. Radii and times bounded away from zero cost only a constant times $\|f\|_1$, since $J_r(f)\le4\|f\|_1$ and $H_t(f)\le2\|f\|_1$. Under~\hP{} and~\hC{}, Theorem~\ref{th:metric} therefore identifies $\lambda/d_w$ as both the density and the nonconstancy critical exponent in time. In the Ahlfors regular case Theorem~\ref{th:ahlfors} gives $\alpha=(Q-d_{tH}(X)+1)/d_w$ under these two hypotheses. Chapter~\ref{sec:nocommon} shows why the common exponent matters for this dimension formula. For the canonical diffusions on the following examples we obtain the time exponents in the last column. Each $d_w$ refers to the space in its row. The heat kernel estimates for the carpets and sponge are those of~\cite[Section~4.7]{BBKT}, and those for the gasket are in~\cite{BPgasket,BLgasket}. \begin{center} \begin{tabular}{lcc} & Spatial exponent $\lambda$ & Heat exponent $\alpha$ \\ \hline Standard carpet & $\log_3 4$ & $(\log_3 4)/d_w$ \\ Central-block carpet $F_{b,a}$ & $\log_b(b+a)$ & $\log_b(b+a)/d_w$ \\ Menger sponge & $\log_3 5$ & $(\log_3 5)/d_w$ \\ Sierpi\'nski gasket & $\log_2 3$ & $\log 3/\log 5$ \end{tabular} \end{center} \subsection{The weak Bakry--\'Emery estimate} Proposition~\ref{prop:heat-scales} controls an integral in both variables. The weak Bakry--\'Emery estimate of~\cite{AB} controls the temperature at two prescribed points for arbitrary bounded initial data. In the notation of that paper, $\mathrm{wBE}(\kappa)$ means that \begin{equation}\label{eq:heat-wBE} |P_tg(x)-P_tg(y)|\le C\left(\frac{d(x,y)}{t^{1/d_w}}\right)^\kappa\|g\|_\infty. \end{equation} The estimate is taken for a continuous version of $P_tg$ and for the times in the heat kernel estimates. In the sub-Gaussian setting of~\cite[Sections~3.5 and~4.2]{AB}, it gives $\lambda_1^\#\le d_w-\kappa$. At the critical value $\kappa=d_w-\lambda_1^\#$ it also gives the short-time characterization of variation. Proposition~\ref{prop:heat-scales} obtains the latter characterization directly from~\hP. The product example uses the pointwise estimate in each coordinate. Example~\ref{ex:heat-gaussian} uses the classical curvature condition $\Gamma_2\ge\Gamma$, which gives a gradient contraction for Gaussian variation. \paragraph{Products of nested fractals.} Let $K$ be an unbounded nested fractal in the setting of~\cite{AB}, of Hausdorff dimension $d_h$ and walk dimension $d_w$. Its diffusion satisfies $\mathrm{wBE}(d_w-d_h)$. On $K^n$, with the maximum of the factor distances and product measure, the product kernel is $\prod_{i=1}^n p_t(x_i,y_i)$. Varying one coordinate at a time in~\eqref{eq:heat-wBE} gives the same exponent~$\kappa$ on $K^n$. For the reverse bound on the critical Besov exponent, the boundary of a product of cells is covered by finitely many faces in which one coordinate is a junction point. Its $r$-neighbourhood has measure $O(r^{d_h})$. Indicators of products of cells therefore belong to $\Bes{d_h}(K^n)$, and their span is dense in $L^1(K^n)$. Together these estimates give \[ \dim_H(K^n)=nd_h,\qquad \lambda_1^*(K^n)=\lambda_1^\#(K^n)=d_h. \] Thus the critical heat exponent $d_h/d_w$ is independent of the number of factors. For $n\ge2$ the corresponding Sobolev inequality is $\|f\|_{L^{n/(n-1)}(K^n)}\le C\Var(f)$ for $f\in BV(K^n)$. In particular the product of two infinite gaskets has critical heat exponent $\log 3/\log 5$ and Sobolev target $L^2$~\cite[Sections~4.5 and~5.2]{AB}. \subsection{Heat content and the measure-theoretic boundary}\label{sec:heat-boundary} Write $u_t=P_t\ind_E$. The two expressions $Q_E(t)=\int_{E^c}u_t\,dm=\int_E P_t\ind_{E^c}\,dm$ are equal by symmetry and make sense also when $m(E)=\infty$. Symmetry and conservation give \[ 2Q_E(t)=H_t(\ind_E)=\|u_t-\ind_E\|_1,\qquad H_t(f)=2\int_{\R}Q_{\{f>v\}}(t)\,dv . \] The last identity follows by writing $|f(x)-f(y)|$ as the integral in $v$ of the absolute difference of the superlevel indicators and applying Tonelli's theorem. For general real $f\in L^1$, Jensen's inequality gives $\|P_tf-f\|_1\le H_t(f)$. If~\hP{} and~\hC{} hold, Proposition~\ref{prop:heat-scales} and Theorem~\ref{th:federer} give, for $m(E)<\infty$, \[ \liminf_{t\downarrow0}t^{-\alpha}Q_E(t) \asymp\Per(E)\asymp\Hcod\lambda(\partial^*E), \qquad \alpha=\lambda/d_w . \] \begin{proposition}\label{prop:heat-boundary} Assume that~\eqref{eq:heat-bounds} and $\int_Xp_t(x,y)\,dm(y)=1$ hold for every $x$, for a common version of the kernel. For every measurable $E$ one has \[ \partial^*E=\{x:\ \limsup_{t\downarrow0}u_t(x)>0 \ \text{and}\ \liminf_{t\downarrow0}u_t(x)<1\}. \] Suppose in addition that~\hP{} holds and $m(E)<\infty$. There exists $\eta_0>0$ such that for $0<\eta\le\eta_0$ the sets $T_t^\eta=\{x:\eta\le u_t(x)\le1-\eta\}$ satisfy \[ c\Per(E)\le\liminf_{t\downarrow0}t^{-\alpha}m(T_t^\eta) \le\limsup_{t\downarrow0}t^{-\alpha}m(T_t^\eta)\le C\eta^{-1}\Per(E). \] \end{proposition} \begin{proof} Let $r=t^{1/d_w}$. The near-diagonal lower bound gives $u_t(x)\ge c\,\theta_E(x,r)$. Conversely, for fixed $A=2^k\ge1$, the integral over $B(x,Ar)\cap E$ is at most $CA^{Q_d}\theta_E(x,Ar)$ by doubling. By~\eqref{eq:heat-bounds} and~\eqref{eq:dbl}, the integral over the complement of $B(x,Ar)$ is bounded by $C\sum_{j\ge k}2^{jQ_d}\exp(-c'2^{j d_w/(d_w-1)})$, uniformly in $x$ and $t$. Letting $r\downarrow0$ and then $k\to\infty$ shows that $u_t(x)\to0$ if and only if $\theta_E(x,r)\to0$. Applying this also to $E^c$ proves the first assertion. Take $\eta_*=(2C_d^2)^{-1}$. The same lower bound applied to $E$ and $E^c$ gives $M_r^{\eta_*}(E)\subset T_t^\eta$ for every sufficiently small $\eta$, where $M_r^{\eta_*}(E)$ is the set of mixed balls of Section~\ref{sec:mixed}, identified with their centres. The lower estimate follows from Theorem~\ref{th:mixed}. For the upper estimate, $|u_t-\ind_E|\ge\eta$ on $T_t^\eta$. Integrating gives $\eta m(T_t^\eta)\le 2Q_E(t)$, and Proposition~\ref{prop:heat-scales} applies. \end{proof} \subsection{Heat kernels and BV measures}\label{sec:heat-measures} For $f\in BV(X)$, define the heat measures by \[ d\sigma_{t,f}(x)=t^{-\alpha} \left(\int_Xp_t(x,y)|f(x)-f(y)|\,dm(y)\right)dm(x). \] Their masses are the normalized heat oscillations. A comparison with the measures of Chapter~\ref{sec:measures} also identifies where those oscillations occur. Compare the heat-kernel construction in~\cite[Section~4.6]{AB}. \begin{proposition}\label{prop:heat-measures} Under~\hP{} and~\eqref{eq:heat-bounds}, every sequence $t_i\downarrow0$ has a subsequence along which $\sigma_{t_i,f}$ converges against bounded continuous functions. Each limit $\sigma$ satisfies $c\mu\le\sigma\le C\mu$ for every BV measure $\mu$ of $f$. In particular, under~\hC{}, if $m(E)<\infty$ and $\Per(E)<\infty$, every heat measure limit for $\ind_E$ is comparable to $\Hcod\lambda\llcorner\partial^*E$. \end{proposition} \begin{proof} Use the formula for $m_{s,f}$ in Section~\ref{sec:clusters} also for $s>D$ when $D<\infty$. Then $M_f=\sup_{s>0}m_{s,f}(X)<\infty$ by~\eqref{eq:mrf} and $J_s(f)\le4\|f\|_1$. Keeping the first variable in the annular estimate of Proposition~\ref{prop:heat-scales} gives inequalities of measures \[ c\,m_{r,f}\le\sigma_{t,f}\le C\sum_{j=0}^{\infty}a_j\,m_{2^jr,f}, \qquad r=t^{1/d_w}, \qquad a_j=2^{j(Q_d+\lambda)}\exp(-c'2^{j d_w/(d_w-1)}). \] Indeed, on $d(x,y)<2^jr$ the kernel $k_{2^jr}(x,y)$ is comparable to $m(B(x,2^jr))^{-1}$ by~\eqref{eq:kernel}. The factor $2^{jQ_d}$ accounts for doubling and $2^{j\lambda}$ for the normalization. For each fixed $N$, the first $N$ families on the right are tight along $r_i=t_i^{1/d_w}\downarrow0$ by~\eqref{eq:tight}. The remaining terms have total mass at most $CM_f\sum_{j\ge N}a_j$, which tends to zero. This proves tightness also on unbounded $X$, and the uniform mass bound gives a weakly convergent subsequence. Along any such subsequence, apply Theorem~\ref{th:bvmeasures} and a diagonal extraction so that $m_{2^jr_i,f}\rightharpoonup\mu_j$ for every $j\ge0$. Testing the displayed bounds against non-negative continuous functions of compact support and using the same tail estimate gives \[ c\mu_0\le\sigma\le C\sum_{j\ge0}a_j\mu_j . \] All the $\mu_j$ are BV measures of $f$, uniformly comparable to any fixed BV measure by Theorem~\ref{th:bvmeasures}\ref{it:bvm-compare}. The assertion for indicators follows from Theorem~\ref{th:measures}\ref{it:meas-coarea}. \end{proof} \subsection{Fractional domains of indicators} The heat loss also determines which fractional powers of the generator can be applied to an indicator in $L^2$. For related Besov and fractional Sobolev inequalities on Dirichlet spaces see~\cite{ABFrac}. \begin{corollary}\label{cor:heat-spectral} Assume~\hP{} and~\eqref{eq:heat-bounds}, and suppose $0<\alpha=\lambda/d_w<1$. Let $0c_1a_{\max}$, let $a=a_{\max}$ and $\Nc=\{X\}$. In both cases $\Nc$ is connected, has at most $K_0$ elements, and $W=\bigcup\Nc$ satisfies \begin{equation*} B\subset W\subset\Lambda B\,,\qquad a\max\{N/2,\zeta\}$, independent of $a$ and~$P$, such that for every $\mathcal Y\subset\ch(P)$ with $\#\mathcal Y<\zeta$ the graph $\ch(P)-\mathcal Y$ has a connected component with at least $g$ vertices. \item\label{H3} If $P\sim P'$, $\mathcal Y\subset\ch(P)\cup\ch(P')$ and $\#\mathcal Y<\zeta$, there are $U\in\ch(P)\setminus\mathcal Y$ and $U'\in\ch(P')\setminus\mathcal Y$ with $U\sim U'$ such that $U$ and $U'$ belong to the connected components with at least $g$ vertices of $\ch(P)-\mathcal Y$ and of $\ch(P')-\mathcal Y$, respectively. \end{enumerate} Since $g>N/2$, the component in~\ref{H2} is unique. Figure~\ref{fig:children} shows the graphs $\ch(P)$ of the carpet and of the sponge. \begin{figure}[t] \centering \begin{tikzpicture}[x=9mm,y=9mm] \foreach \o in {0,3}{% \foreach \a in {0,1,2}{\foreach \b in {0,1,2}{% \pgfmathtruncatemacro{\midsq}{(\a==1)&&(\b==1)}% \ifnum\midsq=0 \fill[cellgray,draw=white,line width=.6pt] (\o+\a,\b) rectangle ++(1,1);\fi}} \draw[navy,line width=.9pt] (\o+.5,.5)--(\o+2.5,.5)--(\o+2.5,2.5)--(\o+.5,2.5)--cycle;} \draw[black,line width=.6pt] (3,-.25) -- (3,3.25); \foreach \b in {0,1,2}{\draw[cutred,line width=1pt] (2.5,\b+.5)--(3.5,\b+.5);} \foreach \o in {0,3}{\foreach \a/\b in {0/0,1/0,2/0,2/1,2/2,1/2,0/2,0/1}{\fill[navy] (\o+\a+.5,\b+.5) circle (2pt);}} \node at (1.5,3.55) {\small $P$}; \node at (4.5,3.55) {\small $P'$}; \node at (3,-0.95) {\small (a)}; \end{tikzpicture} \hspace{16mm} \begin{tikzpicture}[x={(14mm,0mm)},y={(6.6mm,5mm)},z={(0mm,14mm)}] \foreach \a in {0,2}{\foreach \b in {0,2}{% \draw[navy,line width=.9pt] (\a,\b,0)--(\a,\b,2); \draw[navy,line width=.9pt] (\a,0,\b)--(\a,2,\b); \draw[navy,line width=.9pt] (0,\a,\b)--(2,\a,\b);}} \foreach \a in {0,2}{\foreach \b in {0,2}{% \fill[white,draw=navy,line width=.8pt] (\a,\b,1) circle (2pt); \fill[white,draw=navy,line width=.8pt] (\a,1,\b) circle (2pt); \fill[white,draw=navy,line width=.8pt] (1,\a,\b) circle (2pt);}} \foreach \a in {0,2}{\foreach \b in {0,2}{\foreach \c in {0,2}{\fill[navy] (\a,\b,\c) circle (2.2pt);}}} \foreach \p in {(1,0,0),(0,1,0),(0,0,1)}{\fill[white] \p circle (3pt);\draw[cutred,line width=1.1pt] \p ++(-2.6pt,-2.6pt) -- ++(5.2pt,5.2pt) \p ++(-2.6pt,2.6pt) -- ++(5.2pt,-5.2pt);} \fill[cutred] (0,0,0) circle (2.4pt); \node at (1.3,0,-0.68) {\small (b)}; \end{tikzpicture} \caption{(a) Carpet: the graphs $\ch(P)$ and $\ch(P')$ of two adjacent cells are cycles of length~$8$, joined by three edges, in red. Here $\zeta=2$: after the deletion of one vertex, what remains of each cycle is connected (a cycle, or a path with $7$ vertices), and at least two of the three red edges remain. (b)~Sponge: the graph $\ch(P)$ has $8$ vertices of degree~$3$ and $12$ vertices of degree~$2$. Here $\zeta=4$: the deletion of the three vertices marked by crosses isolates the red vertex, and the other $16$ vertices remain connected.}\label{fig:children} \end{figure} \begin{theorem}\label{th:strong} Let $0\zeta$ and a rule with the following properties. \begin{enumerate}[label=\textup{(\roman*)}] \item For every $P$ and every assignment of weights to $\ch(P)$ of total weight less than $\zeta$, the rule selects a connected component of the retained graph with at least $g$ vertices. If the total weight is less than one, the component contains every child. \item For adjacent parents of the same side whose combined child weight is less than $\zeta$, the components selected by the rule in the two parents are joined by a retained edge. \end{enumerate} Then~\eqref{eq:content} holds. If $X$ also satisfies~\hP{} with $\lambda=Q-s$, the conclusions of Corollary~\ref{cor:strongfederer} hold. \end{corollary} \paragraph{Strategy of the proof.} Given a countable family of balls $B_\iota$ with small cost $\sum_\iota r_\iota^s$, we construct a point of $\Sigma_\gamma(E)$ outside their union. For a related selection by chains of balls, see~\cite[Section~3]{LahtiStrong}. \begin{itemize} \item The balls are converted into a weight $w$ on the cells. With $\ell(U)$ the side of a cell~$U$ and $h_\iota\in\TT$ comparable to the radius of~$B_\iota$, the weight $w(U)$ is the sum of the costs $h_\iota^s$ of the balls $B_\iota$ with $h_\iota\le\ell(U)$, each counted once for every cell of side $h_\iota$ contained in $U$ which it meets. A cell is discarded when $w(U)\ge\ell(U)^s$. \item If $w(P)<\ell(P)^s$, the normalized child weights $w(V)/(\ell(P)/b_0)^s$ have sum less than $\zeta$. We select a connected component of children with at least $g>\zeta$ vertices. Under~\ref{H1}--\ref{H3} a deletion argument gives the selection. On the planar carpets, complete rows and columns determine a component directly. \item A point of $\Sigma_\gamma(E)$ is found by following, through all scales, cells or pairs of adjacent cells in which $E$ and $X\setminus E$ both fill a fixed proportion of what remains. \end{itemize} \begin{proof}[Proof of Theorem~\ref{th:strong} and Corollary~\ref{cor:strongselection}] Let $B=B(x,R)$, let $a\in\TT_X$ with $R/c_1\le a0$. Let $(B_\iota)_\iota$ be a countable family of balls $B_\iota=B(x_\iota,r_\iota)$ with \begin{equation}\label{eq:smallcover} \sum_\iota r_\iota^{s}<\varepsilon\,v^{s/Q}\,, \end{equation} where $\varepsilon>0$ is a structural constant fixed in Steps~1 and~4. We shall find a point of $\Sigma_\gamma(E)\cap W$ which lies in none of the balls~$B_\iota$. By the definition of the Hausdorff content, this proves~\eqref{eq:content} with $C=1/\varepsilon$. For $i\ge0$ let $\Tc_i=\{U\in\Qc_{b_0^{-i}a}:\ U\subset W\}=[\Ac]$, so that $\Tc_0=\Ac$, and let $\Tc=\bigcup_{i\ge0}\Tc_i$. We write $\ell(U)$ for the side of $U\in\Tc$. By~\ref{K3}, the elements of $\Tc$ which contain a given $U\in\Tc$ are totally ordered by inclusion. \emph{Step 1: weights.} By~\eqref{eq:smallcover}, $r_\iota^s<\varepsilon(K_0a^Q)^{s/Q}$, hence $r_\iotaN/2$, so the component is unique and can be selected independently of the deletion. If the total weight is less than one, every vertex and edge is retained and~\ref{H1} gives connectivity. For two parents, apply the same deletion simultaneously. Condition~\ref{H3} joins the two components of size at least $g$ in the undeleted graphs. Each lies in the unique selected component of its parent, and the joining edge is retained. This proves both properties of the selection rule. Starting with $\Gc_0=\Ac$, set $\Gc_{i+1}=\bigcup_{P\in\Gc_i}\Gc(P)$ and $\Gc=\bigcup_{i\ge0}\Gc_i$. In either case the selection gives the following properties. \begin{enumerate}[label=\textup{(G\arabic*)},leftmargin=*] \item\label{G1} For each $P\in\Gc$, $\#\Gc(P)\ge g>\zeta$ and $\Gamma^*[\Gc(P)]$ is connected. \item\label{G2} If $w(P)<(\ell(P)/b_0)^s$, then $\Gc(P)=\ch(P)$. \item\label{G3} For $P,P'\in\Gc_i$ joined by an edge of $\mathcal E^*$, a retained edge joins $\Gc(P)$ to $\Gc(P')$. Their union is connected in $\Gamma^*$, and induction gives the connectivity of $\Gamma^*[\Gc_i]$ at every generation. \end{enumerate} \emph{Step 3: the part of $W$ which remains.} For $U\in\Gc_i$ let \begin{equation*} Z_U=\bigcap_{n\ge i}\ \bigcup\,\{U'\in\Gc_n:\ U'\subset U\}\,,\qquad Z=\bigcup_{U\in\Ac}Z_U\,. \end{equation*} The set $Z_U$ is a compact subset of $U$, as a decreasing intersection of finite unions of cells. We claim: \begin{enumerate}[label=\textup{(Z\arabic*)},leftmargin=*] \item\label{Z1} $Z_U=\bigcup_{U'\in\Gc(U)}Z_{U'}$ for every $U\in\Gc$. In particular $Z_U\subset Z$. \item\label{Z2} There is a structural constant $c_2\in(0,1]$ such that $c_2\,\ell(U)^{Q}\le m(Z_U)\le\ell(U)^{Q}$ for every $U\in\Gc$. \item\label{Z3} $m(W\setminus Z)\le C\,w_0^{Q/s}$, and $Z\cap B_\iota=\emptyset$ for every~$\iota$. \end{enumerate} For~\ref{Z1}, let $z\in Z_U$ with $U\in\Gc_i$. For every $n>i$, the point $z$ lies in some element of $\Gc_n$ contained in~$U$, hence in an element of $\Gc(U)$. One element $U'\in\Gc(U)$ occurs for infinitely many~$n$, and then $z\in Z_{U'}$ because the unions in the definition of $Z_{U'}$ decrease with~$n$. The reverse inclusion is clear. For~\ref{Z2} and~\ref{Z3}, let $U\in\Gc_i$ and $n>i$, let $h=b_0^{-n}a$, and let \begin{equation*} \mathcal L_n(U)=\bigcup\,\big\{V:\ V\in\ch(P)\setminus\Gc(P),\ P\in\Gc_{n-1},\ P\subset U\big\}\,. \end{equation*} By~\ref{G2}, a cell $P\in\Gc_{n-1}$ with $\Gc(P)\ne\ch(P)$ satisfies $w(P)\ge h^s$; by~\ref{W1} there are at most $w(U)/h^s$ such cells $P\subset U$, and none if $w(U)k$: take the smallest $n$ such that the point lies in no element of $\Gc_n$ contained in~$U$. In particular \begin{equation*} W\setminus Z\subset\bigcup_{U\in\Ac}\ \bigcup_{n\ge1}\mathcal L_n(U)\,. \end{equation*} Summing~\eqref{eq:loss} over $U\in\Ac$ and $n\ge1$, and using $\sum_{U\in\Ac}w(U)=w_0$, we obtain the first assertion of~\ref{Z3}: the sum of $h^{Q-s}$ over the numbers $h\in\TT$ with $h^s\le w_0$ is at most $C\,w_0^{(Q-s)/s}$. For~\ref{Z2}, let $k\ge1$ be an integer. By~\ref{G1}, at least $g^k$ of the $N^k$ elements of $\Tc$ of side $b_0^{-k}\ell(U)$ contained in $U$ belong to~$\Gc$, and their union has measure at least $(g/N)^k\ell(U)^Q$. By~\eqref{eq:loss} and $w(U)<\ell(U)^s$, the part of this union which is not in $Z_U$ has measure at most \begin{equation*} N\,\ell(U)^s\sum_{h\in\TT,\ h\zeta$, we can fix $k$ so large that $(g/N)^k-C(\zeta/N)^k=:c_2>0$. Finally, if $z\in Z\cap B_\iota$, then $z$ lies in some $U\in\Gc$ with $\ell(U)=h_\iota$. Then $U\in\mathcal M_\iota$ and $w(U)\ge\ell(U)^{s}$ by~\ref{W3}, which contradicts $\Gc\subset\Tc^*$. \emph{Step 4: two cells with different densities.} By~\ref{Z3} and~\ref{W2}, $m(W\setminus Z)1-\delta_1\,. \end{equation*} Let $z$ be a density point of $Z\cap E$ which does not lie in two distinct cells of the same side; this excludes an $m$-null set. For $i\ge0$ the point $z$ lies in a unique element $U_i$ of~$\Tc_i$, and $U_i\in\Gc_i$ because $z\in Z$. Moreover $U_i\subset B(z,2C_0\ell(U_i))$, hence \begin{equation*} m(Z_{U_i}\setminus E)\le m\big(B(z,2C_0\ell(U_i))\setminus(Z\cap E)\big)=o\big(\ell(U_i)^{Q}\big)\qquad\text{as }i\to\infty\,, \end{equation*} whereas $m(Z_{U_i})\ge c_2\,\ell(U_i)^{Q}$ by~\ref{Z2}. Thus $p_{U_i}\to1$. In the same way, a density point of $Z\setminus E$ provides cells $U'_i\in\Gc_i$ with $p_{U'_i}\to0$. \emph{Step 5: nested compact sets.} For $i\ge0$ let $\mathcal K_i$ be the collection of the sets $K$ of one of the following two forms: \begin{enumerate}[label=\textup{(\alph*)}] \item $K=Z_U$ with $U\in\Gc_i$ and $\delta_1\le p_U\le1-\delta_1$; \item $K=Z_U\cup Z_{U'}$ with $U,U'\in\Gc_i$, $\{U,U'\}\in\mathcal E^*$, $p_U<\delta_1$ and $p_{U'}>1-\delta_1$. \end{enumerate} Let $K\in\mathcal K_i$ and $h=b_0^{-i}a$. Then $K$ is a compact subset of $Z$ of diameter at most~$2C_0h$, and \begin{equation}\label{eq:bothphases} \min\{m(K\cap E),m(K\setminus E)\}\ge\max\big\{\delta_1c_2\,h^{Q},\ \delta_1\,m(K)\big\}\,. \end{equation} In case~(a) this follows from~\ref{Z2}. In case~(b), \ref{Z2} gives $m(K\cap E)\ge p_{U'}\,m(Z_{U'})>(1-\delta_1)c_2\,h^{Q}$, and the same bound for $m(K\setminus E)\ge(1-p_U)\,m(Z_U)$, while $m(K)\le2h^{Q}$ and $(1-\delta_1)c_2\ge2\delta_1$. We claim that $\mathcal K_{i_0}\ne\emptyset$, and that every $K\in\mathcal K_i$ contains an element of $\mathcal K_{i+1}$. For the first claim, join the cells $U,U'$ of Step~4 by a path in $\Gamma^*[\Gc_{i_0}]$, which exists by~\ref{G3}. Either one cell of the path has $p\in[\delta_1,1-\delta_1]$, or two consecutive cells of the path satisfy~(b). For the second claim, let $K\in\mathcal K_i$, and let $\Gc'=\Gc(U)$ in case~(a) and $\Gc'=\Gc(U)\cup\Gc(U')$ in case~(b). By~\ref{G1} and~\ref{G3}, the graph $\Gamma^*[\Gc']$ is connected. By~\ref{Z1}, $K=\bigcup_{U''\in\Gc'}Z_{U''}$, and these sets overlap in null sets, so that \begin{equation*} \sum_{U''\in\Gc'}p_{U''}\,m(Z_{U''})=m(K\cap E)\in\big[\delta_1\,m(K),(1-\delta_1)\,m(K)\big] \end{equation*} by~\eqref{eq:bothphases}. Hence the numbers $p_{U''}$, $U''\in\Gc'$, are neither all smaller than $\delta_1$ nor all larger than~$1-\delta_1$. Either one of them lies in $[\delta_1,1-\delta_1]$, and $Z_{U''}\in\mathcal K_{i+1}$; or both kinds occur, and following a path in $\Gamma^*[\Gc']$ we find either a cell with $p\in[\delta_1,1-\delta_1]$ or an edge $\{U'',U'''\}\in\mathcal E^*$ with $p_{U''}<\delta_1$ and $p_{U'''}>1-\delta_1$, so that $Z_{U''}\cup Z_{U'''}\in\mathcal K_{i+1}$. \emph{Step 6: conclusion.} By Step~5 there are sets $K_i\in\mathcal K_i$, $i\ge i_0$, with $K_{i+1}\subset K_i$. Let $z$ be a point of their intersection. Then $z\in Z\subset W$, and $z$ lies in none of the balls $B_\iota$ by~\ref{Z3}. Let $0<\rho\le2C_0b_0^{1-i_0}a$, and choose $i\ge i_0$ such that $h=b_0^{-i}a$ satisfies $2C_0h<\rho\le2C_0b_0h$. Since $z\in K_i$ and $K_i$ has diameter at most~$2C_0h$, we have $K_i\subset B(z,\rho)$. By~\eqref{eq:bothphases} and~\eqref{eq:allr}, \begin{equation*} \vartheta_E(z,\rho)\ge\frac{\delta_1c_2\,h^{Q}}{C_A\,\rho^{Q}}\ge\frac{\delta_1c_2}{C_A\,(2C_0b_0)^{Q}}=:\gamma\,. \end{equation*} Hence $z\in\Sigma_\gamma(E)$. This proves~\eqref{eq:content} under either set of hypotheses. Under~\hP{} the proof of Corollary~\ref{cor:strongfederer} now gives the perimeter estimates. \end{proof} \chapter{Sierpi\'nski carpets}\label{sec:carpet} \begin{overview} We verify the two hypotheses on the standard Sierpi\'nski carpet and on its unbounded version, with the exponent $\lambda=\log_34$. Sections~\ref{sec:carpet-squares} to~\ref{sec:carpet-neighbours} describe the carpet by ternary digits and show that its cells form a cell structure. Section~\ref{sec:graph} proves the Poincar\'e inequality on the graphs of cells, with the constant $13\cdot4^j$; it is purely combinatorial, and it is the place where the exponent is produced. Section~\ref{sec:rectangles} constructs the sets of hypothesis~\hC. Sections~\ref{sec:carpet-summary} and~\ref{sec:examples} give the perimeter of each vertical cut and identify the boundary of the diagonal cut. Section~\ref{sec:carpet-heat} compares the heat crossing the cuts at one half and one third. The perimeter calculations determine all functions of bounded variation on the compact carpet which depend on a single coordinate (Theorem~\ref{th:coordinateprofiles}). Section~\ref{sec:centralcarpets} treats planar carpets obtained by deleting a central block. For blocks of width at least three, continuous functions of bounded variation are uniformly dense in the continuous functions (Proposition~\ref{prop:carpetcontinuous}). For the central-block family the complete rows and columns also give a characterization by the strong boundary (Corollary~\ref{cor:centralstrong}). \end{overview} \section{The carpets}\label{sec:carpet-squares} Let $F\subset[0,1]^2$ be the standard Sierpi\'nski carpet. It is obtained from $[0,1]^2$ by dividing each remaining closed square into nine closed squares of one third of its side, keeping the eight outer ones, and iterating; $F$ is the intersection of the successive unions of the squares that are kept. Since $F\subset3F$, the sets $3^kF$ increase with~$k$, and the unbounded Sierpi\'nski carpet is \begin{equation*} F_\infty=\bigcup_{k\ge0}3^kF\subset[0,\infty)^2\,. \end{equation*} Until Section~\ref{sec:centralcarpets}, $X$ denotes either $F$ or $F_\infty$, with the distance \begin{equation*} d(x,y)=\max\{|x_1-y_1|,|x_2-y_2|\}\,, \end{equation*} and $m$ is the Hausdorff measure of dimension $d_h=\log8/\log3$ on~$X$, normalized by $m(F)=1$. Thus $D=1$ for $X=F$ and $D=\infty$ for $X=F_\infty$. Three exponents are used: \begin{equation*} Q=d_h=\frac{\log 8}{\log 3}\,,\qquad s=d_b=\frac{\log 2}{\log 3}\,,\qquad \lambda=d_h-d_b=\frac{\log 4}{\log 3}\,. \end{equation*} They satisfy $3^{d_h}=8$, $3^{d_b}=2$ and $3^\lambda=4$, so that $d_h=3d_b$ and $\lambda=2d_b$. The exponent $d_b$ is the Hausdorff dimension of the middle-third Cantor set $\K\subset[0,1]$. The Cantor set enters through the sections of the carpet by the lines through the centres of its squares. For instance, the ternary digits of $\frac12$ are all equal to~$1$, so that $(\frac12,y)\in F$ if and only if $y$ has a ternary expansion without the digit~$1$: \begin{equation}\label{eq:section} F\cap\big(\{\tfrac12\}\times[0,1]\big)=\{\tfrac12\}\times\K\,. \end{equation} \paragraph{Triadic squares.} A \emph{triadic number} is a number $3^{-n}$ with $n\in\Z$, and $\TT$ is the set of triadic numbers. Each interval $[\rho,3\rho)$ and each interval $(\rho,3\rho]$, $\rho>0$, contains exactly one triadic number. For $a\in\TT$ and $k,l\in\N$ let \begin{equation*} Q^a_{k,l}=[ka,(k+1)a]\times[la,(l+1)a] \end{equation*} be the closed triadic square of side~$a$ with index $(k,l)$. We write the ternary expansions of the indices as $k=\sum_{i\ge0}k_i3^i$ and $l=\sum_{i\ge0}l_i3^i$, with digits $k_i,l_i\in\{0,1,2\}$. Let \begin{equation*} \Omega_F=[0,1]^2\,,\quad\TT_F=\{3^{-n}:\ n\in\N\}\,,\qquad \Omega_{F_\infty}=[0,\infty)^2\,,\quad\TT_{F_\infty}=\TT\,. \end{equation*} \begin{definition}\label{def:squares} For $a\in\TT_X$ let \begin{equation*} \Qc_a=\Qc_a(X)=\big\{Q^a_{k,l}:\ Q^a_{k,l}\subset\Omega_X\text{ and }(k_i,l_i)\ne(1,1)\text{ for every }i\ge0\big\}\,. \end{equation*} A \emph{cell of side~$a$} is a set $Q\cap X$ with $Q\in\Qc_a$. \end{definition} The nine triadic subsquares of side $a/3$ of $Q^a_{k,l}$ are the squares $Q^{a/3}_{3k+e,3l+e'}$ with $e,e'\in\{0,1,2\}$, and the digits of $3k+e$ are those of $k$ moved up by one place, with the new lowest digit~$e$. Hence \begin{equation*} Q^{a/3}_{3k+e,\,3l+e'}\in\Qc_{a/3}\quad\Longleftrightarrow\quad Q^a_{k,l}\in\Qc_a\ \text{ and }\ (e,e')\ne(1,1)\,. \end{equation*} Thus $\Qc_{3^{-n}}(F)$ is the family of the squares kept after $n$ steps of the construction of~$F$. The dilation $x\mapsto3x$ maps $Q^a_{k,l}$ onto $Q^{3a}_{k,l}$ and preserves the condition on the digits. For both carpets we obtain \begin{equation*} X=\bigcap_{a\in\TT_X}\ \bigcup\Qc_a\,, \end{equation*} together with the following three properties, valid for every $a\in\TT_X$. \begin{enumerate}[label=\textup{(Q\arabic*)},leftmargin=*] \item\label{Q1} \emph{Nesting.} Each $Q\in\Qc_a$ contains exactly eight elements of $\Qc_{a/3}$, namely its triadic subsquares of side $a/3$ other than the middle one. Each element of $\Qc_{a/3}$ is contained in exactly one element of~$\Qc_a$. A triadic square of side~$a$ which does not belong to $\Qc_a$ contains no element of $\Qc_b$ for $b\le a$. \item\label{Q2} \emph{Self-similarity.} For $Q=Q^a_{k,l}\in\Qc_a$ let $\varphi_Q(x)=(ka,la)+ax$. Then $Q\cap X=\varphi_Q(F)$, and for every $b\in\TT_F$ the map $\varphi_Q$ sends $\Qc_b(F)$ onto $\{Q'\in\Qc_{ab}:\ Q'\subset Q\}$. In particular, for every integer $j\ge0$, the square $Q$ contains exactly $8^j$ elements of $\Qc_{3^{-j}a}$, and $Q\cap X$ is the union of the corresponding cells. \item\label{Q3} \emph{Covering.} We have $X\subset\bigcup\Qc_a$. Two distinct triadic squares of the same side are disjoint, or meet in a single point, or meet in a common side. \end{enumerate} \section{The measure of cells and balls} Recall that $0<\Hd(F)<\infty$, where $\Hd$ is the Hausdorff measure of dimension~$d_h$~\cite{Hut}; thus $m=\Hd(\,\cdot\cap X)/\Hd(F)$. We extend $m$ to the Borel subsets of $\R^2$ by $m(A)=m(A\cap X)$. \begin{lemma}\label{lem:volume} Let $a\in\TT_X$. \begin{enumerate}[label=\textup{(\roman*)}] \item\label{it:cellmass} If $Q\in\Qc_a$, then $m(Q)=a^{d_h}$, and $m(\varphi_Q(A))=a^{d_h}m(A)$ for every Borel set $A\subset F$. \item\label{it:null} Every line segment is $m$-null. Consequently $m(Q\cap Q')=0$ for distinct triadic squares $Q,Q'$ of the same side, and $m(Q)=0$ for every triadic square $Q$ of side~$a$ which does not belong to~$\Qc_a$. \item\label{it:quarter} If $Q\in\Qc_a$, the two lines through the centre of $Q$ parallel to the axes divide $Q$ into four closed squares of side $a/2$, and each of them has measure $a^{d_h}/4$. \item\label{it:ball} For every $x\in X$ and $0b_2$, then $\widehat H_2$ has side $3b_2\le b_1$ and is contained in a triadic square $A$ of side~$b_1$. Since $\widehat H_2$ belongs to $\Qc_{3b_2}$, the square $A$ belongs to $\Qc_{b_1}$ by~\ref{Q1}. Hence $A\ne H_1$, so that $\interior A\cap H_1=\emptyset$ by~\ref{Q3}, whereas $H_2\subset\interior\widehat H_2\subset\interior A$. \emph{Step 3: conclusion.} By Step~1 there are $H_1,H_2\in\mathfrak H$ with $H_1\supset Q_1$ and $H_2\supset Q_2$. Both contain~$p$, so $H_1=H_2=:H$ by Step~2. The square $H$ is a product of two intervals; the first contains $I\cup I'$ and the second contains $J\cup J'$, because $H$ contains $I\times J'$ and $I'\times J$. Therefore $Q=I\times J\subset H$. Since a square of $\mathfrak H$ of side~$b$ is not in $\Qc_b$, property~\ref{Q1} shows that $Q\notin\Qc_a$, a contradiction. \end{proof} \begin{corollary}\label{cor:neighbours} Let $a\in\TT_X$, let $Q_0\in\Qc_a$, and let $\Nc(Q_0)=\{Q\in\Qc_a:\ Q\cap Q_0\ne\emptyset\}$. \begin{enumerate}[label=\textup{(\roman*)}] \item\label{it:nine} $\#\Nc(Q_0)\le9$. If $Q\in\Nc(Q_0)$ and $Q\ne Q_0$, then either $Q\sim Q_0$, or there is $Q_1\in\Nc(Q_0)\cap\Nc(Q)$ with $Q\sim Q_1\sim Q_0$. In particular $\Nc(Q_0)$ is connected. \item\label{it:ballcover} If $x\in Q_0\cap X$, then $B(x,a)\subset\bigcup\Nc(Q_0)$. \end{enumerate} Consequently the cells of the carpet, with this adjacency relation, form a cell structure in the sense of Definition~\ref{def:cells}, with $b_0=3$, $N=8$, $a_{\max}=1$ for $X=F$ and $a_{\max}=\infty$ for $X=F_\infty$, and with the constants $C_0=1$, $c_1=1$ and $K_0=9$. \end{corollary} \begin{proof} \ref{it:nine} The squares of $\Nc(Q_0)$ are among the nine triadic squares of side~$a$ which meet~$Q_0$. If $Q\in\Nc(Q_0)$ is neither $Q_0$ nor adjacent to~$Q_0$, then $Q\cap Q_0$ is a single point by~\ref{Q3}, and Lemma~\ref{lem:corner} provides $Q_1\in\Qc_a$ containing this point and having a common side with $Q$ and with~$Q_0$. \ref{it:ballcover} Let $y\in B(x,a)$. By~\ref{Q3}, $y$ lies in some $Q=Q^a_{k',l'}\in\Qc_a$. Write $Q_0=Q^a_{k,l}$. If $k'\ge k+2$, then $y_1-x_1\ge(k+2)a-(k+1)a=a$, which is impossible; arguing in the same way for the other cases we get $|k-k'|\le1$ and $|l-l'|\le1$, that is, $Q\in\Nc(Q_0)$. For the last assertion, \ref{K1} holds by Lemma~\ref{lem:volume}\ref{it:cellmass}, since a cell of side~$a$ has diameter at most~$a$ for the distance~$d$; \ref{K2} and~\ref{K3} are~\ref{Q1}, \ref{Q3} and Lemma~\ref{lem:volume}\ref{it:null}, with $\Qc_1(F)=\{[0,1]^2\}$; \ref{K4} is clear, and~\ref{K5} is~\ref{it:nine} and~\ref{it:ballcover} for a square $Q_0\ni x$. \end{proof} In what follows we identify a square $Q\in\Qc_a$ with the cell $Q\cap X$; thus $[P]=\{U\in\Qc_h:\ U\subset P\}$ for $P\in\Qc_{3^jh}$, as in Chapter~\ref{sec:cells}. \section{A Poincar\'e inequality on the approximating graphs}\label{sec:graph} Fix $h\in\TT_X$. With the adjacency relation of Definition~\ref{def:connected}, the squares of $\Qc_h$ are the vertices of a graph which approximates the carpet at scale~$h$. This section proves an $L^1$ Poincar\'e inequality on the finite subgraphs formed by the squares of $\Qc_h$ contained in one square of side $3^jh$, or in two adjacent ones. The inequality involves only the edges inside the subgraph, and its constant $4^j=(3^j)^\lambda$ has the sharp dependence on~$j$. We use the notation $v_{\mathcal D}$ and $T_{\mathcal D}(v)$ of Definition~\ref{def:graph}. \begin{theorem}[Poincar\'e inequality on the approximating graphs]\label{th:graph} Let $h\in\TT_X$ and let $j\ge0$ be an integer with $3^jh\in\TT_X$. Let $\mathcal D=[P]$ with $P\in\Qc_{3^jh}$, or $\mathcal D=[P]\cup[P']$ with adjacent $P,P'\in\Qc_{3^jh}$. Then, for every $v\colon\mathcal D\to\R$, \begin{equation}\label{eq:graph} \sum_{U\in\mathcal D}|v(U)-v_{\mathcal D}|\le13\cdot4^j\,T_{\mathcal D}(v)\,. \end{equation} In other words, the cell structure of the carpet satisfies the graph Poincar\'e inequality with exponent $\lambda=\log_34$ and $C_G=13$. \end{theorem} For $S\subset[P]$ let $\partial_PS$ be the set of the unordered pairs $\{U,V\}$ with $U\in S$, $V\in[P]\setminus S$ and $U\sim V$. Applied to $v=\ind_S$, Theorem~\ref{th:graph} gives an isoperimetric inequality. \begin{corollary}[Isoperimetric inequality on the approximating graphs]\label{cor:graphisop} Let $h$, $j$ and $P\in\Qc_{3^jh}$ be as in Theorem~\ref{th:graph}. For every $S\subset[P]$, \begin{equation}\label{eq:graphisop} \min\{\#S,\,8^j-\#S\}\le13\cdot4^j\ \#\partial_PS\qquad\text{and}\qquad\min\{\#S,\,8^j-\#S\}^{1/3}\le83\ \#\partial_PS\,. \end{equation} If $j\ge1$, there is a set $L\subset[P]$ with \begin{equation*} \tfrac38\,8^j\le\#L\le\tfrac12\,8^j\qquad\text{and}\qquad\#\partial_PL=2^j\,. \end{equation*} In particular, the factor $4^j$ in~\eqref{eq:graph} and in~\eqref{eq:graphisop} cannot be replaced by $o(4^j)$ as $j\to\infty$. \end{corollary} \paragraph{The idea.} A Poincar\'e inequality on a graph is proved by comparing the values of~$v$ at different vertices along paths, in such a way that no edge is used too often. In the graph $[P]$ the holes of all sizes obstruct most paths, and the estimate would be lost if we compared arbitrary pairs of cells. Instead, we attach to every square~$P'$ of every intermediate side a single number $s_{P'}(v)$, the mean of~$v$ over the fine cells of~$P'$ whose two coordinates avoid the digit~$1$. These cells lie on rows and columns which meet no hole. Hence the means of two adjacent squares can be compared along complete rows (Lemma~\ref{lem:cross}), and the gain of a factor~$2^{-j}$ in that comparison, against the trivial bound, is exactly the factor which turns the number $8^j$ of cells into $4^j$. The mean of a square is then compared with the means of its eight subsquares (Lemma~\ref{lem:generation}), and a telescoping sum over the scales gives the theorem. Identify the $h$-squares in $[P]$, $P=Q^{3^j h}_{k,l}$, by their indices $(3^jk+\alpha,3^jl+\beta)$, writing $(\alpha,\beta)$ for their coordinates in~$P$. The allowed coordinates form \begin{equation*} \Rc_j=\{(\alpha,\beta)\in\{0,\ldots,3^j-1\}^2:(\alpha_i,\beta_i)\ne(1,1)\text{ at each ternary place }i\mu\}$. Hence $\#L=(8^j-2^j)/2\ge\frac38\,8^j$. The elements of $\partial_PL$ are the pairs $\{(\mu-1,\beta),(\mu,\beta)\}$ with $\beta\in\Cc_j$, so that $\#\partial_PL=2^j$. For $v=\ind_L$, \eqref{eq:indicator} gives $\sum_{U\in[P]}|v(U)-v_{[P]}|\ge\#L\ge\frac38\,4^j\,T_{[P]}(v)$. \end{proof} \section{Sets bounded by lines through the centres of squares}\label{sec:rectangles} The sets $G$ of~\hC{} on the carpet are unions of rectangles whose sides lie on lines $x_i=(k+\frac12)a$ (Figure~\ref{fig:hyp}(b)). Such a line meets the carpet along copies of the Cantor set~$\K$, as in~\eqref{eq:section}, and its neighbourhoods have small measure. These lines were used in~\cite[proof of Theorem~5.4]{BBE} to compute $d_{tH}(F)$, and their neighbourhoods in~\cite[Section~5.1]{AB}. The first lemma is the computation of Section~\ref{sec:exponent} for a general line. \begin{lemma}\label{lem:strip} Let $a\in\TT_X$, let $h\in\TT$ with $h\le a$, let $k,l\in\N$ and $b=(k+\frac12)a$. \begin{enumerate}[label=\textup{(\roman*)}] \item\label{it:stripmass} $m\big(\big\{x\in X:\ |x_1-b|<\tfrac h2,\ la\le x_2\le(l+1)a\big\}\big)\le a^{d_b}\,h^\lambda$. \item\label{it:stripcontent} $\Hb\big(\big\{x\in X:\ x_1=b,\ la\le x_2\le(l+1)a\big\}\big)\le a^{d_b}$. \end{enumerate} The same bounds hold with the roles of $x_1$ and $x_2$ exchanged. \end{lemma} \begin{proof} \ref{it:stripmass} Let $Z$ be the set on the left. Since $h/2\le a/2$, we have $Z\subset Q^a_{k,l}$. If $Q^a_{k,l}\notin\Qc_a$, then $m(Z)=0$ by Lemma~\ref{lem:volume}\ref{it:null}. Assume that $Q^a_{k,l}\in\Qc_a$, and write $a=3^ph$ with an integer $p\ge0$. Let \begin{equation*} k'=3^pk+\mu\,,\qquad\mu=\frac{3^p-1}2=\sum_{i=0}^{p-1}3^i\,. \end{equation*} The interval $[k'h,(k'+1)h]$ has midpoint $(k'+\frac12)h=(k+\frac12)a=b$. Hence $Z$ is covered by the triadic squares $Q^h_{k',l'}$ with $l'=3^pl+\beta$, $0\le\beta<3^p$. The digits of $k'$ in the places $0\le i3^{-p}a$. Hence $\Hb(Z_0)\le\lim_p2^p(3^{-p}a)^{d_b}=a^{d_b}$. If $Q\notin\Qc_a$, then by~\ref{Q3} every point of $Q\cap X$ lies in a triadic square of side~$a$ other than~$Q$, hence on the boundary of~$Q$, and $Z_0$ has at most two points. \end{proof} \begin{definition}\label{def:rect} Let $a\in\TT_X$ and $b_k=(k+\frac12)a$ for $k\in\N$. If $X=F_\infty$, let $I_0=[0,b_0)$ and $I_k=[b_{k-1},b_k)$ for $k\ge1$. If $X=F$, we use the same intervals for $0\le k<1/a$ and let $I_{1/a}=[b_{1/a-1},1]$. We denote by $\Pc_a$ the family of the non-empty sets $(I_k\times I_l)\cap X$. \end{definition} The intervals $I_k$ partition $[0,\infty)$, respectively $[0,1]$, and each has length at most~$a$. Hence $\Pc_a$ is a partition of $X$ into sets of diameter at most~$a$. \begin{proposition}\label{prop:rect} Let $a\in\TT_X$ and $A\in\Pc_a$. Then \begin{equation*} \tfrac14\,a^{d_h}\le m(A)\le a^{d_h}\,,\qquad J_r(\ind_A)\le C\,a^{d_b}\,r^\lambda\quad\text{for every }00$ and $C$ such that, for every measurable $E\subset X$, \begin{equation*} C^{-1}\,\Hb(\partial^*E)\le\Per(E)\le C\,\Hb(\Sigma_\gamma(E))\,, \end{equation*} and $\Hb(\partial^*E\setminus\Sigma_\gamma(E))=0$ if $\Per(E)<\infty$. \end{enumerate} \end{theorem} \begin{proof} \ref{it:carpet-hyp} By Lemma~\ref{lem:volume} and Corollary~\ref{cor:neighbours}, $X$ satisfies the standing assumptions and has a cell structure. By Theorem~\ref{th:graph} it satisfies the graph Poincar\'e inequality with exponent $\lambda$, and Proposition~\ref{prop:transfer} gives~\hP. Hypotheses~\hC{} and~\hCp{} are Corollary~\ref{cor:carpetC}. The value of $d_{tH}$ follows from Theorem~\ref{th:ahlfors}\ref{it:ahl-dim}. \ref{it:carpet-strong} Here $\zeta=3^{d_b}=2$, so that $\#\mathcal Y<\zeta$ means $\#\mathcal Y\le1$ (Figure~\ref{fig:children}(a)). \emph{\ref{H1} and~\ref{H2}.} The graph $\ch(P)$ of a square $P\in\Qc_a$ is the cycle formed by its eight subsquares, described in the proof of Lemma~\ref{lem:generation}; it is connected, and after the deletion of one vertex the remaining seven vertices form a path. Thus~\ref{H2} holds with $g=7>\max\{4,2\}$. Two triadic squares of the same side are adjacent only if their indices differ by one in exactly one coordinate, so the parity of $k+l$ gives a partition of the graphs $\ch(P)$ and $\ch(P)\cup\ch(P')$ into two classes without adjacent elements, and~\ref{H1} holds. \emph{\ref{H3}.} Let $P\sim P'$. Three subsquares of $P$ have a side contained in $P\cap P'$, and each of them is adjacent to exactly one subsquare of~$P'$. After the deletion of one vertex, at least two of these three pairs remain, and all the remaining children of $P$, and of~$P'$, belong to the components with at least $7$ vertices. The conclusions follow from Theorem~\ref{th:strong} and Corollary~\ref{cor:strongfederer}. \end{proof} By Theorem~\ref{th:approx}, the perimeter on the carpet is comparable to the lower semicontinuous envelope of $E\mapsto\Hb(\partial E)$, and the approximating sets $E_h$ of that theorem are finite unions of elements of the partitions~$\Pc_a$, whose boundaries are finite unions of pieces of Cantor sets. By Proposition~\ref{prop:rect} and Theorem~\ref{th:ahlfors}\ref{it:ahl-isop}, every $A\in\Pc_a$ satisfies \begin{equation*} \Per(A)\asymp a^{d_b}\asymp m(A)^{1/3}\,. \end{equation*} \section{Explicit sets}\label{sec:examples} We determine which sets of the form $\{x\in F:\ x_1<\tau\}$ have finite perimeter, and we consider the set $\{x\in F:\ x_13^{-j}$. Hence \begin{equation*} \Hb(\{\tau\}\times S)\le\lim_{j\to\infty}\#\mathcal I_j\,3^{-jd_b}=\lim_{j\to\infty}\big(\tfrac32\big)^{N_j}=\big(\tfrac32\big)^{N(\tau)}\,. \end{equation*} For the lower bound, let $\mu$ be the Borel probability measure on $S$ which gives the mass $1/\#\mathcal I_j$ to each interval in~\eqref{eq:sectionS}, for every~$j$; it exists by the remark following~\eqref{eq:sectionS}. Let $B=B(x,r)$ be a ball of $F$ with $3^{-j-1}\le r<3^{-j}$. The set of the $y$ with $(\tau,y)\in B$ is contained in an interval of length $2r<2\cdot3^{-j}$, which meets at most three of the intervals $[l3^{-j},(l+1)3^{-j}]$. Therefore \begin{equation*} \mu\big(\{y:\ (\tau,y)\in B\}\big)\le\frac3{\#\mathcal I_j}=3\cdot2^{-j}\big(\tfrac32\big)^{-N_j}\le6\,\big(\tfrac32\big)^{-N_j}\,r^{d_b}\,. \end{equation*} Let now $j_0\ge0$, and let $(B(x_\iota,r_\iota))_\iota$ be a countable family of balls with $r_\iota<3^{-j_0}$ which covers $\{\tau\}\times S$. Since $N_j\ge N_{j_0}$ for $j\ge j_0$, we get $1\le6\,(\frac32)^{-N_{j_0}}\sum_\iota r_\iota^{d_b}$. Thus $\Hb(\{\tau\}\times S)\ge\frac16(\frac32)^{N_{j_0}}$ for every~$j_0$, and $\Hb(\partial^*E_\tau)\asymp(\frac32)^{N(\tau)}$. The comparison with $\Per(E_\tau)$ is Theorem~\ref{th:ahlfors}\ref{it:ahl-fed}. \ref{it:triadic} Let $\tau=k3^{-n}$ and $a=3^{-n}$. Since the index $l=0$ has no digit equal to~$1$, the squares $Q^a_{k-1,0}$ and $Q^a_{k,0}$ belong to $\Qc_a(F)$. Their common side $\sigma=\{\tau\}\times[0,a]$ is contained in~$F$. Let $z\in\sigma$ and $h=3^{-j}\le a$, and let $l0$, hence $\sigma\subset\partial^*E_\tau$. Since $d_b<1$, we have $\Hb(\sigma)=\infty$, and $\Per(E_\tau)=\infty$ by Theorem~\ref{th:ahlfors}\ref{it:ahl-fed}. \emph{The last assertions.} We have $N(\tau)<\infty$ if and only if $\tau_i=1$ for all $i>n$, for some $n\ge0$, that is, if and only if $\tau=(k+\frac12)3^{-n}$ with $0\le k<3^n$. The statements for $\{x\in F:\ x_2<\tau\}$ follow by exchanging the coordinates. \end{proof} \begin{remark}[Construction cells]\label{rem:cellperimeter} Every construction cell of the compact carpet of positive generation has infinite critical perimeter. Indeed, it shares an entire side with a retained sibling. At each finer generation every point on that side belongs to two fine squares, one on each side, since the column or row adjacent to the side uses only the extreme digit $0$ or $2$ in its normal coordinate. As in the proof of Proposition~\ref{prop:lines}\ref{it:triadic}, the common side is contained in the measure-theoretic boundary. Its $\Hb$-measure is infinite since $d_b<1$, and Theorem~\ref{th:carpet} gives the assertion. \end{remark} \paragraph{Energy measures of coordinate cuts.} Let $E=E_{1/2}$ and let $\kappa$ be the uniform Cantor probability measure on $\{1/2\}\times\K$. The exact self-similarity at the line $x_1=1/2$ determines the spatial distribution of its energy at small scales. \begin{proposition}\label{prop:carpetaverage} Set $a(r)=m_{r,\ind_E}(F)=r^{-\lambda}J_r(\ind_E)$. For $00$ and \begin{equation*} W_1\!\left(a(r)^{-1}m_{r,\ind_E},\kappa\right)\le 12r\,, \end{equation*} where $W_1$ is the $1$-Wasserstein distance for the maximum metric on~$F$. In particular $m_{r,\ind_E}-a(r)\kappa\rightharpoonup0$ as $r\downarrow0$, and for any $r_0\in(0,1/12)$, \begin{equation*} \frac1{\log3}\int_r^{3r}m_{u,\ind_E}\,\frac{du}{u} \;\rightharpoonup\; \left(\frac1{\log3}\int_{r_0}^{3r_0}a(u)\,\frac{du}{u}\right)\kappa\,. \end{equation*} The coefficient is positive and finite. \end{proposition} \begin{proof} Let $S_0(x)=(x+(1,0))/3$ and $S_1(x)=(x+(1,2))/3$. The cells $S_0F,S_1F$ form the middle column of the first generation, are at distance $1/3$ from each other, and each map $S_i$ preserves the side of the line $x_1=1/2$. Suppose $00$, let $m^P_r$ be the measure which is defined like $m_{r,\ind_{E_\tau}}$, but in the space $P\cap F$ with the restrictions of $d$ and~$m$; thus the balls in its kernel are the balls of the cell. The map $T_P$ multiplies distances by~$h$ and measures by $h^{Q}=8^{-n}$. The same change of variables as in~\eqref{eq:carpetrecursion}, now with $3^{n\lambda}=4^n$, gives \begin{equation*} m^P_r=\frac{4^n}{8^n}\,(T_P)_*m_{3^nr,\ind_{E_{1/2}}}=2^{-n}\,(T_P)_*m_{3^nr,\ind_{E_{1/2}}}\,,\qquad\text{hence}\qquad m_r^P(F)=2^{-n}\,a(3^nr)\,. \end{equation*} \emph{Step 2: comparison with the energy in the carpet.} Let $Z$ be the finite set of the endpoints of the segments $P\cap\{x_1=\tau\}$, and let $03r$, and suppose that there is $y\in F$ with $d(x,y)2r$ from its two vertical sides. The points $(\tau,lh)$ and $(\tau,(l+1)h)$ belong to~$Z$, hence $x$ is at distance larger than~$3r$ from the two horizontal sides of~$P$. Therefore $B(x,2r)$ is contained in~$P$, and so are $B(x,r)$ and $B(y,r)$. Consequently the kernel $k_r(x,y)$ coincides with the kernel of the cell, and the densities of $m_{r,\ind_{E_\tau}}$ and of $\sum_Pm^P_r$ with respect to~$m$ coincide at~$x$. On the set $\{x:\ d(x,Z)\le3r\}$ both densities are at most $2\,r^{-\lambda}$, by~\eqref{eq:kernelmass}, and this set has measure at most $C\,\#Z\,r^{Q}$ by Lemma~\ref{lem:volume}\ref{it:ball}. Taking the masses and using Step~1, we obtain \begin{equation}\label{eq:cutcommonperiod} r^{-\lambda}J_r(\ind_{E_\tau}) =2^{-n}\,M\,a(3^n r)+O\big(\#Z\,r^{Q-\lambda}\big)\qquad\text{as }r\downarrow0\,. \end{equation} Since $Q-\lambda=d_b>0$, taking the lower limit gives $\Per(E_\tau)=2^{-n}M\Per(E_{1/2})=(\frac32)^{N(\tau)}\Per(E_{1/2})$. \emph{Step 3: the Hausdorff measure of the boundary.} By Proposition~\ref{prop:lines} and~\eqref{eq:section}, the set $\partial^*E_\tau=F\cap\{x_1=\tau\}$ is the union of the $M$ sets $T_P(\{\frac12\}\times\K)$, which meet only at points of~$Z$, and $\Hb(Z)=0$. A point of $P\cap\{x_1=\tau\}$ which is not in~$Z$ is an interior point of the square~$P$. Hence, for a compact subset $K'$ of $T_P(\{\frac12\}\times\K)\setminus Z$, the balls of~$F$ of sufficiently small radius which meet~$K'$ are contained in~$P$, and they are the images under~$T_P$ of balls of~$F$ whose radii are $3^n$ times larger. Thus $\Hb(K')=3^{-nd_b}\,\Hb(T_P^{-1}(K'))=2^{-n}\,\Hb(T_P^{-1}(K'))$, and exhausting by compact sets we get $\Hb(T_P(\{\frac12\}\times\K))=2^{-n}\,\Hb(\{\frac12\}\times\K)$. Therefore \begin{equation*} \Hb(\partial^*E_\tau)=2^{-n}\,M\,\Hb(\partial^*E_{1/2})=\big(\tfrac32\big)^{N(\tau)}\,\Hb(\partial^*E_{1/2})\,, \end{equation*} and the ratio $\Per(E_\tau)/\Hb(\partial^*E_\tau)$ does not depend on~$\tau$. The reflection $(x_1,x_2)\mapsto(x_2,x_1)$ preserves $F$, $d$ and~$m$ and gives the same statements, with the same ratio, for the horizontal cuts. \end{proof} \begin{proposition}\label{prop:diagonal} Let $E=\{x\in F:\ x_1x_2\}$. Since the diagonal is $m$-null, $\theta_E(z,r)=\frac12$ for every $z\in F\cap\{x_1=x_2\}$ and every $r>0$. A point of $F$ outside the diagonal has a neighbourhood contained in $E$ or in $F\setminus E$. This proves the first assertion. The set $\{(u,u):\ u\in\K\}$ is isometric to~$\K$, and $0<\Hb(\K)<\infty$~\cite{Hut}. The second assertion follows from Theorem~\ref{th:ahlfors}\ref{it:ahl-fed}. \end{proof} \section{Heat loss across vertical cuts}\label{sec:carpet-heat} Equip the compact standard carpet $F$ with its canonical conservative diffusion. Its heat kernel satisfies the sub-Gaussian estimates of Section~\ref{sec:heat-BV} in the maximum metric, with walk dimension $d_w$ \cite[Section~4.7]{BBKT}. Write $E_\tau=\{x\in F:x_1<\tau\}$ and recall that $Q=\log_3 8$. The two interfaces in Figure~\ref{fig:lines} give different powers of time. \begin{proposition}\label{prop:carpet-heat-cuts} As $t\downarrow0$, \begin{equation*} Q_{E_{1/2}}(t)\asymp t^{(Q-\log_3 2)/d_w}, \qquad Q_{E_{1/3}}(t)\asymp t^{(Q-1)/d_w}. \end{equation*} For $0<\tau<1$, the quantity $t^{-(\log_3 4)/d_w}Q_{E_\tau}(t)$ stays bounded as $t\downarrow0$ precisely when $\tau=(k+\tfrac12)3^{-n}$ for integers $n\ge0$ and $0\le k<3^n$. At every other cut it tends to infinity. \end{proposition} \begin{proof} Put $r=t^{1/d_w}$. By Proposition~\ref{prop:heat-scales}, $2Q_{E_\tau}(t)=H_t(\ind_{E_\tau})\asymp J_r(\ind_{E_\tau})$. The carpet exponent is $\lambda=Q-\log_3 2=\log_3 4$. Proposition~\ref{prop:lines} gives finite perimeter for precisely the column midpoints in the statement. At each such cut the perimeter is positive by Theorem~\ref{th:metric}, since both sides have positive measure. The definition of $\Per$ gives a positive lower bound for $r^{-\lambda}J_r(\ind_{E_\tau})$ at all sufficiently small radii, and Theorem~\ref{th:metric} gives the upper bound. For every remaining cut the defining lower limit is infinite. This proves the assertion about all cuts and the estimate at $\tau=1/2$. For $\tau=1/3$, a pair on opposite sides at distance less than $r$ has both points in the strip $|x_1-1/3|t\}}\quad\rho\text{-almost everywhere}, \qquad \sum_{t\in T}w(t)|b_t|<\infty\,. \end{equation*} In that case \begin{equation*} \Var(g\circ\pi_1)=\Per(E_{1/2})\sum_{t\in T}w(t)|b_t|\,. \end{equation*} In particular, if $g$ is continuous and $g\circ\pi_1\in BV(F)$, then $g$ is constant. The same statements hold for $\pi_2$. \end{theorem} \begin{proof} \emph{Column averages.} Suppose $f=g\circ\pi_1\in BV(F)$. For $h=3^{-n}$ let $g_n$ take on the $k$-th column interval the value $c_k$ equal to the $\rho$-average of $g$ there. Self-similarity gives the same value for the $m$-mean of $f$ in every retained square of this column. At an interior grid boundary $u=kh$, let $q_n(u)$ be the number of positions at which both $k-1$ and $k$, written with $n$ ternary digits, have a digit different from one. The two columns have $2^n(3/2)^{q_n(u)}$ common retained rows. Indeed, the row digit has three choices if both column digits are outer and two otherwise. For adjacent squares across the interface $u=kh$, Jensen's inequality bounds $|c_k-c_{k-1}|$ by the mean of $|f(x)-f(y)|$ on their product. These products are disjoint modulo null sets. Each square has mass $8^{-n}$, and $k_{3h}(x,y)\ge c\,8^n$ on the products by Ahlfors regularity. Summing over the interfaces gives, for $n\ge1$, \begin{equation}\label{eq:carpetcolumnmeans} \sum_{k=1}^{3^n-1}(3/2)^{q_n(kh)}|c_k-c_{k-1}| \le C\,4^nJ_{3h}(f)\le C S_\lambda(f)\,. \end{equation} In particular the ordinary total variations of the step functions $g_n$ are bounded. Their supremum norms are bounded as well, since $\int |g_n|\,d\rho\le\int |g|\,d\rho$. By Helly's theorem a subsequence converges at every continuity point of a classical BV function $G$ on $(0,1)$, hence also in $L^1(0,1)$ for Lebesgue measure. The column means converge $\rho$-almost everywhere to $g$ by the martingale convergence theorem. Since a BV representative has at most countably many discontinuities and $\rho$ is nonatomic, $G=g$ $\rho$-almost everywhere. \emph{The distributional derivative.} For any sequence of grid interfaces $u_n\to u\in(0,1)$, \begin{equation*} \liminf_{n\to\infty}(3/2)^{q_n(u_n)}\ge w(u)\,. \end{equation*} If $u$ is not a grid endpoint, both columns adjacent to $u_n$ eventually share each fixed prefix of $u$. If $u$ is a grid endpoint of generation $k_0$, fix $L>k_0$. The two columns eventually lie in the union of the two level-$L$ intervals incident to $u$. Every digit in positions $k_0+1,\ldots,L$ in either prefix is $0$ or $2$, giving $q_n(u_n)\ge L-k_0$. The same prefix argument shows that $w$ is lower semicontinuous on $(0,1)$. Take $0\le\phi\in C_c(0,1)$ with $\phi\le w$. Given $\varepsilon>0$, all sufficiently fine grid weights satisfy $(3/2)^{q_n(u)}\ge\phi(u)-\varepsilon$, by the preceding lower bound and compactness of the support. Lower semicontinuity of the weighted ordinary total variation under $L^1$ convergence (or its distributional dual formula) and~\eqref{eq:carpetcolumnmeans} give \begin{equation*} \int\phi\,d|DG|\le\liminf_n\int\phi\,d|Dg_n| \le C S_\lambda(f)+\varepsilon\sup_n|Dg_n|((0,1))\,. \end{equation*} Sending $\varepsilon$ to zero and taking the supremum over $\phi$ yields $\int w\,d|DG|\le C S_\lambda(f)$. Hence $DG$ is carried by $T$. With $b_t=DG(\{t\})$, the series in the statement has distributional derivative $DG$. Its value therefore agrees with $G$ up to an additive constant wherever both representatives are continuous. This gives the representation $\rho$-almost everywhere. \emph{Exact variation.} For a finite sum, a pair with $d(x,y)0$, depending only on $b$ and $a$, such that every measurable set $E\subset F_{b,a}$ satisfies \[ \Per(E)\asymp\Hc^s(\partial^*E)\asymp\Hc^s(\Sigma_\gamma(E)). \] If $\Per(E)<\infty$, then $\Hc^s(\partial^*E\setminus\Sigma_\gamma(E))=0$. \end{corollary} \begin{proof} Put $\ell=b-a=b^s$. We verify the selection rule of Corollary~\ref{cor:strongselection}. Give the children of a parent weights of total sum less than $\ell$. Among the $\ell$ disjoint complete rows at least one has total weight less than one. The same holds for the $\ell$ disjoint complete columns. Each row or column of weight less than one lies in the retained graph, including its edges. Every complete row meets every complete column. All complete rows and columns of weight less than one therefore belong to a single component, which we select. A row and a column have $2b-1$ children between them, so the component has at least $g=2b-1>\ell$ vertices. If the total weight is less than one, every edge and vertex is retained and the child graph is connected. For two horizontally adjacent parents with combined child weight less than $\ell$, consider the $\ell$ disjoint pairs of aligned complete rows. Some pair has total weight less than one. Its two halves belong to the selected components of their respective parents, and the edge across their common side is retained. For vertically adjacent parents one uses the aligned complete columns. This proves the selection rule, and Theorem~\ref{th:centralcarpets} supplies~\hP{} at $\lambda=Q-s$. Corollary~\ref{cor:strongselection} gives the assertion. \end{proof} \paragraph{Continuous functions of bounded variation.} If the central block has width $a\ge3$, one can choose its column digit independently at every generation. The resulting Cantor set of cut positions carries an atomless measure, whose distribution function gives continuous BV functions separating points. \begin{proposition}\label{prop:carpetcontinuous} If $a\ge3$, the algebra $C(F_{b,a})\cap BV(F_{b,a})$ is uniformly dense in $C(F_{b,a})$. For every nonconstant $f$ in this algebra the coarea measure $\nu_f$ is nonzero and vanishes on every Borel set of $\sigma$-finite $\Hc^{s}$-measure, where $s=\log_b(b-a)$. \end{proposition} \begin{proof} Let $I$ be the set of the $a$ central digits and let $K_I$ consist of the numbers all of whose base-$b$ digits lie in $I$. Let $D_0$ be a base-$b$ interval of generation $k$. Map the uniform Bernoulli measure on $K_I$ to $D_0$ by the increasing similitude from $[0,1]$ onto $D_0$, and denote its image by $\eta$. Since $a\ge3$, this measure is nonatomic. Its distribution function $G(u)=\eta([0,u])$ is continuous, equals zero to the left of $D_0$ and one to its right. Put $N=b^2-a^2$ and $\ell=b-a$. Every $t$ in the support of $\eta$ has all digits after the $k$-th in $I$. Since $0,b-1\notin I$, at every generation $j\ge k$ the point $t$ is at distance at least $c b^{-j}$ from both endpoints of its column, for a constant $c>0$ depending only on $b,a$. The column contains at most $b^k\ell^{j-k}$ retained squares. Given small $r>0$, choose $h=b^{-j}$ so that $rh$. If $Q^a_k\notin\Qc_a$, both sets in~\eqref{eq:spongestrip} are contained in the boundary of $Q^a_k$; the first one is null and the second one is contained in four segments, which are $\Hc^s$-null because $s>1$. The same holds for the other coordinate directions. Let $A=(I_{k_1}\times I_{k_2}\times I_{k_3})\cap\MS$. Each of the at most six faces of the box $I_{k_1}\times I_{k_2}\times I_{k_3}$ which do not lie on the boundary of $[0,1]^3$ is contained in a plane $\{x_i=(k+\frac12)a\}$ and in the union of four cubes $Q^a_{k'}$. Arguing as in the proof of Proposition~\ref{prop:rect}, with~\eqref{eq:spongestrip} in place of Lemma~\ref{lem:strip}, we obtain $\Hc^s(\partial A)\le24\,a^s$, and $J_r(\ind_A)\le C\,a^s\,r^\lambda$ for $r\le a/6$. For $a/60$ and $C$ such that, for every measurable $E\subset\MS$, \begin{equation*} C^{-1}\,\Hc^s(\partial^*E)\le\Per(E)\le C\,\Hc^s(\Sigma_\gamma(E))\,, \end{equation*} and $\Hc^s(\partial^*E\setminus\Sigma_\gamma(E))=0$ if $\Per(E)<\infty$. \end{enumerate} \end{theorem} \begin{proof} \ref{it:sponge-hyp} By Lemma~\ref{lem:spongecells} and Theorem~\ref{th:spongegraph}, $\MS$ has a cell structure which satisfies the graph Poincar\'e inequality with exponent~$\lambda$, and Proposition~\ref{prop:transfer} gives~\hP. Hypotheses~\hC{} and~\hCp{} are Lemma~\ref{lem:spongerect}. \ref{it:sponge-strong} Here $\zeta=3^s=4$ and $N=20$. The graph $\Gamma=\ch(P)$ is connected, and bipartite with the corners and the midpoints as the two classes; the graph $\ch(P)\cup\ch(P')$ of two adjacent cubes is bipartite as well, because adjacent cubes have indices which differ by one in exactly one coordinate. Thus~\ref{H1} holds, and~\ref{H2} and~\ref{H3} hold with $g=13>\max\{10,4\}$ by Lemma~\ref{lem:deletions}. The conclusions follow from Theorem~\ref{th:strong} and Corollary~\ref{cor:strongfederer}. \end{proof} The condition~\ref{H2} cannot be verified on the sponge by counting alone, as on the carpet: since $\zeta=4$, three children of a cube may be deleted, and deleting the three midpoints adjacent to a corner isolates this corner in $\ch(P)$ (Figure~\ref{fig:children}(b)). This is why the proof of Theorem~\ref{th:strong} retains only the largest connected component of $\Gamma^*[\ch(P)]$, and why it requires an edge of $\mathcal E^*$, and not only two cells of $\Tc^*$, between adjacent cubes. \chapter{The Sierpi\'nski gasket}\label{sec:gasket} \begin{overview} On the gasket a cell is separated from its complement by at most three points, its corners. This gives~\hC{} with $s=0$, and the connectedness of the graphs of cells gives~\hP{} with $\lambda=Q$. We are therefore at the endpoint of the theory, where $\Hcod\lambda$ is comparable to the counting measure, and everything can be made explicit. The sets of finite perimeter are the finite unions of cells. The perimeter of a set is a constant multiple of the number of points of its measure-theoretic boundary. The coarea inequality is an identity, and the variation of a function is a constant multiple of the sum of its jumps at the junction points. On open sets the jump measure is recovered by taking the supremum of the variation over relatively compact open subsets. The relaxed variation of the indicator of a first-level cell fails to be additive on two disjoint open sets. \end{overview} \section{Cells} Let $p_1,p_2,p_3\in\R^2$ be the vertices of an equilateral triangle $\triangle$ of side~$1$, let $F_i(x)=\frac12(x+p_i)$ for $i=1,2,3$, and let $\SG$ be the Sierpi\'nski gasket, that is, the unique non-empty compact set with \begin{equation*} \SG=F_1(\SG)\cup F_2(\SG)\cup F_3(\SG)\,. \end{equation*} For a word $w=w_1\cdots w_n\in\{1,2,3\}^n$ let $F_w=F_{w_1}\circ\cdots\circ F_{w_n}$. The sets $F_w(\SG)$ with $w$ of length~$n$ are the \emph{cells of side $2^{-n}$}, and the three points $F_w(p_i)$ are the \emph{corners} of the cell $F_w(\SG)$. Let $\Qc_{2^{-n}}$ be the family of the cells of side $2^{-n}$, $V_n$ the set of their corners, and $V_*=\bigcup_nV_n$, which is countable. We equip $\SG$ with the Euclidean distance~$d$, so that $D=1$, and with the self-similar probability measure~$m$ which gives the mass $3^{-n}$ to each cell of side $2^{-n}$; it is the normalized Hausdorff measure of dimension \begin{equation*} Q=\frac{\log3}{\log2}\,. \end{equation*} Two distinct cells of the same side are \emph{adjacent} if they intersect. We use the following standard facts. \begin{enumerate}[label=\textup{(S\arabic*)},leftmargin=*] \item\label{S1} Two distinct cells of side $2^{-n}$ are disjoint or meet in exactly one point, which is a corner of both. A cell of side $2^{-n}$ is adjacent to at most six cells of the same side, and a point belongs to at most three cells of the same side. There is a constant $c_0\in(0,1]$ such that two disjoint cells of side $2^{-n}$ are at distance at least $c_0\,2^{-n}$ from each other. \item\label{S2} A cell has diameter equal to its side, it is the union of its three children, which are pairwise adjacent, and it contains its corners. A point of a cell which is not one of its corners is an interior point of the cell in~$\SG$. \item\label{S3} For every cell $U$ and every $z\in U$, the set $U\setminus\{z\}$ is connected. The set obtained from $U$ by removing its three corners is connected. \end{enumerate} \begin{proof}[Proof of~\ref{S1} to~\ref{S3}] \ref{S1} A cell of side $2^{-n}$ is contained in a closed triangle $F_w(\triangle)$ and contains its vertices, and these triangles are translates of $2^{-n}\triangle$ by the vectors of the lattice generated by $2^{-n}(p_2-p_1)$ and $2^{-n}(p_3-p_1)$. Two distinct translates of $\triangle$ by vectors of the lattice generated by $p_2-p_1$ and $p_3-p_1$ either are disjoint or have exactly one vertex in common, the latter for six translates; each lattice point is a vertex of three translates; and since finitely many translates meet a given ball, the distance between two disjoint translates is bounded below. \ref{S2} The first three assertions are clear, and the last one follows from~\ref{S1}: the other cells of the same side are closed, finite in number, and do not contain the point. \ref{S3} It suffices to consider $U=\SG$. Let $\Gamma_n$ be the union of the boundaries of the triangles $F_w(\triangle)$ with $w$ of length~$n$. We show by induction that $\Gamma_n\setminus\{z\}$ is connected for every~$z$. This is clear for the boundary of a triangle. For the inductive step, $\Gamma_{n+1}$ is the union of the three sets $F_i(\Gamma_n)$, each of which remains connected when $z$ is removed, and any two of them have a common point; these three common points are distinct, so at least two of them differ from~$z$. Since the sets $\Gamma_n$ increase and their union is dense in~$\SG$, the set $\SG\setminus\{z\}$ contains a dense connected subset and is connected. Finally, each child of $\SG$ contains exactly one corner of $\SG$ and remains connected when it is removed, and the three points common to two children are not corners of~$\SG$. \end{proof} \begin{proposition}\label{prop:gasketaxioms} The space $(\SG,d,m)$ satisfies the standing assumptions of Section~\ref{sec:hyp}, the measure $m$ is Ahlfors regular of dimension~$Q$, and its cells form a cell structure with $b_0=2$, $N=3$, $a_{\max}=1$, $C_0=1$, $c_1=c_0$ and $K_0=7$. It satisfies the graph Poincar\'e inequality with exponent $\lambda=Q$ and $C_G=4$, hence~\hP{} with $\lambda=Q$, and it satisfies~\hCp, hence~\hC, with $s=0$ and $M=3$. More precisely: \begin{enumerate}[label=\textup{(\roman*)}] \item\label{it:gasket-ball} $\frac13\,r^Q\le m(B(x,r))\le7\,(2/c_0)^Q\,r^Q$ for $x\in\SG$ and $0c_0a/2$, Lemma~\ref{lem:Jbasic}\ref{it:JL1} gives $J_r(\ind_U)\le4\,a^Q\le C\,r^Q$. If $r\le c_0a/2$, let $h=2^{-n}\le a/2$ with $c_0h/20$ hold on the gasket with $\lambda=Q$. We list them. \begin{theorem}\label{th:gasketgeneral} On the Sierpi\'nski gasket, with $\lambda=Q=\log_23$: \begin{enumerate}[label=\textup{(\roman*)}] \item Theorem~\ref{th:metric} holds: $S_Q(f)\le C\liminf_{r\downarrow0}r^{-Q}J_r(f)$, the space $BV(\SG)=\Bes Q(\SG)$ is dense in $L^1(\SG,m)$, $\lambda_1^*=\lambda_1^\#=Q$, and a function with $J_r(f)=o(r^Q)$ is constant. \item A measurable set $E$ with $00$ such that, for every measurable set~$E$, \begin{gather*} C^{-1}\,\#\partial^*E\le\Per(E)\le C\,\#\Sigma_\gamma(E)\,,\\ c\Per(E)\le\liminf_{n\to\infty}N_{2^{-n}}(E)\le\sup_{n\ge2}N_{2^{-n}}(E)\le C\Per(E)\,. \end{gather*} \end{enumerate} \end{theorem} \begin{proof} These assertions follow from Theorems~\ref{th:metric} and~\ref{th:ahlfors} and Corollary~\ref{th:discrete}. \end{proof} The value $d_{tH}(\SG)=1$ is known, see~\cite{BBE}, and so is the critical exponent; see Remark~\ref{rem:AB}. \section{The main theorem}\label{sec:gasket-main} The statements of Theorem~\ref{th:gasketgeneral} hold up to constants. On the compact gasket they can be replaced by identities, with a single constant. Let $V_*=\bigcup_nV_n$ be the set of the corners of all the cells; its points other than the three corners of~$\SG$ are the \emph{junction points}, at which two cells of the same side meet. Fix a first-level cell $U_0$ and let \begin{equation*} a(r)=\frac{J_r(\ind_{U_0})}{2r^Q},\qquad c_{\SG}=\liminf_{r\downarrow0}a(r)=\tfrac12\Per(U_0)>0. \end{equation*} For $f\in BV(\SG)$, write $f^\wedge$ and $f^\vee$ for its approximate lower and upper limits. Thus $f^\wedge(v)$ is the supremum of the $t$ for which $\{ft\}$ has density zero at $v$. Both are finite since $f$ is essentially bounded by Theorem~\ref{th:gasketgeneral}. \begin{theorem}\label{th:gasket} A measurable set $E\subset\SG$ has finite perimeter if and only if it agrees almost everywhere with a finite union of cells. For every measurable $E$ and every $f\in L^1(\SG,m)$, \begin{equation*} \Per(E)=c_{\SG}\,\#\partial^*E\,, \qquad \Var(f)=\int_\R\Per(\{f>t\})\,dt\,. \end{equation*} The possible volumes of sets of finite perimeter are precisely $k3^{-n}$, where $n\ge0$ and $0\le k\le3^n$ are integers. The variation is lower semicontinuous in $L^1$. If $f\in BV(\SG)$, then \begin{equation*} \Var(f)=c_{\SG}\sum_{v\in V_*}\bigl(f^\vee(v)-f^\wedge(v)\bigr)\,. \end{equation*} In particular every continuous function in $BV(\SG)$ is constant. \end{theorem} The last assertion was conjectured in~\cite[Conjecture~5.3(2)]{AB}. Every BV measure of $f$ is a scalar multiple of the atomic measure with masses $f^\vee(v)-f^\wedge(v)$ at the vertices. Dividing the energy measures by the single-junction contribution $a(r)$ gives a weak limit along all radii (Theorem~\ref{gask-exact}). Corollary~\ref{cor:gasketlocalization} recovers its restriction to each open set from the localized variation. At a triadic volume, a lexicographic initial segment of the cells minimizes perimeter (Corollary~\ref{gask-profile}). \paragraph{Heat regularization on the gasket and the Vicsek set.} Let $P_t=e^{-tL}$ be the conservative heat semigroup on the compact gasket. Its kernel is continuous at each positive time and satisfies sub-Gaussian estimates with $d_w=\log_2 5$ \cite{BPgasket}. Put $\alpha=Q/d_w=\log 3/\log 5$. Every nonconstant $f\in BV(\SG)$ satisfies \begin{equation*} P_t f\notin BV(\SG)\quad(t>0),\qquad \|P_t f-f\|_1\le C t^\alpha\Var(f)\quad(00$ and $u\ne0$, then $u=e^{\eta t}P_tu$ has a continuous representative and is nonconstant. Thus $u\notin BV(\SG)$, although \begin{equation*} t^{-\alpha}\|P_tu-u\|_1 = t^{-\alpha}(1-e^{-\eta t})\|u\|_1\longrightarrow0. \end{equation*} In particular the one-point difference cannot characterize critical BV on the gasket. Both the gasket and the Vicsek set admit the weak estimate~\eqref{eq:heat-wBE} at their respective exponents $d_w-d_h$, where $d_h$ is the Hausdorff dimension~\cite[Section~2]{BLgasket}, \cite[Section~5]{BCVicHeat}. On the compact Vicsek set $K$ with its geodesic metric there is a further estimate for the weak derivative $\partial$ on the tree skeleton $\mathcal S$. If $\nu$ is length measure on $\mathcal S$ and $m_K$ is the self-similar probability measure, the conservative semigroup $P_t^K$ satisfies \begin{equation*} \|\partial P_t^K f\|_{L^1(\mathcal S,\nu)} \le C t^{-d_h/d_w}\|f\|_{L^1(K,m_K)},\qquad 00$ \cite[Section~5]{BCVicSob}. \paragraph{Plan of the proof.} The proof has three parts. Section~\ref{sec:gasket-sets} classifies the sets of finite perimeter: by the endpoint case of Federer's theorem their measure-theoretic boundary is finite, and the connectedness properties~\ref{S3} of the cells then force the set to be a union of cells. Section~\ref{gask-section} computes the energy of a union of cells at small scales: near each junction point the gasket looks the same, up to an isometry, so that each boundary point contributes the same amount $a(r)\,r^Q$ to the energy. Integrating over the level sets of a function gives the formula for the variation and the coarea identity. Section~\ref{sec:gasket-cor} proves global lower semicontinuity, computes the relaxed variation off the junctions of a cell, and identifies the isoperimetric profile. \section{Sets of finite perimeter}\label{sec:gasket-sets} \begin{figure}[t] \centering \begin{tikzpicture}[x=62mm,y=62mm] \gasketpicture{5}{0}{0}{1}{cellgray} \gasketpicture{3}{0.125}{0.2165064}{0.25}{navy} \gasketpicture{3}{0.25}{0}{0.25}{navy} \gasketpicture{3}{0.5}{0}{0.25}{navy} \foreach \x/\y in {0.25/0, 0.125/0.2165064, 0.25/0.4330127, 0.75/0, 0.625/0.2165064}{\fill[white] (\x,\y) circle (2.6pt);\fill[cutred] (\x,\y) circle (1.9pt);} \end{tikzpicture} \caption{The set $E$ is the union of the three dark cells of side~$\frac14$. Its measure-theoretic boundary consists of the five marked junctions, so $\Per(E)=5c_{\SG}$ by Theorem~\ref{th:gasket}.}\label{fig:gasket} \end{figure} \begin{proposition}\label{prop:gasketsets} Let $E\subset\SG$ be measurable. \begin{enumerate}[label=\textup{(\roman*)}] \item\label{it:gs-union} If $E$ is a union of cells of side~$2^{-n}$, then $\Per(E)<\infty$, and $\partial^*E$ is the set of the points of~$V_n$ which belong to a cell of side $2^{-n}$ contained in~$E$ and to a cell of side $2^{-n}$ not contained in~$E$. \item\label{it:gs-class} If $\Per(E)<\infty$, there is $n\ge0$ such that $E$ coincides, up to a null set, with a union of cells of side~$2^{-n}$. \end{enumerate} Consequently the measures of the sets of finite perimeter are the numbers $k\,3^{-n}$ with integers $n\ge0$ and $0\le k\le3^n$. \end{proposition} \begin{proof} \ref{it:gs-union} By Proposition~\ref{prop:gasketaxioms}\ref{it:gasket-cell} and~\eqref{eq:Junion}, $S_Q(\ind_E)<\infty$, hence $\Per(E)<\infty$. Let $z\in\SG$. If $z\notin V_n$, then $z$ is an interior point of the cell of side~$2^{-n}$ which contains it, by~\ref{S2}, and $z\notin\partial^*E$. Let $z\in V_n$. The union of the cells of side~$2^{-n}$ which contain~$z$ is a neighbourhood of~$z$, because the other cells of this side are closed, finite in number, and do not contain~$z$. If all these cells are contained in~$E$, or if none of them is, then $z\notin\partial^*E$, because the cells overlap in null sets. Otherwise let $U\subset E$ and $U'\not\subset E$ be two of these cells. For $k\ge n$, the cell of side $2^{-k}$ contained in~$U$ which has the corner~$z$ has measure~$3^{-k}$ and is contained in $B(z,r)$ for every $r>2^{-k}$, and the same holds for~$U'$. By Proposition~\ref{prop:gasketaxioms}\ref{it:gasket-ball}, both $E$ and $\SG\setminus E$ fill a proportion at least~$c$ of every sufficiently small ball centred at~$z$, hence $z\in\partial^*E$. \ref{it:gs-class} Let $S=\partial^*E$. By Theorem~\ref{th:gasketgeneral}, $\#S\le C\Per(E)<\infty$. \emph{Step 1: $\ind_E$ is locally constant off~$S$.} Let $\gamma$ and $L$ be the constants of Lemma~\ref{lem:strongpoint}. If a ball~$B$ satisfies $v_B(E)>0$, then $LB$ contains a point of $\Sigma_\gamma(E)\subset S$. Hence every $x\in\SG\setminus S$ is the centre of a ball~$B$ with $v_B(E)=0$, that is, a ball on which $\ind_E$ is almost everywhere equal to a constant. Two such balls which intersect have the same constant, because non-empty open sets have positive measure. Thus there is a locally constant function~$g$ on the open set $\SG\setminus S$ with $g=\ind_E$ almost everywhere. \emph{Step 2: $S\subset V_*$.} Suppose that $z\in S\setminus V_*$. Since $S$ is finite, and by~\ref{S2}, there is a cell~$U$ which is a neighbourhood of~$z$ with $U\cap S=\{z\}$. The set $U\setminus\{z\}$ is connected by~\ref{S3}, so that $g$ is constant on it. Since $m(\{z\})=0$, the function $\ind_E$ is almost everywhere constant on the neighbourhood~$U$ of~$z$, which contradicts $z\in\partial^*E$. \emph{Step 3: conclusion.} By Step~2 there is~$n$ with $S\subset V_n$. Let $U$ be a cell of side~$2^{-n}$. A point of $V_n$ which lies in~$U$ is a corner of~$U$, by~\ref{S1}. Hence the set obtained from~$U$ by removing its three corners does not meet~$S$; it is connected by~\ref{S3}, and $g$ is constant on it. Therefore $\ind_E$ is almost everywhere constant on each cell of side~$2^{-n}$. The last assertion follows because a cell of side~$2^{-n}$ has measure~$3^{-n}$ and the cells of the same side overlap in null sets. \end{proof} \section{The energy measures at the junctions}\label{gask-section} \begin{theorem}\label{gask-exact} If $f\in BV(\SG)$, the measure \begin{equation*} \sigma_f=\sum_{v\in V_*}\bigl(f^\vee(v)-f^\wedge(v)\bigr)\delta_v \end{equation*} is finite and satisfies \begin{equation*} m_{r,f}-a(r)\sigma_f\ \rightharpoonup\ 0,\qquad \frac{m_{r,f}}{a(r)}\ \rightharpoonup\ \sigma_f \qquad(r\downarrow0). \end{equation*} Moreover, $a(r/2)=a(r)$ for all sufficiently small $r$. In particular, with $r_0$ sufficiently small, \begin{equation*} \frac1{\log 2}\int_r^{2r}m_{s,f}\,\frac{ds}{s} \ \rightharpoonup\ \left(\frac1{\log 2}\int_{r_0}^{2r_0}a(s)\,\frac{ds}{s}\right)\sigma_f \qquad (r\downarrow0). \end{equation*} \end{theorem} \begin{proof} \emph{Step 1: all the junctions look the same.} Let $n\ge1$ and let $v\in V_n$ be a junction point. We claim that $v$ belongs to exactly two cells of side~$2^{-n}$. For $n=1$ the three cells meet pairwise at three distinct points. If the claim holds for~$n$, a point of~$V_n$ belongs to exactly one child of each of the two cells which contain it, and a point of $V_{n+1}\setminus V_n$ is common to exactly two children of one cell of side~$2^{-n}$ and is not a corner of this cell, hence belongs to no other cell of side~$2^{-n}$. Let $U$ and $U'$ be the two cells of side~$2^{-n}$ which contain~$v$. They are translates of $2^{-n}\SG$, and $v$ is the image of $2^{-n}p_i$ in~$U$ and of $2^{-n}p_j$ in~$U'$, with $i\ne j$. The other cells of side~$2^{-n}$ are compact and do not contain~$v$. Hence there is $\rho_n>0$, which depends only on~$n$, such that \begin{equation*} \SG\cap B(v,\rho_n)=v+2^{-n}\Big(\big((\SG-p_i)\cup(\SG-p_j)\big)\cap B(0,2^n\rho_n)\Big)\,. \end{equation*} The symmetries of the triangle~$\triangle$ preserve $\SG$ and~$m$, and for any two ordered pairs $(i,j)$ and $(i',j')$ of distinct indices one of them maps $p_i$ to $p_{i'}$ and $p_j$ to~$p_{j'}$. Consequently, if $v'$ is another junction point of~$V_n$, contained in the cells $W$ and~$W'$ of side~$2^{-n}$, there is an isometry of the plane which maps $v$ to~$v'$, $U\cap B(v,\rho_n)$ onto $W\cap B(v',\rho_n)$ and $U'\cap B(v,\rho_n)$ onto $W'\cap B(v',\rho_n)$, and which transports the restriction of~$m$ to the restriction of~$m$. \emph{Step 2: the energy of a union of cells.} Let $E$ be a union of cells of side~$2^{-n}$, with $n\ge1$. By Proposition~\ref{prop:gasketsets}\ref{it:gs-union}, $\partial^*E$ is the set of the junction points of~$V_n$ which belong to a cell contained in~$E$ and to a cell not contained in~$E$. Let $x\in E$ and $y\notin E$ with $d(x,y)0$ such that, for $rt\}$. By Proposition~\ref{prop:coarea}, $\int_\R\Per(E_t)\,dt\le\Var(f)<\infty$, so that $\Per(E_t)<\infty$ for almost every~$t$. For these~$t$ let $\Delta_r(t)$ be the difference in Step~5 for the set~$E_t$. By Corollary~\ref{cor:wm}\ref{it:wmspatial} and Step~4, \begin{equation*} |\Delta_r(t)|\le\|\varphi\|_\infty\,\big(r^{-Q}J_r(\ind_{E_t})+a(r)\,\#\partial^*E_t\big)\le C\,\|\varphi\|_\infty\Per(E_t)\,, \end{equation*} and $\Delta_r(t)\to0$ as $r\downarrow0$. The layer-cake identity~\eqref{eq:layer} gives $\int_\R\int\varphi\,dm_{r,\ind_{E_t}}\,dt=\int\varphi\,dm_{r,f}$. For almost every $t$, Proposition~\ref{prop:gasketsets} gives $\partial^*E_t\subset V_*$. For each $v\in V_*$, the set of levels $t$ with $v\in\partial^*E_t$ agrees with $(f^\wedge(v),f^\vee(v))$ up to its two endpoints, as in the proof of Proposition~\ref{prop:coareajump}. Tonelli's theorem for counting measure on $V_*$ first gives $\sigma_f(\SG)=\int_\R\#\partial^*E_t\,dt<\infty$ and then \begin{equation*} \int_\R\sum_{v\in\partial^*E_t}\varphi(v)\,dt =\sum_{v\in V_*}\varphi(v)\big(f^\vee(v)-f^\wedge(v)\big) =\int\varphi\,d\sigma_f. \end{equation*} Dominated convergence now gives $\int\varphi\,dm_{r,f}-a(r)\int\varphi\,d\sigma_f\to0$. Since $\liminf_{r\downarrow0}a(r)=c_{\SG}>0$, division by $a(r)$ gives the second weak limit. \emph{Step 7: averages.} Integrate the first limit against $ds/(s\log2)$ on $[r,2r]$. By Step~3 the average of $a(s)$ over this interval is independent of $r$ for all sufficiently small $r$. \end{proof} The BV measures of $f$ are therefore precisely the measures $c\sigma_f$ with $c$ a limit point of $a(r)$ as $r\downarrow0$. Pure atomicity on the gasket was predicted in the introduction of~\cite{AB}. \begin{proof}[Proof of Theorem~\ref{th:gasket}] The classification of the sets of finite perimeter and the description of their measures are Proposition~\ref{prop:gasketsets}, and the formula for the perimeter is Step~4 of the preceding proof. Let $f\in BV(\SG)$. Taking $\varphi=1$ in Step~6 we get $r^{-Q}J_r(f)-a(r)\,\sigma_f(\SG)\to0$, and taking the lower limit, \begin{equation*} \Var(f)=c_{\SG}\,\sigma_f(\SG)=c_{\SG}\sum_{v\in V_*}\big(f^\vee(v)-f^\wedge(v)\big)=\int_\R c_{\SG}\,\#\partial^*E_t\,dt=\int_\R\Per(E_t)\,dt\,. \end{equation*} If $f\in L^1(\SG,m)\setminus BV(\SG)$, then $\Var(f)=\infty$, and $\int_\R\Per(E_t)\,dt=\infty$ by the second inequality of Proposition~\ref{prop:coarea}. This proves the coarea identity. If $f\in BV(\SG)$ is continuous, then $f^\wedge(v)=f^\vee(v)=f(v)$ for every~$v$, hence $\Var(f)=0$, and $f$ is constant by Theorem~\ref{th:metric}. The lower semicontinuity is Corollary~\ref{gask-lsc} below. \end{proof} \begin{corollary}[Localization of the jump measure]\label{cor:gasketlocalization} For $f\in BV(\SG)$ and every open set $U\subset\SG$, \begin{equation*} c_{\SG}\,\sigma_f(U) =\sup\{\Var(f;V): V\text{ open},\ \overline V\subset U\}. \end{equation*} In particular $\Var(f;V)=c_{\SG}\,\sigma_f(V)$ for every open $V$ such that $\sigma_f(\partial V)=0$. \end{corollary} \begin{proof} We first show that for every open $V$, \begin{equation*} c_{\SG}\,\sigma_f(V)\le\Var(f;V)\le c_{\SG}\,\sigma_f(\overline V). \end{equation*} Let $0\le\varphi\le1$ be continuous with compact support in $V$. At all sufficiently small radii $B(x,r)\subset V$ for every $x\in\operatorname{supp}\varphi$, hence $\int\varphi\,dm_{r,f}\le r^{-Q}J_r(f;V)$. Theorem~\ref{gask-exact} gives $c_{\SG}\int\varphi\,d\sigma_f\le\Var(f;V)$ on taking the lower limit. Taking the supremum over $\varphi$ gives the first inequality. Choose $r_j\downarrow0$ with $a(r_j)\to c_{\SG}$. By Theorem~\ref{gask-exact}, $m_{r_j,f}\rightharpoonup c_{\SG}\sigma_f$. Since $r_j^{-Q}J_{r_j}(f;V)\le m_{r_j,f}(\overline V)$, the closed-set inequality for weak convergence gives the second bound. Finally, $\sigma_f(U)=\sup_{\overline V\subset U}\sigma_f(V)$ by inner regularity, with $V$ open. The two bounds give the formula for $U$ and the equality for every $V$ with $\sigma_f(\partial V)=0$. \end{proof} \paragraph{Normalization at one junction.} For the unbounded nested fractals treated in~\cite[Theorem~3.1]{Osc} there is a positive bounded periodic function $\Phi$, bounded away from zero, such that for every finite union $U$ of cells of a fixed level \begin{equation*} \lim_{t\downarrow0}\Phi(-\log t)\,t^{-d_h/d_w}H_t(\ind_U) =\#\partial U . \end{equation*} Here $\partial U$ is the boundary in the unbounded fractal. Nonconstancy of the heat profile is posed in~\cite[Conjecture~1.2]{Osc}. On the compact gasket Theorem~\ref{gask-exact} gives an all-radii limit for the ball energy measures after division by the contribution of one junction. The first-level cell $U_0$ has two junctions, so its heat oscillation also gives a normalization to test. Does \begin{equation*} \frac{2}{H_t(\ind_{U_0})} \left(\int_{\SG}p_t(x,y)|f(x)-f(y)|\,dm(y)\right)dm(x) \ \rightharpoonup\ \sum_{v\in V_*}\bigl(f^\vee(v)-f^\wedge(v)\bigr)\delta_v \qquad(t\downarrow0) \end{equation*} hold for every $f\in BV(\SG)$? \section{Lower semicontinuity, relaxation and the isoperimetric profile}\label{sec:gasket-cor} In general the variation is lower semicontinuous only up to a constant (Corollary~\ref{cor:wm}). On the gasket the exact formulas give more. \begin{corollary}\label{gask-lsc} The functional $\Var$ is lower semicontinuous in $L^1(\SG,m)$. \end{corollary} \begin{proof} \emph{Sets.} Let $E_j$ and $E$ be measurable sets with $\ind_{E_j}\to\ind_E$ in $L^1(\SG,m)$, and let $z_1,\dots,z_k$ be distinct points of~$\partial^*E$. Let $L$ be the constant of Lemma~\ref{lem:strongpoint}, and choose balls $B_i$ centred at~$z_i$ such that the balls $LB_i$ are pairwise disjoint. Since $z_i\in\partial^*E$, we have $v_{B_i}(E)>0$, hence $v_{B_i}(E_j)>0$ for all large~$j$. By Lemma~\ref{lem:strongpoint}, each ball $LB_i$ then contains a point of $\Sigma_\gamma(E_j)\subset\partial^*E_j$. Thus $\#\partial^*E_j\ge k$ for all large~$j$, and \begin{equation*} \#\partial^*E\le\liminf_{j\to\infty}\#\partial^*E_j\,,\qquad\text{that is,}\qquad\Per(E)\le\liminf_{j\to\infty}\Per(E_j) \end{equation*} by Theorem~\ref{th:gasket}. \emph{Functions.} Let $f_j\to f$ in $L^1(\SG,m)$. Passing to a subsequence, we may assume that $\Var(f_j)$ converges to its lower limit. Since $\int_\R\|\ind_{\{f_j>t\}}-\ind_{\{f>t\}}\|_1\,dt=\|f_j-f\|_1\to0$, a further subsequence satisfies $\ind_{\{f_j>t\}}\to\ind_{\{f>t\}}$ in $L^1(\SG,m)$ for almost every~$t$. By the coarea identity of Theorem~\ref{th:gasket}, the first part and Fatou's lemma, \begin{equation*} \Var(f)=\int_\R\Per(\{f>t\})\,dt\le\int_\R\liminf_{j\to\infty}\Per(\{f_j>t\})\,dt\le\liminf_{j\to\infty}\Var(f_j)\,.\qedhere \end{equation*} \end{proof} \begin{corollary}[Relaxation off two junctions]\label{cor:gasketrelaxation} Let $E$ be a first-level cell, let $S$ consist of its two boundary junctions, and set $U_1=E\setminus S$ and $U_2=\SG\setminus E$. These sets are disjoint and open. For the relaxed variation of Section~\ref{sec:measures-remarks}, \begin{equation*} \mathsf V(\ind_E;U_1)=\mathsf V(\ind_E;U_2)=0,\qquad \mathsf V(\ind_E;U_1\cup U_2)=2c_{\SG}. \end{equation*} \end{corollary} \begin{proof} The indicator is constant on each of $U_1$ and $U_2$. Their union is $U=\SG\setminus S$. Since $m(S)=0$, $J_r(g;U)=J_r(g;\SG)$ for every $g$ and every $r$. Consider a sequence $g_j\to\ind_E$ in $L^1_{\mathrm{loc}}(U)$. Truncating $g_j$ to $[0,1]$ preserves this convergence and decreases every $J_r$. The truncated sequence converges in $L^1(\SG)$, since the complement of any open neighborhood of $S$ is compact in $U$, and those neighborhoods can have arbitrarily small measure. By Corollary~\ref{gask-lsc}, \begin{equation*} \liminf_{j\to\infty}\Var(g_j;U)\ge\Per(E)=2c_{\SG}. \end{equation*} The constant sequence $g_j=\ind_E$ attains this value. \end{proof} By Proposition~\ref{prop:gasketsets}, the perimeter of a union of cells of side~$2^{-n}$ is $c_{\SG}$ times the number of the pairs of adjacent cells of which exactly one is contained in the set. The isoperimetric problem on the gasket is therefore an edge-isoperimetric problem on the graphs of cells, which was solved by Harper. \begin{corollary}\label{gask-profile} At volume $k3^{-n}$, with $n\ge1$ and $0\le k\le3^n$, the union of the first $k$ level-$n$ cells in lexicographic order minimizes the perimeter. The minimum equals $c_{\SG}$ times the number of edges leaving this initial segment in the cell adjacency graph $S(n,3)$. At every nontriadic volume in $(0,1)$ the infimum is infinite. \end{corollary} \begin{proof} Each crossing edge contributes one boundary junction. At level one the adjacency graph is the complete graph on three vertices. At level $n\ge2$ it consists of three copies of $S(n-1,3)$, joined by the edges $ij^{n-1}\leftrightarrow ji^{n-1}$, $i\ne j$. By \cite[Theorem~8]{Harper}, a lexicographic initial segment minimizes the edge boundary at fixed cardinality. Refining all cells to any deeper common level preserves both the union and the initial-segment property, so the comparison applies to every finite-perimeter competitor. The classification excludes other volumes. Harper also gives the corresponding continuum profile for counting the topological boundary in \cite[Section~6.5]{Harper}. \end{proof} \chapter{Spaces without a common exponent}\label{sec:nocommon} \begin{overview} In all the preceding examples the two hypotheses hold with the same exponent. We now study a family of self-similar spaces in which the smallest exponent of~\hP{} is strictly larger than the largest exponent of~\hC. In these spaces the two critical Besov exponents coincide with the smallest exponent of~\hP, whereas the topological Hausdorff dimension is determined by the largest exponent of~\hC. This shows that the existence of a common exponent is a restriction on the space, and it explains what each of the two hypotheses detects. \end{overview} \section{The spaces and the result} Let $n\ge2$. Divide $[0,1]^n$ into cubes of side $1/5$, indexed by $\{0,\ldots,4\}^n$. Keep every cube except those with index $c\pm e_i$, where $c=(2,\ldots,2)$ and $1\le i\le n$. Repeat the construction in every retained cube, and denote the resulting compact set by $X_n$. Cao and Chen~\cite{CC} introduced $X_2$ and $X_3$ and proved that they satisfy $p$-conductive homogeneity for $p=2$ and fail to satisfy it for $p>1$ sufficiently close to $1$. Figure~\ref{fig:cc} shows the construction of $X_2$. We use the maximum distance and the uniform self-similar probability measure $m$. Put \begin{equation*} N=5^n-2n,\quad Q=\log_5 N,\quad s=n-2,\quad \lambda=Q-s,\quad L=5^{n-1}-2n+1,\quad t=\log_5 L. \end{equation*} A level-$j$ cell is the intersection of $X_n$ with a retained cube of side $h=5^{-j}$. Its measure is $h^Q$. The measure is Ahlfors $Q$-regular. Indeed, a ball of radius comparable to $h$ meets a bounded number of grid cubes and contains a cell of comparable side. As in Lemma~\ref{lem:volume}, $m$ is the normalized $Q$-dimensional Hausdorff measure. Distinct cells of the same generation overlap in null sets because a prescribed coordinate digit has probability at most $5^{n-1}/N<1$ and the digit vectors are independent across generations. \begin{figure}[t] \centering \begin{tikzpicture}[x=8mm,y=8mm] \foreach \a in {0,...,4}{\foreach \b in {0,...,4}{% \pgfmathtruncatemacro{\rem}{((\a==2)&&((\b==1)||(\b==3)))||((\b==2)&&((\a==1)||(\a==3)))}% \ifnum\rem=0 \pgfmathtruncatemacro{\cen}{(\a==2)&&(\b==2)}% \pgfmathtruncatemacro{\row}{(\b==0)||(\b==4)}% \ifnum\cen=1 \fill[navy,draw=white,line width=.6pt] (\a,\b) rectangle ++(1,1); \else\ifnum\row=1 \fill[rowblue,draw=white,line width=.6pt] (\a,\b) rectangle ++(1,1); \else \fill[cellgray,draw=white,line width=.6pt] (\a,\b) rectangle ++(1,1);\fi\fi \fi}} \node at (2.5,-.7) {\small (a)}; \end{tikzpicture} \hspace{14mm} \begin{tikzpicture}[x=1.6mm,y=1.6mm] \foreach \a in {0,...,24}{\foreach \b in {0,...,24}{% \pgfmathtruncatemacro{\rem}{((mod(\a,5)==2)&&((mod(\b,5)==1)||(mod(\b,5)==3)))||((mod(\b,5)==2)&&((mod(\a,5)==1)||(mod(\a,5)==3)))||((div(\a,5)==2)&&((div(\b,5)==1)||(div(\b,5)==3)))||((div(\b,5)==2)&&((div(\a,5)==1)||(div(\a,5)==3)))}% \ifnum\rem=0 \pgfmathtruncatemacro{\cen}{(div(\a,5)==2)&&(div(\b,5)==2)}% \pgfmathtruncatemacro{\row}{((mod(\b,5)==0)||(mod(\b,5)==4))&&((div(\b,5)==0)||(div(\b,5)==4))}% \ifnum\cen=1 \fill[navy,draw=white,line width=.2pt] (\a,\b) rectangle ++(1,1); \else\ifnum\row=1 \fill[rowblue,draw=white,line width=.2pt] (\a,\b) rectangle ++(1,1); \else \fill[cellgray,draw=white,line width=.2pt] (\a,\b) rectangle ++(1,1);\fi\fi \fi}} \node at (12.5,-3.5) {\small (b)}; \end{tikzpicture} \caption{The set $X_2$ after one step (a) and two steps (b) of its construction. The central cell $W$ of side $\frac15$, in dark blue, meets the other cells of side $\frac15$ only at its four corners, which gives the lower bound for the exponents of~\hP. The rows in blue, $2^j$ of them after $j$ steps, contain no removed square, which gives the upper bound for the exponents of~\hC.}\label{fig:cc} \end{figure} \begin{proposition}\label{prop:nocommon} For every integer $n\ge2$ the following assertions hold on $X_n$. \begin{enumerate}[label=\textup{(\roman*)}] \item\label{it:noP} Hypothesis~\hP{} holds at $\beta>0$ if and only if $\beta\ge\lambda$. Moreover, \begin{equation*} \lambda_1^*(X_n)=\lambda_1^\#(X_n)=Q-(n-2), \qquad \Bes\lambda(X_n)\text{ is dense in }L^1(X_n,m). \end{equation*} \item\label{it:noC} Hypothesis~\hC{} holds at $\beta>0$ if and only if $\beta\le Q-t$. At $\beta=Q-t$, hypothesis~\hCp{} holds with open sets. \item The topological Hausdorff dimension is \begin{equation*} d_{tH}(X_n)=1+t>Q-\lambda_1^*(X_n)+1=n-1. \end{equation*} \end{enumerate} In particular $Q-d_{tH}(X_n)+1$ is the largest exponent for~\hC{} and is strictly smaller than the critical Besov exponent. \end{proposition} \paragraph{The two mechanisms.} The central cell of each cube is attached to the other cells only along faces of dimension $n-2$, because its $2n$ neighbours across the facets have been removed. A set which is bounded by such faces has a boundary of dimension $s=n-2$, and its indicator has an energy of order $r^{Q-s}$. This is the smallest possible energy, and it gives the critical Besov exponent $\lambda=Q-s$. But the central cells are small islands: they do not surround a given ball, and they cannot be used as the sets of~\hC. A set which contains a ball and is contained in a larger ball must cut all the complete rows of fine cells which leave the ball. There are $L^j$ such rows at the generation~$j$, with $L>5^{s}$, and this forces an energy of order at least $r^{Q-t}$ with $t=\log_5L>s$. In the terms of Section~\ref{sec:onescale}, at the exponent~$\lambda$ the space $X_n$ satisfies~\hIl, because it satisfies~\hP, and it does not satisfy~\hIIl: otherwise Theorem~\ref{th:onescale} would give~\hC{} for the exponent $\lambda>Q-t$. On these spaces hypothesis~\hP{} is therefore not accessible through the conditions at small scales, and we obtain it from a Poincar\'e inequality on the graphs of cells. The proof of Proposition~\ref{prop:nocommon} occupies the rest of the chapter. It is divided into six lemmas, and the proposition is deduced from them in Section~\ref{sec:nocommon-proof}. Throughout, a \emph{cell} of side $h=5^{-j}$ is the intersection of~$X_n$ with a retained cube of side~$h$, and two cells of the same side, or the corresponding cubes, are \emph{adjacent} if the intersection of the two cubes contains a face of dimension $n-2$ of both; in particular two cubes with a common facet are adjacent. The constants denoted by $C_n$ depend only on~$n$. We write $[P]$ for the set of the cells of side~$h$ contained in a retained cube~$P$ of side $5^jh$, and $T_{\mathcal D}(v)$ for the sum of $|v(U)-v(V)|$ over the pairs of adjacent elements of~$\mathcal D$, as in Definition~\ref{def:graph}. \section{The Poincar\'e inequality} \begin{lemma}[Graph inequality]\label{lem:cc-graph} There is a constant $C_n$ such that, for every side $h=5^{-i}$, every integer $j\ge0$ with $5^jh\le1$, every $\mathcal D$ of the form $[P]$ or $[P]\cup[P']$ with adjacent retained cubes $P,P'$ of side $5^jh$, and every $v\colon\mathcal D\to\R$, \begin{equation*} \sum_{U\in\mathcal D}|v(U)-v_{\mathcal D}|\le C_n\,5^{j\lambda}\,T_{\mathcal D}(v)\,. \end{equation*} \end{lemma} \idea On the carpet we compared the means of~$v$ over the cells of the complete rows. Here the reference value of a cube~$P$ is the mean $T(P)$ of~$v$ over the cells along one of its facets; all these cells are retained. Two adjacent cubes may share only a face of dimension $n-2$, along which $5^{js}$ pairs of adjacent cells are available. Comparing two means through these pairs gives the factor $5^{-js}$, and $N^j\cdot5^{-js}=5^{j\lambda}$. \begin{proof} For a retained cube~$P$ of side $5^jh$, let $T(P)$ be the mean of~$v$ over the $5^{j(n-1)}$ cubes of side~$h$ along the lower facet of~$P$ perpendicular to the first coordinate direction. \emph{Step 1: facets and faces of dimension $n-2$.} Every cube of side~$h$ along a facet of~$P$ is retained: one coordinate of its address relative to~$P$ has only the digit~$0$, or only the digit~$4$, whereas the addresses of the removed cubes have all their digits in $\{1,2,3\}$. Let $\Phi$ be a facet of~$P$ and $\Psi$ one of its faces of dimension $n-2$, and let $\bar v_\Phi$ and $\bar v_\Psi$ be the means of~$v$ over the cubes of side~$h$ along~$\Phi$ and along~$\Psi$. The cubes along~$\Phi$ form $5^{js}$ columns of $5^j$ cubes, perpendicular to~$\Psi$, and each column has one end along~$\Psi$. In a column, the difference between the mean of~$v$ and its value at this end is at most the sum of the absolute differences of~$v$ between consecutive cubes. Averaging over the columns, which have no pair in common, we get \begin{equation*} |\bar v_\Phi-\bar v_\Psi|\le5^{-js}\,T_{[P]}(v)\,. \end{equation*} Two facets with a common face of dimension $n-2$ are thus compared, and any two facets of a cube are joined by a chain of at most three facets of this kind. Hence \begin{equation}\label{eq:cc-faces} |\bar v_\Phi-T(P)|\le C_n\,5^{-js}\,T_{[P]}(v)\,,\qquad|\bar v_\Psi-T(P)|\le C_n\,5^{-js}\,T_{[P]}(v) \end{equation} for every facet~$\Phi$ and every face~$\Psi$ of dimension $n-2$ of~$P$. For $n=2$ a face of dimension~$0$ is a corner, and $\bar v_\Psi$ is the value of~$v$ at the corner cube. \emph{Step 2: adjacent cubes.} Let $P$ and $P'$ be adjacent retained cubes of side $5^jh$, and let $\Psi$ be a common face of dimension $n-2$, contained in their common facet if they have one. The $5^{js}$ cubes of side~$h$ of~$P$ along~$\Psi$ are matched with those of~$P'$ in such a way that two matched cubes meet along a face of dimension $n-2$ or along a facet; these are $5^{js}$ distinct pairs of adjacent cells. Hence the means of~$v$ along~$\Psi$ in $P$ and in~$P'$ differ by at most $5^{-js}\,T_{[P]\cup[P']}(v)$, and by~\eqref{eq:cc-faces} \begin{equation}\label{eq:cao-anchor} |T(P)-T(P')|\le C_n\,5^{-js}\,T_{[P]\cup[P']}(v)\,. \end{equation} \emph{Step 3: consecutive scales.} The graph of the $N$ children of a retained cube is connected. Indeed, the children whose index has a coordinate equal to $0$ or~$4$ are all retained and form a connected family. A retained child with index in $\{1,2,3\}^n$ other than $c$ has at least two coordinates different from~$2$, since the indices $c\pm e_i$ are removed, and changing one of them from~$1$ to~$0$, or from~$3$ to~$4$, leads to an adjacent child of the first kind. Finally the central child, of index~$c$, is adjacent to the child of index $c-e_1-e_2$. Moreover $T(P)$ is the mean of the numbers $T(A)$ over the children~$A$ of~$P$ along its lower first facet. Hence, if $P$ has side $5^{k+1}h$ and $A$ is any child of~$P$, joining $A$ to these children by chains of adjacent children and applying~\eqref{eq:cao-anchor} to the cubes of side~$5^kh$, we get \begin{equation*} |T(A)-T(P)|\le C_n\,5^{-ks}\,T_{[P]}(v)\,. \end{equation*} \emph{Step 4: telescoping.} Let $P_0$ be a retained cube of side $5^jh$. For a cell~$U$ of side~$h$ we have $T(U)=v(U)$. As in Step~1 of the proof of Theorem~\ref{th:graph}, we write $v(U)-T(P_0)$ as the sum of the differences $T(A)-T(P)$ along the ancestors of~$U$. A cube of side $5^kh$ contains $N^k$ cells of side~$h$, each cube has $N$ children, and the sets $[P]$ of distinct cubes~$P$ of the same side are disjoint. Since $N\,5^{-s}=5^{\lambda}>1$, \begin{equation*} \sum_{U\in[P_0]}|v(U)-T(P_0)| \le C_n\sum_{k=0}^{j-1}N^{k+1}\,5^{-ks}\,T_{[P_0]}(v) \le C_n\,5^{j\lambda}\,T_{[P_0]}(v)\,. \end{equation*} For two adjacent cubes $P_0$ and $P_0'$ we apply this inequality in each of them and add the term $N^j\,|T(P_0)-T(P_0')|\le C_n\,5^{j\lambda}\,T_{[P_0]\cup[P_0']}(v)$ given by~\eqref{eq:cao-anchor}. Finally, by~\eqref{eq:mean}, replacing the reference value $T(P_0)$ by the mean $v_{\mathcal D}$ costs at most a factor~$2$. \end{proof} \begin{lemma}[Cell structure]\label{lem:cc-cells} With the adjacency relation defined above, the cells of~$X_n$ form a cell structure in the sense of Definition~\ref{def:cells}, with $b_0=5$, $N=5^n-2n$, $a_{\max}=1$, $C_0=1$, $c_1=\frac13$ and $K_0=2^n$. Consequently $X_n$ satisfies~\hP{} with the exponent $\lambda=Q-s$. \end{lemma} \begin{proof} Properties~\ref{K1} to~\ref{K3} follow from the construction and from the properties of~$m$ recalled above. For~\ref{K4}, note that $X_n$ contains the boundary of $[0,1]^n$, because a point of this boundary has a coordinate all of whose digits are equal to~$0$ or all equal to~$4$; hence every cell contains the boundary of its cube, and two adjacent cells intersect. It remains to prove~\ref{K5}. Let $a=5^{-p}$ and $x\in X_n$. In each coordinate the interval $(x_i-\frac a3,x_i+\frac a3)$ meets at most two consecutive intervals of the grid of side~$a$. Hence there is a vertex~$z$ of this grid such that every cube of side~$a$ which meets $B(x,\frac a3)$ contains~$z$. There are at most $2^n$ cubes of side~$a$ which contain~$z$, and it suffices to show that the retained ones form a connected family. Write $z=a\,(t_1,\dots,t_n)$ with integers~$t_i$. The cubes of side~$a$ which contain~$z$ have the indices $k$ with $k_i\in\{t_i-1,t_i\}$. If $t_i\in\{0,5^p\}$ for some~$i$, the coordinate~$k_i$ has only the digit~$0$, or only the digit~$4$, and all these cubes are retained. Otherwise, for each~$i$ let $p_i$ be the lowest place at which $t_i$ has a non-zero digit, and let $p^*=\max_ip_i$. The digits of $t_i$ and $t_i-1$ agree above the place~$p_i$; at the place~$p_i$ they are two consecutive digits; and below it those of~$t_i$ are equal to~$0$ and those of $t_i-1$ to~$4$. We examine the vectors of the digits of~$k$ at each place. \begin{itemize} \item \emph{Above the place $p^*$} the vector of digits does not depend on the choice of~$k$. \item \emph{Below the place $p^*$} a coordinate~$i$ with $p_i=p^*$ has the digit $0$ or~$4$, so that the vector of digits is never of the form $c\pm e_l$. \item \emph{At the place $p^*$} the vectors of digits form a product~$\Pi$ of pairs of consecutive digits, for the coordinates with $p_i=p^*$, and of single digits, for the others. \end{itemize} All the cubes which contain~$z$ are contained in the same cube of side $5^{p^*+1}a$, which is retained because $z\in X_n$. Thus a cube which contains~$z$ is retained if and only if its vector of digits at the place~$p^*$ is not of the form $c\pm e_l$. The coordinates with $p_i0$. Consequently: \begin{enumerate}[label=\textup{(\roman*)}] \item hypothesis~\hP{} fails on~$X_n$ for every exponent $\beta<\lambda$; \item $\Bes\lambda(X_n)$ is dense in $L^1(X_n,m)$, and $\lambda_1^*(X_n)=\lambda_1^\#(X_n)=\lambda$. \end{enumerate} \end{lemma} \begin{proof} \emph{The energy of~$\ind_A$.} The cube of~$A$ lies at distance~$2a$ from the boundary of the cube of its parent. The other retained children of the parent which meet the cube of~$A$ have an index $c+\varepsilon$ with $\varepsilon\in\{-1,0,1\}^n$ and at least two non-zero coordinates, and they meet the cube of~$A$ along a face~$\Phi$ of dimension at most $s=n-2$. If $y\in A$ and $z$ belongs to such a child, with $d(y,z)\lambda$ they contain only constants, by Corollary~\ref{cor:wm}\ref{it:rigidity} for the exponent~$\lambda$, which satisfies~\hP{} by Lemma~\ref{lem:cc-cells}. \end{proof} \section{The exponents of hypothesis~\hC} We now turn to hypothesis~\hC. The upper bound for its exponents comes from a count of complete rows, as in~\cite[Lemmas~2.1 and~2.3]{CC}. \begin{lemma}[Complete rows]\label{lem:cc-rows} If~\hC{} holds on~$X_n$ for an exponent~$\beta$, then $\beta\le Q-t$. Moreover $L\ge2\cdot5^{n-2}$, so that $t>s$ and $Q-t<\lambda$. \end{lemma} \begin{proof} Let $c'=(2,\dots,2)\in\{0,\dots,4\}^{n-1}$. A vector $y'\in\{0,\dots,4\}^{n-1}$ of digits of the last $n-1$ coordinates allows all the five values of the first digit if and only if it is different from~$c'$ and from the vectors $c'\pm e_i$, $1\le i\le n-1$. There are $L=5^{n-1}-2n+1$ such vectors, and every vector with a coordinate equal to $0$ or~$4$ is one of them, so that $L\ge5^{n-1}-3^{n-1}\ge2\cdot5^{n-2}$. A word of~$j$ such vectors determines a \emph{complete row}: the $5^j$ cubes of side $h=5^{-j}$ whose last $n-1$ coordinates have this word as address are all retained. Suppose that~\hC{} holds for the exponent~$\beta$, with the dilation~$M$. Choose $R>0$ with $MR<\frac12$, let $G$ be a set given by~\hC{} for the ball $B(0,R)$, and choose an integer~$i$ with $5^{-i}i$ and $h=5^{-j}$, and consider the $L^{j-i}$ complete rows whose words begin with $i$ vectors equal to zero. The first cell of such a row is contained in $B(0,R)$, and the last one does not meet $B(0,MR)$. Hence the mean of $\ind_G$ is~$1$ on the first cell and~$0$ on the last one, and the sum of the absolute differences of the means of $\ind_G$ over the consecutive cells of the row is at least~$1$. For two consecutive cells $U,V$ of a row, \begin{equation*} \big|(\ind_G)_U-(\ind_G)_V\big|\le h^{-2Q}\iint_{U\times V}|\ind_G(x)-\ind_G(y)|\,dm(x)\,dm(y)\,, \end{equation*} and $d(x,y)\le2h$ on $U\times V$. The products $U\times V$ of the different pairs overlap in null sets. Summing over the rows and using~\eqref{eq:JA} and~\eqref{eq:C}, we obtain \begin{equation*} L^{j-i}\le C\,h^{-2Q}\,(3h)^Q\,J_{3h}(\ind_G)\le C_R\,h^{\beta-Q}=C_R\,5^{j(Q-\beta)}\,, \end{equation*} with a constant $C_R$ which does not depend on~$j$. Letting $j\to\infty$ we get $L\le5^{Q-\beta}$, that is, $\beta\le Q-t$. \end{proof} \begin{lemma}[Lower bound for the topological Hausdorff dimension]\label{lem:cc-lower} $d_{tH}(X_n)\ge1+t$. \end{lemma} \begin{proof} Let $\mathsf T\subset[0,1]^{n-1}$ be the self-similar set of the points all of whose digit vectors belong to the set of the $L$ vectors of the preceding proof. Its defining similitudes satisfy the open set condition, so that $\dim_H\mathsf T=\log_5L=t$~\cite{Hut}, and $[0,1]\times\mathsf T\subset X_n$ because the rows are complete. Let $\mathcal U$ be a basis of open sets of~$X_n$. The compact set $\{0\}\times\mathsf T$ is covered by finitely many elements of~$\mathcal U$ whose closures do not meet $\{1\}\times\mathsf T$; let $O$ be their union. For every $y\in\mathsf T$ the segment $[0,1]\times\{y\}$ is connected, starts in~$O$ and ends outside the closure of~$O$; hence it meets $\partial O$. Therefore the projection of $\partial O$ onto the last $n-1$ coordinates contains~$\mathsf T$, and $\dim_H\partial O\ge t$ because this projection is Lipschitz. Since $\partial O$ is contained in the union of the boundaries of the finitely many chosen elements of~$\mathcal U$, one of them has a boundary of Hausdorff dimension at least~$t$. As $\mathcal U$ was arbitrary, $d_{tH}(X_n)\ge1+t$. \end{proof} \section{Construction of the cutoff sets} It remains to construct sets with the properties of~\hCp{} for the exponent $Q-t$. A half-space $\{y_it$. We therefore modify the half-space by adding to it, at every generation, the central children which the hyperplane cuts. What remains of the boundary lies in the $L^j$ cubes of each generation~$j$ which the hyperplane cuts and which are not central children, and in the boundaries of the added cells, which have dimension~$ss=n-2$ by Lemma~\ref{lem:cc-rows}, we have $1+t>n-1=Q-\lambda_1^*(X_n)+1$. Finally $Q-d_{tH}(X_n)+1=Q-t$ is the largest exponent of~\hC, and it is strictly smaller than the critical Besov exponent~$\lambda$. \qed \appendix \chapter{Index of notation}\label{sec:notation} The numbers refer to the chapters or sections in which the notation is introduced. \begin{center} \renewcommand{\arraystretch}{1.22} \begin{longtable}{@{}p{42mm}p{82mm}l@{}} \toprule Notation & Meaning & Where\\ \midrule \endhead \bottomrule \endfoot \multicolumn{3}{@{}l}{\emph{The space}}\\ $B(x,r)$, $tB$, $D$ & open ball, ball with the same centre and radius $tR$, diameter of~$X$ & \ref{sec:hyp}, \ref{sec:twohyp}\\ $C_d$, $Q_d$ & doubling constant, $Q_d=\log_2C_d$ & \ref{sec:hyp}, \ref{sec:doubling}\\ $Q$, $c_Q$ & constants of the lower bound~\eqref{eq:decay} for the measure of balls & \ref{sec:hyp}\\ $c_A$, $C_A$ & constants of Ahlfors regularity~\eqref{eq:ahlfors} & \ref{sec:hyp}\\ $\kappa(t)$, $V_z$ & overlap constant of nets, cells of a Voronoi partition & \ref{sec:doubling}\\ $B(A,t)$ & open $t$-neighbourhood of a set~$A$ & \ref{sec:conventions}\\[3pt] \multicolumn{3}{@{}l}{\emph{Energies and hypotheses}}\\ $k_r(x,y)$, $J_r(f;W)$, $J_r(f)$ & kernel and energy at scale~$r$ & \ref{sec:energies}\\ $P_t$, $H_t(f)$, $Q_E(t)$ & heat semigroup, heat oscillation of $f$, heat outside $E$ for initial temperature $\ind_E$ & \ref{sec:heat-BV}\\ $d_w$, $\alpha$, $\kappa$ & walk dimension, critical heat exponent $\lambda/d_w$ and spatial exponent in the weak Bakry--\'Emery estimate & \ref{sec:heat-BV}\\ $\mu_r$, $\Pair_r(E;W)$ & measure with density $k_r$ on $X\times X$, pairs of points of~$W$ at distance less than~$r$ separated by~$E$ & \ref{sec:energies}\\ $\lambda$, $q$ & the exponent, $q=Q/(Q-\lambda)$ & \ref{sec:twohyp}\\ \hP, $C_P$, $\Lambda$ & Poincar\'e inequality and its constants & \ref{sec:twohyp}\\ \hC, $C_C$, $M$ & sets of small perimeter and their constants & \ref{sec:twohyp}\\ \hCp & \hC{} with a bound for $\Hcod\lambda(\partial G)$ & \ref{sec:approx}\\ \hI, \hII & relative isoperimetric inequality and cutoff sets, for the upper perimeter & \ref{sec:onescale}\\ \hIl, \hIIl & the same two conditions for the perimeter & \ref{sec:onescale}\\ \hPI & $(1,1)$-Poincar\'e inequality for Lipschitz functions & \ref{sec:classical}\\ $f_W$, $v_W(E)$ & mean of~$f$ on~$W$, $\min\{m(W\cap E),m(W\setminus E)\}$ & \ref{sec:twohyp}, \ref{sec:defs}\\[3pt] \multicolumn{3}{@{}l}{\emph{Variation}}\\ $S_\beta(f)$, $\Bes\beta(X)$ & supremum of $r^{-\beta}J_r(f)$ over the scales, Besov class & \ref{sec:defs}\\ \raggedright $\Var(f;W)$, $\Per(E;W)$, $BV(X)$ & variation, perimeter, functions of bounded variation & \ref{sec:defs}\\ $\mathsf V(f;U)$ & relaxed variation for $L^1_{\mathrm{loc}}(U)$ convergence & \ref{sec:measures-remarks}\\ $\Per^+(E;W)$ & upper perimeter, the upper limit of $r^{-\lambda}J_r(\ind_E;W)$ & \ref{sec:onescale}\\ $\Var^+(f;W)$ & upper limit of $r^{-\lambda}J_r(f;W)$ & \ref{sec:caratheodory}\\ $\lambda_1^*$, $\lambda_1^\#$ & critical exponents & \ref{sec:defs}\\ $\|g\|_{L^{q,1}(W)}$ & Lorentz norm & \ref{sec:bv}\\[3pt] \multicolumn{3}{@{}l}{\emph{Boundaries}}\\ $\xi_\beta(B)$, $\Hcod\beta_\delta$, $\Hcod\beta$ & cost of a ball, content and Hausdorff measure of codimension~$\beta$ & \ref{sec:hausdorff}\\ $\Hc^t_\delta$, $\Hc^t$, $\Hc^t_\infty$ & spherical Hausdorff content and measure of dimension~$t$ & \ref{sec:ahlfors-hyp}\\ $\theta_E(x,r)$, $\vartheta_E(x,r)$ & proportion of $B(x,r)$ in~$E$, proportion of the smaller part & \ref{sec:federer-intro}\\ $\partial E$, $\partial^*E$ & topological and measure-theoretic boundary & \ref{sec:federer-intro}\\ $D_\eta(E)$, $\Sigma_\eta(E)$ & points with $\limsup_r\vartheta_E\ge\eta$, with $\liminf_r\vartheta_E\ge\eta$ & \ref{sec:federer-intro}\\ $M_r^\eta(E)$ & points with $\vartheta_E(x,r)\ge\eta$ & \ref{sec:mixed}\\ $D^{(0)}$ & points at which $D$ has density zero & \ref{sec:relaxed}\\ $d_{tH}$, $\codim_{tH}$ & topological Hausdorff dimension and codimension & \ref{sec:top-intro}\\[3pt] \multicolumn{3}{@{}l}{\emph{Measures}}\\ $m_{r,f}$ & energy measure at scale~$r$ & \ref{sec:clusters}\\ $\mu_f^-$, $\mu_f^+$ & Carath\'eodory measures of the lower and upper local energies & \ref{sec:caratheodory}\\ $\nu_f$ & coarea measure & \ref{sec:coareameasure}\\ $\overline\nu_E$, $\overline\nu_f$ & relaxed coarea measure of a set, of a function & \ref{sec:relaxed}\\ $f^\wedge$, $f^\vee$, $J_f$ & approximate lower and upper limits, jump set & \ref{prop:coareajump}\\ $\Lip u$, $\|Df\|$ & slope, total variation of Miranda & \ref{sec:classical}\\[3pt] \multicolumn{3}{@{}l}{\emph{Examples}}\\ $s$ & $s=Q-\lambda$, the dimension of boundaries & \ref{sec:ahlfors}\\ $\Qc_a$, $[P]$, $\ch(P)$ & cells of side~$a$, cells of side~$h$ in~$P$, children of~$P$ & \ref{sec:cells-def}, \ref{sec:cells-strong}\\ $T_{\mathcal D}(v)$, $v_{\mathcal D}$ & sum of $|v(U)-v(V)|$ over adjacent cells, mean of~$v$ & \ref{sec:cells-def}\\ $b_U$, $T_{\Qc_h}(b)$ & cell medians and the sum of their differences across edges & \ref{sec:cells-edges}\\ $N_h(E)$ & number of edges between the cells mostly in~$E$ and the others & \ref{sec:cells-edges}\\ $F$, $F_\infty$, $F_{b,a}$ & Sierpi\'nski carpets & \ref{sec:carpet-squares}, \ref{sec:centralcarpets}\\ $T$, $w(t)$ & triadic column midpoints and their jump weights & \ref{sec:coordinateprofiles}\\ $\K$, $\Cc_j$, $s_P(v)$ & Cantor set, discrete Cantor set, mean over $\Cc_j\times\Cc_j$ & \ref{sec:carpet-squares}, \ref{sec:graph}\\ $\MS$, $\SG$, $X_n$ & Menger sponge, Sierpi\'nski gasket, spaces of Chapter~\ref{sec:nocommon} & \ref{sec:sponge}, \ref{sec:gasket}, \ref{sec:nocommon}\\ $V_*$, $c_{\SG}$, $\sigma_f$ & corners of the gasket cells, perimeter constant, atomic jump measure & \ref{sec:gasket-main}, \ref{gask-section}\\ \end{longtable} \end{center} \backmatter \begin{thebibliography}{99} \bibitem{ABI} P.~Alonso Ruiz, F.~Baudoin, L.~Chen, L.~G. Rogers, N.~Shanmugalingam and A.~Teplyaev, Besov class via heat semigroup on Dirichlet spaces I: Sobolev type inequalities, \emph{J. Funct. Anal.} \textbf{278} (2020), no.~11, Paper No.~108459. \bibitem{ABII} P.~Alonso Ruiz, F.~Baudoin, L.~Chen, L.~G. Rogers, N.~Shanmugalingam and A.~Teplyaev, Besov class via heat semigroup on Dirichlet spaces II: BV functions and Gaussian heat kernel estimates, \emph{Calc. Var. Partial Differential Equations} \textbf{59} (2020), Paper No.~103. \bibitem{AB} P.~Alonso Ruiz, F.~Baudoin, L.~Chen, L.~G. Rogers, N.~Shanmugalingam and A.~Teplyaev, Besov class via heat semigroup on Dirichlet spaces III: BV functions and sub-Gaussian heat kernel estimates, \emph{Calc. Var. Partial Differential Equations} \textbf{60} (2021), Paper No.~170. \bibitem{ABFrac} P.~Alonso Ruiz, F.~Baudoin, L.~Chen, L.~G. Rogers, N.~Shanmugalingam and A.~Teplyaev, \href{https://doi.org/10.4310/ajm.2023.v27.n4.a1}{BV functions and fractional Laplacians on Dirichlet spaces}, \emph{Asian J. Math.} \textbf{27} (2023), 441--466. \bibitem{ABmanifold} P.~Alonso Ruiz and F.~Baudoin, \href{https://doi.org/10.5802/afst.1745}{Yet another heat semigroup characterization of BV functions on Riemannian manifolds}, \emph{Ann. Fac. Sci. Toulouse Math.} (6) \textbf{32} (2023), 577--606. \bibitem{ABGN} P.~Alonso Ruiz and F.~Baudoin, Gagliardo--Nirenberg, Trudinger--Moser and Morrey inequalities on Dirichlet spaces, \emph{J. Math. Anal. Appl.} \textbf{497} (2021), Article 124899. \bibitem{KScompact} P.~Alonso Ruiz and F.~Baudoin, Korevaar--Schoen $p$-energies and their $\Gamma$-limits on Cheeger spaces, \emph{Nonlinear Anal.} \textbf{256} (2025), Article 113779. \href{https://arxiv.org/abs/2401.15699}{arXiv:2401.15699}. \bibitem{Osc} P.~Alonso Ruiz and F.~Baudoin, Oscillations of BV measures on unbounded nested fractals, \emph{J. Fractal Geom.} \textbf{9} (2022), 373--396. \bibitem{AmbrosioAR} L.~Ambrosio, Some fine properties of sets of finite perimeter in Ahlfors regular metric measure spaces, \emph{Adv. Math.} \textbf{159} (2001), 51--67. \bibitem{Ambrosio} L.~Ambrosio, Fine properties of sets of finite perimeter in doubling metric measure spaces, \emph{Set-Valued Anal.} \textbf{10} (2002), 111--128. \bibitem{ADM} L.~Ambrosio and S.~Di~Marino, Equivalent definitions of $BV$ space and of total variation on metric measure spaces, \emph{J. Funct. Anal.} \textbf{266} (2014), 4150--4188. \bibitem{AFP} L.~Ambrosio, N.~Fusco and D.~Pallara, \emph{Functions of Bounded Variation and Free Discontinuity Problems}, Oxford Mathematical Monographs, Oxford University Press, New York, 2000. \bibitem{AMP} L.~Ambrosio, M.~Miranda~Jr. and D.~Pallara, Special functions of bounded variation in doubling metric measure spaces, in: \emph{Calculus of Variations: Topics from the Mathematical Heritage of E.~De~Giorgi}, Quad. Mat.~14, Dept. Math., Seconda Univ. Napoli, Caserta, 2004, pp.~1--45. \bibitem{AMPwiener} L.~Ambrosio, M.~Miranda~Jr. and D.~Pallara, \href{https://doi.org/10.1515/agms-2015-0013}{Some fine properties of BV functions on Wiener spaces}, \emph{Anal. Geom. Metr. Spaces} \textbf{3} (2015), 212--230. \bibitem{BBE} R.~Balka, Z.~Buczolich and M.~Elekes, A new fractal dimension: the topological Hausdorff dimension, \emph{Adv. Math.} \textbf{274} (2015), 881--927. \bibitem{BBKT} M.~T. Barlow, R.~F. Bass, T.~Kumagai and A.~Teplyaev, \href{https://doi.org/10.4171/JEMS/211}{Uniqueness of Brownian motion on Sierpi\'nski carpets}, \emph{J. Eur. Math. Soc.} \textbf{12} (2010), 655--701. \bibitem{BPgasket} M.~T. Barlow and E.~A. Perkins, \href{https://doi.org/10.1007/BF00318785}{Brownian motion on the Sierpi\'nski gasket}, \emph{Probab. Theory Related Fields} \textbf{79} (1988), 543--623. \bibitem{Bau} F.~Baudoin, Korevaar--Schoen--Sobolev spaces and critical exponents in metric measure spaces, \emph{Ann. Fenn. Math.} \textbf{49} (2024), 487--527. \bibitem{BCVicSob} F.~Baudoin and L.~Chen, \href{https://doi.org/10.54330/afm.122168}{Sobolev spaces and Poincar\'e inequalities on the Vicsek fractal}, \emph{Ann. Fenn. Math.} \textbf{48} (2023), 3--26. \bibitem{BCVicHeat} F.~Baudoin and L.~Chen, \href{https://doi.org/10.1002/mana.202400180}{Heat kernel gradient estimates for the Vicsek set}, \emph{Math. Nachr.} \textbf{297} (2024), 4450--4477. \bibitem{BPPheat} C.~Brena, E.~Pasqualetto and A.~Pinamonti, \href{https://doi.org/10.1142/S0219199725500026}{Sobolev and BV functions on RCD spaces via the short-time behavior of the heat kernel}, \emph{Commun. Contemp. Math.} \textbf{27} (2025), no.~8, Paper No.~2550002. \bibitem{BLgasket} F.~Baudoin and C.~Lacaux, \href{https://doi.org/10.1007/s11854-022-0211-x}{Fractional Gaussian fields on the Sierpi\'nski gasket and related fractals}, \emph{J. Anal. Math.} \textbf{146} (2022), 719--739. \bibitem{BPY} F.~Baudoin, A.~Pinamonti and M.~Yang, Macroscopic Poincar\'e inequalities and weak-type characterizations of $p$-energy forms, \href{https://arxiv.org/abs/2610.29789}{arXiv:2610.29789}. \bibitem{BS} C.~Bennett and R.~Sharpley, \emph{Interpolation of Operators}, Pure and Applied Mathematics~129, Academic Press, Boston, 1988. \bibitem{CC} S.~Cao and Z.-Q. Chen, Whether $p$-conductive homogeneity holds depends on $p$, \emph{J. Fractal Geom.} \textbf{12} (2025), 93--104. \bibitem{CGL} A.~Chambolle, A.~Giacomini and L.~Lussardi, Continuous limits of discrete perimeters, \emph{ESAIM Math. Model. Numer. Anal.} \textbf{44} (2010), 207--230. \bibitem{Chr} M.~Christ, A $T(b)$ theorem with remarks on analytic capacity and the Cauchy integral, \emph{Colloq. Math.} \textbf{60/61} (1990), 601--628. \bibitem{CPS} A.~Cianchi, L.~Pick and L.~Slav\'ikov\'a, Higher-order Sobolev embeddings and isoperimetric inequalities, \emph{Adv. Math.} \textbf{273} (2015), 568--650. \bibitem{Dav} J.~D\'avila, On an open question about functions of bounded variation, \emph{Calc. Var. Partial Differential Equations} \textbf{15} (2002), 519--527. \bibitem{DGL} E.~De~Giorgi and G.~Letta, Une notion g\'en\'erale de convergence faible pour des fonctions croissantes d'ensemble, \emph{Ann. Scuola Norm. Sup. Pisa Cl. Sci.} (4) \textbf{4} (1977), 61--99. \bibitem{DMS} S.~Di~Marino and M.~Squassina, New characterizations of Sobolev metric spaces, \emph{J. Funct. Anal.} \textbf{276} (2019), 1853--1874. \bibitem{DS} P.~Diaconis and D.~Stroock, Geometric bounds for eigenvalues of Markov chains, \emph{Ann. Appl. Probab.} \textbf{1} (1991), 36--61. \bibitem{EB} S.~Eriksson-Bique, A new Hausdorff content bound for limsup sets, \emph{Adv. Math.} \textbf{445} (2024), Paper No.~109638. \bibitem{FM} K.~J. Falconer and R.~D. Mauldin, Fubini-type theorems for general measure constructions, \emph{Mathematika} \textbf{47} (2000), 251--265. \bibitem{Fed} H.~Federer, \emph{Geometric Measure Theory}, Grundlehren der mathematischen Wissenschaften~153, Springer, New York, 1969. \bibitem{GaoYang} J.~Gao and M.~Yang, \href{https://doi.org/10.1016/j.aim.2026.110797}{H\"older regularity of harmonic functions on metric measure spaces}, \emph{Adv. Math.} \textbf{488} (2026), Article 110797. \bibitem{GibsonPivarski} L.~R. Gibson and M.~Pivarski, Isoperimetric profiles on the pre-fractal Sierpinski carpet, \emph{Fractals} \textbf{18} (2010), 433--449. \bibitem{Gladkova} V.~Gladkova and V.~Shum, Separation profiles of graphs of fractals, \href{https://arxiv.org/abs/1810.08792}{arXiv:1810.08792}. \bibitem{HK} P.~Haj\l asz and P.~Koskela, Sobolev met Poincar\'e, \emph{Mem. Amer. Math. Soc.} \textbf{145} (2000), no.~688. \bibitem{Harper} L.~H.~Harper, The edge-isoperimetric problem on Sierpi\'nski graphs, \href{https://arxiv.org/abs/1610.02089}{arXiv:1610.02089} (2016). \bibitem{Hei} J.~Heinonen, \emph{Lectures on Analysis on Metric Spaces}, Universitext, Springer, New York, 2001. \bibitem{HeKo} J.~Heinonen and P.~Koskela, Quasiconformal maps in metric spaces with controlled geometry, \emph{Acta Math.} \textbf{181} (1998), 1--61. \bibitem{HKST} J.~Heinonen, P.~Koskela, N.~Shanmugalingam and J.~T. Tyson, \emph{Sobolev Spaces on Metric Measure Spaces: An Approach Based on Upper Gradients}, New Mathematical Monographs~27, Cambridge University Press, Cambridge, 2015. \bibitem{Hut} J.~E. Hutchinson, Fractals and self-similarity, \emph{Indiana Univ. Math. J.} \textbf{30} (1981), 713--747. \bibitem{HyKo} T.~Hyt\"onen and R.~Korte, Characterisations of Sobolev spaces and constant functions over metric spaces, \href{https://arxiv.org/abs/2508.07801}{arXiv:2508.07801}. \bibitem{KS} N.~Kajino and R.~Shimizu, Contraction properties and differentiability of $p$-energy forms with applications to nonlinear potential theory on self-similar sets, \href{https://arxiv.org/abs/2404.13668}{arXiv:2404.13668}. \bibitem{Keith} S.~Keith, Modulus and the Poincar\'e inequality on metric measure spaces, \emph{Math. Z.} \textbf{245} (2003), 255--292. \bibitem{Kig} J.~Kigami, \emph{Conductive Homogeneity of Compact Metric Spaces and Construction of $p$-Energy}, Mem. Eur. Math. Soc.~5, EMS Press, Berlin, 2023. \bibitem{KKST} J.~Kinnunen, R.~Korte, N.~Shanmugalingam and H.~Tuominen, Lebesgue points and capacities via the boxing inequality in metric spaces, \emph{Indiana Univ. Math. J.} \textbf{57} (2008), 401--430. \bibitem{KSc} N.~J. Korevaar and R.~M. Schoen, Sobolev spaces and harmonic maps for metric space targets, \emph{Comm. Anal. Geom.} \textbf{1} (1993), 561--659. \bibitem{KL} R.~Korte and P.~Lahti, Relative isoperimetric inequalities and sufficient conditions for finite perimeter on metric spaces, \emph{Ann. Inst. H. Poincar\'e C Anal. Non Lin\'eaire} \textbf{31} (2014), 129--154. \bibitem{KZ} S.~Kusuoka and X.~Y. Zhou, Dirichlet forms on fractals: Poincar\'e constant and resistance, \emph{Probab. Theory Related Fields} \textbf{93} (1992), 169--196. \bibitem{Lahti} P.~Lahti, Federer's characterization of sets of finite perimeter in metric spaces, \emph{Anal. PDE} \textbf{13} (2020), 1501--1519. \bibitem{LahtiStrong} P.~Lahti, A new Federer-type characterization of sets of finite perimeter in metric spaces, \emph{Arch. Ration. Mech. Anal.} \textbf{236} (2020), 801--838. \bibitem{LPZ} P.~Lahti, A.~Pinamonti and X.~Zhou, A characterization of BV and Sobolev functions via nonlocal functionals in metric spaces, \emph{Nonlinear Anal.} \textbf{241} (2024), Paper No.~113467. \bibitem{Lud} M.~Ludwig, Anisotropic fractional perimeters, \emph{J. Differential Geom.} \textbf{96} (2014), 77--93. \bibitem{MMS} N.~Marola, M.~Miranda~Jr. and N.~Shanmugalingam, Characterizations of sets of finite perimeter using heat kernels in metric spaces, \emph{Potential Anal.} \textbf{45} (2016), 609--633. \bibitem{Mat} P.~Mattila, \emph{Geometry of Sets and Measures in Euclidean Spaces}, Cambridge Studies in Advanced Mathematics~44, Cambridge University Press, Cambridge, 1995. \bibitem{Maz} V.~Maz'ya, \emph{Sobolev Spaces with Applications to Elliptic Partial Differential Equations}, 2nd ed., Grundlehren der mathematischen Wissenschaften~342, Springer, Heidelberg, 2011. \bibitem{Mir} M.~Miranda~Jr., Functions of bounded variation on ``good'' metric spaces, \emph{J. Math. Pures Appl.} (9) \textbf{82} (2003), 975--1004. \bibitem{MS} M.~Murugan and R.~Shimizu, First-order Sobolev spaces, self-similar energies and energy measures on the Sierpi\'nski carpet, \href{https://arxiv.org/abs/2308.06232}{arXiv:2308.06232}. \bibitem{Osada} H.~Osada, Isoperimetric constants and estimates of heat kernels of pre Sierpinski carpets, \emph{Probab. Theory Related Fields} \textbf{86} (1990), 469--490. \bibitem{Shi} R.~Shimizu, Construction of $p$-energy and associated energy measures on Sierpi\'nski carpets, \emph{Trans. Amer. Math. Soc.} \textbf{377} (2024), 951--1032. \bibitem{Vis} A.~Visintin, Generalized coarea formula and fractal sets, \emph{Japan J. Indust. Appl. Math.} \textbf{8} (1991), 175--201. \end{thebibliography} \end{document}