PROOF.bal.hi: def of bend-kit-collections@0.1.4.1 Import: import bend-kit-collections@0.1.4.1/PROOF.bend as PROOF Lines 1571-1584 of bend-kit-collections@0.1.4.1/PROOF.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-collections@0.1.4.1/PROOF.bend&start_line=1571&end_line=1584 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/omap.bend as O import bend-kit-collections@0.1.4.1/nat_order.bend as Ord def bal.hi( -K: Data, -V: Data, +k: K, +v: V, +lo: O.OMap, +hi: O.OMap, +hi2: O.OMap, +ok: {Laws.weight_ok(W(K, V, lo), W(K, V, hi)) == True{} : Bool}, wbl: {WB(K, V, lo) == True{} : Bool}, +pw: {PW(K, V, W(K, V, hi), hi2) == True{} : Bool} ) -> {PW(K, V, Nat.add(W(K, V, lo), W(K, V, hi)), Laws.g_balance(K, V, k, v, lo, hi2)) == True{} : Bool}: +a = W(K, V, lo) +c = W(K, V, hi) +c2 = W(K, V, hi2) +nr = MBool.eq_true_of_and_right(WB(K, V, hi2), Ord.near(c, c2), pw) +n1 = MBool.eq_true_of_and_left(Nat.is_le(c, 1n+c2), Nat.is_le(c2, 1n+c), nr) +n2 = MBool.eq_true_of_and_right(Nat.is_le(c, 1n+c2), Nat.is_le(c2, 1n+c), nr) MBool.and_eq_true(WB(K, V, Laws.g_balance(K, V, k, v, lo, hi2)), Ord.near(Nat.add(a, c), W(K, V, Laws.g_balance(K, V, k, v, lo, hi2))), bal.wb(K, V, k, v, lo, hi2, wbl, MBool.eq_true_of_and_left(WB(K, V, hi2), Ord.near(c, c2), pw), Ord.almhi.w0(a, c, c2, Ord.wok_l(a, c, ok), Ord.wok_r(a, c, ok), n1, n2)), bal.hi.near(K, V, k, v, lo, hi, hi2, n1, n2)) Uses (19): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_le https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/LAWS.bend&name=g_balance https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/LAWS.bend&name=weight_ok https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/PROOF.bend&name=PW https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/PROOF.bend&name=W https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/PROOF.bend&name=WB https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/PROOF.bend&name=bal.hi.near https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/PROOF.bend&name=bal.wb https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/nat_order.bend&name=almhi.w0 https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/nat_order.bend&name=near https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/nat_order.bend&name=wok_l https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/nat_order.bend&name=wok_r https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/omap.bend&name=OMap https://jend.leeeet.dev/definition.txt?path=bend-mathlib@0.8.1.0/bool.bend&name=and_eq_true https://jend.leeeet.dev/definition.txt?path=bend-mathlib@0.8.1.0/bool.bend&name=eq_true_of_and_left https://jend.leeeet.dev/definition.txt?path=bend-mathlib@0.8.1.0/bool.bend&name=eq_true_of_and_right