Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1007/978-3-031-66997-2_4guideproceedingsArticle/Chapter ViewAbstractPublication PagesConference Proceedingsacm-pubtype
Article

Chaining Extensionality Lemmas in Lean’s Mathlib

Published: 05 August 2024 Publication History

Abstract

In its most basic form, Lean’s [inline-graphic not available: see fulltext] or “extensionality” tactic reduces equalities of functions [inline-graphic not available: see fulltext] into equality at every evaluation [inline-graphic not available: see fulltext], and equalities of sets [inline-graphic not available: see fulltext] into equivalence of membership in each set [inline-graphic not available: see fulltext] . The tactic is extensible; new scenarios can be enabled by adding an [inline-graphic not available: see fulltext] attribute to a theorem, for instance to add support for finite sets analogous to the support for sets.
Where the [inline-graphic not available: see fulltext] tactic can provide particular value is when working with equalities of morphisms; for instance, to show that two linear maps from the tensor product of two modules agrees, it suffices to show that the two maps agree on the pure tensors. Using tensor products as the main example, this paper explores a well-established pattern in mathlib (championed largely by the author) that declares these extensions in a way that allows “chaining”; by preferring to state the assumption in terms of an equality of “partially-applied” morphisms, quantifying over elements only as a last result.
Inevitably, the design of these tools shapes the way in which they are used; this paper concludes by noting how the [inline-graphic not available: see fulltext] tactic encourages expressing statements in a point-free manner, which at times impedes clarity.

References

[1]
Moura L and Ullrich S Platzer A and Sutcliffe G The lean 4 theorem prover and programming language Automated Deduction – CADE 28 2021 Cham Springer 625-635
[2]
The mathlib Community. “The Lean Mathematical Library”. In: Proceedings of the 9th ACM SIGPLAN International Conference on Certified Programs and Proofs. POPL ’20: 47th Annual ACM SIGPLAN Symposium on Principles of Programming Languages. New Orleans LA USA: ACM, Jan. 20, 2020, pp. 367–381. isbn: 978-1-4503-7097–4.
[3]
Wieser, E.: Scalar actions in Lean’s mathlib. In: Workshop Papers of the 14th Conference on Intelligent Computer Mathematics. CICM 2021, vol. 3377. Timisoara, Romania: CEUR-WS (2021). arXiv:2108. 10700 [cs.LO]
[4]
Skřivan, T.: Lecopivo/SciLean: Scientific Computing in Lean 4. https://github.com/lecopivo/SciLean. Accessed 18 Feb 02
[5]
Morrison, S.: chore: upstream [inline-graphic not available: see fulltext] tactic (2024). https://github.com/leanprover/lean4/pull/3306
[6]
Hudon, S.: feat(tactic/ext): new [inline-graphic not available: see fulltext] tactic and corresponding [inline-graphic not available: see fulltext] Reviewed by Johannes Hölzl and Mario Carneiro (2018 ). https://github.com/leanprover-community/mathlib/pull/104
[7]
Price, G.: chore(algebra/direct_sum_graded): golf proofs. Reviewed by Eric Wieser and Scott Morrison (2021). https://github.com/leanprover-community/mathlib/pull/7029
[8]
Hughes, C.: feat(group_theory/semidirect_product): [inline-graphic not available: see fulltext] and [inline-graphic not available: see fulltext]. Reviewed by Scott Morrison (2020). https://github.com/leanprover-community/mathlib/pull/3408
[9]
Topaz, A.: feat(linear_algebra/tensor_algebra): Tensor algebras. Reviewed by Eric Wieser, Scott Morrison, Patrick Massot, Johan Commelin, and Chris Hughes (2020). https://github.com/leanprover-community/mathlib/pull/3531
[10]
Morrison, S.: feat(algebra/ring_quot): quotients of noncommutative rings. Reviewed by Eric Wieser, Kenny Lau, and Johan Commelin (2020). https://github.com/leanprover-community/mathlib/pull/4078
[11]
Kudryashov, Y.G. chore(*): a few more type-specific ext lemmas. Reviewed by Johan Commelin and Eric Wieser (2020). https://github.com/leanprover-community/mathlib/pull/4741
[12]
Wieser, E.: feat(group_theory/*): mark some lemmas as ext (about homs out of free constructions). Reviewed by Floris van Doorn (2020). https://github.com/leanprover-community/mathlib/pull/5484
[13]
Wieser, E.: feat(linear_algebra/exterior_algebra): Add an exterior algebra. Reviewed by Anne Baanen and Scott Morrison (2020). https://github.com/leanprover-community/mathlib/pull/4297
[14]
Wieser, E.: feat(linear_algebra/clifford_algebra): Add a definition derived from [inline-graphic not available: see fulltext]. Reviewed by Anne Baanen, Adam Topaz, Heather Macbeth, and Utensil Song (2020). https://github.com/leanprover-community/mathlib/pull/4430
[15]
Wieser, E.: feat(algebra/direct_sum): graded algebras. Reviewed by Kevin Buzzard and Johan Commelin (2021). https://github.com/leanprover-community/mathlib/pull/8783
[16]
Wieser, E.: feat(data/complex/module): add [inline-graphic not available: see fulltext]. Reviewed by Anne Baanen (2021). https://github.com/leanprover-community/mathlib/pull/8105
[17]
Wieser, E.: feat(linear_algebra/clifford_algebra/equivs): There is a clifford algebra isomorphic to the dual numbers. Reviewed by Johan Commelin and Rob Lewis (2021). https://github.com/leanprover-community/mathlib/pull/10730
[18]
Wieser, E.: feat(algebra/triv_sq_zero_ext): universal property. Reviewed by Johan Commelin (2021). https://github.com/leanprover-community/mathlib/pull/10754
[19]
Wieser, E.: feat(RingTheory/TensorProduct): heterogenize. Reviewed by Johan Commelin and Antoine Chambert-Loir (2023). https://github.com/leanprover-community/mathlib4/pull/6417
[20]
Wieser, E.: feat(Data/Polynomial/AlgebraMap): more results for non-commutative polynomials. Reviewed by Yaël Dillies and Johan Commelin (2023). https://github.com/leanprover-community/mathlib4/pull/8116
[21]
Wieser, E.: feat(data/dfinsupp): Port over the [inline-graphic not available: see fulltext] API. Reviewed by Johan Commelin (2020). https://github.com/leanprover-community/mathlib/pull/4821
[22]
Wieser, E.: refactor(linear_algebra/tensor_product): Use a more powerful lemma for ext. Reviewed by Johan Commelin (2021). https://github.com/leanprover-community/mathlib/pull/6105
[23]
Wieser, E.: feat(linear_algebra/prod): add an ext lemma that recurses into products. Reviewed by Johan Commelin (2021). https://github.com/leanprover-community/mathlib/pull/6124
[24]
Wieser, E.: feat(linear_algebra/clifford_algebra/of_alternating): extend alternating maps to the exterior algebra. Reviewed by Oliver Nash (2022). https://github.com/leanprover-community/mathlib/pull/14803
[25]
Wieser, E.: feat(data/zsqrtd/to_real): Add [inline-graphic not available: see fulltext]. Reviewed by Johan Commelin, Mario Carneiro, Bryan Gin-ge Chen, and Anne Baanen (2021). https://github.com/leanprover-community/mathlib/pull/5640
[26]
Wieser, E.: feat(linear_algebra/basic, group_theory/quotient___group, algebra/lie/quotient): ext lemmas for morphisms out of quotients. Reviewed by Oliver Nash and Anne Baanen (2021). https://github.com/leanprover-community/mathlib/pull/8641

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Guide Proceedings
Intelligent Computer Mathematics: 17th International Conference, CICM 2024, Montréal, QC, Canada, August 5–9, 2024, Proceedings
Aug 2024
366 pages
ISBN:978-3-031-66996-5
DOI:10.1007/978-3-031-66997-2
  • Editors:
  • Andrea Kohlhase,
  • Laura Kovács

Publisher

Springer-Verlag

Berlin, Heidelberg

Publication History

Published: 05 August 2024

Author Tags

  1. Extensionality
  2. Tactics
  3. Formalization
  4. mathlib

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 0
    Total Downloads
  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 21 Sep 2024

Other Metrics

Citations

View Options

View options

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media