def sc_take_take

bend-collections-laws-math@1.0.0.0 · proofs/lib/list.bend:310

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

310def sc_take_take(-A: Data, +xs: List<&2, A>, +n: Nat, +e: Nat, +h: {Nat.is_le(e, n) == True{} : Bool}) -> {SC.take(A, SC.take(A, xs, n), e) == SC.take(A, xs, e) : List<&2, A>}:
311  match xs n e:
312    case Nil{} _ _:
313      {==}
314    case Con{a, t} 0n 0n:
315      {==}
316    case Con{a, t} 1n+m 0n:
317      {==}
318    case Con{a, t} 0n 1n+f:
319      Empty.absurd({SC.take(A, SC.take(A, Con{a, t}, 0n), 1n+f) == SC.take(A, Con{a, t}, 1n+f) : List<&2, A>}, L.false_true(h))
320    case Con{a, t} 1n+m 1n+f:
321      cons_cong(A, a, SC.take(A, SC.take(A, t, m), f), SC.take(A, t, f), sc_take_take(A, t, m, f, h))

Uses (8)

Used by (0)

No other definition uses this definition.