"Understanding is the minimum expression of the maximum shared" (Jorge Wagensberg).
"Understanding is relating a reality to something more compact than itself and, in the limit, to its own essence" (Jorge Wagensberg).
"Science is the simplest and most compressed form of understanding reality" (Jorge Wagensberg).
The Compression
Finite mathematical objects can be represented extensively (by specifying them one at a time) or intensively (by specifying a pattern, shape, property, or algorithm). When the intensive representation of an object is shorter than the extensive one, we say that we have compressed or compacted them.
Infinite mathematical objects can only be represented intensively. If it is not possible to do so, then such objects are inexpressible with our linguistic resources.
This approach to compression is used by Gregory Chaitin [2002, 2005, 2006] to illustrate the limitations of mathematics:
If an object can be compressed, this is equivalent to saying that a theory, law or pattern has been discovered through which its representation is simplified. The theory makes it possible to understand better, that is to say, to shift consciousness towards the general. The simpler a theory is, the better it is, because it is better understood.
The problem of compressing a set of data is nowadays approached by a branch of mathematics called "Algorithmic Information Theory". The algorithmic information of a data set is the length of the program that generates it, independent of computational resources (memory and execution time), and is a measure of complexity. Different programming languages can result in different program lengths.
For example, π is a transcendent number, with infinite decimal places. However, it is compressible (representable) by a relatively simple algorithm.
There are mathematical objects that cannot be compressed. A finite random number is not compressible, because there is no law or pattern that expresses it more compactly than the extensive form. An infinite random number is incompressible, unrepresentable and inexpressible.
Chaitin [2005] gives an example of a non-compressible infinite mathematical object: a number he calls "omega" (Ω), which is the probability that a randomly chosen algorithm (among all possible algorithms) arrives at a final result. This is a perfectly defined number, but it is impossible to calculate it completely. This problem is analogous to the "halting problem" of a Turing machine: there is no meta-algorithm (an algorithm whose argument is an algorithm, which in turn has its own data) that determines whether such an algorithm will halt, i.e. reach a final result.
An algorithm, by definition, is "smart" if it is the shortest possible of all algorithms that produce the same result. It is impossible to prove that an algorithm is smart, because this problem is analogous also to the halting problem of a Turing machine.
The APL language
Kenneth Iverson created a compact mathematical notation for manipulating matrices to simplify the teaching of algebra to his students. This notation served him to create in 1962, together with Adin D. Falkoff, the programming language APL (the acronym for "A Programming Language"), an interactive language of high level of abstraction that offered a compact, simple and easy to learn notation, challenging the traditional mathematical notation, a notation oriented mainly for matrix manipulation (array-oriented language), which includes arithmetic and logical operations. For Iverson [1980], the notation was a "thinking tool".
The APL language served as an inspiration for other functional-type programming languages and for mathematical software in general. Iverson received the Turing Award in 1979 for his contributions to mathematical notation in programming languages.
The main features of APL are:
It is a functional language, but it also includes assignment, so it is not a pure functional language.
It is an interactive and usually interpreted language. It uses an environment or workspace, where programs and data are stored.
Use symbols, instead of keywords. Uses a character set not available on standard keyboards.
The basic data structure is the multidimensional array.
It is a high-level language independent of operating system and machine architecture.
It distinguishes between functions and operators. Functions are monadic or dyadic and use arrays as arguments (which can be variables or constants) and return arrays as results. Operators are higher-order functions, since their arguments are functions.
Most primitives are functions or operators. One important primitive is assignment, which is neither a function nor an operator.
An APL program is a chain of functions and operators acting on arrays.
Expressions are evaluated from right to left. There are no symbols to indicate precedence of functions or operators.
Allows nested arrays.
The advantages of APL are:
Programming is more productive than with conventional languages.
It is very efficient in the execution of matrix operations, even of high complexity (such as matrix inversion).
The user can manipulate data without the need to develop formal programs.
Examples:
n ← 4 5 6 7 (creation of a vector n with the specified values)
n+4 (add 4 to all values of n: 8 9 10 11)
+/n (sum all values of n: 38)
ί4 (values 1 to 4: 1 2 3 4)
3+ί4 (sum 3 to the previous values: 4 5 6 7)
+/(3+ί4) (sum of previous values: 22)
(ί is the Greek letter "iota")
The J language
In 1989, Kenneth Iverson, together with Roger Hui and Arthur Whiney, created a prototype of a new language that formed the germ of the J language, an enhancement of APL with some features of the functional languages FP (Function Programming) and FL (Function Level).
FP was created by John Backus (the creator of the Fortran language and the BNF notation for defining programming language grammars). Backus was inspired by APL to create FP. FL is the successor of FP and was created in 1989 by John Backus together with John Williams and Edward Wimmers. Most of the innovative ideas of these two languages were implemented in J.
The main features of J are:
It is an executable mathematical notation. In fact, Iverson has written a number of mathematical texts using J as notation.
It is a compact language. Mathematical problems requiring hundreds of lines in Basic or Pascal can be expressed in a few lines of J.
Like APL, it is an interactive, interpreted language.
Instead of special symbols it uses the standard ASCII character set along with two additional characters (the period and colon) to extend the symbol set and their corresponding meanings.
Like APL, it simplifies array manipulation.
All operations have the same priority.
Uses 3 types of data: numbers, literals and boxed. A box data is a data inside a box.
The only collection of data is the array, which can be of any dimension. For example, a number is an array of dimension zero, and a text is an array of dimension 1. It also supports sparse arrays, where values are stored referenced by their indices.
It has a semantic orientation close to natural language. Functions are called verbs. Constants are called nouns. Adverbs and conjunctions modify the actions of verbs. Verbs correspond to APL functions, and adverbs and conjunctions correspond to APL operators.
It is organized as a dictionary, with words or identifiers (nouns, verbs, adverbs, conjunctions, etc.).
It supports objects and classes, but they are not data types, but ways of naming expressions.
Unlike APL, it supports control structures such as "if-then-else" and "while".
Like FP/FL, it supports tacit programming at the functional level. In the definition of a function, the names of the parameters are not included, since they are tacit. And other functions are specified in the definition of a function. Tacit programming is also called "point-free style" or "pointless style", where the points refer to the parameters.
The following example calculates the average value of a series of numeric values:
mean =. +/ % #
mean 1 2 3 3 4 5
3
The tacit argument is a vector (one-dimensional array).
+/ indicates to add all the elements of the vector ("/" is an adverb).
indicates to find the average value.
Disadvantages of J:
It is necessary to learn many language resources: the identifiers or dictionary words, with their syntax and semantics.
The tacit programming (without argument names) makes the program code somewhat cryptic.
MENTAL and Compression
Science, in general, tends to use the fewest number of concepts. It seeks the supreme conceptual understanding and the maximum possible simplicity.
MENTAL is a compressed language in a triple sense: 1) at the semantic level because of the reduced number of primitives; 2) at the syntactic level because no keywords are used, only symbols; 3) because it facilitates the compression of programs.
MENTAL is oriented to expressions, which result from combining the primitives of the language:
Expressions that can be operational or descriptive, extensive or intensive, finite or infinite. Compressed expressions are descriptive and intensive expressions.
All types of expressions can be combined. Higher order compressed expressions can be specified.
Does not use keywords. Primitives use only symbols.
MENTAL, with its universal semantic primitives, together with the axioms relating the primitives, makes it possible to ground mathematics and compress it in the sense that primitives are degrees of freedom with which mathematics can be expressed. MENTAL is supreme understanding.
Comparing MENTAL with APL and J:
MENTAL offers a unifying or universal paradigm from which all particular paradigms can be specified. It is not only mathematically oriented, like APL and J.
MENTAL is intended to be the canonical language for computer science and mathematics (including logic).
According to Iverson, notation is a tool of thought. The real tool of thought is the archetypes of consciousness.
MENTAL unites syntax and semantics as two sides of the same coin.
MENTAL is much simpler, more intuitive and flexible than APL and J.
MENTAL vs. APL
The above expressions of APL are almost equally compact in MENTAL:
n=(4 5 6 7) // creating a vector n with the specified values
(n° = ( [n↓]+4 )) // add 4 to all values of n: n=(8 9 10 11)
+⊣n // sum all values of n: 38
1...4 // values from 1 to 4
3+[1...4] // add 3 to the above values: 4 5 6 7
+⊣(3+[1...4]) // sum of the above values: 22
MENTAL vs. J
The definition of the function "medium" would be less compact than in J, but more intelligible.