Abstract
In principle, dependent type theory should provide an ideal foundation for formalizing graded rings, where each grade can be of a different type. However, the power of these foundations leaves a plethora of choices for how to proceed with such a formalization. This paper explores various different approaches to how formalization could proceed, and then demonstrates precisely how the authors formalized graded algebras in Lean’s mathlib. Notably, we show how this formalization was used as an API; allowing us to formalize various graded structures such as those on tuples, free monoids, tensor algebras, and Clifford algebras.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
Or “a graded algebra of type \(\mathbb {N}\) over the ring R with graduation A” in the language of [6, III, §3, 1.].
- 2.
Where \(\mathcal {C}\ell (V, Q)\) is notation to specify the quadratic form Q and vector space V.
- 3.
At least, when \(Q\ne 0\). If \(Q = 0\) then \(\mathcal {C}\ell (V, Q) = \mathcal {\bigwedge }(V)\) and we can proceed as above.
- 4.
Note that literature referring to an \(\mathbb {N}\)-grading is referring to the grading on \(\mathcal {\bigwedge }(V)\) via the canonical module equivalence.
- 5.
- 6.
Some sources use a more general definition of graded R-modules and R-algebras, where R is itself a graded ring such that \(R_iM_j \subseteq M_{i+j}\). For brevity we will not discuss these here (in essence considering only the special case when R has the trivial graduation), but our approach would extends to this straightforwardly .
- 7.
In the absence of our work a proof via convexity was used instead.
- 8.
Chosen for brevity due to having the fewest axioms, not because they are interesting.
- 9.
Lean 4 lifts this notation restriction, but the algebraic typeclasses provided by mathlib would need reworking.
- 10.
The syntax in Lean for an incomplete proof.
- 11.
After enabling the appropriate by-default-disabled instances.
- 12.
Thus resolving the further work in [14, §8.1].
- 13.
source lines of code.
- 14.
- 15.
In geometric algebra and algebraic geometry, respectively!.
References
Affeldt, R., Cohen, C., Kerjean, M., Mahboubi, A., Rouhling, D., Sakaguchi, K.: Competing inheritance paths in dependent type theory: a case study in functional analysis. In: Peltier, N., Sofronie-Stokkermans, V. (eds.) IJCAR 2020. LNCS (LNAI), vol. 12167, pp. 3–20. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-51054-1_1
Avigad, J., et al.: Spectral Sequences in Homotopy Type Theory, November 2015. https://github.com/cmu-phil/Spectral
Baanen, A.: Leanprover-community/mathlib#11750: define subobject classes from submonoid up to subfield, April 2022. https://github.com/leanprover-community/mathlib/pull/11750
Baanen, A.: Use and abuse of instance parameters in the Lean mathematical library. In: ITP 2022, Haifa, Israel, May 2022. http://arxiv.org/abs/2202.01629
Barton, R., Commelin, J., Buzzard, K., Lau, K., Carneiro, M.: #maths \(>\) CDGAs, June 2019. https://leanprover-community.github.io/archive/stream/116395-maths/topic/CDGAs.html
Bourbaki, N.: Algebra I, Chapters 1–3. Elements of Mathematics. Springer, Heidelberg (1989). https://doi.org/10.1007/978-3-642-59312-3
Brunerie, G., Ljungström, A., Mörtberg, A.: Synthetic integral cohomology in cubical agda. In: Manea, F., Simpson, A. (eds.) 30th EACSL Annual Conference on Computer Science Logic (CSL 2022). Leibniz International Proceedings in Informatics (LIPIcs), vol. 216, pp. 11:1–11:19. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, Dagstuhl, Germany (2022). https://doi.org/10.4230/LIPIcs.CSL.2022.11. ISSN: 1868-8969
Castelvecchi, D.: Mathematicians welcome computer-assisted proof in ‘grand unification’ theory. Nature 595(7865), 18–19 (2021). https://doi.org/10.1038/d41586-021-01627-2
Domínguez, C., Rubio, J.: Effective homology of bicomplexes, formalized in Coq. Theoret. Comput. Sci. 412(11), 962–970 (2011). https://doi.org/10.1016/j.tcs.2010.11.016
de Moura, L., Kong, S., Avigad, J., van Doorn, F., von Raumer, J.: The lean theorem prover (system description). In: Felty, A.P., Middeldorp, A. (eds.) CADE 2015. LNCS (LNAI), vol. 9195, pp. 378–388. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-21401-6_26
The mathlib Community: The lean mathematical library. In: Proceedings of the 9th ACM SIGPLAN International Conference on Certified Programs and Proofs, pp. 367–381. ACM, New Orleans, January 2020. https://doi.org/10.1145/3372885.3373824
The Stacks project authors: The Stacks project (2022). https://stacks.math.columbia.edu
Wieser, E.: Scalar actions in Lean’s mathlib. In: CICM 2021. Timisoara, Romania, August 2021. http://arxiv.org/abs/2108.10700
Wieser, E., Song, U.: Formalizing geometric algebra in lean. Adv. Appl. Clifford Algebras 32(3), 28 (2022). https://doi.org/10.1007/s00006-021-01164-1
Acknowledgments
The authors would like to thank Kevin Buzzard for his justified insistence on needing an interface to talk about internal gradings, Anne Baanen for picking up the mantle dropped by the first author on the rest of the set_like refactor, and the rest of the mathlib community for the extraordinarily collaborative work providing the context for this paper. The first author is funded by a scholarship from the Cambridge Trust. The second author is funded by the Schrödinger Scholarship Scheme from Imperial College London.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Wieser, E., Zhang, J. (2022). Graded Rings in Lean’s Dependent Type Theory. In: Buzzard, K., Kutsia, T. (eds) Intelligent Computer Mathematics. CICM 2022. Lecture Notes in Computer Science(), vol 13467. Springer, Cham. https://doi.org/10.1007/978-3-031-16681-5_8
Download citation
DOI: https://doi.org/10.1007/978-3-031-16681-5_8
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-16680-8
Online ISBN: 978-3-031-16681-5
eBook Packages: Computer ScienceComputer Science (R0)