Cash Statement Proofs (DEBK Invariants)

A unified DEBK invariant for companies and sole traders

Abstract

Trade Control is an open‑source production system with an accounting engine built on a simple idea:
that the economic reality of a business is found in its flows — the productive transactions that move goods, services, and cash — rather than in static snapshots of assets.

In this model, every financial transaction mirrors a productive one, with quantity and cash expressed as opposite‑signed flows. This Cash Polarity Principle allows Trade Control to operate at the level of individual transactions, independent of arbitrary reporting periods. From this transaction‑grained representation, the engine can algorithmically reconstruct the asset‑based reporting required by conventional accounting.

The invariant presented in this paper is the bridge between these two mentalities. It shows how a dynamic, flow‑based model can be reconciled exactly with the static, asset‑rooted view of traditional bookkeeping. Because this approach rewrites the core computational logic of accounting, it requires a clear, rigorous proof. This document provides that proof, along with the definitions and reasoning that make the invariant operational inside Trade Control.

1. Purpose

This paper states and proves a single DEBK invariant that holds for:

The invariant is expressed entirely in terms of:

Annual profit after tax is reconstructible from balance‑sheet deltas alone, up to a small, well‑understood rounding residual (typically pennies, and 1p in Year 1 for VAT‑registered businesses).

There are no classification‑dependent bridge terms, no hand‑coded “equity movements”, and no tautological definitions. Capital movement is measured directly from the balance sheet.

2. Core definitions

2.1 Balance constraint code

Each account carries a BalanceConstraintCode:

The invariant uses only accounts with BalanceConstraintCode = 2 to define capital.

2.2 Capital position and capital movement

For each year \( y \):
$$ \text{CapitalMovement}_y = \text{CapitalPosition}_y - \text{CapitalPosition}_{y-1} $$

This is implemented via LAG over the capital position by year. It is:

2.3 Opening terms

Year 1 has no prior year. Instead, we treat:

For year ( y > 1 ):

2.4 Profit and tax

For each year ( y ):

Then:

$$ \text{ProfitAfterTax}_y = \text{Profit}_y - \text{BusinessTaxExpense}_y $$

2.5 Losses carried forward

Losses carried forward are derived from the tax balance and tax rate:

These are used for analysis and disclosure but do not appear directly in the core equity bridge identity.

3. Year‑1 treatment

Year 1 is special because there is no prior year capital snapshot.

We enforce:

The entire initial state of the business is represented by:

For ( y > 1 ):

4. The equity bridge

For each year ( y ), define:

$$ \text{CapitalDelta}_y = \text{ClosingCapital}_y - \text{OpeningCapital}_y $$
We then define the Variance\(_y\) as the residual required to make the equity bridge hold:
$$ \text{CapitalDelta}_y = \text{ProfitAfterTax}_y + \text{CapitalMovement}_y + \text{OpeningPosition}_y + \text{OpeningAccountPosition}_y + \text{Variance}_y $$

Rearranging:

$$ \text{Variance}_y = \text{CapitalDelta}_y - \Big( \text{ProfitAfterTax}_y + \text{CapitalMovement}_y + \text{OpeningPosition}_y + \text{OpeningAccountPosition}_y \Big) $$

Variance is a pure rounding residual, typically pennies.

5. The invariant

Rearranging the equity bridge gives the core invariant:

$$ \text{ProfitAfterTax}_y = \text{CapitalDelta}_y - \text{CapitalMovement}_y - \text{OpeningPosition}_y - \text{OpeningAccountPosition}_y - \text{Variance}_y $$

In words:

Annual profit after tax is reconstructible from balance‑sheet deltas alone, plus explicit opening terms, up to a small rounding residual.

This holds for:

6. VAT and penny‑level residuals

VAT introduces a three‑stage rounding chain:

  1. VAT rounded on individual transactions
  2. Profit computed VAT‑exclusive
  3. Capital balances rounded at 2dp

In Year 1, this can produce a 1p residual.
For later years, the effect typically disappears or remains within the same tolerance.

7. Unified business tax logic

Trade Control uses a unified business‑tax model:

This logic feeds into \( \text{ProfitAfterTax}_y \) and losses carried forward but does not alter the structure of the invariant.

8. Implementation

The invariant is implemented in the open‑source Trade Control codebase.

The SQL definition of the reconciliation view:

Cash.vwEquityReconciliationByYear

computes:

…exactly as defined in this paper.

Conclusion

This paper establishes a single, unified DEBK invariant that holds for companies and sole traders, VAT‑registered and non‑registered businesses, and any chart of accounts that respects a simple balance‑constraint flag.

The benefits of this approach:

Longer term, this provides:

Trade Control is built on this invariant.
This paper shows why it works — and why it will continue to work as the system grows.

Appendix A: Relevant Objects & Supporting Material

This paper’s reference run uses the scenario runner script:

The script executes four scenarios (profit/loss; VAT on/off) by running App.proc_DatasetSyntheticMIS with configurable settings, including:

For full source, see EXEC_DatasetSyntheticMIS.sql.

Relevant objects

Additional Scripts / Diagnostics

To prove all four synthetic scenarios (profit/loss; VAT on/off), use:

This script:

Reference output

Synthetic Scenario Resultset

Licence

Creative Commons

Licenced by Trade Control Ltd under a Creative Commons Attribution-NoDerivatives 4.0 International License