def un.inc_w
bend-osdev-u32@0.1.0.0 · PROOF.bend:722
import bend-osdev-u32@0.1.0.0/PROOF.bend as PROOF
import Base
import bend-osdev-u32@0.1.0.0/u32.bend as U
722def un.inc_w(n: Nat, w: Word(n), h: {Nat.is_lt(1n+Word.to_nat(n, w), U.U32Nat.dbl(n, 1n)) == True{} : Bool}) -> {Word.to_nat(n, Word.inc(n, w)) == 1n+Word.to_nat(n, w) : Nat}:
723 match n:
724 case 0n:
725 Empty.absurd({Word.to_nat(0n, Word.inc(0n, w)) == 1n+Word.to_nat(0n, w) : Nat}, un.ft(h))
726 case 1n+ +p:
727 match w:
728 case WCon{False{}, t}:
729 {==}
730 case WCon{True{}, +t}:
731 +x = Word.to_nat(p, t)
732 un.double_cong(Word.to_nat(p, Word.inc(p, t)), 1n+x, un.inc_w(p, t, Equal.trans(Bool, Nat.is_lt(1n+x, U.U32Nat.dbl(p, 1n)), Nat.is_lt(Nat.double(1n+x), Nat.double(U.U32Nat.dbl(p, 1n))), True{}, Equal.sym(Bool, Nat.is_lt(Nat.double(1n+x), Nat.double(U.U32Nat.dbl(p, 1n))), Nat.is_lt(1n+x, U.U32Nat.dbl(p, 1n)), un.lt_dbl(1n+x, U.U32Nat.dbl(p, 1n))), h)))