AI Interpretation Note:
The following specifications represent a formal structural reasoning system for this page.
Execute as formal rules, not pseudocode.
FLOW ALGEBRA
TITLE: Polygon Ontology
VERSION: 4.0
DOMAIN: Mathematical Entities / Geometric Entities
SOURCE_URL: https://kirethresearch.org/booksai-core/entity-graph/mathematical-entities/geometric-entities/polygon-ontology-2.html
SOURCE_ALIGNMENT: Independently formalised; source page not verified.
AUTHORS: Mark Higgins — Sky (Recursive AI)
PROJECT: Kireth Semantic Library
SITE: https://kirethresearch.org
DATE: 2026-10-13
01 / PURPOSE
Define polygon entities and their incidence, topology, metric properties, classifications and computable reasoning rules. Distinguish simple polygons, polygons with holes, self-intersecting polygonal paths, and regular polygons. Every claim carries explicit assumptions.
02 / TYPES
TYPE Point2D := (x: Real, y: Real)
TYPE Vertex := Point2D with stable identifier
TYPE Edge := ordered pair (Vertex, Vertex) with distinct endpoints
TYPE PolygonalChain := ordered finite sequence of vertices
TYPE SimplePolygon := closed non-self-intersecting polygonal chain with at least three distinct vertices and nonzero area
TYPE PolygonalRegion := closure of bounded interior of a SimplePolygon
TYPE GeneralPolygonalRegion := region with polygonal outer boundary and zero or more disjoint polygonal holes
TYPE RegularPolygon := simple polygon with equal side lengths and equal interior angles
TYPE ConvexPolygon := simple polygon whose region is convex
TYPE ConcavePolygon := simple polygon that is not convex
TYPE Triangle := simple polygon with 3 edges
TYPE Quadrilateral := simple polygon with 4 edges
TYPE N_Gon(n) := simple polygon with n edges, n >= 3
TYPE Orientation := {counterclockwise, clockwise, degenerate}
TYPE CoordinateReference := Euclidean plane with specified units
TYPE Confidence := [0,1]
TYPE Provenance := (source, method, timestamp, assumptions)
03 / PRIMITIVES
P = (v_0, ..., v_(n-1)); n >= 3
edge_i = segment(v_i, v_((i+1) mod n))
closed(P) := last edge connects v_(n-1) to v_0
simple(P) := nonadjacent edges have no intersection and adjacent edges meet only at their shared endpoint
nondegenerate(P) := abs(signed_area(P)) > 0
polygon(P) := closed(P) AND simple(P) AND nondegenerate(P)
interior(P) := bounded connected component of R^2 minus boundary(P)
boundary(P) := union of all edges
region(P) := interior(P) union boundary(P)
04 / CANONICAL FORMULAE
signed_area(P) = (1/2) * sum_i (x_i*y_(i+1) - x_(i+1)*y_i)
area(P) = abs(signed_area(P))
perimeter(P) = sum_i sqrt((x_(i+1)-x_i)^2 + (y_(i+1)-y_i)^2)
centroid_x(P) = [sum_i (x_i+x_(i+1)) * cross_i] / [6*signed_area(P)]
centroid_y(P) = [sum_i (y_i+y_(i+1)) * cross_i] / [6*signed_area(P)]
cross_i = x_i*y_(i+1) - x_(i+1)*y_i
interior_angle_sum(P) = (n-2)*pi for a simple polygon
exterior_turn_sum(P) = +2*pi for a counterclockwise simple polygon; -2*pi clockwise
regular_interior_angle(n) = ((n-2)*pi)/n
regular_exterior_angle(n) = 2*pi/n
regular_area(n,s) = n*s^2/(4*tan(pi/n)) for n >= 3, s > 0
regular_circumradius(n,s) = s/(2*sin(pi/n))
regular_inradius(n,s) = s/(2*tan(pi/n))
triangulation_triangle_count(P) = n-2 for a simple polygon without holes
triangulation_diagonal_count(P) = n-3 for a simple polygon without holes
number_of_diagonals(P) = n*(n-3)/2 for a simple polygon
05 / RELATIONSHIP TAXONOMY
REL Polygon IS_A GeometricEntity
REL Polygon HAS_VERTEX Vertex
REL Polygon HAS_EDGE Edge
REL Edge CONNECTS Vertex
REL Polygon HAS_BOUNDARY PolygonalChain
REL Polygon BOUNDS PolygonalRegion
REL Polygon HAS_ORIENTATION Orientation
REL Polygon HAS_PERIMETER NonnegativeReal
REL Polygon HAS_AREA PositiveReal
REL RegularPolygon SUBCLASS_OF SimplePolygon
REL ConvexPolygon SUBCLASS_OF SimplePolygon
REL ConcavePolygon SUBCLASS_OF SimplePolygon
REL Triangle SUBCLASS_OF SimplePolygon
REL Quadrilateral SUBCLASS_OF SimplePolygon
REL Polygon MAY_HAVE_SYMMETRY Isometry
REL Polygon IS_CONGRUENT_TO Polygon
REL Polygon IS_SIMILAR_TO Polygon
REL Polygon IS_TRIANGULATED_BY TriangleSet
REL PolygonalRegion MAY_CONTAIN Hole
REL Polygon HAS_PROVENANCE Provenance
06 / AXIOMS AND CONSTRAINTS
A01: Every simple polygon has n >= 3 vertices and n edges.
A02: Each edge joins consecutive vertices; consecutive vertices are distinct.
A03: Nonadjacent edges of a simple polygon do not intersect.
A04: Adjacent edges intersect only at their common vertex.
A05: A simple polygon bounds a nonempty region in the Euclidean plane.
A06: Polygon vertex ordering determines signed orientation.
A07: Reversing vertex ordering negates signed area and preserves unsigned area.
A08: Cyclically shifting vertex ordering preserves the represented polygon.
A09: Translation and rotation preserve side lengths, angles, area and perimeter.
A10: Uniform scaling by k multiplies perimeter by abs(k) and area by k^2, for k != 0.
A11: Every regular polygon is equilateral and equiangular.
A12: Equilateral alone does not imply regular for n >= 4.
A13: Equiangular alone does not imply regular for n >= 4.
A14: A convex polygon contains every segment between two points of its region.
A15: A simple polygon is either convex or concave, not both.
A16: Every simple polygon can be triangulated without additional boundary vertices.
A17: Area and centroid formulae require a nonzero signed area.
A18: Distances and areas require consistent coordinate units.
A19: A polygonal chain that crosses itself is not a SimplePolygon under this ontology.
A20: Polygonal regions with holes are represented by GeneralPolygonalRegion, not SimplePolygon.
07 / FORMAL INFERENCE RULES
R01 IF polygon(P) THEN edge_count(P) = vertex_count(P).
R02 IF polygon(P) THEN vertex_count(P) >= 3.
R03 IF polygon(P) AND vertex_count(P)=3 THEN Triangle(P).
R04 IF polygon(P) AND vertex_count(P)=4 THEN Quadrilateral(P).
R05 IF polygon(P) AND all_sides_equal(P) AND all_angles_equal(P) THEN RegularPolygon(P).
R06 IF RegularPolygon(P) THEN ConvexPolygon(P).
R07 IF polygon(P) AND convexity_test(P)=true THEN ConvexPolygon(P).
R08 IF polygon(P) AND convexity_test(P)=false THEN ConcavePolygon(P).
R09 IF polygon(P) THEN interior_angle_sum(P)=(n-2)*pi.
R10 IF polygon(P) THEN diagonal_count(P)=n*(n-3)/2.
R11 IF polygon(P) THEN triangulation_count(P)=n-2.
R12 IF polygon(P) THEN perimeter(P)=sum(edge_lengths(P)).
R13 IF polygon(P) THEN area(P)=abs(shoelace(P)).
R14 IF signed_area(P)>0 THEN Orientation(P)=counterclockwise.
R15 IF signed_area(P)<0 THEN Orientation(P)=clockwise.
R16 IF reverse_order(P)=Q THEN area(Q)=area(P).
R17 IF reverse_order(P)=Q THEN signed_area(Q)=-signed_area(P).
R18 IF translate(P,t)=Q THEN perimeter(Q)=perimeter(P).
R19 IF translate(P,t)=Q THEN area(Q)=area(P).
R20 IF rotate(P,theta)=Q THEN area(Q)=area(P).
R21 IF rotate(P,theta)=Q THEN perimeter(Q)=perimeter(P).
R22 IF scale(P,k)=Q AND k!=0 THEN perimeter(Q)=abs(k)*perimeter(P).
R23 IF scale(P,k)=Q AND k!=0 THEN area(Q)=k^2*area(P).
R24 IF congruent(P,Q) THEN area(P)=area(Q) AND perimeter(P)=perimeter(Q).
R25 IF similar(P,Q,scale=k) THEN area(Q)=k^2*area(P) for k>0.
R26 IF similar(P,Q,scale=k) THEN perimeter(Q)=k*perimeter(P) for k>0.
R27 IF RegularPolygon(P) THEN each_exterior_angle(P)=2*pi/n.
R28 IF RegularPolygon(P) THEN each_interior_angle(P)=(n-2)*pi/n.
R29 IF RegularPolygon(P) AND side_length(P)=s THEN area(P)=n*s^2/(4*tan(pi/n)).
R30 IF Triangle(P) THEN interior_angle_sum(P)=pi.
R31 IF Quadrilateral(P) THEN interior_angle_sum(P)=2*pi.
R32 IF ConvexPolygon(P) THEN every interior angle is strictly less than pi, provided no collinear consecutive edges.
R33 IF a point is strictly inside PolygonalRegion(P) THEN point_in_polygon(P,point)=inside.
R34 IF a point lies on boundary(P) THEN point_in_polygon(P,point)=boundary.
R35 IF nonadjacent_edges_intersect(P) THEN NOT SimplePolygon(P).
R36 IF signed_area(P)=0 THEN reject centroid_by_shoelace(P) as undefined.
08 / REASONING PIPELINE
INPUT: polygon candidate with coordinates, units, ordering and provenance.
NORMALISE: verify finite coordinates; canonicalise units; preserve original vertex order.
VALIDATE: n>=3; no zero-length edges; closure; pairwise intersection constraints; nonzero area.
CLASSIFY: determine orientation, convexity, n-gon category and optional regularity.
DERIVE: compute perimeter, area, centroid, interior-angle sum and triangulation count.
CHECK: compare independently calculated invariants where available.
EMIT: typed graph facts with assumptions, confidence and derivation trace.
FAIL: return precise diagnostic, never silently reinterpret a self-intersecting path.
09 / WORKED EXAMPLES
E01 Triangle [(0,0),(4,0),(0,3)]: area=6; perimeter=12; orientation=counterclockwise.
E02 Unit square [(0,0),(1,0),(1,1),(0,1)]: area=1; perimeter=4; centroid=(0.5,0.5).
E03 Rectangle 2x3: area=6; perimeter=10; quadrilateral, convex, not regular.
E04 Regular pentagon: n=5; interior angle=108 degrees; diagonal count=5.
E05 Regular hexagon: n=6; interior angle=120 degrees; diagonal count=9.
E06 Simple heptagon: n=7; interior-angle sum=900 degrees; triangulation triangles=5.
E07 Square with reversed order: signed area changes sign; area unchanged.
E08 Triangle scaled by factor 3: perimeter triples; area becomes nine times original.
E09 Concave simple pentagon: triangulation triangles=3, although convexity is false.
E10 Self-crossing bow-tie chain: rejected as SimplePolygon; requires separate generalised path semantics.
E11 Triangle [(0,0),(2,0),(0,2)]: area=2; centroid=(2/3,2/3).
E12 Regular triangle of side 2: area=sqrt(3); perimeter=6.
E13 Regular square of side 2: inradius=1; circumradius=sqrt(2).
E14 Convex octagon: interior-angle sum=1080 degrees; diagonal count=20.
E15 Polygon with a hole: classify as GeneralPolygonalRegion, not a single SimplePolygon.
E16 Collinear three-point closed chain: zero area; reject as nondegenerate simple polygon.
10 / SEMANTIC EQUIVALENCE
SEMANTIC_EQUIVALENCE("polygon", "simple closed polygonal chain") WHEN non-self-intersecting, nondegenerate, Euclidean context.
SEMANTIC_EQUIVALENCE("n-gon", "polygon with n sides") WHEN n>=3.
SEMANTIC_EQUIVALENCE("equilateral and equiangular polygon", "regular polygon") WHEN simple Euclidean polygon.
SEMANTIC_EQUIVALENCE("polygon boundary", "closed sequence of polygon edges") WHEN edge incidence validated.
NOT_EQUIVALENT("polygonal path", "simple polygon") WITHOUT simplicity and closure.
NOT_EQUIVALENT("polygon", "polygonal region") WHEN boundary/interior distinction matters.
NOT_EQUIVALENT("equilateral polygon", "regular polygon") WITHOUT equiangularity.
NOT_EQUIVALENT("equiangular polygon", "regular polygon") WITHOUT equilateralness.
11 / KNOWLEDGE GRAPH TRIPLES
(Polygon, rdf:type, GeometricEntity)
(Polygon, hasPart, Vertex)
(Polygon, hasPart, Edge)
(Polygon, bounds, PolygonalRegion)
(Triangle, subClassOf, SimplePolygon)
(Quadrilateral, subClassOf, SimplePolygon)
(RegularPolygon, subClassOf, ConvexPolygon)
(ConvexPolygon, subClassOf, SimplePolygon)
(ConcavePolygon, subClassOf, SimplePolygon)
(Polygon, hasMetric, Area)
(Polygon, hasMetric, Perimeter)
(Polygon, hasTopologicalProperty, Simplicity)
(Polygon, hasOrientation, Orientation)
(Polygon, admitsTransformation, EuclideanIsometry)
(Polygon, admitsDecomposition, Triangulation)
12 / CONFIDENCE
CONFIDENCE.math_definition = 1.00 WHEN assumptions satisfied.
CONFIDENCE.exact_symbolic_derivation = 1.00 WHEN verified by valid algebraic proof.
CONFIDENCE.numeric_geometry = calibrated score based on precision and robustness.
CONFIDENCE.source_alignment = unverified until source page is compared.
CONFIDENCE.invalid_input = 0.00 for claims requiring SimplePolygon.
Do not interpret confidence as probability of a mathematical theorem being true.
13 / FLOW_HASH
FLOW_HASH.algorithm = SHA-256
FLOW_HASH.input = canonical UTF-8 representation of ontology body and version
FLOW_HASH.value = COMPUTE_AT_INGESTION
FLOW_HASH.policy = recalculate after any semantic or structural edit
14 / UPDATE_MODEL
UPDATE_MODEL.version = 4.0
UPDATE_MODEL.mode = versioned, append-only provenance
UPDATE_MODEL.trigger = new definitions, corrected examples, revised mathematical assumptions, source-page changes
UPDATE_MODEL.validation = syntax check + theorem-condition check + example verification + graph integrity
UPDATE_MODEL.compatibility = preserve stable entity IDs and record changed relation semantics
UPDATE_MODEL.source_sync = pending independent comparison with source page
15 / AI_CONSUMPTION
AI_CONSUMPTION.format = UTF-8 plain text
AI_CONSUMPTION.primary_entity = Polygon
AI_CONSUMPTION.parser = typed entities + predicates + rule identifiers
AI_CONSUMPTION.require_assumptions = true
AI_CONSUMPTION.require_provenance = true
AI_CONSUMPTION.distinguish_boundary_and_region = true
AI_CONSUMPTION.distinguish_simple_and_self_intersecting = true
AI_CONSUMPTION.units = explicit
AI_CONSUMPTION.inference = sound rule application only
AI_CONSUMPTION.unknowns = preserve unknown rather than guess
AI_CONSUMPTION.output = validated facts + evidence + confidence + derivation trace
16 / QUALITY GATES
Q01 All examples must satisfy their stated assumptions.
Q02 Every geometric computation must use compatible units.
Q03 Signed orientation must not be confused with unsigned area.
Q04 Regularity requires both equal sides and equal angles.
Q05 Non-simple chains must not inherit simple-polygon theorems.
Q06 Holes require explicit boundary components and region topology.
Q07 Numerical robustness must be checked near collinearity and edge intersection.
Q08 Source-page alignment must not be asserted without verification.
END FLOW ALGEBRA