def lt_or_eq

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

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

250def lt_or_eq(+a: Nat, +b: Nat, e: {Nat.is_le(a, b) == True{} : Bool}, ne: {Nat.is_eq(a, b) == False{} : Bool}) -> {Nat.is_lt(a, b) == True{} : Bool}:
251  match a b:
252    case 0n 0n:
253      Empty.absurd({Nat.is_lt(0n, 0n) == True{} : Bool}, L.true_false(ne))
254    case 0n 1n+q:
255      {==}
256    case 1n+p 0n:
257      Empty.absurd({Nat.is_lt(1n+p, 0n) == True{} : Bool}, L.false_true(e))
258    case 1n+p 1n+q:
259      lt_or_eq(p, q, e, ne)

Uses (8)

Used by (5)