the auroran sunset ([info]tithonus) wrote,
@ 2004-05-08 13:48:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Current mood: tired
Current music:The Rolling Stones - Get Off Of My Cloud

the "constructive reals calculator"

this article is part of a section on explaining mathematical terminology.



the constructive reals calculator is a working proof of concept calculator, written in java. the author's description says the following:

This is a calculator that operates on constructive real numbers. Numbers are represented exactly internally to the calculator, and then evaluated on demand to guarantee an error in the displayed result that is strictly less than one in the least significant displayed digit. It is possible to scroll the display to the right to generate essentially arbitrary precision in the result.


note the sloppy quasi-religious mathematical bullshitting: "exactly" and "essentially arbitrary precision". the calculator in fact has a limit of just over 1000 places, after the decimal, on my computer. i'm not sure if the limitation is in the registers on my computer, or in java itself. probably the computer. obviously with bigger memory registers, or a modified java, you could calculate more places, but there will *always* be some limit.

calculations are inputted using reverse polish notation, which is something like working with a stack.



so, what is a "constructive real"? essentially it is a method of looking at any 'number' as if it were a sequence of numbers converging towards it. i put 'number' in quotes, because the 'numbers' that this method is usually used for are those with so-called 'infinite' decimal strings after the point - for example pi, e, the square root of two, 1/3, etc.. clearly in reality such 'numbers' don't exist, only approximations exist. for more detailed explanation of this, see part of abelard's deconstruction of the mess godel built.

the theory goes on to give methods to calculate these sequences and manipulate them. this is how they are producing "arbitrary precision".


if you wanted to go into the mathematical details, this would be a good place to start. it is the "lecture notes of the second half of a course on constructive mathematics and lambda-calculus, held at uppsala university, autumn 1998". one of the modules i did in the third year of my computation degree was on lambda calculus - it made up about 1/7 of my finals. i, at least, found it interesting - this sort of maths makes pretty patterns, even if it is full of cloudcuckooland mumbo-jumbo such as that above.


as an example of the kind of mathematics used: the most basic part of defining these sequences are two mathematical objects called cauchy sequences and dedekind cuts - you generally learn about these two very early on in the first year of a mathematics degree. in fact in a maths degree, you will be using cauchy sequences over and over and over and over and over again.

first cauchy sequences:-


so, what are those funny symbols?
  • the upside-down capital a means "for all".
  • the back-to-front capital e means "there exists".
  • q is the sequence. a sequence is something like 1,2,3,4,5,6,... - a list of numbers following a pattern. that sequence would be defined as sn=n
  • m,N,k and l are integers (the numbers you count with).
in english that sentence reads:

a cauchy sequence q is defined as a sequence such that "for all possible integers [e.g. 1,2,3,4,..] m [e.g. 3], there exists an integer N [e.g. 12] such that for all integers k and l greater than N [e.g. k=15, l=203394], the size of the difference between the kth and the lth elements of the sequence is strictly less than one divided by two to the power m [with m=3, that's strictly less than 1/8]".


i think you will agree that the formula is slightly less wordy! but what does it mean in practice?

one divided by 2 to the power m gets very small as m gets bigger: 1/2, 1/4, 1/8, ... , 1/16777216, ...
so the definition is saying that with a cauchy sequence, no matter how small an error margin you decide is acceptable, you can find a member of the sequence so that the difference between all later pairs from the sequence is strictly less than that error. ie once you decide how much error you will allow, you can find an answer with less than that error.

a concrete example of a cauchy sequence

probably the simplest cauchy sequence is fx = 1/x

in numbers that sequence is: 1, 1/2, 1/3, 1/4, 1/5, ... , 1/10032, ...

it should be fairly obvious that each number in this sequence gets smaller than the last. ie 1/3 is smaller than 1/2.

it should be fairly obvious that the numbers never go negative, so the smallest an element in the sequence could possibly be is 0.

from these two, we can infer that the biggest possible difference between two element is the size of the bigger one: bigger element - 0 = bigger element.

from this we can see that if 1/N is less than 2-m then the conditions for a cauchy sequence are met. obviously, given any m, we can easily find such an N.


and now even more concretely! ... the definition starts with "for all m" - ie it shouldn't matter what m we chose. it should still work... let's choose an m.

i choose m=4. [you can try it yourself with whatever number you feel like].
2-4 is 1/16. clearly if N=17, for any k and l that are greater than N, 1/k and 1/l is less than 1/16. so the difference between the two is definitely less than 1/16. therefore we must have a cauchy sequence.



now for dedekind cuts:-


again, i will start with the meaning of the strange symbols:
  • the 0 with a line through means the empty set - another mathematicians' fantasy.
  • the = with a line through means "not equal" - again an indication of the general belief by mathematicians in another fantasy: that of the existence of equality.
  • the u on its side with a line under it means the thing before it is a subset of the thing after it. eg. "the set of rainy days" is a subset of "the set of all days".
  • s.t. is short for "such that".
  • the curvy e (a greek lower case epsilon) means the element before belongs to the set afterwards. eg. "japan" belongs to the "set of countries".
  • that capital q with shading is the set of rational numbers. a rational number is a number that can be represented as a fraction. for example 1/2, 1, 1000, 3959/329. in the future i will write 'Q' for this.
now to read it in english:-

a dedekind cut is a set that isn't empty and is a subset of the rationals. if we have one such subset called 'A', A is defined such that:
  1. a rational number exists that is strictly bigger than all members of A.
  2. for all elements of A, there is another element of A that is bigger.
  3. for all elements of A, all rational numbers that are smaller than it are also in A.
what does this mean? numbers 1 & 2 together mean that there is a number not in A which is bigger than everything in A, but that you can get "arbitrarily close" to that bigger number with numbers that *are* in A - note that this is another variant of the 'infinity' fantasy. there are of course even bigger numbers in Q that are bigger than everything in A - mathematicians generally only care about the smallest such number, which is called the "least upper bound". number 3 means that there is no such bound in the other direction - yet another variant of the 'infinity' fantasy.

'tis quite amazing how many fantasies mathematicians can put in one box and still come out with something useful!

a concrete example of a dedekind cut


DC = {x in Q: x<0}
in other words, our example set contains all rational numbers that are less than zero (not including zero). for example it contains: -1, -32849, -1/2, -23489/2390280, ...

as it contains those, it is obviously not empty. also we defined it to only contain rational numbers, so it is clearly a subset of the rational numbers.

we know that zero is bigger than any element of that set, because zero is bigger than all negative numbers. we also deliberately said zero is not in the set. these two points give us the "bounded" and "open" conditions.

if we think of a really really negative rational number, say -1209823840248032948320, it is clearly still less than zero, so it must be in our set. this gives us the "downward closed" condition.

from these points, we can see that we must have a dedekind cut. in mathematics, real numbers are defined as the dedekind cut with that number as their least upper bound.

note that mathematics include numbers with 'neverending' decimal expansions in the definition of 'real' numbers [for example, pi], which are about as unreal as you can get! mathematicians call these 'neverending' numbers "irrational" numbers.

in other words, our set DC is the mathematical definition of the number zero. for more mathematical details on dedekind cuts and defining the real numbers, see here.



anyway, those are two of the lowest building blocks in the theory of constructive reals. it's the sort of thing that kept me amused in the first year of my computation degree and to a lesser extent through the rest of the degree, although i didn't actually study constructive reals as such. seeing it again is very 懐かしい [natsukashii - means something like "capable of bringing back memories", "poignant", ... i can't think of any good way to express it in english as that part of speech].

[lead from c.m.]



Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…