def lt_sub2
bend-collections-laws-math@1.0.0.0 · proofs/math/natural/roots.bend:108
import bend-collections-laws-math@1.0.0.0/proofs/math/natural/roots.bend as Roots
import Base
import bend-collections-laws-math@1.0.0.0/proofs/lib/logic.bend as L
108
109def lt_sub2(+a: Nat, +b: Nat, +c: Nat, +h1: {Nat.is_lt(a, b) == True{} : Bool}, +h2: {Nat.is_le(c, a) == True{} : Bool}) -> {Nat.is_lt(Nat.sub(a, c), Nat.sub(b, c)) == True{} : Bool}:
110 match a b c:
111 case 0n 0n c0:
112 Empty.absurd({Nat.is_lt(Nat.sub(0n, c0), Nat.sub(0n, c0)) == True{} : Bool}, L.false_true(h1))
113 case 0n 1n+bp 0n:
114 {==}
115 case 0n 1n+bp 1n+cp:
116 Empty.absurd({Nat.is_lt(Nat.sub(0n, 1n+cp), Nat.sub(1n+bp, 1n+cp)) == True{} : Bool}, L.false_true(h2))
117 case 1n+ap 0n c0:
118 Empty.absurd({Nat.is_lt(Nat.sub(1n+ap, c0), Nat.sub(0n, c0)) == True{} : Bool}, L.false_true(h1))
119 case 1n+ap 1n+bp 0n:
120 h1
121 case 1n+ +ap 1n+ +bp 1n+ +cp:
122 lt_sub2(ap, bp, cp, h1, h2)