Add references and complete formalization