Symbolic Demonstrations

Executable pure-symbolic Python demonstrations (Model(…, auto_intersect=False)) verifying every geometric construction, polyhedral invariant, sphere-packing density, cyclotomic minimal polynomial, uniform planar tessellation, and harmonic orbital law in geometor.kepler with zero floating-point coordinates.

1. Mysterium Cosmographicum — Five Regular Solids & Graz 1595 Nesting

Derives the insphere/circumsphere radius and quadrance ratios of the five Platonic solids directly from exact 3D vertex sets over $\mathbb{Q}(\phi)$, proves polar-duality equality ($\text{Cube} = \text{Octahedron}$ with $Q_{\text{in}}/Q_{\text{out}} = \frac{1}{3}$; $\text{Dodecahedron} = \text{Icosahedron}$ with $Q_{\text{in}}/Q_{\text{out}} = \frac{5 + 2\sqrt{5}}{15}$), propagates the six heliocentric planetary orbs from Terra ($R = 1$), and constructs Kepler’s July 19, 1595 Graz Great-Conjunction planar diagram.

 1#!/usr/bin/env python3
         2"""Pure-symbolic demonstration of Kepler's *Mysterium Cosmographicum* (1596/1621)."""
         3
         4from __future__ import annotations
         5
         6import sys
         7from pathlib import Path
         8
         9_ROOT = Path(__file__).resolve().parents[1]
        10for _p in (_ROOT / "src", _ROOT.parent / "model" / "src"):
        11    if _p.exists() and str(_p) not in sys.path:
        12        sys.path.insert(0, str(_p))
        13
        14import sympy as sp  # noqa: E402
        15from rich.console import Console  # noqa: E402
        16from rich.table import Table  # noqa: E402
        17
        18from geometor.kepler.mysterium_spheres import (  # noqa: E402
        19    compute_nested_planetary_radii,
        20    construct_mysterium_planar_nesting,
        21    derive_platonic_sphere_ratios,
        22    verify_polar_duality_ratios,
        23)
        24
        25
        26def main() -> int:
        27    console = Console()
        28    console.print("[bold gold1]Mysterium Cosmographicum (1596 / 1621)[/bold gold1] — Exact Symbolic Verification\n")
        29
        30    t_solids = Table(title="Five Regular Solids — Exact Insphere / Circumsphere Ratios")
        31    t_solids.add_column("Solid", style="cyan")
        32    t_solids.add_column("Rank")
        33    t_solids.add_column("Planetary Pair")
        34    t_solids.add_column("Q_in / Q_out", style="green")
        35    t_solids.add_column("r_in / R_out", style="yellow")
        36
        37    for s in derive_platonic_sphere_ratios():
        38        t_solids.add_row(
        39            f"{s.name} ({s.latin_name})",
        40            s.rank_class,
        41            f"{s.planet_outer} -> {s.planet_inner}",
        42            str(s.q_in_over_q_out),
        43            str(sp.simplify(s.r_in_over_r_out)),
        44        )
        45    console.print(t_solids)
        46
        47    duality = verify_polar_duality_ratios()
        48    for check_name, ok in duality.items():
        49        assert ok, f"Failed check: {check_name}"
        50    console.print(f"\nPolar-duality invariants proved: {duality}\n")
        51
        52    t_orbs = Table(title="Heliocentric Nested Orbs (Earth = 1, Circulus mensor omnium)")
        53    t_orbs.add_column("Planet", style="cyan")
        54    t_orbs.add_column("Polyhedral Gap")
        55    t_orbs.add_column("Exact Symbolic Radius", style="green")
        56    t_orbs.add_column("Polyhedral (evalf 4d)", justify="right")
        57    t_orbs.add_column("Copernican Mean AU", justify="right")
        58
        59    for orb in compute_nested_planetary_radii():
        60        t_orbs.add_row(
        61            orb.planet,
        62            orb.intervening_solid or "Circulus mensor omnium",
        63            str(orb.symbolic_radius),
        64            f"{float(orb.symbolic_radius.evalf()):.4f}",
        65            f"{float(orb.copernican_mean_au):.4f}",
        66        )
        67    console.print(t_orbs)
        68
        69    model = construct_mysterium_planar_nesting()
        70    pts = model.points
        71    assert all(not p.x.has(sp.Float) and not p.y.has(sp.Float) for p in pts)
        72    console.print(
        73        f"\nGraz 1595 planar construction verified: {len(pts)} exact symbolic points, "
        74        "zero floating-point coordinates."
        75    )
        76    return 0
        77
        78
        79if __name__ == "__main__":
        80    raise SystemExit(main())
        

Run locally:

/home/phi/PROJECTS/geometor/.venv/bin/python demos/mysterium_spheres.py
        

2. Strena seu de Nive Sexangula — Rhombic Zonohedra, Close-Packing & Fibonacci

Verifies the exact 3D geometry of the space-filling Rhombic Dodecahedron (12 faces, 14 vertices, 24 edges, diagonal ratio $\sqrt{2}:1$, dihedral $120^\circ$) and the Golden Rhombic Triacontahedron (30 faces, 32 vertices, 60 edges, diagonal ratio $\phi:1$, dihedral $144^\circ$), proves FCC/HCP sphere close-packing density $\frac{\pi}{3\sqrt{2}}$ ($\sqrt{2}$ times denser than simple cubic $\frac{\pi}{6}$), constructs the 7-circle hexagonal close-packing rosette, and checks Cassini’s determinant across Kepler’s Fibonacci ratios converging to $\phi$.

 1#!/usr/bin/env python3
         2"""Pure-symbolic demonstration of Kepler's *Strena seu de Nive Sexangula* (1611)."""
         3
         4from __future__ import annotations
         5
         6import sys
         7from pathlib import Path
         8
         9_ROOT = Path(__file__).resolve().parents[1]
        10for _p in (_ROOT / "src", _ROOT.parent / "model" / "src"):
        11    if _p.exists() and str(_p) not in sys.path:
        12        sys.path.insert(0, str(_p))
        13
        14import sympy as sp  # noqa: E402
        15from rich.console import Console  # noqa: E402
        16from rich.table import Table  # noqa: E402
        17
        18from geometor.kepler.strena_packing import (  # noqa: E402
        19    analyze_rhombic_dodecahedron,
        20    analyze_rhombic_triacontahedron,
        21    compute_fibonacci_phyllotaxis,
        22    construct_hexagonal_rosette,
        23    verify_kepler_sphere_packing,
        24)
        25
        26
        27def main() -> int:
        28    console = Console()
        29    console.print("[bold gold1]Strena seu de Nive Sexangula (1611)[/bold gold1] — Exact Symbolic Verification\n")
        30
        31    rd = analyze_rhombic_dodecahedron()
        32    rt = analyze_rhombic_triacontahedron()
        33    t_poly = Table(title="Kepler's Two Isohedral Rhombic Polyhedra")
        34    t_poly.add_column("Polyhedron", style="cyan")
        35    t_poly.add_column("F / V / E")
        36    t_poly.add_column("Edge Q")
        37    t_poly.add_column("Diagonal Ratio", style="green")
        38    t_poly.add_column("Dihedral Angle", style="yellow")
        39    t_poly.add_column("Space-Filling")
        40    for m in (rd, rt):
        41        t_poly.add_row(
        42            f"{m.name} ({m.latin_name})",
        43            f"{m.faces} / {m.vertices} / {m.edges}",
        44            str(m.edge_quadrance),
        45            f"({m.diagonal_ratio}) : 1",
        46            f"{m.dihedral_angle_deg} deg (cos = {m.dihedral_cosine})",
        47            str(m.space_filling),
        48        )
        49    console.print(t_poly)
        50
        51    pack = verify_kepler_sphere_packing()
        52    console.print(
        53        f"\nSphere Close-Packing (Kepler Conjecture):\n"
        54        f"  • Simple Cubic (kissing {pack.simple_cubic_kissing}): {pack.simple_cubic_density}\n"
        55        f"  • FCC / HCP Close-Packed (kissing {pack.close_packed_kissing}): {pack.close_packed_density}\n"
        56        f"  • Exact Density Ratio (Close / Cubic): {pack.density_ratio_close_over_cubic}\n"
        57    )
        58
        59    t_fib = Table(title="Botanical Pentamery & Fibonacci Convergence to phi")
        60    t_fib.add_column("n", justify="right")
        61    t_fib.add_column("F_{n+1} / F_n", style="green")
        62    t_fib.add_column("Cassini F_{n+1}F_{n-1} - F_n^2", justify="right", style="yellow")
        63    for row in compute_fibonacci_phyllotaxis(9):
        64        t_fib.add_row(str(row.index), str(row.ratio_next_over_curr), str(row.cassini_determinant))
        65    console.print(t_fib)
        66
        67    rosette = construct_hexagonal_rosette()
        68    pts = rosette.points
        69    assert all(not p.x.has(sp.Float) and not p.y.has(sp.Float) for p in pts)
        70    console.print(
        71        f"\n7-Circle Hexagonal Rosette verified: {len(pts)} exact symbolic points, "
        72        "zero floating-point coordinates."
        73    )
        74    return 0
        75
        76
        77if __name__ == "__main__":
        78    raise SystemExit(main())
        

Run locally:

/home/phi/PROJECTS/geometor/.venv/bin/python demos/strena_packing.py
        

3. Harmonices Mundi & 1597 Kepler Right Triangle

Constructs the Kepler Right Triangle $(1, \sqrt{\phi}, \phi)$ over $\mathbb{Q}(\sqrt{\phi})$ purely from $(0,0)$ and $(1,0)$ by Euclidean ruler-and-compass intersections, classifies constructible polygons (Scibilia) against the irreducible cubic of the regular heptagon ($x^3 + x^2 - 2x - 1 = 0$) and Jost Bürgi’s cossic chord sextic ($y^6 - 7y^4 + 14y^2 - 7 = 0$), derives all 11 uniform Archimedean planar tilings from scratch, and verifies Kepler’s Harmonic Third Law $(T_1/T_2)^2 = (a_1/a_2)^3$.

 1#!/usr/bin/env python3
         2"""Pure-symbolic demonstration of *Harmonices Mundi* (1619) & 1597 Kepler Triangle."""
         3
         4from __future__ import annotations
         5
         6import sys
         7from pathlib import Path
         8
         9_ROOT = Path(__file__).resolve().parents[1]
        10for _p in (_ROOT / "src", _ROOT.parent / "model" / "src"):
        11    if _p.exists() and str(_p) not in sys.path:
        12        sys.path.insert(0, str(_p))
        13
        14import sympy as sp  # noqa: E402
        15from rich.console import Console  # noqa: E402
        16from rich.table import Table  # noqa: E402
        17
        18from geometor.kepler.harmonices_geometry import (  # noqa: E402
        19    analyze_planetary_harmonies,
        20    classify_polygon_scibilitas,
        21    construct_kepler_right_triangle,
        22    enumerate_archimedean_planar_tilings,
        23    verify_heptagon_cubic_obstruction,
        24    verify_kepler_third_law,
        25    verify_maestlin_1597_decimal,
        26)
        27
        28
        29def main() -> int:
        30    console = Console()
        31    console.print("[bold gold1]Harmonices Mundi (1619) & Kepler Triangle (1597)[/bold gold1]\n")
        32
        33    kt_model = construct_kepler_right_triangle()
        34    pts = kt_model.points
        35    assert all(not p.x.has(sp.Float) and not p.y.has(sp.Float) for p in pts)
        36    maestlin = verify_maestlin_1597_decimal()
        37    console.print(
        38        f"Kepler Right Triangle proved ({len(pts)} exact symbolic points over Q(sqrt(phi))).\n"
        39        f"Mästlin 1597 decimal 0.6180340 accurate to 7 places: {maestlin['accurate_to_7_places']}\n"
        40    )
        41
        42    t_scib = Table(title="Book I — Scibilitas vs. Inscibilitas of Regular Polygons")
        43    t_scib.add_column("n", justify="right")
        44    t_scib.add_column("Polygon", style="cyan")
        45    t_scib.add_column("MinPoly of 2*cos(2*pi/n)", style="green")
        46    t_scib.add_column("Deg", justify="right")
        47    t_scib.add_column("Scibilis?", style="yellow")
        48    for p in classify_polygon_scibilitas():
        49        t_scib.add_row(
        50            str(p.n_sides),
        51            p.name,
        52            str(p.minimal_poly_2cos.as_expr()),
        53            str(p.algebraic_degree),
        54            "YES" if p.constructible else "NO (Inscibilis)",
        55        )
        56    console.print(t_scib)
        57
        58    hept = verify_heptagon_cubic_obstruction()
        59    console.print(
        60        f"\nHeptagon Prop. XLV cubic irreducible: {hept['cubic_irreducible']} | "
        61        f"Bürgi sextic: {hept['buergi_chord_minpoly'].as_expr()} = 0\n"
        62    )
        63
        64    tilings = enumerate_archimedean_planar_tilings()
        65    console.print(
        66        f"Book II — Derived all {len(tilings)} uniform Archimedean planar tilings:\n  "
        67        + ", ".join(t.notation for t in tilings)
        68        + "\n"
        69    )
        70
        71    t_harm = Table(title="Book V — Planetary Extremal Harmonies & Lex Tertia")
        72    t_harm.add_column("Planet", style="cyan")
        73    t_harm.add_column("Aphelion / Perihelion (\"/day)", justify="right")
        74    t_harm.add_column("Ratio", style="green")
        75    t_harm.add_column("Musical Consonance", style="yellow")
        76    for h in analyze_planetary_harmonies():
        77        t_harm.add_row(
        78            h.planet,
        79            f"{h.aphelion_arcsec_per_day} / {h.perihelion_arcsec_per_day}",
        80            str(h.harmonic_ratio_aph_over_per),
        81            h.musical_interval,
        82        )
        83    console.print(t_harm)
        84
        85    law3 = verify_kepler_third_law()
        86    console.print(f"\nKepler's Third Law verified: {law3}")
        87    return 0
        88
        89
        90if __name__ == "__main__":
        91    raise SystemExit(main())
        

Run locally:

/home/phi/PROJECTS/geometor/.venv/bin/python demos/harmonices_geometry.py