MathRPG: Army of Truth

Copy it

This is an experimental project, offered to the Lean community as a proposal: the game, the tools, the maps, the notes and this site. Nothing is released yet. We intend code under the Apache License 2.0 and text, pictures and maps under CC BY 4.0, so that anyone could change it, design their own worlds or run the whole system without us, but we want to settle the terms with the community first. Until then, read it and try it on your own computer, and please ask before reusing anything.

The source is in a public repository: https://github.com/GroovyGou/MathRPG

Three layers, no server of ours

LayerWhat it isWhat we hold
This sitestatic files: the game, the maps, the notes, the manifestonothing (the host keeps access logs; see Privacy)
Local kitthe repository on your own computer: Lean, Mathlib, the rank tools, the game and its check servernothing
Cloud kita script for very large builds on a machine you rent yourselfnothing: your account, your keys, your bill

On your own computer

Most measurements fit an ordinary computer (a few GB of disk for Mathlib's compiled files).

  1. Get the repository: git clone it from the address above.
  2. Install Lean with elan, Lean's version manager. Download the release file for your system from elan's releases page, check its SHA-256, and run elan-init. We do not recommend piping a script from the internet into your shell. The repository's lean-toolchain file names the Lean version, and elan fetches it.
  3. Get Mathlib: in the repository, run lake exe cache get (Mathlib's compiled files from its cache), then lake build.
  4. Play locally: run python3 tools/serve.py (on Windows py -3 tools/serve.py) and open the address it prints. A local copy keeps your saves in your own browser.
  5. Measure: MathRank.lean and its siblings hold the commands #math_rank, #place_edges and #place_modules; each file's header says how to run it. The Python tools in world/ turn their output into worlds, maps and raid boards; each has tests (python3 -m unittest).
  6. Check proofs from the game: the workbench's Check button talks to a small check server (server/, API in docs/specs/play-api-1.md). It runs Lean jobs as a separate user without network, with time and memory limits, on Linux or in WSL on Windows.
  7. Build this site: python3 tools/demo_site.py build --out ../mathrpg-site. A new result is a new folder under site/notes/ (its data.json and note.md); python3 tools/notes.py check checks it.

In the cloud, on your own account

Some formalisations are too large for a normal computer. The Riemann hypothesis formalisation, for example, needed about 18 GB of memory just to load (build note). For builds like that:

The full step-by-step guides for both kits are being written and will be in the repository's docs/ folder.

Change it, and tell us

If you find an error in a measurement, a text or a map, or if you lower a rank record with a new route, please tell us through the repository. Corrections are welcome.