coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Ramkumar Ramachandra <artagnon AT gmail.com>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Fwd: "Lean is like Coq but better"
- Date: Sat, 4 Jan 2020 06:42:40 +0100
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=artagnon AT gmail.com; spf=Pass smtp.mailfrom=artagnon AT gmail.com; spf=None smtp.helo=postmaster AT mail-vs1-f41.google.com
- Ironport-phdr: 9a23:v3DjwhQ06qCauHoSuGDjt8cGfNpsv+yvbD5Q0YIujvd0So/mwa6yZxaN2/xhgRfzUJnB7Loc0qyK6vumAzBcqsbe+Fk5M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aFRrwLxd6KfroEYDOkcu3y/qy+5rOaAlUmTaxe7x/IAi4oAnLqMUbjoRvJqkyxxbLv3BFZ/lYyWR0KFyJgh3y/N2w/Jlt8yRRv/Iu6ctNWrjkcqo7ULJVEi0oP3g668P3uxbDSxCP5mYHXWUNjhVIGQnF4wrkUZr3ryD3q/By2CiePc3xULA0RTGv5LplRRP0lCsKMSMy/2bKhMxtl6JbuAyuqABjw4DaZ4GVMeBxfqLbfdgHQWZMUcJcWylHD4ihbYUAEvABMP5XoInzpVQArRWwCwqxCu3x1jBFnWX50bEg3uk7DQ3KwA4tEtQTu3rUttX1M6ISXPipwqbSyDXDbO5W2TLn54jSbxsvveuDXbdqfsXNyUkgDQXFgUiKqYP/IjiY0f4Cs3KH7+V6WuKvjWknqwdqrzigw8cjkIjJhoYPxl/Y8iV5xZ84KNulQ0B1Zt6kFYFftyCcN4ZuQ8MiWWBouCggxr0Io563ZCcKyJU7xx7fdvyIaJKE4hPkVOqJLjd4hW5leLKihxmp60Sv1ur8Vsyy3V1XrSRFisHBum4R2xHX8MSKSftw8l2/1TqS1Q3f8O5JLV0ymKHGMZAu2KQwmYAWsUnbHi/5hkH2jKiOe0Uh4Oeo6uDnbqz4pp+HKoN4kw/+P6szlsClDuQ4NQ8OX2ef+euizrHs4Ur5QLBSgv03lKnWrozaKNwFqqKlBwJZyIUu5halAzu4zdgVn2MLIV1YdB6fiojmIVDOIPT2DfelhFSslS9myOrcPr39GJrNIX7DkLDnfbtm5E5czRA8zdFb555OFr4BJ/fzVlfrtNPEFh85LxC0w+H/Bdph0YMeQHuDDbOdMKPPqlCF/fkvIumJZI8NojnxMfkl5/j0jX84g1ARZ6ep3YFEIEy/S/9hOgCSZWfmqtYHC2YD+AQkH8Lwj1jXazdWZGu3Vrh03Dg+AYmmBIHPXInl1LWbwC60GJpQTm9DA1GIV3zvctPXCL83dCuOL5o5wXQ/Xr+7Rtp9hEj/5j+/8KJuK6/vwgNdsJvi0NZv4OiKzEM98DV1C4KW1GTfFjgpzFNNfCc/2eVEmWI4ylqH1vIl0flRFNgW+egQFwlmbNjTyOt1D920UQXELI/QFASWB+6+CDR0deofhscUah8kSdqnhxHHmSGtBu1Nmg==
Lean has much lower startup-cost for pure mathematicians, since the built-in features and mathlib are great for doing undergraduate-level group theory & topology, masters-level commutative algebra & category theory, but I think it plateaus quickly thereafter; future releases of Lean will probably fix this.
Lean seems to have taken a top-down approach, by focusing on writing real proofs as quickly as possible, without compromising soundness [https://github.com/digama0/lean-type-theory/releases/tag/v1.0]. There are three axioms in Lean: propositional extensionality, quotient soundness, and choice; however, these don’t block computation, since computation is done by a VM. However, they break good type theoretic properties like strong normalization, subject reduction, and canonicity — this was a conscious design choice, and they decided that these properties weren’t as important to working mathematicians.
Coq, on the other hand, has always been very particular about sound type theoretic foundations. The recent “Coq Coq Correct!” paper [https://www.irif.fr/~sozeau/research/publications/drafts/Coq_Coq_Correct.pdf] proves various metatheoretic properties of the Coq engine.
Lean supports both constructive and classical reasoning, but I’m hoping HoTT will be integrated into mainline Coq and solve most of the setoid-related issues (not that I understand much about it).
One would think that Lean is an engineering feat, since it’s written in C++ (and lean4 is written mostly in C): math-comp is 90k loc, while mathlib is 150k loc; and it takes over thirty minutes to build mathlib! Coq is much faster.
Quotients are indeed a great feature to have, and makes formalizing commutative algebra painless; an example [https://github.com/leanprover-community/mathlib/blob/master/docs/tutorial/Zmod37.lean] of using quotients in Lean. However, quotients are tricky to implement without breaking certain metatheoretic properties that Coq’ers cherish, which is why it hasn’t been implemented yet.
Lean’s inheritance [https://leanprover.github.io/theorem_proving_in_lean/structures_and_records.html#inheritance] is another good feature; it disallows diamond-inheritance, and seems like a bit of a hack, but Coq should definitely get some form of a well-thought-out ad-hoc polymorphism.
Category theory in Lean has not been developed [https://github.com/leanprover-community/mathlib/blob/master/docs/theories/category_theory.md] with higher categories in mind; I’m not sure how one would define ∞-categories, since universes are explicit, and since there are no coinductive types: Coq’s impredicativity seems to be a better design choice.
Footnote. Metamath Zero [https://github.com/digama0/mm0] might be of interest to the Coq community for high-performance checking.
Lean seems to have taken a top-down approach, by focusing on writing real proofs as quickly as possible, without compromising soundness [https://github.com/digama0/lean-type-theory/releases/tag/v1.0]. There are three axioms in Lean: propositional extensionality, quotient soundness, and choice; however, these don’t block computation, since computation is done by a VM. However, they break good type theoretic properties like strong normalization, subject reduction, and canonicity — this was a conscious design choice, and they decided that these properties weren’t as important to working mathematicians.
Coq, on the other hand, has always been very particular about sound type theoretic foundations. The recent “Coq Coq Correct!” paper [https://www.irif.fr/~sozeau/research/publications/drafts/Coq_Coq_Correct.pdf] proves various metatheoretic properties of the Coq engine.
Lean supports both constructive and classical reasoning, but I’m hoping HoTT will be integrated into mainline Coq and solve most of the setoid-related issues (not that I understand much about it).
One would think that Lean is an engineering feat, since it’s written in C++ (and lean4 is written mostly in C): math-comp is 90k loc, while mathlib is 150k loc; and it takes over thirty minutes to build mathlib! Coq is much faster.
Quotients are indeed a great feature to have, and makes formalizing commutative algebra painless; an example [https://github.com/leanprover-community/mathlib/blob/master/docs/tutorial/Zmod37.lean] of using quotients in Lean. However, quotients are tricky to implement without breaking certain metatheoretic properties that Coq’ers cherish, which is why it hasn’t been implemented yet.
Lean’s inheritance [https://leanprover.github.io/theorem_proving_in_lean/structures_and_records.html#inheritance] is another good feature; it disallows diamond-inheritance, and seems like a bit of a hack, but Coq should definitely get some form of a well-thought-out ad-hoc polymorphism.
Category theory in Lean has not been developed [https://github.com/leanprover-community/mathlib/blob/master/docs/theories/category_theory.md] with higher categories in mind; I’m not sure how one would define ∞-categories, since universes are explicit, and since there are no coinductive types: Coq’s impredicativity seems to be a better design choice.
Footnote. Metamath Zero [https://github.com/digama0/mm0] might be of interest to the Coq community for high-performance checking.
Ram
- [Coq-Club] "Lean is like Coq but better", Bas Spitters, 01/02/2020
- Re: [Coq-Club] "Lean is like Coq but better", Timothy Carstens, 01/02/2020
- Re: [Coq-Club] "Lean is like Coq but better", Kevin Buzzard, 01/02/2020
- [Coq-Club] Fwd: "Lean is like Coq but better", Kevin Buzzard, 01/02/2020
- Re: [Coq-Club] Fwd: "Lean is like Coq but better", Gaëtan Gilbert, 01/03/2020
- Message not available
- Re: [Coq-Club] Fwd: "Lean is like Coq but better", Ramkumar Ramachandra, 01/04/2020
- Re: [Coq-Club] Fwd: "Lean is like Coq but better", Bas Spitters, 01/06/2020
- Re: [Coq-Club] Fwd: "Lean is like Coq but better", Kevin Buzzard, 01/06/2020
- Re: [Coq-Club] Fwd: "Lean is like Coq but better", Conor McBride, 01/06/2020
- Re: [Coq-Club] Fwd: "Lean is like Coq but better", Stefan Monnier, 01/06/2020
- Re: [Coq-Club] Fwd: "Lean is like Coq but better", Bas Spitters, 01/06/2020
- Re: [Coq-Club] Fwd: "Lean is like Coq but better", Xuanrui Qi, 01/07/2020
- Re: [Coq-Club] Fwd: "Lean is like Coq but better", Bas Spitters, 01/07/2020
- Re: [Coq-Club] Fwd: "Lean is like Coq but better", Ramkumar Ramachandra, 01/04/2020
- Re: [Coq-Club] Fwd: "Lean is like Coq but better", Thorsten Altenkirch, 01/07/2020
- Re: [Coq-Club] Fwd: "Lean is like Coq but better", Ramkumar Ramachandra, 01/07/2020
- Re: [Coq-Club] Fwd: "Lean is like Coq but better", jonikelee AT gmail.com, 01/08/2020
- Message not available
- Re: [Coq-Club] Fwd: "Lean is like Coq but better", Gaëtan Gilbert, 01/03/2020
- [Coq-Club] Fwd: "Lean is like Coq but better", Kevin Buzzard, 01/02/2020
- Re: [Coq-Club] "Lean is like Coq but better", Kevin Buzzard, 01/02/2020
- Re: [Coq-Club] "Lean is like Coq but better", Timothy Carstens, 01/02/2020
Archive powered by MHonArc 2.6.18.