GAP Playground

Run GAP, Prover9, Mace4, and Lean 4 proofs in isolated cloud runners.

How to use this playground

Type code on the left and press Run (or ⌘/Ctrl + Enter). Your code runs in an isolated runner, and results appear on the right, usually within a minute.

⚑ Batch Execution Model: Each run executes the complete script in your editor from top to bottom in a clean, isolated cloud sandbox. All variables, functions, and theorems defined within your editor work together seamlessly. Because each run starts fresh, there is no lingering or hidden state from previous runs—ensuring 100% reproducible computations and proofs.

GAP: Like the GAP prompt, a statement ending in ; shows its value, while ;; hides it. Print(…) works too. Load packages with LoadPackage("semigroups");. Runs stop after 120 seconds. Choose LaTeX above the output to typeset GAP results automatically, plus any maths between $…$ or $$…$$.

Prover9 and Mace4: pick the tool next to the editor title. Both read the same input language (formulas(assumptions). … end_of_list., then formulas(goals). … end_of_list.). Prover9 searches for a proof; Mace4 searches for a finite model or counterexample (use assign(domain_size, 6). to fix the size).

Lean 4 + Mathlib 4: pick Lean 4 next to the editor title. Import modules like import Mathlib.Algebra.Group.Basic or import Mathlib.Tactic. Use tactics such as linarith, ring, rw, and induction, or run evaluations with #eval and #check.

Connection & Privacy settings

Use a fine-grained token limited to the target repository with Contents: read & write (dispatches runs), Actions: read (downloads outputs) and Checks: read (backup output channel).

πŸ“˜ Step-by-Step for Mathematicians: How to get your own token in 1 minute

Why a token? Computations run on GitHub's cloud runners. GitHub uses tokens to verify authorization so you can execute code safely.

Option A — Running on a Shared / Department Repository:
If you were invited as a collaborator on a shared runner repository, accept the invitation email. Then generate a fine-grained token selecting that repository and enter its owner/name above.
Option B — Running on Your Own GitHub Account:
Fork the runner repository to your own account. Then generate a token selecting your fork, and enter your-username/repo-name above. Every free GitHub account receives 2,000 free runner minutes per month!
Generating your token in 5 easy clicks:
  1. Sign in to GitHub and open the Fine-grained tokens page.
  2. Click Generate new token. Set a token name (e.g. Math Playground) and an expiration date.
  3. Under Repository access, select Only select repositories and pick your target repository.
  4. Under Permissions → Repository permissions, set:
    • Contents: Access: Read and write (sends computation requests)
    • Actions: Access: Read-only (downloads run results)
    • Checks: Access: Read-only (backup output channel)
  5. Click Generate token at the bottom. Copy the token (starts with github_pat_...).
  6. Paste the repository name above and your token, then click Save settings.

πŸ”’ Complete Privacy Guarantee: Your token is stored only in your own browser's local storage (localStorage) and sent directly to GitHub's HTTPS API. It is never transmitted to any third party, database, or server.

GAP code

Output

Ready. Press Run or ⌘/Ctrl + Enter.
Output appears here.