def le_antisym

bend-collections-laws-math@1.0.0.0 · proofs/lib/nat.bend:205

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

205def le_antisym(+a: Nat, +b: Nat, ab: {Nat.is_le(a, b) == True{} : Bool}, ba: {Nat.is_le(b, a) == True{} : Bool}) -> {a == b : Nat}:
206  match a b:
207    case 0n 0n:
208      {==}
209    case 0n 1n+q:
210      Empty.absurd({0n == 1n+q : Nat}, L.false_true(ba))
211    case 1n+p 0n:
212      Empty.absurd({1n+p == 0n : Nat}, L.false_true(ab))
213    case 1n+p 1n+q:
214      succ_cong(p, q, le_antisym(p, q, ab, ba))

Uses (6)

Used by (19)