DEV Community

Nobuki Fujimoto
Nobuki Fujimoto

Posted on

Grounding Computation and Ontology in Just 4 Axioms — The Design Philosophy of the Rei Language (0 -shiki)

Introduction

The foundational theories of programming languages — λ-calculus (3 axioms), Turing machines, and the type theories built on top of them — all share a hidden assumption: values already exist. None of them address where the existence of values comes from in the first place.

Rei (0₀-shiki / 零式) is a computational system grounded in D-FUMT (Dimensional Fujimoto Universal Mathematical Theory). It begins with a single question — "What comes before zero?" — and from that starting point, just 4 axioms are enough to ground both computation and ontology.

npm install rei-lang
Enter fullscreen mode Exit fullscreen mode

Numbers Are Not Points — They Are Fields

In conventional programming, a number is a single point (a scalar value). When you write x = 5, a point called 5 is stored in a variable.

Rei overturns this assumption. Every value is a field with a "center" and a "periphery".

import { mdnum, compute } from 'rei-lang';

// A multidimensional number: center=5, periphery=[1, 2, 3, 4]
const md = mdnum(5, [1, 2, 3, 4]);
const result = compute(md);
console.log(result.value); // 7.5 (weighted average of center + periphery)

// center=0, no periphery → degenerates to a scalar
const scalar = mdnum(0, []);
console.log(compute(scalar).value); // 0 (same as an ordinary number)
Enter fullscreen mode Exit fullscreen mode

This is fundamentally different from "computing with arrays." In Rei, the structure of a number itself follows the center-periphery pattern, and a scalar is merely the degenerate case where the periphery is empty.

The 4 Axioms

The entire Rei system is derived from 4 irreducible axioms.

A1: Center-Periphery

A value is not a point but a field. Every value exists as a relation between a center and its periphery.

M = (c, N, μ, w)

c ∈ V           — center
N = (n₁, ..., nₖ)  — periphery
μ ∈ Modes       — computation mode
w : N → ℝ⁺     — weight function

Degeneracy: when k = 0, compute(c, ∅, μ, w) = c
Enter fullscreen mode Exit fullscreen mode

Conventional programming can be viewed as handling only the degenerate case where k = 0.

A2: Extension-Reduction

Every value can be extended or reduced along the depth axis.

⊕ : V × S → V    (extension: add a subscript)
⊖ : V → V         (reduction: remove a subscript)

Chain:   v₀ →⊕ v₀ₒ →⊕ v₀ₒₒ → ...
Inverse: ⊖(⊕(v, s)) = v
Enter fullscreen mode Exit fullscreen mode
import { subscript, extnum, extend, reduce, toNotation } from 'rei-lang';

// Create 0₀ₒₒ (triple extension of zero)
const sub = subscript(0, ['o', 'o', 'o']);
const en = extnum(sub);

// Extension and reduction operations
const extended = extend(en, 'x');  // 0ooo → 0ooox (⊕)
const reduced = reduce(extended);  // 0ooox → 0ooo  (⊖)

// 4-layer notational equivalence
const notation = toNotation(sub);
// notation.sensory    → "0ooo"     (sensory layer)
// notation.dialogue   → "0_o3"     (dialogue layer)
// notation.structural → "0(o,3)"   (structural layer)
// notation.semantic   → JSON       (semantic layer)
Enter fullscreen mode Exit fullscreen mode

This is the answer to "What comes before zero?" Normally, 0 is an irreducible atom, but in Rei, an infinite structure unfolds inside 0.

A3: σ-Accumulation

Every transformation leaves a trace. A value retains its own history.

V̂ = V × Σ      (value = raw value + metadata)

Σ = (H, τ, n)
  H — transformation history (memory)
  τ — tendency (direction of change)
  n — transformation count
Enter fullscreen mode Exit fullscreen mode

Every function application is automatically recorded. This means a value always knows not only what it is now, but also where it came from.

import { lang } from 'rei-lang';

// compress = function definition (the philosophy of compression)
lang.run('compress double(x) -> x * 2');
lang.run('compress inc(x) -> x + 1');

// Chain transformations with the pipe operator
lang.run('5 |> double |> inc |> double');
// → 22
// During this process, the transformation history [5, 10, 11]
// is automatically accumulated in σ
Enter fullscreen mode Exit fullscreen mode

A4: Genesis Phase Transition

Existence arises from nothing in stages. No stage can be skipped.

P = { void, ・, 0₀, 0, ℕ }

void → ・    (something can exist)
  ・ → 0₀   (value and structure separate)
 0₀ → 0    (value solidifies and becomes computable)
  0 → ℕ    (the natural number system arises)
Enter fullscreen mode Exit fullscreen mode
import { genesis } from 'rei-lang';
const { runFullGenesis, verifyTheoremS0, verifyTheoremS1 } = genesis;

// Run the full genesis process: void → ・ → 0₀ → 0 → ℕ
const state = runFullGenesis();
console.log(state.phase); // 'number'

// Verify uniqueness theorems
const s0 = verifyTheoremS0(state); // ・→ 0₀ transition is unique
const s1 = verifyTheoremS1(state); // 0₀ → 0 transition is unique
console.log(s0.valid, s1.valid); // true true
Enter fullscreen mode Exit fullscreen mode

Blocking rule: You cannot jump directly from void to 0. The transition must proceed one step at a time: void → ・ → 0₀ → 0. This is the principle that "there are no shortcuts to existence."

Independence and Orthogonality of the 4 Axioms

Each axiom governs a different "axis" and is independent of the others.

A1 — Space   (structure)  "What shape does a value have?"
A2 — Depth   (depth)      "How deep can you go inside a value?"
A3 — Time    (history)    "How has a value changed?"
A4 — Origin  (genesis)    "Where does a value come from?"
Enter fullscreen mode Exit fullscreen mode
Axiom Why it can't be replaced by the other three
A1 A2, A3, A4 do not define the structure of a value
A2 A1, A3, A4 do not include the concept of depth
A3 A1, A2, A4 do not imply retention of history
A4 A1, A2, A3 do not address the origin of existence

Comparison with Other Systems

System Axioms Scope
λ-calculus 3 Computation
Peano 5 Natural numbers
ZFC 9 Sets
Rei 4 Computation + Ontology

Rei Language Syntax

Rei's syntax directly reflects its 4 axioms.

import { lang } from 'rei-lang';

// A1: Multidimensional number literal [center; periphery...]
lang.run('[5; 1, 2, 3, 4]');

// A2: Extension ⊕ / Reduction ⊖
lang.run('0oo ⊕ x');    // 0oo → 0oox
lang.run('0oox ⊖');      // 0oox → 0oo

// A3: Pipe (function composition with σ-accumulation)
lang.run('compress inc(x) -> x + 1');
lang.run('41 |> inc');   // 42

// A4: bind (value fixation = solidification of existence)
lang.run('bind x = 42');
Enter fullscreen mode Exit fullscreen mode
Syntax Axiom Design Intent
[c; n₁, n₂] A1 Directly express multidimensional numbers
/ A2 Extension/Reduction as first-class operators
`\ >` (pipe) A3
bind A4 Irreversibly fix the existence of a value
compress A1+A3 Compress computation into a reusable form

Benchmarks

Real-world performance advantages of the center-periphery pattern:

Task vs. Conventional Description
Image kernel ops 4× reduction Code volume for convolution
Multidim data aggregation 3.7× improvement Aggregation pipeline verbosity
Graph structure transforms 3.7× improvement Network structure manipulation
Average code reduction 74% Overall expressiveness

What's Next

Phase 7 (v0.5.5+) has implemented σ-attribute interactions (7a), self-repair (7b), self-generation (7c), emergence (7d), and micro-macro bi-limit meta-bridges (7e). Seven domains — natural science, information engineering, humanities, art, music, economics, and linguistics — are fully connected via 36-direction bridges, and transformations between 5 alternative axiom systems are realized through compress/expand functors.

Feedback, issues, and stars are welcome.

Top comments (0)