LAWS.to_nat_split: law of lawful-words@0.1.0.0 Import: import lawful-words@0.1.0.0/LAWS.bend as LAWS Lines 231-237 of lawful-words@0.1.0.0/LAWS.bend: https://jend.leeeet.dev/read.txt?path=lawful-words@0.1.0.0/LAWS.bend&start_line=231&end_line=237 import Base # A word splits into its high part (a >> k) and its low k bits (a & m). law to_nat_split: for a: U32 for m: U32 for k: Nat for h: {U32.to_nat(m) == Nat.sub(Nat.pow(2n, k), 1n) : Nat} {U32.to_nat(a) == Nat.add(Nat.mul(U32.to_nat(U32.shrn(a, k)), Nat.pow(2n, k)), U32.to_nat(U32.and(a, m))) : Nat} Uses (10): 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.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.pow https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shrn https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=lawful-words@0.1.0.0/proof_u32.bend&name=to_nat_split