def ws.gshr_hi_lt

bend-osdev-word64@0.1.1.0 · proof_shift.bend:456

import bend-osdev-word64@0.1.1.0/proof_shift.bend as ProofShift
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
import bend-osdev-word64@0.1.1.0/proof_value.bend as P
import bend-osdev-u32@0.1.0.0/LAWS_order.bend as UO

456def ws.gshr_hi_lt(+n: Nat, +k: Nat, +hw: Word(n), +lw: Word(n), +h1: {Nat.is_le(n, k) == True{} : Bool}) -> {Nat.is_lt(P.wv.V(n, hw, lw), U.U32Nat.dbl(k, 1n+P.wv.V(n, Word.zero(n), ws.shr(n, Nat.sub(k, n), hw)))) == True{} : Bool}:
457  +s1 = Equal.trans(Bool, Nat.is_lt(Nat.add(Word.to_nat(n, lw), U.U32Nat.dbl(n, Word.to_nat(n, hw))), Nat.add(U.U32Nat.dbl(n, 1n), U.U32Nat.dbl(n, Word.to_nat(n, hw)))), Nat.is_lt(Word.to_nat(n, lw), U.U32Nat.dbl(n, 1n)), True{}, P.wn.lt_add_r(Word.to_nat(n, lw), U.U32Nat.dbl(n, 1n), U.U32Nat.dbl(n, Word.to_nat(n, hw))), UL.word_value_lt(n, lw))
458  +s2 = P.wn.lt_rw2(Nat.add(Word.to_nat(n, lw), U.U32Nat.dbl(n, Word.to_nat(n, hw))), Nat.add(U.U32Nat.dbl(n, 1n), U.U32Nat.dbl(n, Word.to_nat(n, hw))), U.U32Nat.dbl(n, 1n+Word.to_nat(n, hw)), Equal.sym(Nat, U.U32Nat.dbl(n, 1n+Word.to_nat(n, hw)), Nat.add(U.U32Nat.dbl(n, 1n), U.U32Nat.dbl(n, Word.to_nat(n, hw))), UL.dbl_add(n, 1n, Word.to_nat(n, hw))), s1)
459  +s3 = Equal.trans(Bool, Nat.is_le(U.U32Nat.dbl(n, 1n+Word.to_nat(n, hw)), U.U32Nat.dbl(n, U.U32Nat.dbl(Nat.sub(k, n), 1n+Word.to_nat(n, ws.shr(n, Nat.sub(k, n), hw))))), Nat.is_le(1n+Word.to_nat(n, hw), U.U32Nat.dbl(Nat.sub(k, n), 1n+Word.to_nat(n, ws.shr(n, Nat.sub(k, n), hw)))), True{}, UL.dbl_le(n, 1n+Word.to_nat(n, hw), U.U32Nat.dbl(Nat.sub(k, n), 1n+Word.to_nat(n, ws.shr(n, Nat.sub(k, n), hw)))), Equal.trans(Bool, Nat.is_le(1n+Word.to_nat(n, hw), U.U32Nat.dbl(Nat.sub(k, n), 1n+Word.to_nat(n, ws.shr(n, Nat.sub(k, n), hw)))), Nat.is_lt(Word.to_nat(n, hw), U.U32Nat.dbl(Nat.sub(k, n), 1n+Word.to_nat(n, ws.shr(n, Nat.sub(k, n), hw)))), True{}, P.wn.le_succ(Word.to_nat(n, hw), U.U32Nat.dbl(Nat.sub(k, n), 1n+Word.to_nat(n, ws.shr(n, Nat.sub(k, n), hw)))), ws.shr_lt(n, Nat.sub(k, n), hw)))
460  +e = Equal.trans(Nat, U.U32Nat.dbl(n, U.U32Nat.dbl(Nat.sub(k, n), 1n+Word.to_nat(n, ws.shr(n, Nat.sub(k, n), hw)))), U.U32Nat.dbl(k, 1n+Word.to_nat(n, ws.shr(n, Nat.sub(k, n), hw))), U.U32Nat.dbl(k, 1n+P.wv.V(n, Word.zero(n), ws.shr(n, Nat.sub(k, n), hw))), Equal.sym(Nat, U.U32Nat.dbl(k, 1n+Word.to_nat(n, ws.shr(n, Nat.sub(k, n), hw))), U.U32Nat.dbl(n, U.U32Nat.dbl(Nat.sub(k, n), 1n+Word.to_nat(n, ws.shr(n, Nat.sub(k, n), hw)))), ns.dnj(n, k, 1n+Word.to_nat(n, ws.shr(n, Nat.sub(k, n), hw)), h1)), Equal.cong(Nat, Nat, v => U.U32Nat.dbl(k, 1n+v), Word.to_nat(n, ws.shr(n, Nat.sub(k, n), hw)), P.wv.V(n, Word.zero(n), ws.shr(n, Nat.sub(k, n), hw)), Equal.sym(Nat, P.wv.V(n, Word.zero(n), ws.shr(n, Nat.sub(k, n), hw)), Word.to_nat(n, ws.shr(n, Nat.sub(k, n), hw)), ws.gshr_hi_v(n, k, hw))))
461  UO.nat_lt_le_trans(P.wv.V(n, hw, lw), U.U32Nat.dbl(n, 1n+Word.to_nat(n, hw)), U.U32Nat.dbl(k, 1n+P.wv.V(n, Word.zero(n), ws.shr(n, Nat.sub(k, n), hw))), s2, P.wn.le_rw2(U.U32Nat.dbl(n, 1n+Word.to_nat(n, hw)), U.U32Nat.dbl(n, U.U32Nat.dbl(Nat.sub(k, n), 1n+Word.to_nat(n, ws.shr(n, Nat.sub(k, n), hw)))), U.U32Nat.dbl(k, 1n+P.wv.V(n, Word.zero(n), ws.shr(n, Nat.sub(k, n), hw))), e, s3))

Uses (26)

Used by (1)