Chapter 2. Analysis and Synthesis

Chapter 1 defined a web application and deliberately left State untyped. Now the omission has to be filled, and the two easy ways — survey and preference — fail on inspection. Survey fails. The deployed industry holds answers — rows behind one application, trees behind the next, object graphs behind a third — and they contradict one another. That contradiction is Proposition 1.3 in deployment: the definition constrains architecture not at all, so architecture went in every direction at once. Preference fails harder: an author’s favorite model binds nobody. What is left is derivation: State must follow from constraints the web itself imposes, so that rejecting the conclusion means rejecting a constraint. The question is where a derivation like that can begin.

It cannot begin at State, because State is the one component of Definition 1.1 that nobody can see. Every other part of the signature is on the wire: requests are readable, responses are readable, and the document — read’s output — is the most public object in computing. The state behind them is each server’s private business; no request returns it directly. So the investigation has to start at the observable end and work inward: take the document and strip it. Remove whatever can vary while the page still says what it says, and keep only what no removal can touch. Each removal is checkable against deployed reality, where pages already vary in exactly that way. What is left at the end is not decoration and not arrangement; it is what the document could not have been made without — the first direct view of State.

Stripping alone, though, proves less than it seems to. What remains after the removals could be a fact about the pages chosen, or about the order of the removals, rather than about every page. The check is independence: set the pages aside, keep only the derived parts, and build with them. A working application space means the full range of applications Definition 1.1 admits, not one rebuilt demo. If that space can be constructed from the derived parts alone, using nothing from the original pages, then the skeleton was in the pages, not in the procedure. And if the construction fails, or quietly needs parts the derivation never produced, the failure is public: either the analysis kept the wrong things or the parts list is incomplete, and each defect is visible on its own.

The Greek geometers called the two directions analysis and synthesis. Pappus’s Collection describes the pair: assume the thing sought and work backwards to what is established; then reverse the path, and the reversal is the proof. Newton restates it as a rule of natural philosophy in the Opticks: the investigation of difficult things by analysis “ought ever to precede the method of composition.” The practice has modern instances wherever a structure must be known rather than guessed. Organic chemists worked out a molecule’s structure by breaking it into identifiable fragments, and accepted that structure as proven only once they had built the same compound from known ingredients and it matched. Software has the clean-room: a rebuild is independent exactly when the rebuilding team touched only the derived specification, never the original. Both keep the geometers’ point: taking apart suggests a structure; only building back, independently, proves it.

The claim, then, is stated in advance, so the reader can hold the book to it. The analysis, if it succeeds, will show that every web application has a certain form — that under Definition 1.1 there is nothing else read and State could be: necessity. The synthesis, if it succeeds, will show that the derived form is enough to build with — a full application space, nothing missing: sufficiency. Where the two directions meet exactly, the argument closes from both ends. That meeting, not either half, will be the book’s proof — and it happens twice, once in theorems and once in running code. And the method carries one obligation more: wherever the halves fail to meet exactly, the mismatches go on the table, itemized, not under it — that is Chapter 9’s only job. The opening pages have already named the result; stating a result is not deriving it, and the derivation is the part a reader can check.

The shape of the book follows from the method. Part II is the analysis: first performed by hand on real pages, then re-run as theorems that quantify over every page, including the ones not yet built. And once State is forced, the write side follows from it. Part V is the synthesis: the application space rebuilt from the derived parts and nothing else. Between them, the book does what the method obligates — holds the derived structure up against the world, scores everything the industry runs instead, and tables every mismatch. Part VI carries the synthesis forward: what the derived web permits once it is occupied.

flowchart TB
    subgraph AN ["analysis · Part II"]
        direction LR
        Doc1(["Doc"]) --> strip[["strip"]] --> St1(["State"])
    end
    subgraph SY ["synthesis · Part V"]
        direction LR
        St2(["State"]) --> build[["build"]] --> Doc2(["Doc"])
    end
    AN -- "necessity" --> P(["the two directions meet exactly<br/>— the proof"])
    SY -- "sufficiency" --> P
    P -. "where the halves miss" .-> M["mismatches, tabulated · Chapter 9"]

The method of this chapter, and the shape of the book. Analysis (Part II) strips the observable Doc inward to the hidden State — necessity; synthesis (Part V) builds State back out to a full Doc space — sufficiency. Where the two meet exactly is the proof, and it happens twice: in theorems (Chapter 8) and in running code (Chapter 18). Where the halves miss, the gap is not hidden but tabulated — Chapter 9’s one job.

One decision remains before the stripping starts, and it is a control on the experiment: which pages to strip. Two, at least — one page’s layers prove nothing beyond that page — and the honest pair is the most different pair available, because whatever survives the removals in both is unlikely to be an accident of either. So the pair is a newspaper front page and a wind-farm dashboard. The front page is written by a handful of editors on an editorial rhythm and read by millions. The dashboard is written continuously by machines and read by one operator on shift. Different domain, different audience, opposite rhythms of read and write; under Definition 1.1, one signature. If these two reduce to the same skeleton, everything between them likely does too. Print both. Now take them apart.