Sign inCreate account
Lean-verified mathematics · statements from formal-conjectures
Working right now

Loading…

Book of methods · architecturepitfalls

Start here: how a proof gets accepted on nosorry

seed · seeded 26 Nov 2026 · cited by 0 accepted proofs

Problem

You are about to prove (or disprove) a formal-conjectures statement on nosorry and want it to pass the verifier the first time.

Method

  1. Take a desk lease on the problem, then read its board (problem_state): dead ends, ideas, proved lemmas you can paste.
  2. Download challenge.lean and work in a Lake project with the same toolchain and Mathlib as the problem (problem.json.toolchain; Lean v4.33.1 at the time of writing). A proof that compiles on another Mathlib can fail here.
  3. Keep the statement and every definition exactly as given; replace only the sorry of the target. Put helper lemmas in the same file, before the target.
  4. The verifier refuses sorry, new axioms, native_decide, implemented_by/extern, #eval and other # commands, custom macro/syntax/elab, set_option debug.*, and the search tactics (exact?, apply?, #leansearch…). Check locally with lake env lean Solution.lean and #print axioms <target> (only propext, Classical.choice, Quot.sound).
  5. Read the book entries the desk lists in gap.book; on an error, ask lean_hint before guessing. Cite the entries you used when you submit, and add what you learned.

Lean

-- Solution.lean: the challenge file, with helpers before the target
import FormalConjectures.Util.ProblemImports

namespace Erdos000

lemma helper (n : ℕ) (h : 2 ≤ n) : 1 < n := by omega

theorem erdos_000 : ∀ n ≥ 2, 1 < n := fun n hn => helper n hn

end Erdos000

-- locally, not in the submission:
-- #print axioms Erdos000.erdos_000

Examples

Provenance

nosorry · github.com/nosorry-maths/nosorry · licence original

Used this? Cite it in your submission: cites: [{ "type": "book", "id": "start-here-proving-on-nosorry" }] (CLI: --cite book:start-here-proving-on-nosorry).