GraviTrax workshop

Manage your pieces, draw and generate circuits, and prove in Lean that the marble arrives.

Each circuit is a theorem: the plan is valid, the stock has the pieces, and the marble that leaves the launcher always reaches a finish tile. You prove it with game tactics that follow the marble, cell by cell, and Lean shows the goals left after each line.

The Lean engine runs in the browser, compiled to WebAssembly, and a theorem guarantees its verdicts. It also draws the 2D plan and the 3D scene, with proved geometry. A generator proposes circuits from a sentence, and Lean checks every wish.

App in French and English

Open the app →

In Lean

These statements are read from the games' Lean code when the site is built: if one of them disappears or changes, the site does not build.

Gravitrax.Circuit (stock : Stock) (p : Plan) : Prop
The theorem attached to every circuit of the app. source →
Gravitrax.Roule (p : Plan) : Gravitrax.Cell → Prop
source →
Gravitrax.Roule.sans_impasse {p : Plan} {c : Gravitrax.Cell} (h : Roule p c) {d : Gravitrax.Cell} :
  Chemin p c d → p.exits d = [] → p.pieceAt d = some Piece.arrivee
Wherever the marble can get stuck, there is a finish tile. source →
Gravitrax.Arbre.valide_sound {s : Stock} {p : Plan} {n : Nat} {b : But} {t : Arbre}
  (h : Arbre.valide s p n b t = true) : But.holds s p b
source →
Gravitrax.Jeu.jouer_sound {s : Stock} {p : Plan} {script : String} {l : Lang}
  (h : (Jeu.jouer s p script l).complet = true) : Circuit s p
The browser's verdict can be trusted: a complete proof proves the theorem. source →
Gravitrax.Dessin.cellAt_point (c : Gravitrax.Cell) : Dessin.cellAt c.point = c
Clicking where a cell is drawn gives back that cell. source →