@@ -35,10 +35,10 @@ the direct-deposit trick (see *Proof Strategy*), and the gov-deposit growth
3535
3636The ` PoolDepositsRegistered ` {.AgdaFunction} hypothesis is necessary, not an artifact
3737of the proof: the batch balance charges ` newCertDeposits ` {.AgdaFunction} against the
38- registered-pool set, while ` POOL-reg ` {.AgdaInductiveConstructor}'s left-biased pot
39- update silently keeps a stale entry for an unregistered pool — at a state with such
40- an entry, a pool registration destroys the charged deposit and the theorem is false.
41- On-chain states satisfy the hypothesis by construction.
38+ registered-pool set, while ` POOL-reg ` {.AgdaInductiveConstructor}'s left-biased update
39+ silently keeps a stale entry for an unregistered pool; at a state with such an entry,
40+ a pool registration destroys the charged deposit and the theorem is false. On-chain
41+ states satisfy the hypothesis by construction.
4242
4343## Proof Strategy
4444
@@ -49,25 +49,24 @@ The Dijkstra `LEDGER-pov`{.AgdaFunction} does not decompose into independent
4949may individually transfer value between UTxO and CertState without local balancing.
5050
5151Instead, the ` LEDGER-V ` proof is a single equational chain at the
52- ` LedgerState ` {.AgdaRecord} level, with the cancellation of total direct deposits as
53- the central trick — direct -deposit value appears both on the UTxO side (via
52+ ` LedgerState ` {.AgdaRecord} level, and cancellation of the * total* direct deposits is
53+ the key to the proof. Direct -deposit value appears both on the UTxO side (via
5454` producedBatch ` ) and on the CertState side (via ` applyDirectDeposits ` inside
5555` ENTITIES ` ) and cancels in the total.
5656
5757Concretely, the proof composes four inductions over the ` SUBLEDGERS ` {.AgdaDatatype}
5858reflexive-transitive closure, plus one arithmetic identity.
5959
60- + ** ` SUBLEDGERS-utxo-coin ` {.AgdaFunction}** threads the per- ` SUBUTXOW ` coin equation
61- (` subutxow-step-coin ` ).
62- + ** ` SUBLEDGERS-certs -pov ` {.AgdaFunction}** composes per-sub-transaction
60+ + ** ` SUBLEDGERS-utxo-coin ` {.AgdaFunction}** inducts over the subtransaction list,
61+ applying the per- ` SUBUTXOW ` coin equation (` subutxow-step-coin ` ) at each step .
62+ + ** ` SUBLEDGERS-rewards -pov ` {.AgdaFunction}** composes per-sub-transaction
6363 ` SUBENTITIES-pov ` {.AgdaFunction} invocations (the rewards flow).
6464+ ** ` SUBLEDGERS-deposits ` {.AgdaFunction}** (with ` SUBLEDGERS-registered ` {.AgdaFunction})
6565 telescopes the per-step closed-form deposit accounting into the batch-wide
6666 equation consumed by ` bat' ` .
67- + ** ` SUBLEDGERS-gov-coin ` {.AgdaFunction}** accumulates the per-` GOVS ` gov-deposit
68- growth.
69- + ** ` posNeg-deposits ` {.AgdaFunction}** equationally relates the pre-/post-batch deposit
70- totals to the ` posPart ` /` negPart ` of ` calculateDepositsChange ` .
67+ + ** ` SUBLEDGERS-gov-coin ` {.AgdaFunction}** accumulates the per-` GOVS ` gov-deposit growth.
68+ + ** ` posNeg-deposits ` {.AgdaFunction}** relates the pre-/post-batch deposit totals to
69+ the ` posPart ` /` negPart ` of ` calculateDepositsChange ` .
7170
7271The ` LEDGER-I ` case is straightforward; ` certState ` and ` govSt ` are unchanged,
7372` SUBLEDGERS ` is a no-op, and only the ` UTXOW ` step affects ` getCoin ` , which it
@@ -106,10 +105,6 @@ open import Ledger.Dijkstra.Specification.Utxow txs abs
106105
107106open import Ledger.Dijkstra.Specification.Entities.Properties.PoV txs
108107
109- -- We will import the following once the UTXO/UTXOW PoV proofs land:
110- -- open import Ledger.Dijkstra.Specification.Utxo.Properties.PoV txs abs
111- -- open import Ledger.Dijkstra.Specification.Utxow.Properties.PoV txs abs
112-
113108open import Interface.STS
114109
115110open RewardAddress
@@ -394,8 +389,8 @@ same quantity (the sum of deposits across the batch), just rephrased to expose
394389
395390## ` SUBLEDGERS-utxo-coin `
396391
397- Induct over the ` SUBLEDGERS ` reflexive-transitive closure, threading the
398- per-` SUBUTXOW ` coin equation:
392+ Induct over the ` SUBLEDGERS ` reflexive-transitive closure, applying the
393+ per-` SUBUTXOW ` coin equation at each step :
399394
400395``` agda
401396 SUBLEDGERS-utxo-coin :
@@ -450,7 +445,7 @@ per-`SUBUTXOW` coin equation:
450445 ih = SUBLEDGERS-utxo-coin isV rest
451446```
452447
453- ## ` SUBLEDGERS-certs -pov `
448+ ## ` SUBLEDGERS-rewards -pov `
454449
455450Parallel induction over ` SUBLEDGERS ` , composing per-sub-transaction ` SUBENTITIES-pov `
456451invocations. The ` NetworkId ` witnesses and domain conditions are premises of the
@@ -460,7 +455,7 @@ invocations. The `NetworkId` witnesses and domain conditions are premises of th
460455``` agda
461456 open SubLedgerEnv
462457
463- SUBLEDGERS-certs -pov :
458+ SUBLEDGERS-rewards -pov :
464459 {Γ : SubLedgerEnv}
465460 {s₀ s₁ : LedgerState}
466461 {stxs : List SubLevelTx}
@@ -469,12 +464,12 @@ invocations. The `NetworkId` witnesses and domain conditions are premises of th
469464 → coinFromRewards (CertStateOf s₀) + sum (map ddwl stxs)
470465 ≡ coinFromRewards (CertStateOf s₁) + sum (map wdrwl stxs)
471466
472- SUBLEDGERS-certs -pov _ (BS-base Id-nop) = refl
467+ SUBLEDGERS-rewards -pov _ (BS-base Id-nop) = refl
473468
474- SUBLEDGERS-certs -pov isV (BS-ind (SUBLEDGER-I (isI , _)) _) =
469+ SUBLEDGERS-rewards -pov isV (BS-ind (SUBLEDGER-I (isI , _)) _) =
475470 ⊥-elim (case trans (sym isV) isI of λ ())
476471
477- SUBLEDGERS-certs -pov {Γ} isV (BS-ind {s = s₀} {s' = s₁} {sigs} {s'' = sₙ}
472+ SUBLEDGERS-rewards -pov {Γ} isV (BS-ind {s = s₀} {s' = s₁} {sigs} {s'' = sₙ}
478473 (SUBLEDGER-V {stx = stx} (_ , _ , entitiesStep , _)) rest) =
479474 begin
480475 coinFromRewards (CertStateOf s₀) + (getCoin (DirectDepositsOf stx) + sum (map ddwl sigs))
@@ -495,7 +490,7 @@ invocations. The `NetworkId` witnesses and domain conditions are premises of th
495490 where
496491 ih : coinFromRewards (CertStateOf s₁) + sum (map ddwl sigs)
497492 ≡ coinFromRewards (CertStateOf sₙ) + sum (map wdrwl sigs)
498- ih = SUBLEDGERS-certs -pov isV rest
493+ ih = SUBLEDGERS-rewards -pov isV rest
499494```
500495
501496## ` SUBLEDGERS-deposits `
@@ -814,7 +809,7 @@ itself; the no-truncation bound comes from `ENTITIES-wdrls-bounded`.)
814809 coinFromRewards (CertStateOf s) + (subDirectDepsCoin + getCoin (DirectDepositsOf tx))
815810 ≡˘⟨ +-assoc (coinFromRewards (CertStateOf s)) subDirectDepsCoin (getCoin (DirectDepositsOf tx)) ⟩
816811 coinFromRewards (CertStateOf s) + subDirectDepsCoin + getCoin (DirectDepositsOf tx)
817- ≡⟨ cong (_+ getCoin (DirectDepositsOf tx)) (SUBLEDGERS-certs -pov valid subStep) ⟩
812+ ≡⟨ cong (_+ getCoin (DirectDepositsOf tx)) (SUBLEDGERS-rewards -pov valid subStep) ⟩
818813 coinFromRewards cs₁ + subWdrlsCoin + getCoin (DirectDepositsOf tx)
819814 ≡⟨ swap-right (coinFromRewards cs₁) subWdrlsCoin (getCoin (DirectDepositsOf tx)) ⟩
820815 coinFromRewards cs₁ + getCoin (DirectDepositsOf tx) + subWdrlsCoin
@@ -1038,10 +1033,7 @@ The main inner chain, showing LHS + E ≡ RHS + E:
10381033 ≡⟨ arithmetic-2 U₀ allWdrls D₀ ⟩
10391034 U₀ + Psub + allWdrls + (D₀ + posPart dct + posPart dcs) + Ctop
10401035 ≡⟨ cong (λ x → x + allWdrls + (D₀ + posPart dct + posPart dcs) + Ctop)
1041- (subst (λ u → U₀ + Psub ≡ U₁ + sum (map (λ stx → cbalance (u ∣ SpendInputsOf stx))
1042- (SubTransactionsOf tx)))
1043- (refl {x = UTxOOf (UTxOStateOf s)})
1044- (SUBLEDGERS-utxo-coin valid subStep)) ⟩
1036+ (SUBLEDGERS-utxo-coin valid subStep) ⟩
10451037 U₁ + Csub + allWdrls + (D₀ + posPart dct + posPart dcs) + Ctop
10461038 ≡⟨ cong (λ x → (U₁ + Csub) + allWdrls + x + Ctop) posneg ⟩
10471039 U₁ + Csub + allWdrls + (D₂ + negPart dct + negPart dcs) + Ctop
0 commit comments