The polygonal overlay, assembled into a plane graph #
Schoenflies/Overlay.lean does the separating half of lem:polygonal-overlay: after cutting
at the right points, two pieces of the subdivision whose interiors meet are the same
segment, in one order or the other. This module turns that into a plane graph.
The only thing standing between "the same segment" and "the same edge" is that a segment has
two names, (a, b) and (b, a). orientPiece removes the choice by fixing a total order on
plane points — Precedes, lexicographic in the coordinates — and putting the smaller end
first. Two names for one segment then orient to the same name, so "represent each duplicated
subsegment once" stops being deduplication up to reversal and becomes deduplication up to
equality, which List.dedup does without knowing any geometry. Nothing geometric rests on
which order it is: only precedes_total and eq_of_precedes_of_precedes are ever used.
The graph is overlayGraph, a Graph Plane Piece: its edges are the oriented, deduplicated
pieces, and its vertices are their ends. IsLink P x y says that P is an edge and that x
and y are its two ends in one order or the other — which is why
eq_or_eq_of_isLink_of_isLink is a two-line case split rather than an argument.
The three clauses of Graph.IsDrawing come out as follows.
- Each edge is drawn by an arc between its ends —
isArcBetween_segment, given nondegeneracy, whichsubdivide_nepreserves and orienting does not disturb. - An edge's arc meets the vertex set only at its own ends — a vertex is an end of some
edge, hence a cut point, and
subdivide_avoidssays a cut point is interior to nothing. - Distinct edges meet only at shared vertices — a common point that is an end of neither
would be interior to both, and
subdivide_separatedwould make the two pieces the same segment, hence (after orienting) the same name. Once it is an end of one it is a cut point, so it cannot be interior to the other either, and it is an end of both.
Blueprint #
Precedes,orientPiece— the canonical orientation of a segment.overlayPieces,overlayGraph,segmentDrawing— the graph of Lemma 3.7.polygonal_overlay— Lemma 3.7 (polygonal overlay), the whole statement.
A total order on plane points #
It exists to pick one of two points canonically. Only two facts about it are used: that it compares any two points, and that it cannot rank two distinct points both ways round.
The canonical orientation of a piece #
A piece with its ends in lexicographic order. Two names for one segment orient to the same name; that is the whole purpose.
Equations
- Schoenflies.orientPiece P = if Schoenflies.Precedes P.1 P.2 then P else (P.2, P.1)
Instances For
Orienting does not move the segment.
Nor the interior.
Nor which points are its ends.
The output is oriented — which is what makes orientPiece idempotent.
Orienting forgets the name it was given. This is the fact that makes deduplication carry no geometry.
Deduplication #
cover only sees which pieces are in the list, so both steps of the assembly — orienting and
deduplicating — leave it alone.
The edges of the overlay: the pieces of the subdivision, oriented and then deduplicated. Orienting is what makes the deduplication a plain list operation.
Equations
- Schoenflies.overlayPieces pieces points = (List.map Schoenflies.orientPiece (Schoenflies.subdivide pieces points)).dedup
Instances For
The list of edges has no duplicates.
Neither orienting nor deduplicating changes what the pieces occupy.
Every end of every edge is a cut point: orienting does not change which points are ends,
and subdivide_ends_are_cuts covers the subdivision.
Distinct edges have disjoint interiors. This is where separation is spent: two pieces sharing an interior point are the same segment, so after orienting they are the same name, and a deduplicated list holds a name once.
The graph #
The overlay graph: the oriented deduplicated pieces as edges, their ends as vertices.
An edge links x and y exactly when they are its two ends in one order or the other, which
is what makes eq_or_eq_of_isLink_of_isLink a case split with no content.
Equations
- One or more equations did not get rendered due to their size.
Instances For
An end of an edge is a vertex.
The drawing #
A straight edge is drawn by the affine parametrization of its segment, so the arc clause of
IsDrawing is isArcBetween_segment and nothing else.
Every piece is drawn by the affine parametrization of its segment.
Equations
- Schoenflies.segmentDrawing P = ⇑(AffineMap.lineMap P.1 P.2)
Instances For
The overlay graph is a plane graph.
What the graph occupies is what its edges occupy: every vertex is an end of an edge, so the vertices add nothing.
Finiteness #
Without this the whole face and outer-face machinery of Schoenflies/Graph/Drawing.lean and
Schoenflies/Graph/OuterFace.lean is inapplicable to the overlay, since every statement there
carries a [G.Finite] instance. Both sets come from one finite list, so it is immediate — but
it has to be said, and the instance has to be found by typeclass search at the call site.
Lemma 3.7 (polygonal overlay). Finitely many nondegenerate segments are the point set of a finite plane graph.
The finiteness clause is not decoration. Every statement about faces and about the outer face
carries a [G.Finite] instance, and an existential that produced only IsDrawing would hide
the graph behind a binder with no way to recover the instance — so the overlay could not be
fed to the face machinery at all.