Demonstrations¶
100% Exact Symbolic SymPy & Rational Trigonometry Proofs of Nicomachus’s Arithmetical Geometry
In strict accordance with GEOMETOR’s Content / Code Separation, the historical Book Codex (Introduction to Arithmetic) contains zero embedded Python scripts. All executable symbolic proofs, ratio trees, figurate gnomon dissections, semicircle mean constructions, and polyhedral cube models live in geometor.nicomachus and the runnable demos/*.py scripts documented below—verified over exact SymPy rationals \(\mathbb{Q}\) and quadratic radicals \(\mathbb{Q}(\sqrt{ac})\) with Model(..., auto_intersect=False) and zero floating-point approximations.
1. Book I, Chs. 13, 16, 17–23 & Book II, Chs. 1–2 — Ratio Taxonomy & the Equality Unfolding Tree¶
Codex Reference: Book I, Ch. 23 — The Equality Unfolding Tree (Critical Notes) · Script: demos/equality_tree.py
Symbolic Verification: Starting from Equality (1, 1, 1), direct application of
NICOMACHUS_MATRIX_N1\((a, a+b, a+2b+c)\) generates the multiple spine (1, 2, 4), (1, 3, 9), (1, 4, 16). Reversing a multiple triple before applying the rule (NICOMACHUS_MATRIX_N2) births the superparticulars (4, 6, 9) (hemiolios \(3:2\)) and (9, 12, 16) (epitritos \(4:3\)), while direct vs. reversed children of superparticulars generate multiple superparticulars (4, 10, 25) and superpartients (9, 15, 25). Conversely, reducetoequality reduces every coprime geometric progression \((p^2, pq, q^2)\) back to(1, 1, 1).
from geometor.nicomachus import (
classify_nicomachean_ratio,
generate_equality_tree,
reduce_to_equality,
verify_equality_identities,
)
info = classify_nicomachean_ratio(9, 8)
assert info["species_key"] == "superparticularis"
tree = generate_equality_tree(max_depth=3)
assert tree[0].terms == (1, 1, 1)
steps = reduce_to_equality(9, 24, 64)
assert steps[-1].after == (1, 1, 1)
assert verify_equality_identities()["verified_tree_nodes"] == 16
2. Book II, Chs. 6–20 — Polygonal Alpha-Gnomons, Same/Other & Nicomachus’s Sum-of-Cubes Theorem¶
Codex Reference: Book II, Ch. 20 — Sum of Cubes from Odd Blocks (Critical Notes) · Script: demos/figurate_gnomons.py
Symbolic Verification: In
construct_nicomachus_cubes_model(order=4), ageometor.model.Model(auto_intersect=False)constructs the \(T_n \times T_n\) square bordered at triangular coordinates \(T_k = \frac{k(k+1)}{2}\). Each \(k\)-th L-gnomon has exact symbolic area \(T_k^2 - T_{k-1}^2 = k^3\) and equals the sum of the \(k\)-element odd block {13, 15, 17, 19} = 64 = 43, whilesieve_of_eratosthenesandeuclid_nicomachus_perfect_numbersverify Book I, Chs. 13 & 16.
from geometor.nicomachus import (
construct_nicomachus_cubes_model,
euclid_nicomachus_perfect_numbers,
sieve_of_eratosthenes,
verify_figurate_identities,
)
sieve = sieve_of_eratosthenes(35)
assert sieve["odd_primes"][:6] == (3, 5, 7, 11, 13, 17)
assert [row["perfect_number"] for row in euclid_nicomachus_perfect_numbers(4)] == [6, 28, 496, 8128]
cubes = construct_nicomachus_cubes_model(order=4)
assert cubes.total_area == cubes.triangular_side**2 == 100
assert verify_figurate_identities()["nicomachus_cubes_verified"] is True
3. Book II, Chs. 21–29 — Semicircle Means, Ten Proportions & the Cube’s Teleiotatē Analogia¶
Codex Reference: Book II, Ch. 29 — The Most Perfect Proportion & Cube Harmony (Critical Notes) · Script: demos/ten_means_and_cube.py
Symbolic Verification: In
construct_three_classical_means_model(6, 12), exact circle-line and line-line intersections over \(\mathbb{Q}(\sqrt{2})\) establish radius OS = A = 9 (\(Q(O, S) = 81\)), ordinate QS = G = 6√2 (\(Q(Q, S) = 72\)), and radial projection SF = H = 8 (\(Q(S, F) = 64\)). Inconstruct_cube_proportion_model(), the Cube’s \(6\) faces, \(8\) vertices, and \(12\) edges embed \(6 : 8 :: 9 : 12\) with projective harmonic cross-ratio-1and every Pythagorean consonance (\(2:1, 3:2, 4:3, 9:8\)).
from geometor.model.invariants import quadrance
from geometor.nicomachus import (
compute_all_ten_means,
construct_cube_proportion_model,
construct_three_classical_means_model,
verify_cube_proportion_identities,
verify_ten_means_identities,
)
m = construct_three_classical_means_model(6, 12)
assert quadrance(m.get_element_by_ID("O"), m.get_element_by_ID("S")) == 81 # A^2 = 9^2
assert quadrance(m.get_element_by_ID("Q"), m.get_element_by_ID("S")) == 72 # G^2 = 6 * 12
assert quadrance(m.get_element_by_ID("S"), m.get_element_by_ID("F")) == 64 # H^2 = 8^2
assert len(compute_all_ten_means(4, 12)) == 10
cube = construct_cube_proportion_model()
assert cube.cube_counts == {"faces": 6, "vertices": 8, "edges": 12}
assert cube.projective_cross_ratio == -1
assert all(verify_ten_means_identities().values())
assert all(verify_cube_proportion_identities().values())