Topic

Finite geometries

A geometry can have finitely many points. The smallest projective plane, the Fano plane, has seven points and seven lines, three points on each line and three lines through each point, and its 168 symmetries form a famous simple group.

const F = fano();                    // PG(2, 2)
F.projectiveAxioms();                // { twoPointsOneLine: true, twoLinesOnePoint: true, … }
F.collineations().order;             // 168, by searching all permutations
projectivePlane(4).collineationGroup().order;   // 120960 = 2 · |PGL(3, 4)|
affinePlane(3).isAffinePlane();      // true: Playfair's axiom holds
affinePlane(3).completion();         // add points at infinity: a projective plane of order 3

Planes over finite fields

Replace the real numbers by a finite field with q elements (q a prime or a prime power, from algebraic's galoisField) and the definitions still work. The projective plane PG(2, q) has a point for each triple [x : y : z] up to non-zero multiples, which makes q2+q+1q^2 + q + 1 points; lines are triples too, with the same count, and each line has q + 1 points. The affine plane AG(2, q) has the q2q^2 pairs (x, y) as points and the lines y = mx + c and x = c, in q + 1 parallel classes of q lines each.

The incidence matrix N of a projective plane of order n (rows lines, columns points) satisfies NNT=nI+JNN^{\mathsf T} = nI + J: two lines meet in exactly one point. The tests check this for every q up to 9.

The axioms, checked

incidence(lines) takes any family of lines as lists of points. projectiveAxioms() checks that two points lie on exactly one line, two lines meet in exactly one point, and there are four points with no three collinear. affineAxioms() checks the first and Playfair's axiom: through a point off a line there is exactly one parallel. In a projective plane there are no parallels at all (parallels(p, ℓ) is empty), and adding a point at infinity for each parallel class of an affine plane, plus one line through them, gives a projective plane. That is completion().

Every plane here is also a block design: a projective plane of order n is a 2-(n² + n + 1, n + 1, 1) design. designParameters() returns v, b, k, r and λ, and the lines can be handed to the discrete package's blockDesign.

Collineations

A collineation is a permutation of the points that sends lines to lines. For PG(2, q) the invertible matrices give them, and for q = pᵏ with k > 1 so do the field automorphisms. collineationGroup() generates this group as a PermGroup on the points, of order k q3(q3−1)(q2−1)k\,q^3(q^3-1)(q^2-1): 168 for the Fano plane, 5616 for q = 3, 120960 for q = 4. For small structures collineations() finds every collineation by a backtracking search, which needs no algebra at all, and for the Fano plane it also finds 168.

Not every projective plane comes from a field. Planes of order 9 that are not PG(2, 9) exist, no plane of order 6 exists (Bruck–Ryser), none of order 10 (Lam's computer search, 1989), and order 12 is open.

callreturns
projectivePlane(q), affinePlane(q), fano()FiniteProjectivePlane (coordinates, pointAt, collineationGroup) and FiniteAffinePlane (parallelClasses, completion)
incidence(lines, { points, name, labels })Incidence: v, b, lines, matrix, linesThrough, lineThrough, meet, parallels, dual
projectiveAxioms(), affineAxioms(), order, designParameters()The checks, each named
collineations(){ order, group, elements } by search
Try itEdit the code and run it with @ratmath/geo and Core's Rational in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math.
Ctrl/⌘ + Enter runs