def and_lt

bend-collections-laws-math@1.0.0.0 · proofs/math/random/lemire.bend:37

import bend-collections-laws-math@1.0.0.0/proofs/math/random/lemire.bend as Lemire
import Base
import bend-collections-laws-math@1.0.0.0/proofs/lib/nat.bend as N

37# lo < n and lo < t is lo < t, when t < n
38def and_lt(+lo: Nat, +n: Nat, +t: Nat, +ht: {Nat.is_lt(t, n) == True{} : Bool}, +c: Bool, +hc: {Nat.is_lt(lo, t) == c : Bool}) -> {Bool.and(Nat.is_lt(lo, n), Nat.is_lt(lo, t)) == c : Bool}:
39  match c:
40    case True{}:
41      %Equal.sym(Bool, Nat.is_lt(lo, n), True{}, N.lt_trans(lo, t, n, hc, ht)) : {Bool.and(_, Nat.is_lt(lo, t)) == True{} : Bool}
42      hc
43    case False{}:
44      %Equal.sym(Bool, Nat.is_lt(lo, t), False{}, hc) : {Bool.and(Nat.is_lt(lo, n), _) == False{} : Bool}
45      and_false(Nat.is_lt(lo, n))

Uses (7)

Used by (2)