New Way of Averaging the Most Pathological Funtions: (Converting Maths in the Attatchments to Code)

Edit: I updated the attatchments. For a better version of this post, see this version. (If the latter is allowed, I will send a link to the official post)?

Motivation: I want to convert the mathematics in the attatchments to code. This might be the only way to apply the equations in the articles.

Here is the abstract:

Suppose n\in\mathbb{N}, f:\mathbb{R}^{n}\to\mathbb{R} is a Borel
function and any Borel measure is defined on the Borel
\sigma-algebra. For all real numbers
a_1<b_1,a_2<b_2,\cdots,a_n<b_n, suppose that
\mathcal{B}_{n}:=(a_1,b_1)\times(a_2,b_2)\times\cdots\times(a_n,b_n)\subset\mathbb{R}^{n}
is an n-dimensional interval.


We want the mean of explicit, unbounded f (defined without axiom of
choice) that is non-Lebesgue integrable on any
\mathcal{B}_n\subset\mathbb{R}^{n}. The problem is the mean of f,
w.r.t. the n-dimensional Lebesgue measure, is always undefined.
Thus, take the average w.r.t. the Hausdorff measure in its dimension
of a family of bounded functions with different domains converging to
f. Nevertheless, depending on the chosen family of bounded functions
converging to f, the new mean can be one of several values; that is,
the new mean is non-unique. Hence, we define a modeling question (its
answer, a mathematical model of a real-life phenomenon) that chooses a
unique, “satisfying”, and finite average of f.


The applications in the modeling question include a reference point
\mathbf{R}\in\mathbb{R}^{n+1} (i.e., the chosen “center” of the
observable universe), the actual rate versus expected rate of
expansion of a family of each bounded function’s graph (i.e., the rate
of expansion of the observable universe), and the “measure” of the
chosen families of each bounded function’s graph (i.e., the “entropic
density” of the observable universe). The “measure” partitions each
graph into equal measure sets which take a sample point from each
partition, pathways of line segments between sample points, lengths of
line segments in each pathway, removed lengths which are outliers,
remaining lengths which are converted into a probability distribution,
and the entropy of the distribution.


Therefore, assuming n\in\mathbb{N}, we want to average the special case of f:\mathbb{R}^{n}\to\mathbb{R} (i.e., \mathcal{G}:\mathbb{R}^{n}\to\mathbb{R}) where for all real numbers a_1<b_1,a_2<b_2,\cdots,a_n<b_n, supposing that \mathcal{B}_{n}:=(a_1,b_1)\times(a_2,b_2)\times\cdots\times(a_n,b_n)\subset\mathbb{R}^{n} is an n-dimensional interval:

We want explicit, unbounded \mathcal{G} (defined without the axiom of choice) such that:

  1. The restriction of \mathcal{G} to any n-dimensional interval has infinite (n+1)-dimensional volume both above and below v=0, where v:\mathbb{R}^{n}\to\mathbb{R} is a function.
  2. For all n-dimensional intervals \mathcal{B}_n\subset\mathbb{R}^{n} (look above this quote) and c<d real numbers, \{(x_1,\cdots, x_n)\in\mathcal{B}_n:\mathcal{G}(x_1,\cdots,x_n) \in (c,d)\} is a set with positive n-dimensional Lebesgue measure.

Here is an example, when n=1:

(Example of \mathcal{G}) Let (q_t)_{t\in\mathbb{N}} be a numbering of the rational numbers and k_t=2^{2^t}, and define functions s_t as follows:

If s_0=0 everywhere and:

s_{t+1}(x)=\begin{cases} q_{t/2} & x\in\bigcup_{j\in\{1,\cdots,t\}}(q_j-1/k_t,q_j+1/k_t), \, t \text{ is even}\\ k_t^2 & x \in\bigcup_{j\in\{1,\cdots,t\}}(q_j-1/k_t,q_j+1/k_t), \, t \text{ is odd}\\ s_t(x) & \text{otherwise} \end{cases}

each s_{t+1} agrees with s_t at all real numbers except a set of measure <1/2^t for big t, so one could consider \mathcal{G} the pointwise limit of the functions s_t, which is defined everywhere except measure 0 (in those bad points just define \mathcal{G}=0).

Here is the partial code to define the example:

Clear["Global`*"]
enumerateRationals[n_Integer?Positive] := 
  Module[{posRationals, 
    fullList},(*Generate enough positive rationals using the Calkin-
   Wilf step*)
   posRationals = NestList[1/(2 Floor[#] - # + 1) &, 1, Ceiling[n/2]];
   (*Interleave:0,q1,-q1,q2,-q2...*)
   fullList = Riffle[posRationals, -posRationals];
   Prepend[fullList, 0][[1 ;; n]]];
enumerateRationals[0] = {};
q[t_] := q[t] = enumerateRationals[t][[t]]
(*Takes the t-value in an enumeration*)
k[t_] := k[t] = 2^(2^t)
s[0, _] = 0;
s[t_Integer, x_] := 
 s[t, x] = 
  Piecewise[{{q[(t - 1)/2], 
     EvenQ[t - 1] && 
      0 <= Min[Abs[x - enumerateRationals[t - 1]]] < 1/k[t - 1]}, {k[
       t - 1]^2, 
     OddQ[t - 1] && 
      0 <= Min[Abs[x - enumerateRationals[t - 1]]] < 1/k[t - 1]}}, 
   s[t - 1, x]]
FullSimplify[PiecewiseExpand[s[4, x]]]

I need to compute \mathcal{G}(x) by taking s[t,x] as t->Infinity, but I’m unable to do this with the current code.


Notes on the Remaining Paper:

To obtain a unique, “satisfying”, and finite average from \mathcal{G}(x), we use an answer to the modeling question (see abstract or introduction) in Section 3.1 (pg. 28-30). In the longer attatchment, we answer the recent modeling question in Section 4 (pg. 31-43) and represent it with code in Section 4.4.2.1 (pg. 123-158).

Since the explanation of the answer in Section 4 [pg. 44-122] is extremely long, you don’t have to read it.

Therefore, after reading most of the papers (excluding certain parts of pg. 44-122) I have the following question:


Question:

When n=1, using \mathcal{G}(x) in Section 2.1.1 (pg. 6), Definition 13 (pg. 13-14), and the answer to Section 3.1 (pg. 28-30):

What is M_{\mathcal{G},\mathbb{R}}((f_r^{\star}),(A_r^{\star});1) depending on (see the abstract or introduction) the reference point \mathbf{R}\in\mathbb{R}^{2}, the fixed expected rate of expansion E, and the actual rate of expansion \mathcal{E}(\mathbf{R},\mathrm{graph}(f_r^{\star}))?


(If you want to acknowledge that you’ve read the attatchments, see this online link.)

_OP_Reformatted Shorter Version_CP_ Averaging a Function Non-Integrable on Any Interval.pdf (849 KB)
_OP_Reformatted_CP_ Averaging a Function Non-Integrable on Any Interval.pdf (1.39 MB)

I would define s this way, for nicer formulas:

s[t_Integer, x_] := s[t, x] =
   PiecewiseExpand[Piecewise[{
       {q[(t - 1)/2], EvenQ[t - 1] &&
         0 <= Min[Abs[x - enumerateRationals[t - 1]]] <
          1/k[t - 1]},
       {k[t - 1]^2, OddQ[t - 1] &&
         0 <= Min[Abs[x - enumerateRationals[t - 1]]] <
          1/k[t - 1]}}, s[t - 1, x]]] /.
    {a_?NumberQ, cond_} :>
     {a, Reduce[cond, x, Reals]};

I don’t know how to calculate the limit.

For the sake of neatness, how do we replace the conditions of y=0, with the text “otherwise”.

For example, with s[4,x], I want the following output:

s_4(x)=\begin{cases} 65536& x\in(-\frac{257}{256},-\frac{255}{256})\cup(-\frac{1}{256},\frac{1}{256})\cup(\frac{255}{256},\frac{257}{256})\\ 16 & x \in(-\frac{1}{4},\frac{1}{4})\\ 0 & \text{otherwise} \end{cases}

Even then, I don’t think the output above is correct. The intervals in y=16 and y=65536 overlap.

Piecewise conditions are evaluated in the given order: the first one that applies is chosen. They can overlap by design. If you really need non-overlap, you can try this:

s[4, x] //. ({foo___, {a1_?NumberQ, cond1_},
     {a2_?NumberQ, cond2_}, bar___} /;
    Reduce[cond1 && cond2] =!= False) :>
  {foo, {a1, cond1},
   {a2, Reduce[cond2 && Not[cond1]]}, bar}