def perm_append_right

bend-mathlib@0.8.1.0 · perm.bend:177

import bend-mathlib@0.8.1.0/perm.bend as Perm
import Base
import bendlib-kernel-list@1.0.0.0/list.bend as K

177# Permuting the right operand of an append gives a permutation of the append.
178def perm_append_right(-A: Data, +xs: List<&2, A>, +ys: List<&2, A>, -zs: List<&2, A>, h: K.perm(A, ys, zs)) -> K.perm(A, List.append(&2, A, xs, ys), List.append(&2, A, xs, zs)):
179  match xs:
180    case Nil{}:
181      h
182    case +x <> r:
183      perm_cons(A, x, List.append(&2, A, r, ys), List.append(&2, A, r, zs), perm_append_right(A, r, ys, zs, h))

Uses (4)

Used by (1)