def sc_nth_take
import bend-collections-laws-math@1.0.0.0/proofs/lib/list.bend as Listimport Base
import bend-collections-laws-math@1.0.0.0/proofs/lib/nat.bend as N
import bend-collections-laws-math@1.0.0.0/spec/lib/common.bend as SC
299def sc_nth_take(-A: Data, +xs: List<&2, A>, +n: Nat, +i: Nat, +h: {Nat.is_lt(i, n) == True{} : Bool}) -> {SC.nth(A, SC.take(A, xs, n), i) == SC.nth(A, xs, i) : Maybe<&2, A>}:
300 match xs n i:
301 case Nil{} _ _:
302 {==}
303 case Con{a, t} 0n _:
304 Empty.absurd({SC.nth(A, SC.take(A, Con{a, t}, 0n), i) == SC.nth(A, Con{a, t}, i) : Maybe<&2, A>}, N.lt_zero_absurd(i, h))
305 case Con{a, t} 1n+m 0n:
306 {==}
307 case Con{a, t} 1n+m 1n+j:
308 sc_nth_take(A, t, m, j, h)
Uses (9)
Used by (0)
No other definition uses this definition.