Word.inc_zero: def of bend-collections-laws-crypto@1.0.0.0 Import: import bend-collections-laws-crypto@1.0.0.0/proofs/lib/word.bend as Word Lines 224-232 of bend-collections-laws-crypto@1.0.0.0/proofs/lib/word.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/lib/word.bend&start_line=224&end_line=232 import Base # an increment is zero iff it wrapped from all ones def inc_zero(+n: Nat, +x: Word(n)) -> {Cmp.is_eq(Word.cmp(n, Word.inc(n, x), Word.zero(n))) == ones(n, x) : Bool}: match n x: case 0n WNil{}: {==} case 1n+p WCon{False{}, t}: eq_fin_tf(Word.cmp(p, t, Word.zero(p))) case 1n+p WCon{True{}, t}: Equal.trans(Bool, Cmp.is_eq(Word.cmp.fin(False{}, False{}, Word.cmp(p, Word.inc(p, t), Word.zero(p)))), Cmp.is_eq(Word.cmp(p, Word.inc(p, t), Word.zero(p))), ones(p, t), eq_fin_ff(Word.cmp(p, Word.inc(p, t), Word.zero(p))), inc_zero(p, t)) Uses (14): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Cmp.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.trans https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat 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=Base/base.bend&name=Word.Nil https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.cmp https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.cmp.fin https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.inc https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.zero https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/lib/word.bend&name=eq_fin_ff https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/lib/word.bend&name=eq_fin_tf https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/lib/word.bend&name=ones