#Beat nested arrays

People would weep, if Btrix is too slow to catch up with Bird's arrays. So they will leap for joy, when she engages his Beaf in deep nested hyperspace.

# Entry in hyperspace

With the next nested entry `,[,1]` in Btrix, we take our first steps on the extra-dimensional level, also known as hyperspace. The numbers expressed here are comparable to Eaf wrapping up his row of last chapter with its `,` separator.
On the left Btrix resolves multidimensional subexpressions to increment right entries, append rows, planes and multidimensional blocks, in order to get at the nested entries in her separator array.

• a,b1,[,1]1 = a,a,[b]1 = a,a.,[b-]..1 :a ≈> Eaf(.a,..a) :b1 = Eaf(a,b2,2)
• a,b1,[,1]2 = a,a,[b]2 == a,(a,a,[b]1),[b]1 ≈> Eaf(a,(a,b2,2),2) ~> Eaf(b1,3,2,2)
• a,b1,[,1]c ~> Eaf(b1,c1,2,2)
• a,b1,[,1],1 = a,a,[,1]b ~> Eaf(b,2,3,2)
• a,b,[,1],2 = a,(a,b,[,1],1),[,1],1 ~ Eaf(b,3,3,2)
• a,b,[,1],,1 = a,a,[,1],b- ~ Eaf(b,2,4,2)
• a,b,[,1],1 Eaf(a,2,b2,2) ~ Eaf(b1,2,2,2,2)
• a,b,[,1],,1 ~> Eaf(b,2,2,3,2)
• a,b,[,1],1 ~> Eaf(b,2,2,1,2,2)
• a,b,[,1]Dim ~ Eaf(Row,2)

A lot `Dim` of dimensions fly over the Btrix bridge to add `1` yota to the plane of Eaf.
The big question is whether Btrix stays (on account of motor `3.` which just adds) structurally slower than Eaf. If she has to nest a hyper-array to approach the next linear array of Eaf, she might never catch up. But now we will show she is not that bad.

• a,b,[,1],[,1]c ~> Eaf(b,c1,2,3)
• a,b,[1,1]1 = a,a.,[,1]..1 :b ≈> Eaf(a,a,b1)
• a,b,[1,1]c ~> Eaf(b,c1,2,1,2)
• a,b,[1,1]Dim ~ Eaf(Row,1,2)
• a,b,[1,1],[,1]c ~> Eaf(b,c1,2,2,2)
• a,b,[1,1],[1,1]c ~> Eaf(b,c1,2,1,3)
• a,b,[2,1]c ~> Eaf(b,c1,2,1,1,2)
• a,b,[2,1],[2,1]c ~> Eaf(b,c1,2,1,1,3)
• a,b.,[e,1]..c :d ~> Eaf(b,c1,2,.1,..,d1) :e

That first hyper-entry `e` of Btrix approaches the second row of Eaf in size. But it is in the same place as the multidimensional index, that matched the first `Row` of Eaf. So the 2nd hyper-entry in Btrix (which counts iterations over the 1st) is equivalent to the number of rows on Eaf's plane.

• a,b1,[,2]1 = a,a,[b,1]1 ≈> Eaf(a,b,1,2)
• a,b,[,2]c ~> Eaf(b,c1,2,1,2)
• a,b,[,2],[,2]1 ≈> Eaf(a,b,1,3)
• a,b,[1,2]c ~> Eaf(b,c1,2,1,1,2)
• a,b,[1,2],[1,2]c ~> Eaf(b,c1,2,1,1,3)
• a,b,[2,2]c ~> Eaf(b,c1,2,1,1,1,2)
• a,b,[e,2]c ~> Eaf(b,c1,2,1,.1,..2) :e
• a,b.,[e,f]..c :d ~> Eaf(b,c1,2.,1..,1..d) :f :e
• a1,b2,[,,1]1 = a1,a1,[a,b]1 ≈> Eaf(a,b1,2)

In our Btrix matrix the next hyperspace entry is nested, while Bird's Beaf fills a plane of rows to its `,` rim. Rules for Eaf and Beaf were listed in last chapter, rules for Btrix follow.

# The hyper-row

Btrix usurps a hyper-row – the structure called hyper-dimensional array by Chris Bird – to approach a multi-dimensional array structure as expressed in Bowers & Bird's Beaf.

The motor rule of Bowers (substituting the `b` predecessor expression for `b1`) dominates the results at this stage. But how do the other rules compare to Bird's hyperdimensional arrays?
Like Bowers, Bird employs a double system with arrays `a<X>b` in Angle brackets as intermediaries for the Main level reductions of Beaf. We have to sober up – there's a lot of redundancy in Bird's system. We brought his back to an Eaf system, where only those methods effective in creating Bigger numbers are kept.
Apart from motor rule `3.` the Btrix algorithm will resemble Eaf. The theory is easy – in Eaf and Btrix we assume the upsize of subordinate structures to trickle down anyway. First by `a` (after the top structure is expanded by `b`), but later these lower structures will be upsized from significantly larger baskets `b` than before, so there is no loss.

List the rules of the Btrix system up to linear hyperdimensions. Here an array wildcard `S` (and likewise `T` partial arrays) stands for a nested ```sj,.. :m``` row of entries.
The removal of trailing separators by rule `8.` is optional (leaving them is not significant, because any next size expansions by `b'` are accumulatively Bigger). In case rule `6.` doesn't find the dimension counter up-front (because there's a comma instead), the new rule `5.4` uploads the value from basket `b` to the right free nested entry. Later it will appear that this is just the nested version of ground level rule `5.3` and that both blend together in rule `5.6` for nested separators to arbitrary depth.

• 1.4 a,b.,[Si].. :k = a,b = b (choice)
• 2.3 a,Y,[s]{k1} = a,Y]{k} (outer drop)
• 3.2 a,b,1Z = a,ab,Z (motor)
• 4.3 a,.,[Si]..1Z :k≥1 = a,a.,[Si]..Z :k (fill)
• 5.3 a,b1.,[Si]..,1Z :k≥1 = a,.,[Si]..1b,Z :k = a,a.,[Si]..b,Z :k (main upload)
• 5.4 a,b1\$,[,{m1}1T]1Z where \$ ≡ ,[Si].. :k≥0 = a,a\$,[,{m}b,T]1Z (hyper-row upload)
• 6.3 a,b\$,[1T]1Z where \$ ≡ ,[Si].. :k≥0 = a,a\$.,[T]..1,[1T]Z :b (main upsize)
• 7.1 ,[] ≡ ,
• 8.1 ,[S],[T] {S<T} ≡ ,[T] (weighted drop)

In rules like `5.4` (upload into nests) it is convenient to refill the empty basket `b` at once.
The stricter fill by rule `4.` results in larger numbers (decrementing `1Z` at ground level instead of uploading `b1` to `b` in the nest). But we'd run into notational problems for expressions `a,a,[,{m}b,T]z` when `m>z` and the nested array is uploaded until it has to drop off while `z` is counted down. Even though the usual reduction train `z` is last uploaded by rule `5.3` and very much Bigger than `m` when hyper-upload rule `5.4` kicks in, a lot of nested expressions would go unaccounted for – all in vain!
We want to make sure all sound-looking expressions are valid.
We will forget rule `4.` in future definitions of Btrix, and let rules `5.` handle the refill (of apple `a` in basket `b`) directly.

Because she is such a slow starter, hyperdimensional arrays in Btrix have structurally smaller results than the same arrays in Eaf. Fathom the effect of expanding arrays in both systems.

• a,a,[,,1]Row ≡ a,b,[,,1],1 ≈> Eaf(a,a,b,2)
• a,a,[,,1]Dim ≡ a,b,[,,1],[,1]1 ≈> Eaf(Row,2) ≡ Eaf(a,b,2,2)
• a,b,[,,1],[1,1]1 ≈> Eaf(a,b,1,2,2)
• a,b,[,,1],[2,1]1 ≈> Eaf(a,b,1,1,2,2)
• a,b,[,,1],[,2]1 ≈> Eaf(a,b,Row,2) ≡ Eaf(a,b,1,2,2)
• a,b,[,,1],[,,1]1 ≈> Beaf(a,b,3) ≈> Eaf(a,b,3)

The values of ground level vars `a` and `b` don't matter anymore. The comparison is primarily about the structure and values of the separator arrays here. Notice that repetition of the highest separator in Btrix compares to incrementation of the rightmost entry in Eaf.

• a,b,[1,,1]1 = a,a.,[,,1]..1 :b ≈> Eaf(a,b,1,2)
• a,b,[1,,1],[1,,1]1 Eaf(a,b,1,3)
• a,b,[2,,1]1 Eaf(a,b,1,1,2)
• a,b,[,1,1]1 = a,a,[b-,,1]1 Eaf(a,b,1,2)
• a,b,[1,1,1]1 Eaf(a,b,1,1,2)
• a,b,[,2,1]1 Eaf(a,b,1,1,2)
• a,b,[,,2]1 Eaf(a,b,1,2)
• a,b,[,,,1]1 Eaf(a,b,2)
• a,a,[Row]1 ≡ a,a,[,{b}1]1 = a,b,[,1]1 ≈> Eaf(Dim) ≡ Eaf(a,a,[b]2) Beaf(a,b,[1,2]2)

Slow working Btrix requires a full `Row` row of separator index entries (nested at level `1`), while Eaf fills up `Dim` multiple dimensions (still at level `0`).
In the next section the structures `Row` and `Dim` of both nested systems appear to alternate.

Calculate norms in Nix for the separators of the first hyper-entry. Continue from the norm `n^^2` for multiple dimensions. Note that star `*` operators resolve by minority precedence: smaller first.

```,[1,1] ≅ n^n*n = n**n1
,[,2] ≅ n^n*n^n = n**n*2
,[,3] ≅ ,[,2]*n^n ≅ n**n*3
,[,,1] ≅ n**n**2
,[,1,1] ≅ n**n*n1```

Follow the norms `Ñ` for separators of the Btrix hyper-row from this section.
When convenient mix stars with up-arrows `^` which have higher & majority precedence.

```,[,,2] ≅ ,[,,1]*n^n^2 ≅ n**n*n*2
,[,,,1] ≅ n**n**3
,[,,,2] ≅ ,[,,,1]*n^n^3 ≅ n**n*n*n*2
,[,,,,1] ≅ n**n**4
,[,1] ≅ n***3```

Our Nix collapse of the hyper-row puts a power `n***2+**n` on top of the norm for multiple dimensions. Similarly, the hyperdimensional row in Bird's classification of separator spaces has level `ω^ω` which is a power `ω` above his class `ω` for multidimensional Beaf arrays.

# Dimensional separators

Define special rules for the level of nested `,[,[n]]` multiple dimensions in Btrix. There is no other place to go – we have to find room inside her separator subarrays.

• let \$ ≡ ,[Si].. :k \$' ≡ ,[si].. :m
• 5.5 a,b1\$,[\$',1T]1Z (hyperdim upload) = a,a\$,[\$'b,T]1Z
• 6.4 a,b\$,[\$',[1t]1T]1Z (hyperdim upsize) = a,a\$,[\$'.,[t]..1,[1t]T]1Z :b>0

These rules will be wrapped up with earlier versions, in the section on general nested separators.
Continue our comparisons from the last equation, where the hyper-row size of Btrix rivalled the number of dimensions in Eaf.

• a,a,[,1]Row Eaf(a,a,Var,[1,2]2)
• a,a,[,1]Dim ≡ a,b,[,1],[,1]1 Eaf(Row,[1,2]2) ≡ Eaf(a,b,2,[1,2]2)
• a,b,[,1],[,,1]1 Eaf(a,b,2,[1,2]2)
• a,a,[,1],[Row]1 ≡ a,b,[,1],[,1]1 Eaf(Dim,[1,2]2) ≡ Eaf(a,b,[1,2]3)
• a,b,[1,1]1 Eaf(a,b,[1,2]1,2)
• a,b,[,1,1]1 Eaf(a,b,[1,2]1,2)
• a,b,[,,1,1]1 Eaf(a,b,[1,2]1,2)
• a,a,[Row,1]1 ≡ a,b,[,2]1 Eaf(a,a,[1,2]Dim) ≡ Eaf(a,b,[1,2]1,[1,2]2)

Again Btrix hyper-row and Eaf dimensions are comparable. Disparate structures that live on different levels? Or can we already see the two systems coming together?

• a,b,[,2],[,2]1 Eaf(a,b,[1,2]1,[1,2]3)
• a,b,[1,2]1 Eaf(a,b,[1,2]1,[1,2]1,2)
• a,b,[,1,2]1 Eaf(a,b,[1,2]1,[1,2]1,2)
• a,b,[,3]1 Eaf(a,b,[1,2]1,[1,2]1,[1,2]2)
• a,b,[,,1]1 Eaf(a,b,[2,2]2)
• a,b,[,,2]1 Eaf(a,b,[2,2]1,[2,2]2)
• a,b,[,,,1]1 Eaf(a,b,[3,2]2)
• a,b,[,,1]1 Eaf(a,b,[1,3]2)

Notice the symmetry – fed back from the end of the hyper-row – repeating the dominant nested separator in Btrix compares to incrementing the right nested array entry in Eaf.

• a,b,[,1]1 Eaf(a,b,[1,1,2]2)
• a,b,[,,1]1 Eaf(a,b,[1,1,2]1,[1,2]2)
• a,b,[,,1]1 Eaf(a,b,[1,2,2]2)
• a,b,[,,1]1 Eaf(a,b,[1,1,3]2)
• a,b,[,1]1 Eaf(a,b,[1,1,1,2]2)
• a,a,[Dim]1 ≡ a,b,[,[,1]1]1 Eaf(a,a,[Row]2) ≡ Eaf(a,b,[1,2]2)

A multidimensional matrix `Dim` nested (end level `1`) in Btrix equals a subarray `Row` nested (middle level `1`) in Eaf. This reminds us how dimensional Btrix matched the Eaf linear array (both at ground level `0`). Is our matrix system catching up?

Continue our Nix classification of structures, from norm `n^^3` of the hyper-row. We found that moving a dominant first level nested entry `1` to a value of `2` is squaring the norm.

```,[,2] ≅ (n^^3)^2 = n^(n^n*2)
,[,,1] ≅ n^n^n1
,[,,2] ≅ n^(n^n1*2)
,[,,,1] ≅ n^n^n2
,[,,1] ≅ n^n^(n*2)```

We represent expressions of Btrix by their dominant separator on the left. For suppose `n` is a Big number that upsizes the highest structure, its substructures will later be upsized `ñ` Big. In this Btrix compares to Beaf array structures, exploded to a fixed size `n` on all levels at once. And then, if we let their separators drop by Nix, the norms `Ñ` on the right count up all entries `ñ` left.

```,[,1] ≅ n**n**n**2
,[,,1] ≅ n**n**n*n1
,[,,1] ≅ n**n**n*n*2
,[,1] ≅ n**n**n**3
,[,[,1]1] ≅ n***4```

Our norm for separator dimensions appends a power `,[,1]+**n` on top of the hyper-row norm. Similarly, in Bird's classification he would now reach level `ω^ω^ω` above his `ω^ω` hyper.

# Twice nested row

Take our comparison down to a deeper nested (level `2`) separator array. Refer to the general definition of Btrix and Eaf (for Bird's Beaf) for nesting depth in the next section.

Effectively we come to nest a preceding expression in Btrix in the same basket `b` as in Eaf, but the countdown occurs on the right in Btrix, not on the left as in Eaf.
Therefore appending the next structure (eventually a new `Dim` on the right) to a Btrix expression, is comparable to building from the start (a new `Row` on the left) inside Eaf.

• a,a,[,[,1]1]Dim ~ Eaf(Row,[1,2]2)
• a,a,[Row,[,1]1]1 Eaf(a,a,[1,2]Dim)
• a,a,[Dim,[,1]1]1 ≡ a,b,[,[,1]2]1 Eaf(a,a,[1,2]1,[Row]2) ≡ Eaf(a,b,[1,2]1,[1,2]2)
• a,a,[,[,1],1]1 Eaf(a,b,[2,2]2)
• a,b,[,[,1],,1]1 Eaf(a,b,[3,2]2)
• a,b,[,[,1],1]1 Eaf(a,b,[1,2,2]2)
• a,b,[,[,1],1]1 Eaf(a,b,[1,1,2,2]2)
• a,a,[,[,1]Dim]1 ≡ a,b,[,[,1],[,1]1]1 Eaf(a,a,[Row,2]2) ≡ Eaf(a,b,[1,3]2)

Again Btrix hyper-dimensions and an Eaf hyper-row are similar in a similar position.
Again the symmetry, that repeating the dominant separator in Btrix (at a certain level of nesting), compares to rightmost incrementation (at the same level) in Eaf. Vise versa, when the dominant separator is repeated in Eaf, the (dominant) rightmost entry nested at the next (deeper) level in Btrix is incremented, as appears below.

The two systems show enough overlap to suggest they will soon merge together.

• a,a,[,[1,1]Dim]1 Eaf(a,a,[Row,1,2]2)
• a,b,[,[2,1],[,1]1]1 Eaf(a,b,[1,2,1,2]2)
• a,b,[,[3,1]1]1 Eaf(a,b,[1,1,1,1,2]2)
• a,b,[,[,2]1]1 Eaf(a,b,[1,1,2]2)
• a,b,[,[,,1]1]1 Eaf(a,b,[1,2]2)
• a,a,[,[Row]1]1 ≡ a,b,[,[,1]1]1 Eaf(a,a,[Dim]2) ≡ Eaf(a,b,[1,[1,2]2]2)

A linear sub-subarray `Row` (middle level `2`) in Btrix equals a sub-dimensional array `Dim` (ends level `1`) in Eaf. The stand-off was similar at the end of the hyper-row section (one level ago).
Because the Dim-Row alternation is as fast (over the first two levels) as the Row-Dim alternation, further nesting won't change their structural distance. This proves that Btrix and Beaf run on a par over depth levels of nested separator arrays.

Continue our classification of structures from the norm `n^^4` of first nested dimensional arrays.

```,[,[,1]2] ≅ ,[,[,1]1]^2 ≅ n^(n^^3*2)
,[,[,1],1] ≅ ,[,[,1]1]^n ≅ n^(n^^3*n)
,[,[,1],1] ≅ ,[,[,1]1]^n^n ≅ n^n^(n^n+n)
,[,[,1],1] ≅ ,[,[,1]1]^n^n^2 ≅ n^n^(n^n+n^2)
,[,[,1],[,1]1] ≅ ,[,[,1]1]^n^^3 ≅ n^n^(n^n*2)```

The added dimensional array ends the first batch. Now the second batch of this section. We use postponed operators, with `++` to add to the top exponent of a power tower.

```,[,[1,1]1] ≅ n**n**n**n1 = n***4++1
,[,[,2]1] ≅ n***4+*2
,[,[,,1]1] ≅ n***4+**2
,[,[,,,1]1] ≅ n***4+**3
,[,[,1]1] ≅ n***5```

We've extrapolated the last normations for the twice nested row from the previous level of the single nested hyper-row we've calculated at ~2 before. The newly nested row appends a power `,[,1]+**n` to our norm tower, while Bird reaches his `ω^^4` class.

Further extrapolation to any nesting depth is easy enough. We quickly look up norms Ñ at comparable preceding separators. Cross level patterns emerge…

```,[,[,1]2] ≅ (n^n^n^n^n)^2
,[,[,2]1] ≅ n^n^(n^n^n)^2
,[,[,1]1] ≅ n^n^n^n^n^2
,[,[,[,1]1]1] ≅ n^^6
,[] ≡ ,.[,..1] :n: ≅ n^^(n*2) ≈ ñ****2```

That last line gives an approximate norm `ñ^^ñ` for nesting depth. Bird did put his general nested arrays precisely at level `ε1` `= ω^^(ω*2)` in Bird I (March 2012, page 4), but later classifies them at the same level `ε0` `= ω^^ω` as we do here (see any Bird II, p1).
At this point in our algorithms, the difference between row and dimensional arrays blurs.

# Nesting depth

Separators can be nested to arbitrary depth in Btrix, with the general rules `5.` (value upload) and `6.` (structural upsize), to incorporate any previously defined nest level (main and nested).
This whole structure of nested array levels defines the first nesting or single deep.

• let \$j ,[Si,j].. :rj0 {0≤j<n} (`S` depth index `j` init `0` to `n-` for `:n>0`)
• 5.6 a,b1.\$j,[..\$n,1Tn..]1Tj :n: (nestable upload `b`) = a,a.\$j,[..\$nb,Tn..]1Tj :n:
• 6.5 a,b.\$j,[..1..Tj]1.Z :n1: (nestable upsize `,[Tn]` by `b`) = a,a.\$j,[..\$n.,[Tn]..1,[1Tn]..Tj]1.Z :n :b>0 n:

We operate at deeper levels by diving down the cascade of arrays of leftmost active separators. Separator arrays can be declared active in a rule, when directly followed `,[X]1t` by a number entry on the right. At each nesting level along the cascade active separators are required, but only at the deepest level we count off the `1t` (this is across levels in Btrix always the leftmost).
Aside from the deepest active comma, deeper nested arrays may hide within inactive separators on the left (until reactivated), and in separators reached later on the right.

• a,a,[,[Dim]1]1 ≡ a,b,[,[,[,1]1]1]1 Eaf(a,a,[1,[Row]2]2) ≡ Eaf(a,b,[1,[1,2]2]2)
• a,a,[,[,[Row]1]1]1 Eaf(a,a,[1,[Dim]2]2)

The general comparison formula for deep nested Btrix and Eaf.
Apply evaluations `,≡,[]` and `,≡,` to nest a level deeper (to `:n2:` after Dim cases).

• a,a.,[..Dim..]1 :n: ≡ a,b.,[..,1..]1 :n1: Eaf(a,a.1,[..Row..]2.) :n:Eaf(a,b.,[1..1..]2.) :n1:
• a,a.,[..Row..]1 :n1: ≡ a,b.,[..1..]1 :n2: Eaf(a,a.1,[..Dim..]2.) :n:Eaf(a,b.,[1..,2..]2.) :n1:

We have reached the point where separator nesting depth `n` can be expressed directly with a new depth index. Here Btrix and Beaf fall together – for the same Big nesting depth in both systems the resulting Big numbers can be considered approximately equal.

Where to attach any next deeps? After the subarray's opening bracket, and/or after or before its closing bracket? Or perhaps assign all to the separator comma in name?
Repetition of brackets may lead to a similar situation we had before, when we could have created a dimensional array with multiple commas `,.. :m` but instead expressed it with a single entry subarray `,m]` or `,[m]`. A plane has room for `n` series of multiple commas, instead we wrote `,[m,n]` on the line. Soon to find out this notation was more economical.

Although Jonathan Bowers invented the nested array structures (see his legions arrays) as part of his Beaf, they were first defined properly in Chris Bird's nested array article.
Multidimensional arrays live at ground level, Bird's hyperdimensional arrays open up the `1`st level, and general nested arrays exist at the `j`th level of nesting.
We owe you the rules for nested arrays in Eaf, whose growth rate is everywhere comparable to Bird's Beaf nested arrays (as argued in _2 before).

1. use \$j ,[1Si,j]1.. :rj≥0
2. Eaf(a,b,1,2Z) = Eaf(a,a,b,1Z) &' Eaf(a,b.\$j,[1..]2Zj.) :m1: = Eaf(a,a.\$j,[1..\$mb,1Zm..]2Zj.) :m:
3. Eaf(a,b1.\$j,[1..1X..]2Zj.) :m1: = Eaf(a,a.\$j,[1..\$m.,[1X]1..1,[2X]1Zm..]2Zj.) :m :b m:

The comma `,≡,` matches in the expression of rule `4'` as its deepest separator.
Rule `4'` can be seen as an initial case of rule `6` where `X≡-` collapses `,[]` to voids.

The fact that Beaf nests a complete predecessor expression in a common evaluation step, whereas Btrix motor rule just applies addition, has finally lost its importance.
Can you guess why a rule for unlimited nesting of arrays (within an entry) and a system to nest an array within a separator [to a deeper level] have the same algorithmic strength? Take into account that an array can contain an unlimited series of separators!

While Bird soon represents his `[..]` `:k:` superseparator brackets by a new `\k` sign, we will increase the expressiveness of our brackets, to try to make the most of what we have.

by Giga Gerard mathematical artist ↑

People can read this article plain or choose the `hard` & fast & open version.