Lean 4

1 program Added 2026-02-26T00:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: Lean4, Lean
Provenance: commit 3c32f4c615 · authored 2026-02-26T17:07:34+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

5 sources · pl_id: pl/lean-4
LLM (this repo) · 1LinguistPygmentsWikipediaWikidata · Q6509476

Wikipedia infobox

Pulled from the wikimedia/structured-wikipedia snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and pl_fact.csv for the long-table provenance.

Paradigmsstrict purely functional · dependently typed
Typingstatic, strong, inferred
Designed byLean FRO · Leonardo de Moura
First appeared2013
Influenced byML · Rocq (formerly named Coq) · Haskell
LicenseApache 2.0
Implemented inLean · C++
Homepagehttp://lean-lang.org

Extensions claimed by this language

2 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.leanlinguistprimary1.0M files
.leanpygmentsprimary1.0M files

Related languages

Lean4 (1.00)Lean (0.33)Clean (0.29)Bean (0.21)JEAN (0.21)

LLM-contributed programs

FizzBuzz

Provenance: commit 3c32f4c615 · authored 2026-02-26T17:07:34+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.lean · license: Public Domain · added: 2026-02-26T00:00:00Z
def fizzBuzz (n : Nat) : String :=
  if n % 15 == 0 then "FizzBuzz"
  else if n % 3 == 0 then "Fizz"
  else if n % 5 == 0 then "Buzz"
  else toString n

def main : IO Unit := do
  for i in List.range 20 do
    IO.println (fizzBuzz (i + 1))

Real programs from Software Heritage

1 sample mined from derived_datasets/<date>/contents/*.parquet, byte-verified against the SWH archive. Citation-grade qualified SWHIDs preserved.
CvxLeanTest.lean · 52 B · ext .lean · seen 386× in SWH
via heuristicrule h/linguist/.lean/1
swh:1:cnt:4304f49277615a8e932ae620b36a6df9250111d6;origin=https://github.com/verified-optimization/CvxLean;anchor=swh:1:rev:4d8c9ab20d101f9b4e7fb1ca9eaa95080fbfd448;path=/CvxLeanTest.lean
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
import CvxLean.Test.All
import CvxLean.Examples.All

Disambiguation rules

Linguist heuristic rules that predict this language when one of its claimed extensions is shared with another.
RuleExtKindPredicates (truncated)
h/linguist/.lean/1.leanpredicates[{"kind": "any", "regexes": ["^import [A-Z]"]}]

Contribute — propose a file extension

Tell us where to find evidence about Lean 4 (mapped to pl/lean-4). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Lean 4/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Lean Lean4 →