correctness proof with library,instances,and annotated types