ProofValue.wv.char_add: def of bend-osdev-word64@0.1.1.0 Import: import bend-osdev-word64@0.1.1.0/proof_value.bend as ProofValue Lines 385-402 of bend-osdev-word64@0.1.1.0/proof_value.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-word64@0.1.1.0/proof_value.bend&start_line=385&end_line=402 import Base import bend-osdev-u32@0.1.0.0/u32.bend as U import bend-osdev-u32@0.1.0.0/LAWS.bend as UL def wv.char_add(+n: Nat, x: Nat, +s: Nat, +a: Nat, +b: Nat, e: {Nat.add(s, wv.Q(n, x)) == Nat.add(a, b) : Nat}, ha: {Nat.is_lt(a, wv.Q(n, 1n)) == True{} : Bool}, hb: {Nat.is_lt(b, wv.Q(n, 1n)) == True{} : Bool}) -> {x == U.U32Nat.bit(Nat.is_lt(s, a)) : Nat}: match x: case 0n: +es = Equal.trans(Nat, s, Nat.add(s, 0n), Nat.add(a, b), Equal.sym(Nat, Nat.add(s, 0n), s, UL.nat_add_zero(s)), Equal.trans(Nat, Nat.add(s, 0n), Nat.add(s, wv.Q(n, 0n)), Nat.add(a, b), Equal.cong(Nat, Nat, v => Nat.add(s, v), 0n, wv.Q(n, 0n), Equal.sym(Nat, wv.Q(n, 0n), 0n, wv.q0(n))), e)) %Equal.sym(Nat, s, Nat.add(a, b), es) : {0n == U.U32Nat.bit(Nat.is_lt(_, a)) : Nat} %Equal.sym(Bool, Nat.is_lt(Nat.add(a, b), a), False{}, wn.not_lt_add(a, b)) : {0n == U.U32Nat.bit(_) : Nat} {==} case 1n+x1: match x1: case 0n: +q1 = wv.Q(n, 1n) +h1 = Equal.trans(Bool, Nat.is_lt(Nat.add(a, b), Nat.add(a, q1)), Nat.is_lt(b, q1), True{}, wn.lt_add_l(a, b, q1), hb) +h2 = wn.lt_rw(Nat.add(a, b), Nat.add(s, q1), Nat.add(a, q1), Equal.sym(Nat, Nat.add(s, q1), Nat.add(a, b), e), h1) +lt = Equal.trans(Bool, Nat.is_lt(s, a), Nat.is_lt(Nat.add(s, q1), Nat.add(a, q1)), True{}, Equal.sym(Bool, Nat.is_lt(Nat.add(s, q1), Nat.add(a, q1)), Nat.is_lt(s, a), wn.lt_add_r(s, a, q1)), h2) %Equal.sym(Bool, Nat.is_lt(s, a), True{}, lt) : {1n == U.U32Nat.bit(_) : Nat} {==} case 1n+y: Empty.absurd({2n+y == U.U32Nat.bit(Nat.is_lt(s, a)) : Nat}, wn.lt_irrefl(Nat.add(a, b), wn.lt_rw2(Nat.add(a, b), Nat.add(s, wv.Q(n, 2n+y)), Nat.add(a, b), e, wv.q_two(n, y, s, a, b, ha, hb)))) 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=Empty.absurd https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.cong https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.sym https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.trans 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_lt https://jend.leeeet.dev/definition.txt?path=bend-osdev-u32@0.1.0.0/LAWS.bend&name=nat_add_zero https://jend.leeeet.dev/definition.txt?path=bend-osdev-u32@0.1.0.0/u32.bend&name=U32Nat.bit https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/proof_value.bend&name=wn.lt_add_l https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/proof_value.bend&name=wn.lt_add_r https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/proof_value.bend&name=wn.lt_irrefl https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/proof_value.bend&name=wn.lt_rw https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/proof_value.bend&name=wn.lt_rw2 https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/proof_value.bend&name=wn.not_lt_add https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/proof_value.bend&name=wv.Q https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/proof_value.bend&name=wv.q0 https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/proof_value.bend&name=wv.q_two