def eq_sym_c

bend-collections-laws-crypto@1.0.0.0 · proofs/lib/words32.bend:16

import bend-collections-laws-crypto@1.0.0.0/proofs/lib/words32.bend as Words32
import Base
import bend-collections-laws-crypto@1.0.0.0/proofs/lib/logic.bend as L
import bend-collections-laws-crypto@1.0.0.0/proofs/lib/u32alg.bend as A
import bend-collections-laws-crypto@1.0.0.0/proofs/lib/u32.bend as UW

16def eq_sym_c(+a: U32, +b: U32, +c: Bool, +hc: {U32.is_eq(a, b) == c : Bool}, +d: Bool, +hd: {U32.is_eq(b, a) == d : Bool}) -> {c == d : Bool}:
17  match c d:
18    case True{} True{}:
19      {==}
20    case False{} False{}:
21      {==}
22    case True{} False{}:
23      Empty.absurd({True{} == False{} : Bool}, L.true_false(Equal.trans(Bool, True{}, U32.is_eq(b, a), False{}, L.subst(U32, z => {True{} == U32.is_eq(b, z) : Bool}, b, a, Equal.sym(U32, a, b, A.eq_of(a, b, hc)), Equal.sym(Bool, U32.is_eq(b, b), True{}, UW.u32_eq_refl(b))), hd)))
24    case False{} True{}:
25      Empty.absurd({False{} == True{} : Bool}, L.false_true(Equal.trans(Bool, False{}, U32.is_eq(a, b), True{}, Equal.sym(Bool, U32.is_eq(a, b), False{}, hc), L.subst(U32, z => {U32.is_eq(a, z) == True{} : Bool}, a, b, Equal.sym(U32, b, a, A.eq_of(b, a, hd)), UW.u32_eq_refl(a)))))

Uses (11)

Used by (1)