U32int.pal: 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 316-330 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=316&end_line=330 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/instances.bend as I import bend-collections-laws-math@1.0.0.0/proofs/math/typed/u32laws.bend as LW def pal(+xs: List<&2, U32>, +r: Maybe<&2, U32>, +n: Nat, +c: Bool, +hr: {r == G.fits(U32, Bool.not(c), of(n)) : Maybe<&2, U32>}, +hc: {C.fits(32n, n) == c : Bool}) -> {G.ok(U32, G.prod_go(~U32, ~I.u32_op, ~I.u32_is, xs, r)) == SG.prefix_fin(~U32, ~SG.u32_of, SG.prod_go(32n, vals(xs), n, c)) : Result<&2, &2, NM.NumError, U32>}: match xs c: case Nil{} True{}: %Equal.sym(Maybe<&2, U32>, r, Some{of(n)}, hr) : {G.ok(U32, _) == Done{of(n)} : Result<&2, &2, NM.NumError, U32>} {==} case Nil{} False{}: %Equal.sym(Maybe<&2, U32>, r, None{}, hr) : {G.ok(U32, _) == Fail{NM.Overflow{}} : Result<&2, &2, NM.NumError, U32>} {==} case Con{x, t} False{}: %Equal.sym(Maybe<&2, U32>, r, None{}, hr) : {G.ok(U32, G.prod_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(Maybe<&2, U32>, r, Some{of(n)}, hr) : {G.ok(U32, G.prod_go(~U32, ~I.u32_op, ~I.u32_is, Con{x, t}, _)) == SG.prefix_fin(~U32, ~SG.u32_of, SG.prod_go(32n, vals(t), Nat.mul(n, v(x)), C.fits(32n, Nat.mul(n, v(x))))) : Result<&2, &2, NM.NumError, U32>} +hn = Equal.cong(Nat, Nat, z => Nat.mul(z, v(x)), v(of(n)), n, LW.vo(n, hc)) pal(t, G.cmul(~U32, ~I.u32_op, ~I.u32_is, of(n), x), Nat.mul(n, v(x)), C.fits(32n, Nat.mul(n, v(x))), cmul_rel(of(n), x, Nat.mul(n, v(x)), hn, C.fits(32n, Nat.mul(n, v(x))), {==}), {==}) Uses (26): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not 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=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mul 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=cmul_rel 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=prefix_fin https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/spec/math/generic.bend&name=prod_go 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=cmul https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/src/math/generic.bend&name=fits https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/src/math/generic.bend&name=ok https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/src/math/generic.bend&name=prod_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/num.bend&name=NumError