User blog:Ikosarakt1/Something for BEAF

It's known that b^n & a is defined by Bowers, but he wrote nothing about b*n & a or b+n & a. I'm inspired by the idea to make & operator universal, so that it can take any function f(n) and return its corresponding array, f(n) & n.

Strings, not integers for &
First of all, we can't say that the expression to the left from & is a number, because there's a math axiom which says:

$$n = m \rightarrow f(n) = f(m)$$

In the number sense, 2+1 = 3, but 2+1 & 3 isn't supposed to be equal to 3 & 3. So, 2+1 and 3 are just strings (remember string type in programming languages.)

Which notation I want to use
In the changed variant of BEAF, the {}-brackets indicate value of array, but without them it can't be treated as a number. Say, {3,3,3} is a number, but 3,3,3 is an array. It is important when we construct arrays, using & operator. I call arrays without &'s - expanded arrays.

As for Bowerian X-s, I decided to not use them in & operator at all. However, they are needed in separators. For example, I express (n)-separator as [X^n]. Namely in square brackets, because round parentheses are often used in the string for & as in ((2+1)*3+2)*4+5 & 6.

Also, expressions inside separators are numbers, not strings. So, for example, [X^(2+1)] = [X^3].

Addition
Let a and b are strings which looks as the decimal expression of integer number. What a+b & n would mean? Logically, I define is as:

a+b & n = n,...,n [X^1] n,...,n (a n's in the first row and b n's in the second)

Knowing that m & n = n,...,n (m copies of n):

a+b & n = a & n [X^1] b & n

For 3 summands:

a+b+c & n = a & n [X^1] b & n [X^1] c & n

Generalizing for m summands (m is a natural number):

a1+a2+...+am & n = a1 & n [X^1] a2 & n [X^1] ... [X^1] am & n

It's worth to note that parentheses don't change value of array: {(1+2)+3 & 4} = {1+(2+3) & 4}. That's a ghost of addition's associativity.

Multiplication
When we say "a by b", we usually mean rectangle with b rows and a columns. So:

a*2 & n = {a & n [X^1] a & n}

a*3 & n = {a & n [X^1] a & n [X^1] a & n}

a*4 & n = {a & n [X^1] a & n [X^1] a & n [X^1] a & n}

a*b & n = {a & n [X^1] ... [X^1] a & n} (b copies of a & n)

"a by b by c", by analogy, means a box with c rectangles "a by b":

a*b*2 & n = {a*b & n [X^2] a*b & n}

a*b*3 & n = {a*b & n [X^2] a*b & n [X^2] a*b & n}

a*b*4 & n = {a*b & n [X^2] a*b & n [X^2] a*b & n [X^2] a*b & n}

a*b*c & n = {a*b & n [X^2] ... [X^2] a*b & n} (b copies of a & n)

Note that:

a*b*c & n $$\neq$$ {a*b & n [X^1] ... [X^1] a*b & n} (b copies of a*b & n)

If they're equal, then a*b*c is just c a*b rectangles where they're appended to each other in domino-style, without forming a box.

Let A = a1*a2*...*am

Then:

A*k & n = {A & n [X^m] ... [X^m] A & n} (k copies of A & n)

It's also legal to replace A*k with A+A+A...A+A+A (k copies of A.)

And A^k with A*A*A...A*A*A (k copies of A.)

At this point, we can define factorial arrays for decimal number m:

m! & n = m*(m-1)*(m-2)*...*4*3*2 & n

Mix
Now, we come to the hardest part.

What we need here is to specify rules which tells what to do with A = (a1,1+a1,2+...+a1,m)*(a2,1+a2,2+...+a2,m)*...*(ap,1+ap,2+...+ap,m), where each ai,j can expressed in the same form as A, but possibly with other p and m (by the analogy with Cantor's normal form for ordinals below $$\varepsilon_0$$.) I'll call this form - multiadd form.

What at least (2+1)*2 & 3 might be? Well, let's invent rules, based on a*2 & n = a & n (1) a & n.

Let:

(a+1)*2 & 3 = a+1 & 3 [X^1] a+1 & 3

(a+b)*2 & 3 = a+b & 3 [X^1] a+b & 3

(a+b+c)*2 & 3 = a+b+c & 3 [X^1] a+b+c & 3

Let B = a1+a2+...+am

B*2 & 3 = B & 3 [X^1] B & 3

B*3 & 3 = B & 3 [X^1] B & 3 [X^1] B & 3

B*4 & 3 = B & 3 [X^1] B & 3 [X^1] B & 3 [X^1] B & 3

B*b & 3 = B & 3 [X^1] ... [X^1] B & 3 (b copies of B & 3)

Now we need to specify what to do if the second multiplicand isn't just a decimal number. Let's observe the fact that a+b & n = a & n [X^1] b & n and extrapolate, replacing [X^1] separator by [X^2] (as you may note, adding each * increases number of dimensions):

B*(b+c) & n = B*b & n [X^2] B*c & n

B*(b+c+d) & n = B*b & n [X^2] B*c & n [X^2] B*d & n

B*(a1+a2+...+am) & n = B*a1 & n [X^2] B*a2 & n [X^2] ... [X^2] B*am

Let Bi = a1,i+a2,i+...+am,i

And C = B1*B2*...*Bp

C*(a1,i+a2,i+...+ak,i) & n = C*a1,i & n [X^(p+1)] C*a2,i & n [X^(p+1)] ... [X^(p+1)] C*ak,i & n

Are we done? Still, no. We should consider the fact that ai,j can itself be complex expression. For example, as in (((2+1)*2+1)*2+1)*2 & 3. We can't handle it as (a+1)*2 & 3, because then it would be even weaker than 2*2*2*2 & 3. It seems that the total number of *'s is important, so we probably want to define that (it's wrong in many cases, see later why):

C*(a1,i+a2,i+...+ak,i) & n = C*a1,i & n [X^p] C*a2,i & n [X^p] ... [X^p] C*ak,i & n

Where p is the number of * signs before (a1,i+a2,i+...+ak,i). However, consider 2*2*4 & 3 and 2*2+2*2+2*2+2*2 & 3. They're supposed to be equal, according by what I specified in multiplication section, but different by the rule above.

I don't know how to avoid this problem right now. Let's consider it as open problem.

Levels
You can note that we can create here the same which Chris Bird did in his Nested Array Notation. We compute level of the expression A as follows:


 * 1) Set level at�1. B := A. Go to step 2.
 * 2) Represent B in multiadd form. Go to step 3.
 * 3) Represent each ai,j in multiadd form. Go to step 4.
 * 4) If each ai,j is in decimal form, then we are done. Otherwise, take B = ai,j and do step 2.

For example:

(2+2)*(2+2)*(2+2) & 3 has level 1.

((2+2)*(2+2)*(2+2)+2)*((2+2)*(2+2)*(2+2)+2) has level 2

(((2+1)*2+1)*2+1)*2+1 has level 3.

((((2+1)*2+1)*2+1)*2+1)*2+1 has level 4.

That might help with determining which separator should be used.