Forward some map function to Finite{,Value}Map

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
Danila Fedorin 2024-05-08 20:34:15 -07:00
parent 3859826293
commit 6b116ed960
2 changed files with 15 additions and 1 deletions

View File

@ -35,6 +35,9 @@ open import Lattice.Map ≡-dec-A lB as Map
; keys to keysᵐ ; keys to keysᵐ
; _updating_via_ to _updatingᵐ_via_ ; _updating_via_ to _updatingᵐ_via_
; updating-via-keys-≡ to updatingᵐ-via-keys-≡ ; updating-via-keys-≡ to updatingᵐ-via-keys-≡
; updating-via-k∈ks to updatingᵐ-via-k∈ks
; updating-via-k∈ks-≡ to updatingᵐ-via-k∈ks-≡
; updating-via-∈k-forward to updatingᵐ-via-∈k-forward
; f'-Monotonic to f'-Monotonicᵐ ; f'-Monotonic to f'-Monotonicᵐ
; _≼_ to _≼ᵐ_ ; _≼_ to _≼ᵐ_
; ∈k-dec to ∈k-decᵐ ; ∈k-dec to ∈k-decᵐ
@ -83,6 +86,8 @@ module WithKeys (ks : List A) where
_∈k_ : A FiniteMap Set a _∈k_ : A FiniteMap Set a
_∈k_ k (m₁ , _) = k ∈ˡ (keysᵐ m₁) _∈k_ k (m₁ , _) = k ∈ˡ (keysᵐ m₁)
open Map using (forget) public
∈k-dec = ∈k-decᵐ ∈k-dec = ∈k-decᵐ
locate : {k : A} {fm : FiniteMap} k ∈k fm Σ B (λ v (k , v) fm) locate : {k : A} {fm : FiniteMap} k ∈k fm Σ B (λ v (k , v) fm)
@ -171,6 +176,15 @@ module WithKeys (ks : List A) where
f'-Monotonic : Monotonic _≼ˡ_ _≼_ f' f'-Monotonic : Monotonic _≼ˡ_ _≼_ f'
f'-Monotonic {l₁} {l₂} l₁≼l₂ = f'-Monotonicᵐ lL (proj₁ f) f-Monotonic g g-Monotonicʳ ks l₁≼l₂ f'-Monotonic {l₁} {l₂} l₁≼l₂ = f'-Monotonicᵐ lL (proj₁ f) f-Monotonic g g-Monotonicʳ ks l₁≼l₂
f'-∈k-forward : {k l} k ∈k (f l) k ∈k (f' l)
f'-∈k-forward {k} {l} = updatingᵐ-via-∈k-forward (proj₁ (f l)) ks (updater l)
f'-k∈ks : {k l} k ∈ˡ ks k ∈k (f' l) (k , updater l k) (f' l)
f'-k∈ks {k} {l} = updatingᵐ-via-k∈ks (proj₁ (f l)) (updater l)
f'-k∈ks-≡ : {k v l} k ∈ˡ ks (k , v) (f' l) v updater l k
f'-k∈ks-≡ {k} {v} {l} = updatingᵐ-via-k∈ks-≡ (proj₁ (f l)) (updater l)
all-equal-keys : (fm₁ fm₂ : FiniteMap) (Map.keys (proj₁ fm₁) Map.keys (proj₁ fm₂)) all-equal-keys : (fm₁ fm₂ : FiniteMap) (Map.keys (proj₁ fm₁) Map.keys (proj₁ fm₂))
all-equal-keys (fm₁ , km₁≡ks) (fm₂ , km₂≡ks) = trans km₁≡ks (sym km₂≡ks) all-equal-keys (fm₁ , km₁≡ks) (fm₂ , km₂≡ks) = trans km₁≡ks (sym km₂≡ks)

View File

@ -32,7 +32,7 @@ open import Isomorphism using (IsInverseˡ; IsInverseʳ)
open import Lattice.Map ≡-dec-A lB open import Lattice.Map ≡-dec-A lB
using using
( subset-impl ( subset-impl
; locate; forget ; locate
; Map-functional ; Map-functional
; Expr-Provenance ; Expr-Provenance
; Expr-Provenance-≡ ; Expr-Provenance-≡