Sunday, October 19, 2008

Drawing Abstractions

This post shall contain observations of interest more to computer programmers than to mathematics enthusiasts.

My work experience is in creating models of hardware designs, and using the models to verify the designs by comparing the outputs of the two in response to various inputs. The difference between the models I write and the designs I verify is that the designs are synthesizable into real hardware. The models I write to verify the synthesizable designs contain more architectural than microarchitectural detail. The difference between architecture and microarchitecture is that the end user of the hardware does not have direct control over or direct access to the microarchitectural details. Corroboration between the model and design is merely anecdotal evidence of the correctness of the design. However, this sort of anecdotal verification is often essential to verify a hardware design.

The program described in the last post is a procedure to find mathematical abstractions. I can think of it as a model of some of the mathematical structures governed by theorems and definitions given in previous posts. Even though I would doubt the correctness of the theorems if I found it impossible to model the intended structures, my goal in modelling the structures is not to verify the theorems. In fact, success in modeling the structures would be only anecdotal support of the theorems. My goal in modeling the structures is to satisfy the curiosity which helped to motivate me to produce the theorems. In that way, I could more easily move on to related topics.

The challenge of modeling mathematical structures differs from the challenge of modeling hardware designs. Hardware designs are more concrete than the mathematical structures I am modeling. I have an intuitive sense of what a portion of the model must do in order to model the corresponding portion of the design. However, in my simplex overlap model, the sidednesses are represented by 1s and 0s, and sometimes I lack intuition as to whether some intermediate 1s and 0s are correct. This intuition about the correctness of intermediate results is essential to debugging a computer program. Other than by direct inspection of and reasoning about the program source code, the only way I know to debug a program is by taking it one step at a time, and checking the results after each step. For me, the direct inspection technique works better when it is used in conjunction with the intermediate result technique.

Often, the intermediate results in my simplex overlap program are the sidedness relations of linear spaces. At least for fewer than 4 dimensions, I do have an intuitive notion of what a linear space is. I can represent such a linear space by a drawing. Thus, to check that a sidedness relation does represent a linear space, I attempt to draw lines and points which satisfy the sidedness relation. Unfortunately, converting the sidedness relation to a drawing requires a lot of trial and error. This leads me to desire a program which could draw the lines and points automatically, given any linear sidedness relation. If the program failed on a particular sidedness relation, when it succeeded in much less time on equally complex sidedness relations, I would suspect that the sidedness relation it failed on was not in fact linear. In that way, I could detect faulty intermediate results in the simplex overlap program.

Another advantage of having drawings of intermediate linear space results in the simplex overlap program is that I could use those drawings to check other intermediate results which are not linear spaces. For example, the inside of a triangle overlap would be obvious from its drawing.

Yet another advantage of a program to convert the sidedness relations of a linear space into a drawing is that when I do find all of the tetrahedron overlaps, then I will be able to more easily publish drawings of them. I suspect the actual drawings will be more inspirational and convincing than a simple count of their number.

Now I will describe the program which converts sidedness relations to drawings. It starts out with random coordinates for the specified number of points and boundaries. The coordinates of a boundary are the coordinates of a point on the boundary, together with the coordinates of a unit normal to the boundary. Given a set of coordinates, the program calculates a score by taking the sum of the signed perpendicular distances of the points from the boundaries. The program attempts to increase this score by randomly changing one coordinate at a time. The program reverts the change if it does not improve the score. As the score improves, the way the coordinates are changed changes from pure random to a sort of Brownian motion.

I wonder whether this program to convert sidedness relations to coordinates would be easier to debug than the simplex overlap program it is intended to help debug. I suspect it would be easier to debug because coordinates are less abstract than sidedness relations. Coordinates are concrete in that they can be displayed on a computer screen in a graphical way. To me, graphics are less abstract than symbols.

Wednesday, August 27, 2008

Overlap Program Description

By the Continuity Theorem (see previous posts), the migration operation spans all linear sidedness spaces, starting from any one. Similarly, migrations are sufficient to find all simplex overlaps of a given dimension. I need only check each migration from each overlap found so far, and find if it is equivalent to one found already. To simplify the equivalence check, I will impose an ordering on equivalent sections and remember only the first in order. The program to do this is described in the following.

Start with a single entry list. Finding this initial overlap example is the most difficult part of the program. Create the example overlap by modifying an overlap with one fewer boundary than desired. First choose a boundary. Then choose a boundary in the section by it. In the one dimensional case, choose a region and divide it by a new boundary. In the next dimension up, divide regions by a new boundary close to the chosen one, passing through the new boundary in the previous dimension. Continue up to the original dimension.

One question is whether the above method could be used to find all overlaps without using migrations. This would be less efficient than using migrations as below, because the above method would find all possible sidedness relations. The migration method below finds all overlaps while going through only some of the possible sidedness relations.

Now fill out the list with a representative from each overlap equivalence class. For each overlap in the growing list, for each possible migration, consider the resultant overlap. If the overlap is not equivalent to any on the list, then add it to the end of the list.

Determine equivalence by keeping a list of sections which compare as the least of all permutations and inversions. By definition, the equivalence class is all permutations and inversions. A one to one mapping is a permutation. An inversion is a reversal of all bits in the sidedness relation indexed by a boundary.

Friday, January 4, 2008

First Principles

This entry shall contain some philosophization. Philosophization, sidedness, get it?

What are some of the advantages and disadvantages of deriving mathematical results from first principles, instead of basing new results on published results? Both techniques are useful. I found it easier to get the information I needed to design a program to count tetrahedron overlaps by assuming points do not lie on lines instead of assuming they always lie on lines as in (widely published) incidence geometry. I do not doubt someone more familiar with incidence geometry would find it easier to use than I do. Both techniques, using first principles and using published results, encourage insight and interrelationships between different parts of mathematics. I already tied sidedness geometry to linear spaces, and I can imagine eventually learning enough about incidence geometry to find how sidedness and incidence geometries relate. The inspiration for trying to relate incidence and sidedness is that they are so obviously similar. So far these are advantages for both the first principle technique and the published result technique.

The difference between first principles and published results is that a hypothetical person who is intelligent, but hitherto illiterate, could understand an argument from first principles, but the same hypothetical person could never understand an argument based on published results. I am much closer to such an hypothetical person than a professional mathematician, so I admit a bias toward first principles. Perhaps the general public is closer to that hypothetical, intelligent but hitherto illiterate, person than a professional mathematician, and for that reason my bias is mitigated. However, I do find myself peculiarly deficient of memory when reason will suffice. For some reason, I associate this peculiarity of mine with creativity. Thus, in my mind, I consider first principles to be more creative than I imagine reasoning from published results would be.

Mathematics is all about abstraction, generality, and precision. That is, start with nothing, end up with everything, and make no mistakes along the way. With credentials like that, why don't we have more mathematicians in the white house? Both creativity and abstraction are, to borrow a phrase from Marvin Minsky, suitcase words, meaning many different things. Since I do not have a superior understanding of the complexities of abstraction, I must rely on my intuition that first principles are similar to abstraction. Since even I was able make a connection from first principles to linear space, I must assume connections to linear space are not the most general. However, my fantasy is that the number of overlaps is always prime. Now that would be a promising path from nothing to everything! As to precision, I draw from personal experience. In my profession, we discourage designers from verifying their own designs; we prefer for the verification to be done by someone else. Similarly, the correctness of my, and presumably other people's, proofs would be assisted by the attention of others. Since results derived from published results are more likely to be reviewed by others, a result from first principles has less chance for such review. While first principles are more abstract than published results, published results are more well reviewed than first principles, so neither has superior advantages.

Monday, December 31, 2007

Overlap Examples

Here are the 11 triangle overlaps. The top left one differs from the disjoint one by a single migration. I call this kind of migration, where a point jumps across a boundary, a point migration.



Here are three tetrahedron overlaps. The right two differ from the disjoint one by single migrations. The middle one is a point migration since it is a point jumping across a boundary. The rightmost one is a segment migration since it is a segment jumping across another segment.

Saturday, December 8, 2007

Tetrahedron Overlaps

Linear Space Equivalence

Two linear spaces are equivalent iff they are isomorphic to the same finite set of nonparallel noncoincidental linear surfaces. Two finite sets of nonparallel noncoincidental linear surfaces are equivalent iff they are isomorphic to the same linear space. A finite set of nonparallel noncoincidental linear surfaces are said to be equivalent to a linear space iff they are isomorphic.

Migration

In space Sn = (B,P,S,n), regions R1 and R2 are neighbors with respect to b0∈B iff R1(b) = R2(b) and R1(b0)R2(b0), for b∈B0, where B = B0∪{b0}. In space Sn = (B,P,S,n), region R2 is the opposite of region R1 iff for b∈B, R1(b)R2(b)R1 has a nonempty neighbor with respect to b. Two spaces S1n = (B,P1,S,n) and S2n = (B,P2,S,n) are migrations of each other iff for each region R in S1n and S2n, one or both of the following is true. R is empty in S1nR is empty in S2n. Or, R is empty the opposite of R is not empty.

Example

Regions A, B, and C have empty opposites. Region A is the opposite of region E. Region E is the opposite of region D.

Migration Theorem

If S1n and S2n are migrations of each other then, S1n is linear S2n is linear.

Without loss of generality, assume S1n is linear, R is empty in S2n,
and its opposite is not empty in S2n. Suppose S3n is any subspace of S2n. If R is not a region of S3n, then it is linear because its identical subspace in S1n is linear. If R is a region of S3n, then so is its opposite, so the number of nonempty regions in S3n is unaltered, so it is linear, and the theorem is proved.

Continuity Theorem

There exists continuous L:R→{m linear surfaces in Rn}, such that L(r) is nonparallel and nonconicidental for rr0R, only if there exist r1, r2R, and linear spaces S1n and S2n, such that r1<r0<r2, L(r1)≡S1n, L(r2)≡S2n, and S1n and S2n are migrations of each other.

As a set of linear surfaces changes continuously, its regions cannot suddenly become empty. Before becoming empty, a region must become infinitesimally small. As a region becomes infinitesimally small, so does its opposite. Thus, as a region becomes empty, its opposite becomes nonempty.

Simplex Overlap

A simplex overlap is two disjoint sets of boundaries, each of which is a simplex. The inside of a simplex overlap Sn = (B,P,S,n) is a space S1n = (B,P1,S,n), such that P1 is the union of the insides of the simplices. Two simplex overlaps, (M1,M2), and (N1,N2), where M1, M2, N1, N2 are the simplices of the overlaps, are equivalent iff there exists one to one mapping g:M1∪M2→N1∪N2, such that g(M1) = Ni for some i∈{1,2}, and for each b∈M1∪M2 the section of the inside of (M1,M2) by b is equivalent to the section of the inside of (N1,N2) by g(b). There are 11 equivalence classes of triangle overlap. How many equivalence classes of tetrahedron overlap are there?

Sunday, November 11, 2007

Sidedness Geometry

Linear Space

Take points and boundaries as undefined. Define a sidedness relation S:B×P→{0,1}, where B is a finite set of boundaries and P is a finite set of points. Two points p0, p1 are said to be on the same side of a boundary b iff S(b,p0) = S(b,p1), and they are said to be opposite b iff S(b,p0)S(b,p1). Define a space as Sn = (B,P,S,n), where S is a sidedness relation on B×P, and integer n>0 is called the dimension of the space. Define a region as R:B→{0,1}. Note that there are 2m regions in a space with m boundaries. A point p∈P is said to be in region R iff S(b,p) = R(b) for each b∈B. A region is said to be empty iff no points are in it. Define a subspace of Sn = (B,P,S,n) to be S0n = (B0,P,S0,n) such that B0⊂B, and S0(b,p) = S(b,p) for each b∈B0, and p∈P. A space Sn is said to be linear iff in each subspace the number of nonempty regions is equal to f(n,m), where m is the number of boundaries in the subspace, f(1,m) = m+1, f(n,0) = 1, and f(n+1,m+1) = f(n+1,m)+f(n,m). A sidedness relation S:B×P→{0,1}, where B is a finite set of linear surfaces in Euclidean space Rn and PRn is a finite set of points not on the surfaces in B, is given by nb∙(p-pb)>0, where nb is a normal to bB, pb is a point on b, and pP. A finite set of linear surfaces in Rn is nonparallel iff no two surfaces in it are parallel. A finite set of linear surfaces in Rn is noncoincidental iff no n+1 surfaces in it share a point. A space Sn is isomorphic with a finite set of nonparallel noncoincidental linear surfaces in Rn iff there exist one to one mappings g:B→B, h:P→P, and sb:{0,1}→{0,1}, such that S(b,p) = sb(S(g(b),h(p))) for each b∈B and p∈P.

Linear Space Theorem

A finite set of nonparallel noncoincidental linear surfaces in Rn exists if and only if isomorphic linear space Sn exists.

First I will prove that a finite set of linear surfaces in Rn exists only if isomorphic linear space Sn exists. Each point in R divides one of a finite set of regions spanning R, so the number of regions in R is f(1,m) = m+1, where m is the number of points dividing R. Thus, the "only if" part of the theorem is true for n = 1. There exist any number of points in Rn on either side of a linear surface, so f(n,1) = 2, for all n. Thus, the "only if" part of the theorem is true for m = 1. Suppose the "only if" part of the theorem is true for n < i. Also suppose that if n = i, then the "only if" part of the theorem is true for m < j. I must show that the "only if" part of the theorem is true for n = i and m = j. Let L be a set of j-1 nonparallel noncoincidental linear surfaces in Ri, and let l be a linear surface in Ri, nonparallel and noncoincidental with L. By supposition, L divides Ri into f(i,j-1) regions. The intersections of l with the surfaces in L are isomorphic with linear surfaces in Ri-1. By supposition, l divides f(i-1,j-1) of the regions formed by L in Ri. Therefore, there are f(i,j-1)+f(i-1,j-1) = f(i,j) regions formed by L∪{l} in Ri, and the "only if" part of the theorem is proved. The "if" part I will prove below after proving some supportive theorems.

Section

A boundary b is said to extend S0n = (B0,P0,S0,n) to S1n = (B1,P1,S1,n) iff S0n is a subspace of S1n, and B1 = B0∪{b}. If b extends S0n = (B0,P0,S0,n) to S1n, then b divides region R0 in S0n into regions R1a and R1b in S1n iff R1a and R1b are not empty, R1aR1b, and R1a(b0) = R1b(b0) = R0(b0) for each b0∈B0. If b extends S0n = (B0,P0,S0,n), then S1n-1 is the section of S0n by b iff S1n-1 is isomorphic with S1n = (B0,P⊂P0,S0,n), where p∈P iff p is in a region divided by b.

Section Theorem

If Sn-1 is a section of S0n by b, b extends S0n to S1n, S0n is linear, and S1n is linear, then Sn-1 is linear.

The number of regions in Sn-1 is the number of regions divided by b. The number of regions divided by b is the number of regions in S0n subtracted from the number of regions in S1n. Since S0n and S1n are linear, the number of regions in Sn-1 is f(n,m+1)-f(n,m) = (f(n,m)+f(n-1,m))-f(n,m) = f(n-1,m). The same reasoning applies to each subspace of Sn-1, because each subspace of Sn-1 is the section of a subspace of S0n by b. Therefore, Sn-1 is linear.

Antisection Theorem

If Sn-1 is a section of S0n by b, b extends S0n to S1n, Sn-1 is linear, and S0n is linear, then S1n is linear.

The number of regions in Sn-1 is the number of regions divided by b. The number of regions in S1n is the number of regions divided by b added to the number of regions in S0n. Since Sn-1 and S0n are linear, the number of regions in S1n is f(n-1,m)+f(n,m) = f(n,m+1). The same reasoning applies to each subspace of S1n, because each subspace of S1n is the extension of a subspace of S0n by b. Therefore, S1n is linear.

Simplex

A simplex in linear space Sn is any n+1 boundaries in Sn. Note that because n linear surfaces are linearly independent in Rn, and the "only if" part of the Linear Space Theorem is true, f(n,n) = 2n. By definition of linear space, f(1,2) = 22-1, and if f(n-1,n) = 2n-1, then f(n,n+1) = f(n,n)+f(n-1,n) = 2n+2n-1 = 2n+1-1, so the number of nonempty regions in a simplex is 2n+1-1. Consider the empty region of a simplex in space Sn. Reverse any one sidedness of the empty region, and call the resultant region a vertex region of the simplex. Since there are n+1 boundaries in a simplex, there are n+1 vertex regions in it. Reverse all of the sidednesses of the empty region and call the resultant region the inside of the simplex. Since there is only one empty region in a simplex, there is only one inside in it.

Simplex Theorem

There exists no boundary dividing all vertex regions of a simplex.

Suppose there does exist boundary b dividing all n+1 vertex regions of simplex b1, b2, ... bn+1. Consider the section of b1, b2, ... bn by b. That section is a simplex with vertices sectioned from the vertices opposite b1, b2, ... bn. Since the vertex region opposite bn+1 is opposite one of b1, b2, ... bn from each of the sectioned vertex regions, it is not sectioned to any one region of the sectioned simplex. This contradicts the supposition of b, so no such b exists, and the theorem is proved.

Independent Boundary Theorem

If Sn extended by b0 is linear, and Sn extended by b1 is linear, and b0 and b1 divide different sets of regions, then Sn extended by b0 and b1 is linear.

For S1 it is true because b0 and b1 divide different regions, so points on one or the other side of b0 in the region it divides will all be on one side of b1. Suppose it is true for Sn-1. I must prove it for Sn. Suppose Sn is not linear if it is extended by both b0 and b1 together, but Sn is linear if it is extended by b0 or b1 individually. Discard boundaries from Sn until the reduced Sn is linear when extended by both b0 and b1. This is possible because b0 and b1 alone in Sn is a linear space. Let b2 be the last boundary discarded from Sn. Consider the section by b2, Sn-1. By the Section Theorem, Sn-1 is linear because Sn is linear and Sn extended by b2 is linear. Similarly, Sn-1 extended by the section of b0, or by the section of b1, is linear. Thus, by supposition, Sn-1 extended by the sections of both b0 and b1 is linear. By the Antisection Theorem, since Sn extended by b0 and b1 is linear, and Sn-1 extended by the sections of b0 and b1 is linear, Sn extended by b0, b1, and b2 is linear. This contradicts the supposition, so the theorem is proved.

"If" Part of Linear Space Theorem

If linear space Sn exists, then a finite set of linear surfaces in Rn isomorphic with Sn exist.

Suppose no R0n exits with boundaries and sidednesses isomorphic to some linear space S0n. Let S1n be boundaries of S0n which are isomorphic with the boundaries and sidednesses of some R1n. Until impossible, extend S1n by boundaries from S0n such that S1n is still isomorphic with an extension of R1n. By supposition, there exists boundary b0 in S0n such that b0 is not in S1n. Let R1, R2, ... Rn+1 be the n+1 regions of S1n divided by b0 such that no b0 exists which divides those regions in R1n. Let p1 and q1 be in R1, opposite b0, and similarly for (p2,q2), ... (pn+1,qn+1). Construct b1, b2, ... bn+1 such that p1 and q1 are in one vertex region of the simplex formed by b1, b2, ... bn+1, and (p2,q2), ... (pn+1,qn+1) are in the other vertex regions. The prior construction is possible because, given n+1 points in Rn a simplex can be constructed with those points as vertices; a point can be chosen in each of R1, R2, ... Rn+1; the vertex region of each point at least partially overlaps the region the point is in; and without loss of generality, we may assume pi and qi are in the portion of Ri which overlaps the vertex region. Extend R1n by b1, b2, ... bn+1 to R2n. Since R2n obeys the "only if" part of the Linear Space Theorem, S1n can be similarly extended to S2n such that S2n is isomorphic to R2n. Since S1n can be extended by b0, and b0 divides different regions from b1, b2, ... bn+1, S2n can be extended by b0 to S3n because of the Independent Boundary Theorem. Now, b0 goes through each of the vertex regions of b1, b2, ... bn+1 in S3n. This violates the Simplex Theorem. Therefore the supposition was false, and there does exist R0n with boundaries and sidednesses isomorphic with S0n.