def length_snoc
bend-collections-laws-crypto@1.0.0.0 · proofs/lib/list.bend:39
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/nat.bend as N
import bend-collections-laws-crypto@1.0.0.0/spec/lib/common.bend as SC
39def length_snoc(-A: Data, +xs: List<&2, A>, +x: A) -> {SC.length(A, SC.snoc(A, xs, x)) == 1n+SC.length(A, xs) : Nat}:
40 match xs:
41 case Nil{}:
42 {==}
43 case Con{+h, +t}:
44 N.succ_cong(SC.length(A, SC.snoc(A, t, x)), 1n+SC.length(A, t), length_snoc(A, t, x))