def sub_succ_left

bend-collections-laws-crypto@1.0.0.0 · proofs/lib/nat.bend:297

import bend-collections-laws-crypto@1.0.0.0/proofs/lib/nat.bend as Nat
import Base
import bend-collections-laws-crypto@1.0.0.0/proofs/lib/logic.bend as L

297def sub_succ_left(+a: Nat, +b: Nat, e: {Nat.is_le(b, a) == True{} : Bool}) -> {Nat.sub(1n+a, b) == 1n+Nat.sub(a, b) : Nat}:
298  match a b:
299    case _ 0n:
300      %Equal.sym(Nat, Nat.sub(a, 0n), a, sub_zero(a)) : {1n+a == 1n+_ : Nat}
301      {==}
302    case 0n 1n+q:
303      Empty.absurd({Nat.sub(1n, 1n+q) == 1n+Nat.sub(0n, 1n+q) : Nat}, L.false_true(e))
304    case 1n+p 1n+q:
305      sub_succ_left(p, q, e)

Uses (8)

Used by (2)