Nēberu
Exact geometric algebra from the balanced ternary axiom.
Zero floats. Zero unsafe. Zero external dependencies.
cargo run
Runs the Kase Optimality Theorem self-certification proof: e1·e1 = -1 in
Cl(1,0,0), traced, verified, and certified as a 7-byte exact integer.
What It Is
Nēberu builds geometric algebra from one primitive: the Trit — the balanced
ternary value {N, Z, P} with multiplication. Five constructions derive from
this axiom:
Trit — the axiom: {N=-1, Z=0, P=+1}
↓ packed into u128
Tern — 64-trit balanced ternary integer (exact, no i128 bridge)
├─► Rat — exact rational (Tern/Tern, reduced)
↓
Gen = (Trit, u32) — a generator IS its square signature
↓ free monoid over Gen
Word — basis blade
↓ Rat-weighted linear combination
Expr — multivector
↓ governed by
Governance (Word → Expr) — directed rewrite rules
├─► Trace / TraceWalk — canonicalization record as Wlk<TraceGen>
├─► KOT — optimality verdict as Trit
└─► Geoit = (Governance, Expr) — every value lives in an algebra
Evaluation is canonicalization. There is no other mechanism.
Modules
| Module | What it provides |
|---|---|
trit |
Trit — the axiom (N/Z/P/INV), mul table, encoding |
tern |
Tern — 64-trit packed integer, exact arithmetic, GCD, content hash |
rat |
Rat — exact rational, always reduced, Ord |
gen |
Gen = (Trit, u32) — typed generator; signature() is one field access |
word |
Word — basis blade, free monoid over Gen, grade, ordering |
expr |
Expr — sparse multivector over Rat, grade projection, reverse |
governance |
Governance — rewrite rules, canonicalize, canonicalize_traced, Clifford::cl |
geoit |
Geoit = (Arc<Governance>, Expr) — value + algebra, inseparable |
trace |
TraceWalk, KotResult, verify_kot, explore_confluence |
encoding |
Trit-word packing; N₁/N₂/N₃ certificate bytes; q2_governance |
size |
Trit-cost measurement of any object in the from-axiom encoding |
inspect |
inspect() → full KOT report with N₁/N₂/N₃/Q₁/Q₂ display |
loader |
.neb file parser — loads algebra definitions into Governance |
The Encoding
Two bits per trit. Four states. Three valid. One sentinel.
00 = Z (zero / annihilator) — memset-safe, propagates via AND
01 = N (negative / imaginary)
10 = P (positive / hyperbolic)
11 = INV (invalid / NaN) — propagates via OR
64 trits packed into a u128. Arithmetic is bitwise. Division is non-restoring balanced ternary — no i128 bridge.
Clifford Algebras
A generator's type is its Trit signature:
imaginary // sig = N, x*x = -1
degenerate // sig = Z, x*x = 0
hyperbolic // sig = P, x*x = +1
signature(gen) = gen.sig — O(1), one field access. The type IS the generator.
use Governance;
use Expr;
use Gen;
let gov = cl; // STA: 3 imaginary + 1 hyperbolic
let e1 = gen;
let e2 = gen;
assert_eq!; // imaginary squares to -1
assert_eq!;
To build algebras from typed generator slices directly:
let gens = vec!;
let gov = clifford;
The KOT — Kase Optimality Theorem
Every canonicalization is self-certified. Minimal — no redundant steps. Complete — terminal is irreducible. Consistent — no confluence failure. The verdict is a Trit.
use ;
let = gov.canonicalize_traced;
let walk = walk_from_trace;
let verdict = verify_kot;
assert_eq!; // P = optimal
The inspect module runs the full pipeline and displays all five numbers:
╔════════════════════════════════════════════════════════╗
║ NĒBERU INSPECT ║
║ source: e1·e1 algebra: Cl(1,0,0) ║
╠════════════════════════════════════════════════════════╣
║ N₁ — trace encoding (Magma<Trit>) ║
║ steps: 1 ║
║ trits: 4 t (8 bits, 1 byte) ║
║ N₂ — KOT governance ║
║ relations: 8 ║
║ trits: 40 t (80 bits, 10 bytes) ║
║ N₃ — certificate total (N₁ + N₂) ║
║ trits: 44 t (88 bits, 11 bytes) ║
╠════════════════════════════════════════════════════════╣
║ Q₁ = P ✓ OPTIMAL ║
║ minimal: ✓ ║
║ complete: ✓ ║
║ consistent: ✓ ║
╠════════════════════════════════════════════════════════╣
║ Q₂ = P ✓ certificate is correctly certified ║
║ Q₁ = Q₂ = P — fixed point reached ║
║ the axiom describes itself. ║
╚════════════════════════════════════════════════════════╝
The .neb Language
Algebras are expressible as text. Two files ship in src/neb/:
src/neb/trit.neb — the Clifford axiom in its own language:
type imag = { x * x = -1 }
type dual = { x * x = 0 }
type hyp = { x * x = 1 }
for x : imag => x * x = -1
for x : dual => x * x = 0
for x : hyp => x * x = 1
for a : any, b : any where ordered(a, b) => b * a = -a * b
src/neb/kot.neb — the KOT self-description (governance as text).
Loading .neb source:
use loader;
use Governance;
use Gen;
let gens = vec!;
let gov = load_standard?;
load_standard registers the standard types (imag, dual, hyp, any)
and the ordered bridge predicate. Custom types and bridges go through load.
Confluence Detection
use explore_confluence;
let witnesses = explore_confluence;
// For contradictory governance:
// confluence failure:
// source: e1·e1
// path A → -1
// path B → 1
// your governance is not confluent at this expression.
Standard Clifford algebras are confluent. explore_confluence is for
governance constructed outside of Governance::cl / Governance::clifford.
use explore_confluence;
let witnesses = explore_confluence;
// For contradictory governance:
// confluence failure:
// source: e1·e1
// path A → -1
// path B → 1
// your governance is not confluent at this expression.
No Dependencies
[]
= "0.0.0"
That's it. No nalgebra. No num. No ndarray. The axiom provides everything.
License
MIT — Enoch Automation