def h.eg_del_same

bend-kit-collections@0.1.4.1 · PROOF.bend:2315

import bend-kit-collections@0.1.4.1/PROOF.bend as PROOF
import Base
import bend-mathlib@0.7.4.0/bool.bend as MBool
import bend-kit-collections@0.1.4.1/LAWS.bend as Laws
import bend-kit-collections@0.1.4.1/hmap.bend as M

2315def h.eg_del_same(
2316  ~K: Data, ~V: Data, ~eq: K -> K -> Bool,
2317  ~sound: @x: K -> @y: K -> {eq(x, y) == True{} : Bool} -> {x == y : K},
2318  xs: List<&2, M.Entry<K, V>>, +k: K,
2319  ds: {Laws.hmap_distinct(~K, ~V, ~eq, xs) == True{} : Bool}
2320) -> {M.HMap.entries.get(~K, ~V, ~eq, M.HMap.entries.del(~K, ~V, ~eq, xs, k), k) == None{} : Maybe<&2, V>}:
2321  match xs:
2322    case Nil{}:
2323      {==}
2324    case Con{M.Entry{+key, +val}, +rest}:
2325      +ds = ds
2326      h.eg_del_same.c(~K, ~V, ~eq, ~sound, key, val, rest, k, eq(k, key), {==},
2327        MBool.eq_true_of_and_left(Laws.hmap_absent(~K, ~V, ~eq, rest, key), Laws.hmap_distinct(~K, ~V, ~eq, rest), ds),
2328        h.eg_del_same(~K, ~V, ~eq, ~sound, rest, k,
2329          MBool.eq_true_of_and_right(Laws.hmap_absent(~K, ~V, ~eq, rest, key), Laws.hmap_distinct(~K, ~V, ~eq, rest), ds)))

Uses (11)

Used by (1)