SymPy geometry

L1 Instance · Archetype: analytic-cas · upstream · dossier

Believe it because exact arithmetic on concrete coordinates evaluates the predicate to True — subject to SymPy’s simplification heuristics.

Trust chain

SymPy trust chain

Ontology

Coordinate entities: Point, Line, Segment, Circle, Polygon over SymPy expressions. (What exists?)

Language

Python predicates: Point.is_collinear(A, B, C), Point.is_concyclic(…). (How is a statement written?)

Assumptions

Field arithmetic over exact SymPy numbers. (What is taken as given?)

Engine

Expression evaluation; simplify / equals; rank with a numeric zero test. (How are new truths derived?)

Certificate

A boolean. (What evidence is left behind?)

Checker

SymPy simplification heuristics + mpmath. (What must be trusted?)

Semantics

One concrete figure (or symbolic coordinates). (What model makes it sound?)

At a glance

Logic / calculus:

Evaluation

Exact vs numeric:

Exact inputs; heuristic zero tests

Decision procedure:

Heuristic (simplify)

Role of the diagram:

The object is the computation

Degeneracy handling:

Visible in the instance

Trusted base (size):

~12k lines + SymPy core

Trusts:

SymPy simplification (core heuristics + mpmath)

Catalog:

109 principles (23 shared with other systems) — search

A statement in its own language

from sympy import Point
        Point.is_collinear(Point(0, 0), Point(1, 1), Point(2, 2))   # True
        

Source: point.py

Findings

  • Point.affine_rank (behind is_collinear) zero-tests with abs(x.n(2)) < 1e-12 — a 2-digit numeric test, marked ‘XXX fragile’ (point.py:333-334).

  • Float inputs are silently rationalized via nsimplify (point.py:165-168).

  • Triangle.excenters has a live formula bug (polygon.py:2714-2726).

References