U32int.lall: def of bend-collections-laws-math@1.0.0.0 Import: import bend-collections-laws-math@1.0.0.0/proofs/math/typed/u32int.bend as U32int Lines 287-299 of bend-collections-laws-math@1.0.0.0/proofs/math/typed/u32int.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-math@1.0.0.0/proofs/math/typed/u32int.bend&start_line=287&end_line=299 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/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/natural.bend as M 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/u32laws.bend as LW # the fold on an accumulator r == checked(n) (c == fits(32, n)) def lall(+xs: List<&2, U32>, +r: Result<&2, &2, NM.NumError, U32>, +n: Nat, +c: Bool, +hr: {r == SG.checked_pick(~U32, ~SG.u32_of, n, c) : Result<&2, &2, NM.NumError, U32>}, +hc: {C.fits(32n, n) == c : Bool}) -> {G.lcm_all_go(~U32, ~I.u32_op, ~I.u32_is, xs, r) == SG.prefix_fin(~U32, ~SG.u32_of, SG.lcm_go(32n, vals(xs), n, c)) : Result<&2, &2, NM.NumError, U32>}: match xs c: case Nil{} _: hr case Con{x, t} False{}: %Equal.sym(Result<&2, &2, NM.NumError, U32>, r, Fail{NM.Overflow{}}, hr) : {G.lcm_all_go(~U32, ~I.u32_op, ~I.u32_is, Con{x, t}, _) == Fail{NM.Overflow{}} : Result<&2, &2, NM.NumError, U32>} {==} case Con{+x, +t} True{}: %Equal.sym(Result<&2, &2, NM.NumError, U32>, r, Done{of(n)}, hr) : {G.lcm_all_go(~U32, ~I.u32_op, ~I.u32_is, Con{x, t}, _) == SG.prefix_fin(~U32, ~SG.u32_of, SG.lcm_go(32n, vals(t), M.lcm(n, v(x)), C.fits(32n, M.lcm(n, v(x))))) : Result<&2, &2, NM.NumError, U32>} +en = LW.vo(n, hc) +el = Equal.trans(Result<&2, &2, NM.NumError, U32>, G.lcm(~U32, ~I.u32_op, ~I.u32_is, of(n), x), SG.checked(~U32, ~SG.u32_of, 32n, M.lcm(v(of(n)), v(x))), SG.checked(~U32, ~SG.u32_of, 32n, M.lcm(n, v(x))), lcm_checked(of(n), x), Equal.cong(Nat, Result<&2, &2, NM.NumError, U32>, z => SG.checked(~U32, ~SG.u32_of, 32n, M.lcm(z, v(x))), v(of(n)), n, en)) lall(t, G.lcm(~U32, ~I.u32_op, ~I.u32_is, of(n), x), M.lcm(n, v(x)), C.fits(32n, M.lcm(n, v(x))), el, {==}) Uses (25): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.cong https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.sym https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.trans https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/math/typed/u32int.bend&name=lcm_checked https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/math/typed/u32int.bend&name=of https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/math/typed/u32int.bend&name=v https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/math/typed/u32int.bend&name=vals https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/math/typed/u32laws.bend&name=vo https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/spec/lib/common.bend&name=fits https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/spec/math/generic.bend&name=checked https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/spec/math/generic.bend&name=checked_pick https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/spec/math/generic.bend&name=lcm_go https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/spec/math/generic.bend&name=prefix_fin https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/spec/math/generic.bend&name=u32_of https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/src/math/generic.bend&name=lcm https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/src/math/generic.bend&name=lcm_all_go https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/src/math/instances.bend&name=u32_is https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/src/math/instances.bend&name=u32_op https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/src/math/natural.bend&name=lcm https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/src/math/num.bend&name=NumError