SubtractionBounds.u32_exact: def of bend-collections-laws-math@1.0.0.0 Import: import bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/proofs/subtraction_bounds.bend as SubtractionBounds Lines 52-58 of bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/proofs/subtraction_bounds.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/proofs/subtraction_bounds.bend&start_line=52&end_line=58 import Base import bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/spec/numeric.bend as S import bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/proofs/numeric.bend as Numeric def u32_exact(a: U32, b: U32, enough: {Nat.is_le(U32.to_nat(b), U32.to_nat(a)) == True{} : Bool}) -> {U32.to_nat(U32.sub(a, b)) == Nat.sub(U32.to_nat(a), U32.to_nat(b)) : Nat}: match a b: case U32{+x} U32{+y}: %Equal.sym(Nat, Word.to_nat(32n, Word.sub(32n, x, y)), S.unsigned(32n, Word.sub(32n, x, y)), Numeric.primitive_word_interpretation(32n, Word.sub(32n, x, y))) : {_ == Nat.sub(Word.to_nat(32n, x), Word.to_nat(32n, y)) : Nat} %Equal.sym(Nat, Word.to_nat(32n, x), S.unsigned(32n, x), Numeric.primitive_word_interpretation(32n, x)) : {S.unsigned(32n, Word.sub(32n, x, y)) == Nat.sub(_, Word.to_nat(32n, y)) : Nat} %Equal.sym(Nat, Word.to_nat(32n, y), S.unsigned(32n, y), Numeric.primitive_word_interpretation(32n, y)) : {S.unsigned(32n, Word.sub(32n, x, y)) == Nat.sub(S.unsigned(32n, x), _) : Nat} exact(32n, x, y, primitive_bound(x, y, enough)) 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=Equal.sym 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=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.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.to_nat https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/proofs/numeric.bend&name=primitive_word_interpretation https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/proofs/subtraction_bounds.bend&name=exact https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/proofs/subtraction_bounds.bend&name=primitive_bound https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/spec/numeric.bend&name=unsigned