explaingit

petergpt/lean-3d-game-axiom

Analysis updated 2026-05-18

21LeanAudience · developerComplexity · 4/5LicenseSetup · moderate

TLDR

A complete first-person voxel exploration game written almost entirely in the Lean 4 theorem-proving language.

Mindmap

mindmap
  root((repo))
    What it does
      Voxel island exploration
      Mining and building
      Day and night cycle
      Hidden landmarks
    Tech stack
      Lean 4
      Raylib
    Use cases
      Play a compact voxel game
      Study Lean for real time systems
    Audience
      Developers
      Lean enthusiasts

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Explore and play a small voxel island with mining, building, and flight.

USE CASE 2

Study how a theorem-proving language can drive a real-time game loop.

USE CASE 3

Build the game from source on an Apple Silicon Mac to inspect the Lean code.

USE CASE 4

Run the acceptance test suite to see deterministic testing in Lean.

What is it built with?

Lean 4Raylib

How does it compare?

petergpt/lean-3d-game-axiomjzshischolar/pyleanermathtensor/ai4math-putnam2025
Stars211413
LanguageLeanLeanLean
Setup difficultymoderatehardmoderate
Complexity4/54/54/5
Audiencedeveloperresearcherresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Apple Silicon macOS only, building from source needs elan and Apple's clang compiler.

In plain English

Axiom: First Light is a playable first person voxel game, built almost entirely in Lean 4, a programming language normally used for proving mathematical theorems rather than making games. The project shows that the same language used for formal proofs can also run a real time game loop, complete with graphics, physics, sound, and saved progress. In the game you explore a small island made of blocks, about 96 by 96 by 48 units in size, with beaches, forest, caves, ocean, clouds, stars, and a day and night cycle. You can walk, sprint, jump, or switch to a creative flying mode, and you can mine and place blocks using nine different materials. There is a hidden cave and a marble sun gate somewhere on the island to find. The game deliberately stays small: there is no crafting, no combat, no multiplayer, and no endlessly generated terrain, since it is meant to be a compact, complete experience rather than an ever expanding one. Nearly everything that makes the game work, including world generation, block storage, rendering meshes, physics, aiming, editing, sound effects, saving, and the menus, is written in Lean. A separate library called Raylib handles the lower level platform work: opening the window, reading keyboard and mouse input, playing audio, and sending the graphics Lean produces to the graphics card. The game currently only runs on Apple Silicon Macs. You can download a prebuilt release and open the app directly, though you may need to right click and choose Open the first time since it is not notarized by Apple. To build it from source, you need macOS 26 on Apple Silicon, a Lean toolchain manager called elan installed through Homebrew, and Apple's clang compiler, after which a few setup scripts compile the game and launch it. The project is released under the MIT license and includes no third party art or audio.

Copy-paste prompts

Prompt 1
Walk me through installing elan and building this game from source on my Mac.
Prompt 2
Explain how Lean handles the game loop while Raylib handles the platform layer.
Prompt 3
Show me how the voxel world generation and meshing code is organized across files.
Prompt 4
Help me understand the save file format and how invalid saves are handled.

Frequently asked questions

What is lean-3d-game-axiom?

A complete first-person voxel exploration game written almost entirely in the Lean 4 theorem-proving language.

What language is lean-3d-game-axiom written in?

Mainly Lean. The stack also includes Lean 4, Raylib.

How hard is lean-3d-game-axiom to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is lean-3d-game-axiom for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.