def sc_take_append_left

bend-collections-laws-crypto@1.0.0.0 · proofs/lib/list.bend:330

import bend-collections-laws-crypto@1.0.0.0/proofs/lib/list.bend as List
import Base
import bend-collections-laws-crypto@1.0.0.0/proofs/lib/logic.bend as L
import bend-collections-laws-crypto@1.0.0.0/spec/lib/common.bend as SC

330def sc_take_append_left(-A: Data, +xs: List<&2, A>, +ys: List<&2, A>, +i: Nat, +h: {Nat.is_le(i, SC.length(A, xs)) == True{} : Bool}) -> {SC.take(A, SC.append(A, xs, ys), i) == SC.take(A, xs, i) : List<&2, A>}:
331  match xs i:
332    case Nil{} 0n:
333      sc_take_zero(A, ys)
334    case Nil{} 1n+j:
335      Empty.absurd({SC.take(A, ys, 1n+j) == Nil{} : List<&2, A>}, L.false_true(h))
336    case Con{a, t} 0n:
337      {==}
338    case Con{a, t} 1n+j:
339      cons_cong(A, a, SC.take(A, SC.append(A, t, ys), j), SC.take(A, t, j), sc_take_append_left(A, t, ys, j, h))

Uses (11)

Used by (3)