|
| 1 | += Adjacency: Provenance Semirings |
| 2 | +:toc: macro |
| 3 | + |
| 4 | +toc::[] |
| 5 | + |
| 6 | +== 1. Nearest existing construction |
| 7 | + |
| 8 | +Green, Karvounarakis, and Tannen introduced K-provenance: database |
| 9 | +tuples are annotated by elements of a commutative semiring `K`, and |
| 10 | +relational-algebra operations compose annotations using `+` (union), |
| 11 | +`·` (join), `0`, `1`. Specialisations include boolean provenance |
| 12 | +(which-provenance), `Bag`-provenance (how-many), `Trio`-style |
| 13 | +provenance (why/where), and the free semiring `N[X]` (how). The |
| 14 | +discipline is "track what each output tuple was derived from, in a |
| 15 | +structure that is compositional". |
| 16 | + |
| 17 | +The echo pattern "retain provenance of a visible output under |
| 18 | +collapsing computation" is in the same genre. |
| 19 | + |
| 20 | +== 2. What do echo types add? |
| 21 | + |
| 22 | +. *Witness at the level of types, not annotations.* K-provenance |
| 23 | + attaches a _label_ to each tuple. Echo types attach a _proof term_ |
| 24 | + `(x , p)` where `p : f x ≡ y`. The witness is itself an inhabitant |
| 25 | + of a dependent type, not a semiring element. This is what |
| 26 | + `map-over-id` and `map-over-comp` in `proofs/agda/Echo.agda` |
| 27 | + transport. |
| 28 | +. *Role-indexed provenance.* `EchoIndexed.Echoᵢ` extends the witness |
| 29 | + by a role index so the same visible output can carry different |
| 30 | + provenance certificates for different observers. The closest |
| 31 | + K-provenance analogue is polynomial provenance with variables per |
| 32 | + source, but there the labels are still scalar algebraic terms, not |
| 33 | + types indexed by observer. |
| 34 | +. *Graded degradation with composition.* `EchoGraded.degrade-comp` |
| 35 | + in `proofs/agda/EchoGraded.agda` composes lowerings along |
| 36 | + `_≤g_`. K-provenance has a natural homomorphism story ("evaluate in |
| 37 | + a simpler semiring"), but a homomorphism between semirings is a |
| 38 | + different mathematical object from a typed lowering of witnesses. |
| 39 | +. *Strict non-recoverability as a theorem.* |
| 40 | + `no-section-collapse-to-residue` in `EchoResidue` _proves_ that the |
| 41 | + lowering from echo to residue has no inverse. Provenance |
| 42 | + homomorphisms are surjections by construction; the usual framing |
| 43 | + does not supply a non-inverse theorem at this granularity. |
| 44 | +. *Epistemic integration.* `EchoEpistemic` ties echoes to |
| 45 | + observer-indistinguishability and knowledge operators. This is |
| 46 | + adjacent to how-provenance but built on different primitives |
| 47 | + (`Indist`, `Knows`), not on semiring annotations. |
| 48 | + |
| 49 | +== 3. What do echo types _not_ add? |
| 50 | + |
| 51 | +* No semiring. There is no `+`, no `·`, no `0`, no `1`. The |
| 52 | + K-provenance algebra is absent. |
| 53 | +* No database-theoretic reading. Relational algebra operators |
| 54 | + (projection, selection, join, union) are not instantiated. The |
| 55 | + `visible : Bool × Bool → Bool` example is _in the same spirit_ as |
| 56 | + projection, but the development does not claim to reconstruct a |
| 57 | + provenance-semiring-aware relational algebra. |
| 58 | +* No free/polynomial provenance. There is no analogue of `N[X]` that |
| 59 | + would let one recover which source contributed how many times. |
| 60 | +* No query-equivalence theorems. Provenance theory has powerful |
| 61 | + results about when two queries agree on all K-annotations for all |
| 62 | + `K`. This is entirely absent here. |
| 63 | + |
| 64 | +== 4. Honest risk to the distinction |
| 65 | + |
| 66 | +A provenance researcher can argue that the residue hierarchy |
| 67 | +(`keep`, `residue`, `forget`) is a 3-element bounded lattice and that |
| 68 | +`degrade` is a homomorphism into a coarser annotation. On that |
| 69 | +reading, everything in `EchoGraded` is "K-provenance for an |
| 70 | +impoverished `K`, dressed up as a type family". |
| 71 | + |
| 72 | +There are two non-trivial replies: |
| 73 | + |
| 74 | +. The witnesses are _types_, not semiring elements. `Echo collapse tt` |
| 75 | + has two distinct inhabitants that are not identified by any |
| 76 | + annotation algebra, because annotations cannot distinguish |
| 77 | + `echo-true` from `echo-false` once the semiring is trivial (as it |
| 78 | + must be when the output type is `⊤`). The echo framing keeps the |
| 79 | + distinction by keeping the source term. |
| 80 | +. The bridges (linear, choreographic, epistemic) are not naturally |
| 81 | + semiring structures. Attempting to force them into a K-provenance |
| 82 | + framing loses the typed content that makes e.g. |
| 83 | + `EchoIntegration.knowledge-and-controlled-degradation` go through. |
| 84 | + |
| 85 | +Still, the overlap of _spirit_ is real: both frameworks care about |
| 86 | +tracking what survives under lossy operations. The distinction is on |
| 87 | +mechanism (types and lowerings vs. semiring annotations), not on |
| 88 | +motive. |
| 89 | + |
| 90 | +== 5. Verdict for Gate 1 |
| 91 | + |
| 92 | +Survives. The motive overlaps with provenance-semiring work, but the |
| 93 | +mechanism is genuinely different. An echo is a proof witness; a |
| 94 | +provenance annotation is a semiring element. The two meet in the |
| 95 | +middle only via a homomorphism story that no existing work combines |
| 96 | +with dependent-type residue hierarchies and epistemic bridges. |
0 commit comments