Commit 08a09e5
committed
feat(dijkstra): discharge
Replace the two `coin-of-consumedBatch` / `coin-of-producedBatch` module
parameters of `Utxo/Properties/PoV` with direct proofs. The proofs are
organised as three layers:
+ Layer 1 — single-transaction coin equations
`coin-producedTx : coin (producedTx t) ≡ cbalance (outs t) + DonationsOf t + getCoin (DirectDepositsOf t)`
`coin-consumedTx : coin (MintedValueOf t) ≡ 0 → coin (consumedTx t utxo₀) ≡ cbalance (utxo₀ ∣ SpendInputsOf t) + getCoin (WithdrawalsOf t)`
Each is a direct unfolding: repeated `∙-homo-Coin` to distribute `coin`
across `+`, followed by `coin∘inject≗id` to strip each `inject`. The
consumed version additionally uses `coin (MintedValueOf t) ≡ 0` to cancel
the mint term (from UTXO premise p₆ / SUBUTXO premise).
+ Layer 2 — sum-over-sub-transactions coin equations
`coin-∑-producedTx-sub` : pushes `coin` through the `∑ˡ`-indexed sum over
`SubTransactionsOf tx` using the new `coin-∑ˡ` lemma (from
`Utxo/Properties/Base`), then applies Layer 1 pointwise by list induction.
`coin-∑-consumedTx-sub` : same shape, threading a `noMintingSubTxs tx`
hypothesis (`∀ stx → stx ∈ˡ SubTransactionsOf tx → coin (MintedValueOf stx) ≡ 0`)
through the induction so each element's Layer-1 application has its
`noMint` premise available.
+ Layer 3 — the two batch-level coin equations
`coin-of-consumedBatch` and `coin-of-producedBatch`: unfold the outer
`+ inject _` / `+ ∑ˡ _` structure of `consumedBatch` / `producedBatch` by
repeated `∙-homo-Coin` and `coin∘inject≗id`, substitute the Layer-1
top-level equation for the top-level summand, and substitute the Layer-2
equation for the sub-transaction sum.
The produced-side proof ends with a small associative-commutative shuffle
(`reshape-top`) that reorders the top-level fields from
`(outs + Donations + DirectDeposits) + TxFees` to the stated
`outs + TxFees + Donations + DirectDeposits`. The shuffle uses the same
`swap-right` helper already used in `UTXO-V-mechanical`.
+ Supporting change
Adds a small helper alias `noMintingSubTxs` at the top of the file to keep
the sub-level mint-conservation hypothesis readable in the theorem
statements.
All proofs typecheck under `--safe`. The `UTXO-pov` placeholder remains;
this commit delivers the coin-balance infrastructure that the eventual
full proof (and the LEDGER-pov's `BatchUtxoAccounting` consumer) will
depend on.coin-of-{consumed,produced}Batch in UTXO PoV1 parent 9ee6ea0 commit 08a09e5
5 files changed
Lines changed: 384 additions & 146 deletions
File tree
- src/Ledger/Dijkstra/Specification
- Utxow
- Utxo
- Properties
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
147 | 155 | | |
148 | 156 | | |
149 | 157 | | |
| |||
218 | 226 | | |
219 | 227 | | |
220 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
221 | 235 | | |
222 | 236 | | |
223 | 237 | | |
| |||
312 | 326 | | |
313 | 327 | | |
314 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
315 | 339 | | |
316 | 340 | | |
317 | 341 | | |
| |||
328 | 352 | | |
329 | 353 | | |
330 | 354 | | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | 355 | | |
337 | 356 | | |
338 | 357 | | |
| |||
341 | 360 | | |
342 | 361 | | |
343 | 362 | | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | 363 | | |
350 | 364 | | |
351 | 365 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
61 | 77 | | |
62 | 78 | | |
63 | 79 | | |
| |||
0 commit comments