Skip to main content

ogdoad

CI crates.io PyPI docs.rs License: AGPL v3

Ogdoad is a pure-Rust library for Clifford and Weyl algebras, quadratic forms, and combinatorial games over exact, finite, local, and transfinite coefficient systems. Optional PyO3 bindings expose selected concrete backends without entering the generic math core.

Metrics may be degenerate, and characteristic two is first-class: the quadratic and polar data stay independent,

e_i^2             = q_i
e_i e_j + e_j e_i = b_ij

and an optional upper-triangular a_ij records the ordered contraction of a general bilinear metric. Generic product code takes signs from Scalar::neg and never branches on the characteristic.

Scope and non-claims

A Clifford scalar is a commutative ring. Partizan games form only an abelian group under disjunctive sum, so Ogdoad is not a Clifford algebra over all games. Field-like game subclasses, such as finite nimbers and represented surcomplex numbers, live in the scalar pillar; genuinely game-theoretic constructions live in the games pillar.

Representation limits are part of the API:

  • Nimber(u128) is F_(2^128), not the algebraic closure of F_2.
  • Surreal stores finite-support Conway-normal-form expressions, not arbitrary surreal series.
  • Valued and local models have explicit precision caps and claim exact field laws only inside them.
  • Ordinal::nim_mul, nim_pow, checked_inv, and checked_sqrt return None when a computation would need a Kummer row beyond the supported table or leave the represented segment; the Scalar multiplication wrapper panics if that boundary is ignored.
  • Weyl algebras are infinite-dimensional with finite-support elements. In positive characteristic their enlarged centre is kept explicit, so the polynomial differential action is not claimed faithful.
  • Integer and Rational panic on i128 overflow rather than wrapping; Rational::checked_add and checked_mul return None instead.
  • Fixed-width algebraic values and group orders use u128 or i128; usize is for dimensions, indices, in-memory counts, and ABI hooks.

Architecture

path role
src/scalar/ coefficient traits and exact, finite, valued, global, surreal, and ordinal backends
src/clifford/ metrics, blades, multivectors, products, versors, spinors, and geometric-algebra constructions
src/weyl/ alternating commutator forms, budgeted PBW products, Darboux coordinates, canonical transformations, symbols, centres, finite central fibres, and p-symbols
src/forms/ quadratic-form classification, characteristic-two Arf/Brown/Dickson theory, Clifford centers, Witt/Brauer and low Milnor symbols, Springer and local--global arithmetic, Hermitian and symplectic forms
src/forms/integral/ lattices, discriminant forms, codes, theta series, genera, neighbors, and Weyl-group reflections as Pin versors
src/games/ impartial, partizan, misère, loopy, thermographic, Witt--FIFO/Brown, octal-certificate, Hackenbush, and game-exterior constructions
src/py/ optional per-backend PyO3 bindings; scalar worlds never mix at runtime
src/linalg/ crate-private shared linear algebra
grundy/ unpublished typed ruleset language built on the public API
formal/ separately pinned Lean 4 development
writeups/ mathematical papers and BibTeX sources

Public pillars re-export their children shallowly. Each source pillar carries an AGENTS.md with its module map and local invariants, and docs/README.md indexes the project documentation.

The Weyl pillar builds T(V)/(z_i z_j - z_j z_i - omega_ij) from an alternating scalar-valued form. WeylAlgebra::standard(n) orders generators x_0,...,x_(n-1),d_0,...,d_(n-1) with [d_i,x_j] = delta_ij. Every expanding operation has a variant with explicit term and work budgets, and finite fibres require explicit size caps. Over exact fields it certifies Darboux coordinates; in characteristic p it certifies the centre, reduces to bounded central fibres, identifies characteristic-two fibres with Clifford algebras, and gives executable p-symbol presentations whose Brauer interpretation remains cited.

grundy/ is a typed language for combinatorial games over Ogdoad: positions are data, moves are functions, and every answer states its scope — exact, a verified claim, or a sampled Bounded value. It is a workspace member with publish = false; see grundy/docs/.

Use

As a dependency:

cargo add ogdoad
python -m pip install ogdoad    # Python 3.9 or newer

The API documentation opens each pillar with runnable examples, including the headline constructions of the papers below. From a checkout, the examples tour the library and its research instruments:

cargo run --example tour        # verified core
cargo run --example weyl        # Weyl algebras, centres, p-symbols
cargo run --example tropical    # thermography as tropical arithmetic
cargo run --release --example octal_hunt

bent_route, interactive_kernel, loopy_quadric, and misere_quotient are further bounded experiments. To build the Python extension from source:

python -m maturin build --profile dev -i python
python -m pip install --force-reinstall --no-deps target/wheels/ogdoad-*.whl

A taste of the Python surface:

import ogdoad as og

# q and b are independent in characteristic two.
A = og.NimberAlgebra(q=[og.Nimber(2), og.Nimber(3)], b={(0, 1): 1})
e0, e1 = A.gen(0), A.gen(1)

# Weyl backends remain monomorphic too; budgets stay explicit.
W = og.NimberWeylAlgebra(1)
x, d = W.x(0), W.d(0)
assert W.commutator(d, x) == W.one()
P = W.psymbol([og.Nimber(2), og.Nimber(3)], 4)
assert P.p_residue(x * d) == og.Nimber(1)
assert P.cyclic_factor(0, 4) == (og.Nimber(3), og.Nimber(1))

# Fp3 supplies the odd-characteristic split and residue/trace certificates.
W3 = og.Fp3WeylAlgebra(1)
P3 = W3.psymbol([og.Fp3(2), og.Fp3(1)], 9)
assert P3.certify_split([og.Fp3(2), og.Fp3(1)], 9, 100, 1_000_000)
assert P3.split_trace_matches_residue(
    W3.monomial([2, 2], 1), [og.Fp3(2), og.Fp3(1)],
    9, 100, 1_000_000,
)
assert W.clifford_fiber_products_agree(
    d * x, x + d, [og.Nimber(2), og.Nimber(3)], 4,
    max_terms=32, max_steps=1_000,
)
assert e0 * e1 + e1 * e0 == A.scalar(og.Nimber(1))

# Exact finite-support surreal monomials.
S = og.SurrealAlgebra(q=[og.omega(), og.epsilon()])
assert (S.gen(0) * S.gen(1)) ** 2 == S.scalar(og.Surreal.from_int(-1))

# A Hermitian form restricts to the ordinary quadratic form q(v)=h(v,v)
# over the involution-fixed field; dimension doubles.
H = og.HermitianForm.diagonal([1, -1])
Q = H.restrict_scalars()
assert Q.dim == 4 and og.surreal_signature(Q) == (2, 2, 0)

# Checked game constructors preserve their proof and validation boundaries.
arena = og.WittFifoArena(diagonal=[True], polar=[0], input=1)
assert arena.quadratic_value and arena.grundy(state_budget=100_000) != 0

selector = og.BrownSelector(q4=[3], brown_polar=[0], input=1)
outcome = selector.outcome_class(state_budget_per_follower=100_000)
assert og.BrownSelector.decode_outcome(outcome) == selector.residue

code = og.OctalCode([2])
certificate = og.GuySmithCertificate.compute(code, 1, 2, term_budget=16)
assert certificate.heap_grundy(10**30) == 1

The Python layer monomorphizes a documented slice of the Rust backends and has no runtime-tagged any-scalar algebra: cross-world arithmetic raises TypeError, and cross-world equality compares unequal. Beyond the algebras above it exposes typed reports for finite quadratic modules and Nikulin criteria, extraspecial and Heisenberg--Weil objects, function-field Brauer--Wall classes, Niemeier data, finite-field Witt decompositions, characteristic-two spinor norms and symmetry certificates, lexicode turning games, conformal algebras, ordinal finite-subfield degrees, Witt--FIFO and Brown constructors, Hermitian restriction, and Guy--Smith certificates. Most Python reprs delegate to the canonical Rust rendering.

Mathematical status

The papers under writeups/ form one research suite:

paper result
transfinite_arf.tex classification over perfect Artin--Schreier-surjective characteristic-two fields and its full-nimber specialization
goldarf.tex quadratic-refinement realization in normal play, Gold specialization, Brown selector, and game-exterior obstruction
witt_realization.tex quadratic Witt coordinates over F_2(t), finite impartial realization, explicit ramified naturality, and finite-static and singular no-go theorems
thermo_newton.tex thermic regrading under Norton multiplication and its separation from Newton tropicalization
semiring_stability.tex stable quadratic-pair classification over Hessenberg and supertropical semirings, the universal scalar-extension quotient, and the thermograph wall obstruction
nim_fast_multiplication.tex quasi-linear canonical-word nim multiplication via explicit affine transforms to a primitive Artin--Schreier tower
linking_affine.tex exact affine reductions and the remaining causal step for isolated-dummy FIFO linking
excess.tex exact four-arm selected-order reduction, proved arithmetic boundaries, and the open status of the transfinite nim-excess 0/1/4 rule
misere_natural_realization.tex exact octal traces and periodic code compression, split and subtraction classifications, and exact misère Grundy quotients through heap 18

The last three papers carry the live open problems; their statements and sharp proof boundaries are in docs/OPEN.md. Lean checks named algebraic components and end-to-end finite constructions, including the literal Gold--Arf root; cited bridges and the open propositions stay outside that boundary. See formal/README.md for the theorem map.

Verification

The default gate covers the published core:

cargo fmt -p ogdoad --check
cargo test -p ogdoad
cargo clippy -p ogdoad --all-targets -- -D warnings
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps -p ogdoad

grundy/, the Python bindings, the Lean development, and the papers have opt-in gates in docs/VERIFY.md. Contributions label each mathematical claim as standard/cited, implemented and tested, proved here, or open; see CONTRIBUTING.md.

Ogdoad is licensed under AGPL-3.0-or-later.

Metadata

Release files for ogdoad 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ogdoad 2.0.0
File Size Uploaded Provenance Actions
ogdoad-2.0.0.tar.gz 1.1 MB With provenance Details for ogdoad-2.0.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for ogdoad 2.0.0
File Actions
ogdoad-2.0.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for ogdoad-2.0.0-cp39-abi3-win_amd64.whl
ogdoad-2.0.0-cp39-abi3-musllinux_1_2_x86_64.whl CPython 3.9 abi3 Linux musl 1.2+ x86-64 Details for ogdoad-2.0.0-cp39-abi3-musllinux_1_2_x86_64.whl
ogdoad-2.0.0-cp39-abi3-musllinux_1_2_aarch64.whl CPython 3.9 abi3 Linux musl 1.2+ ARM64 Details for ogdoad-2.0.0-cp39-abi3-musllinux_1_2_aarch64.whl
ogdoad-2.0.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for ogdoad-2.0.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
ogdoad-2.0.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for ogdoad-2.0.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
ogdoad-2.0.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for ogdoad-2.0.0-cp39-abi3-macosx_11_0_arm64.whl
ogdoad-2.0.0-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for ogdoad-2.0.0-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 123.8 MB

Release files / ogdoad-2.0.0.tar.gz

Download URL ogdoad-2.0.0.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
3e56fb2b3b0db87627c291ae19676bf589c73ac1e51433994b8e2df546a6dc8a
BLAKE2b-256 checksum
How to use checksums
aacdd509f025415903da0427af41646d41f6d3c8ea005cd12e28310290aa657e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Release files / ogdoad-2.0.0-cp39-abi3-win_amd64.whl

Download URL ogdoad-2.0.0-cp39-abi3-win_amd64.whl
Size 19.4 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
ab785f1e5218d8daca82a4692652a6ab365f36190a39224720a217fdbfc81605
BLAKE2b-256 checksum
How to use checksums
adcc1dda9b8805e16bf4b1b555dac0b4a9b523bc6171b25468cac60743fb6d27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Release files / ogdoad-2.0.0-cp39-abi3-musllinux_1_2_x86_64.whl

Download URL ogdoad-2.0.0-cp39-abi3-musllinux_1_2_x86_64.whl
Size 18.9 MB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
15952268e676f82d153427d4c0d67d4b17b16668eb8dce1c8b568df4c1ead46f
BLAKE2b-256 checksum
How to use checksums
ad32fa89ffd4904786aee0c3af131f381e4a32cf3a27dcfcc749562348bd4b71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Release files / ogdoad-2.0.0-cp39-abi3-musllinux_1_2_aarch64.whl

Download URL ogdoad-2.0.0-cp39-abi3-musllinux_1_2_aarch64.whl
Size 17.3 MB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
ff038e78d513c4341fb1ab231ff0a0b5cd59316eea9ef0f88c263165fb13d425
BLAKE2b-256 checksum
How to use checksums
160b86c25c9a421559b4a66be96622acd17f871691800f0f212aa1a2318b05d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Release files / ogdoad-2.0.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ogdoad-2.0.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 17.1 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
fe4f0bb5e5fb2c1d5d1b1ac2b5a5244fa2e1dee4c13e8a3d0164aac0c5a819b8
BLAKE2b-256 checksum
How to use checksums
edb2a72a2e15f8ecb37669073e52535d90688b6fd06300c2849a29fed123dd97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Release files / ogdoad-2.0.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL ogdoad-2.0.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 17.1 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
e9ba5737fa0fdd3df2c2df299fb7d4180db4ed862be9af5958ac497fd1861084
BLAKE2b-256 checksum
How to use checksums
1b5a5391aac667e779332e6d10a869aae1f7db23613f0dc3dba9b900cce70188
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Release files / ogdoad-2.0.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL ogdoad-2.0.0-cp39-abi3-macosx_11_0_arm64.whl
Size 15.8 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
410c4adb9643be71ac695b49fad1dcf66c0b65b08d56015579438f9860914937
BLAKE2b-256 checksum
How to use checksums
5f762257fce55daf93f7d031f8f39469b28d90a42f8a751448c11790c2649967
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Release files / ogdoad-2.0.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL ogdoad-2.0.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 17.0 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
b378e1d95e0fe91bcba57b7eccb6396cc6a4d03c837f2b5b445cbd2ef5cd1a81
BLAKE2b-256 checksum
How to use checksums
6bf939e72fa1e93e1749537db3c037e54a71998bc6dcb1c144a1c89d90be4c5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Security for ogdoad 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 8 files in this release have been uploaded with provenance metadata.

Select from 8 files

Attestation for ogdoad-2.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page