Power App · Lean 4

Lean 4 + Mathlib, in the cloud.

A real Lean 4 instance in browser VS Code — Mathlib preinstalled, the proof state beside the code, a coding agent one pane over. Your first theorem in minutes, not afternoons.

Tutorial.lean
your instance
1import Mathlib.Tactic
2
3/-! # Lean 4 + Mathlib tutorial -/
4-- Each `example` is tiny and self-contained.
5
6-- 1. `rfl` — proof by computation
7example : 2 + 2 = 4 := rfl
8example (a : Nat) : a + 0 = a := rfl
9
10-- 2. `ring` — equalities in commutative rings
11example (a b : ℤ) :
12 (a + b) ^ 2 = a ^ 2 + 2 * a * b + b ^ 2 := by ring
13
14-- 3. an open exercise — the hint's in the comment
15theorem my_add_succ (n : Nat) : n + 1 = n.succ := sorry
Lean 4 · mathlib · elaborated in 240ms
LEAN INFOVIEW
Tutorial.lean:17:21
Messages (1)
Goals accomplished! 🎉
All Messages (1)
Tutorial.lean:128:8
declaration uses 'sorry'
CLAUDE CODE
Learn Lean 4 with mathlib examples
please use mathlib and create simple examples to learn lean4
I've added LeanProject/Tutorial.lean — it covers, in order:
1.rflproof by computation
2.ringalgebraic identities over ℤ
3.linarith / omegalinear arithmetic over ℝ and ℕ
4.simpthe tagged lemma library
5.intro / exact / applythe basic term-building tactics
6.inductionproving 0 + n = n by hand
7.Nat.PrimeMathlib in action, via norm_num
8.my_add_succan open exercise, for you to finish
Tutorial.lean · mathlib preinstalled · your instance
Why cloud

Skip the setup wall

The web playground at live.lean-lang.org is a shared, one-file scratchpad. A real project needs a real toolchain — or someone else's machine that already has one.

On your machine

  • Install elan, then the right Lean toolchain
  • Set up lake and a project skeleton
  • Add mathlib as a dependency
  • Run lake exe cache get — a multi-gigabyte download
  • Install the VS Code extension
  • Wait for the language server to warm up

On Oyren

  • Open a workspace
  • Open the Lean 4 Power App
  • State your theorem

Mathlib and its prebuilt cache are already there — your first import elaborates in seconds, not hours.

The instance

A real Lean 4 instance, yours alone

VS Code in the browser

Real VS Code, not an imitation — the Lean extension, your files, your keybindings, running in an isolated container that's yours alone.

Mathlib, preinstalled

The full library with its prebuilt cache already in place. No lake exe cache get, no overnight builds — import Mathlib.Tactic just works.

The proof state beside the code

The infoview updates as you type: goals, hypotheses, and errors live, exactly as Lean users expect it.

AI theorem proving

The model drafts, the kernel judges

Lean is the rare place where an agent can't bluff: a proof either elaborates or it doesn't.

Point Claude Code or opencode at your project from the pane beside the editor. The agent proposes tactics, whole lemmas, or the tutorial you saw above — and everything it writes is checked by the Lean kernel before it counts. Agents don't replace understanding; they speed up the search for the proof you were going to write anyway.

Who it's for

From your first rfl to formalized business logic

Students

Spend your first hour on rfl and simp, not on toolchain errors. The tutorial above is the actual on-ramp.

Researchers

A full mathlib environment from any laptop — formalize on the machine in the cloud, not the one in your bag.

Engineers

Prove the invariants your business logic depends on — pricing caps, state machines, protocol rules.

Puzzle solvers

Project Euler in Lean 4: solve it, then prove the solution is the only one.

FAQ

Before you ask

Can I run Lean 4 online without installing anything?

Yes. A Lean 4 Power App on Oyren opens real VS Code in your browser with the toolchain ready — no elan, no lake, nothing local. It's your own instance in an isolated container, not a shared playground.

Is Mathlib preinstalled?

Yes, with its prebuilt cache in place, so imports elaborate in seconds instead of the hours a local build can take. The cache covers mathlib itself; unusual extra dependencies still compile normally.

How is this different from live.lean-lang.org?

The web playground is a shared, one-file scratchpad — great for a quick check. An Oyren workspace is a full environment: multi-file projects, git, the VS Code extension ecosystem, and coding agents in the same container.

Can AI agents write Lean proofs?

They draft; the kernel judges. Claude Code or opencode can propose tactics and whole lemmas, and only what elaborates counts as done. Agents don't replace understanding — they speed up the search.

Start proving

A real Lean 4 instance with Mathlib, in your browser, in minutes. Your first is closer than your first successful local build.

Start free