WIP -- [Dijkstra] CIP-159-11b: Prove UTxO and UTxOW preservation of value (#1186)#1189
Draft
williamdemeo wants to merge 3 commits into
Draft
WIP -- [Dijkstra] CIP-159-11b: Prove UTxO and UTxOW preservation of value (#1186)#1189williamdemeo wants to merge 3 commits into
williamdemeo wants to merge 3 commits into
Conversation
3 tasks
williamdemeo
force-pushed
the
1186-dijkstra-utxo-and-utxow-pov
branch
from
May 7, 2026 20:23
6763664 to
ca99121
Compare
williamdemeo
force-pushed
the
1185-dijkstra-certs-pov
branch
from
May 7, 2026 20:33
e4f46a7 to
4e3d554
Compare
williamdemeo
force-pushed
the
1186-dijkstra-utxo-and-utxow-pov
branch
4 times, most recently
from
May 8, 2026 22:32
f34dd7b to
ed32fcc
Compare
4 tasks
williamdemeo
force-pushed
the
1185-dijkstra-certs-pov
branch
from
May 12, 2026 05:24
c4f6a1b to
a2963c6
Compare
williamdemeo
force-pushed
the
1186-dijkstra-utxo-and-utxow-pov
branch
from
May 12, 2026 05:25
ed32fcc to
60167ea
Compare
williamdemeo
marked this pull request as ready for review
May 12, 2026 05:45
williamdemeo
marked this pull request as draft
May 14, 2026 04:28
williamdemeo
force-pushed
the
1185-dijkstra-certs-pov
branch
from
May 14, 2026 04:45
a2963c6 to
f635bd6
Compare
williamdemeo
force-pushed
the
1186-dijkstra-utxo-and-utxow-pov
branch
2 times, most recently
from
May 14, 2026 19:51
cf7a86b to
e494a2e
Compare
williamdemeo
force-pushed
the
1185-dijkstra-certs-pov
branch
3 times, most recently
from
May 19, 2026 21:37
1db822b to
2a6a3dd
Compare
williamdemeo
force-pushed
the
1186-dijkstra-utxo-and-utxow-pov
branch
2 times, most recently
from
May 19, 2026 23:27
f1cc871 to
91db883
Compare
williamdemeo
force-pushed
the
1186-dijkstra-utxo-and-utxow-pov
branch
from
May 20, 2026 01:13
91db883 to
ac0e814
Compare
4 tasks
williamdemeo
pushed a commit
that referenced
this pull request
Jun 23, 2026
Records the precise, ordered steps to make this PR faithful to the top-down plan: delete the Certs-PoV provider modules (Certs/Properties/PoV and PoVLemmas, which are #1210's work), drop their imports from Certs/Properties, and lift the facts they provide (CERTS-pov, and later CERTS-coinFromDeposits-updateCertDeposits) to module parameters in Entities.Properties.PoV and the LEDGER-PoV module. Notes that Utxo/Utxow-PoV are already absent (deferred to #1189) and already parameterized, flags the Conway-side touches to re-check, and cross-references the separate coinFromGovDeposit re-derivation. Prose only; to be executed in a session with the Agda toolchain so each step can be typechecked. https://claude.ai/code/session_0174ZBS1RKAGSbBXDsESUwoA
4 tasks
williamdemeo
pushed a commit
that referenced
this pull request
Jun 25, 2026
Records the precise, ordered steps to make this PR faithful to the top-down plan: delete the Certs-PoV provider modules (Certs/Properties/PoV and PoVLemmas, which are #1210's work), drop their imports from Certs/Properties, and lift the facts they provide (CERTS-pov, and later CERTS-coinFromDeposits-updateCertDeposits) to module parameters in Entities.Properties.PoV and the LEDGER-PoV module. Notes that Utxo/Utxow-PoV are already absent (deferred to #1189) and already parameterized, flags the Conway-side touches to re-check, and cross-references the separate coinFromGovDeposit re-derivation. Prose only; to be executed in a session with the Agda toolchain so each step can be typechecked. https://claude.ai/code/session_0174ZBS1RKAGSbBXDsESUwoA
williamdemeo
pushed a commit
that referenced
this pull request
Jun 25, 2026
…mas (#1186) First piece of the utxo/utxow-pov work that discharges #1187/#1203's UTxO-side module parameters. Ported verbatim from the stale #1189 branch (1186-dijkstra-utxo-and-utxow-pov); typechecks unchanged against the current spec (Agda 2.8.0 via the Nix flake), since these lemmas are era-independent: - ∙-homo-Coin : coin (x + y) ≡ coin x + coin y (coin monoid homomorphism) - coin-∑ˡ : coin distributes over a list-indexed ∑ˡ - newTxid⇒disj : TxId freshness ⇒ disjointness of dom utxo and dom (outs tx) - outs-disjoint : the (utxo ∣ SpendInputs ᶜ) / outs specialisation used by PoV balance-∪ / split-balance remain module parameters of Utxo.Properties.PoV (the set-theoretic balance-arithmetic port is tracked separately). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01We2YdXX2ozJAdAbCrRwi6r
williamdemeo
pushed a commit
that referenced
this pull request
Jun 25, 2026
Records the precise, ordered steps to make this PR faithful to the top-down plan: delete the Certs-PoV provider modules (Certs/Properties/PoV and PoVLemmas, which are #1210's work), drop their imports from Certs/Properties, and lift the facts they provide (CERTS-pov, and later CERTS-coinFromDeposits-updateCertDeposits) to module parameters in Entities.Properties.PoV and the LEDGER-PoV module. Notes that Utxo/Utxow-PoV are already absent (deferred to #1189) and already parameterized, flags the Conway-side touches to re-check, and cross-references the separate coinFromGovDeposit re-derivation. Prose only; to be executed in a session with the Agda toolchain so each step can be typechecked. https://claude.ai/code/session_0174ZBS1RKAGSbBXDsESUwoA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[!WARNING]
🔖 Resume here — session hand-off 2026-06-16 (dependency provider; NOT yet on Entities refactor)
Top-down reorder: this PR provides the UTxO/UTxOW-PoV facts that discharge #1203's UTxO-side module parameters. Complete it AFTER #1203's skeleton fixes the exact statements needed (prove only those).
1185-dijkstra-certs-pov; last touched 2026-05-20; CI predates the currentformal-ledger-agdajob.To finish:
bd56c87); retarget base tomaster.balance-∪,split-balance,outs-disjoint(last is local via the already-provednewTxid⇒disj).UTXO-pov{!!}to match the statement WIP -- [Dijkstra] CIP-159-11c: Prove LEDGER preservation of value (#1187) #1203 actually consumes.Description
Closes #1186.
This PR adds the preservation-of-value (PoV) building blocks for the Dijkstra
UTXOandUTXOWrules. These are the UTxO-side ingredients consumed by the LEDGER-level proof in sub-issue #1187; this PR does not itself prove a completeUTXO-povtheorem (that statement's exact shape depends on howLEDGER-povthreads sub-transaction state).This PR is the second of three replacing the original PR #1169, which has been split along module-tree boundaries. It contains only the
Utxo/PropertiesandUtxow/Propertiessub-trees. It targets the branch of PR #<new-A>(Certs PoV) so that CI sees the full PoV chain in order; once #<new-A>merges, this PR will be retargeted tomaster.Modules
Utxo.Properties.Base∙-homo-Coin,newTxid⇒disj,outs-disjoint,coin-∑ˡUtxo.Properties.PoVUtxow.Properties.PoVUTXOW⇒UTXOextractor + delegated wrappersWhat's proved
The Dijkstra UTXO PoV proof decomposes into two orthogonal pieces, matching the batch structure of the rule.
Mechanical state change
UTXO-I-getCoin(invalid case: collateral collection preservesgetCoin) andUTXO-V-mechanical(valid case: additive rearrangement relatinggetCoin s₀togetCoin s₁viasplit-balance+balance-∪). Both proved.Batch coin balance
batch-balance-coin— the coin projection of theconsumedBatch ≡ producedBatchpremise (premisep₇of theUTXOrule) — proved via a three-layer structure.Per-transaction (
coin-producedTx,coin-consumedTx). UnfoldproducedTx/consumedTxand peelcointhrough each+ inject _layer using∙-homo-Coin+coin∘inject≗id. The consumed version usescoin (MintedValueOf t) ≡ 0(UTXO premisep₆for top-level, SUBUTXO premise for sub-transactions) to cancel the mint term.Sum over sub-transactions (
coin-∑-producedTx-sub,coin-∑-consumedTx-sub). Pushcointhrough the∑ˡ-indexed sum using the newcoin-∑ˡlemma (a four-line monoid-homomorphism induction inUtxo.Properties.Base), then apply the per-transaction equations pointwise. The consumed version threadsnoMintingSubTxs txthrough the sub-tx list induction.Batch level (
coin-of-consumedBatch,coin-of-producedBatch). Peel the outer+ inject _layers, substitute Layer 1 for the top-level summand and Layer 2 for the sub-transaction sum, and finish with a small associative-commutative shuffle using aswap-righthelper.UTXOW-levelUTXOW-I-getCoin,UTXOW-V-mechanical,UTXOW-batch-balance-coin, andutxow-pov-invalidare thin wrappers. BothUTXOW-normalandUTXOW-legacyembed aUTXOderivation as their final premise, so a singleUTXOW⇒UTXOextractor reduces every statement to its UTXO-level counterpart.Combined
UTXO-povstatementThe combined
UTXO-povtheorem is stated but left as a placeholder ({!!}) — its exact form depends on how the consumer (LEDGER-pov, sub-issue #<C>) threads sub-transaction state. All three of its building blocks (UTXO-I-getCoin,UTXO-V-mechanical,batch-balance-coin) are already proved.Outstanding proof obligations
balance-∪andsplit-balanceare taken as module parameters ofUtxo.Properties.PoV. The Conway versions of these lemmas rely onindexedSumᵐ-congover a finite map of hashedTxOuts; Dijkstra definesbalanceas∑ˢover aℙ Value, so the Conway proofs do not apply verbatim. Porting them requires the set-theoretic cong lemmas fromabstract-set-theory.FiniteSetTheoryand is era-independent enough to be tracked as its own follow-up.outs-disjointis also taken as a module parameter; oncenewTxid⇒disj(already proved inUtxo.Properties.Base) is combined with the appropriate UTxO disjointness reasoning, this can be discharged locally.Design notes
λ {u}{u'} →η-wrappingPassing
balance-∪directly toUTXOW-PoVtriggers Agda to eta-expand the{u u' : UTxO}implicits throughUTxO'sΣ _ left-uniquerecord structure, leaving theleft-uniquefield as an unresolved meta. Binding{u}{u'}as pattern variables in an outer lambda makes them concrete bound values and sidesteps the eta-expansion. This pattern is used at theUTXOW⇒UTXOinstantiation site.Why no per-step "before/after" theorem at the UTXO level
Unlike Conway, the mechanical state change alone (for the valid case) does not suffice to prove a local
getCoin s₀ ≡ getCoin s₁equation, becauseutxoSt₀passed to theUTXOrule at the LEDGER level is the post-SUBLEDGERSstate, not the pre-batch state, so in generalUTxOOf utxoSt₀ ≢ UTxOOf Γ; andUTxOOf Γ(the pre-batch snapshot) to quantities summed over the entire batch, not just the top-level tx.Consequently, deriving a full value-preservation statement for the UTXO rule alone requires threading information about the preceding
SUBLEDGERSstep — work that is done inLEDGER-pov(sub-issue #<C>), not here.Checklist
CHANGELOG.md