Engine

7. Proofs🔗

Every sentence in this manual that states a fact is the name of a theorem of the spec, written out as a sentence (underscores become spaces). It is underlined; hovering shows the exact Lean statement and clicking leads to the statement below. The build checks that each such theorem exists in the spec and is proved: no sorry, no axiom beyond propext, Classical.choice and Quot.sound (a red sorry mark and a failing scripts/check.sh otherwise). Each statement is written out below, checked against the spec theorem of that name (same binders, same statement up to reducible unfolding), and links to the proof in the source. The examples are checked by computation in the kernel (decide +kernel) or by evaluating the parser (parse_eval); nothing relies on the compiler.

Where the statements are:

Topic

Page

null, division, rounding, lower, timestamps, ranges

Values

selectors, windows, calendar

Selectors

count, sum, last of, min, max, the field of an aggregate

Reading the history

comparisons, is null, quantities, ever

Conditions

what requires sees, the incoming event, what a precondition guarantees

Preconditions

what an invariant may use, invariants always hold, lower bounds, groups

Invariants

what an append checks, batches, fast check, rejections, concurrency

Appending

rule lifetimes, deploy checks, type safety

Deploying

printing and parsing, precedence, literals

Grammar

schemas, valid events, at, revisions, expected_revision, retries, schema changes

Events

definition files, JSON numbers, dates and timestamps, requests and responses, the API

Files and requests

the running examples: folio, account, shift, small histories

Rules, Events and the other pages

how the engine and language are built (types, reachable states, parser, wire format)

Spec details

What no proof covers is on Foundations.

  1. 7.1. Statements of Overview
  2. 7.2. Statements of Events
  3. 7.3. Statements of Values
  4. 7.4. Statements of Selectors
  5. 7.5. Statements of Reading the history
  6. 7.6. Statements of Conditions
  7. 7.7. Statements of Preconditions
  8. 7.8. Statements of Invariants
  9. 7.9. Statements of Appending
  10. 7.10. Statements of Deploying
  11. 7.11. Statements of Grammar
  12. 7.12. Statements of Views
  13. 7.13. Statements of Files and requests
  14. 7.14. Statements of Examples