PROOF.un.shlput: def of bend-osdev-u32@0.1.0.0 Import: import bend-osdev-u32@0.1.0.0/PROOF.bend as PROOF Lines 739-764 of bend-osdev-u32@0.1.0.0/PROOF.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-u32@0.1.0.0/PROOF.bend&start_line=739&end_line=764 import Base import bend-osdev-u32@0.1.0.0/u32.bend as U def un.shlput(n: Nat, c: Bool, w: Word(n), h: {Nat.is_lt(Nat.add(U.U32Nat.bit(c), Nat.double(Word.to_nat(n, w))), U.U32Nat.dbl(n, 1n)) == True{} : Bool}) -> {Word.to_nat(n, Word.shl.put(n, c, w)) == Nat.add(U.U32Nat.bit(c), Nat.double(Word.to_nat(n, w))) : Nat}: match n: case 0n: match c w: case False{} WNil{}: {==} case True{} WNil{}: Empty.absurd({0n == 1n : Nat}, un.ft(h)) case 1n+ +p: match c w: case False{} WCon{False{}, +t}: +k = U.U32Nat.dbl(p, 1n) +x = Word.to_nat(p, t) un.double_cong(Word.to_nat(p, Word.shl.put(p, False{}, t)), Nat.double(x), un.shlput(p, False{}, t, Equal.trans(Bool, Nat.is_lt(Nat.double(x), k), Nat.is_lt(Nat.double(Nat.double(x)), Nat.double(k)), True{}, Equal.sym(Bool, Nat.is_lt(Nat.double(Nat.double(x)), Nat.double(k)), Nat.is_lt(Nat.double(x), k), un.lt_dbl(Nat.double(x), k)), h))) case False{} WCon{True{}, +t}: +k = U.U32Nat.dbl(p, 1n) +x = Word.to_nat(p, t) un.double_cong(Word.to_nat(p, Word.shl.put(p, True{}, t)), 1n+Nat.double(x), un.shlput(p, True{}, t, Equal.trans(Bool, Nat.is_lt(1n+Nat.double(x), k), Nat.is_lt(Nat.double(1n+Nat.double(x)), Nat.double(k)), True{}, Equal.sym(Bool, Nat.is_lt(Nat.double(1n+Nat.double(x)), Nat.double(k)), Nat.is_lt(1n+Nat.double(x), k), un.lt_dbl(1n+Nat.double(x), k)), h))) case True{} WCon{False{}, +t}: +k = U.U32Nat.dbl(p, 1n) +x = Word.to_nat(p, t) un.succ_cong(Nat.double(Word.to_nat(p, Word.shl.put(p, False{}, t))), Nat.double(Nat.double(x)), un.double_cong(Word.to_nat(p, Word.shl.put(p, False{}, t)), Nat.double(x), un.shlput(p, False{}, t, Equal.trans(Bool, Nat.is_lt(Nat.double(x), k), Nat.is_lt(1n+Nat.double(Nat.double(x)), Nat.double(k)), True{}, Equal.sym(Bool, Nat.is_lt(1n+Nat.double(Nat.double(x)), Nat.double(k)), Nat.is_lt(Nat.double(x), k), un.lt_dbl1(Nat.double(x), k)), h)))) case True{} WCon{True{}, +t}: +k = U.U32Nat.dbl(p, 1n) +x = Word.to_nat(p, t) un.succ_cong(Nat.double(Word.to_nat(p, Word.shl.put(p, True{}, t))), Nat.double(1n+Nat.double(x)), un.double_cong(Word.to_nat(p, Word.shl.put(p, True{}, t)), 1n+Nat.double(x), un.shlput(p, True{}, t, Equal.trans(Bool, Nat.is_lt(1n+Nat.double(x), k), Nat.is_lt(1n+Nat.double(1n+Nat.double(x)), Nat.double(k)), True{}, Equal.sym(Bool, Nat.is_lt(1n+Nat.double(1n+Nat.double(x)), Nat.double(k)), Nat.is_lt(1n+Nat.double(x), k), un.lt_dbl1(1n+Nat.double(x), k)), h)))) Uses (20): 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.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.double https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.Con https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.Nil https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.shl.put https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.to_nat https://jend.leeeet.dev/definition.txt?path=bend-osdev-u32@0.1.0.0/PROOF.bend&name=un.double_cong https://jend.leeeet.dev/definition.txt?path=bend-osdev-u32@0.1.0.0/PROOF.bend&name=un.ft https://jend.leeeet.dev/definition.txt?path=bend-osdev-u32@0.1.0.0/PROOF.bend&name=un.lt_dbl https://jend.leeeet.dev/definition.txt?path=bend-osdev-u32@0.1.0.0/PROOF.bend&name=un.lt_dbl1 https://jend.leeeet.dev/definition.txt?path=bend-osdev-u32@0.1.0.0/PROOF.bend&name=un.succ_cong 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-u32@0.1.0.0/u32.bend&name=U32Nat.dbl