def length_update

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

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/nat.bend as N
import bend-collections-laws-math@1.0.0.0/spec/lib/common.bend as SC

100def length_update(-A: Data, +xs: List<&2, A>, +i: Nat, +v: A) -> {SC.length(A, SC.update(A, xs, i, v)) == SC.length(A, xs) : Nat}:
101  match xs i:
102    case Nil{} _:
103      {==}
104    case Con{h1, t} 0n:
105      {==}
106    case Con{h1, t} 1n+p:
107      N.succ_cong(SC.length(A, SC.update(A, t, p, v)), SC.length(A, t), length_update(A, t, p, v))

Uses (5)

Used by (0)

No other definition uses this definition.