Skip to content

Commit

Permalink
Use prop-||-⋁
Browse files Browse the repository at this point in the history
  • Loading branch information
HeinrichApfelmus committed May 7, 2024
1 parent 8b2be4d commit 7b3bca6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,13 +303,6 @@ getBIP32Path s = fmap toBIP32Path ∘ getDerivationPath s

{-# COMPILE AGDA2HS getBIP32Path #-}

lemma-||-⋁
: (b b' : Bool)
(b || b') ≡ True
(b ≡ True) ⋁ (b' ≡ True)
lemma-||-⋁ True b' refl = inl refl
lemma-||-⋁ False True refl = inr refl

--
@0 lemma-getDerivationPath-Just
: (s : AddressState)
Expand All @@ -333,7 +326,7 @@ lemma-getDerivationPath-Just s addr eq =
Just DerivationChange
)
; False {{eq2}} case (lemma-||-⋁ _ (isCustomerAddress s addr) eq) of λ
; False {{eq2}} case (prop-||-⋁ eq) of λ
{ (inl eqChange)
case trans (sym eqChange) eq2 of λ ()
; (inr eqCustomer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,6 @@ lemma-isChange-c0
isChange new addr
lemma-isChange-c0 = λ new c0 addr x c0 `witness` (sym x)

lemma-||-equal
: (b b' : Bool)
(b || b') ≡ True
(b ≡ True) ⋁ (b' ≡ True)
lemma-||-equal True b' refl = inl refl
lemma-||-equal False True refl = inr refl

onLeft
: {p p' q : Set} (p p') p ⋁ q p' ⋁ q
onLeft f (inl p) = inl (f p)
Expand All @@ -179,7 +172,7 @@ prop-balanceTransaction-addresses
⋁ addr ∈ map TxOut.address (PartialTx.outputs partialTx)

prop-balanceTransaction-addresses u partialTx new c0 tx balance addr el
= onLeft lemma2 (lemma-||-equal b1 b2 (sym lemma1))
= onLeft lemma2 (prop-||- (sym lemma1))
where
lemma1 =
begin
Expand Down

0 comments on commit 7b3bca6

Please sign in to comment.