Validity-First Formalism

Make validity the primitive, not the afterthought.

Consistency Calculus becomes more defensible when it is not framed as “a bag of constraints,” but as a formal object whose admissible states, defect map, projection, and residual geometry can be studied directly.

Page One

The Object

The scalar residual is not the object. It is the observable shadow cast by the object. The object is the structure that determines what counts as a valid state at all.

Definition

A consistency structure is a sextuple ℂ = (S, E, C, Π, w, ρ) where:

  • S is the state space.
  • E is the defect space, usually decomposed as E = ⊕i Ei.
  • C : S → E is the defect map.
  • Π : S → M is a projection or repair operator onto the admissible set.
  • w assigns scale to each defect component.
  • ρ assigns penalty shape to each defect component.

Primitive Equations

M = C-1(0) R(ψ) = Σi wi ρi(Ci(ψ)) ψ* = argminψ ∈ S R(ψ) TψM = ker D Cψ when rank is locally constant

The tangent-space identity is a standard differential-topology result. It matters because it gives “admissible directions” a clean local meaning.

Interpretation

What This Changes

Traditional modeling starts from dynamics and asks which states appear. This object starts from admissibility and asks which states are structurally possible.

Procedural View
  • Specify update rules.
  • Simulate a trajectory.
  • Detect anomalies from behavior afterward.
  • Patch edge cases with more logic.
Consistency View
  • Specify admissibility.
  • Measure defect directly.
  • Project invalid states back toward coherence.
  • Explain anomalies by violated mechanism.
Advantages

Why This Object Should Exist

Even before claiming deep novelty, the object earns its place if it gives practitioners and researchers a cleaner unit of reasoning than ad hoc penalties, brittle rules, or opaque anomaly scores.

One Language For Validity

The same object can talk about feasibility, anomaly scoring, repair, and reinitialization without switching formalisms halfway through the problem.

Continuous, Not Binary

Instead of only saying valid or invalid, it measures how invalid a state is and which mechanisms contribute most to that failure.

Composable

New knowledge is added as new defect components or new operators, rather than as procedural branches scattered through a codebase.

Interpretable

Residual decomposition gives a reason for failure: sequence failure, lifecycle failure, conservation failure, price-order failure, and so on.

Bridges Math And Software

The same object can be discussed as a manifold-and-defect structure in theory and as a residual API in code.

Supports Repair

A projection operator gives an explicit place for recovery logic instead of hiding “fix-ups” in procedural exception handling.

Use Cases

What It Could Be Used For

The object is useful anywhere a system has a meaningful notion of structural validity and the important question is whether observed data can still be reconciled with it.

Market Data Validation

Detect feed corruption, snapshot/incremental desynchronization, missing updates, and impossible order-book states with a single residual trace.

Market Surveillance

Use residual spikes and defect signatures to separate ordinary microstructure noise from manipulative or mechanically inconsistent behavior.

Execution Modeling

Evaluate whether a strategy interacts with the market in a way that remains coherent with the order-book mechanics it assumes.

Simulator QA

Stress a simulator or backtest engine by asking whether its generated trajectories remain close to the admissible set implied by the market rules.

Industrial Diagnostics

Recast residual-based fault detection in a more explicit object language built around admissibility, projection, and defect decomposition.

Scientific Data Pipelines

Treat impossible measurements, missing transitions, or broken conservation laws as structured defect rather than one-off data-cleaning edge cases.

Current Evidence

The Object Is Starting To Earn Its Keep

The first T7-style prototype is no longer only philosophical. In the current rebuild simulation, a consistency-driven policy makes better recovery decisions than a hard-break heuristic while ending in the same final clean book.

Residual Exposure
-17.1%

Cumulative residual drops from 35.1 under the naive policy to 29.1 under the consistency policy.

Next Event Clears
2 vs 1

Consistency-triggered rebuilds clear the very next event twice; the naive policy does so only once.

Unnecessary Rebuilds
0 vs 1

The consistency policy avoids a late rebuild on a tiny crossed-book event that the naive rule still takes.

Naive Policy
  • Rebuilds on packet gap, missing-order break, and a late tiny crossed book.
  • Misses persistent moderate drift during auction-state maintenance.
  • Creates one unnecessary rebuild in the proxy snapshot experiment.
Consistency Policy
  • Rebuilds on severe breaks plus persistent residual, not only hard failures.
  • Catches repeated auction-state drift earlier at event 16.
  • Reduces inconsistent-event exposure without increasing rebuild count.
These numbers come from a 23-event normalized T7-style replay with proxy snapshot rebuild simulation. The claim is still narrow, but it is already stronger than “interesting residual trace.”
Operators

Operations The Object Should Support

This is where a real formalism begins. Without operations, the framework risks collapsing back into weighted penalty engineering.

Composition

(S1, E1, C1) ⊕ (S2, E2, C2) = (S1 × S2, E1 ⊕ E2, C1 ⊕ C2)

Couple subsystems without discarding per-constraint interpretability.

Restriction

C|U : U ⊆ S → E

Move the structure onto a subsystem, submarket, or regime-specific slice.

Projection

Π(ψ) = argminφ ∈ M d(ψ, φ)

Interpret repair, reinitialization, or model invalidation in one operator.

Linearization

C(ψ + δ) ≈ C(ψ) + D Cψδ

Separate local admissible motion from local defect-growing motion.

Residual Flow

dψ/dt = -G(ψ) ∇R(ψ)

Define defect-reducing dynamics when the system is driven toward validity.

Mode Decomposition

R = Rseq + Rexist + Rflow + Rpx + …

Turn one anomaly score into a structural signature of why validity failed.

Code Sketch

Minimal API

A useful formal object should translate cleanly into software. The code should reveal the structure, not hide it.

from dataclasses import dataclass
from typing import Callable

@dataclass
class ConsistencyStructure:
    state_space: str
    defect_map: Callable
    projector: Callable
    weights: dict[str, float]
    penalties: dict[str, Callable]

    def residual(self, state):
        defect = self.defect_map(state)
        total = 0.0
        parts = {}
        for name, value in defect.items():
            term = self.weights[name] * self.penalties[name](value)
            parts[name] = term
            total += term
        return total, parts

    def admissible(self, state, tol=1e-9):
        total, _ = self.residual(state)
        return total <= tol

What Needs To Be True For This To Matter

  • The defect map must carry interpretable semantics.
  • The weights must normalize heterogeneous defects.
  • The projection must be meaningful, not arbitrary.
  • The decomposition must say more than the scalar score alone.
  • The object must expose something existing models miss.
The novelty claim should not be “constraints exist.” It should be “this object gives a reusable validity formalism with interpretable operations and useful invariants.”
Novelty Map

Where It Seems New And Where It Does Not

Nearby fields already contain consistency spaces, projections, residuals, and constrained manifolds. The opening is in the synthesis and in the market-microstructure use case.

Already Known Nearby

  • Constrained mechanics and holonomic constraints.
  • Differential-algebraic consistency spaces and projectors.
  • Residual-based fault diagnosis and model invalidation.
  • Behavioral systems and distance-to-model ideas.

Potentially New

  • A single object centered on defect structure rather than trajectory.
  • Canonical residual decomposition as an explanatory signature.
  • Projection and repair as first-class operations.
  • A validity-first lens on order-book processing.

Must Be Proven

  • Coordinate-invariant statements or local structure results.
  • At least one nontrivial theorem or formal proposition.
  • One application where the object beats a simpler baseline.
  • Evidence that this is more than renamed penalty minimization.