Algebra.foldl_eq_foldr_sym: law of bend-mathlib@0.8.1.0 Import: import bend-mathlib@0.8.1.0/algebra.bend as Algebra Lines 491-499 of bend-mathlib@0.8.1.0/algebra.bend: https://jend.leeeet.dev/read.txt?path=bend-mathlib@0.8.1.0/algebra.bend&start_line=491&end_line=499 import Base # Folding left equals folding right for an associative, commutative operation (Mathlib's List.foldl_eq_foldr), reversed to rewrite toward the simple side. law foldl_eq_foldr_sym: for ~B: Data for ~op: B -> B -> B for ~assoc: @x: B -> @y: B -> @z: B -> {op(op(x, y), z) == op(x, op(y, z)) : B} for ~comm: @x: B -> @y: B -> {op(x, y) == op(y, x) : B} for +z: B for +xs: List<&2, B> {List.foldr(&2, B, B, op, xs, z) == List.foldl(&2, B, B, op, xs, z) : B} Uses (5): 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=List.foldl https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.foldr https://jend.leeeet.dev/definition.txt?path=bend-mathlib@0.8.1.0/algebra.bend&name=foldl_eq_foldr