Skip to content

Conversation

@facundominguez
Copy link
Collaborator

@facundominguez facundominguez commented Oct 31, 2025

This PR modifies updates updateCertDeposits so pool deposits are not counted again when reregistering a pool. This is the function used by the UTXO rule to update deposits.

The change to the function is fairly simple, but then there are a few broken proofs that are fixed in later commits.

Comment on lines 139 to 142
open import Relation.Binary.Reasoning.PartialOrder ⊆-Poset
open import Relation.Binary.Structures using (IsEquivalence)
module ≡ᵉA = IsEquivalence (≡ᵉ-isEquivalence {A = A})
open import Relation.Binary.Reasoning.Syntax
open ⊆-syntax _IsRelatedTo_ _IsRelatedTo_ ≤-go public
Copy link
Collaborator Author

@facundominguez facundominguez Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setup is longer than the proof. Maybe we should create a module
Axiom.Set.Reasoning to reexport these?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option is just to use the same style as in the proofs below:

  dom∪ˡˡ a∈ = begin→ a∈ $
    a ∈ dom (m ˢ)                   →⟨ ∪-⊆ˡ ⟩
    a ∈ dom (m ˢ) ∪ dom (rhs-∪ˡ ˢ)  →⟨ proj₂ dom∪ ⟩
    a ∈ dom ((m ˢ) ∪ (rhs-∪ˡ ˢ))    →⟨ id ⟩
    a ∈ dom ((m ∪ˡ m') ˢ)
    ∎→

Copy link
Collaborator Author

@facundominguez facundominguez Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the latest version I rewrote this with Function.Reasoning._|>_:. Thanks to @javierdiaz72 for pointing it.

@WhatisRT suggested using EquivalenceReasoning from Function.Related.Propositional, but I couldn't figure out how to use it with implication yet.

  dom∪ˡˡ {a} a∈ = a∈ |> id ∶
      a ∈ dom (m ˢ)                   |> ∪-⊆ˡ ∶
      a ∈ dom (m ˢ) ∪ dom (rhs-∪ˡ ˢ)  |> proj₂ dom∪ ∶
      a ∈ dom ((m ˢ) ∪ (rhs-∪ˡ ˢ))    |> id ∶
      a ∈ dom ((m ∪ˡ m') ˢ)

Comment on lines 145 to 153
_∎→ : ∀ (A : Type) → A → A
A ∎→ = id
infix 3 _∎→
_→⟨_⟩_ : ∀ (x : Type) {y z : Type} → (x → y) → (y → z) → x → z
_ →⟨ f ⟩ g = g ∘ f
infixr 2 _→⟨_⟩_
begin→ : ∀ {A B : Type} → A → (A → B) → B
begin→ a f = f a
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are used in the proofs below. Do they belong here or in some more general place?

@facundominguez facundominguez force-pushed the fd/reregistration-deposits branch 2 times, most recently from 80a957a to 8f29a25 Compare October 31, 2025 19:39
@facundominguez facundominguez force-pushed the fd/reregistration-deposits branch from 8f29a25 to 7a868c3 Compare November 3, 2025 15:47
@facundominguez facundominguez force-pushed the fd/reregistration-deposits branch from 2163de1 to edb257b Compare November 5, 2025 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants