def eq_from_is_eq

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

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

223def eq_from_is_eq(+a: Nat, +b: Nat, e: {Nat.is_eq(a, b) == True{} : Bool}) -> {a == b : Nat}:
224  match a b:
225    case 0n 0n:
226      {==}
227    case 0n 1n+q:
228      Empty.absurd({0n == 1n+q : Nat}, L.false_true(e))
229    case 1n+p 0n:
230      Empty.absurd({1n+p == 0n : Nat}, L.false_true(e))
231    case 1n+p 1n+q:
232      succ_cong(p, q, eq_from_is_eq(p, q, e))

Uses (6)

Used by (32)