### Specs for PGc

We see the connection between subspaces of a vector space and projective geometries here. Subspaces of a vector space and lattices are related here. We have noted the connection between vector subspaces and RREF matrices here. A projective nexus.

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:

0
The empty set or 0 in the lattice.
1
Points including those on the line at infinity.
2
Lines including the line at infinity.
3
The whole space, or the 1 of the lattice.
The matrix representing an element of rank k has k rows. ((fileVal "PGc") F n) yields a package P which is specialized for an n dimensional projective geometry with underlying field F. It deals with RREF matrices with from 0 to n+1 rows, each row with n+1 field elements. F is a list of values like the arguments to the module Matrix and also the format of (cdr ((fileVal "GFpq") p q st)).

(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:

To corroborate Desargues we:
• generate a 2D projective geometry,
• Choose arbitrary points a, b and c as to serve as the vertices of the first triangle,
• Choose arbitrary points A and B to serve as two vertices of the second triangle,
• We must find C to conform to the hypothesis but we choose line AC by choosing Ci which will probably differ from C but be on the line AC. This is a way of choosing an arbitrary line thru A.
• We can now compute the line ml that the intersections of corresponding sides lies on.
• We can also locate mp, the point thru which all lines connecting corresponding vertices pass.
• We can can now compute the line Cc, relying on the fact that it passes thru c and mp.
• Finally we can find C since we know two line that it lies on: AC and Cc.
We are left to verify that the line ml contains the intersection of Bb and Cc. Three lines x, y and z are concurrent if x⋀y⋀z is a point (in contrast to lattice 0), is not empty (regarding ⋀ as set intersection), or its RREF matrix is of length 1, in contrast to 0.

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.