TY - JOUR

T1 - Leibniz equality is isomorphic to Martin-Löf identity, parametrically

AU - Abel, Andreas

AU - Cockx, Jesper

AU - Devriese, Dominique

AU - Timany, Amin

AU - Wadler, Philip

PY - 2020/6/17

Y1 - 2020/6/17

N2 - Consider two widely used definitions of equality. That of Leibniz: One value equals another if any predicate that holds of the first holds of the second. And that of Martin-Löf: The type identifying one value with another is occupied if the two values are identical. The former dates back several centuries, while the latter is widely used in proof systems such as Agda and Coq. Here we show that the two definitions are isomorphic: We can convert any proof of Leibniz equality to one of Martin-Löf identity and vice versa, and each conversion followed by the other is the identity. One direction of the isomorphism depends crucially on values of the type corresponding to Leibniz equality satisfying functional extensionality and Reynolds' notion of parametricity. The existence of the conversions is widely known (meaning that if one can prove one equality then one can prove the other), but that the two conversions form an isomorphism (internally) in the presence of parametricity and functional extensionality is, we believe, new. Our result is a special case of a more general relation that holds between inductive families and their Church encodings. Our proofs are given inside type theory, rather than meta-theoretically. Our paper is a literate Agda script.

AB - Consider two widely used definitions of equality. That of Leibniz: One value equals another if any predicate that holds of the first holds of the second. And that of Martin-Löf: The type identifying one value with another is occupied if the two values are identical. The former dates back several centuries, while the latter is widely used in proof systems such as Agda and Coq. Here we show that the two definitions are isomorphic: We can convert any proof of Leibniz equality to one of Martin-Löf identity and vice versa, and each conversion followed by the other is the identity. One direction of the isomorphism depends crucially on values of the type corresponding to Leibniz equality satisfying functional extensionality and Reynolds' notion of parametricity. The existence of the conversions is widely known (meaning that if one can prove one equality then one can prove the other), but that the two conversions form an isomorphism (internally) in the presence of parametricity and functional extensionality is, we believe, new. Our result is a special case of a more general relation that holds between inductive families and their Church encodings. Our proofs are given inside type theory, rather than meta-theoretically. Our paper is a literate Agda script.

UR - http://www.scopus.com/inward/record.url?scp=85090554130&partnerID=8YFLogxK

U2 - https://doi.org/10.1017/S0956796820000155

DO - https://doi.org/10.1017/S0956796820000155

M3 - Article

VL - 30

JO - Journal of Functional Programming

JF - Journal of Functional Programming

SN - 0956-7968

M1 - e17

ER -