def half_lo

bend-collections-laws-math@1.0.0.0 · proofs/math/typed/f64sqn.bend:65

import bend-collections-laws-math@1.0.0.0/proofs/math/typed/f64sqn.bend as F64sqn
import Base
import bend-collections-laws-math@1.0.0.0/proofs/lib/logic.bend as L
import bend-collections-laws-math@1.0.0.0/proofs/math/natural/arith.bend as NR

65# halving: S <= (r0 + Q) / 2 <= S + 6
66def half_lo(+S: Nat, +n: Nat, +h: {Nat.is_le(Nat.add(S, S), n) == True{} : Bool}) -> {Nat.is_le(S, Nat.div(n, 2n)) == True{} : Bool}:
67  Equal.trans(Bool, Nat.is_le(S, Nat.div(n, 2n)), Nat.is_le(Nat.mul(S, 2n), n), True{}, NR.le_div(1n, S, n), L.subst(Nat, z => {Nat.is_le(z, n) == True{} : Bool}, Nat.add(S, S), Nat.mul(S, 2n), Equal.sym(Nat, Nat.mul(S, 2n), Nat.add(S, S), two_mul(S)), h))

Uses (11)

Used by (0)

No other definition uses this definition.