Rconst.lt_of_sum: def of bend-collections-laws-crypto@1.0.0.0 Import: import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/rconst.bend as Rconst Lines 81-89 of bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/rconst.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/rconst.bend&start_line=81&end_line=89 import Base import bend-collections-laws-crypto@1.0.0.0/proofs/lib/nat.bend as N import bend-collections-laws-crypto@1.0.0.0/proofs/lib/lemmas/proofs/nat_algebra.bend as NA import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/ineq.bend as I # a + c = b + d and c < d give b < a def lt_of_sum(+a: Nat, +b: Nat, +c: Nat, +d: Nat, +e: {Nat.add(a, c) == Nat.add(b, d) : Nat}, +h: {Nat.is_lt(c, d) == True{} : Bool}) -> {Nat.is_lt(b, a) == True{} : Bool}: +h2 = N.lt_succ_le_succ(c, d, h) +h3 = N.le_add_left(1n+c, d, b, h2) +h4 = I.le_subst_r(Nat.add(b, 1n+c), Nat.add(b, d), Nat.add(a, c), Equal.sym(Nat, Nat.add(a, c), Nat.add(b, d), e), h3) +e2 = Equal.trans(Nat, Nat.add(b, 1n+c), 1n+Nat.add(b, c), Nat.add(c, 1n+b), NA.add_succ(b, c), sc(b, c)) +h5 = I.le_subst_l(Nat.add(b, 1n+c), Nat.add(c, 1n+b), Nat.add(a, c), e2, h4) +h6 = I.le_subst_r(Nat.add(c, 1n+b), Nat.add(a, c), Nat.add(c, a), NA.add_comm(a, c), h5) N.succ_le_lt(b, a, le_cancel_l(c, 1n+b, a, h6)) Uses (15): 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=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=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_lt https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/ineq.bend&name=le_subst_l https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/ineq.bend&name=le_subst_r https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/rconst.bend&name=le_cancel_l https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/rconst.bend&name=sc https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/lib/lemmas/proofs/nat_algebra.bend&name=add_comm https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/lib/lemmas/proofs/nat_algebra.bend&name=add_succ https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/lib/nat.bend&name=le_add_left https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/lib/nat.bend&name=lt_succ_le_succ https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/lib/nat.bend&name=succ_le_lt