def is_zero_eq

bend-collections-laws-math@1.0.0.0 · proofs/math/u64/u64div.bend:319

import bend-collections-laws-math@1.0.0.0/proofs/math/u64/u64div.bend as U64div
import Base
import bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/src/wide.bend as W
import bend-collections-laws-math@1.0.0.0/proofs/lib/logic.bend as L

319def is_zero_eq(+n: Nat, +w: Word(n), +h: {W.is_zero(n, w) == True{} : Bool}) -> {w == Word.zero(n) : Word(n)}:
320  match n w:
321    case 0n WNil{}:
322      {==}
323    case 1n+p WCon{True{}, t}:
324      Empty.absurd({WCon{True{}, t} == Word.zero(1n+p) : Word(1n+p)}, L.false_true(h))
325    case 1n+p WCon{False{}, t}:
326      Equal.cong(Word(p), Word(1n+p), z => WCon{False{}, z}, t, Word.zero(p), is_zero_eq(p, t, h))

Uses (10)

Used by (1)