PROOF.bitw.popcount_le: def of bend-osdev-algo@0.1.0.0 Import: import bend-osdev-algo@0.1.0.0/PROOF.bend as PROOF Lines 160-169 of bend-osdev-algo@0.1.0.0/PROOF.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-algo@0.1.0.0/PROOF.bend&start_line=160&end_line=169 import Base import bend-osdev-algo@0.1.0.0/algo.bend as A def bitw.popcount_le(n: Nat, w: Word(n)) -> {Nat.is_le(A.bitw.popcount(n, w), n) == True{} : Bool}: match n: case 0n: {==} case 1n+ +p: match w: case WCon{True{}, t}: bitw.popcount_le(p, t) case WCon{False{}, +t}: nat.le_succ(A.bitw.popcount(p, t), p, bitw.popcount_le(p, t)) Uses (7): 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_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.Con https://jend.leeeet.dev/definition.txt?path=bend-osdev-algo@0.1.0.0/PROOF.bend&name=nat.le_succ https://jend.leeeet.dev/definition.txt?path=bend-osdev-algo@0.1.0.0/algo.bend&name=bitw.popcount