Lean

1 program Added 2025-10-22T13:19:22Z Model: anthropic/claude-3.5-sonnetTemp: 0.4 Evidence Report issue View issues
Aliases: Lean Prover, Lean 4
Provenance: commit dada93fb9e · authored 2025-10-22T15:19:22+02:00 · model anthropic/claude-3.5-sonnet

Sources mentioning this language

8 sources · pl_id: pl/lean
LLM (this repo) · 1PldbLinguistPygmentsWikipediaHyperpolyglotRosettacodeWikidata · 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

3 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.leanlinguistprimary2.1M files
.leanpygmentsprimary2.1M files
.hleanlinguistsecondary7.1K files

Related languages

Lean 4 (0.33)Lean4 (0.33)Tamarin (0.26)Aya (0.25)Lever (0.20)

Real programs from Software Heritage

No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)

Programs collected by LLM agents experimental · unverified

Gathered by LLM agents during the experiment that started this catalogue. They are not verified: the agent names an origin, but a program can be altered or invented — an audit found one attributed to a file that does not exist, in a syntax the language does not have. Prefer the programs archived by Software Heritage above. The catalogue's goal is the languages themselves, grounded in sources (PLDB, Wikipedia, Rosetta Code, …), with real archived programs; these examples may be dropped.

Natural Number Addition Properties

Provenance: commit dada93fb9e · authored 2025-10-22T15:19:22+02:00 · model anthropic/claude-3.5-sonnet · Temp 0.4
code.lean · license: Apache-2.0 · added: 2025-10-22T13:19:22Z
theorem add_zero (n : Nat) : n + 0 = n := rfl

theorem zero_add (n : Nat) : 0 + n = n := by
  induction n with
  | zero => rfl
  | succ n ih => simp [add_succ, ih]

theorem add_succ (n m : Nat) : n + Nat.succ m = Nat.succ (n + m) := by
  induction n with
  | zero => simp [zero_add]
  | succ n ih => simp [add_succ, ih]

theorem succ_add (n m : Nat) : Nat.succ n + m = Nat.succ (n + m) := rfl

theorem add_comm (n m : Nat) : n + m = m + n := by
  induction n with
  | zero => simp [zero_add]
  | succ n ih => simp [add_succ, ih, succ_add]

Disambiguation rules

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

Contribute — propose a file extension

Tell us where to find evidence about Lean (mapped to pl/lean). 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/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Leaf Lean 4 →