BRIK64
Back to Blog
DEEP DIVEMAR 1, 2026

EVA Algebra Deep Dive

A deep dive into EVA — the formal algebraic system behind BRIK-64's pipeline composition and closure proofs. Sequential, parallel, conditional.

The Problem: Why Can't We Compose Software Like Hardware?

In electronics, composition is trivial. If Gate A is correct and Gate B is correct, then wiring A's output to B's input gives you a correct A-B circuit. This isn't hope — it's Kirchhoff's laws. The voltages and currents are governed by algebra, and that algebra is closed under composition.

Software has no equivalent. If Function A is correct and Function B is correct, calling A then B might crash, might deadlock, might produce garbage. There is no algebraic law that guarantees the composition works. Every integration is a prayer.

EVA — Entropic Verification Algebra — is the formal algebraic system that gives software the same composability guarantees that hardware has had since Kirchhoff. It defines three operators, their laws, and the conditions under which composition preserves correctness.

The Three Operators

EVA has exactly three composition operators. Every program in PCD is built from these three operations applied to the 64 atomic monomers. Nothing else exists. Nothing else is needed.

Sequential Composition (Tensor)

A sequential Bmeans: execute A, then feed A's output into B's input. The output type of A must match the input type of B. This is the most fundamental operator — it's a pipeline.

// Sequential: output of one operation feeds into the next
// A pipeline that computes price + tax
// The compiler verifies type compatibility at each step

The key property: if A is certified (Φc = 1) and B is certified (Φc = 1), then A sequential B is certified. Correctness composes sequentially. This is proven in Coq — not tested, proven.

Parallel Composition

A parallel B means: execute A and B independently, on separate inputs, producing separate outputs. There is no data dependency between them. They can run simultaneously.

// Parallel: two independent calculations
// e.g., temperature conversion and distance conversion
// running independently with no shared state

The key property: if A and B share no state, their parallel composition is automatically correct. No race conditions. No locks. No synchronization bugs. The algebra forbids shared mutable state between parallel branches.

Conditional Composition (Direct Sum)

A conditional B means: based on a condition, execute either A or B — never both. This is branching, but with a critical constraint: both branches must have the same output type.

// Conditional: one path or the other
// Based on a predicate, choose branch A or branch B
// Both branches must produce the same output type
// The compiler verifies totality: every case is covered

The key property: if both branches are certified and the condition is total (always evaluates to true or false, never undefined), then the conditional composition is certified. Every possible execution path is covered. No unhandled cases.

The Algebraic Laws

These three operators obey strict algebraic laws — including associativity, commutativity, distributivity, and identity — all proven in Coq. The laws guarantee that refactoring is safe, parallelization is automatic, and optimizations preserve behavior. The compiler can transform code freely because the algebraic structure guarantees semantic equivalence across transformations.

Why the Algebra Matters

These aren't abstract mathematical curiosities. They have direct, practical consequences:

Refactoring is safe.Associativity means you can break a long pipeline into smaller named circuits and compose them back. The result is provably identical. No "refactoring regression."

Parallelization is automatic. Commutativity of parallel composition means the compiler can parallelize independent computations without programmer annotation. No async/await. No thread pools. No race conditions.

Optimization is provably correct. Distributivity means the compiler can transform code — inlining, factoring, reordering — and the algebraic laws guarantee the transformation preserves behavior.

Composition preserves certification. This is the crown jewel. If every monomer in a circuit is certified (Φc= 1), and every composition uses sequential, parallel, or conditional composition according to the laws, then the entire circuit is certified. Correctness scales. It doesn't degrade as the program grows. It composes.

The Closure Theorem

EVA has a fundamental closure theorem, proven in Coq: if two components are certified (Φc = 1), then any composition of them — sequential, parallel, or conditional — is also certified. The space of correct programs is closed under composition. You cannot compose correct parts and get an incorrect whole. The algebra prevents it.

In hardware, this is obvious — Kirchhoff's laws guarantee it. In software, before EVA, it was impossible. Now it's a theorem.

EVA sits in a unique position among verification approaches: it has full composability guarantees with automatic verification and practical usability. The finite monomer space (64 operations) is what makes this possible — you can't do this with an infinite language.

Building with EVA

Every PCD program you write is an EVA expression. When you write:

// A simple circuit composing operations:
// addition >> multiplication | identity
// The compiler checks algebraic laws at each step

The compiler sees the algebraic structure of your program. It checks the laws. It verifies type compatibility at every composition point. It proves closure. And when it reports Φc= 1, it's not saying "all tests passed" — it's saying "the algebraic structure is sound."

That's the difference between testing and proof. Tests check examples. Algebra checks structure. EVA checks structure.

The math does the heavy lifting. You just compose.