def rt
bend-collections-laws-math@1.0.0.0 · proofs/math/typed/u64laws.bend:38
import bend-collections-laws-math@1.0.0.0/proofs/math/typed/u64laws.bend as U64laws
import Base
import bend-collections-laws-math@1.0.0.0/spec/lib/common.bend as C
import bend-collections-laws-math@1.0.0.0/spec/math/generic.bend as SG
import bend-collections-laws-math@1.0.0.0/src/math/u64.bend as WU
import bend-collections-laws-math@1.0.0.0/proofs/math/typed/width.bend as WW
import bend-collections-laws-math@1.0.0.0/proofs/math/typed/u32laws.bend as LW
38def rt(+x: WU.U64) -> {SG.u64_of(v(x)) == x : WU.U64}:
39 match x:
40 case WU.U64{+l, +h}:
41 +el = WW.low_u(32n, LW.v(l), LW.v(h), LW.vb(l))
42 +eh = WW.high_u(32n, LW.v(l), LW.v(h), LW.vb(l))
43 +e1 = Equal.trans(U32, U32.from_nat(C.low(32n, v(WU.U64{l, h}))), U32.from_nat(LW.v(l)), l, Equal.cong(Nat, U32, z => U32.from_nat(z), C.low(32n, v(WU.U64{l, h})), LW.v(l), el), LW.rt(l))
44 +e2 = Equal.trans(U32, U32.from_nat(C.high(32n, v(WU.U64{l, h}))), U32.from_nat(LW.v(h)), h, Equal.cong(Nat, U32, z => U32.from_nat(z), C.high(32n, v(WU.U64{l, h})), LW.v(h), eh), LW.rt(h))
45 Equal.trans(WU.U64, WU.U64{U32.from_nat(C.low(32n, v(WU.U64{l, h}))), U32.from_nat(C.high(32n, v(WU.U64{l, h})))}, WU.U64{l, U32.from_nat(C.high(32n, v(WU.U64{l, h})))}, WU.U64{l, h}, Equal.cong(U32, WU.U64, z => WU.U64{z, U32.from_nat(C.high(32n, v(WU.U64{l, h})))}, U32.from_nat(C.low(32n, v(WU.U64{l, h}))), l, e1), Equal.cong(U32, WU.U64, z => WU.U64{l, z}, U32.from_nat(C.high(32n, v(WU.U64{l, h}))), h, e2))