def h.absent_put
bend-kit-collections@0.1.4.1 · PROOF.bend:2394
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
2394def h.absent_put(
2395 ~K: Data, ~V: Data, ~eq: K -> K -> Bool, ~refl: @x: K -> {eq(x, x) == True{} : Bool},
2396 ~sound: @x: K -> @y: K -> {eq(x, y) == True{} : Bool} -> {x == y : K},
2397 xs: List<&2, M.Entry<K, V>>, +key: K, +k: K, +v: V,
2398 ab: {Laws.hmap_absent(~K, ~V, ~eq, xs, key) == True{} : Bool},
2399 +nk: {eq(k, key) == False{} : Bool}
2400) -> {Laws.hmap_absent(~K, ~V, ~eq, M.HMap.entries.put(~K, ~V, ~eq, xs, k, v), key) == True{} : Bool}:
2401 match xs:
2402 case Nil{}:
2403 %h.sb(eq(key, k), False{}, h.eq_sym_f(~K, ~eq, ~refl, ~sound, k, key, nk))
2404 : {Bool.and(Bool.not(_), True{}) == True{} : Bool}
2405 {==}
2406 case Con{M.Entry{+key2, +val}, +rest}:
2407 +ab = ab
2408 h.absent_put.c(~K, ~V, ~eq, key2, val, rest, key, k, v, eq(k, key2), ab,
2409 h.absent_put(~K, ~V, ~eq, ~refl, ~sound, rest, key, k, v,
2410 MBool.eq_true_of_and_right(Bool.not(eq(key, key2)), Laws.hmap_absent(~K, ~V, ~eq, rest, key), ab), nk))