We propose to represent elements of projective geometries, points, lines, planes, etc., uniquely by RREF matrices without zero rows. We use some of the lattice jargon introduced in the first reference. Counting the top and bottom, a projective space of n dimensions has elements of n+2 different ranks. For 2D projective geometry the elements are:
(P 'meet) yields the binary operator (x⋀y) corresponding to the intersection of two subspaces.
(P 'join) yields the binary operator (x⋁y) corresponding to the span of the union of the two spaces.
(P 'one) yields the top of the lattice which is also the entire space.
(P 'zero) yields the bottom of the lattice which is also the subspace {0}, or the empty set in the projective space.
When 0 ≤ k ≤ n+1 ((P 're) k) yields a random element of the geometry of rank k.
(P 'e=) yields an equivalence relation which means its two operands are the same element of the geometry.
While RREF is canonical, the field elements therein may not be.
We verify that our model of subspaces behaves as a lattice.
Doing Projective Calculations
You may want to skip ahead and see the verification of Desargues’ Theorem below, but this section bears on some subtleties there.To set the stage for computing in n dimensions we create a value P by evaluating ((fileVal "PGc") F n). In n dimensions a projective point relates to a 1D subspace. A random point is thus had from ((P 're) 1). The Scheme value, A, is a list of one vectors and that vector is a list of n+1 field elements. (length A) yields 1. If A and B are points then A⋁B or ((P 'join) A B) give the line thru A and B. That Scheme value is a list of two vectors, each a list of n+1 field elements. Since this matrix of two vectors is canonical, the identity of A and B are lost in the expression of the line thru them.
If L and M are two lines and n=2 then L⋀M or ((P 'meet) A B) yields the point where they intersect. If n>2 then they may not meet whence the resulting value is the empty list of vectors. To see if three points, A, B and C are collinear check the rank of A⋁B⋁C (length (jo (jo A B) c)). (jo is (P 'join).) If the rank is 1 they are all the same point; if the rank is 2 they are on the same line and if the rank is 3 then they are not collinear. To see if three lines, L, M and N, are concurrent, compute L⋀M⋀N (length (me (me L M) N)). If rank is 0 they have no common point. If the rank is 1 then L⋀M⋀N is that point. If rank is 2 then the three lines are identical and the same as L⋀M⋀N.
In each of the calculations in the Desargues case there is an expectation of the rank of each of the results which we do not check except for printing the ranks of intermediate results at the end. It might make sense to make the expected ranks explicit in the code and check them as they are calculated.
Desargues’ Theorem
Desargues said of two triangles:
Finally we do this computation over both the rationals and GF(75). Modulo debugging we should not be surprised that it works over the rationals. I was unsure of the finite field situation for I do not remember the proof of Desargues’ theorem.
We were lucky that our choice of points gave us triangles with three distinct non-collinear vertices. This is not unlikely but we should design a version that copes with the possibility. For now reporting the rank of the matrices and verifying that it is 1 for what we expect as point, and 2 for lines, confirms our luck.