Purpose
Problem: How do we create a new measure that yields the same (arithmetic) mean for functions where the mean is well-defined and has a unique value but calculates a new arithmetic mean for functions where it's not well-defined or does not have a unique value.
Specifically, I wish to generalize the mean to find a new average for functions defined on $A\subseteq \mathbb{R}$ such when using the Lebesgue Measure ($\lambda$) and integral, the mean:
$$\frac{1}{\lambda(A)}\int_{A}f(x)$$
is undefined if $\lambda(A)=0$; the mean using the counting measure
$$\frac{1}{\mu(A)}\sum\limits_{x\in A}f(x)$$
is undefined if $\mu(A)=+\infty$
and the mean using the Haar Measure and Integral is well-defined but not unique without axiom of choice.
From this, it follows from functions where the mean is undefined, that its domains are almost continuous nowhere, with infinite points and a zero-measure domain.
Main Question
What Research Has Been Done On This Problem?
(Below is my attempt to solve my purpose)
First Attempt To Generalize The Mean
Defining Measure $\mathcal{P}$
If $S\subseteq A$:
- $\ell$ is the length of an interval
- $\left(J_{k} \right)_{k=1}^{m}$ for $m\in\mathbb{N}$, are a sequence of open intervals where $\;\ell(J_1)=...=\ell(J_m)=g\in\mathbb{R}^{+}$ and the infimum is taken over all $J_k$ of:
\begin{align} \mathcal{M}(g,S)= g\cdot\inf\left\{m\in\mathbb{N}: {S^{\prime}\text{ is countable}, \left(S\setminus S^{\prime}\right)\subseteq\bigcup\limits_{k=1}^{m}J_{k}}\right\} \end{align}
and
$$\mathcal{N}(S,A)=\lim\limits_{g\to 0}\frac{\mathcal{M}\left(g,S\right)}{\mathcal{M}\left(g,A\right)}$$
then if
\begin{align} & \mathcal{O}(g,S)=\\ & \begin{cases} \small{g\cdot\inf\left\{m\in\mathbb{N}: {S_{j}\subseteq S, \; \mathcal{N}(S_{j},A)=0,\;\bigcup\limits_{j=1}^{\infty}{S}_{j}=S^{\prime\prime},\;\left(S\setminus S^{\prime\prime}\right)\subseteq\bigcup\limits_{k=1}^{m}J_{k}}\right\}} & A \text{ is uncountable}\\ g\cdot\inf\left\{m\in\mathbb{N}: S\subseteq\bigcup\limits_{k=1}^{m}J_{k}\right\} & A \text{ is countable} \end{cases} \end{align}
then the outer measure is
$$\mathcal{P}^{*}(S,A)=\lim\limits_{g\to 0}\frac{\mathcal{O}(g,S)}{\mathcal{O}(g,A)}$$
And the inner measure is $\mathcal{P}_{*}(S,A)=1-\mathcal{P}^{*}(A\setminus S,A)$, meaning measure $\mathcal{P}(S,A)$ exists when $\mathcal{P}^{*}(S,A)=\mathcal{P}_{*}(S,A)$.
When $\mathcal{P}(S,A)$ is defined, the average of $f:A\to B$ is defined as follows:
First, split $[a,b]=[\min(A),\max(A)]$ into sub-intervals using partitions $x_i$
$$a= x_0 \le \dots \le x_i \le \dots \le x_r =b$$
Here, if $1\le i \le r$, then $[x_{i-1},x_i]$ are sub-intervals of $[a,b]$.
For every $i$, choose a $v_i\in A\cap[x_{i-1}, x_{i}]$ and define $A_i=A\cap[x_{i-1},x_i]$. Then define set $P$, such that $i \in P\subseteq\left\{1,...,r\in\mathbb{N}\right\}$ when $A\cap[x_{i-1},x_i]\neq\emptyset$. This gives
\begin{align} & \lim_{r\to\infty}\sum_{i\in P} f(v_i) \times \mathcal{P}(A_i,A) \end{align}
(This may look tedious but we can use shortcuts to simplify the sum. If I write it out my post will be too long.)
Example Where $\mathcal{P}$ Is Undefined
Consider the following:
Therefore, $f:\left\{\frac{1}{s}:s\in\mathbb{N}\right\}\to\left\{0,1 \right\}$
\begin{align*} f(x)=\begin{cases} 1 & x\in \left\{\frac{1}{2s+1}:s\in\mathbb{N}\right\} \\ 0 & x\in \left\{\frac{1}{2s}:s\in\mathbb{N}\right\} \end{cases} \end{align*}
Suppose $S_1=\left\{\frac{1}{2s+1}:s\in\mathbb{N}\right\}$ and $S_2\in\left\{\frac{1}{2s}:s\in\mathbb{N}\right\}$
Using $\mathcal{P}^{*}$, I approximated (and wish to prove using box-dimensions) that $\mathcal{P}^{*}(S_1,S_1\cup S_2)\ge 1/\sqrt{2}$ and $\mathcal{P}^{*}(S_2,S_1\cup S_2)\ge 1/\sqrt{2}$. Hence, $\mathcal{P}_{*}(S_1,S_1\cup S_2)=1-\mathcal{P}^{*}(S_2,S_1\cup S_2)\le 1-1/\sqrt{2}$ but $1/\sqrt{2}\neq 1-1/\sqrt{2}$. Hence for this case my measure is undefined.
Now we need a measure that gives the same value as $\mathcal{P}(S,A)$ when defined but a different value when $\mathcal{P}(S,A)$ is undefined.
Last Request
I believe I found the final answer to my problem (the answer is below my post); however, I wish someone would check. If someday my answers make sense could you please mention this to me?
Currently, I'm in undergrad but if I do not let go of my "research", I could struggle in my studies. Hopefully, someone can verify my ideas so I may be at peace.
My 2 cents: I suppose what you would like to have is a partially ordered family $\{\mu_i\}_{i\in I}$ of measures such that for $i<j$, we have $\mu_i(A)<\infty\implies \mu_j(A)=0$. Then for every $A\subseteq \Bbb R$, there exists at most one $i\in I$ with $0<\mu_i(A)<\infty$, and if such $i$ exists, we define the mean of $f\colon A\to\Bbb R$ to be $\frac1{\mu_i(A)}\int_Af\,\mathrm d\mu_i$ (assuming integrability). For conveninece, we may also wish each $\mu_i$ to be translation invariant. The Lebesgue measure and the counting measure would already be two nice-to-have members of such a family, and we wish to have a family as big as possible.
Using Zorn's lemma, we can infer the existence of a maximal such family. Unfortunately, such a maximal family is probably highly non-constructive.