// Definitions to prove something about datatype List = Nil | Cons(head: T, tail: List) function Length(xs: List): nat { match xs case Nil => 0 case Cons(_, tail) => 1 + Length(tail) } function Append(xs: List, ys: List): List ensures Length(Append(xs, ys)) == Length(xs) + Length(ys) { match xs case Nil => ys case Cons(x, tail) => Cons(x, Append(tail, ys)) } function At(xs: List, i: nat): T requires i < Length(xs) { if i == 0 then xs.head else At(xs.tail, i - 1) } // Your task lemma AtAppend(xs: List, ys: List, i: nat) requires i < Length(Append(xs, ys)) ensures At(Append(xs, ys), i) == At(Append(xs, ys), i) // Change the righthand side of this 'ensures' to say something more interesting. // Try to capture the expected behavior of 'At' as completely as possible. // The proof should go through automatically if you get it right! { }