3 min read
On this page

Geometry of Conditional Logic

What It Solves#

Lock-preserving incremental repair — when a perturbation arrives (a constraint becomes unsatisfied), the system computes minimal repair, not full recomputation. Locked commitments are never changed; only the invalid region is modified.

Key Innovation#

Chinese Remainder Theorem (CRT) Encoding:

Each Boolean condition is assigned a distinct prime pip_i. The CRT reconstruction is:

z=z+kM, where M=pSpz' = z + kM, \text{ where } M = \prod_{p \in S} p k(cz)M1(modpt)k \equiv (c - z) \cdot M^{-1} \pmod{p_t}

This is a “safe corridor” — a fully differentiable path that fixes broken constraints without disturbing solved ones.

Smooth Cosine Loss#

Li(z)=1cos(2πpi(zai))L_i(z) = 1 - \cos\left(\frac{2\pi}{p_i} \cdot (z - a_i)\right)

Each constraint gets a smooth sinusoidal “groove” — satisfying the constraint means falling into the groove.

Garner’s Algorithm#

Fully differentiable CRT reconstruction that provides the safe corridor between solution basins.

Why CRT?#

The CRT has a crucial property: modular arithmetic is closed under composition. If you know the solution modulo each prime, you know the solution modulo their product. This means:

  • Constraints are additively independent (no constraint affects another)
  • The solution space is a product of circles (continuous, no brittleness)
  • Perturbations only affect the relevant prime’s circle

Results#

ScenarioFull RestartCRT IncrementalSpeedup
Sudoku (single cell)baseline847x847x
Sudoku (5 cells)baseline12,495x12,495x
Preserved solutionsk ≤ 5100%

Website#

Live: sethuiyer.github.io/geometry-of-conditional-logic

Key Files#

  • geometry-of-conditional-logic/README.md — Overview
  • geometry-of-conditional-logic/docs/MATH.md — Mathematical foundations
  • geometry-of-conditional-logic/docs/PADIC.md — p-adic analysis

Connection to Core Vision#

Geometry of Conditional Logic provides the discrete encoding of the Arithmetic Manifold. The CRT is the discrete analog of the continuous partition function — both provide a “coordinate system” for navigating the solution space.

The CRT “safe corridor” is geometrically identical to BAHA’s branch enumeration:

  • BAHA: Navigate between basins via Lambert W branches
  • CRT: Navigate between solutions via modular corridors

Both are instances of the same principle: there’s always a path between solutions that doesn’t cross barrier regions.

The same repair idea reappears in Factor Agent as supervised local recovery: failed probes, desynchronized tools, and stale observations are repaired locally instead of restarting the whole investigation. See Agentic AI as a Distributed System for the runtime version of this idea.


See Also#

Start typing to search all 77 articles and guides.