def max_val_c

bend-collections-laws-math@1.0.0.0 · proofs/math/typed/u32int.bend:105

import bend-collections-laws-math@1.0.0.0/proofs/math/typed/u32int.bend as U32int
import Base
import bend-collections-laws-math@1.0.0.0/src/math/generic.bend as G
import bend-collections-laws-math@1.0.0.0/src/math/num.bend as NM
import bend-collections-laws-math@1.0.0.0/src/math/instances.bend as I
import bend-collections-laws-math@1.0.0.0/proofs/math/typed/u32.bend as U32P

105def max_val_c(+x: U32, +lo: U32, +c: Bool, +hc: {I.u32_is(NM.Lt{x, lo}) == c : Bool}) -> {v(G.pick(U32, c, lo, x)) == Nat.max(v(x), v(lo)) : Nat}:
106  match c:
107    case True{}:
108      Equal.sym(Nat, Nat.max(v(x), v(lo)), v(lo), U32P.max_of_lt(v(x), v(lo), lt_of(x, lo, True{}, hc)))
109    case False{}:
110      Equal.sym(Nat, Nat.max(v(x), v(lo)), v(x), U32P.max_of_ge(v(x), v(lo), lt_of(x, lo, False{}, hc)))

Uses (12)

Used by (1)