def nth_update_other
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/logic.bend as L
import bend-collections-laws-math@1.0.0.0/spec/lib/common.bend as SC
162def nth_update_other(-A: Data, +xs: List<&2, A>, +i: Nat, +j: Nat, +v: A, +ne: {Nat.is_eq(i, j) == False{} : Bool}) -> {SC.nth(A, SC.update(A, xs, i, v), j) == SC.nth(A, xs, j) : Maybe<&2, A>}:
163 match xs i j:
164 case Nil{} _ _:
165 {==}
166 case Con{h, t} 0n 0n:
167 Empty.absurd({Some{v} == Some{h} : Maybe<&2, A>}, L.true_false(ne))
168 case Con{h, t} 0n 1n+q:
169 {==}
170 case Con{h, t} 1n+p 0n:
171 {==}
172 case Con{h, +t} 1n+p 1n+q:
173 nth_update_other(A, t, p, q, v, ne)
Uses (9)
Used by (0)
No other definition uses this definition.