Commit e0d513e
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 c6163a3 commit e0d513e
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 | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
144 | 152 | | |
145 | 153 | | |
146 | 154 | | |
| |||
209 | 217 | | |
210 | 218 | | |
211 | 219 | | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
212 | 226 | | |
213 | 227 | | |
214 | 228 | | |
| |||
303 | 317 | | |
304 | 318 | | |
305 | 319 | | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
306 | 330 | | |
307 | 331 | | |
308 | 332 | | |
| |||
319 | 343 | | |
320 | 344 | | |
321 | 345 | | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | 346 | | |
328 | 347 | | |
329 | 348 | | |
| |||
340 | 359 | | |
341 | 360 | | |
342 | 361 | | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | 362 | | |
349 | 363 | | |
350 | 364 | | |
| |||
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