Lean (proof assistant)

Lean
ParadigmFunctional programming, Imperative programming
FamilyProof assistant
DeveloperLean FRO
First appeared2013; 11 years ago (2013)
Stable release
4.11.0 / 1 September 2024; 3 months ago (2024-09-01)
Preview release
4.12.0-rc1 / 2 September 2024; 3 months ago (2024-09-02)
Typing disciplineStatic, strong, inferred
Implementation languageLean, C++
OSCross-platform
LicenseApache License 2.0
Websitelean-lang.org
Influenced by
ML
Coq
Haskell

Lean is a proof assistant and a functional programming language.[1] It is based on the calculus of constructions with inductive types. It is an open-source project hosted on GitHub. It was developed primarily by Leonardo de Moura while employed by Microsoft Research and now Amazon Web Services, and has had significant contributions from other coauthors and collaborators during its history. Development is currently supported by the non-profit Lean Focused Research Organization (FRO).

History

Lean was launched by Leonardo de Moura at Microsoft Research in 2013.[2] The initial versions of the language, later known as Lean 1 and 2, were experimental and contained features such as support for homotopy type theory – based foundations that were later dropped.

Lean 3 (first released Jan 20, 2017) was the first moderately stable version of Lean. It was implemented primarily in C++ with some features written in Lean itself. After version 3.4.2 Lean 3 was officially end-of-lifed while development of Lean 4 began. In this interim period members of the Lean community developed and released unofficial versions up to 3.51.1.

In 2021, Lean 4 was released, which was a reimplementation of the Lean theorem prover capable of producing C code which is then compiled, enabling the development of efficient domain-specific automation.[3] Lean 4 also contains a macro system and improved type class synthesis and memory management procedures over the previous version. Another benefit compared to Lean 3 is the ability to avoid touching C++ code in order to modify the frontend and other key parts of the core system, as they are now all implemented in Lean and available to the end user to be overridden as needed.[citation needed]

Lean 4 is not backwards-compatible with Lean 3.[4]

In 2023, the Lean FRO was formed, with the goals of improving the language's scalability and usability, and implementing proof automation.[5]

Overview

Libraries

The official lean package includes a standard library batteries, which implements common data structures that may be used for both mathematical research and more conventional software development.[6]

In 2017, a community-maintained project to develop a Lean library mathlib began, with the goal to digitize as much of pure mathematics as possible in one large cohesive library, up to research level mathematics.[7][8] As of September 2024, mathlib had formalised over 165,000 theorems and 85,000 definitions in Lean.[9]

Editors integration

Lean integrates with:[10]

Interfacing is done via a client-extension and Language Server Protocol server.

It has native support for Unicode symbols, which can be typed using LaTeX-like sequences, such as "\times" for "×". Lean can also be compiled to JavaScript and accessed in a web browser and has extensive support for meta-programming.

Examples (Lean 4)

The natural numbers can be defined as an inductive type. This definition is based on the Peano axioms and states that every natural number is either zero or the successor of some other natural number.

inductive Nat : Type
| zero : Nat
| succ : Nat  Nat

Addition of natural numbers can be defined recursively, using pattern matching.

def Nat.add : Nat  Nat  Nat
| n, Nat.zero   => n                      -- n + 0 = n  
| n, Nat.succ m => Nat.succ (Nat.add n m) -- n + succ(m) = succ(n + m)

This is a simple proof of for two propositions and (where is the conjunction and the implication) in Lean using tactic mode:

theorem and_swap (p q : Prop) : p  q  q  p := by
  intro h            -- assume p ∧ q with proof h, the goal is q ∧ p
  apply And.intro    -- the goal is split into two subgoals, one is q and the other is p
  · exact h.right    -- the first subgoal is exactly the right part of h : p ∧ q
  · exact h.left     -- the second subgoal is exactly the left part of h : p ∧ q

This same proof in term mode:

theorem and_swap (p q : Prop) : p  q  q  p :=
    fun hp, hq => hq, hp

Usage

Mathematics

Lean has received attention from mathematicians such as Thomas Hales,[11] Kevin Buzzard,[12] and Heather Macbeth.[13] Hales is using it for his project, Formal Abstracts.[14] Buzzard uses it for the Xena project.[15] One of the Xena Project's goals is to rewrite every theorem and proof in the undergraduate math curriculum of Imperial College London in Lean. Macbeth is using Lean to teach students the fundamentals of mathematical proof with instant feedback.[16]

In 2021, a team of researchers used Lean to verify the correctness of a proof by Peter Scholze in the area of condensed mathematics. The project garnered attention for formalizing a result at the cutting edge of mathematical research.[17] In 2023, Terence Tao used Lean to formalize a proof of the Polynomial Freiman-Ruzsa (PFR) conjecture, a result published by Tao and collaborators in the same year.[18]

Artificial intelligence

In 2022, OpenAI and Meta AI independently created AI models to generate proofs of various high-school-level olympiad problems in Lean.[19] Meta AI's model is available for public use with the Lean environment.[20]

In 2023, Vlad Tenev and Tudor Achim co-founded startup Harmonic, which aims to reduce AI hallucinations by generating and checking Lean code.[21]

In 2024, Google DeepMind created AlphaProof[22] which proves mathematical statements in Lean at the level of a silver medalist at the International Mathematical Olympiad. This was the first AI system that achieved a medal-worthy performance on a math olympiad's problems.[23]


See also

References

  1. ^ Moura, Leonardo de; Ullrich, Sebastian (2021). "The Lean 4 Theorem Prover and Programming Language". In Platzer, André; Sutcliffe, Geoff (eds.). Automated Deduction – CADE 28. Lecture Notes in Computer Science. Vol. 12699. Cham: Springer International Publishing. pp. 625–635. doi:10.1007/978-3-030-79876-5_37. ISBN 978-3-030-79876-5.
  2. ^ "About". Lean Language. Retrieved 2024-03-13.
  3. ^ Moura, Leonardo de; Ullrich, Sebastian (2021). Platzer, Andr'e; Sutcliffe, Geoff (eds.). Automated Deduction -- CADE 28. Springer International Publishing. pp. 625–635. doi:10.1007/978-3-030-79876-5_37. ISBN 978-3-030-79876-5. S2CID 235800962. Retrieved 24 March 2023.
  4. ^ "Significant changes from Lean 3". Lean Manual. Retrieved 24 March 2023.
  5. ^ "Mission". Lean FRO. 2023-07-25. Retrieved 2024-03-14.
  6. ^ "batteries". GitHub. Retrieved 2024-09-22.
  7. ^ "Building the Mathematical Library of the Future". Quanta Magazine. October 2020. Archived from the original on 2 Oct 2020.
  8. ^ "Lean community". leanprover-community.github.io. Retrieved 2023-10-24.
  9. ^ "Mathlib statistics". leanprover-community.github.io. Retrieved 2024-09-22.
  10. ^ "Installing Lean 4 on Linux". leanprover-community.github.io. Retrieved 2023-10-24.
  11. ^ Hales, Thomas (September 18, 2018). "A Review of the Lean Theorem Prover". Jigger Wit. Archived from the original on 21 Nov 2020.
  12. ^ Buzzard, Kevin. "The Future of Mathematics?" (PDF). Retrieved 6 October 2020.
  13. ^ Macbeth, Heather. "The Mechanics of Proof". hrmacbeth.github.io. Archived from the original on 5 Jun 2024.
  14. ^ "Formal Abstracts". Github.
  15. ^ "What is the Xena project?". Xena. 8 May 2019.
  16. ^ Roberts, Siobhan (July 2, 2023). "A.I. Is Coming for Mathematics, Too". New York Times. Archived from the original on 1 May 2024.
  17. ^ Hartnett, Kevin (July 28, 2021). "Proof Assistant Makes Jump to Big-League Math". Quanta Magazine. Archived from the original on 2 Jan 2022.
  18. ^ Sloman, Leila (2023-12-06). "'A-Team' of Math Proves a Critical Link Between Addition and Sets". Quanta Magazine. Retrieved 2023-12-07.
  19. ^ "Solving (some) formal math olympiad problems". OpenAI. February 2, 2022. Retrieved March 13, 2024.
  20. ^ "Teaching AI advanced mathematical reasoning". Meta AI. November 3, 2022. Retrieved March 13, 2024.
  21. ^ Metz, Cade (23 September 2024). "Is Math the Path to Chatbots That Don't Make Stuff Up?". New York Times. Archived from the original on 24 Sep 2024.
  22. ^ "AI achieves silver-medal standard solving International Mathematical Olympiad problems". Google DeepMind. 2024-05-14. Retrieved 2024-07-25.
  23. ^ Roberts, Siobhan (July 25, 2024). "Move Over, Mathematicians, Here Comes AlphaProof". New York Times. Archived from the original on July 29, 2024.

Read other articles:

Batalyon Zeni Tempur 20/Pawbili Pelle AlangLambang Yonzipur 20/PPADibentuk11 Agustus 2020NegaraIndonesiaCabangZeniTipe unitSatuan Bantuan TempurPeranPasukan Prasarana MiliterBagian dariKodam XVIII/KasuariMarkasSorong, Papua Barat DayaJulukanYonzipur 20/PPAMotoPawbili Pelle AlangBaretHijauMaskotEnggang HitamUlang tahun2 FebruariPertempuranOperasi NemangkawiTokohKomandan saat iniLetkol Czi Moch. Zaenal Wafa, S.Sos. Batalyon Zeni Tempur 20/Pawbili Pelle Alang disingkat Yon Zipur 20/PPA sebelumny...

 

 

Ketua Mahkamah Agung Republik SingapuraChief Justice of the Republic of SingaporePetahanaSundaresh Menonsejak 6 November 2012Mahkamah Agung SingapuraGelar Ketua Mahkamah Agung(informal) Yang Mulia(formal) Dicalonkan olehPerdana Menteri SingapuraDitunjuk olehPresiden SingapuraMasa jabatanJabatan hingga umur 65Dasar hukumKonstitusi Singapura, Pasal 94Pejabat perdanaWee Chong JinDibentuk9 Agustus 1965; 58 tahun lalu (1965-08-09)GajiS$347.400 per tahunSitus webwww.supremecourt.gov.sgKet...

 

 

Katedral Nova IguaçuKatedral Santo Antônio de JacutingaKatedral Nova IguaçuLokasiNova IguaçuNegara BrasilDenominasiGereja Katolik RomaArsitekturStatusKatedralStatus fungsionalAktifAdministrasiKeuskupanKeuskupan Nova Iguaçu Katedral Nova Iguaçu yang bernama resmi Katedral Santo Antônio de Jacutinga adalah sebuah gereja katedral Katolik yang terletak di Nova Iguaçu, Brasil. Katedral ini merupakan pusat kedudukan dan takhta bagi Keuskupan Nova Iguaçu.[1] Lihat juga Keuskupa...

Artikel ini tidak memiliki referensi atau sumber tepercaya sehingga isinya tidak bisa dipastikan. Tolong bantu perbaiki artikel ini dengan menambahkan referensi yang layak. Tulisan tanpa sumber dapat dipertanyakan dan dihapus sewaktu-waktu.Cari sumber: Surabaya Town Square – berita · surat kabar · buku · cendekiawan · JSTOR Townsquare SurabayaLokasiSurabayaAlamatJl. Hayam Wuruk No.6, Sawunggaling, WonokromoTanggal dibuka2008Jumlah lantai4Situs web[1] S...

 

 

Over the 150-year history of football in Scotland, most teams have occupied several grounds as their home; this has occasionally involved a relocation to another community altogether. Grounds which have been in continuous use for several decades have been extensively redeveloped, particularly since the 1990s, with a few exceptions. This article and the accompanying tables focus on those Scottish Football League / Scottish Professional Football League clubs which have moved to a different stad...

 

 

22°56′N 57°32′E / 22.933°N 57.533°E / 22.933; 57.533 ولاية نزوى عمر علي    ولاية نزوى تقسيم إداري البلد  عمان[1] عاصمة لـ محافظة الداخلية  التقسيم الأعلى محافظة الداخلية  خصائص جغرافية إحداثيات 22°56′00″N 57°32′00″E / 22.933333333333°N 57.533333333333°E / 22.933333333333; 57.533333333...

Disambiguazione – Se stai cercando altri significati, vedi Sinisgalli (disambigua). Leonardo Sinisgalli ritratto da Federico Patellani (1943) Leonardo Rocco Antonio Maria[1] Sinisgalli (Montemurro, 9 marzo 1908 – Roma, 31 gennaio 1981) è stato un poeta, saggista e critico d'arte italiano. È noto come Il poeta ingegnere o Il poeta delle due muse, per il fatto che in tutte le sue opere ha sempre fatto convivere cultura umanistica e cultura scientifica[2]. Per la sua versa...

 

 

City in Razavi Khorasan province, Iran For the administrative divisions, see Shahrabad District and Shahrabad Rural District. For other places with the same name, see Shahrabad. City in Razavi Khorasan, IranShahrabad Persian: شهرآبادCityShahrabadCoordinates: 35°08′54″N 57°56′07″E / 35.14833°N 57.93528°E / 35.14833; 57.93528[1]CountryIranProvinceRazavi KhorasanCountyBardaskanDistrictShahrabadPopulation (2016)[2] • Tota...

 

 

Bharat Sanchar Nigam Limited (BSNL)JenisPerusahaan Milik NegaraIndustriTelekomunikasiDidirikanAbad ke-19, dimasukkan tahun 2000KantorpusatNew Delhi, IndiaTokohkunciRakesh Kumar Upadhyay (CMD)ProdukJaringan tetap dan telepon ponsel, Layanan internet, Televisi digital, IPTVPendapatan Rs 32.045 crore (2009-10)[1]Laba bersih Rs 1.822 crore (2009–10)Total aset Rs 132.243 crore (2009–10)[2]Karyawan281,635 (Maret 2011)[3]Situs webwww.bsnl.co.in Kantor pusat BSNL, New Delh...

Football tournamentList of All-Ireland Senior Football Championship finalsFounded1887RegionIreland (GAA)Number of teams34 (qualifiers)Most successful team(s)Kerry (38 titles) The All-Ireland Men's Senior Football Championship, the premier competition in Gaelic football, is an annual series of games played in Ireland during the summer and early autumn, and organised by the Gaelic Athletic Association (GAA). Contested by the top male inter-county football teams in Ireland, the tournament ...

 

 

Pour les articles homonymes, voir Mitchell. Joni Mitchell Joni Mitchell en 1983.Informations générales Nom de naissance Roberta Joan Anderson Naissance 7 novembre 1943 (80 ans)Fort Macleod (Alberta), Canada Genre musical Folk, country rock, folk rock, jazz Instruments Guitare, piano, voix, dulcimer Années actives 1964–20022006–20072013Depuis 2022 Labels Reprise (1968-1972, 1994-2001)Asylum (1972-1981)Geffen (1982-1993)Nonesuch (2002)Hear Music (2007) Site officiel jonimitchell.co...

 

 

2020年夏季奥林匹克运动会波兰代表團波兰国旗IOC編碼POLNOC波蘭奧林匹克委員會網站olimpijski.pl(英文)(波兰文)2020年夏季奥林匹克运动会(東京)2021年7月23日至8月8日(受2019冠状病毒病疫情影响推迟,但仍保留原定名称)運動員206參賽項目24个大项旗手开幕式:帕维尔·科热尼奥夫斯基(游泳)和马娅·沃什乔夫斯卡(自行车)[1]闭幕式:卡罗利娜·纳亚(皮划艇)&#...

Region in Texas, United StatesNortheast TexasRegionFrom top, left to right: Plaza Tower in Tyler; North Broadway Avenue in Tyler; Downtown Longview; State Line Avenue in Texarkana; Paris Commercial Historic District; Downtown Palestine; and Downtown MarshallNortheast Texas counties in redCountry United StatesState TexasLargest cityTylerPopulation (2020) • Total1,152,223[1][2][3][4] Northeast Texas is a cultural and geographic region i...

 

 

Austrian alpine skier Marcel HirscherHirscher in March 2018Personal informationBorn (1989-03-02) 2 March 1989 (age 35)Hallein, Salzburg, AustriaOccupationAlpine skierHeight1.73 m (5 ft 8 in)Skiing careerDisciplinesSlalom, giant slalom, super-G, combinedClubSkiklub AnnabergWorld Cup debut17 March 2007(age 18)Retired4 September 2019 (age 30)Websitemarcelhirscher.atOlympicsTeams3 – (2010, 2014, 2018)Medals3 (2 gold)World ChampionshipsTeams5 – (2009, 2013, 2015, 2017, 2019...

 

 

Trains: in UK Template‑class Trains Portal This template is within the scope of WikiProject Trains, an attempt to build a comprehensive and detailed guide to rail transport on Wikipedia. If you would like to participate, you can visit the project page, where you can join the project and/or contribute to the discussion. See also: WikiProject Trains to do list and the Trains Portal.TrainsWikipedia:WikiProject TrainsTemplate:WikiProject Trainsrail transport articlesTemplateThis template does ...

Claudia de' MediciFrans Luycx, Ritratto dell'arciduchessa Claudia de' Medici, 1635, Kunsthistorisches Museum, ViennaDuchessa consorte di UrbinoStemma In carica1621 –1623 PredecessoreLivia della Rovere SuccessoreLivia della Rovere Arciduchessa consortedell'Austria AnterioreIn carica19 aprile 1626 –13 settembre 1632 PredecessoreAnna Caterina Gonzaga SuccessoreAnna de' Medici TrattamentoSua Altezza Reale Altri titoliPrincipessa di ToscanaArciduchessa d'AustriaContessa consort...

 

 

Election of Pope Paschal II Papal electionAugust 1099Dates and location13 August 1099RomeElected popeRanieirusName taken: Paschal II← 10881118 → Old St. Peter's Basilica, site of the 1099 conclave The 1099 papal election following the death of Pope Urban II took place on 13 August 1099. Before his death, Urban had designated Cardinal Rainerius da Bieda as his successor. The cardinal-electors, with the consent of the lower Roman clergy, chose Rainerius, who, after a flight and ov...

 

 

PilotEpisode The X-FilesNomor episodeMusim 1Episode 1SutradaraRobert MandelPenulisChris CarterKode produksi1X79Tanggal siar10 September 1993Durasi48 menitBintang tamu Charles Cioffi sebagai Scott Blevins Cliff DeYoung sebagai Dr. Jay Nemman Sarah Koskoff sebagai Theresa Nemman Leon Russom sebagai Detektif Miles Zachary Ansley sebagai Billy Miles William B. Davis sebagai The Smoking Man Kronologi episode ← Sebelumnya— Selanjutnya →Deep Throat Pilot (The X-Files) adalah...

У этого термина существуют и другие значения, см. 33-й полк. 33-й зенитный ракетный полк Годы существования c 9 декабря 2015 года [1] Страна  Россия Входит в 1-я дивизия ПВО Дислокация Рогачево о. Южный архипелага Новая Земля  Медиафайлы на Викискладе 33-й зенитный ракетны...

 

 

MontabardcomuneMontabard – Veduta LocalizzazioneStato Francia Regione Normandia Dipartimento Orne ArrondissementArgentan CantoneArgentan-1 TerritorioCoordinate48°49′N 0°05′W48°49′N, 0°05′W (Montabard) Superficie11,04 km² Abitanti310[1] (2009) Densità28,08 ab./km² Altre informazioniCod. postale61160 Fuso orarioUTC+1 Codice INSEE61283 CartografiaMontabard Modifica dati su Wikidata · Manuale Montabard è un comune francese di 310 abitanti situat...