Mathematical Verification & Stamp of Trust¶
Because algebrax implements foundational linear algebra, semirings, discrete exterior calculus, spectral transforms,
and Lie algebras in 100% pure Python with zero required runtime dependencies, mathematical correctness cannot be
left to conventional unit tests alone.
To earn a verifiable Stamp of Trust, algebrax employs a Multi-Layered Verification Suite housed under
tests/verifications/ (alongside the built-in law verifier in tests/algebrax/test_verification.py). Every
mathematical claim is continuously cross-checked against external industry-standard reference engines (NumPy,
SciPy, LAPACK, PocketFFT) and rigorous mathematical invariants.
1. Verification Methodologies & Categories¶
Each test in tests/verifications/ is categorized by its formal verification methodology and pytest marker:
| Category / Marker | Verification Methodology | How It Establishes Mathematical Truth |
|---|---|---|
differential |
Comparative / Differential Oracle Testing (McKeeman, 1998) | Pits algebrax sparse dictionary algorithms directly against battle-tested C/Fortran reference libraries (numpy.linalg, scipy.linalg, scipy.sparse.linalg, numpy.fft, scipy.signal) across deterministic and Hypothesis-generated inputs. |
axiomatic |
Property-Based Algebraic Law Testing (MacIver et al., 2019) | Uses Hypothesis to generate adversarial random inputs (including \(\pm\infty\), boundary probabilities, and exact rationals) and verifies universal algebraic axioms (associativity, commutativity, distributivity, identity, annihilation). |
Exact Rational |
Infinite-Precision \(\mathbb{Q}\) Verification | Evaluates semirings and matrix operations over Python's exact fractions.Fraction field, eliminating IEEE 754 floating-point rounding tolerances (\(\epsilon = 0\)). |
metamorphic |
Metamorphic Invariant Relations (Chen et al., 1998) | Verifies necessary structural conservation laws across input transformations when no external oracle exists (e.g., \((A \otimes B)^T = B^T \otimes A^T\), boundary nilpotency \(\partial^2 = 0\), graph vertex permutation conjugacy \(L(P A P^T) = P L(A) P^T\)). |
pit |
Schwartz–Zippel Polynomial Identity Testing (Schwartz, 1980; Saxena, 2014) | Defeats exponential symbolic monomial blowup by evaluating high-degree identities (such as the Jacobi identity on 14-dimensional \(\mathfrak{g}_2\) and 52-dimensional \(\mathfrak{f}_4\)) at random integer coordinates in \(S \subset \mathbb{Z}\), bounding false-positive error probability to \(\le (d/ \lvert S \rvert)^k \le 10^{-16}\). |
certificates |
Proof-Carrying Solver (PCS) Witnesses | Verifies the output of expensive \(O(N^3)\) numerical solvers (e.g., Helmholtz–Hodge decomposition, LU, QR, Cholesky, SVD, CG, Fiedler) via fast, independent \(O(\text{nnz})\) algebraic witness checks (orthogonality, curl/divergence annihilation, exact reconstruction). |
mms |
Method of Manufactured Solutions (Roache, 2002) | Injects exact analytical harmonic extensions and boundary conditions to verify discrete exterior calculus, PDE diffusion, and sheaf Laplacians against known solutions. |
smt |
Two-Tier Grounded SMT / Z3 Formal Proofs (de Moura & Bjørner, 2008) |
Tier 1 directly executes live algebrax code (DualNumberAlgebra, ExpectationSemiring, BinomialConvolutionSemiring, matrix.dot, transpose, MatrixCategory.compose) on z3.ArithRef expressions using test-local Z3 carriers (zero Z3 hooks in src/). Tier 2 pairs universal check(Not(Law)) == unsat proofs for branching structures and 3-node LawvereMetricCategory tropical closure with exhaustive / Z3-model / Hypothesis live conformance and meta-falsification (timeout=5000, < 5s). |
2. Traceability Matrix: Functionality \(\to\) Verification Test¶
The tables below map each algebrax module and function to the exact verification test function, verification category,
external oracle or mathematical law verified, and numerical precision.
2.1. Sparse Linear Algebra & Solvers (algebrax.matrix)¶
| AlgebraX Function | Verification Category | Reference Oracle / Mathematical Law | Test File & Function | Precision / Tolerance |
|---|---|---|---|---|
ax.matrix.dot(A, B) |
Comparative (differential) |
numpy.matmul(A, B) |
differential/test_linalg_and_tensors.py::test_differential_matrix_multiplication_and_addition |
\(10^{-10}\) |
ax.matrix.dot(A, B) |
Comparative + Property (differential) |
numpy.matmul(A, B) over Hypothesis \(4 \times 4\) matrices |
differential/test_linalg_and_tensors.py::test_hypothesis_differential_matmul_and_lu |
\(10^{-9}\) |
ax.matrix.dot(A, B, semiring) |
Metamorphic (metamorphic) |
Transpose duality \((A \otimes B)^T = B^T \otimes A^T\) & scalar homogeneity \(c(AB) = (cA)B\) | test_metamorphic_invariants.py::test_metamorphic_matrix_transpose_duality, test_metamorphic_invariants.py::test_metamorphic_scalar_homogeneity |
\(10^{-10}\) |
ax.matrix.add(A, B) / subtract(A, B) |
Comparative (differential) |
numpy.add(A, B) / numpy.subtract(A, B) |
differential/test_linalg_and_tensors.py::test_differential_matrix_multiplication_and_addition |
\(10^{-12}\) |
ax.matrix.transpose(A) |
Comparative (differential) |
numpy.transpose(A) |
differential/test_linalg_and_tensors.py::test_differential_transpose_trace_and_frobenius |
\(10^{-12}\) |
ax.matrix.trace(A) |
Comparative (differential) |
numpy.trace(A) |
differential/test_linalg_and_tensors.py::test_differential_transpose_trace_and_frobenius |
\(10^{-12}\) |
ax.matrix.frobenius_inner(A, B) |
Comparative (differential) |
numpy.sum(A * B) (\(\operatorname{Tr}(A^T B)\)) |
differential/test_linalg_and_tensors.py::test_differential_transpose_trace_and_frobenius |
\(10^{-11}\) |
ax.matrix.power(A, k) |
Comparative (differential) |
numpy.linalg.matrix_power(A, k) for \(k \in \{0, 1, 2, 5\}\) |
differential/test_linalg_and_tensors.py::test_differential_matrix_power |
\(10^{-10}\) |
ax.matrix.mat_vec, vec_mat, inner, vec_norm, vec_axpy |
Comparative (differential) |
A @ x, x @ A, np.dot(x, y), np.linalg.norm(x), \(\alpha x + y\) |
differential/test_linalg_and_tensors.py::test_differential_mat_vec_and_vec_ops |
\(10^{-11}\) |
ax.matrix.block_diag([A, B]) |
Comparative (differential) |
scipy.linalg.block_diag(A, B) |
differential/test_linalg_and_tensors.py::test_differential_block_diag_vs_scipy_block_diag |
\(10^{-12}\) |
ax.matrix.commutator(A, B) & kronecker_delta(i, j) |
Comparative (differential) |
A @ B - B @ A & \(\delta_{ij}\) identity |
differential/test_linalg_and_tensors.py::test_differential_block_diag_vs_scipy_block_diag |
\(10^{-12}\) |
ax.matrix.inverse(A) |
Comparative (differential) |
numpy.linalg.inv(A) |
differential/test_linalg_and_tensors.py::test_differential_inverse_and_determinant |
\(10^{-9}\) |
ax.matrix.academic.determinant(A) |
Comparative (differential) |
numpy.linalg.det(A) & scipy.linalg.det(A) |
differential/test_linalg_and_tensors.py::test_differential_inverse_and_determinant |
\(10^{-9}\) |
ax.matrix.cg_solve(A, b) |
Comparative (differential) |
scipy.sparse.linalg.cg(A, b) & numpy.linalg.solve(A, b) |
differential/test_linalg_and_tensors.py::test_differential_cg_solve_vs_scipy_cg |
\(10^{-7}\) |
ax.matrix.laplacian_matrix(A) |
Metamorphic (metamorphic) |
Vertex permutation conjugacy \(L(P A P^T) = P L(A) P^T\) | test_metamorphic_invariants.py::test_metamorphic_graph_laplacian_permutation_conjugacy |
\(10^{-10}\) |
2.2. Matrix Decompositions (algebrax.matrix.decompose)¶
| AlgebraX Function | Verification Category | Reference Oracle / Certificate Checked | Test File & Function | Precision / Tolerance |
|---|---|---|---|---|
ax.matrix.cholesky(A) & recompose_cholesky |
Comparative + Certificate (differential) |
numpy.linalg.cholesky(A) entrywise match & \(L L^T = A\) |
differential/test_linalg_and_tensors.py::test_differential_cholesky_vs_numpy |
\(10^{-9}\) |
ax.matrix.lu_decompose(A) & recompose_lu |
Comparative + Certificate (differential) |
scipy.linalg.lu(A) entrywise match, \(P A = L U\), unit lower \(L\), upper \(U\) |
differential/test_linalg_and_tensors.py::test_differential_lu_vs_scipy_lu, differential/test_linalg_and_tensors.py::test_hypothesis_differential_matmul_and_lu |
\(10^{-9}\) |
ax.matrix.qr(A) & recompose_qr |
Comparative + Certificate (differential) |
numpy.linalg.qr(A) (positive \(R\)-diagonal gauge), \(Q^T Q = I\), \(Q R = A\) |
differential/test_linalg_and_tensors.py::test_differential_qr_vs_numpy_qr |
\(10^{-8}\) |
ax.matrix.svd(A) & recompose_svd |
Comparative + Certificate (differential) |
numpy.linalg.svd(A) singular values \(\sigma_i\), \(U^T U = I\), \(V^T V = I\), \(U \Sigma V^T = A\) |
differential/test_linalg_and_tensors.py::test_differential_svd_vs_numpy_svd |
\(10^{-7}\) |
2.3. Multidimensional Tensors & Ecosystem Bridges (algebrax.tensor, algebrax.converters)¶
| AlgebraX Function | Verification Category | Reference Oracle / Mathematical Law | Test File & Function | Precision / Tolerance |
|---|---|---|---|---|
ax.tensor.einsum(subscripts, *T) |
Comparative (differential) |
numpy.einsum across 'ijk,jkl->il', 'bij,bjk->bik', 'ii->' |
differential/test_linalg_and_tensors.py::test_differential_tensor_einsum_vs_numpy |
\(10^{-10}\) |
ax.tensor.permute_tensor & unpermute_tensor |
Comparative + Involution (differential) |
numpy.transpose(T, axes=(2, 0, 1)) & exact inverse restoration |
differential/test_linalg_and_tensors.py::test_differential_tensor_permute_vs_numpy |
\(10^{-12}\) |
ax.converters.to_numpy / from_numpy |
Comparative (differential) |
Lossless 2D numpy.ndarray isomorphism |
differential/test_linalg_and_tensors.py::test_differential_numpy_and_scipy_converters |
\(10^{-12}\) |
ax.converters.to_scipy / from_scipy |
Comparative (differential) |
Lossless scipy.sparse (csr, csc, coo) isomorphism |
differential/test_linalg_and_tensors.py::test_differential_numpy_and_scipy_converters |
\(10^{-12}\) |
2.4. Spectral & Signal Transforms (algebrax.transforms)¶
| AlgebraX Function | Verification Category | Reference Oracle / Mathematical Law | Test File & Function | Precision / Tolerance |
|---|---|---|---|---|
ax.transforms.dft(x) & idft(X) |
Comparative + Property (differential) |
numpy.fft.fft(x) & numpy.fft.ifft(X) (deterministic & Hypothesis) |
differential/test_transforms.py::test_differential_dft_idft_and_hilbert, differential/test_transforms.py::test_hypothesis_differential_dft_and_wht |
\(10^{-8}\) – \(10^{-10}\) |
ax.transforms.dft(x) |
Metamorphic (metamorphic) |
Circular time-shift magnitude invariance \(\|\mathcal{F}(\text{shift}(x))\| = \|\mathcal{F}(x)\|\) | test_metamorphic_invariants.py::test_metamorphic_dft_circular_shift_invariance |
\(10^{-10}\) |
ax.transforms.hilbert(x) |
Comparative (differential) |
scipy.signal.hilbert(x) analytic signal |
differential/test_transforms.py::test_differential_dft_idft_and_hilbert |
\(10^{-10}\) |
ax.transforms.convolve & deconvolve |
Comparative + Inversion (differential) |
numpy.convolve(f, g) & spectral circular deconvolution recovery |
differential/test_transforms.py::test_differential_convolve_and_deconvolve |
\(10^{-9}\) – \(10^{-12}\) |
ax.transforms.walsh_hadamard & iwalsh_hadamard |
Comparative + Property (differential) |
scipy.linalg.hadamard(8) @ x & inverse round-trip (deterministic & Hypothesis) |
differential/test_transforms.py::test_differential_walsh_hadamard_vs_scipy_hadamard, differential/test_transforms.py::test_hypothesis_differential_dft_and_wht |
\(10^{-8}\) – \(10^{-11}\) |
ax.transforms.z_transform & iz_transform |
Comparative + Homomorphism (differential) |
numpy.polyval(f, 1/z), \(\mathcal{Z}\{f * g\} = \mathcal{Z}\{f\}\mathcal{Z}\{g\}\), & contour recovery |
differential/test_transforms.py::test_differential_z_transform_and_convolution_theorem |
\(10^{-9}\) – \(10^{-12}\) |
ax.transforms.gelfand_transform & legendre_fenchel |
Comparative + Convex Duality (differential) |
Character specialization to dft & walsh_hadamard; Fenchel–Young \(f(x)+f^*(s) \ge sx\) & Fenchel–Moreau \(f^{**} = f\) |
differential/test_transforms.py::test_differential_gelfand_and_legendre_fenchel_transforms |
\(10^{-11}\) – \(10^{-12}\) |
ax.transforms.lorentz_boost(v, beta) |
Metamorphic / Analytical (differential) |
Minkowski metric invariance \(t^2 - x^2 - y^2 - z^2 = \text{const}\) & \(-\beta\) inversion | differential/test_transforms.py::test_differential_lorentz_boost_minkowski_invariance |
\(10^{-11}\) |
2.5. Graph Calculus, Spectral Theory & Path Semirings (algebrax.analysis, algebrax.semiring)¶
| AlgebraX Function / Path Semiring | Verification Category | Reference Oracle / Mathematical Law | Test File & Function | Precision / Tolerance |
|---|---|---|---|---|
matrix.power(I + W, n-1, TropicalSemiring) |
Comparative + Property (differential) |
scipy.sparse.csgraph.floyd_warshall & networkx.floyd_warshall_numpy (all-pairs shortest paths) |
differential/test_path_semirings.py::test_differential_tropical_shortest_paths_vs_csgraph_and_networkx, differential/test_path_semirings.py::test_hypothesis_differential_tropical_apsp_and_laplacian |
\(10^{-11}\) – \(10^{-12}\) |
matrix.power(I + A, n-1, BooleanSemiring) |
Comparative (differential) |
networkx.transitive_closure(G, reflexive=True) & csgraph.floyd_warshall(unweighted=True) |
differential/test_path_semirings.py::test_differential_boolean_transitive_closure_vs_networkx_and_csgraph |
Exact (==) |
matrix.power(I + W, n-1, ArcticSemiring) |
Comparative (differential) |
networkx.dag_longest_path_length & negated-weight csgraph.floyd_warshall on DAGs |
differential/test_path_semirings.py::test_differential_arctic_longest_path_on_dag_vs_networkx |
\(10^{-12}\) |
matrix.power(I + C, n-1, BottleneckSemiring) |
Comparative (differential) |
networkx.maximum_spanning_tree unique path bottleneck capacity |
differential/test_path_semirings.py::test_differential_bottleneck_widest_path_vs_maximum_spanning_tree |
\(10^{-12}\) |
ViterbiSemiring & ReliabilitySemiring closure |
Comparative (differential) |
Log-domain isomorphism \(\exp(-\text{csgraph.floyd\_warshall}(-\ln P))\) | differential/test_path_semirings.py::test_differential_viterbi_and_reliability_vs_log_csgraph |
\(10^{-11}\) |
LogSemiring DAG partition function |
Comparative (differential) |
Resolvent \(\ln((I - P)^{-1})\) via scipy.linalg.inv |
differential/test_path_semirings.py::test_differential_log_semiring_dag_partition_function_vs_scipy_inv |
\(10^{-11}\) |
matrix.laplacian_matrix(W, normalized=None \| 'sym' \| 'rw') |
Comparative + Property (differential) |
networkx.laplacian_matrix, nx.normalized_laplacian_matrix, csgraph.laplacian, & \(I - D^{-1}W\) |
differential/test_spectral_graphs.py::test_differential_laplacian_matrices_vs_networkx_and_csgraph, differential/test_path_semirings.py::test_hypothesis_differential_tropical_apsp_and_laplacian |
\(10^{-11}\) – \(10^{-12}\) |
analysis.laplacian_spectrum(W) |
Comparative + Certificate (differential) |
scipy.linalg.eigh(L) eigenvalues, \(V^T V = I\), & residual \(\|L v_i - \lambda_i v_i\|_2\) |
differential/test_spectral_graphs.py::test_differential_laplacian_spectrum_vs_scipy_eigh |
\(10^{-6}\) |
analysis.fiedler_vector & algebraic_connectivity |
Comparative (differential) |
networkx.algebraic_connectivity & networkx.fiedler_vector (up to \(\pm 1\) sign) |
differential/test_spectral_graphs.py::test_differential_fiedler_vector_and_algebraic_connectivity_vs_networkx |
\(10^{-4}\) – \(10^{-5}\) |
analysis.spectral_bipartition(W) |
Comparative (differential) |
networkx.cut_size, nx.conductance, nx.normalized_cut_size |
differential/test_spectral_graphs.py::test_differential_spectral_bipartition_metrics_vs_networkx_cuts |
\(10^{-12}\) |
analysis.pagerank(W, damping, personalization, dangling) |
Comparative (differential) |
networkx.pagerank (standard, dangling sinks, & personalized random walks) |
differential/test_spectral_graphs.py::test_differential_pagerank_vs_networkx |
\(10^{-6}\) |
analysis.eigen_centrality(W) |
Comparative (differential) |
networkx.eigenvector_centrality_numpy |
differential/test_spectral_graphs.py::test_differential_eigen_centrality_vs_networkx |
\(10^{-5}\) |
analysis.gradient, divergence, laplacian |
Comparative + Adjoint (differential) |
nx.laplacian_matrix(G) @ f, \(\operatorname{div}(\operatorname{grad} f) = -2Lf\), & Green's identity \(\langle \nabla f, F \rangle_E = -\langle f, \operatorname{div} F \rangle_V\) |
differential/test_spectral_graphs.py::test_differential_gradient_divergence_laplacian_and_greens_identity |
\(10^{-11}\) |
analysis.laplacian_smoothing & gaussian_kernel |
Comparative (differential) |
np.linalg.matrix_power(I - tau * L, steps) @ f & \(\exp(-D^2 / 2\sigma^2)\) |
differential/test_spectral_graphs.py::test_differential_laplacian_smoothing_and_gaussian_kernel_vs_numpy |
\(10^{-11}\) – \(10^{-12}\) |
analysis.forman_ricci_curvature(W) |
Comparative (differential) |
Exact combinatorial curvature on \(C_n\) (\(\mathcal{F}=0\)) and \(K_n\) (\(\mathcal{F}=6-2n\) unaugmented, \(n\) augmented) | differential/test_spectral_graphs.py::test_differential_forman_ricci_curvature_vs_combinatorial_invariants |
\(10^{-12}\) |
2.6. Exact Symbolic Algebra, Lie, Galois, Clifford & Group Theory (algebrax.lie, algebrax.galois,¶
algebrax.clifford, algebrax.group, algebrax.rep)
| AlgebraX Function / Structure | Verification Category | Reference Oracle / Mathematical Law | Test File & Function | Precision / Tolerance |
|---|---|---|---|---|
matrix.academic.determinant, cofactor, adjoint, inverse over Fraction |
Comparative + Property (differential) |
sympy.Matrix (.det(), .cofactor_matrix(), .adjugate(), .inv()) over \(\mathbb{Q}\) & \(A A^{-1} = I\) |
differential/test_lie_galois_and_clifford.py::test_differential_exact_fraction_matrix_determinant_adjoint_and_inverse_vs_sympy, differential/test_lie_galois_and_clifford.py::test_hypothesis_exact_fraction_determinant_and_inverse_vs_sympy |
Exact (==, \(\epsilon = 0\)) |
lie.RootSystem.from_dynkin (\(A_n, B_n, C_n, D_n, G_2, F_4, E_6, E_7, E_8\)) |
Comparative (differential) |
sympy.liealgebras.RootSystem Cartan matrix, \(\det C\), \(\lvert\Phi^+\rvert\), and symmetrizing factors \(d_i A_{ij} = d_j A_{ji}\) |
differential/test_lie_galois_and_clifford.py::test_differential_root_systems_and_cartan_matrices_vs_sympy |
Exact (==, \(\epsilon = 0\)) |
lie.LieAlgebra.bch(x, y, order=1..4) |
Comparative (differential) |
scipy.linalg.expm(X) @ scipy.linalg.expm(Y) vs. scipy.linalg.expm(BCH(X, Y)) on \(\mathfrak{so}_3, \mathfrak{sl}_2, \mathfrak{su}_2, \mathfrak{se}_3\) |
differential/test_lie_galois_and_clifford.py::test_differential_lie_bch_series_vs_scipy_expm |
\(10^{-6}\) |
lie.LieAlgebra.adjoint_matrix, killing_form, is_semisimple |
Comparative (differential) |
\([\operatorname{ad}_X, \operatorname{ad}_Y] = \operatorname{ad}_{[X, Y]}\), \(B(X,Y) = \operatorname{Tr}(\operatorname{ad}_X \operatorname{ad}_Y)\), ad-invariance \(B([X,Y],Z) + B(Y,[X,Z]) = 0\), Cartan criterion | differential/test_lie_galois_and_clifford.py::test_differential_lie_adjoint_homomorphism_and_killing_form |
\(10^{-10}\) – \(10^{-11}\) |
algebra.GaloisField (\(GF(2^8), GF(3^2), GF(3^3)\)) & galois.gf_matrix_mul |
Comparative (differential) |
sympy.Poly over sympy.GF(p) mod \(P(x)\) (monic & non-monic normalization, reducible rejection), Fermat's Little Theorem \(a^{p^m-1} = 1\), Frobenius \((a+b)^p = a^p + b^p\) |
differential/test_lie_galois_and_clifford.py::test_differential_galois_field_arithmetic_and_fermat_little_theorem_vs_sympy, differential/test_lie_galois_and_clifford.py::test_differential_galois_field_non_monic_vs_sympy, differential/test_lie_galois_and_clifford.py::test_differential_gf_matrix_mul_vs_sympy |
Exact (==, \(\epsilon = 0\)) |
clifford.rotor_rotation(v, bivector, angle) |
Comparative (differential) |
scipy.spatial.transform.Rotation.from_rotvec across 3D coordinate planes |
differential/test_lie_galois_and_clifford.py::test_differential_clifford_rotor_rotation_vs_scipy_rotation |
\(10^{-11}\) |
CliffordAlgebra, GeneralizedCliffordAlgebra, QuantumCliffordAlgebra, clifford_lie_algebra |
Comparative (differential) |
Spacetime \(\mathcal{C}\ell(1,3,0)\) anticommutation, \(\mathfrak{spin}(3) \cong \mathfrak{so}(3)\), \(\omega\)-braiding, & \(q\)-deformed braiding | differential/test_lie_galois_and_clifford.py::test_differential_clifford_algebras_and_bivector_lie_isomorphism |
\(10^{-12}\) / Exact (==) |
group.compose, invert, signature |
Comparative + Property (differential) |
sympy.combinatorics.Permutation composition, inverse, & parity homomorphism \(\operatorname{sgn}(pq) = \operatorname{sgn}(p)\operatorname{sgn}(q)\) |
differential/test_lie_galois_and_clifford.py::test_hypothesis_differential_permutation_group_vs_sympy |
Exact (==, \(\epsilon = 0\)) |
group.FiniteGroup, group.FiniteCommGroup, conjugacy_classes, center |
Comparative + Property (differential) |
sympy.combinatorics.named_groups order, is_abelian, conjugacy class sizes, center order, & CommGroup law witness |
differential/test_lie_galois_and_clifford.py::test_differential_finite_groups_and_conjugacy_classes_vs_sympy |
Exact (==, \(\epsilon = 0\)) |
rep.CharacterTable, regular_rep, isotypic_projector, reynolds_average, is_intertwiner |
Comparative (differential) |
SymPy class sizes, Schur orthogonality, Burnside \(\sum d_i^2 = \lvert G \rvert\), & NumPy projector idempotence/completeness/orthogonality \(P_i^2 = P_i, \sum P_i = I\) | differential/test_representations.py::test_differential_group_representations_and_character_tables_vs_numpy_sympy |
\(10^{-9}\) |
rep.lie (spin_representation, exp_map, quadratic_casimir) & tensor.clebsch_gordan_tensor |
Comparative (differential) |
sympy.physics.quantum.cg.CG exact Condon–Shortley coupling tensor across \((j_1, j_2) \in \{(\frac{1}{2},\frac{1}{2}), (1,\frac{1}{2}), (1,1), (\frac{3}{2},1)\}\) & scipy.linalg.expm on \(\mathfrak{su}(2)\) |
differential/test_representations.py::test_differential_clebsch_gordan_and_lie_expm_vs_sympy_scipy |
\(10^{-11}\) – \(10^{-12}\) |
rep.invariant (compute_molien_series, MolienSeries) & rep.lie (cubic_casimir_tensor/operator) |
Comparative (differential) |
Exact sympy.series expansion of \(\frac{1}{\lvert G \rvert}\sum_{g}\det(I - t\rho(g))^{-1}\) for \(V_4, D_8, S_3, Q_8\) & exact SymPy Matrix trace for \(\mathfrak{sl}_3\) cubic tensor \(d_{ijk}\) and \(C_3\) on \(\mathbf{3}\) vs \(\bar{\mathbf{3}}\) |
differential/test_representations.py::test_differential_molien_series_and_cubic_casimir_vs_sympy |
Exact (==) / \(10^{-10}\) |
rep.quantum (QuantumSL2, universal_r_matrix_sl2_fundamental, jones_polynomial_eval) |
Comparative (differential) |
Symbolic SymPy \(8 \times 8\) QYBE \(R_{12} R_{13} R_{23} = R_{23} R_{13} R_{12}\), symbolic \(U_q(\mathfrak{sl}_2)\) spin-\(j\) matrices (\(j = \frac{1}{2}, 1, \frac{3}{2}\)), & exact Laurent Jones polynomials \(V_L(q^{-2})\) for unknot, unlink, Hopf link, trefoil \(3_1\), and figure-eight \(4_1\) | differential/test_representations.py::test_differential_quantum_groups_yang_baxter_and_jones_vs_sympy |
Exact (==) / \(10^{-10}\) |
rep.quiver (Quiver, tits_quadratic_form, classify_representation_type, gabriel_positive_roots) & algebra.PathAlgebra |
Comparative (differential) |
Exact SymPy Matrix.is_positive_definite / is_positive_semidefinite / nullspace() oracle for ADE (\(A_n, D_n, E_6, E_7, E_8\)), tame Euclidean (\(\widetilde{A}_n, \widetilde{E}_{6,7,8}\)), & wild quivers plus exact SymPy block matrices for \(KQ\) right-module action |
differential/test_representations.py::test_differential_quiver_tits_form_and_gabriel_ade_vs_sympy |
Exact (==) / \(10^{-12}\) |
PolynomialAlgebra(StandardSemiring(Fraction)) |
Comparative (differential) |
sympy.Poly(..., domain='QQ') addition, Cauchy product, and powers |
differential/test_polynomials_and_varieties.py::test_differential_polynomial_semiring_over_fraction_vs_sympy_poly |
Exact (==, \(\epsilon = 0\)) |
MultivariatePolynomialAlgebra, groebner_basis, GroebnerIdeal (Q, F_p, GF(p^m)) |
Comparative (differential) |
sympy.groebner(..., order='lex'\|'grlex'\|'grevlex', domain=QQ\|GF(p)) exact 1-to-1 reduced monic basis match (Buchberger & \(F_4\)) across TwistedCubic, Cyclic-3, Cyclic-4, 2R-Robot-IK; plus sympy.diff, sympy.gcd, sympy.sqf_part, and Poisson bracket |
differential/test_polynomials_and_varieties.py::test_differential_groebner_basis_over_rationals_vs_sympy, differential/test_polynomials_and_varieties.py::test_differential_groebner_basis_over_finite_field_vs_sympy, differential/test_polynomials_and_varieties.py::test_differential_multivariate_diff_gcd_sqf_and_poisson_vs_sympy |
Exact (==, \(\epsilon = 0\)) |
variety.AffineVariety, companion_matrix, solve_exact_rational, solve_zero_dimensional |
Comparative (differential) |
sympy.groebner & sympy.solve cross-check of Krull dimension, Hilbert function, ideal union \(I \cap J\), Stickelberger companion matrices \([M_x, M_y] = 0\), Jacobian, elimination, syzygies, and isolated exact/complex roots (circle–hyperbola & 2R robot IK) |
differential/test_polynomials_and_varieties.py::test_differential_variety_stickelberger_and_rational_solver_vs_sympy, differential/test_polynomials_and_varieties.py::test_differential_variety_jacobian_elimination_and_syzygy_vs_sympy |
Exact (==) / \(10^{-7}\) |
variety.TropicalHypersurface, TropicalPolynomialAlgebra, newton_subdivision, tropical_plucker_relations |
Comparative (differential) |
scipy.spatial.ConvexHull lower/upper Legendre–Fenchel hull vertices in 2D/3D (TropicalSemiring & ArcticSemiring), Noether zero-tension balancing \(\sum m_e u_e = \mathbf{0}\) & cellular sheaf \(\delta^T w = 0\), topological genus duality \(b_1 = g\), and classical \(\operatorname{Gr}(2, 4)\) Plücker support equivalence |
differential/test_polynomials_and_varieties.py::test_differential_tropical_hypersurface_vs_scipy_convex_hull_and_dressian |
Exact (==) / \(10^{-7}\) |
DualNumberAlgebra, BinomialConvolutionSemiring, MultivariateBinomialConvolutionSemiring |
Comparative (differential) |
sympy.diff(f, x, k) (up to 4th derivative) & sympy.diff(g, (x, a1), (y, a2)) 2D partial derivatives |
differential/test_polynomials_and_varieties.py::test_differential_autodiff_semirings_vs_sympy_derivatives |
\(10^{-11}\) |
2.7. Topology, Information Theory, Automata & Fractal Metrics (algebrax.topology, algebrax.probability,¶
algebrax.automata, algebrax.metrics)
| AlgebraX Function / Structure | Verification Category | Reference Oracle / Mathematical Law | Test File & Function | Precision / Tolerance |
|---|---|---|---|---|
topology.SimplicialComplex.betti_numbers & cohomology_rank |
Comparative (differential) |
np.linalg.matrix_rank on dense \(\partial_k\), canonical manifolds (\(S^1, D^2, S^2, D^3, T^2\)), & Euler–Poincaré \(\sum (-1)^k \lvert K_k \rvert = \sum (-1)^k \beta_k\) |
differential/test_topology.py::test_simplicial_homology_canonical_manifolds_and_euler_poincare |
Exact (==, \(\epsilon = 0\)) |
topology.hodge_laplacian(sc, k) |
Comparative (differential) |
scipy.linalg.eigvalsh(Delta_k) nullity \(= \beta_k\) (Discrete Hodge Theorem) & dense \(\partial_k^T \partial_k + \partial_{k+1}\partial_{k+1}^T\) |
differential/test_topology.py::test_discrete_hodge_theorem_vs_scipy_eigvalsh |
Exact (==) / \(10^{-12}\) |
topology.exterior_derivative, codifferential, hodge_star, Cochain |
Comparative (differential) |
Discrete Stokes' Theorem \(\langle d_k \omega, c_{k+1} \rangle = \langle \omega, \partial_{k+1} c_{k+1} \rangle\) & weighted adjointness \(\langle d_0 \alpha, \star_1 \beta \rangle = \langle \alpha, \star_0 \delta_1 \beta \rangle\) | differential/test_topology.py::test_discrete_stokes_theorem_and_hodge_star_adjointness |
\(10^{-12}\) |
topology.helmholtz_hodge_decomposition |
Comparative + Certificate (differential) |
\(\omega = \omega_{\text{exact}} + \omega_{\text{coexact}} + \gamma\), \(L^2\) orthogonality, \(d_1 \omega_{\text{exact}} = 0\), \(\partial_1 \omega_{\text{coexact}} = 0\), \(\Delta_1 \gamma = 0\) | differential/test_topology.py::test_helmholtz_hodge_decomposition_orthogonality_and_invariants |
\(10^{-7}\) |
topology.FilteredSimplicialComplex, persistent_homology, betti_curve, persistence_entropy, bottleneck_distance |
Comparative (differential) |
Dense \(\mathbb{F}_2\) Gaussian elimination boundary rank \(\beta_k(K_{\le t})\), scipy.stats.entropy(lifespans), & Cohen–Steiner \(L_\infty\) bottleneck stability |
differential/test_topology.py::test_persistent_homology_vietoris_rips_and_bottleneck_stability |
Exact (==) / \(10^{-12}\) |
topology.cup_product (\(\smile\)), cap_product (\(\frown\)), persistent_cohomology, CellularSheaf.first_cohomology_dimension |
Axiomatic + Exact \(\mathbb{Q}\) (differential) |
Exact Fraction associativity, graded Leibniz rule \(d(\alpha \smile \beta) = (d\alpha)\smile\beta + (-1)^p \alpha\smile(d\beta)\), Kronecker duality \(\langle\psi, c\frown\phi\rangle = \langle\phi\smile\psi, c\rangle\), primal–dual barcode equality, & sheaf Euler–Poincaré \(\chi = \dim H^0 - \dim H^1\) |
differential/test_topology.py::test_cohomology_cup_cap_ring_and_dual_persistent_cohomology |
Exact (==, \(\epsilon = 0\)) |
probability.entropy, cross_entropy, kl_divergence |
Comparative + Property (differential) |
scipy.stats.entropy(P), scipy.stats.entropy(P, Q), scipy.special.rel_entr, & \(H(P, Q) = H(P) + D_{KL}(P \| Q)\) via Hypothesis |
differential/test_probability_and_discrete.py::test_information_theory_vs_scipy_stats |
\(10^{-11}\) |
probability.mutual_information & marginalize |
Comparative (differential) |
scipy.stats.entropy (\(I(X;Y) = H(X) + H(Y) - H(X,Y)\)) & np.sum(joint, axis=0/1) |
differential/test_probability_and_discrete.py::test_mutual_information_and_marginals_vs_scipy |
\(10^{-11}\) – \(10^{-12}\) |
probability.expected_value, variance, skewness, kurtosis, mode |
Comparative (differential) |
scipy.stats.rv_discrete.stats(moments='mvsk') |
differential/test_probability_and_discrete.py::test_statistical_moments_vs_scipy_rv_discrete |
\(10^{-11}\) – \(10^{-12}\) |
probability.bayes_update, markov_step, markov_steady_state |
Comparative (differential) |
Sequential Bayes commutativity \(B(B(P, E_1), E_2) = B(B(P, E_2), E_1)\), np.linalg.matrix_power(P, k), & scipy.linalg.eig left Perron–Frobenius eigenvector |
differential/test_probability_and_discrete.py::test_bayes_update_commutativity_and_markov_steady_state |
\(10^{-10}\) – \(10^{-12}\) |
automata.dfa_step, nfa_step, simulate_dfa, simulate_nfa |
Comparative (differential) |
Rabin–Scott powerset DFA construction, Python re regex oracle, & probabilistic matrix product \(p_0 P_{w_1} \cdots P_{w_k}\) |
differential/test_probability_and_discrete.py::test_automata_dfa_nfa_vs_rabin_scott_and_regex_oracle |
Exact (==) / \(10^{-12}\) |
metrics.density, sparsity, box_counting_dimension, count_elements, deepness, wideness, uniformness |
Comparative (differential) |
np.count_nonzero(A) / A.size, density \(+\) sparsity \(= 1\), & analytical Hausdorff dimension \(\ln 3 / \ln 2\) on Sierpiński gasket |
differential/test_probability_and_discrete.py::test_metrics_density_sparsity_and_fractal_box_counting |
\(10^{-12}\) |
2.8. Semiring Catalog & Streaming Statistical Moments (algebrax.semiring, algebrax.verification)¶
| AlgebraX Semiring / Function | Verification Category | Reference Oracle / Axioms Verified | Test File & Function | Precision / Tolerance |
|---|---|---|---|---|
StandardSemiring(Fraction) |
Axiomatic + Exact \(\mathbb{Q}\) (axiomatic) |
All 9 ring axioms over infinite-precision fractions.Fraction via Hypothesis |
test_axiomatic_properties.py::test_standard_semiring_exact_rational_axioms |
Exact (==, \(\epsilon = 0\)) |
TropicalSemiring, ArcticSemiring, BooleanSemiring, ViterbiSemiring, ReliabilitySemiring, LogSemiring |
Axiomatic + Kleene Star (axiomatic) |
Commutativity, associativity, identity, annihilation, distributivity, & Kleene star fixed-point \(a^* = \mathbb{1} \oplus a \otimes a^*\) via Hypothesis | test_axiomatic_properties.py::test_tropical_semiring_axiomatic_properties, test_axiomatic_properties.py::test_arctic_semiring_axiomatic_properties, test_axiomatic_properties.py::test_boolean_semiring_axiomatic_properties, test_axiomatic_properties.py::test_viterbi_semiring_axiomatic_properties, test_axiomatic_properties.py::test_log_semiring_axioms_and_kleene_star |
\(10^{-6}\) – \(10^{-9}\) |
LukasiewiczSemiring, BottleneckSemiring, MinTimesSemiring, KCollapsedSemiring, DigitalSemiring, ModularSemiring |
Axiomatic (axiomatic) |
Full 9-axiom Hypothesis property sweeps over fuzzy \([0, 1]\), capacity, bounded counter, digit-sum, and \(\mathbb{Z}/p\mathbb{Z}\) domains | test_axiomatic_properties.py::test_fuzzy_bottleneck_mintimes_kcollapsed_digital_modular_axioms |
\(10^{-7}\) – Exact (==) |
All Catalog Semirings (Semiring.catalog()) |
Axiomatic + Dioid Audit (axiomatic) |
All 9 semiring axioms + nsum(a, 3), nsum(a, 0) = 0, power(a, 3), power(a, 0) = 1, & star(0) = 1 across all registered semirings |
test_axiomatic_properties.py::test_all_catalog_semirings_laws_and_nsum_power_consistency, tests/algebrax/test_verification.py::test_all_catalog_semirings_satisfy_laws |
\(10^{-6}\) – \(10^{-7}\) |
KurtosisSemiring, SkewnessSemiring, VarianceSemiring, StatisticalMomentSemiring |
Comparative + Property (differential) |
Associative parallel stream fold (m(P_1) + m(P_2)) + m(P_3) vs. np.mean, np.var, scipy.stats.skew, scipy.stats.kurtosis & independent RV convolution m(X) * m(Y) |
differential/test_statistical_semirings.py::test_hypothesis_streaming_moments_parallel_merge_vs_scipy_stats, differential/test_statistical_semirings.py::test_binomial_convolution_independent_rv_sum_vs_exact_product_measure |
\(10^{-7}\) – \(10^{-12}\) |
ExpectationSemiring & BivariateVarianceSemiring |
Comparative (differential) |
First-order expectation additivity & bivariate covariance convolution \(\operatorname{Cov}(X_1+X_2, Y_1+Y_2) = \operatorname{Cov}(X_1, Y_1) + \operatorname{Cov}(X_2, Y_2)\) | differential/test_statistical_semirings.py::test_expectation_and_bivariate_covariance_semirings_vs_numpy |
\(10^{-12}\) |
MultivariateMomentSemiring (mean_vector, covariance_matrix) |
Comparative (differential) |
Partitioned parallel fold vs. np.mean(X, axis=0) and np.cov(X, rowvar=False, ddof=0) |
differential/test_statistical_semirings.py::test_multivariate_moment_semiring_vs_numpy_cov |
\(10^{-12}\) |
2.9. Cellular Sheaf MMS, Categories, Lattices & Tries (algebrax.topology, algebrax.category, algebrax.lattice,¶
algebrax.trie)
| AlgebraX Structure / Function | Verification Category | Reference Oracle / Mathematical Law | Test File & Function | Precision / Tolerance |
|---|---|---|---|---|
topology.CellularSheaf & sheaf_harmonic_extension (\(SO(2)\) connection) |
Method of Manufactured Solutions (mms) |
Manufactured twisted global section \(x^*_v = R(\theta_v) g \in \ker \mathcal{L}_{\mathcal{F}}\) restricted to \(\partial B\) is recovered on interior \(V \setminus \partial B\) | mms/test_sheaves_and_geometry.py::test_mms_cellular_sheaf_so2_connection_harmonic_extension |
\(10^{-8}\) |
topology.sheaf_harmonic_extension & sheaf_diffusion |
Comparative + MMS (mms) |
Dense Schur complement scipy.linalg.solve(L_II, -L_IB x_B), Dirichlet energy monotonicity \(E(x_{t+1}) \le E(x_t)\), & \((I - \tau \mathcal{L}_{\mathcal{F}})^k x_0\) |
mms/test_sheaves_and_geometry.py::test_mms_sheaf_harmonic_extension_vs_scipy_schur_complement_and_diffusion |
\(10^{-8}\) – \(10^{-11}\) |
category.kleisli_compose & kan_extension_left |
Axiomatic (axiomatic) |
Kleisli monad left/right identity \(\eta \circ_T f = f = f \circ_T \eta\), associativity \((f \circ_T g) \circ_T h = f \circ_T (g \circ_T h)\), & Kan functoriality over Fraction, Tropical, Boolean |
mms/test_categories_and_algebra.py::test_category_kleisli_monad_laws_and_kan_extension |
Exact (==, \(\epsilon = 0\)) |
lattice.join, meet, average, geometric_mean, harmonic_mean, mask, exclude, exclusive, difference, symmetric_difference, product, ratio |
Axiomatic (axiomatic) |
Distributive lattice idempotence, commutativity, associativity, absorption \(a \lor (a \land b) = a\), distributivity, & Pythagorean inequality \(H \le G \le A\) via Hypothesis | mms/test_categories_and_algebra.py::test_hypothesis_distributive_lattice_laws_and_means |
Exact (==) / \(10^{-11}\) |
trie.AlgebraicTrie (add, contract) |
Homomorphism (axiomatic) |
Prefix-tree \(\Phi(T_1 \oplus_{\mathcal{S}} T_2) = \Phi(T_1) \oplus_{\mathcal{S}} \Phi(T_2)\) across StandardSemiring & TropicalSemiring |
mms/test_categories_and_algebra.py::test_algebraic_trie_semiring_homomorphism |
\(10^{-12}\) / Exact (==) |
SimplicialChainCoalgebra.coproduct vs topology.cup_product |
Method of Manufactured Solutions (mms) |
Alexander-Whitney duality: \(\langle \alpha \smile \beta, \sigma \rangle = \langle \alpha \otimes \beta, \Delta(\sigma) \rangle\) across arbitrary simplicial cochains | mms/test_sheaves_and_geometry.py::test_mms_alexander_whitney_duality_with_cup_product |
\(10^{-12}\) |
TopologicalKTheoryRing, bundle_direct_sum, bundle_tensor_product, first_chern_number |
Method of Manufactured Solutions (mms) |
Manufactured Dirac monopole bundles on \(\partial\Delta^3 \cong S^2\) (\(\int_{S^2} c_1(E_\pm) = \pm 1 \in \mathbb{Z}\)), Whitney sum cancellation, and virtual bundle Chern numbers | mms/test_sheaves_and_geometry.py::test_mms_k_theory_monopole_chern_quantization_and_whitney_additivity |
\(10^{-11}\) |
SimplicialPathGroupoid, FiniteSetCCC, CoeffectContext |
Method of Manufactured Solutions (mms) |
Simplicial path homotopy contraction across filled 2-simplices vs. topological \(H_1\) obstruction on punctured 1-skeletons, and Curry–Howard–Lambek exponential adjunction | mms/test_categories_and_algebra.py::test_mms_path_groupoid_homotopy_obstruction_and_ccc_adjunction |
Exact (==, \(\epsilon = 0\)) |
category.MatrixCategory & LawvereMetricSpace |
Method of Manufactured Solutions (mms) |
Enriched category composition associativity and tropical Lawvere metric triangle inequality & shortest-path closure | mms/test_categories_and_algebra.py::test_mms_matrix_category_composition_and_tropical_lawvere |
Exact (==) / \(10^{-12}\) |
QuotientRing & RingHom (First Isomorphism Theorem) |
Method of Manufactured Solutions (mms) |
Universal ring homomorphism factorization \(R / \ker\phi \cong \operatorname{im}\phi\) across exact integer/polynomial quotients | mms/test_categories_and_algebra.py::test_mms_quotient_ring_first_isomorphism_theorem |
Exact (==, \(\epsilon = 0\)) |
topology.DiscreteConnection (Holonomy & Curvature) |
Method of Manufactured Solutions (mms) |
Manufactured \(U(1)/SO(2)\) gauge connection parallel transport, discrete plaquette curvature, and flat-connection trivial holonomy | mms/test_sheaves_and_geometry.py::test_mms_discrete_connection_holonomy_and_curvature |
\(10^{-11}\) |
langlands_dual, RamanujanExpander, PadicField |
Method of Manufactured Solutions (mms) |
Langlands \(B_n \leftrightarrow C_n\) root duality, Ramanujan spectral gap bound, and \(p\)-adic valuation tropical homomorphism \(v_p: \mathbb{Q}_p \to \mathbb{T}\) | mms/test_sheaves_and_geometry.py::test_mms_langlands_duality_ramanujan_and_padic_tropical_valuation |
Exact (==) / \(10^{-11}\) |
2.10. Proof-Carrying Solver Certificates, Schwartz–Zippel PIT & Metamorphic Invariants (certificates, pit,¶
metamorphic)
| AlgebraX Structure / Function | Verification Category | Reference Oracle / Mathematical Theorem Verified | Test File & Function | Precision / Tolerance |
|---|---|---|---|---|
matrix.lu_decompose(A) & recompose_lu |
Proof-Carrying Certificate (certificates) |
\(O(\text{nnz})\) witness check: \(P A = L U\), \(L\) unit lower-triangular (\(L_{ii}=1, L_{ij}=0\) for \(j>i\)), \(U\) upper-triangular (\(U_{ij}=0\) for \(i>j\)), \(P^T P = I\) | test_certificates.py::test_lu_decomposition_certificate |
\(10^{-11}\) |
matrix.qr(A) & recompose_qr |
Proof-Carrying Certificate (certificates) |
\(O(\text{nnz})\) witness check: \(Q R = A\), \(Q^T Q = I\), \(R\) upper-triangular (\(R_{ij}=0\) for \(i>j\)) | test_certificates.py::test_qr_decomposition_certificate |
\(10^{-10}\) |
matrix.cholesky(A) & recompose_cholesky |
Proof-Carrying Certificate (certificates) |
\(O(\text{nnz})\) witness check: \(L L^T = A\), \(L\) lower-triangular (\(L_{ij}=0\) for \(j>i\)), strict diagonal positivity \(L_{ii} > 0\) | test_certificates.py::test_cholesky_decomposition_certificate |
\(10^{-11}\) |
matrix.svd(A) & recompose_svd |
Proof-Carrying Certificate (certificates) |
\(O(\text{nnz})\) witness check: \(U \Sigma V^T = A\), \(U^T U = I\), \(V^T V = I\), \(\sigma_1 \ge \sigma_2 \ge \dots \ge 0\) | test_certificates.py::test_svd_decomposition_certificate |
\(10^{-7}\) |
matrix.cg_solve, matrix.inverse, analysis.fiedler_vector, analysis.pagerank |
Proof-Carrying Certificate (certificates) |
Relative residual \(\|Ax - b\|_2 / \|b\|_2 \le \epsilon\), \(\|A A^{-1} - I\|_\infty \le \epsilon\), eigenpair \(L v_2 = \lambda_2 v_2\) with \(\langle v_2, \mathbf{1} \rangle = 0, \|v_2\|_2 = 1\), & Markov simplex \(\sum \pi_u = 1, \pi_u > 0\) | test_certificates.py::test_linear_solver_and_spectral_eigenpair_certificates |
\(10^{-5}\) – \(10^{-11}\) |
topology.helmholtz_hodge_decomposition |
Proof-Carrying Certificate (certificates) |
\(O(\lvert E \rvert)\) witness check: \(\omega = \omega_{\text{exact}} + \omega_{\text{coexact}} + \omega_{\text{harmonic}}\), mutual \(L^2\) orthogonality \(\langle \cdot, \cdot \rangle = 0\), \(d_1 \omega_{\text{exact}} = 0\), \(\partial_1 \omega_{\text{coexact}} = 0\) | test_certificates.py::test_helmholtz_hodge_decomposition_certificate |
\(10^{-6}\) |
analysis.banach_fixed_point (ContractionMapping) |
Proof-Carrying Certificate (certificates) |
\(O(1)\) contraction witness check: \(d(T(x^*), x^*) \le \epsilon\) and a priori Banach error bound \(d(x_n, x^*) \le \frac{k^n}{1-k} d(x_1, x_0)\) | test_certificates.py::test_certificate_banach_contraction_fixed_point |
\(10^{-10}\) |
LieAlgebra (\(\mathfrak{so}_3, \mathfrak{sl}_2, \mathfrak{so}_4, \mathfrak{se}_3, \mathfrak{su}_3, \mathfrak{sp}_2, \mathfrak{g}_2, \mathfrak{f}_4, \mathfrak{e}_6, \mathfrak{e}_7, \mathfrak{e}_8\)) |
Schwartz–Zippel PIT (pit) |
Jacobi identity \([x, [y, z]] + [y, [z, x]] + [z, [x, y]] = 0\), antisymmetry \([x, y] + [y, x] = 0\), & adjoint homomorphism \([\operatorname{ad}_x, \operatorname{ad}_y](z) = \operatorname{ad}_{[x,y]}(z)\) (\(\lvert S \rvert = 1000, k=6\)) | test_pit_symbolic.py::test_pit_lie_algebra_jacobi_identity, test_pit_lie_bracket_antisymmetry_and_adjoint_homomorphism |
False-positive prob \(\le 6.4 \times 10^{-17}\) |
matrix.dot, trace, determinant (Cayley–Hamilton Theorem) |
Schwartz–Zippel PIT + Exact \(\mathbb{Q}\) (pit) |
Faddeev–LeVerrier characteristic polynomial \(p_A(A) = A^n + c_{n-1} A^{n-1} + \dots + c_0 I = \mathbf{0}\) and \(c_0 = (-1)^n \det(A)\) over exact Fraction \(3 \times 3\) and \(4 \times 4\) matrices |
test_pit_symbolic.py::test_pit_cayley_hamilton_theorem_exact_rational |
Exact (==, \(\epsilon = 0\)) |
PolynomialAlgebra(StandardSemiring(Fraction)) |
Schwartz–Zippel PIT + Exact \(\mathbb{Q}\) (pit) |
Brahmagupta–Fibonacci two-square identity \((P^2 + Q^2)(R^2 + S^2) = (PR - QS)^2 + (PS + QR)^2\) & \((P+Q)^3\) binomial expansion in \(\mathbb{Q}[x]\) | test_pit_symbolic.py::test_pit_polynomial_ring_brahmagupta_fibonacci_identity |
Exact (==, \(\epsilon = 0\)) |
GroupHopfAlgebra & DividedPowerCoalgebra (Antipode & Coassociativity) |
Schwartz–Zippel PIT (pit) |
Randomized rational trials over \(\mathbb{Z}_6\) group algebra and divided power moment sequence verifying coassociativity, counitality, and the Hopf antipode identity | test_pit_symbolic.py::test_pit_hopf_algebra_antipode_and_coassociativity |
\(10^{-9}\) |
GrothendieckRing(PolynomialAlgebra(Q)) (lift_homomorphism) |
Schwartz–Zippel PIT + Exact \(\mathbb{Q}\) (pit) |
Universal difference ring homomorphism \(\tilde{f}((a-b)(c-d)) = (a-b)(c-d)\) over exact rational polynomials \(\mathbb{Q}[x]\) | test_pit_symbolic.py::test_pit_grothendieck_ring_and_universal_property |
Exact (==, \(\epsilon = 0\)) |
OctonionAlgebra & JordanAlgebra (Alternative & Jordan Identities) |
Schwartz–Zippel PIT (pit) |
Moufang / alternative identities \((xx)y = x(xy)\), \(y(xx) = (yx)x\) over \(\mathbb{O}\) and Jordan identity \((x \circ y) \circ x^2 = x \circ (y \circ x^2)\) | test_pit_symbolic.py::test_pit_non_associative_jordan_and_alternative_identities |
Exact (==) / \(10^{-11}\) |
SimplicialComplex & SparseChainComplex |
Metamorphic (metamorphic) |
Fundamental topological chain nilpotency \(\partial_{k-1} \circ \partial_k = \mathbf{0}\) | test_metamorphic_invariants.py::test_metamorphic_simplicial_boundary_nilpotency |
\(10^{-12}\) |
Cochain discrete \(k\)-forms |
Metamorphic (metamorphic) |
Alternating orientation antisymmetry \(\omega(\pi(\sigma)) = \operatorname{sgn}(\pi)\omega(\sigma)\) & degenerate simplex annihilation \(\omega(u, u) = 0\) | test_metamorphic_invariants.py::test_metamorphic_cochain_orientation_antisymmetry |
Exact (==) |
group.FiniteGroup, FiniteCommGroup (conjugacy_classes, left_cosets, quotient) |
Metamorphic (metamorphic) |
Class equation \(\sum \lvert C_i \rvert = \lvert G \rvert\), \(\lvert C_i \rvert \mid \lvert G \rvert\), Lagrange index, & quotient homomorphism \(\pi(gh) = \pi(g)\pi(h)\) | test_metamorphic_invariants.py::test_metamorphic_finite_group_class_equation_lagrange_and_quotient |
Exact (==) |
rep.ExplicitGroupRep (direct_sum, tensor_product, dual) |
Metamorphic (metamorphic) |
Character ring identities \(\chi_{\rho_1 \oplus \rho_2} = \chi_{\rho_1} + \chi_{\rho_2}\), \(\chi_{\rho_1 \otimes \rho_2} = \chi_{\rho_1}\chi_{\rho_2}\), & \(\chi_{\rho^*} = \overline{\chi_\rho}\) | test_metamorphic_invariants.py::test_metamorphic_group_representation_character_ring_identities |
\(10^{-11}\) |
rep.induction (induced_representation, frobenius_adjoint_transpose, mackey_decomposition) |
Metamorphic (metamorphic) |
Frobenius reciprocity \(\langle \operatorname{Ind}_H^G W, V \rangle_G = \langle W, \operatorname{Res}_H^G V \rangle_H\), intertwiner adjunction bijection \(\Phi^{-1}\circ\Phi = \mathrm{id}\), transitivity \(\operatorname{Ind}_H^G\operatorname{Ind}_K^H = \operatorname{Ind}_K^G\), & Mackey double-coset decomposition | test_metamorphic_invariants.py::test_metamorphic_induced_representation_frobenius_and_mackey_invariants |
\(10^{-11}\) |
2.11. Two-Tier Grounded SMT / Z3 Deductive Formal Proofs (smt / formal_smt)¶
Every Z3 solver enforces timeout=5000 with zero Z3 imports or symbolic hooks inside src/algebrax/:
- Tier 1 — Direct Z3 Symbolic Execution: Live
algebraximplementations execute directly onz3.ArithRefsymbolic values (using test-local Z3 carrier semirings for sparse matrix kernels). - Tier 2 — Grounded Spec-to-Implementation Bridge & Meta-Falsification: Universal Z3 proofs for branching structures and 3-node
LawvereMetricCategorytropical closure are paired with exhaustive (\(\mathbb{B}^3\)), Z3-model, and Hypothesis differential conformance checks against livealgebraxclasses, plus meta-falsification proving broken structures yieldz3.sat.
| AlgebraX Structure / Kernel | Verification Tier & Category | Formal Theorem Proved via z3.Solver (check(Not(Law)) == unsat) + Live Grounding |
Test File & Function | Proof Assurance |
|---|---|---|---|---|
DualNumberAlgebra & ExpectationSemiring |
Tier 1 Direct Symbolic (smt) |
Live add/mul/neg executed directly on z3.ArithRef 2-tuples: commutative ring associativity, distributivity, identities, annihilation, additive inverse, & Leibniz derivation rule \((ab)' = a'b + ab'\) |
test_smt_z3_proofs.py::test_tier1_dual_number_and_expectation_direct_symbolic_proof |
Direct Symbolic Proof (unsat over \(\mathbb{R}^6\)) |
BinomialConvolutionSemiring(order=2) |
Tier 1 Direct Symbolic (smt) |
Live add/mul executed directly on z3.ArithRef 3-tuples: identity, annihilation, commutativity, associativity, and left/right distributivity |
test_smt_z3_proofs.py::test_tier1_binomial_convolution_direct_symbolic_proof |
Direct Symbolic Proof (unsat over \(\mathbb{R}^9\)) |
\(2 \times 2\) matrix.dot, transpose, & MatrixCategory.compose (Real & Tropical Z3 carriers) |
Tier 1 Direct Symbolic (smt) |
Live MatrixCategory.compose, matrix.dot, and matrix.transpose executed on symbolic \(2 \times 2\) & rectangular (\(1 \times 2 \to 2 \times 2 \to 2 \times 1\)) Z3 matrices: associativity & transpose duality \((AB)^T = B^T A^T\) |
test_smt_z3_proofs.py::test_tier1_matrix_dot_transpose_and_category_direct_symbolic_proof |
Direct Symbolic Proof (unsat over \(\mathbb{R}^{12}\)) |
TropicalSemiring (\(\min, +\)) |
Tier 2 Grounded SMT (smt) |
Universal proof \(\forall x, y, z \in \mathbb{R}\) of dioid axioms & Kleene star fixed point (\(a \ge 0\)), grounded against live TropicalSemiring via Z3 substitution & Hypothesis |
test_smt_z3_proofs.py::test_tier2_tropical_semiring_grounded_proof, test_tier2_hypothesis_live_bridge |
Grounded Deductive Proof (unsat over \(\mathbb{R}^3\)) |
ArcticSemiring (\(\max, +\)) & BottleneckSemiring (\(\max, \min\)) |
Tier 2 Grounded SMT (smt) |
Universal proof \(\forall x, y, z \in \mathbb{R}\) of arctic distributivity & bottleneck absorption \(\max(x, \min(x, y)) = x\), grounded against live classes via Z3 substitution & Hypothesis | test_smt_z3_proofs.py::test_tier2_arctic_and_bottleneck_grounded_proof, test_tier2_hypothesis_live_bridge |
Grounded Deductive Proof (unsat over \(\mathbb{R}^3\)) |
LukasiewiczSemiring (\([0, 1]\) fuzzy logic) |
Tier 2 Grounded SMT (smt) |
Universal proof \(\forall x, y, z \in [0, 1]\) of t-norm associativity, distributivity, identity, & annihilation, grounded against live LukasiewiczSemiring via Z3 substitution & Hypothesis |
test_smt_z3_proofs.py::test_tier2_lukasiewicz_semiring_grounded_proof, test_tier2_hypothesis_live_bridge |
Grounded Deductive Proof (unsat over \([0, 1]^3\)) |
BooleanSemiring |
Tier 2 Grounded SMT (smt) |
Universal proof \(\forall p, q, r \in \mathbb{B}\) of distributivity, absorption, & De Morgan laws, paired with exhaustive conformance across all \(2^3 = 8\) triples on live BooleanSemiring |
test_smt_z3_proofs.py::test_tier2_boolean_semiring_exhaustive_grounded_proof |
Exhaustively Grounded Proof (unsat over \(\mathbb{B}^3\)) |
LawvereMetricCategory (3-Node Tropical Closure \((I \oplus D)^{\otimes 2}\)) |
Tier 1+2 Grounded SMT (smt) |
Executes live matrix.dot over 3-node symbolic non-negative weights to prove \(C_{ii} = 0\) and \(C_{ik} \le C_{ij} + C_{jk}\), then extracts a Z3 shortcut witness (sat) and verifies live LawvereMetricCategory.metric_closure() + Hypothesis |
test_smt_z3_proofs.py::test_tier2_lawvere_3node_tropical_closure_grounded_proof, test_tier2_hypothesis_live_bridge |
Grounded Closure Proof (unsat over \(\mathbb{R}_{\ge 0}^9\)) |
Meta-Falsification (Broken DualNumberAlgebra & Broken dot) |
Meta-Falsification (smt) |
Injects a broken DualNumberAlgebra.mul and a buggy dot implementation and proves Z3 finds concrete z3.sat counterexample models that also falsify the live Python implementation |
test_smt_z3_proofs.py::test_meta_falsification_broken_semiring_and_dot_yield_sat_counterexamples |
Falsifiability Proof (sat counterexample) |
2.12. Granular Algebraic Hierarchy & Law Verification (algebrax.algebra, algebrax.verification)¶
| AlgebraX Protocol / Verifier | Verification Category | Reference Oracle / Algebraic Invariant Verified | Test File & Function | Precision / Tolerance |
|---|---|---|---|---|
verify_magma_laws, verify_semigroup_laws, verify_band_laws |
Axiomatic (axiomatic) |
Magma binary closure, semigroup associativity \((a \cdot b) \cdot c = a \cdot (b \cdot c)\), and band idempotence \(a \cdot a = a\) | test_algebra.py::test_multiplicative_verifiers |
Exact (==) / \(10^{-7}\) |
verify_monoid_laws, verify_comm_monoid_laws |
Axiomatic (axiomatic) |
Left/right identity (\(\mathbf{1} \cdot a = a \cdot \mathbf{1} = a\)) and commutativity (\(a \cdot b = b \cdot a\)) across strings, numbers, and semirings | test_algebra.py::test_multiplicative_verifiers, test_semiring_fulfills_additive_and_multiplicative_monoids |
Exact (==) / \(10^{-7}\) |
verify_group_laws, verify_comm_group_laws |
Axiomatic (axiomatic) |
Two-sided inverses (\(a \cdot a^{-1} = a^{-1} \cdot a = \mathbf{1}\)), quotient consistency (\(a / b = a \cdot b^{-1}\)), on \(\mathbb{R}^*\) and \(S_3\) permutation dicts | test_algebra.py::test_multiplicative_verifiers |
Exact (==) / \(10^{-7}\) |
verify_add_magma_laws through verify_add_comm_group_laws |
Axiomatic (axiomatic) |
Additive duals (\(+\), \(\mathbf{0}\), \(-\), difference consistency \(a - b = a + (-b)\)) over unboxed sparse dictionary vectors dict[str, float] |
test_algebra.py::test_sparse_vector_additive_group |
\(10^{-12}\) |
verify_join_semilattice_laws, verify_meet_semilattice_laws, verify_lattice_laws |
Order Axiomatic (axiomatic) |
Meet/join idempotence, commutativity, associativity, and mutual absorption (\(a \wedge (a \vee b) = a\), \(a \vee (a \wedge b) = a\)) | test_algebra.py::test_lattice_verifiers |
Exact (==) |
verify_bounded_lattice_laws, verify_distributive_lattice_laws, verify_boolean_algebra_laws |
Order Axiomatic (axiomatic) |
Universal \(\bot\)/\(\top\) bounds, mutual distributivity, and Boolean complements (\(a \vee \neg a = \top\), \(a \wedge \neg a = \bot\)) on power sets and divisor lattices | test_algebra.py::test_lattice_verifiers |
Exact (==) |
verify_group_action_laws |
Action Axiomatic (axiomatic) |
Identity action (\(\mathbf{1} \cdot x = x\)) and associativity compatibility (\(g \cdot (h \cdot x) = (gh) \cdot x\)) for \(S_3\) permutation actions | test_algebra.py::test_group_action |
Exact (==) |
verify_non_assoc_ring_laws, verify_ring_laws, verify_comm_ring_laws |
Axiomatic (axiomatic) |
Additive abelian group axioms, multiplication distributivity over addition, monoid identity, and ring commutativity | test_rings_fields.py::test_ring_and_field_law_verifiers |
Exact (==) |
verify_division_ring_laws, verify_field_laws |
Axiomatic (axiomatic) |
Multiplicative inverses (\(a \cdot a^{-1} = \mathbf{1}\)), zero division guard (ZeroDivisionError), and field commutativity over Fraction and \(\mathbb{F}_p\) |
test_rings_fields.py::test_ring_and_field_law_verifiers |
Exact (==) |
verify_semimodule_laws, verify_module_laws, verify_algebra_laws |
Two-Sorted Action (axiomatic) |
Scalar distributivity over vector addition \(r \cdot (u+v) = ru+rv\) and scalar addition \((r+s) \cdot u = ru+su\) on unboxed sparse dictionaries dict[str, V] |
test_rings_fields.py::test_module_and_algebra_law_verifiers |
Exact (==) |
verify_coassociativity, verify_counitality |
Coalgebra Axiomatic (axiomatic) |
Coassociativity \((\Delta \otimes \mathrm{id})\Delta = (\mathrm{id} \otimes \Delta)\Delta\) and counitality \((\epsilon \otimes \mathrm{id})\Delta = \mathrm{id}\) on divided power and simplicial chain coalgebras | test_hopf.py::test_divided_power_coalgebra, test_simplicial_chain_coalgebra |
Exact (==) / \(10^{-9}\) |
verify_antipode_axiom, verify_hopf_algebra_laws |
Hopf Axiomatic (axiomatic) |
Fundamental Hopf antipode axiom \(\mu \circ (S \otimes \mathrm{id}) \circ \Delta = \eta \circ \epsilon\) on cyclic and Klein-4 group Hopf algebras | test_hopf.py::test_group_hopf_algebra_axioms_cyclic4, test_group_hopf_algebra_axioms_klein4 |
Exact (==) / \(10^{-9}\) |
verify_grothendieck_universal_property, verify_chern_character_additivity, verify_chern_number_integrality |
K-Theory Axiomatic (axiomatic) |
Universal Grothendieck lifting \(\tilde{f} \circ \iota = f\), stabilized equivalence invariance, Whitney sum Chern additivity \(\mathrm{ch}(E_1 \oplus E_2) = \mathrm{ch}(E_1) + \mathrm{ch}(E_2)\), and integer quantization \(\int_\Sigma c_1(E) \in \mathbb{Z}\) | test_k_theory.py::test_grothendieck_universal_property_and_falsification, test_chern_character_additivity_under_whitney_sum, test_chern_number_integer_quantization_on_closed_tetrahedron |
Exact (==) / \(10^{-7}\) |
verify_exponential_adjunction, verify_coeffect_grading, verify_path_groupoid_laws |
Type Theory & Groupoid (axiomatic) |
CCC product pairing, \(\beta\)/\(\eta\) currying bijection \(\mathrm{Hom}(A \times B, C) \cong \mathrm{Hom}(A, C^B)\), left \(\mathcal{S}\)-semimodule coeffect laws, and \(\Pi_1(K)\) path homotopy inverses | test_type_theory_and_groupoids.py::test_finite_set_ccc_products_and_currying_adjunction, test_coeffect_context_and_tracker_across_semirings, test_simplicial_path_groupoid_filled_vs_punctured_triangle |
Exact (==) / \(10^{-7}\) |
verify_cartan_duality, verify_ramanujan_spectral_gap, verify_padic_ultrametric_inequality |
Langlands, Expander & \(p\)-Adic (axiomatic) |
Cartan transposition \(B_n \leftrightarrow C_n\), coroot bijection \(\Phi^+ \xrightarrow{\sim} (\Phi^\vee)^+\), Ramanujan bound $ | \lambda_i | \le 2\sqrt{d-1}$, Hecke commutativity \(T_1 T_2 = T_2 T_1\), and \(p\)-adic ultrametric / tropical valuation laws |
verify_action_algebra_laws |
Kleene / Action Algebra (axiomatic) |
Kleene algebra axioms plus left/right residuation adjunction \(a \cdot x \le b \iff x \le a \backslash b\) & \(x \cdot a \le b \iff x \le b / a\) | test_axiomatic_properties.py::test_action_algebra_axiomatic_laws |
Exact (==) / \(10^{-7}\) |
verify_groebner_basis_laws, verify_poisson_laws |
Gröbner & Poisson (axiomatic) |
Buchberger S-polynomial zero-reduction criterion, reduced monic uniqueness, ideal absorption, and Poisson antisymmetry, Leibniz & Jacobi identities | test_multivariate_groebner.py::test_groebner_ideal_protocols_absorption_and_quotient_ring, test_multivariate_groebner.py::test_verify_groebner_basis_laws_falsifies_non_groebner_and_non_reduced_bases, test_multivariate_groebner.py::test_formal_derivation_and_poisson_bracket_laws |
Exact (==, \(\epsilon = 0\)) |
verify_affine_variety_laws, verify_stickelberger_laws, verify_polynomial_map_laws, verify_coordinate_hopf_laws |
Algebraic Geometry (axiomatic) |
Ideal–variety duality, exact companion matrix commutativity \([M_{x_i}, M_{x_j}] = 0\) & ideal annihilation \(g(M) = 0\), contravariant pullback adjunction \((\phi^* g)(p) = g(\phi(p))\), and exact \(k[G]\) Hopf antipode/coassociativity laws | test_variety.py::test_affine_variety_cuspidal_and_nodal_singularities, test_variety.py::test_stickelberger_conic_intersection_and_exact_rational, test_variety.py::test_polynomial_map_pullback_and_composition, test_variety.py::test_coordinate_hopf_algebra_sl2_and_so2, test_variety.py::test_verifiers_reject_vacuous_inputs_and_support_finite_stickelberger |
Exact (==, \(\epsilon = 0\)) |
matrix.lu_decompose, solve, det, inv over Field[Fraction] / ModularField |
Exact Linear Algebra (exact) |
Exact rational Gaussian elimination on Hilbert matrices, zero roundoff, and finite Galois field \(\mathbb{F}_p\) linear systems | test_rings_fields.py::test_exact_rational_lu_hilbert, test_rings_fields.py::test_exact_rational_solve_system |
Exact (==, \(\epsilon = 0\)) |
power, zpow, nsum, zsmul, fold_* |
Axiomatic (axiomatic) |
\(O(\log n)\) logarithmic binary exponentiation/multiplication, negative integer exponents/multiples, and empty sequence identity folds | test_algebra.py::test_helpers |
Exact (==) |
FiniteCommGroup, AddCommGroup, LawAssociative, LawAddAssociative, LawAddCommutative |
Axiomatic + Exact \(\mathbb{Q}\) (axiomatic) |
Hypothesis sweeps over \(C_n\) (FiniteCommGroup / CommGroup) & exact Fraction sparse vector AddCommGroup at tol=0.0 |
test_axiomatic_properties.py::test_hypothesis_finite_comm_group_and_add_comm_group_axioms |
Exact (==, \(\epsilon = 0\)) |
Popper Non-Vacuous Guards, NaN-Strict Equality & Adversarial Falsification |
Verification Hardening Invariants | Finite-domain-safe min_count (\(\mathbb{F}_2\), BooleanSemiring, KCollapsedSemiring(0)), single-use generator materialization, NaN != NaN container checks, early-break sibling independence, bialgebra \(\Delta(ab)\) & normed positive-definiteness falsification |
test_algebra.py::test_popper_minimum_witness_guard, test_verification.py::test_semiring_elements_equal_nan_strict_and_mapping_proxy, test_verification.py::test_finite_small_domains_pass_verifiers, test_verification.py::test_generator_exhaustion_across_all_verifier_families, test_verification.py::test_bialgebra_and_normed_inner_product_adversarial_falsification, test_verification.py::test_semiring_stubs_and_early_break_sibling_independence, test_verification.py::test_vacuous_witness_and_nonfinite_guards_across_modules |
Strict Rejection (ValueError / False) |
Unified Structure Registry (registry.catalog(), verify_structure, verify_law_witnesses) |
Registry Protocol & Law Honesty (axiomatic) |
100% protocol/law honesty across all 98 registered 0-cell algebraic structures (14 domains, 11 kinds), non-vacuous StarSemiring/KleeneAlgebra guards, & Popper negative control (LawCommutative on CliffordAlgebra) |
test_registry_invariants.py::test_invariant_i2_protocol_and_law_honesty_across_all_entries, test_registry_invariants.py::test_invariant_i2_star_and_kleene_anti_vacuity, test_registry_invariants.py::test_invariant_i2_popper_negative_control_false_law_fails |
Exact (==) / \(10^{-6}\) |
3. Running the Verification Suite¶
You can run the entire verification suite or filter by verification methodology using pytest markers:
# Run all verification tests (199 tests in tests/verifications/ + 43 in tests/algebrax/test_verification.py = 242 total)
uv run pytest tests/verifications/ tests/algebrax/test_verification.py -v
# Run only comparative / differential tests against NumPy, SciPy, NetworkX & SymPy
uv run pytest tests/verifications/ -m differential -v
# Run only Hypothesis axiomatic property-based tests
uv run pytest tests/verifications/ -m axiomatic -v
# Run only Method of Manufactured Solutions (MMS) sheaf/PDE tests
uv run pytest tests/verifications/ -m mms -v
# Run only metamorphic invariant tests
uv run pytest tests/verifications/ -m metamorphic -v
# Run only Schwartz-Zippel randomized polynomial identity tests (PIT)
uv run pytest tests/verifications/ -m pit -v
# Run only proof-carrying solver certificate checks
uv run pytest tests/verifications/ -m certificates -v
# Run only automated SMT / Z3 formal mathematical proofs (-m smt or -m formal_smt)
uv run pytest tests/verifications/ -m smt -v