LAWS.to_nat_or_split: law of lawful-words@0.1.0.0 Import: import lawful-words@0.1.0.0/LAWS.bend as LAWS Lines 266-274 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=266&end_line=274 import Base # Or of a word with only bits from k up and a word below 2^k is their sum # (no bit in common). Xor likewise. law to_nat_or_split: for a: U32 for b: U32 for k: Nat for ha: {Nat.mod(U32.to_nat(a), Nat.pow(2n, k)) == 0n : Nat} for hb: {Nat.is_lt(U32.to_nat(b), Nat.pow(2n, k)) == True{} : Bool} {U32.to_nat(U32.or(a, b)) == Nat.add(U32.to_nat(a), U32.to_nat(b)) : Nat} Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool 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=Base/base.bend&name=Nat.mod https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.pow https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.or 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_or_split