SCALARS AND DIMENSIONALITY APL is A Programming Language conceived by Kenneth Iverson in the 1960's at the IBM Watson Research Center in Yorktown Heights, NY. APL was written to allow designers of the new IBM 360 super computer of the time to express on paper the algorithms implemented in the hardware that made up the computer. They essentially wrote the computer in APL, before implementing it in hardware. In that sense APL was a hardware programming language, however they found once the 360 was built, that the language used to design it was optimum for use on it in many other areas of application. Like many programming languages APL deals with numbers and computations. It has two rather unique qualities, the first is that rather than use names for various functions like log and sine, it uses single characters, and thus needs a special keyboard to enter the special symbols. If you have ever seen an APL keyboard, you will probably remember wondering what the hell that was. Second, because it has so many fundamental operators like log and sine, there is no order of precedence in evaluating expressions. In most languages 3 x 2 - 1 would be (3 x 2) - 1 or 5. In APL, everything is evaluated from right to left unless there are parenthesis, so 3 x 2 - 1 would be 3. One of the advantages of APL is that it is an interpreter, rather than a compiled language, so one is presented with an active workspace on the computer screen that accepts commands, executes them and remembers them in real time. A simple session might go as follows. Indented lines are typed by the user, unindented lines are typed by the computer. A VALUE ERROR A <- 3 A 3 A <- A + 2 A 5 The above session shows a number of important things. Before A has been assigned anything, it doesn't exist at all, it is a NOTHING per the opening definitions of a nothing, or a VALUE ERROR per APL. OPENING DEFINITIONS http://www.lightlink.com/theproof/cgi/show.cgi?lcc-open The opening definitions define the basic word matrix for the rest of the proof. The opening definition of a nothing is an object with an empty quality set, it is the object with no qualities. In APL, after A has been assigned the number 3 with A <- 3, A becomes a something, its quality set is no longer empty as it now contains the number 3. Once A has been assigned a number, it retains that number forever until it is changed again, for example, in the next line by adding 2 to it and reassigning it to the new number 5. The last line where A is typed alone on the line indicates a desire to see its value, and the number 5 is written. In fact any line, no matter how complex, that does not contain an assignment arrow <-, means that you want the final evaluation of that line printed out. Without the assignment <- however, the final result is not stored in any thing, and the value is lost as soon as it is printed. Better to store it in A first then print it out! The workspace can be saved at this point and reloaded later to find A still exists where one last set it. A can also be erased, returned to a value error. )ERASE A A VALUE ERROR The ) symbol at the beginning of a statement means the start of a system command rather than a mathematical expression. For example )SAVE will save the workspace for later retrieval, )LOAD will reload it back again, and )WSID will print the name of it. Numbers come in many forms in APL, they start with the simple numbers like 3 in the example above. In that case the 3 is a scalar, with zero dimensions as we shall see below. But A can also be assigned to a set of numbers like so: A <- 3 10 5 17 A 3 10 5 17 A + 1 4 11 6 18 In the above example 3 10 5 17 form a 4 element array called a vector. Vectors have one dimension, like points on a line, and can be as long as you like, that is have as many elements as you like including just 1 or even 0 elements! There are a number of operators that work with vectors to help you handle them. First the regular operators like plus and minus work as you would expect. A <- 2 4 6 8 A + 3 5 7 9 11 A + 3 is shorthand for A + 3 3 3 3 5 7 9 11 A + 1 2 3 4 3 6 9 12 A + 1 2 3 4 5 LENGTH ERROR The above shows that you can add a scalar to a vector in which case the scalar is added to each member of the vector, or you can add two vectors together, in which case each member is added to the same member in the other vector. But we can not add two vectors of different lengths, its meaningless. There are also more sophisticated operators that allow you to sum up the values of A A <- 1 2 3 4 +/A 10 The construct +/A means put the + between every member of the vector and the execute the whole line. A more interesting example is is x/A which puts a times between each member and multiplies them all up. A <- 1 2 3 4 x/A 24 Notice in APL times is x and not *. The * is exponentiation. THE RHO OPERATOR Now here is where you really need to start paying attention, for without this you won't ever be able to talk about the proof and scalars in any meaningful way. The first thing that needs to be understand is that APL works with operators and operands. Plus, times etc are operators, and numbers are operands. Operands can also be character strings like "HI THERE" but we won't be dealing with them for the moment. *ALL* operands are called arrays, and all arrays have a shape or a size. There is an operator that allows you to determine the shape and size of any array, be they scalars, vectors, matrices, cubes or hyper cubes etc. It is written and called after the greek letter RHO, in this paper we will use the small letter p to represent the RHO operator, as that is the closest to what a RHO really looks like. Its called RHO after RESHAPE which is what it does. All operators can be used either monadically or dyadically. Monadic use means the operator is on the left and the operand is on the right. For example -3 is an example of a monadic use of the minus sign. Dyadic use means the operator has operands on both the left and the right. For example 2 - 3 is an example of a dyadic use of the minus sign. Sometimes the monadic and dyadic use of an operator are very similar, sometimes they are very different, but usually related in some way. For example monadically *2 means E*2 where E is 2.714281428. Dyadically 4*2 means 4 squared. RHO also has two uses, depending on whether it is used with one argument or two. With one argument, RHO returns the shape or size of A. Shape and size have identical meanings so from now on we will call it shape. A <- 1 2 3 4 5 6 pA 6 This says that A has one dimension with 6 elements in it. That's like a one dimensional line 6 inches long. You know there is only one dimension because only one number was printed out, so A is a vector with 1 dimension. You know that 1 dimension has an extension of 6 6 elements because its right there in the answer. Every dimension has an extension in that dimension even if it is zero extension. A line that is zero inches long is still a line and still has one extension which equals zero. An extension of zero does not mean there is NO extension at all! The extension is still there even if it is zero in length. So when you see 6 = pA, you know that A is one dimensional with an extension of 6 inches, elements, numbers or whatever. When used with two arguments as in B p A, RHO reshapes A after the value of B. RHO will fill out the answer with as many numbers taken from the right side as is necessary to accomodate the left side operand. 5 p 1 1 1 1 1 1 6 p 1 2 3 1 2 3 1 2 3 4 p 1 2 3 4 5 6 1 2 3 4 Now the above notation opens a serious question, which is what is the value of: 0 p 1 2 3 4 Well we know that the left hand side tells you two things, how many dimensions and how many elements in that dimension. So because there is just one number on the left, the answer must be a one dimensional vector, but it has ZERO elements! To make it more concrete let's use A again. A <- 0 p 6 pA 0 A <- blank line Since A has no elements in it, when you ask for APL to print it out, it just prints an empty line. Notice this is not the same thing as a VALUE ERROR. Just because A is an empty vector, doesn't mean it is a nothing. Its a 'something' with one dimension, and one extension that is zero long. Now of course in the real world, and object that was one dimension but zero inches long, would be a material nothing, but we have to be really careful here, because having one dimension, even if its zero extension, makes it a something in our language, not a nothing. It has quality, namely shape, even if it has no material existence, thus it can't be considered a true nothing which has no qualities at all. Shape means dimension with extension. In this case having zero extension doesn't mean having no shape, thus it isn't a complete nothing as it still has shape 1 dimension with zero extension. One more thing to notice before we move on, it clearly doesn't matter WHAT is to the right of the RHO if the left is 0, because RHO is going to take zero elements from the set on the right, and that's zero elements regardless of what is on the right. So the following are all the same 1 dimensional, 0 element vector: 0 p 1 0 p 2 3 0 p 1 2 3 4 5 6 0 p 0 In fact when someone wants to create an empty vector they often just use A <- 0 p 0 pA 0 A blank line Now you might ask why would anyone want to create an empty vector? Well it creates a place holder so that you can then concatenate things on to it as you collect them. For example: A <- 0 p 0 pA 0 A blank line A <- A, 3 pA 1 A 3 A <- A, 4 pA 2 A 3 4 A <- A, 2 4 6 pA 5 A 3 4 2 4 6 A <- A, 3 p 7 7 9 8 7 pA 8 A 3 4 2 4 6 7 7 9 Remember APL evaluates from right to left with no precedence, so 3 p 7 7 9 8 7 is 7 7 9 which is then concatenated onto what A already was. Suppose you tried to concatenate onto B without first setting B to the empty vector. B VALUE ERROR B <- B, 3 VALUE ERROR B isn't defined at all, its a true nothing, so you can't add something to it. Say you want to create a two dimensional matrix that is 3 by 4 filled with 1 2 3 4 5. A <- 3 4 p 1 2 3 4 5 pA 3 4 A 1 2 3 4 5 1 2 3 4 5 1 2 You see, 3 rows, 4 columns filled with 1 2 3 4 5 repeated as many as necessary to fill it up. Say you want to create a cube of 3 by 3 by 2 filled with the numbers from 0 to 17. A <- 3 3 2 p 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 pA 3 3 2 A 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 APL can't print out a cube, so it prints out 3 faces of 3 by 2 each. So you can see the power of RHO. Now let's take a look at the consequences. First let's review what RHO does. Used with two arguments it creates an object from data on the right with shape specified on the left. A <- SHAPE p DATA A <- 2 3 4 p 3 That's a 2x3x4 cube filled with 3's. Used with one argument, RHO returns the shape of the object that was used to create it. SHAPE-OF-DATA = p DATA A <- 2 3 4 p 3 pA 2 3 4 So this is our first theorem of importance. SHAPE = p (SHAPE p DATA) B = p (B p A) Now here is the next question. What is the shape of the answer that RHO returns? In other words what is the shape of the shape of data? In the example above pA returned 2 3 4. What is shape of 2 3 4? Well its 3. So we have A <- 3 4 p 1 A 1 1 1 1 1 1 1 1 1 1 1 1 pA This is the SHAPE of A, its extensions in each dimension. 3 4 ppA This is the RANK of A, its number of dimensions. 2 pppA This is always 1. 1 Clearly A is a 3 x 4 matrix of 1's. So the shape of A is {3,4}. We put the {}'s around the shape of an object to signify that it is the shape we are talking about. APL itself doesn't do this. And the shape of 3 4 is {2}, its a line with 2 elements right? And the shape of 2 is {1}, it too is a line with 1 element. Now here is where you ask, but 2 is a single number, why is it considered a vector of one element instead of a scalar? Simply because RHO is *DEFINED* to return a vector, it always returns a vector, it can't return any thing else but a vector. But it can return a one element vector or even an EMPTY vector. Say we define S to be a scalar, V to be a vector, M to be a matrix and C to be a cube. S <- 3 V <- 1 p 3 M <- 1 1 p 3 C <- 1 1 1 p 3 We have created four objects above. The first is a zero dimensional scalar whose value is 3. The second is a one dimensional vector whose value is 3. The third is a two dimensional matrix whose value is 3. The fourth is a three dimensional cube whose value is 3. S 3 V 3 M 3 C 3 So what is the difference? pS pV 1 pM 1 1 pC 1 1 1 The shape returns how many dimensions the object has, and each element in the shape tells you the number of elements along that dimension in the object. Take a 1 x 1 matrix, it is two dimensional, but has only one element. The shape of that one element is {1,1} which means a 1 by 1 or 1 x 1 matrix. Take a 1 x 1 x 1 cube, it is three dimensional, but also has only one element of shape {1,1,1} So you see that the number of elements that an object has is not related to how many dimensions that object can have. A vector, matrix or cube can have as many elements as you wish, including none! 0 0 0 p 9 is a zero element cube with shape {0,0,0} 0 0 p 9 is a zero element matrix with shape {0,0} 0 p 9 is a zero element vector with shape {0} Remember when 0's are on the left of RHO, it doesn't matter what is on the right. What happens when we try to make a zero element scalar? Notice we can write the above another way. (3 p 0) p 9 is a zero element cube with shape {0,0,0} (2 p 0) p 9 is a zero element matrix with shape {0,0} (1 p 0) p 9 is a zero element vector with shape {0} (0 p 0) p 9 is a ONE element scalar with shape {} Notice the first three lines are 0 element nothings with some shape, but the last line is a 1 element something with no shape whose value equals 9! So how do you make a zero element scalar? You can't. A scalar HAS TO HAVE ONE AND ONLY ONE ELEMENT. A zero element scalar is a VALUE ERROR. NUMBER OF ELEMENTS IN AN ARRAY. So let's talk about the vector and matrix and cube a bit more. How many elements total does an object have? Well if it is a 2 x 3 x 4 object, it has 24 elements, or 24 cubic units, or whatever your measure is. Since 2 3 4 is just the RHO of the object we can write that the number of elements in an object is A <- B p 1 N = x/pA = x/B Remember that x/B means to multiply all the elements of B together. If B is 2 3 4 then 2 x 3 x 4 is 24 elements total in a 2 by 3 by 4 matrix. Now let's get tricky. We know there are zero elements in a 0 element 1 dimensional vector. V = 0 p 6 (6 is irrelevant since only 0 are used. pV 0 x/pV = x/0 0 How many elements are there in a matrix with 0 rows and 4 columns. That's a 0 x 4 matrix. M <- 0 4 p 5 pM 0 4 x/pM = x/0 4 = 0 x 4 0 That's right, zero rows and 4 colums makes zero elements total. Kind of stupid eh? So is that a nothing? No, its not a value error, its a nothing with two dimensions and SHAPE, namely 0 rows and 4 columns, that surely is not a nothing. But it isn't a lot of something either. Say someone gave you a 2 x 2 x 2 piece of gold. That would be 8 cubic units of gold wouldn't it. That's a lot of gold. The product of the shape is the 'volume' of the item. G <- 2 2 2 p GOLD pG 2 2 2 x/pG 8 Volume is 8 cubic units of Gold. But now say someone gave you a 0 x 2 x 2 piece of gold. That's 2 units square on a side, but 0 zero units thick. How much gold would that be? Zero. Correct. G <- 0 2 2 p GOLD pG 0 2 2 x/pG 0 Volume is 0 cubic units of gold. Now let's say you are a two dimensional flatland creature, you have no idea about the 3rd dimension, and cubic units is meaningless to you, but square units means a lot. So the 'volume' of things is measured in square units rather than cubic units. Yes that's normally called 'area', but in APL its called volume anyhow which is DEFINED as the product of the shape. Say someone gives you a 2 x 2 piece of gold. How much gold is that? Well it's 2 square units of gold, which is quite a bit, right? G <- 2 2 p GOLD pG 2 2 x/pG 4 Volume is 4 square units of Gold. But say he gives you a 0 x 2 piece of gold. How much gold is that? G <- 0 2 p GOLD pG 0 2 x/pG 0 Volume is 0 square units of gold. It's zero square units, and that's no flatland gold at all! So what is the difference between a 0 x 2 x 2 piece of 3 dimenisonal gold and a 2 x 2 piece of 2 dimensional gold? The first is 0 cubic units of 3 dimensional gold which is no gold, and the second is 4 square units of 2 dimensional gold which is some gold! So we come to our next theorem which is really important, and you really have to get it, or you just won't get anything beyond this. If a physical object has a dimension, it must have non zero extension in that dimension to order to be a physical something. Anything with zero extension along any of its dimensions is a physical nothing with shape. So the minute you take a 2 x 2 piece of gold which is a something, and give it a 3rd dimension, you HAVE to give it non zero extension in that dimension or it will turn into 0 x 2 x 2 or no gold. So if the external physical universe consists of 9 dimensions, as the string theory boys claim, every one of them HAS to have non zero extension in them or else the entire universe would disappear into nothing. Yes APL allows for zero extension objects to exist, they are called nothings with shape, but ACTUAL hardball existence doesn't allow for nothings with shape. Ok so what about the scalar? Well the scalar is a rough case, because it doesn't have the option of being a nothing with shape, it has to be a something or a value error. You can only be a nothing with shape if you have shape! And having shape means having non zero dimensions. Since a scalar has zero dimensions, it has no shape at all. A scalar doesn't need to have non zero extension along all of its dimensions in order to be a something because it has ZERO dimensions and thus no extensions in which to have non zero extension. Further how do you create a scalar using RHO. Since its SHAPE is the empty vector, you have to use an empty vector to create it! Notice that 0p0 is an empty vector, remember if there is a 0 on the left, it doesn't matter what is on the right, 0p6 would have done just as well, its still 0 elements! A <- (0p0) p 4 A 4 pA <- empty vector, A's shape is zero dimensions ppA 0 <- indicates that pA has zero elements pppA 1 <- is always 1 no matter what Notice that the above does not make A empty, it makes A's SHAPE empty, which makes A a non empty scalar! So lets make a table out of this showing everything there is to know about scalars, vectors, matrixes cubes and hypercubes. Formally the correct way to create all these different kinds of arrays is as follows. Number of Length of each Dimensions Extension S <- (0 p 0) p 9 0 {} V <- (1 p 5) p 9 1 {5} M <- (2 p 4 5) p 9 2 {4,5} C <- (3 p 3 4 5) p 9 3 {3,4,5} H <- (4 p 2 3 4 5) p 9 4 {2,3,4,5} S 9 V 9 9 9 9 9 M 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 C 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 H Hey I will let you figure it out! H is a hypercube. Here is another formal table laying out the p, pp, and ppp of each of the above arrays. S V M C H p {} {5} {4 5} {3 4 5} {2 3 4 5} shape pp 0 1 2 3 4 rank ppp 1 1 1 1 1 always 1 The shape has one number for each dimension showing the extension in that dimension. Notice the shape of the scalar is empty {}. And the rank is how many dimensions an object has. Notice the rank of the scalar is 0 because there are 0 dimensions in the shape {}. Notice that the terms small and big refer to the size of the extension along any dimension. Since a scalar doesn't have any dimensions, it has no extensions, and thus the terms small and big do not apply to a scalar. Do not confuse having no dimensions with being small. Only a non zero dimensional object can be small or big. So what have we learned? An object can either be a scalar with zero dimensions or a non scalar with 1 or more dimensions, such as a vector, matrix or cube. If an object has one or more dimensions, it MUST have non zero extension in all those dimension in order to not be a physical nothing. If an object is a scalar, it doesn't have dimensions in which to have extensions, but exists anyhow with only one element. That one element however can be as long or as complex as you want. PI is a scalar, but is infinitely long and contains an infinite amount of data. One doesn't need dimension to encode data, the use of vectors, matrixes and cubes are merely a convenience. All of the data in the biggest multidimensional matrix you could concieve can all be placed into a single number in a single scalar. PHILOSOPHY Following our usual path, actuality is defined as what is true, and reality is defined as what we think is true, that is what is real to us. It used to be that the reality of people was that the world was flat, this did not in any way change the actuality, which was that the world was round. It is the purpose of inquiry to align reality with actuality. The ultimate question then is what is the nature of the AllThatIs. Is it a multidimensional object, or a zero dimensional object? What is the RANK of existence, how many dimensions does it have. Which is true? 0 = pp Actuality or 0 < pp Actuality ? It is an important question. From The Proof we have learned that one can not learn with certainty about anything across a non zero extension in a dimension. Where there is certainty, there is no extension and zero dimension between learner and learned about. So where there is perfect certainty, 0 = pp Actuality. This zero dimensional actuality however likes to project multi dimensional virtual realities, thus we have the following two equations that sum up existence. 0 = pp Actuality 0 != pp Reality Homer