PROOF.bif.wb: def of bend-kit-collections@0.1.4.1 Import: import bend-kit-collections@0.1.4.1/PROOF.bend as PROOF Lines 1434-1452 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=1434&end_line=1452 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 bif.wb( -K: Data, -V: Data, heavy_hi: Bool, heavy_lo: Bool, +k: K, +v: V, +lo: O.OMap, +hi: O.OMap, eh: {Laws.g_heavy_hi(K, V, lo, hi) == heavy_hi : Bool}, el: {Laws.g_heavy_lo(K, V, lo, hi) == heavy_lo : Bool}, wbl: {WB(K, V, lo) == True{} : Bool}, wbh: {WB(K, V, hi) == True{} : Bool}, +alm: {Ord.alm(W(K, V, lo), W(K, V, hi)) == True{} : Bool} ) -> {WB(K, V, Laws.g_balance.if(K, V, heavy_hi, heavy_lo, k, v, lo, hi)) == True{} : Bool}: match heavy_hi heavy_lo: case True{} _: rl.wb(K, V, hi, k, v, lo, wbl, wbh, Ord.gt_le(W(K, V, hi), Nat.mul(3n, W(K, V, lo)), eh), MBool.eq_true_of_and_left(Nat.is_le(W(K, V, hi), Nat.add(3n, Nat.mul(3n, W(K, V, lo)))), Nat.is_le(W(K, V, lo), Nat.add(3n, Nat.mul(3n, W(K, V, hi)))), alm)) case False{} True{}: rh.wb(K, V, lo, k, v, hi, wbl, wbh, Ord.gt_le(W(K, V, lo), Nat.mul(3n, W(K, V, hi)), el), MBool.eq_true_of_and_right(Nat.is_le(W(K, V, hi), Nat.add(3n, Nat.mul(3n, W(K, V, lo)))), Nat.is_le(W(K, V, lo), Nat.add(3n, Nat.mul(3n, W(K, V, hi)))), alm)) case False{} False{}: wb.i(K, V, k, v, lo, hi, MBool.and_eq_true(Nat.is_le(W(K, V, hi), Nat.mul(3n, W(K, V, lo))), Nat.is_le(W(K, V, lo), Nat.mul(3n, W(K, V, hi))), Ord.ngt_le(W(K, V, hi), Nat.mul(3n, W(K, V, lo)), eh), Ord.ngt_le(W(K, V, lo), Nat.mul(3n, W(K, V, hi)), el)), wbl, wbh) 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.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mul https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/LAWS.bend&name=g_balance.if https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/LAWS.bend&name=g_heavy_hi https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/LAWS.bend&name=g_heavy_lo 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=rh.wb https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/PROOF.bend&name=rl.wb https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/PROOF.bend&name=wb.i https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/nat_order.bend&name=alm https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/nat_order.bend&name=gt_le https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/nat_order.bend&name=ngt_le 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