← A note on language measurability
SigmaAdditivity.tex
\documentclass{amsart}
\usepackage[left=2cm, right=2cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts, amsthm, amssymb, mathtools,etoolbox}
\usepackage{blindtext}
\usepackage[colorlinks=true, urlcolor=blue, linkcolor=blue, citecolor=blue]{hyperref}
\usepackage{tikz,tikz-cd}
\usepackage{cleveref}
\usepackage{xcolor}
\usepackage{array}
\usepackage[style=alphabetic,sorting=nyt, maxnames=4]{biblatex}
% \usepackage[style=authoryear, maxnames=4]{biblatex}
\renewbibmacro{in:}{}
% \addbibresource{biblio.bib}
\addbibresource{CommonBiblio20240922.bib}
\tikzset{pullback/.style={minimum size=1.2ex,path picture={
\draw[opacity=1,black,-,#1] (-0.5ex,-0.5ex) -- (0.5ex,-0.5ex) -- (0.5ex,0.5ex);%
}}}
\usetikzlibrary{calc}
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[subsection]
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{todo}[theorem]{Todo}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{fact}[theorem]{Fact}
\newtheorem{claim}{Claim}[theorem]
\crefname{claim}{Claim}{Claims}
\renewcommand{\theclaim}{\thetheorem.\alph{claim}}
\theoremstyle{definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{notation}[theorem]{Notation}
\newtheorem{puzzle}[theorem]{Puzzle}
\newtheorem{idea}[theorem]{Idea}
\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
\newcommand{\dq}[1]{``#1"}
\newcommand{\memo}[1]{\textcolor{red}{memo: #1}}
% \newcommand{\invmemo}[1]{\textcolor{blue}{memo: #1}}
\newcommand{\invmemo}[1]{}
\newcommand{\horamemo}[1]{\textcolor{green!70!black}{hora: #1}}
\newcommand{\para}[1]{\paragraph{\textbf{#1}}}
\newcommand{\B}{\mathcal{B}}
\newcommand{\Clopen}{{\Delta}}
\newcommand{\Open}{{\mathcal{O}}}
\newcommand{\Bcl}{\mathcal{B}_\Clopen}
\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathcal{C}}
\newcommand{\D}{\mathcal{D}}
\newcommand{\E}{\mathcal{E}}
\newcommand{\F}{\mathbf{F}}
\renewcommand{\L}{\mathcal{L}}
\newcommand{\id}{\mathrm{id}}
\newcommand{\op}{\mathrm{op}}
\newcommand{\ob}{\mathrm{ob}}
\newcommand{\Set}{\mathbf{Set}}
\newcommand{\BoolAlg}{\mathbf{BoolAlg}}
\newcommand{\ProfSp}{\mathbf{ProfSp}}
\newcommand{\sSet}{\mathbf{sSet}}
\newcommand{\FinSet}{\mathbf{FinSet}}
\newcommand{\PSh}{\mathbf{PSh}}
\newcommand{\Sh}{\mathbf{Sh}}
\newcommand{\Cont}{\mathbf{Cont}}
\newcommand{\Func}[2]{[#1,#2]}
\newcommand{\abs}[1]{\left|#1\right|}
\newcommand{\demph}[1]{\textit{#1}}
\font\maljapanese=dmjhira at 2.5ex
\newcommand{\yo}{\textrm{\!\maljapanese\char"48}}
\newcommand{\Pow}{\mathcal{P}}
\newcommand{\St}{\mathrm{St}}
\newcommand{\Ext}{\mathrm{Ext}}
% \newcommand{\Dor}{\mathrm{Cl}_{\perp\perp}}
\newcommand{\Dor}{\mathrm{Dxt}}
\newcommand{\RExt}{\mathrm{RExt}}
\newcommand{\SF}{\mathsf{SF}}
\newcommand{\G}{\mathsf{G}}
\newcommand{\Reg}{\mathsf{Reg}}
\newcommand{\Regu}{\mathsf{Reg}_{>\frac{1}{2}}}
\newcommand{\Regd}{\mathsf{Reg}_{<\frac{1}{2}}}
\newcommand{\A}{{A}}
\newcommand{\dsty}{\mathsf{dty}}
\newcommand{\MA}{{A^{\ast}}}
\newcommand{\proMA}{\widehat{\MA}}
\newcommand{\proden}{\widehat{\delta}}
\newcommand{\Sp}{\mathrm{Sp}}
\newcommand{\bd}{\partial}
\newcommand{\cl}[1]{\overline{#1}}
\newcommand{\Int}{\mathrm{Int}}
\title{A note on language measurability \memo{Ongoing draft}}
\author{Ryuya Hora}
\address{ZEN University, Tokyo, Japan}
\email{ryuya\_hora@zen.ac.jp}
\email{horaryuya38@gmail.com}
% \date{\today}
% \subjclass[2020]{}
% \keywords{h}
\begin{document}
\begin{abstract}
This is a short note on a $\sigma$-additive measure extending Sin'ya's $\Reg$-measurability of formal languages. \memo{This work (in progress) was originally intended to be a note exclusively for discussion with Sin'ya Ryoma. Any comments, especially on errors or preceding work, would be greatly appreciated.}
\end{abstract}
\maketitle
\tableofcontents
\section{Introduction: \texorpdfstring{$\sigma$}{sigma}-additive density of languages}
For a formal language $L$, the notion of \emph{density} $\dsty(L)$ is, intuitively, a real number in $[0,1]$ that represents the probability that a random word belongs to $L$.
Density turns out to be a much more powerful concept than this naive definition might suggest, and already in the earliest stages of its study, connections to the computational hierarchy were established \cite{schutzenberger1965certains, berstel1972densite}.
For instance, the density of a regular language is always a rational number in $[0,1]\cap \Q$, and the density of an unambiguous context-free language is an algebraic number in $[0,1]\cap \overline{\Q}$. \invmemo{cite}
Therefore, this tool can be used to prove that a given language is \emph{not} an unambiguous context-free language.
Then, we mathematicians would ask: how ``natural'' is language density as a mathematical object?
Put less pedantically: how does language density connect to modern mathematical theories, and how might it develop using modern mathematical tools?
Of course, the most naive expectation is a link to probability theory.
Density is certainly probabilistic in nature, and recent work on the measurability of languages by Sin'ya / Sin'ya Yuyama \cite{sin2025measure} implicitly suggests that collections of languages can be embedded into an appropriate function space.
Also, probability measures on a free monoid might remind one of Haar measure on a locally compact group. These ideas suggest connections with harmonic analysis on languages. The recent works \cite{hora2024topoi, uramoto2025semi} might suggest a further connection with profinite Galois groups, which is one of my personal motivations.
However, to the best of the author's knowledge, people have long believed that there is a basic and decisive gap between language density and modern probability theory, which is the problem of $\sigma$-additivity.
\invmemo{Indeed, since this paper tries to refute that viewpoint, perhaps it should be called the \dq{myth} of $\sigma$-additivity.}
Namely, density is at most finitely additive and does not satisfy $\sigma$-additivity (unlike the standard settings in probability theory).
This seems deeply tied to the nature of languages because there are only countably many words.
If we put a $\sigma$-additive measure on a countable set $\MA$ such that every single word has measure $0$, then clearly every subset must have measure $0$ as well.
Therefore, it is often said that trying to fit language density into the paradigm of $\sigma$-additive probability measures is misguided. \invmemo{survey}
This paper provides a way to treat language density in a $\sigma$-additive manner using profinite words. We define a $\sigma$-additive probabilistic Borel measure on $\proMA$, which is known to be the Stone dual to the boolean algebra of regular languages $\Reg$. \memo{See \cite{pin2022mathematical} and papers cited therein.}
Since this profinite completion is no longer a countable infinite set, it can carry $\sigma$-additive probability measures that were impossible before.
Let us explain why the profinite space $\proMA$ is a natural subject to consider. It is not only because it admits the $\sigma$-additive measure, but also because it has exactly the same information as the densities of regular languages, which have the canonical notion of density. \memo{Densities can be defined a priori in may ways. But they tend to coincide and define the canonical notion of density for regular languages.} Furthermore, the $\sigma$-additive probability on $\proMA$ captures the notion of $\Reg$-measurability, which clarifies an analytic aspect of the asymptotic approximation of languages \cite{sinya2021Asymptotic}.
\memo{As mentioned above, one of the motivations is to prepare a bridge to modern mathematics—especially geometric group theory and harmonic analysis on groups. }
\invmemo{(For why the profinite completion is the natural object here, see the Remark.)}
\section{Densities as finitely additive probabilistic measures}
\subsection{The classical notion of density}
We fix a non-empty finite set of alphabet $\A$ and write $\MA$ for the free monoid it generates.
\begin{definition}[density]
For a language $L\subset \MA$, its \demph{density} is defined to be the Ces\`{a}ro mean of $\frac{\#L\cap A^k}{\#A^k}$
\[
\dsty(L) \coloneqq \lim_{n\to \infty}\frac{1}{n} \sum_{k=1}^{n} \frac{\# (L\cap A^k )}{\#A^k}.
\]
\end{definition}
We say that a language $L$ \demph{has density} if the limit converges.
\invmemo{Not every language has density.}
\begin{remark}[Historical remark]
\memo{... possibly \cite{schutzenberger1965certains}}
To the author's knowledge, the above definition first appears in the first ICALP \cite{berstel1972densite} as a special case of \demph{densit\'{e} asymptotique} $d^\eta(L)$ for the monoid homomorphism $\eta\colon \MA \to \R_{>}$ that sends every character $a\in A$ to $\frac{1}{n}$.
\end{remark}
\begin{fact}
Every regular language has density.
\end{fact}
% \begin{proof}[Sketch of proof]
% Let $L\subset \MA$ be a regular language and take a finite deterministic automaton $(Q, \delta\colon Q \times \A \to Q, F\subset Q, q_0\in Q)$ that recognizes $L$.
% \end{proof}
% \begin{proposition}[Density is a finitely additive measure]
% The density function $\delta$ defines a finitely additive probabilist This measure cannot be extended to $\sigma$-additive measure.
% \end{proposition}
% \begin{proof}
% \end{proof}
\invmemo{The Measure Theoretic Approach to Density}
\section{A general theory for Boolean algebras with probability}
\subsection{Preliminary: Stone duality}
See Johnstone's textbook \cite{johnstone1982stone} for detailed explanations of Stone duality.
\begin{notation}\label{notation:BorelandVariants}
Let $X$ be a topological space.
\begin{itemize}
\item We write $\Clopen(X)$ for the boolean algebra of all clopen subsets of $X$, and $\Bcl(X)$ for the $\sigma$-algebra generated by $\Clopen(X)$.
\item We write $\Open(X)$ for the set of all open subsets of $X$, and $\B(X)$ for the $\sigma$-algebra generated by $\Open(X)$, i.e., the set of all Borel sets of $X$.
\end{itemize}
\end{notation}
\begin{fact}[Stone duality \cite{stone1936theory, stone1937applications, doctor1964categories}]
The category of Boolean algebras and the category of profinite spaces are contravariantly equivalent via the functor $\Clopen$.
\[
\begin{tikzcd}
\ProfSp^\op \ar[r, "\Clopen", "\simeq"', shift left] & \BoolAlg
\end{tikzcd}
\]
\end{fact}
We write $\Sp$ for the (essentially unique) converse equivalence $\Sp \colon \BoolAlg^\op \to \ProfSp$
\subsection{Boolean algebra with measure}
\begin{definition}
A \demph{Boolean algebra with measure} (in short, \demph{BwM}) is a pair $(B,\mu)$ of a Boolean algebra $B$ and a function $\mu\colon B \to [0,\infty)$ such that
\begin{itemize}
\item for any $x,y \in B$, $x\land y=\bot$ implies $\mu(x\lor y)=\mu(x)+\mu(y)$.
\end{itemize}
\end{definition}
\begin{lemma}[Basic properties]
For any BwM $(B, \mu)$, the following conditions hold.
\begin{enumerate}
\item $\mu: B \to [0, \infty)$ is order-preserving.
\item $\mu(\bot)=0$
\item For any $x,y \in B$, $\mu(x\lor y)\leq \mu(x)+\mu(y)$
\end{enumerate}
\end{lemma}
\begin{proof} We prove them one by one.
\begin{enumerate}
\item Assuming $x\leq y$, we have $y=y\land(x\lor \lnot x)=x\lor (y\land \lnot x)$. Since $x \land (y\land \lnot x)=\bot$, we have $\mu(y) =\mu (x)+\mu (y\land \lnot x)\geq \mu(x)$. This proves that $\mu$ is order-preserving.
\item Since $\bot= \bot \land \bot $, we have $\mu(\bot)= \mu(\bot \land \bot)=\mu(\bot)+\mu(\bot)$, which implies $\mu(\bot)=0$.
\item As $x\lor y =x\lor (\lnot x \land y)$, we have $\mu(x\lor y)=\mu(x)+\mu(\lnot x \land y)\leq \mu(x)+\mu(y)$.
\end{enumerate}
\end{proof}
% \begin{remark}
%
\invmemo{This provides an embedding into the category of topological spaces with finite additive measure?}
% \end{remark}
% \begin{todo}
%
\invmemo{The metric space structure of (\dq{separable} BwM)}
% \end{todo}
For a topological space, we call a finitely additive measure on $\Clopen(X)$ a \demph{$\Clopen$-measure}. A (finitely or $\sigma$-)additive measure is \demph{finite} if the measure of the whole set is finite.
The next proposition immediately follows from the argument above and the isomorphism $\Clopen(\Sp(B))\cong B$ given by the Stone duality.
\begin{proposition}\label{prop:CorrespondenceAtFiniteLevel}
For any BwM $(B,\mu)$, the function $\Clopen(\Sp(B))\cong B \xrightarrow{\mu}[0,\infty)$ defines a finitely additive finite $\Clopen$-measure on $\Sp(B)$. Furthermore, this correspondence provides a bijective correspondence between BwM structures on a Boolean algebra $B$ and finitely additive finite $\Clopen$-measure on its Stone dual $\Sp(B)$.
\[
\begin{tikzcd}
\text{BwMs on a Boolean algebra $B$}\ar[r, leftrightarrow, "1:1"] & \text{(fin.add.) finite $\Clopen$-measures on its Stone dual $\Sp(B)$}
\end{tikzcd}
\]
\end{proposition}
\subsection{Extension via Hopf-Kolmogorov}
Then, we expand our consideration from $\Clopen(X)$ to $\Bcl(X)$ (\Cref{notation:BorelandVariants}).
% \begin{lemma}\label{lem:restriction}
% For any Boolean algebra $B$, and any finite $\Bcl$-measure $\mu\colon \Bcl(\Sp(B)) \to [0, \infty)$ on $\Sp(B)$, the restriction of $\mu$ to $B\cong\Clopen(\Sp(B))\subset \Bcl(\Sp(B))$ provides a BwM structure on $B$.
% \end{lemma}
% \begin{proof}
% This immediately follows from the definition.
% \end{proof}
\begin{proposition}\label{prop:UniqueExtensionToMeasure}\memo{This should be already known}
For any Boolean algebra $B$,
% the construction of \Cref{lem:restriction} provides
there is a natural one-to-one correspondence between BwM structures on $B$ and finite $\Bcl$-measures on its stone dual $\Sp(B)$.
\[
\begin{tikzcd}
\text{BwMs on a Boolean algebra $B$}\ar[r, leftrightarrow, "1:1"] & \text{($\sigma$-add.) finite $\Bcl$-measures on its Stone dual $\Sp(B)$}
\end{tikzcd}
\]
\end{proposition}
\invmemo{On the natrurality of the above correspondence, in terms of category theory}
Our proof requires the following classical fact.
\begin{fact}[Hopf-Kolmogorov extension]\label{fact:HopfKolmogorov}\memo{Possible citations include \cite[Exercise 1.3.5, 1.3.6]{cohn2013measure}}
A finitely additive measure $(X, B, \mu)$ admits an extension to $\sigma$-additive measure on the measureble space $(X, \sigma(B))$ if and only if it satisfies the $\sigma$-additivity in the following sense.
\begin{description}
\item[$\sigma$-additivity] For any mutually disjoint family $\{A_i\}_{i=0}^\infty$ of elements of $B$, if $\bigcup_{i=0}^\infty A_i$ happens to be an element of $B$, then $\mu\left(\bigcup_{i=0}^\infty A_i\right) = \sum_{i=0}^\infty \mu(A_i)$ holds.
\end{description}
Furthermore, the finitely additive measure space $(X, B, \mu)$ is finite, i.e. $\mu(X)<\infty$, then the extension of $(X, B, \mu)$ to $(X, \sigma(B))$ is unique.
\end{fact}
\begin{proof}[Proof of \Cref{prop:UniqueExtensionToMeasure}]
Due to \Cref{prop:CorrespondenceAtFiniteLevel} and \Cref{fact:HopfKolmogorov}, it suffices to prove that any finitely additive $\Clopen$-measure on $\Sp(B)$ is $\sigma$-additive. Let $\{A_i\}_{i=0}^\infty$ be a mutually disjoint family of elements of $B$ such that $A\coloneqq \bigcup_{i=0}^\infty A_i \subset \Sp(B)$ is an element of $\Clopen(\Sp(B))$. Since $\Sp(B)$ is compact, every closed (in particular, clopen) subset is also compact. Therefore, the equation $A\coloneqq \bigcup_{i=0}^\infty A_i$ provides a open cover of a compact subspace $A$, and hence there exists a finite open subcover. As the family $\{A_i\}_{i=0}^\infty$ is mutually disjoint, we conclude that all but finite components are empty subsets. Thus, the required equality $\mu\left(\bigcup_{i=0}^\infty A_i\right) = \sum_{i=0}^\infty \mu(A_i)$ is reduced to the finite additivity of $\mu$.
\end{proof}
\begin{remark}[Completeness in the above proof]
To the question of why $\sigma$-additivity can be proved from purely finite data, the following answer can be given.
For a Boolean algebra, its Stone dual is the space obtained by adjoining all points that exist virtually. In this sense, Stone duality can be regarded as a kind of existence theorem for points (or completeness theorem). What makes the crucial assumption of $\sigma$-additivity in the Hopf–Kolmogorov theorem trivial in our case is precisely an existence theorem asserting that for any equation of the form $A\coloneqq \bigcup_{i=0}^\infty A_i$, there exists a point refuting it. \invmemo{This should be directly related to the completeness theorem of classical propositional logic.}
\end{remark}
\subsection{Comparison with Borel measures}
\begin{corollary}
If a Boolean algebra $B$ is countable,
% then the construction of \Cref{lem:restriction} provides
there is
a one-to-one correspondence between BwM structures on $B$ and Borel measures on its Stone dual $\Sp(B)$.
\[
\begin{tikzcd}
\text{BwMs on a Boolean algebra $B$}\ar[r, leftrightarrow, "1:1"] & \text{($\sigma$-add.) finite Borel-measures on its Stone dual $\Sp(B)$}
\end{tikzcd}
\]
\end{corollary}
\invmemo{Taking their generating functions should be a continuous map. Is this written by ... some methods in functional analysis?}
\begin{fact}\label{fact:ProfiniteSpacesAreZeroDimensional}
Any profinite space is \textit{zero-dimensional}, i.e., every open subset is a sum of clopen subsets.
\end{fact}
\begin{proof}
\memo{This follows since every profinite space is a flitered limit of finite discrete topological spaces.}
\end{proof}
\begin{lemma}\label{lem:CountableComparisonBorelAndBorelClopen}
If a Boolean algebra $B$ is countable, then the $\Bcl(\Sp(B))$ coincides with the Borel $\sigma$-algebra $\B(\Sp(B))$.
\end{lemma}
\begin{proof}
As the Borel $\sigma$-algebra $\B(\Sp(B))$ is generated by open subsets $\Open(\Sp(B))$, it suffices to prove $\Open(\Sp(b))\subset \Bcl(\Sp(B))$.
The countability of $B$ and \Cref{fact:ProfiniteSpacesAreZeroDimensional} implies that every open subset is a sum of a necessarily countable number of clopen subsets.
\end{proof}
\invmemo{How about $2^{\omega_1} \cong \Sp(\text{free Boolean algebra generated by $\omega_1$})$?}
\begin{remark}[Countability assumption is necessary]
We cannot remove the countability assumption in \Cref{lem:CountableComparisonBorelAndBorelClopen}.
% Let $\beta$ be an ordinal with cofinality larger than omega (for example, $\beta =\omega_1$), and $B_\beta$ be the free Boolean algebra generated by $\beta$. Then, its Stone dual $\Sp(B_\beta)$ is (homeomorphic) to the product space $2^\beta\coloneqq\{f\colon \beta \to \{0,1\}\text{ function}\}$. Let $\B_b(2^\beta)$ be the set of all subsets $A\subset 2^\beta$ such that
% % $f\colon \beta \to \{0,1\}$ such that
% \[
% \text{There exists $\alpha\in \beta$ such that for any functions $f,g\colon \beta \to \{0,1\}$, $f\restriction_{\alpha}=g\restriction_{\alpha}$ implies $(f\in A \iff g\in A)$.}
% \]
Let $I$ be an uncountable set, and $B_I$ be the free Boolean algebra generated by $I$. Then, its Stone dual $\Sp(B_I)$ is (homeomorphic to) the product space $2^I\coloneqq\{f\colon I \to \{0,1\}\text{ function}\}$. We call a subset $A\subset 2^I$ \textit{$\aleph_0$-bounded} if there exists a countable subset $J\subset I$ such that $A$ is an inverse image of a subset of $2^{J}$ along the restriction function $2^I \twoheadrightarrow 2^{J}$. For any countable family of $\aleph_0$-bounded subsets $\{A_i\}_{i=0}^\infty$ witnessed by $\{J_i\}_{i=0}^\infty$, their countable sum or intersection is also $\aleph_0$-bounded witnessed by $\bigcup_{i=0}^\infty$. With easier observations on finite Boolean operations, we can conclude that the set of all bounded subsets, denoted by $\B_0(2^I)$, is a $\sigma$-additive family. Furthermore, one can check $\Clopen(2^I) \subset \B_0(2^I)$, which implies $\Bcl(2^I)\subset \B_0(2^I)$.
On the other hand, $\B(2^I)$ is not included by $\B_b(2^I)$, since the closed subset $\{\mathrm{const}_0\}$, consisting of the unique element of the constant function at $0$, is not $\aleph_0$-bounded. Therefore, we have proven $\Bcl(2^I) \subset \B_b(2^I) \not \supset \B(2^I)$, in particular, $\Bcl(2^I) \neq \B(2^I)$.
% Let $\B_b(2^I)$ be the set of all subsets $A\subset 2^\beta$ such that
% $f\colon \beta \to \{0,1\}$ such that
% \[
% \text{There exists a countable subset $I_0\subset I$ such that $A$ is an inverse image of a subset of $2^{I_0}$ along the restriction function $2^I \twoheadrightarrow 2^{I_0}$.}
% \]
\end{remark}
\invmemo{This reminds me of the topos of light condensed sets.}
% \begin{todo}
% Extend it by the Caratheodory extension. Consider its $L^2$ space and Step functions.
% \end{todo}
\section{On the language measurability}
Definitions are due to \cite{sin2025measure} and the papers cited therein.
\subsection{\texorpdfstring{$\sigma$}{sigma}-additive density of profinite words}
\memo{Write contexts: Stone dual between the profinite monoid and the Boolean algebra of regular languages. }
\begin{corollary}
There exists a unique probabilistic Borel measure $\proden$ on $\proMA$, such that for any clopen subset $C\subset \proMA$
\[
\proden(C) = \delta(C\cap \MA).
\]
\end{corollary}
\begin{example}[The singleton case is the pushout of the Haar measure on $\widehat{\Z}$]
In the case $\#A = 1$, the profinite space $\proMA$ is known to be $\N \sqcup \widehat{\Z}$, where the discrete subspace $\N$ is dense in $\proMA$, and its complement subspace $\widehat{\Z}$ is homeomorphic to the usual profinite topology on the profinite integers. As $\widehat{\Z}$ is a profinite group, it admits the unique Haar probabilistic measure. In fact, the canonical measure on $\proMA$ coincides with the pushout of this measure along the embedding $\widehat{\Z}\to \proMA$. \memo{write a proof}
\end{example}
\memo{
\begin{conjecture}
The Borel measure on $\proMA$ is the unique probabilistic measure that is stable under the average of pushouts by alphabets with possibly some additional conditions. \invmemo{This should follow from the classical result that every regular language is a solution of a "linear equations."}\invmemo{Ahh, possibly we should devide this into group languages and star-free languages..?}
\end{conjecture}
}
\memo{This might be connected with the theory of $\mu$-stationary measures such as \cite{kaimanovich2000poisson}}\invmemo{or studies by Anatoly Vershik.}
\begin{definition}
We call the completion of the measure $\proden$ the \demph{canonical measure} on $\proMA$
\end{definition}
\subsection{Comparison with the Sin'ya \texorpdfstring{$\Reg$}{Reg}-measurability}
\begin{table}
\centering
\begin{tabular}{|c|c|l|}\hline
Words $\MA$& Profinite words $\proMA$ &\\\hline
regular& clopen $\bd C = \emptyset$ &classically known Almeida-Pippenger \\\hline
upper $\Reg$-approximation& closure $\cl{L}$ &\\\hline
lower $\Reg$-approximation& $\proMA \setminus \Int(\proMA \setminus L)$&\\\hline
$\Reg$-measurability& null-boundary $\proden(\bd C) = 0$ &\\ \hline
\end{tabular}
\caption{Correspondence between words and profinite words}
\label{tab:placeholder}
\end{table}
\begin{notation}
For a subset $S$ of a topological space $X$, the \demph{boundary} of $S$ is defined to be the set $\bd S\coloneqq \cl{S}\setminus \Int (S)$.
\end{notation}
\begin{definition}
Let $(X, \mu)$ be a Borel measure on a topological space $X$. We say that a subset $S\subset X$ \demph{has a null-boundary} if its boundary $\bd S$ is contained in a $\mu$-null set.
\end{definition}
\begin{example}
A subset $S\subset X$ is clopen if and only if its boundary $\bd S$ is empty. Therefore,
every clopen subset $C\subset X$ has a null-boundary.
\end{example}
\begin{lemma}
For any language $L \subset \MA$, the $\proden$-measure of its closure $\proden(\cl{L})$ coincides with the upper $\Reg$-approximation.
\end{lemma}
\begin{proposition}[Comparison lemma]
For any subset $S \subset \proMA$ with a null-boundary, the intersection with finite words $S \cap \MA$ is $\Reg$-measurable (in the sense of \cite{sinya2021Asymptotic}). Furthermore, in that case, we have $\proden (S) = \delta (S \cap \MA)$.
\end{proposition}
\begin{proof}
Let $S\subset \proMA$ be a subset with $\proden$-null boundary. Then, we have \[\proden \left(\cl{S}\right) = \proden( \Int S)+ \proden (\bd S) =\proden( \Int S).\]
As $\proMA$ has a countable clopen basis, which is given by the Stone dual to regular languages, There exist two sequences of clopen subsets $(C_i)_{i=0}^\infty, (D_i)_{i=0}^\infty$ such that
\[
C_0\subset C_1\subset \dots \subset S \subset \dots \subset D_1 \subset D_0,
\]
and
\[
\bigcup_{i=0}^\infty C_i = \Int S\text{, and } \bigcap_{i=0}^\infty D_i = \cl{S}.
\]
Thus, we have the following situation
\[
\begin{tikzcd}[column sep = 7pt]
C_0 \ar[r, phantom, "\subset"] & C_1 \ar[r, phantom, "\subset"] &C_2 \ar[r, phantom, "\subset"] &\cdots \ar[r]& \Int S \ar[rr, bend left, "\text{null}", -]& S \ar[l, phantom, "\subset"] \ar[r, phantom, "\subset"]&\cl{S} &\cdots \ar[l] \ar[r, phantom, "\subset"]&D_2 \ar[r, phantom, "\subset"] &D_1 \ar[r, phantom, "\subset"] &D_0 & (\subset \proMA),
\end{tikzcd}
\]
and hence
\[
\begin{tikzcd}[column sep = 4pt]
C_0 \cap \MA \ar[r, phantom, "\subset"] & C_1\cap \MA \ar[r, phantom, "\subset"] &C_2\cap \MA \ar[r, phantom, "\subset"] &\cdots && S\cap \MA \ar[ll, phantom, "\subset"] \ar[rr, phantom, "\subset"]&&\cdots \ar[r, phantom, "\subset"]&D_2\cap \MA \ar[r, phantom, "\subset"] &D_1\cap \MA \ar[r, phantom, "\subset"] &D_0\cap \MA & (\subset \MA).
\end{tikzcd}
\]
by taking their measures, we have
\[
\begin{tikzcd}[column sep = 4pt]
\proden (C_0 )\ar[r, phantom, "\leq"] \ar[d, equal]& \proden (C_1) \ar[r, phantom, "\leq"] \ar[d, equal]&\proden (C_2)\ar[d, equal] \ar[r, "\sup"]& \proden (\Int S )\ar[rr, bend left, equal]& \proden (S) \ar[l, phantom, "\leq"] \ar[r, phantom, "\leq"]&\proden (\cl{S}) &\proden (D_2)\ar[l, "\inf"'] \ar[d, equal] \ar[r, phantom, "\leq"] &\proden (D_1)\ar[d, equal] \ar[r, phantom, "\leq"] &\proden (D_0)\ar[d, equal]\\
\delta (C_0 \cap \MA) \ar[r, phantom, "\leq"] & \delta (C_1\cap \MA) \ar[r, phantom, "\leq"] &\delta (C_2\cap \MA) \ar[r, phantom, "\leq"] &\cdots & \delta (S\cap \MA) \ar[l, phantom, "\leq"] \ar[r, phantom, "\leq"]&\cdots \ar[r, phantom, "\leq"]&\delta (D_2\cap \MA) \ar[r, phantom, "\leq"] &\delta (D_1\cap \MA) \ar[r, phantom, "\leq"] &\delta (D_0\cap \MA).
\end{tikzcd}
\]
This proves that $S\cap \MA$ is $\Reg$-measurable and $\proden (S) = \delta(S \cap \MA)$.
\end{proof}
% \memo{A subset $A\subset \proMA$ is \demph{tame} if $\cl{A}\setminus \Int (A)$ is (contained by) a null-set. In this case, the ... (This is a kind of "boring analogy" of regularity of measure.)}
\begin{example}
$\MA \subset \proMA$ does NOT have a null-boundary.
\end{example}
\invmemo{Isn't this just the Caratheodory criterion of measurability, which says the boundary is null.}
\invmemo{Survey! e.g. Pin's mathematical foundations of ...}
\invmemo{The comparison}
\memo{
\section{\memo{}To be written}
\subsection{Function space over the profinite words}
\invmemo{To be written}
\subsection{The \texorpdfstring{$L^2$}{L2}-space over the profinite words}
\invmemo{To be written}
\subsection{The word actions on the function space}
\invmemo{To be written}
\subsection{The probabilistic independence of languages}\subsection{The probabilistic independence of languages}
\invmemo{To be written}
}
\subsection*{Acknowledgement}
The author would like to thank Mao Hoshino, Koki Sakamoto, Ryoma Sin'ya, and Takao Yuyama for their useful discussions. Of course, all mistakes and any immaturity are due to the author, not to them.
\printbibliography
\end{document}