LAWS.size_count: law of lawful-arrays@0.1.0.0 Import: import lawful-arrays@0.1.0.0/LAWS.bend as LAWS Lines 39-47 of lawful-arrays@0.1.0.0/LAWS.bend: https://jend.leeeet.dev/read.txt?path=lawful-arrays@0.1.0.0/LAWS.bend&start_line=39&end_line=47 import Base import lawful-arrays@0.1.0.0/defs.bend as D # Array.size doubles 1 once per level of the left spine: for a perfect tree of # depth d below 32 that is the number of leaves, 2^d. law size_count: for -T: Data for a: Array for d: Nat for hf: {D.full(T, a, d) == True{} : Bool} for hd: {Nat.is_lt(d, 32n) == True{} : Bool} {U32.to_nat(Pair.snd(Array, U32, Array.size(T, a))) == Nat.pow(2n, d) : Nat} Uses (12): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array.size 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.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.pow https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair.snd https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=lawful-arrays@0.1.0.0/PROOF.bend&name=size_count.go https://jend.leeeet.dev/definition.txt?path=lawful-arrays@0.1.0.0/defs.bend&name=full https://jend.leeeet.dev/definition.txt?path=lawful-arrays@0.1.0.0/proof_tree.bend&name=mirror