Implement and prove map and mapi