3.6. Fibration Gap — Worked Example
EndToEndCorrectness ships two soundness headlines that differ
only in how much of the fibration they expose. They are an
exact demonstration of the alignment rule.
3.6.1. parse_sound_shallow — fibration-hidden
theorem parse_sound_shallow (input : String) (docs : Array YamlDocument)
(h : TokenParser.parseYaml input = .ok docs) :
ValidYamlProp input docs
-
Type mentions
parseYaml,YamlDocument,ScanError, andValidYamlProp. The pipeline stages (scanFiltered,parseStream,YamlDocument.compose) are hidden inside the existential body ofValidYamlProp. -
Proof is four tactics:
unfold; split; injection; …. No project theorem is cited. -
Consequence: condition 1 of the alignment rule fails at every root function, so the chain walker returns zero functorial chains. The
ChainDepthclassifier tags this theorempropBridge— recognisable by its Prop-typed target — and renders a diagnostic overlay labelled "NOT proof deps of the headline."
3.6.2. parse_sound_deep — fibration-aligned
theorem parse_sound_deep (input : String) (docs : Array YamlDocument)
(h : TokenParser.parseYaml input = .ok docs) :
∃ (tokens : Array (Positioned YamlToken))
(raw_docs : Array YamlDocument),
Scanner.scanFiltered input = .ok tokens ∧
TokenParser.parseYamlRaw input = .ok raw_docs ∧
TokenParser.parseStream tokens = .ok raw_docs ∧
docs = raw_docs.map YamlDocument.compose ∧
(∀ doc ∈ docs.toList, ∃ node : ValidNode,
stripAnnotations (toYamlValue node) = stripAnnotations doc.value)
-
Type mentions
parseYaml,parseYamlRaw,parseStream,scanFiltered,YamlDocument.compose,toYamlValue, andValidNodedirectly. Every pipeline stage is a first-class citizen of the about-fibration. -
Proof cites
parseYamlRaw_ok_decompose(aboutparseYamlRaw,scanFiltered,parseStream) andparseYaml_produces_valid_nodes(aboutparseYaml,toYamlValue), the second of which transitively drags inparseStream_output_grammable(aboutparseStream). -
Consequence: conditions 1, 2, and 3 of the alignment rule close simultaneously at multiple root functions. The
ChainDepthclassifier tags this theoremdeep.
3.6.3. Chain-Analysis Confirmation
Running the FGM theoremgraph tool in --chain mode on both
theorems produces the following metrics (tool output captured
on 2026-04-24).
Metric |
|
|
|---|---|---|
Project theorems on chain | 0 | 4 (root + 3 proof deps) |
| 0 | 4 |
| 0 | 9 |
Aligned | 0 | 12 |
|
|
|
The proof-dep theorems surfaced on parse_sound_deep are:
-
parseYamlRaw_ok_decompose(moduleComposition) — splits a successfulparseYamlRawinto a successfulscanFilteredstep and a successfulparseStreamstep -
parseYaml_produces_valid_nodes(moduleParserGrammable) — bridgesparseYamlsuccess to per-documentValidNodewitnesses -
parseStream_output_grammable(moduleParserGrammable) — guarantees everyparseStream-produced document is grammable
Each of these is about a strict callee of parseYaml, so the
alignment square closes at every step of the descent:
parse_sound_deep --uses--> parseYamlRaw_ok_decompose --uses--> parseStream_output_grammable
| | |
about about about
v v v
parseYaml --calls--> parseYamlRaw --calls--> parseStream
parse_sound_shallow's chain graph, by contrast, is a diagnostic overlay:
it enumerates the catalogue entries that would be relevant if the
alignment existed, and the legend explicitly labels those nodes
"NOT proof deps of the headline." The absence of any uses or
calls edge is the fibration gap made visible.
Takeaway: a theorem passing the kernel is a statement about
correctness; a theorem passing the chain walker is additionally a
statement about traceability. The two are not the same. The
deep / propBridge / weak / noAbout classification in
FGM.TheoremGraph is the knob that surfaces this distinction
across the catalogue.