diff --git a/arena/__init__.py b/arena/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/arena/core.py b/arena/core.py
new file mode 100644
index 0000000000000000000000000000000000000000..a757d15a155345f41a109d8585db28b10f65d61b
--- /dev/null
+++ b/arena/core.py
@@ -0,0 +1,97 @@
+"""Task model for the Lean environments. Python 3.9, standard library only."""
+import hashlib, random
+from dataclasses import dataclass, field
+from typing import List, Optional, Dict
+
+HEADER = "import Mathlib\n"
+
+def rng_for(key, seed, difficulty):
+ h = hashlib.sha256(("%s|%d|%d" % (key, seed, difficulty)).encode()).digest()
+ return random.Random(int.from_bytes(h[:8], "big"))
+
+@dataclass
+class Theorem:
+ name: str # Lean identifier
+ statement: str # everything between the name and `:=`, e.g. "(x : ℝ) : x + 0 = x"
+ proof: str # reference proof: everything after `:=`, e.g. "by\n simp"
+ informal: str = "" # the statement in words; becomes the doc comment
+ weight: float = 1.0
+
+@dataclass
+class Task:
+ env: str
+ family: str
+ seed: int
+ difficulty: int
+ title: str
+ informal: str # the problem in words (Markdown, maths in \( \))
+ kind: str = "prove" # "prove" or "define"
+ preamble: str = "" # Lean text after the import: opens and fixed definitions
+ theorems: List[Theorem] = field(default_factory=list)
+ # define tasks only
+ stub: str = "" # what the solver sees, with `sorry` for each definition
+ solution: str = "" # reference definitions
+ free: List[str] = field(default_factory=list) # names the solver defines
+ tests: List[Theorem] = field(default_factory=list) # hidden; proved by the grader with native_decide
+ examples: str = "" # public example values, shown in the instruction
+ meta: Dict = field(default_factory=dict)
+
+ def _doc(self, t):
+ return ("/-- %s -/\n" % t.informal.replace("-/", "- /")) if t.informal else ""
+
+ def _body(self, proofs, defs):
+ out = [HEADER]
+ if self.preamble.strip(): out.append(self.preamble.strip() + "\n")
+ if defs.strip(): out.append(defs.strip() + "\n")
+ for t in self.theorems:
+ out.append("%stheorem %s %s := %s\n" % (self._doc(t), t.name, t.statement.strip(), t.proof.strip() if proofs else "by\n sorry"))
+ return "\n".join(out)
+
+ def start_file(self):
+ """Solution.lean as the solver first sees it."""
+ return self._body(False, self.stub)
+
+ def reference_solution(self):
+ return self._body(True, self.solution)
+
+ def hidden_reference(self):
+ text = self._body(False, self.stub)
+ for t in self.tests:
+ text += "\ntheorem %s %s := by\n sorry\n" % (t.name, t.statement.strip())
+ return text
+
+ def hidden_tests(self):
+ if not self.tests: return None
+ text = "import Solution\n"
+ for t in self.tests:
+ text += "\ntheorem %s %s := by\n native_decide\n" % (t.name, t.statement.strip())
+ return text
+
+ def spec(self):
+ graded = self.tests if self.tests else self.theorems
+ s = {"reference": self.hidden_reference(), "targets": [{"name": t.name, "weight": t.weight} for t in graded]}
+ if self.tests: s["tests"] = self.hidden_tests()
+ if self.free: s["free"] = list(self.free)
+ return s
+
+ def instruction(self):
+ lines = ["# %s" % self.title, "", self.informal.strip(), ""]
+ if self.kind == "prove":
+ n = len(self.theorems)
+ lines += ["## What to do", "",
+ "`Solution.lean` in the working directory states %s in Lean 4 with Mathlib, with `sorry` in place of %s. Replace every `sorry` with a proof." % (
+ "the theorem" if n == 1 else "%d theorems" % n, "the proof" if n == 1 else "each proof"),
+ "", "- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.",
+ "- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.",
+ "- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.",
+ ("- The reward is 1 if the theorem is proved and 0 otherwise." if n == 1 else
+ "- The reward is the share of the %d theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof." % n)]
+ else:
+ lines += ["## What to do", "",
+ "`Solution.lean` in the working directory declares %s with `sorry` as its body. Replace each `sorry` with a definition that matches the description above." % ", ".join("`%s`" % f for f in self.free),
+ "", "- Keep the name and the type exactly as given. You may add helper definitions.",
+ "- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.",
+ "- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.",
+ "- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise."]
+ if self.examples.strip(): lines += ["", "## Examples", "", self.examples.strip()]
+ return "\n".join(lines) + "\n"
diff --git a/arena/grade.py b/arena/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/arena/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/assets/social-preview.jpg b/assets/social-preview.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..01a1987abcc9a668c07e298ccdf19af6c7451b7b
--- /dev/null
+++ b/assets/social-preview.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:98bc05816fc00d9274e303e3ee5386a3d7e1e040805cb7cef1a6e947b673b6e6
+size 151649
diff --git a/data/combinatorial-identities/eval.jsonl b/data/combinatorial-identities/eval.jsonl
new file mode 100644
index 0000000000000000000000000000000000000000..af2c591fc620581e3ce0ace8d48d2bfd02064d7a
--- /dev/null
+++ b/data/combinatorial-identities/eval.jsonl
@@ -0,0 +1,24 @@
+{"id": "combinatorial-identities-binomial_sums-d1-e0000", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 1, "seed": 10000, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\binom{n}{i}\\, 8^{i} = 9^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A weighted sum of binomial coefficients. -/\ntheorem binomial_sum (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), n.choose i * 8 ^ i = 9 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d1-e0000"}
+{"id": "combinatorial-identities-counting-d1-e0001", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 1, "seed": 10001, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(s\\) be a finite set of integers with more than 3 elements. Prove that \\(s\\) contains two different integers \\(x \\ne y\\) that leave the same remainder on division by 3.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Pigeonhole principle for remainders. -/\ntheorem pigeonhole_mod (s : Finset ℤ) (h : 3 < s.card) :\n ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ x % 3 = y % 3 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d1-e0001"}
+{"id": "combinatorial-identities-fibonacci-d1-e0002", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 1, "seed": 10002, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFor every natural number \\(n\\), with \\(F\\) the Fibonacci sequence (\\(F_0 = 0\\), \\(F_1 = 1\\), \\(F_{k+2} = F_k + F_{k+1}\\)), \\[\\sum_{i=0}^{n-1} F_{i+3} + F_{4} = F_{n+4}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A telescoping sum of Fibonacci numbers. -/\ntheorem fib_shifted_sum (n : ℕ) :\n ∑ i ∈ Finset.range n, Nat.fib (i + 3) + Nat.fib 4 = Nat.fib (n + 4) := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d1-e0002"}
+{"id": "combinatorial-identities-linear_recurrence-d1-e0003", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 1, "seed": 10003, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = -3\\), \\(u_1 = -7\\) and \\(u_{n+2} = 4\\,u_{n+1} - 3\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = -2 \\cdot 3^{n} + -1 \\cdot 1^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => (-3)\n | 1 => (-7)\n | (n + 2) => 4 * u (n + 1) - 3 * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = (-2) * 3 ^ n + (-1) * 1 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d1-e0003"}
+{"id": "combinatorial-identities-binomial_sums-d2-e0004", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 2, "seed": 10004, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFor every natural number \\(n\\), \\[2 \\cdot \\sum_{i=0}^{n} \\binom{i+1}{1} = 2 \\cdot \\binom{n+2}{2}.\\] (This is the hockey stick identity.)\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A hockey stick identity for binomial coefficients. -/\ntheorem hockey_stick (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), 2 * (i + 1).choose 1 = 2 * (n + 2).choose 2 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d2-e0004"}
+{"id": "combinatorial-identities-counting-d2-e0005", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 2, "seed": 10005, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(n\\) be a natural number. Prove that the set \\(\\{0, 1, \\dots, n-1\\}\\) has at most as many elements as the set of integers \\(y\\) with \\(0 \\le y < 4 n\\) and \\(y \\equiv 2 \\pmod{4}\\). (Construct an injection.)\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- An injection into a residue class gives a cardinality bound. -/\ntheorem card_le_residue_class (n : ℕ) :\n (Finset.range n).card ≤ ((Finset.range (4 * n)).filter (fun y => y % 4 = 2)).card := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d2-e0005"}
+{"id": "combinatorial-identities-fibonacci-d2-e0006", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 2, "seed": 10006, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFor every natural number \\(n\\), with \\(F\\) the Fibonacci sequence, \\[\\sum_{i=0}^{n} 3\\,F_i^2 = 3\\,F_n F_{n+1}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A sum of squares of Fibonacci numbers. -/\ntheorem fib_square_sum (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), 3 * Nat.fib i ^ 2 = 3 * (Nat.fib n * Nat.fib (n + 1)) := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d2-e0006"}
+{"id": "combinatorial-identities-linear_recurrence-d2-e0007", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 2, "seed": 10007, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = -4\\), \\(u_1 = 11\\) and \\(u_{n+2} = -3\\,u_{n+1} - -4\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = -3 \\cdot (-4)^{n} + -1 \\cdot 1^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => (-4)\n | 1 => 11\n | (n + 2) => (-3) * u (n + 1) - (-4) * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = (-3) * (-4) ^ n + (-1) * 1 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d2-e0007"}
+{"id": "combinatorial-identities-binomial_sums-d3-e0008", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 3, "seed": 10008, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFirst prove \\[\\sum_{i=0}^{n} i \\binom{n}{i} = n \\cdot 2^{n-1},\\] where \\(n - 1\\) is truncated subtraction on the natural numbers. Then use it, and the value of \\(\\sum_{i=0}^{n} \\binom{n}{i}\\), to prove \\[\\sum_{i=0}^{n} (2i + 7) \\binom{n}{i} = 2 \\cdot n \\cdot 2^{n-1} + 7 \\cdot 2^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The sum of i times n choose i. -/\ntheorem sum_i_choose (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), i * n.choose i = n * 2 ^ (n - 1) := by\n sorry\n\n/-- A weighted binomial sum. -/\ntheorem weighted_sum (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (2 * i + 7) * n.choose i = 2 * (n * 2 ^ (n - 1)) + 7 * 2 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d3-e0008"}
+{"id": "combinatorial-identities-counting-d3-e0009", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 3, "seed": 10009, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(s\\) be a set of natural numbers that are all less than \\(4 \\cdot 2 = 8\\), and suppose \\(s\\) has more than 2 elements. Prove that \\(s\\) contains two elements \\(x < y\\) with \\(y - x < 4\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Pigeonhole principle for blocks of consecutive numbers. -/\ntheorem close_pair (s : Finset ℕ) (hs : s ⊆ Finset.range (4 * 2)) (h : 2 < s.card) :\n ∃ x ∈ s, ∃ y ∈ s, x < y ∧ y < x + 4 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d3-e0009"}
+{"id": "combinatorial-identities-fibonacci-d3-e0010", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 3, "seed": 10010, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFirst prove Cassini's identity: for every natural number \\(n\\), \\[F_{n+1}^2 - F_n F_{n+2} = (-1)^n,\\] computed in the integers, where \\(F\\) is the Fibonacci sequence. Then conclude that \\(F_{m+1}^2 - F_m F_{m+2}\\) is either \\(1\\) or \\(-1\\) when \\(m = 7n + 2\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cassini's identity for Fibonacci numbers. -/\ntheorem cassini (n : ℕ) :\n (Nat.fib (n + 1) : ℤ) ^ 2 - Nat.fib n * Nat.fib (n + 2) = (-1) ^ n := by\n sorry\n\n/-- Cassini's determinant is plus or minus one at the index given. -/\ntheorem cassini_pm_one (n : ℕ) :\n (Nat.fib (7 * n + 2 + 1) : ℤ) ^ 2 - Nat.fib (7 * n + 2) * Nat.fib (7 * n + 2 + 2) = 1 ∨ (Nat.fib (7 * n + 2 + 1) : ℤ) ^ 2 - Nat.fib (7 * n + 2) * Nat.fib (7 * n + 2 + 2) = -1 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d3-e0010"}
+{"id": "combinatorial-identities-linear_recurrence-d3-e0011", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 3, "seed": 10011, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = 3\\), \\(u_1 = 14\\) and \\(u_{n+2} = 4\\,u_{n+1} - 4\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = (3 + 4 n) \\cdot 2^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => 3\n | 1 => 14\n | (n + 2) => 4 * u (n + 1) - 4 * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = (3 + 4 * (n : ℤ)) * 2 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d3-e0011"}
+{"id": "combinatorial-identities-binomial_sums-d1-e0012", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 1, "seed": 10012, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\binom{n}{i}\\, 7^{i} = 8^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A weighted sum of binomial coefficients. -/\ntheorem binomial_sum (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), n.choose i * 7 ^ i = 8 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d1-e0012"}
+{"id": "combinatorial-identities-counting-d1-e0013", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 1, "seed": 10013, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(s\\) be a finite set of integers with more than 2 elements. Prove that \\(s\\) contains two different integers \\(x \\ne y\\) that leave the same remainder on division by 2.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Pigeonhole principle for remainders. -/\ntheorem pigeonhole_mod (s : Finset ℤ) (h : 2 < s.card) :\n ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ x % 2 = y % 2 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d1-e0013"}
+{"id": "combinatorial-identities-fibonacci-d1-e0014", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 1, "seed": 10014, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFor every natural number \\(n\\), with \\(F\\) the Fibonacci sequence (\\(F_0 = 0\\), \\(F_1 = 1\\), \\(F_{k+2} = F_k + F_{k+1}\\)), \\[\\sum_{i=0}^{n-1} F_{i+12} + F_{13} = F_{n+13}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A telescoping sum of Fibonacci numbers. -/\ntheorem fib_shifted_sum (n : ℕ) :\n ∑ i ∈ Finset.range n, Nat.fib (i + 12) + Nat.fib 13 = Nat.fib (n + 13) := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d1-e0014"}
+{"id": "combinatorial-identities-linear_recurrence-d1-e0015", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 1, "seed": 10015, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = 4\\), \\(u_1 = 17\\) and \\(u_{n+2} = 7\\,u_{n+1} - 10\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = 1 \\cdot 2^{n} + 3 \\cdot 5^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => 4\n | 1 => 17\n | (n + 2) => 7 * u (n + 1) - 10 * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = 1 * 2 ^ n + 3 * 5 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d1-e0015"}
+{"id": "combinatorial-identities-binomial_sums-d2-e0016", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 2, "seed": 10016, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFor every natural number \\(n\\), \\[5 \\cdot \\sum_{i=0}^{n} \\binom{i+1}{1} = 5 \\cdot \\binom{n+2}{2}.\\] (This is the hockey stick identity.)\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A hockey stick identity for binomial coefficients. -/\ntheorem hockey_stick (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), 5 * (i + 1).choose 1 = 5 * (n + 2).choose 2 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d2-e0016"}
+{"id": "combinatorial-identities-counting-d2-e0017", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 2, "seed": 10017, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(n\\) be a natural number. Prove that the set \\(\\{0, 1, \\dots, n-1\\}\\) has at most as many elements as the set of integers \\(y\\) with \\(0 \\le y < 6 n\\) and \\(y \\equiv 4 \\pmod{6}\\). (Construct an injection.)\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- An injection into a residue class gives a cardinality bound. -/\ntheorem card_le_residue_class (n : ℕ) :\n (Finset.range n).card ≤ ((Finset.range (6 * n)).filter (fun y => y % 6 = 4)).card := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d2-e0017"}
+{"id": "combinatorial-identities-fibonacci-d2-e0018", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 2, "seed": 10018, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFor every natural number \\(n\\), with \\(F\\) the Fibonacci sequence, \\[\\sum_{i=0}^{n-1} F_{2i+11} + F_{10} = F_{2n+10}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A sum of every second Fibonacci number. -/\ntheorem fib_odd_sum (n : ℕ) :\n ∑ i ∈ Finset.range n, Nat.fib (2 * i + 11) + Nat.fib 10 = Nat.fib (2 * n + 10) := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d2-e0018"}
+{"id": "combinatorial-identities-linear_recurrence-d2-e0019", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 2, "seed": 10019, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = 5\\), \\(u_1 = 5\\) and \\(u_{n+2} = 3\\,u_{n+1} - -4\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = 3 \\cdot (-1)^{n} + 2 \\cdot 4^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => 5\n | 1 => 5\n | (n + 2) => 3 * u (n + 1) - (-4) * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = 3 * (-1) ^ n + 2 * 4 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d2-e0019"}
+{"id": "combinatorial-identities-binomial_sums-d3-e0020", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 3, "seed": 10020, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFirst prove \\[\\sum_{i=0}^{n} i \\binom{n}{i} = n \\cdot 2^{n-1},\\] where \\(n - 1\\) is truncated subtraction on the natural numbers. Then use it, and the value of \\(\\sum_{i=0}^{n} \\binom{n}{i}\\), to prove \\[\\sum_{i=0}^{n} (5i + 6) \\binom{n}{i} = 5 \\cdot n \\cdot 2^{n-1} + 6 \\cdot 2^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The sum of i times n choose i. -/\ntheorem sum_i_choose (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), i * n.choose i = n * 2 ^ (n - 1) := by\n sorry\n\n/-- A weighted binomial sum. -/\ntheorem weighted_sum (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (5 * i + 6) * n.choose i = 5 * (n * 2 ^ (n - 1)) + 6 * 2 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d3-e0020"}
+{"id": "combinatorial-identities-counting-d3-e0021", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 3, "seed": 10021, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(s\\) be a set of natural numbers that are all less than \\(6 \\cdot 7 = 42\\), and suppose \\(s\\) has more than 7 elements. Prove that \\(s\\) contains two elements \\(x < y\\) with \\(y - x < 6\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Pigeonhole principle for blocks of consecutive numbers. -/\ntheorem close_pair (s : Finset ℕ) (hs : s ⊆ Finset.range (6 * 7)) (h : 7 < s.card) :\n ∃ x ∈ s, ∃ y ∈ s, x < y ∧ y < x + 6 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d3-e0021"}
+{"id": "combinatorial-identities-fibonacci-d3-e0022", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 3, "seed": 10022, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFirst prove Cassini's identity: for every natural number \\(n\\), \\[F_{n+1}^2 - F_n F_{n+2} = (-1)^n,\\] computed in the integers, where \\(F\\) is the Fibonacci sequence. Then conclude that \\(F_{m+1}^2 - F_m F_{m+2}\\) is either \\(1\\) or \\(-1\\) when \\(m = 3n + 6\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cassini's identity for Fibonacci numbers. -/\ntheorem cassini (n : ℕ) :\n (Nat.fib (n + 1) : ℤ) ^ 2 - Nat.fib n * Nat.fib (n + 2) = (-1) ^ n := by\n sorry\n\n/-- Cassini's determinant is plus or minus one at the index given. -/\ntheorem cassini_pm_one (n : ℕ) :\n (Nat.fib (3 * n + 6 + 1) : ℤ) ^ 2 - Nat.fib (3 * n + 6) * Nat.fib (3 * n + 6 + 2) = 1 ∨ (Nat.fib (3 * n + 6 + 1) : ℤ) ^ 2 - Nat.fib (3 * n + 6) * Nat.fib (3 * n + 6 + 2) = -1 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d3-e0022"}
+{"id": "combinatorial-identities-linear_recurrence-d3-e0023", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 3, "seed": 10023, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = -3\\), \\(u_1 = 4\\) and \\(u_{n+2} = 8\\,u_{n+1} - 16\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = (-3 + 4 n) \\cdot 4^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => (-3)\n | 1 => 4\n | (n + 2) => 8 * u (n + 1) - 16 * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = ((-3) + 4 * (n : ℤ)) * 4 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d3-e0023"}
diff --git a/data/combinatorial-identities/train.jsonl b/data/combinatorial-identities/train.jsonl
new file mode 100644
index 0000000000000000000000000000000000000000..7d214bfca9d86e5b4f2d213537cc8d1ba2d43253
--- /dev/null
+++ b/data/combinatorial-identities/train.jsonl
@@ -0,0 +1,84 @@
+{"id": "combinatorial-identities-binomial_sums-d1-t0000", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 1, "seed": 0, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\binom{n}{i}\\, 2^{i} = 3^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A weighted sum of binomial coefficients. -/\ntheorem binomial_sum (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), n.choose i * 2 ^ i = 3 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d1-t0000"}
+{"id": "combinatorial-identities-counting-d1-t0001", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 1, "seed": 1, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(s\\) be a finite set of integers with more than 3 elements. Prove that \\(s\\) contains two different integers \\(x \\ne y\\) that leave the same remainder on division by 3.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Pigeonhole principle for remainders. -/\ntheorem pigeonhole_mod (s : Finset ℤ) (h : 3 < s.card) :\n ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ x % 3 = y % 3 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d1-t0001"}
+{"id": "combinatorial-identities-fibonacci-d1-t0002", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 1, "seed": 2, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFor every natural number \\(n\\), with \\(F\\) the Fibonacci sequence (\\(F_0 = 0\\), \\(F_1 = 1\\), \\(F_{k+2} = F_k + F_{k+1}\\)), \\[\\sum_{i=0}^{n-1} F_{i+13} + F_{14} = F_{n+14}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A telescoping sum of Fibonacci numbers. -/\ntheorem fib_shifted_sum (n : ℕ) :\n ∑ i ∈ Finset.range n, Nat.fib (i + 13) + Nat.fib 14 = Nat.fib (n + 14) := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d1-t0002"}
+{"id": "combinatorial-identities-linear_recurrence-d1-t0003", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 1, "seed": 3, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = 6\\), \\(u_1 = 26\\) and \\(u_{n+2} = 9\\,u_{n+1} - 20\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = 4 \\cdot 4^{n} + 2 \\cdot 5^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => 6\n | 1 => 26\n | (n + 2) => 9 * u (n + 1) - 20 * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = 4 * 4 ^ n + 2 * 5 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d1-t0003"}
+{"id": "combinatorial-identities-binomial_sums-d2-t0004", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 2, "seed": 4, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\binom{i+7}{7} = \\binom{n+8}{8}.\\] (This is the hockey stick identity.)\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A hockey stick identity for binomial coefficients. -/\ntheorem hockey_stick (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (i + 7).choose 7 = (n + 8).choose 8 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d2-t0004"}
+{"id": "combinatorial-identities-counting-d2-t0005", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 2, "seed": 5, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(n\\) be a natural number. Prove that the set \\(\\{0, 1, \\dots, n-1\\}\\) has at most as many elements as the set of integers \\(y\\) with \\(0 \\le y < 4 n\\) and \\(y \\equiv 1 \\pmod{4}\\). (Construct an injection.)\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- An injection into a residue class gives a cardinality bound. -/\ntheorem card_le_residue_class (n : ℕ) :\n (Finset.range n).card ≤ ((Finset.range (4 * n)).filter (fun y => y % 4 = 1)).card := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d2-t0005"}
+{"id": "combinatorial-identities-fibonacci-d2-t0006", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 2, "seed": 6, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFor every natural number \\(n\\), with \\(F\\) the Fibonacci sequence, \\[\\sum_{i=0}^{n-1} F_{2i+2} + F_{1} = F_{2n+1}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A sum of every second Fibonacci number. -/\ntheorem fib_odd_sum (n : ℕ) :\n ∑ i ∈ Finset.range n, Nat.fib (2 * i + 2) + Nat.fib 1 = Nat.fib (2 * n + 1) := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d2-t0006"}
+{"id": "combinatorial-identities-linear_recurrence-d2-t0007", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 2, "seed": 7, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = 4\\), \\(u_1 = -2\\) and \\(u_{n+2} = -1\\,u_{n+1} - -6\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = 2 \\cdot 2^{n} + 2 \\cdot (-3)^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => 4\n | 1 => (-2)\n | (n + 2) => (-1) * u (n + 1) - (-6) * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = 2 * 2 ^ n + 2 * (-3) ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d2-t0007"}
+{"id": "combinatorial-identities-binomial_sums-d3-t0008", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 3, "seed": 8, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFirst prove \\[\\sum_{i=0}^{n} i \\binom{n}{i} = n \\cdot 2^{n-1},\\] where \\(n - 1\\) is truncated subtraction on the natural numbers. Then use it, and the value of \\(\\sum_{i=0}^{n} \\binom{n}{i}\\), to prove \\[\\sum_{i=0}^{n} (4i + 5) \\binom{n}{i} = 4 \\cdot n \\cdot 2^{n-1} + 5 \\cdot 2^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The sum of i times n choose i. -/\ntheorem sum_i_choose (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), i * n.choose i = n * 2 ^ (n - 1) := by\n sorry\n\n/-- A weighted binomial sum. -/\ntheorem weighted_sum (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (4 * i + 5) * n.choose i = 4 * (n * 2 ^ (n - 1)) + 5 * 2 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d3-t0008"}
+{"id": "combinatorial-identities-counting-d3-t0009", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 3, "seed": 9, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(s\\) be a set of natural numbers that are all less than \\(6 \\cdot 5 = 30\\), and suppose \\(s\\) has more than 5 elements. Prove that \\(s\\) contains two elements \\(x < y\\) with \\(y - x < 6\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Pigeonhole principle for blocks of consecutive numbers. -/\ntheorem close_pair (s : Finset ℕ) (hs : s ⊆ Finset.range (6 * 5)) (h : 5 < s.card) :\n ∃ x ∈ s, ∃ y ∈ s, x < y ∧ y < x + 6 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d3-t0009"}
+{"id": "combinatorial-identities-fibonacci-d3-t0010", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 3, "seed": 10, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFirst prove Cassini's identity: for every natural number \\(n\\), \\[F_{n+1}^2 - F_n F_{n+2} = (-1)^n,\\] computed in the integers, where \\(F\\) is the Fibonacci sequence. Then conclude that \\(F_{m+1}^2 - F_m F_{m+2}\\) is either \\(1\\) or \\(-1\\) when \\(m = 6n + 3\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cassini's identity for Fibonacci numbers. -/\ntheorem cassini (n : ℕ) :\n (Nat.fib (n + 1) : ℤ) ^ 2 - Nat.fib n * Nat.fib (n + 2) = (-1) ^ n := by\n sorry\n\n/-- Cassini's determinant is plus or minus one at the index given. -/\ntheorem cassini_pm_one (n : ℕ) :\n (Nat.fib (6 * n + 3 + 1) : ℤ) ^ 2 - Nat.fib (6 * n + 3) * Nat.fib (6 * n + 3 + 2) = 1 ∨ (Nat.fib (6 * n + 3 + 1) : ℤ) ^ 2 - Nat.fib (6 * n + 3) * Nat.fib (6 * n + 3 + 2) = -1 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d3-t0010"}
+{"id": "combinatorial-identities-linear_recurrence-d3-t0011", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 3, "seed": 11, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = 3\\), \\(u_1 = 12\\) and \\(u_{n+2} = 4\\,u_{n+1} - 4\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = (3 + 3 n) \\cdot 2^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => 3\n | 1 => 12\n | (n + 2) => 4 * u (n + 1) - 4 * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = (3 + 3 * (n : ℤ)) * 2 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d3-t0011"}
+{"id": "combinatorial-identities-binomial_sums-d1-t0012", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 1, "seed": 12, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\binom{n}{i}\\, 6^{i} = 7^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A weighted sum of binomial coefficients. -/\ntheorem binomial_sum (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), n.choose i * 6 ^ i = 7 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d1-t0012"}
+{"id": "combinatorial-identities-counting-d1-t0013", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 1, "seed": 13, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(s\\) be a finite set of integers with more than 5 elements. Prove that \\(s\\) contains two different integers \\(x \\ne y\\) that leave the same remainder on division by 5.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Pigeonhole principle for remainders. -/\ntheorem pigeonhole_mod (s : Finset ℤ) (h : 5 < s.card) :\n ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ x % 5 = y % 5 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d1-t0013"}
+{"id": "combinatorial-identities-fibonacci-d1-t0014", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 1, "seed": 14, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFor every natural number \\(n\\), with \\(F\\) the Fibonacci sequence (\\(F_0 = 0\\), \\(F_1 = 1\\), \\(F_{k+2} = F_k + F_{k+1}\\)), \\[\\sum_{i=0}^{n-1} F_{i+6} + F_{7} = F_{n+7}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A telescoping sum of Fibonacci numbers. -/\ntheorem fib_shifted_sum (n : ℕ) :\n ∑ i ∈ Finset.range n, Nat.fib (i + 6) + Nat.fib 7 = Nat.fib (n + 7) := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d1-t0014"}
+{"id": "combinatorial-identities-linear_recurrence-d1-t0015", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 1, "seed": 15, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = 4\\), \\(u_1 = 18\\) and \\(u_{n+2} = 8\\,u_{n+1} - 15\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = 1 \\cdot 3^{n} + 3 \\cdot 5^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => 4\n | 1 => 18\n | (n + 2) => 8 * u (n + 1) - 15 * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = 1 * 3 ^ n + 3 * 5 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d1-t0015"}
+{"id": "combinatorial-identities-binomial_sums-d2-t0016", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 2, "seed": 16, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\binom{i+6}{6} = \\binom{n+7}{7}.\\] (This is the hockey stick identity.)\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A hockey stick identity for binomial coefficients. -/\ntheorem hockey_stick (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (i + 6).choose 6 = (n + 7).choose 7 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d2-t0016"}
+{"id": "combinatorial-identities-counting-d2-t0017", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 2, "seed": 17, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(n\\) be a natural number. Prove that the set \\(\\{0, 1, \\dots, n-1\\}\\) has at most as many elements as the set of integers \\(y\\) with \\(0 \\le y < 3 n\\) and \\(y \\equiv 1 \\pmod{3}\\). (Construct an injection.)\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- An injection into a residue class gives a cardinality bound. -/\ntheorem card_le_residue_class (n : ℕ) :\n (Finset.range n).card ≤ ((Finset.range (3 * n)).filter (fun y => y % 3 = 1)).card := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d2-t0017"}
+{"id": "combinatorial-identities-fibonacci-d2-t0018", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 2, "seed": 18, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFor every natural number \\(n\\), with \\(F\\) the Fibonacci sequence, \\[\\sum_{i=0}^{n-1} F_{2i+6} + F_{5} = F_{2n+5}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A sum of every second Fibonacci number. -/\ntheorem fib_odd_sum (n : ℕ) :\n ∑ i ∈ Finset.range n, Nat.fib (2 * i + 6) + Nat.fib 5 = Nat.fib (2 * n + 5) := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d2-t0018"}
+{"id": "combinatorial-identities-linear_recurrence-d2-t0019", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 2, "seed": 19, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = 5\\), \\(u_1 = 22\\) and \\(u_{n+2} = 9\\,u_{n+1} - 20\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = 3 \\cdot 4^{n} + 2 \\cdot 5^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => 5\n | 1 => 22\n | (n + 2) => 9 * u (n + 1) - 20 * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = 3 * 4 ^ n + 2 * 5 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d2-t0019"}
+{"id": "combinatorial-identities-binomial_sums-d3-t0020", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 3, "seed": 20, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFirst prove \\[\\sum_{i=0}^{n} i \\binom{n}{i} = n \\cdot 2^{n-1},\\] where \\(n - 1\\) is truncated subtraction on the natural numbers. Then use it, and the value of \\(\\sum_{i=0}^{n} \\binom{n}{i}\\), to prove \\[\\sum_{i=0}^{n} (5i + 3) \\binom{n}{i} = 5 \\cdot n \\cdot 2^{n-1} + 3 \\cdot 2^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The sum of i times n choose i. -/\ntheorem sum_i_choose (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), i * n.choose i = n * 2 ^ (n - 1) := by\n sorry\n\n/-- A weighted binomial sum. -/\ntheorem weighted_sum (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (5 * i + 3) * n.choose i = 5 * (n * 2 ^ (n - 1)) + 3 * 2 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d3-t0020"}
+{"id": "combinatorial-identities-counting-d3-t0021", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 3, "seed": 21, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(s\\) be a set of natural numbers that are all less than \\(2 \\cdot 3 = 6\\), and suppose \\(s\\) has more than 3 elements. Prove that \\(s\\) contains two elements \\(x < y\\) with \\(y - x < 2\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Pigeonhole principle for blocks of consecutive numbers. -/\ntheorem close_pair (s : Finset ℕ) (hs : s ⊆ Finset.range (2 * 3)) (h : 3 < s.card) :\n ∃ x ∈ s, ∃ y ∈ s, x < y ∧ y < x + 2 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d3-t0021"}
+{"id": "combinatorial-identities-fibonacci-d3-t0022", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 3, "seed": 22, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFirst prove Cassini's identity: for every natural number \\(n\\), \\[F_{n+1}^2 - F_n F_{n+2} = (-1)^n,\\] computed in the integers, where \\(F\\) is the Fibonacci sequence. Then conclude that \\(F_{m+1}^2 - F_m F_{m+2}\\) is either \\(1\\) or \\(-1\\) when \\(m = 3n + 3\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cassini's identity for Fibonacci numbers. -/\ntheorem cassini (n : ℕ) :\n (Nat.fib (n + 1) : ℤ) ^ 2 - Nat.fib n * Nat.fib (n + 2) = (-1) ^ n := by\n sorry\n\n/-- Cassini's determinant is plus or minus one at the index given. -/\ntheorem cassini_pm_one (n : ℕ) :\n (Nat.fib (3 * n + 3 + 1) : ℤ) ^ 2 - Nat.fib (3 * n + 3) * Nat.fib (3 * n + 3 + 2) = 1 ∨ (Nat.fib (3 * n + 3 + 1) : ℤ) ^ 2 - Nat.fib (3 * n + 3) * Nat.fib (3 * n + 3 + 2) = -1 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d3-t0022"}
+{"id": "combinatorial-identities-linear_recurrence-d3-t0023", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 3, "seed": 23, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = -1\\), \\(u_1 = 0\\) and \\(u_{n+2} = -6\\,u_{n+1} - 9\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = (-1 + 1 n) \\cdot (-3)^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => (-1)\n | 1 => 0\n | (n + 2) => (-6) * u (n + 1) - 9 * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = ((-1) + 1 * (n : ℤ)) * (-3) ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d3-t0023"}
+{"id": "combinatorial-identities-binomial_sums-d1-t0024", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 1, "seed": 24, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\binom{n}{i}\\, 9^{i} = 10^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A weighted sum of binomial coefficients. -/\ntheorem binomial_sum (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), n.choose i * 9 ^ i = 10 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d1-t0024"}
+{"id": "combinatorial-identities-counting-d1-t0025", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 1, "seed": 25, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(s\\) be a finite set of integers with more than 5 elements. Prove that \\(s\\) contains two different integers \\(x \\ne y\\) that leave the same remainder on division by 5.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Pigeonhole principle for remainders. -/\ntheorem pigeonhole_mod (s : Finset ℤ) (h : 5 < s.card) :\n ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ x % 5 = y % 5 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d1-t0025"}
+{"id": "combinatorial-identities-fibonacci-d1-t0026", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 1, "seed": 26, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFor every natural number \\(n\\), with \\(F\\) the Fibonacci sequence (\\(F_0 = 0\\), \\(F_1 = 1\\), \\(F_{k+2} = F_k + F_{k+1}\\)), \\[\\sum_{i=0}^{n-1} F_{i+8} + F_{9} = F_{n+9}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A telescoping sum of Fibonacci numbers. -/\ntheorem fib_shifted_sum (n : ℕ) :\n ∑ i ∈ Finset.range n, Nat.fib (i + 8) + Nat.fib 9 = Nat.fib (n + 9) := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d1-t0026"}
+{"id": "combinatorial-identities-linear_recurrence-d1-t0027", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 1, "seed": 27, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = 5\\), \\(u_1 = 22\\) and \\(u_{n+2} = 7\\,u_{n+1} - 10\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = 4 \\cdot 5^{n} + 1 \\cdot 2^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => 5\n | 1 => 22\n | (n + 2) => 7 * u (n + 1) - 10 * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = 4 * 5 ^ n + 1 * 2 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d1-t0027"}
+{"id": "combinatorial-identities-binomial_sums-d2-t0028", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 2, "seed": 28, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFor every natural number \\(n\\), \\[2 \\cdot \\sum_{i=0}^{n} \\binom{i+7}{7} = 2 \\cdot \\binom{n+8}{8}.\\] (This is the hockey stick identity.)\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A hockey stick identity for binomial coefficients. -/\ntheorem hockey_stick (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), 2 * (i + 7).choose 7 = 2 * (n + 8).choose 8 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d2-t0028"}
+{"id": "combinatorial-identities-counting-d2-t0029", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 2, "seed": 29, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(n\\) be a natural number. Prove that the set \\(\\{0, 1, \\dots, n-1\\}\\) has at most as many elements as the set of integers \\(y\\) with \\(0 \\le y < 3 n\\) and \\(y \\equiv 2 \\pmod{3}\\). (Construct an injection.)\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- An injection into a residue class gives a cardinality bound. -/\ntheorem card_le_residue_class (n : ℕ) :\n (Finset.range n).card ≤ ((Finset.range (3 * n)).filter (fun y => y % 3 = 2)).card := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d2-t0029"}
+{"id": "combinatorial-identities-fibonacci-d2-t0030", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 2, "seed": 30, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFor every natural number \\(n\\), with \\(F\\) the Fibonacci sequence, \\[\\sum_{i=0}^{n-1} F_{2i+1} + F_{0} = F_{2n+0}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A sum of every second Fibonacci number. -/\ntheorem fib_odd_sum (n : ℕ) :\n ∑ i ∈ Finset.range n, Nat.fib (2 * i + 1) + Nat.fib 0 = Nat.fib (2 * n + 0) := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d2-t0030"}
+{"id": "combinatorial-identities-linear_recurrence-d2-t0031", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 2, "seed": 31, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = -4\\), \\(u_1 = -16\\) and \\(u_{n+2} = 8\\,u_{n+1} - 15\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = -2 \\cdot 5^{n} + -2 \\cdot 3^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => (-4)\n | 1 => (-16)\n | (n + 2) => 8 * u (n + 1) - 15 * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = (-2) * 5 ^ n + (-2) * 3 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d2-t0031"}
+{"id": "combinatorial-identities-binomial_sums-d3-t0032", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 3, "seed": 32, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFirst prove \\[\\sum_{i=0}^{n} i \\binom{n}{i} = n \\cdot 2^{n-1},\\] where \\(n - 1\\) is truncated subtraction on the natural numbers. Then use it, and the value of \\(\\sum_{i=0}^{n} \\binom{n}{i}\\), to prove \\[\\sum_{i=0}^{n} (5i + 7) \\binom{n}{i} = 5 \\cdot n \\cdot 2^{n-1} + 7 \\cdot 2^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The sum of i times n choose i. -/\ntheorem sum_i_choose (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), i * n.choose i = n * 2 ^ (n - 1) := by\n sorry\n\n/-- A weighted binomial sum. -/\ntheorem weighted_sum (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (5 * i + 7) * n.choose i = 5 * (n * 2 ^ (n - 1)) + 7 * 2 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d3-t0032"}
+{"id": "combinatorial-identities-counting-d3-t0033", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 3, "seed": 33, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(s\\) be a set of natural numbers that are all less than \\(7 \\cdot 7 = 49\\), and suppose \\(s\\) has more than 7 elements. Prove that \\(s\\) contains two elements \\(x < y\\) with \\(y - x < 7\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Pigeonhole principle for blocks of consecutive numbers. -/\ntheorem close_pair (s : Finset ℕ) (hs : s ⊆ Finset.range (7 * 7)) (h : 7 < s.card) :\n ∃ x ∈ s, ∃ y ∈ s, x < y ∧ y < x + 7 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d3-t0033"}
+{"id": "combinatorial-identities-fibonacci-d3-t0034", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 3, "seed": 34, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFirst prove Cassini's identity: for every natural number \\(n\\), \\[F_{n+1}^2 - F_n F_{n+2} = (-1)^n,\\] computed in the integers, where \\(F\\) is the Fibonacci sequence. Then conclude that \\(F_{m+1}^2 - F_m F_{m+2}\\) is either \\(1\\) or \\(-1\\) when \\(m = 5n + 7\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cassini's identity for Fibonacci numbers. -/\ntheorem cassini (n : ℕ) :\n (Nat.fib (n + 1) : ℤ) ^ 2 - Nat.fib n * Nat.fib (n + 2) = (-1) ^ n := by\n sorry\n\n/-- Cassini's determinant is plus or minus one at the index given. -/\ntheorem cassini_pm_one (n : ℕ) :\n (Nat.fib (5 * n + 7 + 1) : ℤ) ^ 2 - Nat.fib (5 * n + 7) * Nat.fib (5 * n + 7 + 2) = 1 ∨ (Nat.fib (5 * n + 7 + 1) : ℤ) ^ 2 - Nat.fib (5 * n + 7) * Nat.fib (5 * n + 7 + 2) = -1 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d3-t0034"}
+{"id": "combinatorial-identities-linear_recurrence-d3-t0035", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 3, "seed": 35, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = -3\\), \\(u_1 = 18\\) and \\(u_{n+2} = -6\\,u_{n+1} - 9\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = (-3 + -3 n) \\cdot (-3)^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => (-3)\n | 1 => 18\n | (n + 2) => (-6) * u (n + 1) - 9 * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = ((-3) + (-3) * (n : ℤ)) * (-3) ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d3-t0035"}
+{"id": "combinatorial-identities-binomial_sums-d1-t0036", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 1, "seed": 36, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\binom{n}{i}\\, 2^{i} = 3^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A weighted sum of binomial coefficients. -/\ntheorem binomial_sum (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), n.choose i * 2 ^ i = 3 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d1-t0036"}
+{"id": "combinatorial-identities-counting-d1-t0037", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 1, "seed": 37, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(s\\) be a finite set of integers with more than 3 elements. Prove that \\(s\\) contains two different integers \\(x \\ne y\\) that leave the same remainder on division by 3.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Pigeonhole principle for remainders. -/\ntheorem pigeonhole_mod (s : Finset ℤ) (h : 3 < s.card) :\n ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ x % 3 = y % 3 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d1-t0037"}
+{"id": "combinatorial-identities-fibonacci-d1-t0038", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 1, "seed": 38, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFor every natural number \\(n\\), with \\(F\\) the Fibonacci sequence (\\(F_0 = 0\\), \\(F_1 = 1\\), \\(F_{k+2} = F_k + F_{k+1}\\)), \\[\\sum_{i=0}^{n-1} F_{i+9} + F_{10} = F_{n+10}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A telescoping sum of Fibonacci numbers. -/\ntheorem fib_shifted_sum (n : ℕ) :\n ∑ i ∈ Finset.range n, Nat.fib (i + 9) + Nat.fib 10 = Nat.fib (n + 10) := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d1-t0038"}
+{"id": "combinatorial-identities-linear_recurrence-d1-t0039", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 1, "seed": 39, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = 2\\), \\(u_1 = 13\\) and \\(u_{n+2} = 7\\,u_{n+1} - 10\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = 3 \\cdot 5^{n} + -1 \\cdot 2^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => 2\n | 1 => 13\n | (n + 2) => 7 * u (n + 1) - 10 * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = 3 * 5 ^ n + (-1) * 2 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d1-t0039"}
+{"id": "combinatorial-identities-binomial_sums-d2-t0040", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 2, "seed": 40, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFor every natural number \\(n\\), \\[3 \\cdot \\sum_{i=0}^{n} \\binom{i+7}{7} = 3 \\cdot \\binom{n+8}{8}.\\] (This is the hockey stick identity.)\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A hockey stick identity for binomial coefficients. -/\ntheorem hockey_stick (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), 3 * (i + 7).choose 7 = 3 * (n + 8).choose 8 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d2-t0040"}
+{"id": "combinatorial-identities-counting-d2-t0041", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 2, "seed": 41, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(n\\) be a natural number. Prove that the set \\(\\{0, 1, \\dots, n-1\\}\\) has at most as many elements as the set of integers \\(y\\) with \\(0 \\le y < 4 n\\) and \\(y \\equiv 3 \\pmod{4}\\). (Construct an injection.)\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- An injection into a residue class gives a cardinality bound. -/\ntheorem card_le_residue_class (n : ℕ) :\n (Finset.range n).card ≤ ((Finset.range (4 * n)).filter (fun y => y % 4 = 3)).card := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d2-t0041"}
+{"id": "combinatorial-identities-fibonacci-d2-t0042", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 2, "seed": 42, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFor every natural number \\(n\\), with \\(F\\) the Fibonacci sequence, \\[\\sum_{i=0}^{n} 7\\,F_i^2 = 7\\,F_n F_{n+1}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A sum of squares of Fibonacci numbers. -/\ntheorem fib_square_sum (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), 7 * Nat.fib i ^ 2 = 7 * (Nat.fib n * Nat.fib (n + 1)) := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d2-t0042"}
+{"id": "combinatorial-identities-linear_recurrence-d2-t0043", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 2, "seed": 43, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = 4\\), \\(u_1 = -2\\) and \\(u_{n+2} = 2\\,u_{n+1} - -8\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = 1 \\cdot 4^{n} + 3 \\cdot (-2)^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => 4\n | 1 => (-2)\n | (n + 2) => 2 * u (n + 1) - (-8) * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = 1 * 4 ^ n + 3 * (-2) ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d2-t0043"}
+{"id": "combinatorial-identities-binomial_sums-d3-t0044", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 3, "seed": 44, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFirst prove \\[\\sum_{i=0}^{n} i \\binom{n}{i} = n \\cdot 2^{n-1},\\] where \\(n - 1\\) is truncated subtraction on the natural numbers. Then use it, and the value of \\(\\sum_{i=0}^{n} \\binom{n}{i}\\), to prove \\[\\sum_{i=0}^{n} (2i + 7) \\binom{n}{i} = 2 \\cdot n \\cdot 2^{n-1} + 7 \\cdot 2^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The sum of i times n choose i. -/\ntheorem sum_i_choose (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), i * n.choose i = n * 2 ^ (n - 1) := by\n sorry\n\n/-- A weighted binomial sum. -/\ntheorem weighted_sum (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (2 * i + 7) * n.choose i = 2 * (n * 2 ^ (n - 1)) + 7 * 2 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d3-t0044"}
+{"id": "combinatorial-identities-counting-d3-t0045", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 3, "seed": 45, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(s\\) be a set of natural numbers that are all less than \\(2 \\cdot 5 = 10\\), and suppose \\(s\\) has more than 5 elements. Prove that \\(s\\) contains two elements \\(x < y\\) with \\(y - x < 2\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Pigeonhole principle for blocks of consecutive numbers. -/\ntheorem close_pair (s : Finset ℕ) (hs : s ⊆ Finset.range (2 * 5)) (h : 5 < s.card) :\n ∃ x ∈ s, ∃ y ∈ s, x < y ∧ y < x + 2 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d3-t0045"}
+{"id": "combinatorial-identities-fibonacci-d3-t0046", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 3, "seed": 46, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFirst prove Cassini's identity: for every natural number \\(n\\), \\[F_{n+1}^2 - F_n F_{n+2} = (-1)^n,\\] computed in the integers, where \\(F\\) is the Fibonacci sequence. Then conclude that \\(F_{m+1}^2 - F_m F_{m+2}\\) is either \\(1\\) or \\(-1\\) when \\(m = 7n + 6\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cassini's identity for Fibonacci numbers. -/\ntheorem cassini (n : ℕ) :\n (Nat.fib (n + 1) : ℤ) ^ 2 - Nat.fib n * Nat.fib (n + 2) = (-1) ^ n := by\n sorry\n\n/-- Cassini's determinant is plus or minus one at the index given. -/\ntheorem cassini_pm_one (n : ℕ) :\n (Nat.fib (7 * n + 6 + 1) : ℤ) ^ 2 - Nat.fib (7 * n + 6) * Nat.fib (7 * n + 6 + 2) = 1 ∨ (Nat.fib (7 * n + 6 + 1) : ℤ) ^ 2 - Nat.fib (7 * n + 6) * Nat.fib (7 * n + 6 + 2) = -1 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d3-t0046"}
+{"id": "combinatorial-identities-linear_recurrence-d3-t0047", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 3, "seed": 47, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = -3\\), \\(u_1 = 0\\) and \\(u_{n+2} = -4\\,u_{n+1} - 4\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = (-3 + 3 n) \\cdot (-2)^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => (-3)\n | 1 => 0\n | (n + 2) => (-4) * u (n + 1) - 4 * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = ((-3) + 3 * (n : ℤ)) * (-2) ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d3-t0047"}
+{"id": "combinatorial-identities-binomial_sums-d1-t0048", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 1, "seed": 48, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\binom{n}{i}\\, 4^{i} = 5^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A weighted sum of binomial coefficients. -/\ntheorem binomial_sum (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), n.choose i * 4 ^ i = 5 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d1-t0048"}
+{"id": "combinatorial-identities-counting-d1-t0049", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 1, "seed": 49, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(s\\) be a finite set of integers with more than 5 elements. Prove that \\(s\\) contains two different integers \\(x \\ne y\\) that leave the same remainder on division by 5.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Pigeonhole principle for remainders. -/\ntheorem pigeonhole_mod (s : Finset ℤ) (h : 5 < s.card) :\n ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ x % 5 = y % 5 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d1-t0049"}
+{"id": "combinatorial-identities-fibonacci-d1-t0050", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 1, "seed": 50, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFor every natural number \\(n\\), with \\(F\\) the Fibonacci sequence (\\(F_0 = 0\\), \\(F_1 = 1\\), \\(F_{k+2} = F_k + F_{k+1}\\)), \\[\\sum_{i=0}^{n-1} F_{i+0} + F_{1} = F_{n+1}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A telescoping sum of Fibonacci numbers. -/\ntheorem fib_shifted_sum (n : ℕ) :\n ∑ i ∈ Finset.range n, Nat.fib (i + 0) + Nat.fib 1 = Nat.fib (n + 1) := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d1-t0050"}
+{"id": "combinatorial-identities-linear_recurrence-d1-t0051", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 1, "seed": 51, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = -4\\), \\(u_1 = -18\\) and \\(u_{n+2} = 8\\,u_{n+1} - 15\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = -1 \\cdot 3^{n} + -3 \\cdot 5^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => (-4)\n | 1 => (-18)\n | (n + 2) => 8 * u (n + 1) - 15 * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = (-1) * 3 ^ n + (-3) * 5 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d1-t0051"}
+{"id": "combinatorial-identities-binomial_sums-d2-t0052", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 2, "seed": 52, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFor every natural number \\(n\\), \\[3 \\cdot \\sum_{i=0}^{n} \\binom{i+3}{3} = 3 \\cdot \\binom{n+4}{4}.\\] (This is the hockey stick identity.)\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A hockey stick identity for binomial coefficients. -/\ntheorem hockey_stick (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), 3 * (i + 3).choose 3 = 3 * (n + 4).choose 4 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d2-t0052"}
+{"id": "combinatorial-identities-counting-d2-t0053", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 2, "seed": 53, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(n\\) be a natural number. Prove that the set \\(\\{0, 1, \\dots, n-1\\}\\) has at most as many elements as the set of integers \\(y\\) with \\(0 \\le y < 3 n\\) and \\(y \\equiv 2 \\pmod{3}\\). (Construct an injection.)\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- An injection into a residue class gives a cardinality bound. -/\ntheorem card_le_residue_class (n : ℕ) :\n (Finset.range n).card ≤ ((Finset.range (3 * n)).filter (fun y => y % 3 = 2)).card := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d2-t0053"}
+{"id": "combinatorial-identities-fibonacci-d2-t0054", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 2, "seed": 54, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFor every natural number \\(n\\), with \\(F\\) the Fibonacci sequence, \\[\\sum_{i=0}^{n} 2\\,F_i^2 = 2\\,F_n F_{n+1}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A sum of squares of Fibonacci numbers. -/\ntheorem fib_square_sum (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), 2 * Nat.fib i ^ 2 = 2 * (Nat.fib n * Nat.fib (n + 1)) := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d2-t0054"}
+{"id": "combinatorial-identities-linear_recurrence-d2-t0055", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 2, "seed": 55, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = 6\\), \\(u_1 = 6\\) and \\(u_{n+2} = 0\\,u_{n+1} - -9\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = 4 \\cdot 3^{n} + 2 \\cdot (-3)^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => 6\n | 1 => 6\n | (n + 2) => 0 * u (n + 1) - (-9) * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = 4 * 3 ^ n + 2 * (-3) ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d2-t0055"}
+{"id": "combinatorial-identities-binomial_sums-d3-t0056", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 3, "seed": 56, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFirst prove \\[\\sum_{i=0}^{n} i \\binom{n}{i} = n \\cdot 2^{n-1},\\] where \\(n - 1\\) is truncated subtraction on the natural numbers. Then use it, and the value of \\(\\sum_{i=0}^{n} \\binom{n}{i}\\), to prove \\[\\sum_{i=0}^{n} (1i + 7) \\binom{n}{i} = 1 \\cdot n \\cdot 2^{n-1} + 7 \\cdot 2^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The sum of i times n choose i. -/\ntheorem sum_i_choose (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), i * n.choose i = n * 2 ^ (n - 1) := by\n sorry\n\n/-- A weighted binomial sum. -/\ntheorem weighted_sum (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (1 * i + 7) * n.choose i = 1 * (n * 2 ^ (n - 1)) + 7 * 2 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d3-t0056"}
+{"id": "combinatorial-identities-counting-d3-t0057", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 3, "seed": 57, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(s\\) be a set of natural numbers that are all less than \\(7 \\cdot 5 = 35\\), and suppose \\(s\\) has more than 5 elements. Prove that \\(s\\) contains two elements \\(x < y\\) with \\(y - x < 7\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Pigeonhole principle for blocks of consecutive numbers. -/\ntheorem close_pair (s : Finset ℕ) (hs : s ⊆ Finset.range (7 * 5)) (h : 5 < s.card) :\n ∃ x ∈ s, ∃ y ∈ s, x < y ∧ y < x + 7 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d3-t0057"}
+{"id": "combinatorial-identities-fibonacci-d3-t0058", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 3, "seed": 58, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFirst prove Cassini's identity: for every natural number \\(n\\), \\[F_{n+1}^2 - F_n F_{n+2} = (-1)^n,\\] computed in the integers, where \\(F\\) is the Fibonacci sequence. Then conclude that \\(F_{m+1}^2 - F_m F_{m+2}\\) is either \\(1\\) or \\(-1\\) when \\(m = 2n + 1\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cassini's identity for Fibonacci numbers. -/\ntheorem cassini (n : ℕ) :\n (Nat.fib (n + 1) : ℤ) ^ 2 - Nat.fib n * Nat.fib (n + 2) = (-1) ^ n := by\n sorry\n\n/-- Cassini's determinant is plus or minus one at the index given. -/\ntheorem cassini_pm_one (n : ℕ) :\n (Nat.fib (2 * n + 1 + 1) : ℤ) ^ 2 - Nat.fib (2 * n + 1) * Nat.fib (2 * n + 1 + 2) = 1 ∨ (Nat.fib (2 * n + 1 + 1) : ℤ) ^ 2 - Nat.fib (2 * n + 1) * Nat.fib (2 * n + 1 + 2) = -1 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d3-t0058"}
+{"id": "combinatorial-identities-linear_recurrence-d3-t0059", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 3, "seed": 59, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = 1\\), \\(u_1 = 6\\) and \\(u_{n+2} = 4\\,u_{n+1} - 4\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = (1 + 2 n) \\cdot 2^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => 1\n | 1 => 6\n | (n + 2) => 4 * u (n + 1) - 4 * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = (1 + 2 * (n : ℤ)) * 2 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d3-t0059"}
+{"id": "combinatorial-identities-binomial_sums-d1-t0060", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 1, "seed": 60, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\binom{n}{i}\\, 7^{i} = 8^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A weighted sum of binomial coefficients. -/\ntheorem binomial_sum (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), n.choose i * 7 ^ i = 8 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d1-t0060"}
+{"id": "combinatorial-identities-counting-d1-t0061", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 1, "seed": 61, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(s\\) be a finite set of integers with more than 4 elements. Prove that \\(s\\) contains two different integers \\(x \\ne y\\) that leave the same remainder on division by 4.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Pigeonhole principle for remainders. -/\ntheorem pigeonhole_mod (s : Finset ℤ) (h : 4 < s.card) :\n ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ x % 4 = y % 4 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d1-t0061"}
+{"id": "combinatorial-identities-fibonacci-d1-t0062", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 1, "seed": 62, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFor every natural number \\(n\\), with \\(F\\) the Fibonacci sequence (\\(F_0 = 0\\), \\(F_1 = 1\\), \\(F_{k+2} = F_k + F_{k+1}\\)), \\[\\sum_{i=0}^{n-1} F_{i+11} + F_{12} = F_{n+12}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A telescoping sum of Fibonacci numbers. -/\ntheorem fib_shifted_sum (n : ℕ) :\n ∑ i ∈ Finset.range n, Nat.fib (i + 11) + Nat.fib 12 = Nat.fib (n + 12) := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d1-t0062"}
+{"id": "combinatorial-identities-linear_recurrence-d1-t0063", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 1, "seed": 63, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = -2\\), \\(u_1 = -4\\) and \\(u_{n+2} = 8\\,u_{n+1} - 15\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = 1 \\cdot 5^{n} + -3 \\cdot 3^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => (-2)\n | 1 => (-4)\n | (n + 2) => 8 * u (n + 1) - 15 * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = 1 * 5 ^ n + (-3) * 3 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d1-t0063"}
+{"id": "combinatorial-identities-binomial_sums-d2-t0064", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 2, "seed": 64, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFor every natural number \\(n\\), \\[5 \\cdot \\sum_{i=0}^{n} \\binom{i+3}{3} = 5 \\cdot \\binom{n+4}{4}.\\] (This is the hockey stick identity.)\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A hockey stick identity for binomial coefficients. -/\ntheorem hockey_stick (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), 5 * (i + 3).choose 3 = 5 * (n + 4).choose 4 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d2-t0064"}
+{"id": "combinatorial-identities-counting-d2-t0065", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 2, "seed": 65, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(n\\) be a natural number. Prove that the set \\(\\{0, 1, \\dots, n-1\\}\\) has at most as many elements as the set of integers \\(y\\) with \\(0 \\le y < 6 n\\) and \\(y \\equiv 0 \\pmod{6}\\). (Construct an injection.)\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- An injection into a residue class gives a cardinality bound. -/\ntheorem card_le_residue_class (n : ℕ) :\n (Finset.range n).card ≤ ((Finset.range (6 * n)).filter (fun y => y % 6 = 0)).card := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d2-t0065"}
+{"id": "combinatorial-identities-fibonacci-d2-t0066", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 2, "seed": 66, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFor every natural number \\(n\\), with \\(F\\) the Fibonacci sequence, \\[\\sum_{i=0}^{n} 1\\,F_i^2 = 1\\,F_n F_{n+1}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A sum of squares of Fibonacci numbers. -/\ntheorem fib_square_sum (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), 1 * Nat.fib i ^ 2 = 1 * (Nat.fib n * Nat.fib (n + 1)) := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d2-t0066"}
+{"id": "combinatorial-identities-linear_recurrence-d2-t0067", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 2, "seed": 67, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = 1\\), \\(u_1 = -2\\) and \\(u_{n+2} = 5\\,u_{n+1} - 4\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = -1 \\cdot 4^{n} + 2 \\cdot 1^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => 1\n | 1 => (-2)\n | (n + 2) => 5 * u (n + 1) - 4 * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = (-1) * 4 ^ n + 2 * 1 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d2-t0067"}
+{"id": "combinatorial-identities-binomial_sums-d3-t0068", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 3, "seed": 68, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFirst prove \\[\\sum_{i=0}^{n} i \\binom{n}{i} = n \\cdot 2^{n-1},\\] where \\(n - 1\\) is truncated subtraction on the natural numbers. Then use it, and the value of \\(\\sum_{i=0}^{n} \\binom{n}{i}\\), to prove \\[\\sum_{i=0}^{n} (1i + 1) \\binom{n}{i} = 1 \\cdot n \\cdot 2^{n-1} + 1 \\cdot 2^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The sum of i times n choose i. -/\ntheorem sum_i_choose (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), i * n.choose i = n * 2 ^ (n - 1) := by\n sorry\n\n/-- A weighted binomial sum. -/\ntheorem weighted_sum (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (1 * i + 1) * n.choose i = 1 * (n * 2 ^ (n - 1)) + 1 * 2 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d3-t0068"}
+{"id": "combinatorial-identities-counting-d3-t0069", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 3, "seed": 69, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(s\\) be a set of natural numbers that are all less than \\(6 \\cdot 2 = 12\\), and suppose \\(s\\) has more than 2 elements. Prove that \\(s\\) contains two elements \\(x < y\\) with \\(y - x < 6\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Pigeonhole principle for blocks of consecutive numbers. -/\ntheorem close_pair (s : Finset ℕ) (hs : s ⊆ Finset.range (6 * 2)) (h : 2 < s.card) :\n ∃ x ∈ s, ∃ y ∈ s, x < y ∧ y < x + 6 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d3-t0069"}
+{"id": "combinatorial-identities-fibonacci-d3-t0070", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 3, "seed": 70, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFirst prove Cassini's identity: for every natural number \\(n\\), \\[F_{n+1}^2 - F_n F_{n+2} = (-1)^n,\\] computed in the integers, where \\(F\\) is the Fibonacci sequence. Then conclude that \\(F_{m+1}^2 - F_m F_{m+2}\\) is either \\(1\\) or \\(-1\\) when \\(m = 5n + 5\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cassini's identity for Fibonacci numbers. -/\ntheorem cassini (n : ℕ) :\n (Nat.fib (n + 1) : ℤ) ^ 2 - Nat.fib n * Nat.fib (n + 2) = (-1) ^ n := by\n sorry\n\n/-- Cassini's determinant is plus or minus one at the index given. -/\ntheorem cassini_pm_one (n : ℕ) :\n (Nat.fib (5 * n + 5 + 1) : ℤ) ^ 2 - Nat.fib (5 * n + 5) * Nat.fib (5 * n + 5 + 2) = 1 ∨ (Nat.fib (5 * n + 5 + 1) : ℤ) ^ 2 - Nat.fib (5 * n + 5) * Nat.fib (5 * n + 5 + 2) = -1 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d3-t0070"}
+{"id": "combinatorial-identities-linear_recurrence-d3-t0071", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 3, "seed": 71, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = 1\\), \\(u_1 = 16\\) and \\(u_{n+2} = 8\\,u_{n+1} - 16\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = (1 + 3 n) \\cdot 4^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => 1\n | 1 => 16\n | (n + 2) => 8 * u (n + 1) - 16 * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = (1 + 3 * (n : ℤ)) * 4 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d3-t0071"}
+{"id": "combinatorial-identities-binomial_sums-d1-t0072", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 1, "seed": 72, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\binom{n}{i}\\, 2^{i} = 3^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A weighted sum of binomial coefficients. -/\ntheorem binomial_sum (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), n.choose i * 2 ^ i = 3 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d1-t0072"}
+{"id": "combinatorial-identities-counting-d1-t0073", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 1, "seed": 73, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(s\\) be a finite set of integers with more than 5 elements. Prove that \\(s\\) contains two different integers \\(x \\ne y\\) that leave the same remainder on division by 5.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Pigeonhole principle for remainders. -/\ntheorem pigeonhole_mod (s : Finset ℤ) (h : 5 < s.card) :\n ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ x % 5 = y % 5 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d1-t0073"}
+{"id": "combinatorial-identities-fibonacci-d1-t0074", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 1, "seed": 74, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFor every natural number \\(n\\), with \\(F\\) the Fibonacci sequence (\\(F_0 = 0\\), \\(F_1 = 1\\), \\(F_{k+2} = F_k + F_{k+1}\\)), \\[\\sum_{i=0}^{n-1} F_{i+13} + F_{14} = F_{n+14}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A telescoping sum of Fibonacci numbers. -/\ntheorem fib_shifted_sum (n : ℕ) :\n ∑ i ∈ Finset.range n, Nat.fib (i + 13) + Nat.fib 14 = Nat.fib (n + 14) := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d1-t0074"}
+{"id": "combinatorial-identities-linear_recurrence-d1-t0075", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 1, "seed": 75, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = 5\\), \\(u_1 = 17\\) and \\(u_{n+2} = 6\\,u_{n+1} - 5\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = 3 \\cdot 5^{n} + 2 \\cdot 1^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => 5\n | 1 => 17\n | (n + 2) => 6 * u (n + 1) - 5 * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = 3 * 5 ^ n + 2 * 1 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d1-t0075"}
+{"id": "combinatorial-identities-binomial_sums-d2-t0076", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 2, "seed": 76, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\binom{i+5}{5} = \\binom{n+6}{6}.\\] (This is the hockey stick identity.)\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A hockey stick identity for binomial coefficients. -/\ntheorem hockey_stick (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (i + 5).choose 5 = (n + 6).choose 6 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d2-t0076"}
+{"id": "combinatorial-identities-counting-d2-t0077", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 2, "seed": 77, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(n\\) be a natural number. Prove that the set \\(\\{0, 1, \\dots, n-1\\}\\) has at most as many elements as the set of integers \\(y\\) with \\(0 \\le y < 5 n\\) and \\(y \\equiv 0 \\pmod{5}\\). (Construct an injection.)\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- An injection into a residue class gives a cardinality bound. -/\ntheorem card_le_residue_class (n : ℕ) :\n (Finset.range n).card ≤ ((Finset.range (5 * n)).filter (fun y => y % 5 = 0)).card := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d2-t0077"}
+{"id": "combinatorial-identities-fibonacci-d2-t0078", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 2, "seed": 78, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFor every natural number \\(n\\), with \\(F\\) the Fibonacci sequence, \\[\\sum_{i=0}^{n} 1\\,F_i^2 = 1\\,F_n F_{n+1}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A sum of squares of Fibonacci numbers. -/\ntheorem fib_square_sum (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), 1 * Nat.fib i ^ 2 = 1 * (Nat.fib n * Nat.fib (n + 1)) := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d2-t0078"}
+{"id": "combinatorial-identities-linear_recurrence-d2-t0079", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 2, "seed": 79, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = 6\\), \\(u_1 = 0\\) and \\(u_{n+2} = 0\\,u_{n+1} - -9\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = 3 \\cdot (-3)^{n} + 3 \\cdot 3^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => 6\n | 1 => 0\n | (n + 2) => 0 * u (n + 1) - (-9) * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = 3 * (-3) ^ n + 3 * 3 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d2-t0079"}
+{"id": "combinatorial-identities-binomial_sums-d3-t0080", "env": "combinatorial-identities", "msc": "05", "family": "binomial_sums", "difficulty": 3, "seed": 80, "kind": "prove", "instruction": "# Prove an identity for binomial coefficients\n\nProve the following.\n\nFirst prove \\[\\sum_{i=0}^{n} i \\binom{n}{i} = n \\cdot 2^{n-1},\\] where \\(n - 1\\) is truncated subtraction on the natural numbers. Then use it, and the value of \\(\\sum_{i=0}^{n} \\binom{n}{i}\\), to prove \\[\\sum_{i=0}^{n} (1i + 6) \\binom{n}{i} = 1 \\cdot n \\cdot 2^{n-1} + 6 \\cdot 2^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The sum of i times n choose i. -/\ntheorem sum_i_choose (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), i * n.choose i = n * 2 ^ (n - 1) := by\n sorry\n\n/-- A weighted binomial sum. -/\ntheorem weighted_sum (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (1 * i + 6) * n.choose i = 1 * (n * 2 ^ (n - 1)) + 6 * 2 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-binomial_sums-d3-t0080"}
+{"id": "combinatorial-identities-counting-d3-t0081", "env": "combinatorial-identities", "msc": "05", "family": "counting", "difficulty": 3, "seed": 81, "kind": "prove", "instruction": "# Prove a counting statement\n\nProve the following.\n\nLet \\(s\\) be a set of natural numbers that are all less than \\(5 \\cdot 7 = 35\\), and suppose \\(s\\) has more than 7 elements. Prove that \\(s\\) contains two elements \\(x < y\\) with \\(y - x < 5\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Pigeonhole principle for blocks of consecutive numbers. -/\ntheorem close_pair (s : Finset ℕ) (hs : s ⊆ Finset.range (5 * 7)) (h : 7 < s.card) :\n ∃ x ∈ s, ∃ y ∈ s, x < y ∧ y < x + 5 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-counting-d3-t0081"}
+{"id": "combinatorial-identities-fibonacci-d3-t0082", "env": "combinatorial-identities", "msc": "05", "family": "fibonacci", "difficulty": 3, "seed": 82, "kind": "prove", "instruction": "# Prove an identity for Fibonacci numbers\n\nProve the following.\n\nFirst prove Cassini's identity: for every natural number \\(n\\), \\[F_{n+1}^2 - F_n F_{n+2} = (-1)^n,\\] computed in the integers, where \\(F\\) is the Fibonacci sequence. Then conclude that \\(F_{m+1}^2 - F_m F_{m+2}\\) is either \\(1\\) or \\(-1\\) when \\(m = n + 3\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cassini's identity for Fibonacci numbers. -/\ntheorem cassini (n : ℕ) :\n (Nat.fib (n + 1) : ℤ) ^ 2 - Nat.fib n * Nat.fib (n + 2) = (-1) ^ n := by\n sorry\n\n/-- Cassini's determinant is plus or minus one at the index given. -/\ntheorem cassini_pm_one (n : ℕ) :\n (Nat.fib (n + 3 + 1) : ℤ) ^ 2 - Nat.fib (n + 3) * Nat.fib (n + 3 + 2) = 1 ∨ (Nat.fib (n + 3 + 1) : ℤ) ^ 2 - Nat.fib (n + 3) * Nat.fib (n + 3 + 2) = -1 := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-fibonacci-d3-t0082"}
+{"id": "combinatorial-identities-linear_recurrence-d3-t0083", "env": "combinatorial-identities", "msc": "05", "family": "linear_recurrence", "difficulty": 3, "seed": 83, "kind": "prove", "instruction": "# Find the closed form of a recurrence\n\nProve the following.\n\nDefine a sequence of integers by \\(u_0 = 1\\), \\(u_1 = 8\\) and \\(u_{n+2} = 4\\,u_{n+1} - 4\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = (1 + 3 n) \\cdot 2^{n}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\ndef u : ℕ → ℤ\n | 0 => 1\n | 1 => 8\n | (n + 2) => 4 * u (n + 1) - 4 * u n\n\n/-- A closed form for the sequence defined by the recurrence. -/\ntheorem seq_closed_form (n : ℕ) :\n u n = (1 + 3 * (n : ℤ)) * 2 ^ n := by\n sorry\n", "path": "tasks/combinatorial-identities/combinatorial-identities-linear_recurrence-d3-t0083"}
diff --git a/data/definitions/eval.jsonl b/data/definitions/eval.jsonl
new file mode 100644
index 0000000000000000000000000000000000000000..1a3c53bee565012f531ce3bb3a652f73bf74e2c4
--- /dev/null
+++ b/data/definitions/eval.jsonl
@@ -0,0 +1,24 @@
+{"id": "definitions-count-d1-e0000", "env": "definitions", "msc": "11", "family": "count", "difficulty": 1, "seed": 10000, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of integers \\(k\\) with \\(1 \\le k \\le n\\) such that the decimal digits of \\(k\\) read the same forwards and backwards.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 3\\)\n- \\(f(10) = 9\\)\n- \\(f(17) = 10\\)\n- \\(f(24) = 11\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-count-d1-e0000"}
+{"id": "definitions-divisors-d1-e0001", "env": "definitions", "msc": "11", "family": "divisors", "difficulty": 1, "seed": 10001, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of positive divisors \\(d\\) of \\(n\\) such that the decimal digits of \\(d\\) read the same forwards and backwards. Take \\(f(0) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 2\\)\n- \\(f(10) = 3\\)\n- \\(f(17) = 1\\)\n- \\(f(24) = 6\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-divisors-d1-e0001"}
+{"id": "definitions-extremum-d1-e0002", "env": "definitions", "msc": "11", "family": "extremum", "difficulty": 1, "seed": 10002, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the largest integer \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) leaves remainder 1 on division by 3. If there is no such \\(k\\), then \\(f(n) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 1\\)\n- \\(f(10) = 10\\)\n- \\(f(17) = 16\\)\n- \\(f(24) = 22\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-extremum-d1-e0002"}
+{"id": "definitions-pairs-d1-e0003", "env": "definitions", "msc": "11", "family": "pairs", "difficulty": 1, "seed": 10003, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of ordered pairs \\((a, b)\\) of integers with \\(1 \\le a \\le n\\) and \\(1 \\le b \\le n\\) such that \\(a + b\\) is divisible by 5.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 2\\)\n- \\(f(10) = 20\\)\n- \\(f(17) = 57\\)\n- \\(f(24) = 116\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-pairs-d1-e0003"}
+{"id": "definitions-sequence-d1-e0004", "env": "definitions", "msc": "11", "family": "sequence", "difficulty": 1, "seed": 10004, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\nLet \\(a(0) = 3\\), \\(a(1) = 2\\) and, for \\(n \\ge 0\\), let \\(a(n+2)\\) be the remainder of \\(2\\,a(n+1) + \\,a(n)\\) on division by 11. Then \\(f(n) = a(n)\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 5\\)\n- \\(f(10) = 0\\)\n- \\(f(17) = 5\\)\n- \\(f(24) = 3\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sequence-d1-e0004"}
+{"id": "definitions-sum-d1-e0005", "env": "definitions", "msc": "11", "family": "sum", "difficulty": 1, "seed": 10005, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of \\(k\\) over all integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) leaves remainder 2 on division by 3. An empty sum is 0.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 2\\)\n- \\(f(10) = 15\\)\n- \\(f(17) = 57\\)\n- \\(f(24) = 100\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sum-d1-e0005"}
+{"id": "definitions-count-d2-e0006", "env": "definitions", "msc": "11", "family": "count", "difficulty": 2, "seed": 10006, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of integers \\(k\\) with \\(1 \\le k \\le n\\) such that the decimal digits of \\(k\\) read the same forwards and backwards but it is not the case that \\(k\\) leaves remainder 1 on division by 7.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 2\\)\n- \\(f(10) = 7\\)\n- \\(f(17) = 8\\)\n- \\(f(24) = 8\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-count-d2-e0006"}
+{"id": "definitions-divisors-d2-e0007", "env": "definitions", "msc": "11", "family": "divisors", "difficulty": 2, "seed": 10007, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of \\(d^2\\) over all positive divisors \\(d\\) of \\(n\\) such that the decimal digits of \\(d\\) read the same forwards and backwards. An empty sum is 0, and \\(f(0) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 10\\)\n- \\(f(10) = 30\\)\n- \\(f(17) = 1\\)\n- \\(f(24) = 130\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-divisors-d2-e0007"}
+{"id": "definitions-extremum-d2-e0008", "env": "definitions", "msc": "11", "family": "extremum", "difficulty": 2, "seed": 10008, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the largest integer \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is squarefree (no square larger than 1 divides it) or \\(k\\) is coprime to 12 (or both). If there is no such \\(k\\), then \\(f(n) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 3\\)\n- \\(f(10) = 10\\)\n- \\(f(17) = 17\\)\n- \\(f(24) = 23\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-extremum-d2-e0008"}
+{"id": "definitions-pairs-d2-e0009", "env": "definitions", "msc": "11", "family": "pairs", "difficulty": 2, "seed": 10009, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of ordered pairs \\((a, b)\\) of integers with \\(1 \\le a \\le n\\) and \\(1 \\le b \\le n\\) such that \\(a\\) divides \\(b\\) and \\(a < b\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 2\\)\n- \\(f(10) = 17\\)\n- \\(f(17) = 35\\)\n- \\(f(24) = 60\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-pairs-d2-e0009"}
+{"id": "definitions-sequence-d2-e0010", "env": "definitions", "msc": "11", "family": "sequence", "difficulty": 2, "seed": 10010, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\nLet \\(a(0) = 4\\), \\(a(1) = 2\\) and, for \\(n \\ge 0\\), let \\(a(n+2)\\) be the remainder of \\(3\\,a(n+1) + 4\\,a(n) + 3\\) on division by 17. Then \\(f(n) = a(0) + a(1) + \\dots + a(n)\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 15\\)\n- \\(f(10) = 44\\)\n- \\(f(17) = 66\\)\n- \\(f(24) = 94\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sequence-d2-e0010"}
+{"id": "definitions-sum-d2-e0011", "env": "definitions", "msc": "11", "family": "sum", "difficulty": 2, "seed": 10011, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of the values \\(\\tau(k)\\), where \\(\\tau(m)\\) is the number of positive divisors of \\(m\\), over all integers \\(k\\) with \\(1 \\le k \\le n\\) such that the sum of the decimal digits of \\(k\\) leaves remainder 0 on division by 3. An empty sum is 0.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 2\\)\n- \\(f(10) = 9\\)\n- \\(f(17) = 19\\)\n- \\(f(24) = 37\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sum-d2-e0011"}
+{"id": "definitions-count-d3-e0012", "env": "definitions", "msc": "11", "family": "count", "difficulty": 3, "seed": 10012, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is divisible by 5 or \\(k\\) is squarefree (no square larger than 1 divides it) (or both).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 3\\)\n- \\(f(10) = 7\\)\n- \\(f(17) = 12\\)\n- \\(f(24) = 17\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-count-d3-e0012"}
+{"id": "definitions-divisors-d3-e0013", "env": "definitions", "msc": "11", "family": "divisors", "difficulty": 3, "seed": 10013, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of \\(d^2\\) over all positive divisors \\(d\\) of \\(n\\) such that \\(d\\) is divisible by 2 and \\(d\\) is coprime to 15. An empty sum is 0, and \\(f(0) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 0\\)\n- \\(f(10) = 4\\)\n- \\(f(17) = 0\\)\n- \\(f(24) = 84\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-divisors-d3-e0013"}
+{"id": "definitions-extremum-d3-e0014", "env": "definitions", "msc": "11", "family": "extremum", "difficulty": 3, "seed": 10014, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the largest integer \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is squarefree (no square larger than 1 divides it) but it is not the case that the sum of the decimal digits of \\(k\\) leaves remainder 0 on division by 5. If there is no such \\(k\\), then \\(f(n) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 3\\)\n- \\(f(10) = 10\\)\n- \\(f(17) = 17\\)\n- \\(f(24) = 22\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-extremum-d3-e0014"}
+{"id": "definitions-pairs-d3-e0015", "env": "definitions", "msc": "11", "family": "pairs", "difficulty": 3, "seed": 10015, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of ordered pairs \\((a, b)\\) of integers with \\(1 \\le a \\le n\\) and \\(1 \\le b \\le n\\) such that \\(a + b\\) is prime, \\(a \\cdot b \\le n\\) and \\(a \\le b\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 2\\)\n- \\(f(10) = 7\\)\n- \\(f(17) = 10\\)\n- \\(f(24) = 15\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-pairs-d3-e0015"}
+{"id": "definitions-sequence-d3-e0016", "env": "definitions", "msc": "11", "family": "sequence", "difficulty": 3, "seed": 10016, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\nLet \\(a(0) = 4\\), \\(a(1) = 3\\) and, for \\(n \\ge 0\\), let \\(a(n+2)\\) be the remainder of \\(3\\,a(n+1) + 4\\,a(n)\\) on division by 13. Then \\(f(n)\\) is the number of indices \\(i\\) with \\(0 \\le i < n\\) such that \\(a(i) < a(i+1)\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 1\\)\n- \\(f(10) = 5\\)\n- \\(f(17) = 8\\)\n- \\(f(24) = 12\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sequence-d3-e0016"}
+{"id": "definitions-sum-d3-e0017", "env": "definitions", "msc": "11", "family": "sum", "difficulty": 3, "seed": 10017, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of the digit sums \\(s(k)\\), where \\(s(m)\\) is the sum of the decimal digits of \\(m\\), over all integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is prime but it is not the case that \\(k\\) is divisible by 7. An empty sum is 0.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 5\\)\n- \\(f(10) = 10\\)\n- \\(f(17) = 24\\)\n- \\(f(24) = 39\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sum-d3-e0017"}
+{"id": "definitions-count-d1-e0018", "env": "definitions", "msc": "11", "family": "count", "difficulty": 1, "seed": 10018, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is a perfect square.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 1\\)\n- \\(f(10) = 3\\)\n- \\(f(17) = 4\\)\n- \\(f(24) = 4\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-count-d1-e0018"}
+{"id": "definitions-divisors-d1-e0019", "env": "definitions", "msc": "11", "family": "divisors", "difficulty": 1, "seed": 10019, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of positive divisors \\(d\\) of \\(n\\) such that \\(d\\) is divisible by 3. Take \\(f(0) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 1\\)\n- \\(f(10) = 0\\)\n- \\(f(17) = 0\\)\n- \\(f(24) = 4\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-divisors-d1-e0019"}
+{"id": "definitions-extremum-d1-e0020", "env": "definitions", "msc": "11", "family": "extremum", "difficulty": 1, "seed": 10020, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the largest integer \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is prime. If there is no such \\(k\\), then \\(f(n) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 3\\)\n- \\(f(10) = 7\\)\n- \\(f(17) = 17\\)\n- \\(f(24) = 23\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-extremum-d1-e0020"}
+{"id": "definitions-pairs-d1-e0021", "env": "definitions", "msc": "11", "family": "pairs", "difficulty": 1, "seed": 10021, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of ordered pairs \\((a, b)\\) of integers with \\(1 \\le a \\le n\\) and \\(1 \\le b \\le n\\) such that \\(a \\cdot b \\le n\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 5\\)\n- \\(f(10) = 27\\)\n- \\(f(17) = 52\\)\n- \\(f(24) = 84\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-pairs-d1-e0021"}
+{"id": "definitions-sequence-d1-e0022", "env": "definitions", "msc": "11", "family": "sequence", "difficulty": 1, "seed": 10022, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\nLet \\(a(0) = 3\\), \\(a(1) = 5\\) and, for \\(n \\ge 0\\), let \\(a(n+2)\\) be the remainder of \\(4\\,a(n+1) + \\,a(n)\\) on division by 101. Then \\(f(n) = a(n)\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 97\\)\n- \\(f(10) = 15\\)\n- \\(f(17) = 1\\)\n- \\(f(24) = 49\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sequence-d1-e0022"}
+{"id": "definitions-sum-d1-e0023", "env": "definitions", "msc": "11", "family": "sum", "difficulty": 1, "seed": 10023, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of \\(k\\) over all integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is a perfect square. An empty sum is 0.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 1\\)\n- \\(f(10) = 14\\)\n- \\(f(17) = 30\\)\n- \\(f(24) = 30\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sum-d1-e0023"}
diff --git a/data/definitions/train.jsonl b/data/definitions/train.jsonl
new file mode 100644
index 0000000000000000000000000000000000000000..fea33f70d88cd826ff73687998143e82673fcb67
--- /dev/null
+++ b/data/definitions/train.jsonl
@@ -0,0 +1,84 @@
+{"id": "definitions-count-d1-t0000", "env": "definitions", "msc": "11", "family": "count", "difficulty": 1, "seed": 0, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of integers \\(k\\) with \\(1 \\le k \\le n\\) such that the decimal digits of \\(k\\) read the same forwards and backwards.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 3\\)\n- \\(f(10) = 9\\)\n- \\(f(17) = 10\\)\n- \\(f(24) = 11\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-count-d1-t0000"}
+{"id": "definitions-divisors-d1-t0001", "env": "definitions", "msc": "11", "family": "divisors", "difficulty": 1, "seed": 1, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of positive divisors \\(d\\) of \\(n\\) such that the decimal digits of \\(d\\) read the same forwards and backwards. Take \\(f(0) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 2\\)\n- \\(f(10) = 3\\)\n- \\(f(17) = 1\\)\n- \\(f(24) = 6\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-divisors-d1-t0001"}
+{"id": "definitions-extremum-d1-t0002", "env": "definitions", "msc": "11", "family": "extremum", "difficulty": 1, "seed": 2, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the smallest integer \\(k\\) with \\(k \\ge n\\) and \\(k \\ge 1\\) such that \\(k\\) leaves remainder 2 on division by 3.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 5\\)\n- \\(f(10) = 11\\)\n- \\(f(17) = 17\\)\n- \\(f(24) = 26\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-extremum-d1-t0002"}
+{"id": "definitions-pairs-d1-t0003", "env": "definitions", "msc": "11", "family": "pairs", "difficulty": 1, "seed": 3, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of ordered pairs \\((a, b)\\) of integers with \\(1 \\le a \\le n\\) and \\(1 \\le b \\le n\\) such that \\(a \\cdot b = n\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 2\\)\n- \\(f(10) = 4\\)\n- \\(f(17) = 2\\)\n- \\(f(24) = 8\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-pairs-d1-t0003"}
+{"id": "definitions-sequence-d1-t0004", "env": "definitions", "msc": "11", "family": "sequence", "difficulty": 1, "seed": 4, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\nLet \\(a(0) = 3\\), \\(a(1) = 3\\) and, for \\(n \\ge 0\\), let \\(a(n+2)\\) be the remainder of \\(3\\,a(n+1) + 3\\,a(n)\\) on division by 101. Then \\(f(n) = a(n)\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 63\\)\n- \\(f(10) = 100\\)\n- \\(f(17) = 70\\)\n- \\(f(24) = 62\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sequence-d1-t0004"}
+{"id": "definitions-sum-d1-t0005", "env": "definitions", "msc": "11", "family": "sum", "difficulty": 1, "seed": 5, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of \\(k\\) over all integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is prime. An empty sum is 0.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 5\\)\n- \\(f(10) = 17\\)\n- \\(f(17) = 58\\)\n- \\(f(24) = 100\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sum-d1-t0005"}
+{"id": "definitions-count-d2-t0006", "env": "definitions", "msc": "11", "family": "count", "difficulty": 2, "seed": 6, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of integers \\(k\\) with \\(1 \\le k \\le n\\) such that the decimal digits of \\(k\\) read the same forwards and backwards but it is not the case that \\(k\\) leaves remainder 8 on division by 9.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 3\\)\n- \\(f(10) = 8\\)\n- \\(f(17) = 9\\)\n- \\(f(24) = 10\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-count-d2-t0006"}
+{"id": "definitions-divisors-d2-t0007", "env": "definitions", "msc": "11", "family": "divisors", "difficulty": 2, "seed": 7, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of the values \\(\\tau(d)\\), where \\(\\tau(m)\\) is the number of positive divisors of \\(m\\), over all positive divisors \\(d\\) of \\(n\\) such that \\(d\\) is divisible by 4. An empty sum is 0, and \\(f(0) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 0\\)\n- \\(f(10) = 0\\)\n- \\(f(17) = 0\\)\n- \\(f(24) = 21\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-divisors-d2-t0007"}
+{"id": "definitions-extremum-d2-t0008", "env": "definitions", "msc": "11", "family": "extremum", "difficulty": 2, "seed": 8, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the largest integer \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is coprime to 30 or \\(k\\) is prime (or both). If there is no such \\(k\\), then \\(f(n) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 3\\)\n- \\(f(10) = 7\\)\n- \\(f(17) = 17\\)\n- \\(f(24) = 23\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-extremum-d2-t0008"}
+{"id": "definitions-pairs-d2-t0009", "env": "definitions", "msc": "11", "family": "pairs", "difficulty": 2, "seed": 9, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of ordered pairs \\((a, b)\\) of integers with \\(1 \\le a \\le n\\) and \\(1 \\le b \\le n\\) such that \\(a \\cdot b\\) is a perfect square and \\(a \\le b\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 3\\)\n- \\(f(10) = 14\\)\n- \\(f(17) = 25\\)\n- \\(f(24) = 36\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-pairs-d2-t0009"}
+{"id": "definitions-sequence-d2-t0010", "env": "definitions", "msc": "11", "family": "sequence", "difficulty": 2, "seed": 10, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\nLet \\(a(0) = 1\\), \\(a(1) = 3\\) and, for \\(n \\ge 0\\), let \\(a(n+2)\\) be the remainder of \\(3\\,a(n+1) + 4\\,a(n) + 1\\) on division by 10. Then \\(f(n) = a(0) + a(1) + \\dots + a(n)\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 13\\)\n- \\(f(10) = 46\\)\n- \\(f(17) = 76\\)\n- \\(f(24) = 105\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sequence-d2-t0010"}
+{"id": "definitions-sum-d2-t0011", "env": "definitions", "msc": "11", "family": "sum", "difficulty": 2, "seed": 11, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of the digit sums \\(s(k)\\), where \\(s(m)\\) is the sum of the decimal digits of \\(m\\), over all integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is prime. An empty sum is 0.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 5\\)\n- \\(f(10) = 17\\)\n- \\(f(17) = 31\\)\n- \\(f(24) = 46\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sum-d2-t0011"}
+{"id": "definitions-count-d3-t0012", "env": "definitions", "msc": "11", "family": "count", "difficulty": 3, "seed": 12, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of integers \\(k\\) with \\(1 \\le k \\le n\\) such that the sum of the decimal digits of \\(k\\) leaves remainder 1 on division by 4 and \\(k\\) is coprime to \\(n\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 1\\)\n- \\(f(10) = 2\\)\n- \\(f(17) = 5\\)\n- \\(f(24) = 3\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-count-d3-t0012"}
+{"id": "definitions-divisors-d3-t0013", "env": "definitions", "msc": "11", "family": "divisors", "difficulty": 3, "seed": 13, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of the values \\(\\tau(d)\\), where \\(\\tau(m)\\) is the number of positive divisors of \\(m\\), over all positive divisors \\(d\\) of \\(n\\) such that \\(d\\) is divisible by 2 but it is not the case that \\(d\\) is a perfect square. An empty sum is 0, and \\(f(0) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 0\\)\n- \\(f(10) = 6\\)\n- \\(f(17) = 0\\)\n- \\(f(24) = 24\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-divisors-d3-t0013"}
+{"id": "definitions-extremum-d3-t0014", "env": "definitions", "msc": "11", "family": "extremum", "difficulty": 3, "seed": 14, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the smallest integer \\(k\\) with \\(k > n\\) and \\(k \\ge 1\\) such that \\(k\\) is divisible by 7 or \\(k\\) is divisible by 6 (or both).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 6\\)\n- \\(f(10) = 12\\)\n- \\(f(17) = 18\\)\n- \\(f(24) = 28\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-extremum-d3-t0014"}
+{"id": "definitions-pairs-d3-t0015", "env": "definitions", "msc": "11", "family": "pairs", "difficulty": 3, "seed": 15, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of ordered pairs \\((a, b)\\) of integers with \\(1 \\le a \\le n\\) and \\(1 \\le b \\le n\\) such that \\(a\\) divides \\(b\\), \\(a + b\\) is prime and \\(a \\le b\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 2\\)\n- \\(f(10) = 5\\)\n- \\(f(17) = 7\\)\n- \\(f(24) = 9\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-pairs-d3-t0015"}
+{"id": "definitions-sequence-d3-t0016", "env": "definitions", "msc": "11", "family": "sequence", "difficulty": 3, "seed": 16, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\nLet \\(a(0) = 3\\), \\(a(1) = 3\\) and, for \\(n \\ge 0\\), let \\(a(n+2)\\) be the remainder of \\(\\,a(n+1) + \\,a(n) + 3\\) on division by 7. Then \\(f(n)\\) is the number of indices \\(i\\) with \\(0 \\le i < n\\) such that \\(a(i) < a(i+1)\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 0\\)\n- \\(f(10) = 4\\)\n- \\(f(17) = 7\\)\n- \\(f(24) = 10\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sequence-d3-t0016"}
+{"id": "definitions-sum-d3-t0017", "env": "definitions", "msc": "11", "family": "sum", "difficulty": 3, "seed": 17, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of \\(k\\) over all integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is coprime to \\(n\\) or \\(k\\) is divisible by 4 (or both). An empty sum is 0.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 3\\)\n- \\(f(10) = 32\\)\n- \\(f(17) = 136\\)\n- \\(f(24) = 180\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sum-d3-t0017"}
+{"id": "definitions-count-d1-t0018", "env": "definitions", "msc": "11", "family": "count", "difficulty": 1, "seed": 18, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) leaves remainder 2 on division by 3.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 1\\)\n- \\(f(10) = 3\\)\n- \\(f(17) = 6\\)\n- \\(f(24) = 8\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-count-d1-t0018"}
+{"id": "definitions-divisors-d1-t0019", "env": "definitions", "msc": "11", "family": "divisors", "difficulty": 1, "seed": 19, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of positive divisors \\(d\\) of \\(n\\) such that \\(d\\) is coprime to 21. Take \\(f(0) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 1\\)\n- \\(f(10) = 4\\)\n- \\(f(17) = 2\\)\n- \\(f(24) = 4\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-divisors-d1-t0019"}
+{"id": "definitions-extremum-d1-t0020", "env": "definitions", "msc": "11", "family": "extremum", "difficulty": 1, "seed": 20, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the largest integer \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) leaves remainder 5 on division by 7. If there is no such \\(k\\), then \\(f(n) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 0\\)\n- \\(f(10) = 5\\)\n- \\(f(17) = 12\\)\n- \\(f(24) = 19\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-extremum-d1-t0020"}
+{"id": "definitions-pairs-d1-t0021", "env": "definitions", "msc": "11", "family": "pairs", "difficulty": 1, "seed": 21, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of ordered pairs \\((a, b)\\) of integers with \\(1 \\le a \\le n\\) and \\(1 \\le b \\le n\\) such that \\(a + b\\) is divisible by 5.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 2\\)\n- \\(f(10) = 20\\)\n- \\(f(17) = 57\\)\n- \\(f(24) = 116\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-pairs-d1-t0021"}
+{"id": "definitions-sequence-d1-t0022", "env": "definitions", "msc": "11", "family": "sequence", "difficulty": 1, "seed": 22, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\nLet \\(a(0) = 0\\), \\(a(1) = 3\\) and, for \\(n \\ge 0\\), let \\(a(n+2)\\) be the remainder of \\(3\\,a(n+1) + \\,a(n)\\) on division by 100. Then \\(f(n) = a(n)\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 30\\)\n- \\(f(10) = 11\\)\n- \\(f(17) = 87\\)\n- \\(f(24) = 80\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sequence-d1-t0022"}
+{"id": "definitions-sum-d1-t0023", "env": "definitions", "msc": "11", "family": "sum", "difficulty": 1, "seed": 23, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of \\(k\\) over all integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is coprime to 6. An empty sum is 0.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 1\\)\n- \\(f(10) = 13\\)\n- \\(f(17) = 54\\)\n- \\(f(24) = 96\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sum-d1-t0023"}
+{"id": "definitions-count-d2-t0024", "env": "definitions", "msc": "11", "family": "count", "difficulty": 2, "seed": 24, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) leaves remainder 1 on division by 4 or \\(k\\) is squarefree (no square larger than 1 divides it) (or both).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 3\\)\n- \\(f(10) = 8\\)\n- \\(f(17) = 13\\)\n- \\(f(24) = 17\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-count-d2-t0024"}
+{"id": "definitions-divisors-d2-t0025", "env": "definitions", "msc": "11", "family": "divisors", "difficulty": 2, "seed": 25, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of \\(d\\) over all positive divisors \\(d\\) of \\(n\\) such that the sum of the decimal digits of \\(d\\) leaves remainder 0 on division by 3. An empty sum is 0, and \\(f(0) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 3\\)\n- \\(f(10) = 0\\)\n- \\(f(17) = 0\\)\n- \\(f(24) = 45\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-divisors-d2-t0025"}
+{"id": "definitions-extremum-d2-t0026", "env": "definitions", "msc": "11", "family": "extremum", "difficulty": 2, "seed": 26, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the largest integer \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is prime but it is not the case that the decimal digits of \\(k\\) read the same forwards and backwards. If there is no such \\(k\\), then \\(f(n) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 0\\)\n- \\(f(10) = 0\\)\n- \\(f(17) = 17\\)\n- \\(f(24) = 23\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-extremum-d2-t0026"}
+{"id": "definitions-pairs-d2-t0027", "env": "definitions", "msc": "11", "family": "pairs", "difficulty": 2, "seed": 27, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of ordered pairs \\((a, b)\\) of integers with \\(1 \\le a \\le n\\) and \\(1 \\le b \\le n\\) such that \\(a + b\\) is divisible by 3 and \\(a \\le b\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 2\\)\n- \\(f(10) = 18\\)\n- \\(f(17) = 51\\)\n- \\(f(24) = 100\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-pairs-d2-t0027"}
+{"id": "definitions-sequence-d2-t0028", "env": "definitions", "msc": "11", "family": "sequence", "difficulty": 2, "seed": 28, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\nLet \\(a(0) = 4\\), \\(a(1) = 1\\) and, for \\(n \\ge 0\\), let \\(a(n+2)\\) be the remainder of \\(\\,a(n+1) + \\,a(n)\\) on division by 101. Then \\(f(n) = a(0) + a(1) + \\dots + a(n)\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 16\\)\n- \\(f(10) = 297\\)\n- \\(f(17) = 780\\)\n- \\(f(24) = 1130\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sequence-d2-t0028"}
+{"id": "definitions-sum-d2-t0029", "env": "definitions", "msc": "11", "family": "sum", "difficulty": 2, "seed": 29, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of \\(k^2\\) over all integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) leaves remainder 3 on division by 7. An empty sum is 0.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 9\\)\n- \\(f(10) = 109\\)\n- \\(f(17) = 398\\)\n- \\(f(24) = 974\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sum-d2-t0029"}
+{"id": "definitions-count-d3-t0030", "env": "definitions", "msc": "11", "family": "count", "difficulty": 3, "seed": 30, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is coprime to \\(n\\) but it is not the case that \\(k\\) is a perfect square.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 1\\)\n- \\(f(10) = 2\\)\n- \\(f(17) = 12\\)\n- \\(f(24) = 7\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-count-d3-t0030"}
+{"id": "definitions-divisors-d3-t0031", "env": "definitions", "msc": "11", "family": "divisors", "difficulty": 3, "seed": 31, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of \\(d\\) over all positive divisors \\(d\\) of \\(n\\) such that the sum of the decimal digits of \\(d\\) leaves remainder 2 on division by 3 but it is not the case that \\(d\\) is a perfect square. An empty sum is 0, and \\(f(0) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 0\\)\n- \\(f(10) = 7\\)\n- \\(f(17) = 17\\)\n- \\(f(24) = 10\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-divisors-d3-t0031"}
+{"id": "definitions-extremum-d3-t0032", "env": "definitions", "msc": "11", "family": "extremum", "difficulty": 3, "seed": 32, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the smallest integer \\(k\\) with \\(k > n\\) and \\(k \\ge 1\\) such that \\(k\\) is divisible by 4 or \\(k\\) is coprime to 15 (or both).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 4\\)\n- \\(f(10) = 11\\)\n- \\(f(17) = 19\\)\n- \\(f(24) = 26\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-extremum-d3-t0032"}
+{"id": "definitions-pairs-d3-t0033", "env": "definitions", "msc": "11", "family": "pairs", "difficulty": 3, "seed": 33, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of ordered pairs \\((a, b)\\) of integers with \\(1 \\le a \\le n\\) and \\(1 \\le b \\le n\\) such that \\(a\\) divides \\(b\\), \\(a + b\\) is divisible by 5 and \\(a < b\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 0\\)\n- \\(f(10) = 4\\)\n- \\(f(17) = 8\\)\n- \\(f(24) = 14\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-pairs-d3-t0033"}
+{"id": "definitions-sequence-d3-t0034", "env": "definitions", "msc": "11", "family": "sequence", "difficulty": 3, "seed": 34, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\nLet \\(a(0) = 0\\), \\(a(1) = 3\\) and, for \\(n \\ge 0\\), let \\(a(n+2)\\) be the remainder of \\(4\\,a(n+1) + 4\\,a(n)\\) on division by 17. Then \\(f(n)\\) is the number of indices \\(i\\) with \\(0 \\le i < n\\) such that \\(a(i) < a(i+1)\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 2\\)\n- \\(f(10) = 5\\)\n- \\(f(17) = 9\\)\n- \\(f(24) = 12\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sequence-d3-t0034"}
+{"id": "definitions-sum-d3-t0035", "env": "definitions", "msc": "11", "family": "sum", "difficulty": 3, "seed": 35, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of the digit sums \\(s(k)\\), where \\(s(m)\\) is the sum of the decimal digits of \\(m\\), over all integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is prime and \\(k\\) is squarefree (no square larger than 1 divides it). An empty sum is 0.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 5\\)\n- \\(f(10) = 17\\)\n- \\(f(17) = 31\\)\n- \\(f(24) = 46\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sum-d3-t0035"}
+{"id": "definitions-count-d1-t0036", "env": "definitions", "msc": "11", "family": "count", "difficulty": 1, "seed": 36, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is squarefree (no square larger than 1 divides it).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 3\\)\n- \\(f(10) = 7\\)\n- \\(f(17) = 12\\)\n- \\(f(24) = 16\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-count-d1-t0036"}
+{"id": "definitions-divisors-d1-t0037", "env": "definitions", "msc": "11", "family": "divisors", "difficulty": 1, "seed": 37, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of positive divisors \\(d\\) of \\(n\\) such that the decimal digits of \\(d\\) read the same forwards and backwards. Take \\(f(0) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 2\\)\n- \\(f(10) = 3\\)\n- \\(f(17) = 1\\)\n- \\(f(24) = 6\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-divisors-d1-t0037"}
+{"id": "definitions-extremum-d1-t0038", "env": "definitions", "msc": "11", "family": "extremum", "difficulty": 1, "seed": 38, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the smallest integer \\(k\\) with \\(k \\ge n\\) and \\(k \\ge 1\\) such that \\(k\\) is coprime to 10.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 3\\)\n- \\(f(10) = 11\\)\n- \\(f(17) = 17\\)\n- \\(f(24) = 27\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-extremum-d1-t0038"}
+{"id": "definitions-pairs-d1-t0039", "env": "definitions", "msc": "11", "family": "pairs", "difficulty": 1, "seed": 39, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of ordered pairs \\((a, b)\\) of integers with \\(1 \\le a \\le n\\) and \\(1 \\le b \\le n\\) such that \\(\\gcd(a, b) = 2\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 1\\)\n- \\(f(10) = 19\\)\n- \\(f(17) = 43\\)\n- \\(f(24) = 91\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-pairs-d1-t0039"}
+{"id": "definitions-sequence-d1-t0040", "env": "definitions", "msc": "11", "family": "sequence", "difficulty": 1, "seed": 40, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\nLet \\(a(0) = 1\\), \\(a(1) = 5\\) and, for \\(n \\ge 0\\), let \\(a(n+2)\\) be the remainder of \\(2\\,a(n+1) + 3\\,a(n)\\) on division by 100. Then \\(f(n) = a(n)\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 41\\)\n- \\(f(10) = 73\\)\n- \\(f(17) = 45\\)\n- \\(f(24) = 21\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sequence-d1-t0040"}
+{"id": "definitions-sum-d1-t0041", "env": "definitions", "msc": "11", "family": "sum", "difficulty": 1, "seed": 41, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of \\(k\\) over all integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is a perfect square. An empty sum is 0.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 1\\)\n- \\(f(10) = 14\\)\n- \\(f(17) = 30\\)\n- \\(f(24) = 30\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sum-d1-t0041"}
+{"id": "definitions-count-d2-t0042", "env": "definitions", "msc": "11", "family": "count", "difficulty": 2, "seed": 42, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is prime or \\(k\\) is a perfect square (or both).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 3\\)\n- \\(f(10) = 7\\)\n- \\(f(17) = 11\\)\n- \\(f(24) = 13\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-count-d2-t0042"}
+{"id": "definitions-divisors-d2-t0043", "env": "definitions", "msc": "11", "family": "divisors", "difficulty": 2, "seed": 43, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of \\(d\\) over all positive divisors \\(d\\) of \\(n\\) such that \\(d\\) is divisible by 6. An empty sum is 0, and \\(f(0) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 0\\)\n- \\(f(10) = 0\\)\n- \\(f(17) = 0\\)\n- \\(f(24) = 42\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-divisors-d2-t0043"}
+{"id": "definitions-extremum-d2-t0044", "env": "definitions", "msc": "11", "family": "extremum", "difficulty": 2, "seed": 44, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the smallest integer \\(k\\) with \\(k \\ge n\\) and \\(k \\ge 1\\) such that \\(k\\) is coprime to 21 or \\(k\\) is divisible by 5 (or both).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 4\\)\n- \\(f(10) = 10\\)\n- \\(f(17) = 17\\)\n- \\(f(24) = 25\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-extremum-d2-t0044"}
+{"id": "definitions-pairs-d2-t0045", "env": "definitions", "msc": "11", "family": "pairs", "difficulty": 2, "seed": 45, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of ordered pairs \\((a, b)\\) of integers with \\(1 \\le a \\le n\\) and \\(1 \\le b \\le n\\) such that \\(a\\) divides \\(b\\) and \\(a < b\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 2\\)\n- \\(f(10) = 17\\)\n- \\(f(17) = 35\\)\n- \\(f(24) = 60\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-pairs-d2-t0045"}
+{"id": "definitions-sequence-d2-t0046", "env": "definitions", "msc": "11", "family": "sequence", "difficulty": 2, "seed": 46, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\nLet \\(a(0) = 3\\), \\(a(1) = 5\\) and, for \\(n \\ge 0\\), let \\(a(n+2)\\) be the remainder of \\(3\\,a(n+1) + 2\\,a(n) + 2\\) on division by 17. Then \\(f(n) = a(0) + a(1) + \\dots + a(n)\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 27\\)\n- \\(f(10) = 60\\)\n- \\(f(17) = 114\\)\n- \\(f(24) = 181\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sequence-d2-t0046"}
+{"id": "definitions-sum-d2-t0047", "env": "definitions", "msc": "11", "family": "sum", "difficulty": 2, "seed": 47, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of the values \\(\\tau(k)\\), where \\(\\tau(m)\\) is the number of positive divisors of \\(m\\), over all integers \\(k\\) with \\(1 \\le k \\le n\\) such that the sum of the decimal digits of \\(k\\) leaves remainder 3 on division by 4. An empty sum is 0.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 2\\)\n- \\(f(10) = 4\\)\n- \\(f(17) = 15\\)\n- \\(f(24) = 19\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sum-d2-t0047"}
+{"id": "definitions-count-d3-t0048", "env": "definitions", "msc": "11", "family": "count", "difficulty": 3, "seed": 48, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is coprime to \\(n\\) and the sum of the decimal digits of \\(k\\) leaves remainder 0 on division by 3.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 0\\)\n- \\(f(10) = 2\\)\n- \\(f(17) = 5\\)\n- \\(f(24) = 0\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-count-d3-t0048"}
+{"id": "definitions-divisors-d3-t0049", "env": "definitions", "msc": "11", "family": "divisors", "difficulty": 3, "seed": 49, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of \\(d^2\\) over all positive divisors \\(d\\) of \\(n\\) such that \\(d\\) is a perfect square but it is not the case that \\(d\\) is prime. An empty sum is 0, and \\(f(0) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 1\\)\n- \\(f(10) = 1\\)\n- \\(f(17) = 1\\)\n- \\(f(24) = 17\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-divisors-d3-t0049"}
+{"id": "definitions-extremum-d3-t0050", "env": "definitions", "msc": "11", "family": "extremum", "difficulty": 3, "seed": 50, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the largest integer \\(k\\) with \\(1 \\le k \\le n\\) such that the decimal digits of \\(k\\) read the same forwards and backwards but it is not the case that \\(k\\) is prime. If there is no such \\(k\\), then \\(f(n) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 1\\)\n- \\(f(10) = 9\\)\n- \\(f(17) = 9\\)\n- \\(f(24) = 22\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-extremum-d3-t0050"}
+{"id": "definitions-pairs-d3-t0051", "env": "definitions", "msc": "11", "family": "pairs", "difficulty": 3, "seed": 51, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of ordered pairs \\((a, b)\\) of integers with \\(1 \\le a \\le n\\) and \\(1 \\le b \\le n\\) such that \\(a \\cdot b\\) is a perfect square, \\(a + b\\) is divisible by 4 and \\(a \\le b\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 1\\)\n- \\(f(10) = 5\\)\n- \\(f(17) = 9\\)\n- \\(f(24) = 14\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-pairs-d3-t0051"}
+{"id": "definitions-sequence-d3-t0052", "env": "definitions", "msc": "11", "family": "sequence", "difficulty": 3, "seed": 52, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\nLet \\(a(0) = 4\\), \\(a(1) = 2\\) and, for \\(n \\ge 0\\), let \\(a(n+2)\\) be the remainder of \\(4\\,a(n+1) + 3\\,a(n) + 1\\) on division by 7. Then \\(f(n)\\) is the number of indices \\(i\\) with \\(0 \\le i < n\\) such that \\(a(i) < a(i+1)\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 0\\)\n- \\(f(10) = 4\\)\n- \\(f(17) = 7\\)\n- \\(f(24) = 9\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sequence-d3-t0052"}
+{"id": "definitions-sum-d3-t0053", "env": "definitions", "msc": "11", "family": "sum", "difficulty": 3, "seed": 53, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of \\(k^2\\) over all integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is divisible by 2 but it is not the case that \\(k\\) is coprime to 10. An empty sum is 0.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 4\\)\n- \\(f(10) = 220\\)\n- \\(f(17) = 816\\)\n- \\(f(24) = 2600\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sum-d3-t0053"}
+{"id": "definitions-count-d1-t0054", "env": "definitions", "msc": "11", "family": "count", "difficulty": 1, "seed": 54, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is squarefree (no square larger than 1 divides it).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 3\\)\n- \\(f(10) = 7\\)\n- \\(f(17) = 12\\)\n- \\(f(24) = 16\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-count-d1-t0054"}
+{"id": "definitions-divisors-d1-t0055", "env": "definitions", "msc": "11", "family": "divisors", "difficulty": 1, "seed": 55, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of positive divisors \\(d\\) of \\(n\\) such that the decimal digits of \\(d\\) read the same forwards and backwards. Take \\(f(0) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 2\\)\n- \\(f(10) = 3\\)\n- \\(f(17) = 1\\)\n- \\(f(24) = 6\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-divisors-d1-t0055"}
+{"id": "definitions-extremum-d1-t0056", "env": "definitions", "msc": "11", "family": "extremum", "difficulty": 1, "seed": 56, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the largest integer \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is a perfect square. If there is no such \\(k\\), then \\(f(n) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 1\\)\n- \\(f(10) = 9\\)\n- \\(f(17) = 16\\)\n- \\(f(24) = 16\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-extremum-d1-t0056"}
+{"id": "definitions-pairs-d1-t0057", "env": "definitions", "msc": "11", "family": "pairs", "difficulty": 1, "seed": 57, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of ordered pairs \\((a, b)\\) of integers with \\(1 \\le a \\le n\\) and \\(1 \\le b \\le n\\) such that \\(a + b\\) is prime.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 5\\)\n- \\(f(10) = 37\\)\n- \\(f(17) = 89\\)\n- \\(f(24) = 157\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-pairs-d1-t0057"}
+{"id": "definitions-sequence-d1-t0058", "env": "definitions", "msc": "11", "family": "sequence", "difficulty": 1, "seed": 58, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\nLet \\(a(0) = 0\\), \\(a(1) = 5\\) and, for \\(n \\ge 0\\), let \\(a(n+2)\\) be the remainder of \\(\\,a(n+1) + 3\\,a(n)\\) on division by 11. Then \\(f(n) = a(n)\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 9\\)\n- \\(f(10) = 9\\)\n- \\(f(17) = 1\\)\n- \\(f(24) = 0\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sequence-d1-t0058"}
+{"id": "definitions-sum-d1-t0059", "env": "definitions", "msc": "11", "family": "sum", "difficulty": 1, "seed": 59, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of \\(k\\) over all integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is squarefree (no square larger than 1 divides it). An empty sum is 0.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 6\\)\n- \\(f(10) = 34\\)\n- \\(f(17) = 104\\)\n- \\(f(24) = 189\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sum-d1-t0059"}
+{"id": "definitions-count-d2-t0060", "env": "definitions", "msc": "11", "family": "count", "difficulty": 2, "seed": 60, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is a perfect square but it is not the case that \\(k\\) is prime.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 1\\)\n- \\(f(10) = 3\\)\n- \\(f(17) = 4\\)\n- \\(f(24) = 4\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-count-d2-t0060"}
+{"id": "definitions-divisors-d2-t0061", "env": "definitions", "msc": "11", "family": "divisors", "difficulty": 2, "seed": 61, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of \\(d\\) over all positive divisors \\(d\\) of \\(n\\) such that \\(d\\) is coprime to 14. An empty sum is 0, and \\(f(0) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 4\\)\n- \\(f(10) = 6\\)\n- \\(f(17) = 18\\)\n- \\(f(24) = 4\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-divisors-d2-t0061"}
+{"id": "definitions-extremum-d2-t0062", "env": "definitions", "msc": "11", "family": "extremum", "difficulty": 2, "seed": 62, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the largest integer \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is prime but it is not the case that \\(k\\) leaves remainder 3 on division by 5. If there is no such \\(k\\), then \\(f(n) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 2\\)\n- \\(f(10) = 7\\)\n- \\(f(17) = 17\\)\n- \\(f(24) = 19\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-extremum-d2-t0062"}
+{"id": "definitions-pairs-d2-t0063", "env": "definitions", "msc": "11", "family": "pairs", "difficulty": 2, "seed": 63, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of ordered pairs \\((a, b)\\) of integers with \\(1 \\le a \\le n\\) and \\(1 \\le b \\le n\\) such that \\(\\gcd(a, b) = 1\\) and \\(a \\le b\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 4\\)\n- \\(f(10) = 32\\)\n- \\(f(17) = 96\\)\n- \\(f(24) = 180\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-pairs-d2-t0063"}
+{"id": "definitions-sequence-d2-t0064", "env": "definitions", "msc": "11", "family": "sequence", "difficulty": 2, "seed": 64, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\nLet \\(a(0) = 3\\), \\(a(1) = 1\\) and, for \\(n \\ge 0\\), let \\(a(n+2)\\) be the remainder of \\(4\\,a(n+1) + 3\\,a(n) + 2\\) on division by 100. Then \\(f(n) = a(0) + a(1) + \\dots + a(n)\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 84\\)\n- \\(f(10) = 383\\)\n- \\(f(17) = 620\\)\n- \\(f(24) = 1015\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sequence-d2-t0064"}
+{"id": "definitions-sum-d2-t0065", "env": "definitions", "msc": "11", "family": "sum", "difficulty": 2, "seed": 65, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of \\(k^2\\) over all integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is squarefree (no square larger than 1 divides it). An empty sum is 0.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 14\\)\n- \\(f(10) = 224\\)\n- \\(f(17) = 1224\\)\n- \\(f(24) = 3039\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sum-d2-t0065"}
+{"id": "definitions-count-d3-t0066", "env": "definitions", "msc": "11", "family": "count", "difficulty": 3, "seed": 66, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of integers \\(k\\) with \\(1 \\le k \\le n\\) such that the decimal digits of \\(k\\) read the same forwards and backwards but it is not the case that \\(k\\) leaves remainder 1 on division by 5.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 2\\)\n- \\(f(10) = 7\\)\n- \\(f(17) = 7\\)\n- \\(f(24) = 8\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-count-d3-t0066"}
+{"id": "definitions-divisors-d3-t0067", "env": "definitions", "msc": "11", "family": "divisors", "difficulty": 3, "seed": 67, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of the values \\(\\tau(d)\\), where \\(\\tau(m)\\) is the number of positive divisors of \\(m\\), over all positive divisors \\(d\\) of \\(n\\) such that \\(d\\) is coprime to 21 or \\(d\\) is divisible by 5 (or both). An empty sum is 0, and \\(f(0) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 1\\)\n- \\(f(10) = 9\\)\n- \\(f(17) = 3\\)\n- \\(f(24) = 10\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-divisors-d3-t0067"}
+{"id": "definitions-extremum-d3-t0068", "env": "definitions", "msc": "11", "family": "extremum", "difficulty": 3, "seed": 68, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the smallest integer \\(k\\) with \\(k > n\\) and \\(k \\ge 1\\) such that \\(k\\) is coprime to 6 or \\(k\\) is divisible by 6 (or both).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 5\\)\n- \\(f(10) = 11\\)\n- \\(f(17) = 18\\)\n- \\(f(24) = 25\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-extremum-d3-t0068"}
+{"id": "definitions-pairs-d3-t0069", "env": "definitions", "msc": "11", "family": "pairs", "difficulty": 3, "seed": 69, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of ordered pairs \\((a, b)\\) of integers with \\(1 \\le a \\le n\\) and \\(1 \\le b \\le n\\) such that \\(\\gcd(a, b) = 2\\), \\(a\\) divides \\(b\\) and \\(a \\le b\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 1\\)\n- \\(f(10) = 5\\)\n- \\(f(17) = 8\\)\n- \\(f(24) = 12\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-pairs-d3-t0069"}
+{"id": "definitions-sequence-d3-t0070", "env": "definitions", "msc": "11", "family": "sequence", "difficulty": 3, "seed": 70, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\nLet \\(a(0) = 0\\), \\(a(1) = 2\\) and, for \\(n \\ge 0\\), let \\(a(n+2)\\) be the remainder of \\(3\\,a(n+1) + 3\\,a(n)\\) on division by 10. Then \\(f(n)\\) is the number of indices \\(i\\) with \\(0 \\le i < n\\) such that \\(a(i) < a(i+1)\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 2\\)\n- \\(f(10) = 6\\)\n- \\(f(17) = 9\\)\n- \\(f(24) = 12\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sequence-d3-t0070"}
+{"id": "definitions-sum-d3-t0071", "env": "definitions", "msc": "11", "family": "sum", "difficulty": 3, "seed": 71, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of \\(k^2\\) over all integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) divides \\(n\\) but it is not the case that \\(k\\) is prime. An empty sum is 0.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 1\\)\n- \\(f(10) = 101\\)\n- \\(f(17) = 1\\)\n- \\(f(24) = 837\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sum-d3-t0071"}
+{"id": "definitions-count-d1-t0072", "env": "definitions", "msc": "11", "family": "count", "difficulty": 1, "seed": 72, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is squarefree (no square larger than 1 divides it).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 3\\)\n- \\(f(10) = 7\\)\n- \\(f(17) = 12\\)\n- \\(f(24) = 16\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-count-d1-t0072"}
+{"id": "definitions-divisors-d1-t0073", "env": "definitions", "msc": "11", "family": "divisors", "difficulty": 1, "seed": 73, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of positive divisors \\(d\\) of \\(n\\) such that the decimal digits of \\(d\\) read the same forwards and backwards. Take \\(f(0) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 2\\)\n- \\(f(10) = 3\\)\n- \\(f(17) = 1\\)\n- \\(f(24) = 6\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-divisors-d1-t0073"}
+{"id": "definitions-extremum-d1-t0074", "env": "definitions", "msc": "11", "family": "extremum", "difficulty": 1, "seed": 74, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the largest integer \\(k\\) with \\(1 \\le k \\le n\\) such that the sum of the decimal digits of \\(k\\) leaves remainder 2 on division by 3. If there is no such \\(k\\), then \\(f(n) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 2\\)\n- \\(f(10) = 8\\)\n- \\(f(17) = 17\\)\n- \\(f(24) = 23\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-extremum-d1-t0074"}
+{"id": "definitions-pairs-d1-t0075", "env": "definitions", "msc": "11", "family": "pairs", "difficulty": 1, "seed": 75, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of ordered pairs \\((a, b)\\) of integers with \\(1 \\le a \\le n\\) and \\(1 \\le b \\le n\\) such that \\(a + b\\) is divisible by 3.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 3\\)\n- \\(f(10) = 33\\)\n- \\(f(17) = 97\\)\n- \\(f(24) = 192\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-pairs-d1-t0075"}
+{"id": "definitions-sequence-d1-t0076", "env": "definitions", "msc": "11", "family": "sequence", "difficulty": 1, "seed": 76, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\nLet \\(a(0) = 0\\), \\(a(1) = 1\\) and, for \\(n \\ge 0\\), let \\(a(n+2)\\) be the remainder of \\(2\\,a(n+1) + 3\\,a(n)\\) on division by 100. Then \\(f(n) = a(n)\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 7\\)\n- \\(f(10) = 62\\)\n- \\(f(17) = 41\\)\n- \\(f(24) = 20\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sequence-d1-t0076"}
+{"id": "definitions-sum-d1-t0077", "env": "definitions", "msc": "11", "family": "sum", "difficulty": 1, "seed": 77, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of \\(k\\) over all integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is coprime to 6. An empty sum is 0.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 1\\)\n- \\(f(10) = 13\\)\n- \\(f(17) = 54\\)\n- \\(f(24) = 96\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sum-d1-t0077"}
+{"id": "definitions-count-d2-t0078", "env": "definitions", "msc": "11", "family": "count", "difficulty": 2, "seed": 78, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is coprime to 15 or \\(k\\) is squarefree (no square larger than 1 divides it) (or both).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 3\\)\n- \\(f(10) = 9\\)\n- \\(f(17) = 15\\)\n- \\(f(24) = 19\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-count-d2-t0078"}
+{"id": "definitions-divisors-d2-t0079", "env": "definitions", "msc": "11", "family": "divisors", "difficulty": 2, "seed": 79, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of \\(d^2\\) over all positive divisors \\(d\\) of \\(n\\) such that the decimal digits of \\(d\\) read the same forwards and backwards. An empty sum is 0, and \\(f(0) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 10\\)\n- \\(f(10) = 30\\)\n- \\(f(17) = 1\\)\n- \\(f(24) = 130\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-divisors-d2-t0079"}
+{"id": "definitions-extremum-d2-t0080", "env": "definitions", "msc": "11", "family": "extremum", "difficulty": 2, "seed": 80, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the largest integer \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) is coprime to 30 but it is not the case that \\(k\\) leaves remainder 3 on division by 5. If there is no such \\(k\\), then \\(f(n) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 1\\)\n- \\(f(10) = 7\\)\n- \\(f(17) = 17\\)\n- \\(f(24) = 19\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-extremum-d2-t0080"}
+{"id": "definitions-pairs-d2-t0081", "env": "definitions", "msc": "11", "family": "pairs", "difficulty": 2, "seed": 81, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the number of ordered pairs \\((a, b)\\) of integers with \\(1 \\le a \\le n\\) and \\(1 \\le b \\le n\\) such that \\(a + b\\) is prime and \\(a \\le b\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 3\\)\n- \\(f(10) = 19\\)\n- \\(f(17) = 45\\)\n- \\(f(24) = 79\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-pairs-d2-t0081"}
+{"id": "definitions-sequence-d2-t0082", "env": "definitions", "msc": "11", "family": "sequence", "difficulty": 2, "seed": 82, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\nLet \\(a(0) = 4\\), \\(a(1) = 4\\) and, for \\(n \\ge 0\\), let \\(a(n+2)\\) be the remainder of \\(\\,a(n+1) + \\,a(n) + 2\\) on division by 7. Then \\(f(n) = a(0) + a(1) + \\dots + a(n)\\).\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 13\\)\n- \\(f(10) = 40\\)\n- \\(f(17) = 67\\)\n- \\(f(24) = 93\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sequence-d2-t0082"}
+{"id": "definitions-sum-d2-t0083", "env": "definitions", "msc": "11", "family": "sum", "difficulty": 2, "seed": 83, "kind": "define", "instruction": "# Define a function from its description\n\nDefine the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n\\(f(n)\\) is the sum of \\(k^2\\) over all integers \\(k\\) with \\(1 \\le k \\le n\\) such that \\(k\\) leaves remainder 3 on division by 4. An empty sum is 0.\n\n## What to do\n\n`Solution.lean` in the working directory declares `f` with `sorry` as its body. Replace each `sorry` with a definition that matches the description above.\n\n- Keep the name and the type exactly as given. You may add helper definitions.\n- The definition must be computable: it is checked by running it on hidden inputs, so do not use `noncomputable` or classical choice.\n- Check that the file compiles with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file), and test your definition with `#eval`.\n- The reward is 1 if the definition agrees with the description on every hidden input, and 0 otherwise.\n\n## Examples\n\n- \\(f(3) = 9\\)\n- \\(f(10) = 58\\)\n- \\(f(17) = 404\\)\n- \\(f(24) = 1294\\)\n", "start_file": "import Mathlib\n\ndef f (n : ℕ) : ℕ := sorry\n", "path": "tasks/definitions/definitions-sum-d2-t0083"}
diff --git a/data/finite-sums/eval.jsonl b/data/finite-sums/eval.jsonl
new file mode 100644
index 0000000000000000000000000000000000000000..5e29f9d2c0095607a10c2f79d31f7785ff54bd49
--- /dev/null
+++ b/data/finite-sums/eval.jsonl
@@ -0,0 +1,24 @@
+{"id": "finite-sums-geometric-d1-e0000", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 1, "seed": 10000, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[8 \\sum_{i=0}^{n-1} 9^{i} = 1\\left(9^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (8 : ℤ) * ∑ i ∈ Finset.range n, (9 : ℤ) ^ i = 1 * ((9 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d1-e0000"}
+{"id": "finite-sums-polynomial-d1-e0001", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 1, "seed": 10001, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(4i + 4\\right) = 4 \\cdot \\frac{n(n+1)}{2} + 4 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (4 * (i : ℚ) + 4) = 4 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + 4 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d1-e0001"}
+{"id": "finite-sums-telescoping-d1-e0002", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 1, "seed": 10002, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{1}{(i+2)(i+3)} = \\frac{n}{2(n+2)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (1 : ℚ) / (((i : ℚ) + 2) * ((i : ℚ) + 3)) = 1 * (n : ℚ) / (2 * ((n : ℚ) + 2)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d1-e0002"}
+{"id": "finite-sums-geometric-d2-e0003", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 2, "seed": 10003, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[5 \\sum_{i=0}^{n-1} 5 \\cdot 6^{i} = 5\\left(6^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (5 : ℤ) * ∑ i ∈ Finset.range n, 5 * (6 : ℤ) ^ i = 5 * ((6 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d2-e0003"}
+{"id": "finite-sums-polynomial-d2-e0004", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 2, "seed": 10004, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(4i^2 - 4i\\right) = 4 \\cdot \\frac{n(n+1)(2n+1)}{6} - 4 \\cdot \\frac{n(n+1)}{2}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (4 * (i : ℚ) ^ 2 + -4 * (i : ℚ)) = 4 * ((n : ℚ) * ((n : ℚ) + 1) * (2 * (n : ℚ) + 1) / 6) + -4 * ((n : ℚ) * ((n : ℚ) + 1) / 2) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d2-e0004"}
+{"id": "finite-sums-telescoping-d2-e0005", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 2, "seed": 10005, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{1}{(i+4)(i+5)} = \\frac{n}{4(n+4)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (1 : ℚ) / (((i : ℚ) + 4) * ((i : ℚ) + 5)) = 1 * (n : ℚ) / (4 * ((n : ℚ) + 4)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d2-e0005"}
+{"id": "finite-sums-geometric-d3-e0006", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 3, "seed": 10006, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[4 \\sum_{i=0}^{n-1} 8 \\cdot 5^{i+1} = 40\\left(5^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (4 : ℤ) * ∑ i ∈ Finset.range n, 8 * (5 : ℤ) ^ (i + 1) = 40 * ((5 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d3-e0006"}
+{"id": "finite-sums-polynomial-d3-e0007", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 3, "seed": 10007, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(3i^3 + 3i^2 + i - 4\\right) = 3 \\cdot \\frac{n^2(n+1)^2}{4} + 3 \\cdot \\frac{n(n+1)(2n+1)}{6} + 1 \\cdot \\frac{n(n+1)}{2} - 4 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (3 * (i : ℚ) ^ 3 + 3 * (i : ℚ) ^ 2 + (i : ℚ) + -4) = 3 * ((n : ℚ) ^ 2 * ((n : ℚ) + 1) ^ 2 / 4) + 3 * ((n : ℚ) * ((n : ℚ) + 1) * (2 * (n : ℚ) + 1) / 6) + 1 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + -4 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d3-e0007"}
+{"id": "finite-sums-telescoping-d3-e0008", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 3, "seed": 10008, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{7}{(i+7)(i+8)} = \\frac{7n}{7(n+7)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (7 : ℚ) / (((i : ℚ) + 7) * ((i : ℚ) + 8)) = 7 * (n : ℚ) / (7 * ((n : ℚ) + 7)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d3-e0008"}
+{"id": "finite-sums-geometric-d1-e0009", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 1, "seed": 10009, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[2 \\sum_{i=0}^{n-1} 2 \\cdot 3^{i} = 2\\left(3^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (2 : ℤ) * ∑ i ∈ Finset.range n, 2 * (3 : ℤ) ^ i = 2 * ((3 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d1-e0009"}
+{"id": "finite-sums-polynomial-d1-e0010", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 1, "seed": 10010, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(i - 3\\right) = 1 \\cdot \\frac{n(n+1)}{2} - 3 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), ((i : ℚ) + -3) = 1 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + -3 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d1-e0010"}
+{"id": "finite-sums-telescoping-d1-e0011", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 1, "seed": 10011, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{1}{(i+2)(i+3)} = \\frac{n}{2(n+2)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (1 : ℚ) / (((i : ℚ) + 2) * ((i : ℚ) + 3)) = 1 * (n : ℚ) / (2 * ((n : ℚ) + 2)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d1-e0011"}
+{"id": "finite-sums-geometric-d2-e0012", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 2, "seed": 10012, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[6 \\sum_{i=0}^{n-1} 9 \\cdot 7^{i} = 9\\left(7^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (6 : ℤ) * ∑ i ∈ Finset.range n, 9 * (7 : ℤ) ^ i = 9 * ((7 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d2-e0012"}
+{"id": "finite-sums-polynomial-d2-e0013", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 2, "seed": 10013, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(i^2 - 2i + 3\\right) = 1 \\cdot \\frac{n(n+1)(2n+1)}{6} - 2 \\cdot \\frac{n(n+1)}{2} + 3 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), ((i : ℚ) ^ 2 + -2 * (i : ℚ) + 3) = 1 * ((n : ℚ) * ((n : ℚ) + 1) * (2 * (n : ℚ) + 1) / 6) + -2 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + 3 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d2-e0013"}
+{"id": "finite-sums-telescoping-d2-e0014", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 2, "seed": 10014, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{2}{(i+2)(i+3)} = \\frac{2n}{2(n+2)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (2 : ℚ) / (((i : ℚ) + 2) * ((i : ℚ) + 3)) = 2 * (n : ℚ) / (2 * ((n : ℚ) + 2)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d2-e0014"}
+{"id": "finite-sums-geometric-d3-e0015", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 3, "seed": 10015, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[6 \\sum_{i=0}^{n-1} 7^{i+2} = 49\\left(7^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (6 : ℤ) * ∑ i ∈ Finset.range n, (7 : ℤ) ^ (i + 2) = 49 * ((7 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d3-e0015"}
+{"id": "finite-sums-polynomial-d3-e0016", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 3, "seed": 10016, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(4i^3 - i^2 + 4i + 1\\right) = 4 \\cdot \\frac{n^2(n+1)^2}{4} - 1 \\cdot \\frac{n(n+1)(2n+1)}{6} + 4 \\cdot \\frac{n(n+1)}{2} + 1 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (4 * (i : ℚ) ^ 3 + -1 * (i : ℚ) ^ 2 + 4 * (i : ℚ) + 1) = 4 * ((n : ℚ) ^ 2 * ((n : ℚ) + 1) ^ 2 / 4) + -1 * ((n : ℚ) * ((n : ℚ) + 1) * (2 * (n : ℚ) + 1) / 6) + 4 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + 1 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d3-e0016"}
+{"id": "finite-sums-telescoping-d3-e0017", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 3, "seed": 10017, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{7}{(i+4)(i+5)} = \\frac{7n}{4(n+4)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (7 : ℚ) / (((i : ℚ) + 4) * ((i : ℚ) + 5)) = 7 * (n : ℚ) / (4 * ((n : ℚ) + 4)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d3-e0017"}
+{"id": "finite-sums-geometric-d1-e0018", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 1, "seed": 10018, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[2 \\sum_{i=0}^{n-1} 3^{i} = 1\\left(3^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (2 : ℤ) * ∑ i ∈ Finset.range n, (3 : ℤ) ^ i = 1 * ((3 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d1-e0018"}
+{"id": "finite-sums-polynomial-d1-e0019", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 1, "seed": 10019, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(5i - 1\\right) = 5 \\cdot \\frac{n(n+1)}{2} - 1 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (5 * (i : ℚ) + -1) = 5 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + -1 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d1-e0019"}
+{"id": "finite-sums-telescoping-d1-e0020", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 1, "seed": 10020, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{1}{(i+2)(i+3)} = \\frac{n}{2(n+2)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (1 : ℚ) / (((i : ℚ) + 2) * ((i : ℚ) + 3)) = 1 * (n : ℚ) / (2 * ((n : ℚ) + 2)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d1-e0020"}
+{"id": "finite-sums-geometric-d2-e0021", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 2, "seed": 10021, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[2 \\sum_{i=0}^{n-1} 9 \\cdot 3^{i} = 9\\left(3^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (2 : ℤ) * ∑ i ∈ Finset.range n, 9 * (3 : ℤ) ^ i = 9 * ((3 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d2-e0021"}
+{"id": "finite-sums-polynomial-d2-e0022", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 2, "seed": 10022, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(5i^2 - i + 4\\right) = 5 \\cdot \\frac{n(n+1)(2n+1)}{6} - 1 \\cdot \\frac{n(n+1)}{2} + 4 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (5 * (i : ℚ) ^ 2 + -1 * (i : ℚ) + 4) = 5 * ((n : ℚ) * ((n : ℚ) + 1) * (2 * (n : ℚ) + 1) / 6) + -1 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + 4 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d2-e0022"}
+{"id": "finite-sums-telescoping-d2-e0023", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 2, "seed": 10023, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{1}{(i+6)(i+7)} = \\frac{n}{6(n+6)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (1 : ℚ) / (((i : ℚ) + 6) * ((i : ℚ) + 7)) = 1 * (n : ℚ) / (6 * ((n : ℚ) + 6)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d2-e0023"}
diff --git a/data/finite-sums/train.jsonl b/data/finite-sums/train.jsonl
new file mode 100644
index 0000000000000000000000000000000000000000..9f06f1c5c8ef2d24fb03a68917a4d84ab9d9890c
--- /dev/null
+++ b/data/finite-sums/train.jsonl
@@ -0,0 +1,84 @@
+{"id": "finite-sums-geometric-d1-t0000", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 1, "seed": 0, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[8 \\sum_{i=0}^{n-1} 2 \\cdot 9^{i} = 2\\left(9^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (8 : ℤ) * ∑ i ∈ Finset.range n, 2 * (9 : ℤ) ^ i = 2 * ((9 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d1-t0000"}
+{"id": "finite-sums-polynomial-d1-t0001", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 1, "seed": 1, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(5i - 2\\right) = 5 \\cdot \\frac{n(n+1)}{2} - 2 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (5 * (i : ℚ) + -2) = 5 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + -2 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d1-t0001"}
+{"id": "finite-sums-telescoping-d1-t0002", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 1, "seed": 2, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{1}{(i+4)(i+5)} = \\frac{n}{4(n+4)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (1 : ℚ) / (((i : ℚ) + 4) * ((i : ℚ) + 5)) = 1 * (n : ℚ) / (4 * ((n : ℚ) + 4)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d1-t0002"}
+{"id": "finite-sums-geometric-d2-t0003", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 2, "seed": 3, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[4 \\sum_{i=0}^{n-1} 4 \\cdot 5^{i} = 4\\left(5^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (4 : ℤ) * ∑ i ∈ Finset.range n, 4 * (5 : ℤ) ^ i = 4 * ((5 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d2-t0003"}
+{"id": "finite-sums-polynomial-d2-t0004", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 2, "seed": 4, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(4i^2 + i - 4\\right) = 4 \\cdot \\frac{n(n+1)(2n+1)}{6} + 1 \\cdot \\frac{n(n+1)}{2} - 4 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (4 * (i : ℚ) ^ 2 + (i : ℚ) + -4) = 4 * ((n : ℚ) * ((n : ℚ) + 1) * (2 * (n : ℚ) + 1) / 6) + 1 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + -4 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d2-t0004"}
+{"id": "finite-sums-telescoping-d2-t0005", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 2, "seed": 5, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{2}{(i+2)(i+3)} = \\frac{2n}{2(n+2)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (2 : ℚ) / (((i : ℚ) + 2) * ((i : ℚ) + 3)) = 2 * (n : ℚ) / (2 * ((n : ℚ) + 2)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d2-t0005"}
+{"id": "finite-sums-geometric-d3-t0006", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 3, "seed": 6, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[5 \\sum_{i=0}^{n-1} 2 \\cdot 6^{i+1} = 12\\left(6^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (5 : ℤ) * ∑ i ∈ Finset.range n, 2 * (6 : ℤ) ^ (i + 1) = 12 * ((6 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d3-t0006"}
+{"id": "finite-sums-polynomial-d3-t0007", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 3, "seed": 7, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(i^3 - 3i - 2\\right) = 1 \\cdot \\frac{n^2(n+1)^2}{4} - 3 \\cdot \\frac{n(n+1)}{2} - 2 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), ((i : ℚ) ^ 3 + -3 * (i : ℚ) + -2) = 1 * ((n : ℚ) ^ 2 * ((n : ℚ) + 1) ^ 2 / 4) + -3 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + -2 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d3-t0007"}
+{"id": "finite-sums-telescoping-d3-t0008", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 3, "seed": 8, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{6}{(i+2)(i+3)} = \\frac{6n}{2(n+2)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (6 : ℚ) / (((i : ℚ) + 2) * ((i : ℚ) + 3)) = 6 * (n : ℚ) / (2 * ((n : ℚ) + 2)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d3-t0008"}
+{"id": "finite-sums-geometric-d1-t0009", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 1, "seed": 9, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[5 \\sum_{i=0}^{n-1} 3 \\cdot 6^{i} = 3\\left(6^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (5 : ℤ) * ∑ i ∈ Finset.range n, 3 * (6 : ℤ) ^ i = 3 * ((6 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d1-t0009"}
+{"id": "finite-sums-polynomial-d1-t0010", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 1, "seed": 10, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(5i - 2\\right) = 5 \\cdot \\frac{n(n+1)}{2} - 2 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (5 * (i : ℚ) + -2) = 5 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + -2 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d1-t0010"}
+{"id": "finite-sums-telescoping-d1-t0011", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 1, "seed": 11, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{1}{(i+1)(i+2)} = \\frac{n}{n+1}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (1 : ℚ) / (((i : ℚ) + 1) * ((i : ℚ) + 2)) = 1 * (n : ℚ) / (1 * ((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d1-t0011"}
+{"id": "finite-sums-geometric-d2-t0012", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 2, "seed": 12, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[2 \\sum_{i=0}^{n-1} 3^{i} = 1\\left(3^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (2 : ℤ) * ∑ i ∈ Finset.range n, (3 : ℤ) ^ i = 1 * ((3 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d2-t0012"}
+{"id": "finite-sums-polynomial-d2-t0013", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 2, "seed": 13, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(3i^2 + 5i + 2\\right) = 3 \\cdot \\frac{n(n+1)(2n+1)}{6} + 5 \\cdot \\frac{n(n+1)}{2} + 2 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (3 * (i : ℚ) ^ 2 + 5 * (i : ℚ) + 2) = 3 * ((n : ℚ) * ((n : ℚ) + 1) * (2 * (n : ℚ) + 1) / 6) + 5 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + 2 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d2-t0013"}
+{"id": "finite-sums-telescoping-d2-t0014", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 2, "seed": 14, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{2}{(i+2)(i+3)} = \\frac{2n}{2(n+2)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (2 : ℚ) / (((i : ℚ) + 2) * ((i : ℚ) + 3)) = 2 * (n : ℚ) / (2 * ((n : ℚ) + 2)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d2-t0014"}
+{"id": "finite-sums-geometric-d3-t0015", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 3, "seed": 15, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[-3 \\sum_{i=0}^{n-1} 8 \\cdot (-2)^{i+3} = -64\\left((-2)^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (-3 : ℤ) * ∑ i ∈ Finset.range n, 8 * (-2 : ℤ) ^ (i + 3) = -64 * ((-2 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d3-t0015"}
+{"id": "finite-sums-polynomial-d3-t0016", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 3, "seed": 16, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(5i^3 - 3i^2 - 4i - 3\\right) = 5 \\cdot \\frac{n^2(n+1)^2}{4} - 3 \\cdot \\frac{n(n+1)(2n+1)}{6} - 4 \\cdot \\frac{n(n+1)}{2} - 3 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (5 * (i : ℚ) ^ 3 + -3 * (i : ℚ) ^ 2 + -4 * (i : ℚ) + -3) = 5 * ((n : ℚ) ^ 2 * ((n : ℚ) + 1) ^ 2 / 4) + -3 * ((n : ℚ) * ((n : ℚ) + 1) * (2 * (n : ℚ) + 1) / 6) + -4 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + -3 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d3-t0016"}
+{"id": "finite-sums-telescoping-d3-t0017", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 3, "seed": 17, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{3}{(i+6)(i+7)} = \\frac{3n}{6(n+6)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (3 : ℚ) / (((i : ℚ) + 6) * ((i : ℚ) + 7)) = 3 * (n : ℚ) / (6 * ((n : ℚ) + 6)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d3-t0017"}
+{"id": "finite-sums-geometric-d1-t0018", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 1, "seed": 18, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[8 \\sum_{i=0}^{n-1} 9^{i} = 1\\left(9^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (8 : ℤ) * ∑ i ∈ Finset.range n, (9 : ℤ) ^ i = 1 * ((9 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d1-t0018"}
+{"id": "finite-sums-polynomial-d1-t0019", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 1, "seed": 19, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(4i + 4\\right) = 4 \\cdot \\frac{n(n+1)}{2} + 4 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (4 * (i : ℚ) + 4) = 4 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + 4 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d1-t0019"}
+{"id": "finite-sums-telescoping-d1-t0020", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 1, "seed": 20, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{1}{(i+4)(i+5)} = \\frac{n}{4(n+4)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (1 : ℚ) / (((i : ℚ) + 4) * ((i : ℚ) + 5)) = 1 * (n : ℚ) / (4 * ((n : ℚ) + 4)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d1-t0020"}
+{"id": "finite-sums-geometric-d2-t0021", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 2, "seed": 21, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[3 \\sum_{i=0}^{n-1} 9 \\cdot 4^{i} = 9\\left(4^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (3 : ℤ) * ∑ i ∈ Finset.range n, 9 * (4 : ℤ) ^ i = 9 * ((4 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d2-t0021"}
+{"id": "finite-sums-polynomial-d2-t0022", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 2, "seed": 22, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(2i^2 + 2i - 3\\right) = 2 \\cdot \\frac{n(n+1)(2n+1)}{6} + 2 \\cdot \\frac{n(n+1)}{2} - 3 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (2 * (i : ℚ) ^ 2 + 2 * (i : ℚ) + -3) = 2 * ((n : ℚ) * ((n : ℚ) + 1) * (2 * (n : ℚ) + 1) / 6) + 2 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + -3 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d2-t0022"}
+{"id": "finite-sums-telescoping-d2-t0023", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 2, "seed": 23, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{1}{(i+4)(i+5)} = \\frac{n}{4(n+4)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (1 : ℚ) / (((i : ℚ) + 4) * ((i : ℚ) + 5)) = 1 * (n : ℚ) / (4 * ((n : ℚ) + 4)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d2-t0023"}
+{"id": "finite-sums-geometric-d3-t0024", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 3, "seed": 24, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[-4 \\sum_{i=0}^{n-1} 9 \\cdot (-3)^{i+1} = -27\\left((-3)^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (-4 : ℤ) * ∑ i ∈ Finset.range n, 9 * (-3 : ℤ) ^ (i + 1) = -27 * ((-3 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d3-t0024"}
+{"id": "finite-sums-polynomial-d3-t0025", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 3, "seed": 25, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(3i^3 + 5i^2 + 4i - 4\\right) = 3 \\cdot \\frac{n^2(n+1)^2}{4} + 5 \\cdot \\frac{n(n+1)(2n+1)}{6} + 4 \\cdot \\frac{n(n+1)}{2} - 4 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (3 * (i : ℚ) ^ 3 + 5 * (i : ℚ) ^ 2 + 4 * (i : ℚ) + -4) = 3 * ((n : ℚ) ^ 2 * ((n : ℚ) + 1) ^ 2 / 4) + 5 * ((n : ℚ) * ((n : ℚ) + 1) * (2 * (n : ℚ) + 1) / 6) + 4 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + -4 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d3-t0025"}
+{"id": "finite-sums-telescoping-d3-t0026", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 3, "seed": 26, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{3}{(i+7)(i+8)} = \\frac{3n}{7(n+7)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (3 : ℚ) / (((i : ℚ) + 7) * ((i : ℚ) + 8)) = 3 * (n : ℚ) / (7 * ((n : ℚ) + 7)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d3-t0026"}
+{"id": "finite-sums-geometric-d1-t0027", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 1, "seed": 27, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[1 \\sum_{i=0}^{n-1} 2^{i} = 1\\left(2^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (1 : ℤ) * ∑ i ∈ Finset.range n, (2 : ℤ) ^ i = 1 * ((2 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d1-t0027"}
+{"id": "finite-sums-polynomial-d1-t0028", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 1, "seed": 28, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(4i - 3\\right) = 4 \\cdot \\frac{n(n+1)}{2} - 3 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (4 * (i : ℚ) + -3) = 4 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + -3 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d1-t0028"}
+{"id": "finite-sums-telescoping-d1-t0029", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 1, "seed": 29, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{2}{(i+2)(i+3)} = \\frac{2n}{2(n+2)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (2 : ℚ) / (((i : ℚ) + 2) * ((i : ℚ) + 3)) = 2 * (n : ℚ) / (2 * ((n : ℚ) + 2)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d1-t0029"}
+{"id": "finite-sums-geometric-d2-t0030", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 2, "seed": 30, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[1 \\sum_{i=0}^{n-1} 3 \\cdot 2^{i} = 3\\left(2^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (1 : ℤ) * ∑ i ∈ Finset.range n, 3 * (2 : ℤ) ^ i = 3 * ((2 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d2-t0030"}
+{"id": "finite-sums-polynomial-d2-t0031", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 2, "seed": 31, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(4i^2 - 4i\\right) = 4 \\cdot \\frac{n(n+1)(2n+1)}{6} - 4 \\cdot \\frac{n(n+1)}{2}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (4 * (i : ℚ) ^ 2 + -4 * (i : ℚ)) = 4 * ((n : ℚ) * ((n : ℚ) + 1) * (2 * (n : ℚ) + 1) / 6) + -4 * ((n : ℚ) * ((n : ℚ) + 1) / 2) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d2-t0031"}
+{"id": "finite-sums-telescoping-d2-t0032", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 2, "seed": 32, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{1}{(i+2)(i+3)} = \\frac{n}{2(n+2)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (1 : ℚ) / (((i : ℚ) + 2) * ((i : ℚ) + 3)) = 1 * (n : ℚ) / (2 * ((n : ℚ) + 2)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d2-t0032"}
+{"id": "finite-sums-geometric-d3-t0033", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 3, "seed": 33, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[5 \\sum_{i=0}^{n-1} 4 \\cdot 6^{i+3} = 864\\left(6^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (5 : ℤ) * ∑ i ∈ Finset.range n, 4 * (6 : ℤ) ^ (i + 3) = 864 * ((6 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d3-t0033"}
+{"id": "finite-sums-polynomial-d3-t0034", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 3, "seed": 34, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(5i^3 - 2i^2 + i + 5\\right) = 5 \\cdot \\frac{n^2(n+1)^2}{4} - 2 \\cdot \\frac{n(n+1)(2n+1)}{6} + 1 \\cdot \\frac{n(n+1)}{2} + 5 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (5 * (i : ℚ) ^ 3 + -2 * (i : ℚ) ^ 2 + (i : ℚ) + 5) = 5 * ((n : ℚ) ^ 2 * ((n : ℚ) + 1) ^ 2 / 4) + -2 * ((n : ℚ) * ((n : ℚ) + 1) * (2 * (n : ℚ) + 1) / 6) + 1 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + 5 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d3-t0034"}
+{"id": "finite-sums-telescoping-d3-t0035", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 3, "seed": 35, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{3}{(i+5)(i+6)} = \\frac{3n}{5(n+5)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (3 : ℚ) / (((i : ℚ) + 5) * ((i : ℚ) + 6)) = 3 * (n : ℚ) / (5 * ((n : ℚ) + 5)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d3-t0035"}
+{"id": "finite-sums-geometric-d1-t0036", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 1, "seed": 36, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[4 \\sum_{i=0}^{n-1} 3 \\cdot 5^{i} = 3\\left(5^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (4 : ℤ) * ∑ i ∈ Finset.range n, 3 * (5 : ℤ) ^ i = 3 * ((5 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d1-t0036"}
+{"id": "finite-sums-polynomial-d1-t0037", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 1, "seed": 37, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(4i - 4\\right) = 4 \\cdot \\frac{n(n+1)}{2} - 4 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (4 * (i : ℚ) + -4) = 4 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + -4 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d1-t0037"}
+{"id": "finite-sums-telescoping-d1-t0038", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 1, "seed": 38, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{1}{(i+3)(i+4)} = \\frac{n}{3(n+3)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (1 : ℚ) / (((i : ℚ) + 3) * ((i : ℚ) + 4)) = 1 * (n : ℚ) / (3 * ((n : ℚ) + 3)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d1-t0038"}
+{"id": "finite-sums-geometric-d2-t0039", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 2, "seed": 39, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[7 \\sum_{i=0}^{n-1} 3 \\cdot 8^{i} = 3\\left(8^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (7 : ℤ) * ∑ i ∈ Finset.range n, 3 * (8 : ℤ) ^ i = 3 * ((8 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d2-t0039"}
+{"id": "finite-sums-polynomial-d2-t0040", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 2, "seed": 40, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(4i^2 - 3i + 3\\right) = 4 \\cdot \\frac{n(n+1)(2n+1)}{6} - 3 \\cdot \\frac{n(n+1)}{2} + 3 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (4 * (i : ℚ) ^ 2 + -3 * (i : ℚ) + 3) = 4 * ((n : ℚ) * ((n : ℚ) + 1) * (2 * (n : ℚ) + 1) / 6) + -3 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + 3 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d2-t0040"}
+{"id": "finite-sums-telescoping-d2-t0041", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 2, "seed": 41, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{1}{(i+5)(i+6)} = \\frac{n}{5(n+5)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (1 : ℚ) / (((i : ℚ) + 5) * ((i : ℚ) + 6)) = 1 * (n : ℚ) / (5 * ((n : ℚ) + 5)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d2-t0041"}
+{"id": "finite-sums-geometric-d3-t0042", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 3, "seed": 42, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[6 \\sum_{i=0}^{n-1} 3 \\cdot 7^{i+3} = 1029\\left(7^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (6 : ℤ) * ∑ i ∈ Finset.range n, 3 * (7 : ℤ) ^ (i + 3) = 1029 * ((7 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d3-t0042"}
+{"id": "finite-sums-polynomial-d3-t0043", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 3, "seed": 43, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(2i^3 + 3i^2 + 3i + 1\\right) = 2 \\cdot \\frac{n^2(n+1)^2}{4} + 3 \\cdot \\frac{n(n+1)(2n+1)}{6} + 3 \\cdot \\frac{n(n+1)}{2} + 1 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (2 * (i : ℚ) ^ 3 + 3 * (i : ℚ) ^ 2 + 3 * (i : ℚ) + 1) = 2 * ((n : ℚ) ^ 2 * ((n : ℚ) + 1) ^ 2 / 4) + 3 * ((n : ℚ) * ((n : ℚ) + 1) * (2 * (n : ℚ) + 1) / 6) + 3 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + 1 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d3-t0043"}
+{"id": "finite-sums-telescoping-d3-t0044", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 3, "seed": 44, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{6}{(i+7)(i+8)} = \\frac{6n}{7(n+7)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (6 : ℚ) / (((i : ℚ) + 7) * ((i : ℚ) + 8)) = 6 * (n : ℚ) / (7 * ((n : ℚ) + 7)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d3-t0044"}
+{"id": "finite-sums-geometric-d1-t0045", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 1, "seed": 45, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[6 \\sum_{i=0}^{n-1} 3 \\cdot 7^{i} = 3\\left(7^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (6 : ℤ) * ∑ i ∈ Finset.range n, 3 * (7 : ℤ) ^ i = 3 * ((7 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d1-t0045"}
+{"id": "finite-sums-polynomial-d1-t0046", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 1, "seed": 46, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(3i - 3\\right) = 3 \\cdot \\frac{n(n+1)}{2} - 3 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (3 * (i : ℚ) + -3) = 3 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + -3 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d1-t0046"}
+{"id": "finite-sums-telescoping-d1-t0047", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 1, "seed": 47, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{2}{(i+3)(i+4)} = \\frac{2n}{3(n+3)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (2 : ℚ) / (((i : ℚ) + 3) * ((i : ℚ) + 4)) = 2 * (n : ℚ) / (3 * ((n : ℚ) + 3)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d1-t0047"}
+{"id": "finite-sums-geometric-d2-t0048", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 2, "seed": 48, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[4 \\sum_{i=0}^{n-1} 9 \\cdot 5^{i} = 9\\left(5^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (4 : ℤ) * ∑ i ∈ Finset.range n, 9 * (5 : ℤ) ^ i = 9 * ((5 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d2-t0048"}
+{"id": "finite-sums-polynomial-d2-t0049", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 2, "seed": 49, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(2i^2 - 3i + 4\\right) = 2 \\cdot \\frac{n(n+1)(2n+1)}{6} - 3 \\cdot \\frac{n(n+1)}{2} + 4 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (2 * (i : ℚ) ^ 2 + -3 * (i : ℚ) + 4) = 2 * ((n : ℚ) * ((n : ℚ) + 1) * (2 * (n : ℚ) + 1) / 6) + -3 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + 4 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d2-t0049"}
+{"id": "finite-sums-telescoping-d2-t0050", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 2, "seed": 50, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{1}{(i+7)(i+8)} = \\frac{n}{7(n+7)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (1 : ℚ) / (((i : ℚ) + 7) * ((i : ℚ) + 8)) = 1 * (n : ℚ) / (7 * ((n : ℚ) + 7)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d2-t0050"}
+{"id": "finite-sums-geometric-d3-t0051", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 3, "seed": 51, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[-5 \\sum_{i=0}^{n-1} 7 \\cdot (-4)^{i+2} = 112\\left((-4)^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (-5 : ℤ) * ∑ i ∈ Finset.range n, 7 * (-4 : ℤ) ^ (i + 2) = 112 * ((-4 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d3-t0051"}
+{"id": "finite-sums-polynomial-d3-t0052", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 3, "seed": 52, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(3i^3 - i^2 - i + 2\\right) = 3 \\cdot \\frac{n^2(n+1)^2}{4} - 1 \\cdot \\frac{n(n+1)(2n+1)}{6} - 1 \\cdot \\frac{n(n+1)}{2} + 2 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (3 * (i : ℚ) ^ 3 + -1 * (i : ℚ) ^ 2 + -1 * (i : ℚ) + 2) = 3 * ((n : ℚ) ^ 2 * ((n : ℚ) + 1) ^ 2 / 4) + -1 * ((n : ℚ) * ((n : ℚ) + 1) * (2 * (n : ℚ) + 1) / 6) + -1 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + 2 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d3-t0052"}
+{"id": "finite-sums-telescoping-d3-t0053", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 3, "seed": 53, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{3}{(i+7)(i+8)} = \\frac{3n}{7(n+7)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (3 : ℚ) / (((i : ℚ) + 7) * ((i : ℚ) + 8)) = 3 * (n : ℚ) / (7 * ((n : ℚ) + 7)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d3-t0053"}
+{"id": "finite-sums-geometric-d1-t0054", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 1, "seed": 54, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[5 \\sum_{i=0}^{n-1} 6^{i} = 1\\left(6^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (5 : ℤ) * ∑ i ∈ Finset.range n, (6 : ℤ) ^ i = 1 * ((6 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d1-t0054"}
+{"id": "finite-sums-polynomial-d1-t0055", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 1, "seed": 55, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(3i - 2\\right) = 3 \\cdot \\frac{n(n+1)}{2} - 2 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (3 * (i : ℚ) + -2) = 3 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + -2 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d1-t0055"}
+{"id": "finite-sums-telescoping-d1-t0056", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 1, "seed": 56, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{1}{(i+2)(i+3)} = \\frac{n}{2(n+2)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (1 : ℚ) / (((i : ℚ) + 2) * ((i : ℚ) + 3)) = 1 * (n : ℚ) / (2 * ((n : ℚ) + 2)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d1-t0056"}
+{"id": "finite-sums-geometric-d2-t0057", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 2, "seed": 57, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[5 \\sum_{i=0}^{n-1} 6^{i} = 1\\left(6^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (5 : ℤ) * ∑ i ∈ Finset.range n, (6 : ℤ) ^ i = 1 * ((6 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d2-t0057"}
+{"id": "finite-sums-polynomial-d2-t0058", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 2, "seed": 58, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(i^2 + i\\right) = 1 \\cdot \\frac{n(n+1)(2n+1)}{6} + 1 \\cdot \\frac{n(n+1)}{2}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), ((i : ℚ) ^ 2 + (i : ℚ)) = 1 * ((n : ℚ) * ((n : ℚ) + 1) * (2 * (n : ℚ) + 1) / 6) + 1 * ((n : ℚ) * ((n : ℚ) + 1) / 2) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d2-t0058"}
+{"id": "finite-sums-telescoping-d2-t0059", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 2, "seed": 59, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{1}{(i+6)(i+7)} = \\frac{n}{6(n+6)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (1 : ℚ) / (((i : ℚ) + 6) * ((i : ℚ) + 7)) = 1 * (n : ℚ) / (6 * ((n : ℚ) + 6)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d2-t0059"}
+{"id": "finite-sums-geometric-d3-t0060", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 3, "seed": 60, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[-4 \\sum_{i=0}^{n-1} 6 \\cdot (-3)^{i+1} = -18\\left((-3)^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (-4 : ℤ) * ∑ i ∈ Finset.range n, 6 * (-3 : ℤ) ^ (i + 1) = -18 * ((-3 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d3-t0060"}
+{"id": "finite-sums-polynomial-d3-t0061", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 3, "seed": 61, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(3i^3 + 5i^2 - 2i - 2\\right) = 3 \\cdot \\frac{n^2(n+1)^2}{4} + 5 \\cdot \\frac{n(n+1)(2n+1)}{6} - 2 \\cdot \\frac{n(n+1)}{2} - 2 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (3 * (i : ℚ) ^ 3 + 5 * (i : ℚ) ^ 2 + -2 * (i : ℚ) + -2) = 3 * ((n : ℚ) ^ 2 * ((n : ℚ) + 1) ^ 2 / 4) + 5 * ((n : ℚ) * ((n : ℚ) + 1) * (2 * (n : ℚ) + 1) / 6) + -2 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + -2 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d3-t0061"}
+{"id": "finite-sums-telescoping-d3-t0062", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 3, "seed": 62, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{3}{(i+6)(i+7)} = \\frac{3n}{6(n+6)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (3 : ℚ) / (((i : ℚ) + 6) * ((i : ℚ) + 7)) = 3 * (n : ℚ) / (6 * ((n : ℚ) + 6)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d3-t0062"}
+{"id": "finite-sums-geometric-d1-t0063", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 1, "seed": 63, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[6 \\sum_{i=0}^{n-1} 2 \\cdot 7^{i} = 2\\left(7^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (6 : ℤ) * ∑ i ∈ Finset.range n, 2 * (7 : ℤ) ^ i = 2 * ((7 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d1-t0063"}
+{"id": "finite-sums-polynomial-d1-t0064", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 1, "seed": 64, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(2i - 3\\right) = 2 \\cdot \\frac{n(n+1)}{2} - 3 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (2 * (i : ℚ) + -3) = 2 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + -3 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d1-t0064"}
+{"id": "finite-sums-telescoping-d1-t0065", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 1, "seed": 65, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{1}{(i+2)(i+3)} = \\frac{n}{2(n+2)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (1 : ℚ) / (((i : ℚ) + 2) * ((i : ℚ) + 3)) = 1 * (n : ℚ) / (2 * ((n : ℚ) + 2)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d1-t0065"}
+{"id": "finite-sums-geometric-d2-t0066", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 2, "seed": 66, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[6 \\sum_{i=0}^{n-1} 5 \\cdot 7^{i} = 5\\left(7^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (6 : ℤ) * ∑ i ∈ Finset.range n, 5 * (7 : ℤ) ^ i = 5 * ((7 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d2-t0066"}
+{"id": "finite-sums-polynomial-d2-t0067", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 2, "seed": 67, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(5i^2 + i - 2\\right) = 5 \\cdot \\frac{n(n+1)(2n+1)}{6} + 1 \\cdot \\frac{n(n+1)}{2} - 2 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (5 * (i : ℚ) ^ 2 + (i : ℚ) + -2) = 5 * ((n : ℚ) * ((n : ℚ) + 1) * (2 * (n : ℚ) + 1) / 6) + 1 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + -2 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d2-t0067"}
+{"id": "finite-sums-telescoping-d2-t0068", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 2, "seed": 68, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{1}{(i+7)(i+8)} = \\frac{n}{7(n+7)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (1 : ℚ) / (((i : ℚ) + 7) * ((i : ℚ) + 8)) = 1 * (n : ℚ) / (7 * ((n : ℚ) + 7)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d2-t0068"}
+{"id": "finite-sums-geometric-d3-t0069", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 3, "seed": 69, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[4 \\sum_{i=0}^{n-1} 2 \\cdot 5^{i+1} = 10\\left(5^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (4 : ℤ) * ∑ i ∈ Finset.range n, 2 * (5 : ℤ) ^ (i + 1) = 10 * ((5 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d3-t0069"}
+{"id": "finite-sums-polynomial-d3-t0070", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 3, "seed": 70, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(i^3 - 2i^2 - 2i + 4\\right) = 1 \\cdot \\frac{n^2(n+1)^2}{4} - 2 \\cdot \\frac{n(n+1)(2n+1)}{6} - 2 \\cdot \\frac{n(n+1)}{2} + 4 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), ((i : ℚ) ^ 3 + -2 * (i : ℚ) ^ 2 + -2 * (i : ℚ) + 4) = 1 * ((n : ℚ) ^ 2 * ((n : ℚ) + 1) ^ 2 / 4) + -2 * ((n : ℚ) * ((n : ℚ) + 1) * (2 * (n : ℚ) + 1) / 6) + -2 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + 4 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d3-t0070"}
+{"id": "finite-sums-telescoping-d3-t0071", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 3, "seed": 71, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{2}{(i+8)(i+9)} = \\frac{2n}{8(n+8)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (2 : ℚ) / (((i : ℚ) + 8) * ((i : ℚ) + 9)) = 2 * (n : ℚ) / (8 * ((n : ℚ) + 8)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d3-t0071"}
+{"id": "finite-sums-geometric-d1-t0072", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 1, "seed": 72, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[8 \\sum_{i=0}^{n-1} 9^{i} = 1\\left(9^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (8 : ℤ) * ∑ i ∈ Finset.range n, (9 : ℤ) ^ i = 1 * ((9 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d1-t0072"}
+{"id": "finite-sums-polynomial-d1-t0073", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 1, "seed": 73, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(2i + 2\\right) = 2 \\cdot \\frac{n(n+1)}{2} + 2 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (2 * (i : ℚ) + 2) = 2 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + 2 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d1-t0073"}
+{"id": "finite-sums-telescoping-d1-t0074", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 1, "seed": 74, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{1}{(i+2)(i+3)} = \\frac{n}{2(n+2)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (1 : ℚ) / (((i : ℚ) + 2) * ((i : ℚ) + 3)) = 1 * (n : ℚ) / (2 * ((n : ℚ) + 2)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d1-t0074"}
+{"id": "finite-sums-geometric-d2-t0075", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 2, "seed": 75, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[1 \\sum_{i=0}^{n-1} 4 \\cdot 2^{i} = 4\\left(2^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (1 : ℤ) * ∑ i ∈ Finset.range n, 4 * (2 : ℤ) ^ i = 4 * ((2 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d2-t0075"}
+{"id": "finite-sums-polynomial-d2-t0076", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 2, "seed": 76, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(i^2 - i - 2\\right) = 1 \\cdot \\frac{n(n+1)(2n+1)}{6} - 1 \\cdot \\frac{n(n+1)}{2} - 2 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), ((i : ℚ) ^ 2 + -1 * (i : ℚ) + -2) = 1 * ((n : ℚ) * ((n : ℚ) + 1) * (2 * (n : ℚ) + 1) / 6) + -1 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + -2 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d2-t0076"}
+{"id": "finite-sums-telescoping-d2-t0077", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 2, "seed": 77, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{2}{(i+3)(i+4)} = \\frac{2n}{3(n+3)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (2 : ℚ) / (((i : ℚ) + 3) * ((i : ℚ) + 4)) = 2 * (n : ℚ) / (3 * ((n : ℚ) + 3)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d2-t0077"}
+{"id": "finite-sums-geometric-d3-t0078", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 3, "seed": 78, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[5 \\sum_{i=0}^{n-1} 4 \\cdot 6^{i+1} = 24\\left(6^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (5 : ℤ) * ∑ i ∈ Finset.range n, 4 * (6 : ℤ) ^ (i + 1) = 24 * ((6 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d3-t0078"}
+{"id": "finite-sums-polynomial-d3-t0079", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 3, "seed": 79, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(5i^3 - 4i^2 + 2i + 2\\right) = 5 \\cdot \\frac{n^2(n+1)^2}{4} - 4 \\cdot \\frac{n(n+1)(2n+1)}{6} + 2 \\cdot \\frac{n(n+1)}{2} + 2 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (5 * (i : ℚ) ^ 3 + -4 * (i : ℚ) ^ 2 + 2 * (i : ℚ) + 2) = 5 * ((n : ℚ) ^ 2 * ((n : ℚ) + 1) ^ 2 / 4) + -4 * ((n : ℚ) * ((n : ℚ) + 1) * (2 * (n : ℚ) + 1) / 6) + 2 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + 2 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d3-t0079"}
+{"id": "finite-sums-telescoping-d3-t0080", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 3, "seed": 80, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{7}{(i+8)(i+9)} = \\frac{7n}{8(n+8)}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (7 : ℚ) / (((i : ℚ) + 8) * ((i : ℚ) + 9)) = 7 * (n : ℚ) / (8 * ((n : ℚ) + 8)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d3-t0080"}
+{"id": "finite-sums-geometric-d1-t0081", "env": "finite-sums", "msc": "40", "family": "geometric", "difficulty": 1, "seed": 81, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[5 \\sum_{i=0}^{n-1} 2 \\cdot 6^{i} = 2\\left(6^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n (5 : ℤ) * ∑ i ∈ Finset.range n, 2 * (6 : ℤ) ^ i = 2 * ((6 : ℤ) ^ n - 1) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-geometric-d1-t0081"}
+{"id": "finite-sums-polynomial-d1-t0082", "env": "finite-sums", "msc": "40", "family": "polynomial", "difficulty": 1, "seed": 82, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(i + 2\\right) = 1 \\cdot \\frac{n(n+1)}{2} + 2 \\cdot (n+1).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), ((i : ℚ) + 2) = 1 * ((n : ℚ) * ((n : ℚ) + 1) / 2) + 2 * (((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-polynomial-d1-t0082"}
+{"id": "finite-sums-telescoping-d1-t0083", "env": "finite-sums", "msc": "40", "family": "telescoping", "difficulty": 1, "seed": 83, "kind": "prove", "instruction": "# Prove a closed form for a finite sum\n\nProve the following identity.\n\nFor every natural number \\(n\\), \\[\\sum_{i=0}^{n-1} \\frac{1}{(i+1)(i+2)} = \\frac{n}{n+1}.\\] The sum is over the rationals and is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The closed form stated in the task. -/\ntheorem sum_closed_form (n : ℕ) :\n ∑ i ∈ Finset.range n, (1 : ℚ) / (((i : ℚ) + 1) * ((i : ℚ) + 2)) = 1 * (n : ℚ) / (1 * ((n : ℚ) + 1)) := by\n sorry\n", "path": "tasks/finite-sums/finite-sums-telescoping-d1-t0083"}
diff --git a/data/group-theory/eval.jsonl b/data/group-theory/eval.jsonl
new file mode 100644
index 0000000000000000000000000000000000000000..a296eeab1f0b5d9598470e536547649ff0279cb1
--- /dev/null
+++ b/data/group-theory/eval.jsonl
@@ -0,0 +1,24 @@
+{"id": "group-theory-hom-d1-e0000", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 1, "seed": 10000, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) be a group homomorphism and \\(x, y \\in G\\) with \\(f(x) = e\\). Then \\(y x y^{-1} x^{-1}\\) lies in the kernel of \\(f\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Commutators with a kernel element lie in the kernel. -/\ntheorem commutator_in_kernel {G H : Type*} [Group G] [Group H] (f : G →* H) (x y : G)\n (hx : f x = 1) : y * x * y⁻¹ * x⁻¹ ∈ f.ker := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d1-e0000"}
+{"id": "group-theory-inverse-d1-e0001", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 1, "seed": 10001, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(M\\) be a monoid and \\(g, k, m \\in M\\) with \\(g k = 1\\) and \\(m g = 1\\). Then \\(k = m\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A left inverse and a right inverse of the same element are equal. -/\ntheorem inverses_agree {N : Type*} [Monoid N] (g k m : N)\n (h1 : m * g = 1) (h2 : g * k = 1) : k = m := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d1-e0001"}
+{"id": "group-theory-involution-d1-e0002", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 1, "seed": 10002, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\(g^{-1} = g \\text{ for every } g\\). Then \\(G\\) is commutative: \\(ab = ba\\) for all \\(a, b \\in G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {Q : Type*} [Group Q] (h : ∀ g : Q, g⁻¹ = g) :\n ∀ g k : Q, g * k = k * g := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d1-e0002"}
+{"id": "group-theory-subgroup-d1-e0003", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 1, "seed": 10003, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(L\\) be a subgroup of a group \\(G\\) and let \\(p\\), \\(q\\), \\(r\\) lie in \\(L\\). Then \\(p^{-1} q^{-1} r \\in L\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A product of elements of a subgroup, with inverses and powers, lies in the subgroup. -/\ntheorem product_mem {A : Type*} [Group A] (L : Subgroup A) {p q r : A}\n (hp : p ∈ L) (hq : q ∈ L) (hr : r ∈ L) : p⁻¹ * q⁻¹ * r ∈ L := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d1-e0003"}
+{"id": "group-theory-hom-d2-e0004", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 2, "seed": 10004, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) and \\(g : H \\to K\\) be group homomorphisms. Then every element of the kernel of \\(f\\) lies in the kernel of \\(g \\circ f\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The kernel of f lies in the kernel of g after f. -/\ntheorem ker_le_ker_comp {G K Z : Type*} [Group G] [Group K] [Group Z] (f : G →* K) (g : K →* Z) :\n f.ker ≤ (g.comp f).ker := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d2-e0004"}
+{"id": "group-theory-inverse-d2-e0005", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 2, "seed": 10005, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(M\\) be a monoid and \\(x, y \\in M\\) with \\(x y = 1\\). Then \\(x^n y^n = 1\\) for every \\(n \\in \\mathbb{N}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- If xy = 1 then x^n y^n = 1. -/\ntheorem pow_pair_one {M : Type*} [Monoid M] (x y : M) (h : x * y = 1) (n : ℕ) :\n x ^ n * y ^ n = 1 := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d2-e0005"}
+{"id": "group-theory-involution-d2-e0006", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 2, "seed": 10006, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\((ab)^2 = a^2 b^2 \\text{ for all } a, b\\). Then \\(a b a^{-1} = b\\) for all \\(a, b \\in G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {G : Type*} [Group G] (h : ∀ u v : G, (u * v) ^ 2 = u ^ 2 * v ^ 2) :\n ∀ u v : G, u * v * u⁻¹ = v := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d2-e0006"}
+{"id": "group-theory-subgroup-d2-e0007", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 2, "seed": 10007, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(G\\) be a group with \\(|G| = 4\\) and \\(H\\) a subgroup of \\(G\\). Then \\(|H|\\) divides 4.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Lagrange: the order of a subgroup divides the order of the group. -/\ntheorem subgroup_card_dvd {A : Type*} [Group A] (hG : Nat.card A = 4) (H : Subgroup A) :\n Nat.card H ∣ 4 := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d2-e0007"}
+{"id": "group-theory-hom-d3-e0008", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 3, "seed": 10008, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) be a group homomorphism such that \\(f(u) = e\\) implies \\(u = e\\) for every \\(u \\in G\\). Then \\(f\\) is injective.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A homomorphism with trivial kernel is injective. -/\ntheorem injective_of_trivial_kernel {X Y : Type*} [Group X] [Group Y] (f : X →* Y)\n (h : ∀ u : X, f u = 1 → u = 1) : Function.Injective f := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d3-e0008"}
+{"id": "group-theory-inverse-d3-e0009", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 3, "seed": 10009, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(M\\) be a monoid in which every element \\(x\\) has some \\(y\\) with \\(xy = 1\\). Then \\(xy = 1\\) implies \\(yx = 1\\) for all \\(x, y \\in M\\). Under the same hypothesis, if \\(a b = 1\\) and \\(a c = 1\\) then \\(b = c\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- One-sided inverses are two-sided. -/\ntheorem right_inverse_comm {M : Type*} [Monoid M] (h : ∀ a : M, ∃ b, a * b = 1) :\n ∀ a b : M, a * b = 1 → b * a = 1 := by\n sorry\n\n/-- The inverse is unique. -/\ntheorem inverse_unique {M : Type*} [Monoid M] (h : ∀ a : M, ∃ b, a * b = 1) (a b c : M)\n (h1 : a * b = 1) (h2 : a * c = 1) : b = c := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d3-e0009"}
+{"id": "group-theory-involution-d3-e0010", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 3, "seed": 10010, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\((ab)^{-1} = a^{-1} b^{-1} \\text{ for all } a, b\\). Then every element of \\(G\\) lies in the center of \\(G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {A : Type*} [Group A] (h : ∀ x y : A, (x * y)⁻¹ = x⁻¹ * y⁻¹) :\n ∀ z : A, z ∈ Subgroup.center A := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d3-e0010"}
+{"id": "group-theory-subgroup-d3-e0011", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 3, "seed": 10011, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(G\\) be a group with \\(|G| = 5\\). Then \\(x^{5} = e\\) for every \\(x \\in G\\), and every element \\(p \\neq e\\) has order exactly 5.\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Every element satisfies x^|G| = 1. -/\ntheorem pow_card {A : Type*} [Group A] (hG : Nat.card A = 5) (x : A) :\n x ^ 5 = 1 := by\n sorry\n\n/-- In a group of prime order p, every non-identity element has order p. -/\ntheorem order_prime {A : Type*} [Group A] (hG : Nat.card A = 5) (p : A) (hne : p ≠ 1) :\n orderOf p = 5 := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d3-e0011"}
+{"id": "group-theory-hom-d1-e0012", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 1, "seed": 10012, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) be a group homomorphism and \\(a\\) an element of \\(G\\) with \\(f(a) = e\\). Then \\(f(a^{7}) = e\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of kernel elements are in the kernel. -/\ntheorem image_of_power {G H : Type*} [Group G] [Group H] (f : G →* H) (a : G)\n (hx : f a = 1) : f (a ^ 7) = 1 := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d1-e0012"}
+{"id": "group-theory-inverse-d1-e0013", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 1, "seed": 10013, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(M\\) be a monoid and \\(a, b, c \\in M\\) with \\(a b = 1\\) and \\(c a = 1\\). Then \\(b = c\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A left inverse and a right inverse of the same element are equal. -/\ntheorem inverses_agree {S : Type*} [Monoid S] (a b c : S)\n (h1 : a * b = 1) (h2 : c * a = 1) : b = c := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d1-e0013"}
+{"id": "group-theory-involution-d1-e0014", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 1, "seed": 10014, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\(g^{-1} = g \\text{ for every } g\\). Then \\(G\\) is commutative: \\(ab = ba\\) for all \\(a, b \\in G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {A : Type*} [Group A] (h : ∀ g : A, g⁻¹ = g) :\n ∀ g k : A, g * k = k * g := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d1-e0014"}
+{"id": "group-theory-subgroup-d1-e0015", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 1, "seed": 10015, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(N\\) be a subgroup of a group \\(G\\) and let \\(x\\), \\(y\\) lie in \\(N\\). Then \\(x^{-1} y \\in N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A product of elements of a subgroup, with inverses and powers, lies in the subgroup. -/\ntheorem product_mem {G : Type*} [Group G] (N : Subgroup G) {x y : G}\n (hx : x ∈ N) (hy : y ∈ N) : x⁻¹ * y ∈ N := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d1-e0015"}
+{"id": "group-theory-hom-d2-e0016", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 2, "seed": 10016, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) be a group homomorphism such that \\(f(a) = e\\) implies \\(a = e\\) for every \\(a \\in G\\). Then \\(f\\) is injective.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A homomorphism with trivial kernel is injective. -/\ntheorem injective_of_trivial_kernel {G H : Type*} [Group G] [Group H] (f : G →* H)\n (h : ∀ a : G, f a = 1 → a = 1) : Function.Injective f := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d2-e0016"}
+{"id": "group-theory-inverse-d2-e0017", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 2, "seed": 10017, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(G\\) be a group and \\(g_{1}, g_{2}, g_{3}, g_{4}, g_{5}, g_{6} \\in G\\) with \\(g_{1} g_{2} g_{3} g_{4} g_{5} g_{6} = e\\). Then \\(g_{6} g_{1} g_{2} g_{3} g_{4} g_{5} = e\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A product equal to the identity stays equal to the identity after a cyclic rotation. -/\ntheorem rotate_product {Q : Type*} [Group Q] (g₁ g₂ g₃ g₄ g₅ g₆ : Q)\n (h : g₁ * g₂ * g₃ * g₄ * g₅ * g₆ = 1) : g₆ * g₁ * g₂ * g₃ * g₄ * g₅ = 1 := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d2-e0017"}
+{"id": "group-theory-involution-d2-e0018", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 2, "seed": 10018, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\((ab)^2 = a^2 b^2 \\text{ for all } a, b\\). Then every element of \\(G\\) lies in the center of \\(G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {A : Type*} [Group A] (h : ∀ p q : A, (p * q) ^ 2 = p ^ 2 * q ^ 2) :\n ∀ z : A, z ∈ Subgroup.center A := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d2-e0018"}
+{"id": "group-theory-subgroup-d2-e0019", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 2, "seed": 10019, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(N\\) be a normal subgroup of a group \\(G\\), let \\(p \\in N\\) and \\(q \\in G\\). Then \\(q p q^{-1} p^{-1} \\in N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Conjugates of elements of a normal subgroup stay in it. -/\ntheorem normal_conj {Q : Type*} [Group Q] (N : Subgroup Q) (hN : N.Normal) {p : Q} (hx : p ∈ N) (q : Q) :\n q * p * q⁻¹ * p⁻¹ ∈ N := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d2-e0019"}
+{"id": "group-theory-hom-d3-e0020", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 3, "seed": 10020, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) be a group homomorphism such that \\(f(s) = e\\) implies \\(s = e\\) for every \\(s \\in G\\). Then \\(f\\) is injective.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A homomorphism with trivial kernel is injective. -/\ntheorem injective_of_trivial_kernel {G K : Type*} [Group G] [Group K] (f : G →* K)\n (h : ∀ s : G, f s = 1 → s = 1) : Function.Injective f := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d3-e0020"}
+{"id": "group-theory-inverse-d3-e0021", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 3, "seed": 10021, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(M\\) be a monoid in which every element \\(x\\) has some \\(y\\) with \\(xy = 1\\). Then \\(xy = 1\\) implies \\(yx = 1\\) for all \\(x, y \\in M\\). Under the same hypothesis, if \\(x y = 1\\) and \\(x z = 1\\) then \\(y = z\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- One-sided inverses are two-sided. -/\ntheorem right_inverse_comm {S : Type*} [Monoid S] (h : ∀ x : S, ∃ y, x * y = 1) :\n ∀ x y : S, x * y = 1 → y * x = 1 := by\n sorry\n\n/-- The inverse is unique. -/\ntheorem inverse_unique {S : Type*} [Monoid S] (h : ∀ x : S, ∃ y, x * y = 1) (x y z : S)\n (h1 : x * y = 1) (h2 : x * z = 1) : y = z := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d3-e0021"}
+{"id": "group-theory-involution-d3-e0022", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 3, "seed": 10022, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\((ab)^{-1} = a^{-1} b^{-1} \\text{ for all } a, b\\). Then every element of \\(G\\) lies in the center of \\(G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {G : Type*} [Group G] (h : ∀ u v : G, (u * v)⁻¹ = u⁻¹ * v⁻¹) :\n ∀ z : G, z ∈ Subgroup.center G := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d3-e0022"}
+{"id": "group-theory-subgroup-d3-e0023", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 3, "seed": 10023, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(G\\) be a group with \\(|G| = 63\\) and \\(L\\) a subgroup with \\(|L| = 9\\). Then \\(L\\) has index 7 in \\(G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Lagrange: the cardinality is the product of subgroup order and index. -/\ntheorem subgroup_index {A : Type*} [Group A] (hG : Nat.card A = 63) (L : Subgroup A) (hH : Nat.card L = 9) :\n L.index = 7 := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d3-e0023"}
diff --git a/data/group-theory/train.jsonl b/data/group-theory/train.jsonl
new file mode 100644
index 0000000000000000000000000000000000000000..7dc20248630acc21791f9b988bfc27fb39384643
--- /dev/null
+++ b/data/group-theory/train.jsonl
@@ -0,0 +1,84 @@
+{"id": "group-theory-hom-d1-t0000", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 1, "seed": 0, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) be a group homomorphism and \\(x, y \\in G\\). Then \\(f(x) = f(y)\\) if and only if \\(x^{-1} y\\) lies in the kernel of \\(f\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Two elements have the same image exactly when x⁻¹ y is in the kernel. -/\ntheorem eq_iff_mem_ker {X Y : Type*} [Group X] [Group Y] (f : X →* Y) (x y : X) :\n f x = f y ↔ x⁻¹ * y ∈ f.ker := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d1-t0000"}
+{"id": "group-theory-inverse-d1-t0001", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 1, "seed": 1, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(M\\) be a monoid and \\(x, y, z \\in M\\) with \\(x y = 1\\) and \\(z x = 1\\). Then \\(y = z\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A left inverse and a right inverse of the same element are equal. -/\ntheorem inverses_agree {N : Type*} [Monoid N] (x y z : N)\n (h1 : x * y = 1) (h2 : z * x = 1) : y = z := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d1-t0001"}
+{"id": "group-theory-involution-d1-t0002", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 1, "seed": 2, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\(g^{-1} = g \\text{ for every } g\\). Then \\(G\\) is commutative: \\(ab = ba\\) for all \\(a, b \\in G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {Q : Type*} [Group Q] (h : ∀ g : Q, g⁻¹ = g) :\n ∀ g k : Q, g * k = k * g := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d1-t0002"}
+{"id": "group-theory-subgroup-d1-t0003", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 1, "seed": 3, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(L\\) be a subgroup of a group \\(G\\) and let \\(a\\), \\(b\\), \\(c\\) lie in \\(L\\). Then \\(a^{-1} b c^{-1} \\in L\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A product of elements of a subgroup, with inverses and powers, lies in the subgroup. -/\ntheorem product_mem {Q : Type*} [Group Q] (L : Subgroup Q) {a b c : Q}\n (ha : a ∈ L) (hb : b ∈ L) (hc : c ∈ L) : a⁻¹ * b * c⁻¹ ∈ L := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d1-t0003"}
+{"id": "group-theory-hom-d2-t0004", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 2, "seed": 4, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) and \\(g : H \\to K\\) be group homomorphisms. Then every element of the kernel of \\(f\\) lies in the kernel of \\(g \\circ f\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The kernel of f lies in the kernel of g after f. -/\ntheorem ker_le_ker_comp {G H Z : Type*} [Group G] [Group H] [Group Z] (f : G →* H) (g : H →* Z) :\n f.ker ≤ (g.comp f).ker := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d2-t0004"}
+{"id": "group-theory-inverse-d2-t0005", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 2, "seed": 5, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(G\\) be a group, \\(u, v \\in G\\) and \\(n \\in \\mathbb{N}\\). Then \\((u v u^{-1})^n = u v^n u^{-1}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A fact about conjugation and powers. -/\ntheorem conjugate_fact {G : Type*} [Group G] (u v : G) (n : ℕ) :\n (u * v * u⁻¹) ^ n = u * v ^ n * u⁻¹ := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d2-t0005"}
+{"id": "group-theory-involution-d2-t0006", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 2, "seed": 6, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\(g^2 = e \\text{ for every } g\\). Then \\(a b a^{-1} = b\\) for all \\(a, b \\in G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {A : Type*} [Group A] (h : ∀ g : A, g ^ 2 = 1) :\n ∀ g k : A, g * k * g⁻¹ = k := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d2-t0006"}
+{"id": "group-theory-subgroup-d2-t0007", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 2, "seed": 7, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(G\\) be a group with \\(|G| = 10\\) and \\(K\\) a subgroup with \\(|K| = 2\\). Then \\(K\\) has index 5 in \\(G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Lagrange: the cardinality is the product of subgroup order and index. -/\ntheorem subgroup_index {G : Type*} [Group G] (hG : Nat.card G = 10) (K : Subgroup G) (hH : Nat.card K = 2) :\n K.index = 5 := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d2-t0007"}
+{"id": "group-theory-hom-d3-t0008", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 3, "seed": 8, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) be a group homomorphism whose kernel has exactly one element. Then \\(f\\) is injective.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A homomorphism whose kernel has one element is injective. -/\ntheorem injective_of_card_ker {G H : Type*} [Group G] [Group H] (f : G →* H)\n (h : Nat.card f.ker = 1) : Function.Injective f := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d3-t0008"}
+{"id": "group-theory-inverse-d3-t0009", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 3, "seed": 9, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(G\\) be a group and \\(x_{1}, x_{2}, x_{3}, x_{4}, x_{5}, x_{6}, x_{7} \\in G\\) with \\(x_{1} x_{2} x_{3} x_{4} x_{5} x_{6} x_{7} = e\\). Then \\(x_{2} x_{3} x_{4} x_{5} x_{6} x_{7} x_{1} = e\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A product equal to the identity stays equal to the identity after a cyclic rotation. -/\ntheorem rotate_product {G : Type*} [Group G] (x₁ x₂ x₃ x₄ x₅ x₆ x₇ : G)\n (h : x₁ * x₂ * x₃ * x₄ * x₅ * x₆ * x₇ = 1) : x₂ * x₃ * x₄ * x₅ * x₆ * x₇ * x₁ = 1 := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d3-t0009"}
+{"id": "group-theory-involution-d3-t0010", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 3, "seed": 10, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\(g^2 = e \\text{ for every } g\\). Then every element of \\(G\\) lies in the center of \\(G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {Q : Type*} [Group Q] (h : ∀ g : Q, g ^ 2 = 1) :\n ∀ z : Q, z ∈ Subgroup.center Q := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d3-t0010"}
+{"id": "group-theory-subgroup-d3-t0011", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 3, "seed": 11, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(G\\) be a group with \\(|G| = 45\\) and \\(L\\) a subgroup with \\(|L| = 9\\). Then \\(L\\) has index 5 in \\(G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Lagrange: the cardinality is the product of subgroup order and index. -/\ntheorem subgroup_index {G : Type*} [Group G] (hG : Nat.card G = 45) (L : Subgroup G) (hH : Nat.card L = 9) :\n L.index = 5 := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d3-t0011"}
+{"id": "group-theory-hom-d1-t0012", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 1, "seed": 12, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) be a group homomorphism and \\(s\\) an element of \\(G\\) with \\(f(s) = e\\). Then \\(f(s^{3}) = e\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of kernel elements are in the kernel. -/\ntheorem image_of_power {X Y : Type*} [Group X] [Group Y] (f : X →* Y) (s : X)\n (hx : f s = 1) : f (s ^ 3) = 1 := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d1-t0012"}
+{"id": "group-theory-inverse-d1-t0013", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 1, "seed": 13, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(G\\) be a group and \\(g_{1}, g_{2}, g_{3} \\in G\\) with \\(g_{1} g_{2} g_{3} = e\\). Then \\(g_{3} g_{1} g_{2} = e\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A product equal to the identity stays equal to the identity after a cyclic rotation. -/\ntheorem rotate_product {G : Type*} [Group G] (g₁ g₂ g₃ : G)\n (h : g₁ * g₂ * g₃ = 1) : g₃ * g₁ * g₂ = 1 := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d1-t0013"}
+{"id": "group-theory-involution-d1-t0014", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 1, "seed": 14, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\(g \\cdot g = e \\text{ for every } g\\). Then \\(G\\) is commutative: \\(ab = ba\\) for all \\(a, b \\in G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {Q : Type*} [Group Q] (h : ∀ g : Q, g * g = 1) :\n ∀ g k : Q, g * k = k * g := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d1-t0014"}
+{"id": "group-theory-subgroup-d1-t0015", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 1, "seed": 15, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(L\\) be a subgroup of a group \\(G\\) and let \\(g\\), \\(k\\), \\(m\\) lie in \\(L\\). Then \\(g k^{-1} m^{-1} \\in L\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A product of elements of a subgroup, with inverses and powers, lies in the subgroup. -/\ntheorem product_mem {G : Type*} [Group G] (L : Subgroup G) {g k m : G}\n (hg : g ∈ L) (hk : k ∈ L) (hm : m ∈ L) : g * k⁻¹ * m⁻¹ ∈ L := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d1-t0015"}
+{"id": "group-theory-hom-d2-t0016", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 2, "seed": 16, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) and \\(g : H \\to K\\) be group homomorphisms. Then every element of the kernel of \\(f\\) lies in the kernel of \\(g \\circ f\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The kernel of f lies in the kernel of g after f. -/\ntheorem ker_le_ker_comp {G K Z : Type*} [Group G] [Group K] [Group Z] (f : G →* K) (g : K →* Z) :\n f.ker ≤ (g.comp f).ker := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d2-t0016"}
+{"id": "group-theory-inverse-d2-t0017", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 2, "seed": 17, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(G\\) be a group and \\(g_{1}, g_{2}, g_{3}, g_{4}, g_{5}, g_{6} \\in G\\) with \\(g_{1} g_{2} g_{3} g_{4} g_{5} g_{6} = e\\). Then \\(g_{2} g_{3} g_{4} g_{5} g_{6} g_{1} = e\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A product equal to the identity stays equal to the identity after a cyclic rotation. -/\ntheorem rotate_product {A : Type*} [Group A] (g₁ g₂ g₃ g₄ g₅ g₆ : A)\n (h : g₁ * g₂ * g₃ * g₄ * g₅ * g₆ = 1) : g₂ * g₃ * g₄ * g₅ * g₆ * g₁ = 1 := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d2-t0017"}
+{"id": "group-theory-involution-d2-t0018", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 2, "seed": 18, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\((ab)^{-1} = a^{-1} b^{-1} \\text{ for all } a, b\\). Then every element of \\(G\\) lies in the center of \\(G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {Q : Type*} [Group Q] (h : ∀ p q : Q, (p * q)⁻¹ = p⁻¹ * q⁻¹) :\n ∀ z : Q, z ∈ Subgroup.center Q := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d2-t0018"}
+{"id": "group-theory-subgroup-d2-t0019", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 2, "seed": 19, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(G\\) be a group with \\(|G| = 6\\) and \\(H\\) a subgroup with \\(|H| = 3\\). Then \\(H\\) has index 2 in \\(G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Lagrange: the cardinality is the product of subgroup order and index. -/\ntheorem subgroup_index {G : Type*} [Group G] (hG : Nat.card G = 6) (H : Subgroup G) (hH : Nat.card H = 3) :\n H.index = 2 := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d2-t0019"}
+{"id": "group-theory-hom-d3-t0020", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 3, "seed": 20, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) be a group homomorphism whose kernel has exactly one element. Then \\(f\\) is injective.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A homomorphism whose kernel has one element is injective. -/\ntheorem injective_of_card_ker {G K : Type*} [Group G] [Group K] (f : G →* K)\n (h : Nat.card f.ker = 1) : Function.Injective f := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d3-t0020"}
+{"id": "group-theory-inverse-d3-t0021", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 3, "seed": 21, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(G\\) be a group and \\(g_{1}, g_{2}, g_{3}, g_{4}, g_{5}, g_{6}, g_{7} \\in G\\) with \\(g_{1} g_{2} g_{3} g_{4} g_{5} g_{6} g_{7} = e\\). Then \\(g_{6} g_{7} g_{1} g_{2} g_{3} g_{4} g_{5} = e\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A product equal to the identity stays equal to the identity after a cyclic rotation. -/\ntheorem rotate_product {G : Type*} [Group G] (g₁ g₂ g₃ g₄ g₅ g₆ g₇ : G)\n (h : g₁ * g₂ * g₃ * g₄ * g₅ * g₆ * g₇ = 1) : g₆ * g₇ * g₁ * g₂ * g₃ * g₄ * g₅ = 1 := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d3-t0021"}
+{"id": "group-theory-involution-d3-t0022", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 3, "seed": 22, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\((ab)^2 = a^2 b^2 \\text{ for all } a, b\\). Then \\(a b a^{-1} = b\\) for all \\(a, b \\in G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {Q : Type*} [Group Q] (h : ∀ u v : Q, (u * v) ^ 2 = u ^ 2 * v ^ 2) :\n ∀ u v : Q, u * v * u⁻¹ = v := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d3-t0022"}
+{"id": "group-theory-subgroup-d3-t0023", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 3, "seed": 23, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(H\\) and \\(K\\) be subgroups of a group \\(G\\) such that for all \\(a \\in H\\) and \\(b \\in K\\) the product \\(ab\\) lies in \\(H\\) or in \\(K\\). Then \\(H \\subseteq K\\) or \\(K \\subseteq H\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A product-closed union of two subgroups is one of them. -/\ntheorem subgroup_union {Q : Type*} [Group Q] (H K : Subgroup Q)\n (h : ∀ a ∈ H, ∀ b ∈ K, a * b ∈ H ∨ a * b ∈ K) : H ≤ K ∨ K ≤ H := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d3-t0023"}
+{"id": "group-theory-hom-d1-t0024", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 1, "seed": 24, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) be a group homomorphism and \\(a\\) an element of \\(G\\) with \\(f(a) = e\\). Then \\(f(a^{11}) = e\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of kernel elements are in the kernel. -/\ntheorem image_of_power {G K : Type*} [Group G] [Group K] (f : G →* K) (a : G)\n (hx : f a = 1) : f (a ^ 11) = 1 := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d1-t0024"}
+{"id": "group-theory-inverse-d1-t0025", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 1, "seed": 25, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(G\\) be a group and \\(x_{1}, x_{2}, x_{3} \\in G\\) with \\(x_{1} x_{2} x_{3} = e\\). Then \\(x_{2} x_{3} x_{1} = e\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A product equal to the identity stays equal to the identity after a cyclic rotation. -/\ntheorem rotate_product {Q : Type*} [Group Q] (x₁ x₂ x₃ : Q)\n (h : x₁ * x₂ * x₃ = 1) : x₂ * x₃ * x₁ = 1 := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d1-t0025"}
+{"id": "group-theory-involution-d1-t0026", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 1, "seed": 26, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\(g \\cdot g = e \\text{ for every } g\\). Then \\(G\\) is commutative: \\(ab = ba\\) for all \\(a, b \\in G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {G : Type*} [Group G] (h : ∀ g : G, g * g = 1) :\n ∀ u v : G, u * v = v * u := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d1-t0026"}
+{"id": "group-theory-subgroup-d1-t0027", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 1, "seed": 27, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(H\\) be a subgroup of a group \\(G\\) and let \\(u\\), \\(v\\) lie in \\(H\\). Then \\(u^{-1} v \\in H\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A product of elements of a subgroup, with inverses and powers, lies in the subgroup. -/\ntheorem product_mem {G : Type*} [Group G] (H : Subgroup G) {u v : G}\n (hu : u ∈ H) (hv : v ∈ H) : u⁻¹ * v ∈ H := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d1-t0027"}
+{"id": "group-theory-hom-d2-t0028", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 2, "seed": 28, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) be a group homomorphism such that \\(f(p) = e\\) implies \\(p = e\\) for every \\(p \\in G\\). Then \\(f\\) is injective.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A homomorphism with trivial kernel is injective. -/\ntheorem injective_of_trivial_kernel {G K : Type*} [Group G] [Group K] (f : G →* K)\n (h : ∀ p : G, f p = 1 → p = 1) : Function.Injective f := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d2-t0028"}
+{"id": "group-theory-inverse-d2-t0029", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 2, "seed": 29, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(M\\) be a monoid and \\(u, v \\in M\\) with \\(u v = 1\\). Then \\(u^n v^n = 1\\) for every \\(n \\in \\mathbb{N}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- If xy = 1 then x^n y^n = 1. -/\ntheorem pow_pair_one {M : Type*} [Monoid M] (u v : M) (h : u * v = 1) (n : ℕ) :\n u ^ n * v ^ n = 1 := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d2-t0029"}
+{"id": "group-theory-involution-d2-t0030", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 2, "seed": 30, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\((ab)^2 = a^2 b^2 \\text{ for all } a, b\\). Then every element of \\(G\\) lies in the center of \\(G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {Q : Type*} [Group Q] (h : ∀ a b : Q, (a * b) ^ 2 = a ^ 2 * b ^ 2) :\n ∀ z : Q, z ∈ Subgroup.center Q := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d2-t0030"}
+{"id": "group-theory-subgroup-d2-t0031", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 2, "seed": 31, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(N\\) be a normal subgroup of a group \\(G\\), let \\(p \\in N\\) and \\(q \\in G\\). Then \\(q p q^{-1} p^{-1} \\in N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Conjugates of elements of a normal subgroup stay in it. -/\ntheorem normal_conj {G : Type*} [Group G] (N : Subgroup G) (hN : N.Normal) {p : G} (hx : p ∈ N) (q : G) :\n q * p * q⁻¹ * p⁻¹ ∈ N := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d2-t0031"}
+{"id": "group-theory-hom-d3-t0032", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 3, "seed": 32, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) be an injective group homomorphism of groups. Then \\(|G|\\) divides \\(|H|\\) (cardinalities are in \\(\\mathbb{N}\\), with 0 for an infinite group).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Lagrange for an injective homomorphism. -/\ntheorem card_dvd_of_injective {G K : Type*} [Group G] [Group K] (f : G →* K)\n (hf : Function.Injective f) : Nat.card G ∣ Nat.card K := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d3-t0032"}
+{"id": "group-theory-inverse-d3-t0033", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 3, "seed": 33, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(M\\) be a monoid in which every element \\(x\\) has some \\(y\\) with \\(xy = 1\\). Then \\(xy = 1\\) implies \\(yx = 1\\) for all \\(x, y \\in M\\). Under the same hypothesis, if \\(x y = 1\\) and \\(x z = 1\\) then \\(y = z\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- One-sided inverses are two-sided. -/\ntheorem right_inverse_comm {M : Type*} [Monoid M] (h : ∀ x : M, ∃ y, x * y = 1) :\n ∀ x y : M, x * y = 1 → y * x = 1 := by\n sorry\n\n/-- The inverse is unique. -/\ntheorem inverse_unique {M : Type*} [Monoid M] (h : ∀ x : M, ∃ y, x * y = 1) (x y z : M)\n (h1 : x * y = 1) (h2 : x * z = 1) : y = z := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d3-t0033"}
+{"id": "group-theory-involution-d3-t0034", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 3, "seed": 34, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\((ab)^{-1} = a^{-1} b^{-1} \\text{ for all } a, b\\). Then \\(G\\) is commutative: \\(ab = ba\\) for all \\(a, b \\in G\\). Deduce that \\((ab)^{5} = a^{5} b^{5}\\) for all \\(a, b \\in G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The group is commutative. -/\ntheorem involution_comm {Q : Type*} [Group Q] (h : ∀ g k : Q, (g * k)⁻¹ = g⁻¹ * k⁻¹) :\n ∀ g k : Q, g * k = k * g := by\n sorry\n\n/-- In this group \\((ab)^5 = a^5 b^5\\). -/\ntheorem power_of_product {Q : Type*} [Group Q] (h : ∀ g k : Q, (g * k)⁻¹ = g⁻¹ * k⁻¹) (g k : Q) :\n (g * k) ^ 5 = g ^ 5 * k ^ 5 := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d3-t0034"}
+{"id": "group-theory-subgroup-d3-t0035", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 3, "seed": 35, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(G\\) be a group with \\(|G| = 20\\) and \\(N\\) a subgroup with \\(|N| = 10\\). Then \\(N\\) has index 2 in \\(G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Lagrange: the cardinality is the product of subgroup order and index. -/\ntheorem subgroup_index {G : Type*} [Group G] (hG : Nat.card G = 20) (N : Subgroup G) (hH : Nat.card N = 10) :\n N.index = 2 := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d3-t0035"}
+{"id": "group-theory-hom-d1-t0036", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 1, "seed": 36, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) be a group homomorphism and \\(p\\) an element of \\(G\\) with \\(f(p) = e\\). Then \\(f(p^{6}) = e\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of kernel elements are in the kernel. -/\ntheorem image_of_power {X Y : Type*} [Group X] [Group Y] (f : X →* Y) (p : X)\n (hx : f p = 1) : f (p ^ 6) = 1 := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d1-t0036"}
+{"id": "group-theory-inverse-d1-t0037", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 1, "seed": 37, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(M\\) be a monoid and \\(p, q, r \\in M\\) with \\(p q = 1\\) and \\(r p = 1\\). Then \\(q = r\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A left inverse and a right inverse of the same element are equal. -/\ntheorem inverses_agree {M : Type*} [Monoid M] (p q r : M)\n (h1 : r * p = 1) (h2 : p * q = 1) : q = r := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d1-t0037"}
+{"id": "group-theory-involution-d1-t0038", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 1, "seed": 38, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\(g^{-1} = g \\text{ for every } g\\). Then \\(G\\) is commutative: \\(ab = ba\\) for all \\(a, b \\in G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {Q : Type*} [Group Q] (h : ∀ g : Q, g⁻¹ = g) :\n ∀ a b : Q, a * b = b * a := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d1-t0038"}
+{"id": "group-theory-subgroup-d1-t0039", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 1, "seed": 39, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(H\\) be a subgroup of a group \\(G\\) and let \\(g\\), \\(k\\) lie in \\(H\\). Then \\(g^{-1} k^{-1} \\in H\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A product of elements of a subgroup, with inverses and powers, lies in the subgroup. -/\ntheorem product_mem {A : Type*} [Group A] (H : Subgroup A) {g k : A}\n (hg : g ∈ H) (hk : k ∈ H) : g⁻¹ * k⁻¹ ∈ H := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d1-t0039"}
+{"id": "group-theory-hom-d2-t0040", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 2, "seed": 40, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) be a group homomorphism such that \\(f(x) = e\\) implies \\(x = e\\) for every \\(x \\in G\\). Then \\(f\\) is injective.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A homomorphism with trivial kernel is injective. -/\ntheorem injective_of_trivial_kernel {G H : Type*} [Group G] [Group H] (f : G →* H)\n (h : ∀ x : G, f x = 1 → x = 1) : Function.Injective f := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d2-t0040"}
+{"id": "group-theory-inverse-d2-t0041", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 2, "seed": 41, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(G\\) be a group, \\(a, b \\in G\\) and \\(n \\in \\mathbb{N}\\). Then \\((a^{-1} b a)^n = a^{-1} b^n a\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A fact about conjugation and powers. -/\ntheorem conjugate_fact {Q : Type*} [Group Q] (a b : Q) (n : ℕ) :\n (a⁻¹ * b * a) ^ n = a⁻¹ * b ^ n * a := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d2-t0041"}
+{"id": "group-theory-involution-d2-t0042", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 2, "seed": 42, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\(g^2 = e \\text{ for every } g\\). Then every element of \\(G\\) lies in the center of \\(G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {G : Type*} [Group G] (h : ∀ g : G, g ^ 2 = 1) :\n ∀ z : G, z ∈ Subgroup.center G := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d2-t0042"}
+{"id": "group-theory-subgroup-d2-t0043", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 2, "seed": 43, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(H\\) be a normal subgroup of a group \\(G\\), let \\(u \\in H\\) and \\(v \\in G\\). Then \\(v u^{3} v^{-1} \\in H\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Conjugates of elements of a normal subgroup stay in it. -/\ntheorem normal_conj {Q : Type*} [Group Q] (H : Subgroup Q) (hN : H.Normal) {u : Q} (hx : u ∈ H) (v : Q) :\n v * u ^ 3 * v⁻¹ ∈ H := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d2-t0043"}
+{"id": "group-theory-hom-d3-t0044", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 3, "seed": 44, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) be an injective group homomorphism of groups. Then \\(|G|\\) divides \\(|H|\\) (cardinalities are in \\(\\mathbb{N}\\), with 0 for an infinite group).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Lagrange for an injective homomorphism. -/\ntheorem card_dvd_of_injective {X Y : Type*} [Group X] [Group Y] (f : X →* Y)\n (hf : Function.Injective f) : Nat.card X ∣ Nat.card Y := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d3-t0044"}
+{"id": "group-theory-inverse-d3-t0045", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 3, "seed": 45, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(M\\) be a monoid in which every element \\(x\\) has some \\(y\\) with \\(yx = 1\\). Then \\(yx = 1\\) implies \\(xy = 1\\) for all \\(x, y \\in M\\). Under the same hypothesis, if \\(k g = 1\\) and \\(m g = 1\\) then \\(k = m\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- One-sided inverses are two-sided. -/\ntheorem right_inverse_comm {S : Type*} [Monoid S] (h : ∀ g : S, ∃ k, k * g = 1) :\n ∀ g k : S, k * g = 1 → g * k = 1 := by\n sorry\n\n/-- The inverse is unique. -/\ntheorem inverse_unique {S : Type*} [Monoid S] (h : ∀ g : S, ∃ k, k * g = 1) (g k m : S)\n (h1 : k * g = 1) (h2 : m * g = 1) : k = m := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d3-t0045"}
+{"id": "group-theory-involution-d3-t0046", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 3, "seed": 46, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\((ab)^2 = a^2 b^2 \\text{ for all } a, b\\). Then every element of \\(G\\) lies in the center of \\(G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {G : Type*} [Group G] (h : ∀ s t : G, (s * t) ^ 2 = s ^ 2 * t ^ 2) :\n ∀ z : G, z ∈ Subgroup.center G := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d3-t0046"}
+{"id": "group-theory-subgroup-d3-t0047", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 3, "seed": 47, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(G\\) be a group with \\(|G| = 7\\). Then \\(x^{7} = e\\) for every \\(x \\in G\\), and every element \\(u \\neq e\\) has order exactly 7.\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Every element satisfies x^|G| = 1. -/\ntheorem pow_card {G : Type*} [Group G] (hG : Nat.card G = 7) (x : G) :\n x ^ 7 = 1 := by\n sorry\n\n/-- In a group of prime order p, every non-identity element has order p. -/\ntheorem order_prime {G : Type*} [Group G] (hG : Nat.card G = 7) (u : G) (hne : u ≠ 1) :\n orderOf u = 7 := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d3-t0047"}
+{"id": "group-theory-hom-d1-t0048", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 1, "seed": 48, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) be a group homomorphism and \\(s, t \\in G\\). Then \\(f(s) = f(t)\\) if and only if \\(s^{-1} t\\) lies in the kernel of \\(f\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Two elements have the same image exactly when x⁻¹ y is in the kernel. -/\ntheorem eq_iff_mem_ker {G K : Type*} [Group G] [Group K] (f : G →* K) (s t : G) :\n f s = f t ↔ s⁻¹ * t ∈ f.ker := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d1-t0048"}
+{"id": "group-theory-inverse-d1-t0049", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 1, "seed": 49, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(M\\) be a monoid and \\(x, y, z \\in M\\) with \\(x y = 1\\) and \\(z x = 1\\). Then \\(y = z\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A left inverse and a right inverse of the same element are equal. -/\ntheorem inverses_agree {N : Type*} [Monoid N] (x y z : N)\n (h1 : z * x = 1) (h2 : x * y = 1) : y = z := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d1-t0049"}
+{"id": "group-theory-involution-d1-t0050", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 1, "seed": 50, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\(g^{-1} = g \\text{ for every } g\\). Then \\(G\\) is commutative: \\(ab = ba\\) for all \\(a, b \\in G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {G : Type*} [Group G] (h : ∀ g : G, g⁻¹ = g) :\n ∀ s t : G, s * t = t * s := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d1-t0050"}
+{"id": "group-theory-subgroup-d1-t0051", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 1, "seed": 51, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(H\\) be a subgroup of a group \\(G\\) and let \\(g\\), \\(k\\) lie in \\(H\\). Then \\(g k^{-1} \\in H\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A product of elements of a subgroup, with inverses and powers, lies in the subgroup. -/\ntheorem product_mem {A : Type*} [Group A] (H : Subgroup A) {g k : A}\n (hg : g ∈ H) (hk : k ∈ H) : g * k⁻¹ ∈ H := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d1-t0051"}
+{"id": "group-theory-hom-d2-t0052", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 2, "seed": 52, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) be a group homomorphism such that \\(f(g) = e\\) implies \\(g = e\\) for every \\(g \\in G\\). Then \\(f\\) is injective.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A homomorphism with trivial kernel is injective. -/\ntheorem injective_of_trivial_kernel {G K : Type*} [Group G] [Group K] (f : G →* K)\n (h : ∀ g : G, f g = 1 → g = 1) : Function.Injective f := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d2-t0052"}
+{"id": "group-theory-inverse-d2-t0053", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 2, "seed": 53, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(M\\) be a monoid and \\(a, b \\in M\\) with \\(a b = 1\\). Then \\(a^n b^n = 1\\) for every \\(n \\in \\mathbb{N}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- If xy = 1 then x^n y^n = 1. -/\ntheorem pow_pair_one {S : Type*} [Monoid S] (a b : S) (h : a * b = 1) (n : ℕ) :\n a ^ n * b ^ n = 1 := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d2-t0053"}
+{"id": "group-theory-involution-d2-t0054", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 2, "seed": 54, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\((ab)^2 = a^2 b^2 \\text{ for all } a, b\\). Then every element of \\(G\\) lies in the center of \\(G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {Q : Type*} [Group Q] (h : ∀ s t : Q, (s * t) ^ 2 = s ^ 2 * t ^ 2) :\n ∀ z : Q, z ∈ Subgroup.center Q := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d2-t0054"}
+{"id": "group-theory-subgroup-d2-t0055", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 2, "seed": 55, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(N\\) be a normal subgroup of a group \\(G\\), let \\(g \\in N\\) and \\(k \\in G\\). Then \\(k g^{6} k^{-1} \\in N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Conjugates of elements of a normal subgroup stay in it. -/\ntheorem normal_conj {Q : Type*} [Group Q] (N : Subgroup Q) (hN : N.Normal) {g : Q} (hx : g ∈ N) (k : Q) :\n k * g ^ 6 * k⁻¹ ∈ N := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d2-t0055"}
+{"id": "group-theory-hom-d3-t0056", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 3, "seed": 56, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) be a group homomorphism whose kernel has exactly one element. Then \\(f\\) is injective.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A homomorphism whose kernel has one element is injective. -/\ntheorem injective_of_card_ker {A B : Type*} [Group A] [Group B] (f : A →* B)\n (h : Nat.card f.ker = 1) : Function.Injective f := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d3-t0056"}
+{"id": "group-theory-inverse-d3-t0057", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 3, "seed": 57, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(M\\) be a monoid in which every element \\(x\\) has some \\(y\\) with \\(xy = 1\\). Then \\(xy = 1\\) implies \\(yx = 1\\) for all \\(x, y \\in M\\). Under the same hypothesis, if \\(a b = 1\\) and \\(a c = 1\\) then \\(b = c\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- One-sided inverses are two-sided. -/\ntheorem right_inverse_comm {N : Type*} [Monoid N] (h : ∀ a : N, ∃ b, a * b = 1) :\n ∀ a b : N, a * b = 1 → b * a = 1 := by\n sorry\n\n/-- The inverse is unique. -/\ntheorem inverse_unique {N : Type*} [Monoid N] (h : ∀ a : N, ∃ b, a * b = 1) (a b c : N)\n (h1 : a * b = 1) (h2 : a * c = 1) : b = c := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d3-t0057"}
+{"id": "group-theory-involution-d3-t0058", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 3, "seed": 58, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\(aba = b \\text{ for all } a, b\\). Then every element of \\(G\\) lies in the center of \\(G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {G : Type*} [Group G] (h : ∀ p q : G, p * q * p = q) :\n ∀ z : G, z ∈ Subgroup.center G := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d3-t0058"}
+{"id": "group-theory-subgroup-d3-t0059", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 3, "seed": 59, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(A\\) and \\(B\\) be subgroups of a group \\(G\\) such that for all \\(a \\in A\\) and \\(b \\in B\\) the product \\(ab\\) lies in \\(A\\) or in \\(B\\). Then \\(A \\subseteq B\\) or \\(B \\subseteq A\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A product-closed union of two subgroups is one of them. -/\ntheorem subgroup_union {Q : Type*} [Group Q] (A B : Subgroup Q)\n (h : ∀ a ∈ A, ∀ b ∈ B, a * b ∈ A ∨ a * b ∈ B) : A ≤ B ∨ B ≤ A := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d3-t0059"}
+{"id": "group-theory-hom-d1-t0060", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 1, "seed": 60, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) be a group homomorphism and \\(x, y \\in G\\). Then \\(f(x) = f(y)\\) if and only if \\(x^{-1} y\\) lies in the kernel of \\(f\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Two elements have the same image exactly when x⁻¹ y is in the kernel. -/\ntheorem eq_iff_mem_ker {X Y : Type*} [Group X] [Group Y] (f : X →* Y) (x y : X) :\n f x = f y ↔ x⁻¹ * y ∈ f.ker := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d1-t0060"}
+{"id": "group-theory-inverse-d1-t0061", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 1, "seed": 61, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(G\\) be a group and \\(t_{1}, t_{2}, t_{3} \\in G\\) with \\(t_{1} t_{2} t_{3} = e\\). Then \\(t_{3} t_{1} t_{2} = e\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A product equal to the identity stays equal to the identity after a cyclic rotation. -/\ntheorem rotate_product {Q : Type*} [Group Q] (t₁ t₂ t₃ : Q)\n (h : t₁ * t₂ * t₃ = 1) : t₃ * t₁ * t₂ = 1 := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d1-t0061"}
+{"id": "group-theory-involution-d1-t0062", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 1, "seed": 62, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\(g^{-1} = g \\text{ for every } g\\). Then \\(G\\) is commutative: \\(ab = ba\\) for all \\(a, b \\in G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {G : Type*} [Group G] (h : ∀ g : G, g⁻¹ = g) :\n ∀ s t : G, s * t = t * s := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d1-t0062"}
+{"id": "group-theory-subgroup-d1-t0063", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 1, "seed": 63, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(L\\) be a subgroup of a group \\(G\\) and let \\(x\\), \\(y\\) lie in \\(L\\). Then \\(x^{-1} y \\in L\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A product of elements of a subgroup, with inverses and powers, lies in the subgroup. -/\ntheorem product_mem {Q : Type*} [Group Q] (L : Subgroup Q) {x y : Q}\n (hx : x ∈ L) (hy : y ∈ L) : x⁻¹ * y ∈ L := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d1-t0063"}
+{"id": "group-theory-hom-d2-t0064", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 2, "seed": 64, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) be a group homomorphism such that \\(f(s) = e\\) implies \\(s = e\\) for every \\(s \\in G\\). Then \\(f\\) is injective.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A homomorphism with trivial kernel is injective. -/\ntheorem injective_of_trivial_kernel {A B : Type*} [Group A] [Group B] (f : A →* B)\n (h : ∀ s : A, f s = 1 → s = 1) : Function.Injective f := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d2-t0064"}
+{"id": "group-theory-inverse-d2-t0065", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 2, "seed": 65, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(M\\) be a monoid and \\(x, y \\in M\\) with \\(x y = 1\\). Then \\(x^n y^n = 1\\) for every \\(n \\in \\mathbb{N}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- If xy = 1 then x^n y^n = 1. -/\ntheorem pow_pair_one {M : Type*} [Monoid M] (x y : M) (h : x * y = 1) (n : ℕ) :\n x ^ n * y ^ n = 1 := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d2-t0065"}
+{"id": "group-theory-involution-d2-t0066", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 2, "seed": 66, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\(g^2 = e \\text{ for every } g\\). Then \\(a b a^{-1} = b\\) for all \\(a, b \\in G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {Q : Type*} [Group Q] (h : ∀ g : Q, g ^ 2 = 1) :\n ∀ u v : Q, u * v * u⁻¹ = v := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d2-t0066"}
+{"id": "group-theory-subgroup-d2-t0067", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 2, "seed": 67, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(L\\) be a normal subgroup of a group \\(G\\), let \\(p \\in L\\) and \\(q \\in G\\). Then \\(q p q^{-1} p^{-1} \\in L\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Conjugates of elements of a normal subgroup stay in it. -/\ntheorem normal_conj {A : Type*} [Group A] (L : Subgroup A) (hN : L.Normal) {p : A} (hx : p ∈ L) (q : A) :\n q * p * q⁻¹ * p⁻¹ ∈ L := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d2-t0067"}
+{"id": "group-theory-hom-d3-t0068", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 3, "seed": 68, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) and \\(g : H \\to K\\) be group homomorphisms with \\(g\\) injective. Then \\(g \\circ f\\) and \\(f\\) have the same kernel. Show that \\(\\ker f \\subseteq \\ker(g \\circ f)\\) and then the equality.\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The kernel of f lies in the kernel of g after f. -/\ntheorem ker_le_ker_comp {X Y Z : Type*} [Group X] [Group Y] [Group Z] (f : X →* Y) (g : Y →* Z) :\n f.ker ≤ (g.comp f).ker := by\n sorry\n\n/-- If g is injective the kernels agree. -/\ntheorem ker_comp_eq {X Y Z : Type*} [Group X] [Group Y] [Group Z] (f : X →* Y) (g : Y →* Z)\n (hg : Function.Injective g) : (g.comp f).ker = f.ker := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d3-t0068"}
+{"id": "group-theory-inverse-d3-t0069", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 3, "seed": 69, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(M\\) be a monoid in which every element \\(x\\) has some \\(y\\) with \\(yx = 1\\). Then \\(yx = 1\\) implies \\(xy = 1\\) for all \\(x, y \\in M\\). Under the same hypothesis, if \\(y x = 1\\) and \\(z x = 1\\) then \\(y = z\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- One-sided inverses are two-sided. -/\ntheorem right_inverse_comm {N : Type*} [Monoid N] (h : ∀ x : N, ∃ y, y * x = 1) :\n ∀ x y : N, y * x = 1 → x * y = 1 := by\n sorry\n\n/-- The inverse is unique. -/\ntheorem inverse_unique {N : Type*} [Monoid N] (h : ∀ x : N, ∃ y, y * x = 1) (x y z : N)\n (h1 : y * x = 1) (h2 : z * x = 1) : y = z := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d3-t0069"}
+{"id": "group-theory-involution-d3-t0070", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 3, "seed": 70, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\(aba = b \\text{ for all } a, b\\). Then every element of \\(G\\) lies in the center of \\(G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {Q : Type*} [Group Q] (h : ∀ g k : Q, g * k * g = k) :\n ∀ z : Q, z ∈ Subgroup.center Q := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d3-t0070"}
+{"id": "group-theory-subgroup-d3-t0071", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 3, "seed": 71, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(H\\) and \\(K\\) be subgroups of a group \\(G\\) such that whenever \\(a\\) and \\(b\\) each lie in \\(H\\) or in \\(K\\), the product \\(ab\\) lies in \\(H\\) or in \\(K\\). Then \\(H \\subseteq K\\) or \\(K \\subseteq H\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A product-closed union of two subgroups is one of them. -/\ntheorem subgroup_union {G : Type*} [Group G] (H K : Subgroup G)\n (h : ∀ a b : G, (a ∈ H ∨ a ∈ K) → (b ∈ H ∨ b ∈ K) → (a * b ∈ H ∨ a * b ∈ K)) : H ≤ K ∨ K ≤ H := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d3-t0071"}
+{"id": "group-theory-hom-d1-t0072", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 1, "seed": 72, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) be a group homomorphism and \\(p, q \\in G\\) with \\(f(p) = e\\). Then \\(q p q^{-1} p^{-1}\\) lies in the kernel of \\(f\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Commutators with a kernel element lie in the kernel. -/\ntheorem commutator_in_kernel {A B : Type*} [Group A] [Group B] (f : A →* B) (p q : A)\n (hx : f p = 1) : q * p * q⁻¹ * p⁻¹ ∈ f.ker := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d1-t0072"}
+{"id": "group-theory-inverse-d1-t0073", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 1, "seed": 73, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(G\\) be a group and \\(t_{1}, t_{2}, t_{3} \\in G\\) with \\(t_{1} t_{2} t_{3} = e\\). Then \\(t_{2} t_{3} t_{1} = e\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A product equal to the identity stays equal to the identity after a cyclic rotation. -/\ntheorem rotate_product {A : Type*} [Group A] (t₁ t₂ t₃ : A)\n (h : t₁ * t₂ * t₃ = 1) : t₂ * t₃ * t₁ = 1 := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d1-t0073"}
+{"id": "group-theory-involution-d1-t0074", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 1, "seed": 74, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\(g \\cdot g = e \\text{ for every } g\\). Then \\(G\\) is commutative: \\(ab = ba\\) for all \\(a, b \\in G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {Q : Type*} [Group Q] (h : ∀ g : Q, g * g = 1) :\n ∀ p q : Q, p * q = q * p := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d1-t0074"}
+{"id": "group-theory-subgroup-d1-t0075", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 1, "seed": 75, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(H\\) be a subgroup of a group \\(G\\) and let \\(x\\), \\(y\\), \\(z\\) lie in \\(H\\). Then \\(x y^{-1} z \\in H\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A product of elements of a subgroup, with inverses and powers, lies in the subgroup. -/\ntheorem product_mem {Q : Type*} [Group Q] (H : Subgroup Q) {x y z : Q}\n (hx : x ∈ H) (hy : y ∈ H) (hz : z ∈ H) : x * y⁻¹ * z ∈ H := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d1-t0075"}
+{"id": "group-theory-hom-d2-t0076", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 2, "seed": 76, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) be a group homomorphism such that \\(f(s) = e\\) implies \\(s = e\\) for every \\(s \\in G\\). Then \\(f\\) is injective.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A homomorphism with trivial kernel is injective. -/\ntheorem injective_of_trivial_kernel {X Y : Type*} [Group X] [Group Y] (f : X →* Y)\n (h : ∀ s : X, f s = 1 → s = 1) : Function.Injective f := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d2-t0076"}
+{"id": "group-theory-inverse-d2-t0077", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 2, "seed": 77, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(G\\) be a group and \\(t_{1}, t_{2}, t_{3}, t_{4} \\in G\\) with \\(t_{1} t_{2} t_{3} t_{4} = e\\). Then \\(t_{4} t_{1} t_{2} t_{3} = e\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A product equal to the identity stays equal to the identity after a cyclic rotation. -/\ntheorem rotate_product {Q : Type*} [Group Q] (t₁ t₂ t₃ t₄ : Q)\n (h : t₁ * t₂ * t₃ * t₄ = 1) : t₄ * t₁ * t₂ * t₃ = 1 := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d2-t0077"}
+{"id": "group-theory-involution-d2-t0078", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 2, "seed": 78, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\((ab)^{-1} = a^{-1} b^{-1} \\text{ for all } a, b\\). Then every element of \\(G\\) lies in the center of \\(G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {A : Type*} [Group A] (h : ∀ g k : A, (g * k)⁻¹ = g⁻¹ * k⁻¹) :\n ∀ z : A, z ∈ Subgroup.center A := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d2-t0078"}
+{"id": "group-theory-subgroup-d2-t0079", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 2, "seed": 79, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(G\\) be a group with \\(|G| = 16\\) and \\(L\\) a subgroup of \\(G\\). Then \\(|L|\\) divides 16.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Lagrange: the order of a subgroup divides the order of the group. -/\ntheorem subgroup_card_dvd {A : Type*} [Group A] (hG : Nat.card A = 16) (L : Subgroup A) :\n Nat.card L ∣ 16 := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d2-t0079"}
+{"id": "group-theory-hom-d3-t0080", "env": "group-theory", "msc": "20", "family": "hom", "difficulty": 3, "seed": 80, "kind": "prove", "instruction": "# Kernels of group homomorphisms\n\nProve the following statement.\n\nLet \\(f : G \\to H\\) be a group homomorphism such that \\(f(s) = e\\) implies \\(s = e\\) for every \\(s \\in G\\). Then \\(f\\) is injective.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A homomorphism with trivial kernel is injective. -/\ntheorem injective_of_trivial_kernel {G K : Type*} [Group G] [Group K] (f : G →* K)\n (h : ∀ s : G, f s = 1 → s = 1) : Function.Injective f := by\n sorry\n", "path": "tasks/group-theory/group-theory-hom-d3-t0080"}
+{"id": "group-theory-inverse-d3-t0081", "env": "group-theory", "msc": "20", "family": "inverse", "difficulty": 3, "seed": 81, "kind": "prove", "instruction": "# Inverses and cancellation\n\nProve the following statement.\n\nLet \\(G\\) be a group and \\(a_{1}, a_{2}, a_{3}, a_{4}, a_{5}, a_{6}, a_{7} \\in G\\) with \\(a_{1} a_{2} a_{3} a_{4} a_{5} a_{6} a_{7} = e\\). Then \\(a_{7} a_{1} a_{2} a_{3} a_{4} a_{5} a_{6} = e\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A product equal to the identity stays equal to the identity after a cyclic rotation. -/\ntheorem rotate_product {Q : Type*} [Group Q] (a₁ a₂ a₃ a₄ a₅ a₆ a₇ : Q)\n (h : a₁ * a₂ * a₃ * a₄ * a₅ * a₆ * a₇ = 1) : a₇ * a₁ * a₂ * a₃ * a₄ * a₅ * a₆ = 1 := by\n sorry\n", "path": "tasks/group-theory/group-theory-inverse-d3-t0081"}
+{"id": "group-theory-involution-d3-t0082", "env": "group-theory", "msc": "20", "family": "involution", "difficulty": 3, "seed": 82, "kind": "prove", "instruction": "# Commutativity from a group law\n\nProve the following statement.\n\nLet \\(G\\) be a group such that \\(g^2 = e \\text{ for every } g\\). Then every element of \\(G\\) lies in the center of \\(G\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated consequence of the hypothesis on the group. -/\ntheorem group_commutes {A : Type*} [Group A] (h : ∀ g : A, g ^ 2 = 1) :\n ∀ z : A, z ∈ Subgroup.center A := by\n sorry\n", "path": "tasks/group-theory/group-theory-involution-d3-t0082"}
+{"id": "group-theory-subgroup-d3-t0083", "env": "group-theory", "msc": "20", "family": "subgroup", "difficulty": 3, "seed": 83, "kind": "prove", "instruction": "# Subgroups and their orders\n\nProve the following statement.\n\nLet \\(G\\) be a group with \\(|G| = 19\\). Then \\(x^{19} = e\\) for every \\(x \\in G\\), and every element \\(a \\neq e\\) has order exactly 19.\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Every element satisfies x^|G| = 1. -/\ntheorem pow_card {G : Type*} [Group G] (hG : Nat.card G = 19) (x : G) :\n x ^ 19 = 1 := by\n sorry\n\n/-- In a group of prime order p, every non-identity element has order p. -/\ntheorem order_prime {G : Type*} [Group G] (hG : Nat.card G = 19) (a : G) (hne : a ≠ 1) :\n orderOf a = 19 := by\n sorry\n", "path": "tasks/group-theory/group-theory-subgroup-d3-t0083"}
diff --git a/data/inequalities/eval.jsonl b/data/inequalities/eval.jsonl
new file mode 100644
index 0000000000000000000000000000000000000000..d56715a1dcda14179f98a5c52c563a8510b698ff
--- /dev/null
+++ b/data/inequalities/eval.jsonl
@@ -0,0 +1,24 @@
+{"id": "inequalities-abs_ineq-d1-e0000", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 1, "seed": 10000, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) and \\(y\\) be real numbers with \\(|x - 6| \\le 2\\) and \\(|y - 7| \\le 1\\). Prove that \\(|x - 3y + 15| \\le 5\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- An error bound for a linear combination. -/\ntheorem abs_linear_bound (x y : ℝ) (hx : |x - 6| ≤ 2) (hy : |y - 7| ≤ 1) :\n |x - 3 * y + 15| ≤ 5 := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d1-e0000"}
+{"id": "inequalities-amgm-d1-e0001", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 1, "seed": 10001, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(a\\) and \\(b\\) be real numbers with \\(4a + 6b = 12\\). Prove that \\[24ab \\le \\frac{12^2}{4}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The product is at most a quarter of the squared sum. -/\ntheorem amgm_constraint (a b : ℝ) (h : 4 * a + 6 * b = 12) :\n 24 * a * b ≤ 12 ^ 2 / 4 := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d1-e0001"}
+{"id": "inequalities-cauchy-d1-e0002", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 1, "seed": 10002, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(x\\) and \\(y\\), \\[(10x + 8y)^2 \\le 164\\,(x^2 + y^2).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A two-term Cauchy-Schwarz bound. -/\ntheorem cauchy_two (x y : ℝ) :\n (10 * x + 8 * y) ^ 2 ≤ 164 * (x ^ 2 + y ^ 2) := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d1-e0002"}
+{"id": "inequalities-monotone-d1-e0003", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 1, "seed": 10003, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(x \\le y\\), \\[x^5 + 8\\,x \\le y^5 + 8\\,y.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The function is non-decreasing. -/\ntheorem monotone_sum (x y : ℝ) (h : x ≤ y) :\n x ^ 5 + 8 * x ≤ y ^ 5 + 8 * y := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d1-e0003"}
+{"id": "inequalities-abs_ineq-d2-e0004", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 2, "seed": 10004, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for every real number \\(x\\), \\[9 \\le |x - 4| + |x - 13|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sum of two distances is at least p times the gap. -/\ntheorem abs_two_points (x : ℝ) :\n 9 ≤ |x - 4| + |x - 13| := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d2-e0004"}
+{"id": "inequalities-amgm-d2-e0005", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 2, "seed": 10005, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(a\\) and \\(b\\) be positive real numbers. Prove that \\[60 \\le 50\\frac{a}{b} + 18\\frac{b}{a}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A weighted sum of a ratio and its reciprocal is bounded below. -/\ntheorem amgm_ratio (a b : ℝ) (ha : 0 < a) (hb : 0 < b) :\n 60 ≤ 50 * (a / b) + 18 * (b / a) := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d2-e0005"}
+{"id": "inequalities-cauchy-d2-e0006", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 2, "seed": 10006, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) and \\(y\\) be real numbers with \\(x^2 + y^2 \\le 16\\). Prove that \\(8x + 15y \\le 68\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A linear form is bounded on a disc by the Cauchy-Schwarz inequality. -/\ntheorem cauchy_bound_circle (x y : ℝ) (h : x ^ 2 + y ^ 2 ≤ 16) :\n 8 * x + 15 * y ≤ 68 := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d2-e0006"}
+{"id": "inequalities-monotone-d2-e0007", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 2, "seed": 10007, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that the function \\(f(x) = 5\\,e^{x} + 4\\,x^5\\) is monotone on the real numbers: \\(x \\le y\\) implies \\(f(x) \\le f(y)\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The function is monotone. -/\ntheorem monotone_function : Monotone (fun x : ℝ => 5 * Real.exp x + 4 * x ^ 5) := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d2-e0007"}
+{"id": "inequalities-abs_ineq-d3-e0008", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 3, "seed": 10008, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(a \\le c\\) and \\(x\\), \\(c - a \\le |x - a| + |x - c|\\). Then prove that for every real \\(x\\), \\[11 \\le |x - 1| + |x - 6| + |x - 9| + |x - 9|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The sum of the distances to two points is at least their gap. -/\ntheorem pair_abs_bound (x a c : ℝ) (h : a ≤ c) :\n c - a ≤ |x - a| + |x - c| := by\n sorry\n\n/-- The sum of four distances is bounded below. -/\ntheorem four_points_abs (x : ℝ) :\n 11 ≤ |x - 1| + |x - 6| + |x - 9| + |x - 9| := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d3-e0008"}
+{"id": "inequalities-amgm-d3-e0009", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 3, "seed": 10009, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that \\(27xyz \\le (x+y+z)^3\\) for all non-negative real numbers \\(x, y, z\\). Then prove that for all non-negative real numbers \\(a, b, c\\), \\[486\\,abc \\le (a + 3b + 6c)^3.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The three-variable AM-GM inequality in cubic form. -/\ntheorem amgm_three (x y z : ℝ) (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 ≤ z) :\n 27 * x * y * z ≤ (x + y + z) ^ 3 := by\n sorry\n\n/-- The scaled three-variable inequality. -/\ntheorem amgm_three_scaled (a b c : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) (hc : 0 ≤ c) :\n 486 * a * b * c ≤ (a + 3 * b + 6 * c) ^ 3 := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d3-e0009"}
+{"id": "inequalities-cauchy-d3-e0010", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 3, "seed": 10010, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(u, v, w, x, y, z\\), \\[(ux + vy + wz)^2 \\le (u^2 + v^2 + w^2)(x^2 + y^2 + z^2).\\] Then let \\(x, y, z\\) be real numbers with \\(x^2 + y^2 + z^2 \\le 4\\) and prove that \\(4x - 4y - 7z \\le 18\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cauchy-Schwarz for three-term sums. -/\ntheorem cauchy_three (u v w x y z : ℝ) :\n (u * x + v * y + w * z) ^ 2 ≤ (u ^ 2 + v ^ 2 + w ^ 2) * (x ^ 2 + y ^ 2 + z ^ 2) := by\n sorry\n\n/-- A linear form is bounded on a ball. -/\ntheorem cauchy_bound_ball (x y z : ℝ) (h : x ^ 2 + y ^ 2 + z ^ 2 ≤ 4) :\n 4 * x - 4 * y - 7 * z ≤ 18 := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d3-e0010"}
+{"id": "inequalities-monotone-d3-e0011", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 3, "seed": 10011, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that \\(0 \\le \\ln(1 + y^2) - \\ln(1 + x^2)\\) for real numbers \\(0 < x \\le y\\). Then prove that for such \\(x, y\\), \\[0 \\le \\left(\\sqrt{y} + \\sinh y + 2\\,y^5 + 2\\,\\ln y + \\ln(1 + y^2)\\right) - \\left(\\sqrt{x} + \\sinh x + 2\\,x^5 + 2\\,\\ln x + \\ln(1 + x^2)\\right).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The logarithm of one plus a square is increasing on the positive reals. -/\ntheorem log_one_add_sq_mono (x y : ℝ) (hx : 0 < x) (h : x ≤ y) :\n 0 ≤ Real.log (1 + y ^ 2) - Real.log (1 + x ^ 2) := by\n sorry\n\n/-- The combination is non-decreasing on the positive reals. -/\ntheorem monotone_combination (x y : ℝ) (hx : 0 < x) (h : x ≤ y) :\n 0 ≤ (Real.sqrt y + Real.sinh y + 2 * y ^ 5 + 2 * Real.log y + Real.log (1 + y ^ 2)) - (Real.sqrt x + Real.sinh x + 2 * x ^ 5 + 2 * Real.log x + Real.log (1 + x ^ 2)) := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d3-e0011"}
+{"id": "inequalities-abs_ineq-d1-e0012", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 1, "seed": 10012, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) and \\(y\\) be real numbers with \\(|x + 1| \\le 5\\) and \\(|y - 8| \\le 1\\). Prove that \\(|6x - y + 14| \\le 31\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- An error bound for a linear combination. -/\ntheorem abs_linear_bound (x y : ℝ) (hx : |x + 1| ≤ 5) (hy : |y - 8| ≤ 1) :\n |6 * x - y + 14| ≤ 31 := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d1-e0012"}
+{"id": "inequalities-amgm-d1-e0013", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 1, "seed": 10013, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(a\\) and \\(b\\), \\[108\\,ab \\le (9a + 3b)^2.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A square-completion bound for two real numbers. -/\ntheorem two_var_amgm (a b : ℝ) :\n 108 * a * b ≤ (9 * a + 3 * b) ^ 2 := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d1-e0013"}
+{"id": "inequalities-cauchy-d1-e0014", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 1, "seed": 10014, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(x\\) and \\(y\\), \\[(9x + 4y)^2 \\le 97\\,(x^2 + y^2).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A two-term Cauchy-Schwarz bound. -/\ntheorem cauchy_two (x y : ℝ) :\n (9 * x + 4 * y) ^ 2 ≤ 97 * (x ^ 2 + y ^ 2) := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d1-e0014"}
+{"id": "inequalities-monotone-d1-e0015", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 1, "seed": 10015, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(x \\le y\\), \\[2\\,e^{x} \\le 2\\,e^{y}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The function is non-decreasing. -/\ntheorem monotone_sum (x y : ℝ) (h : x ≤ y) :\n 2 * Real.exp x ≤ 2 * Real.exp y := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d1-e0015"}
+{"id": "inequalities-abs_ineq-d2-e0016", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 2, "seed": 10016, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for every real number \\(x\\), \\[12 \\le 3|x - 5| + 3|x - 9|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sum of two distances is at least p times the gap. -/\ntheorem abs_two_points (x : ℝ) :\n 12 ≤ 3 * |x - 5| + 3 * |x - 9| := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d2-e0016"}
+{"id": "inequalities-amgm-d2-e0017", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 2, "seed": 10017, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) be a positive real number. Prove that \\[24 \\le 8x + \\frac{18}{x}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sum of a linear term and an inverse term is bounded below. -/\ntheorem amgm_linear_plus_inverse (x : ℝ) (hx : 0 < x) :\n 24 ≤ 8 * x + 18 / x := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d2-e0017"}
+{"id": "inequalities-cauchy-d2-e0018", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 2, "seed": 10018, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) and \\(y\\) be real numbers with \\(x^2 + y^2 \\le 25\\). Prove that \\(16x + 12y \\le 100\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A linear form is bounded on a disc by the Cauchy-Schwarz inequality. -/\ntheorem cauchy_bound_circle (x y : ℝ) (h : x ^ 2 + y ^ 2 ≤ 25) :\n 16 * x + 12 * y ≤ 100 := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d2-e0018"}
+{"id": "inequalities-monotone-d2-e0019", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 2, "seed": 10019, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that the function \\(f(x) = 2\\,\\arctan x + x^5\\) is monotone on the real numbers: \\(x \\le y\\) implies \\(f(x) \\le f(y)\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The function is monotone. -/\ntheorem monotone_function : Monotone (fun x : ℝ => 2 * Real.arctan x + x ^ 5) := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d2-e0019"}
+{"id": "inequalities-abs_ineq-d3-e0020", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 3, "seed": 10020, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(a \\le c\\) and \\(x\\), \\(c - a \\le |x - a| + |x - c|\\). Then prove that for every real \\(x\\), \\[6 \\le |x - 5| + |x - 7| + |x - 9| + |x - 9|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The sum of the distances to two points is at least their gap. -/\ntheorem pair_abs_bound (x a c : ℝ) (h : a ≤ c) :\n c - a ≤ |x - a| + |x - c| := by\n sorry\n\n/-- The sum of four distances is bounded below. -/\ntheorem four_points_abs (x : ℝ) :\n 6 ≤ |x - 5| + |x - 7| + |x - 9| + |x - 9| := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d3-e0020"}
+{"id": "inequalities-amgm-d3-e0021", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 3, "seed": 10021, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that \\(27xyz \\le (x+y+z)^3\\) for all non-negative real numbers \\(x, y, z\\). Then prove that for all non-negative real numbers \\(a, b, c\\), \\[378\\,abc \\le (7a + 2b + c)^3.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The three-variable AM-GM inequality in cubic form. -/\ntheorem amgm_three (x y z : ℝ) (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 ≤ z) :\n 27 * x * y * z ≤ (x + y + z) ^ 3 := by\n sorry\n\n/-- The scaled three-variable inequality. -/\ntheorem amgm_three_scaled (a b c : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) (hc : 0 ≤ c) :\n 378 * a * b * c ≤ (7 * a + 2 * b + c) ^ 3 := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d3-e0021"}
+{"id": "inequalities-cauchy-d3-e0022", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 3, "seed": 10022, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(u, v, w, x, y, z\\), \\[(ux + vy + wz)^2 \\le (u^2 + v^2 + w^2)(x^2 + y^2 + z^2).\\] Then let \\(x, y, z\\) be real numbers with \\(x^2 + y^2 + z^2 \\le 9\\) and prove that \\(-4x - 3y - 12z \\le 39\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cauchy-Schwarz for three-term sums. -/\ntheorem cauchy_three (u v w x y z : ℝ) :\n (u * x + v * y + w * z) ^ 2 ≤ (u ^ 2 + v ^ 2 + w ^ 2) * (x ^ 2 + y ^ 2 + z ^ 2) := by\n sorry\n\n/-- A linear form is bounded on a ball. -/\ntheorem cauchy_bound_ball (x y z : ℝ) (h : x ^ 2 + y ^ 2 + z ^ 2 ≤ 9) :\n -4 * x - 3 * y - 12 * z ≤ 39 := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d3-e0022"}
+{"id": "inequalities-monotone-d3-e0023", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 3, "seed": 10023, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that \\(0 \\le \\ln(1 + y^2) - \\ln(1 + x^2)\\) for real numbers \\(0 < x \\le y\\). Then prove that for such \\(x, y\\), \\[0 \\le \\left(5\\,e^{y} + 2\\,y^5 + 2\\,\\ln y + 3\\,\\ln(1 + y^2)\\right) - \\left(5\\,e^{x} + 2\\,x^5 + 2\\,\\ln x + 3\\,\\ln(1 + x^2)\\right).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The logarithm of one plus a square is increasing on the positive reals. -/\ntheorem log_one_add_sq_mono (x y : ℝ) (hx : 0 < x) (h : x ≤ y) :\n 0 ≤ Real.log (1 + y ^ 2) - Real.log (1 + x ^ 2) := by\n sorry\n\n/-- The combination is non-decreasing on the positive reals. -/\ntheorem monotone_combination (x y : ℝ) (hx : 0 < x) (h : x ≤ y) :\n 0 ≤ (5 * Real.exp y + 2 * y ^ 5 + 2 * Real.log y + 3 * Real.log (1 + y ^ 2)) - (5 * Real.exp x + 2 * x ^ 5 + 2 * Real.log x + 3 * Real.log (1 + x ^ 2)) := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d3-e0023"}
diff --git a/data/inequalities/train.jsonl b/data/inequalities/train.jsonl
new file mode 100644
index 0000000000000000000000000000000000000000..e0da28529667e0d62db0e9f4ece363902d3c84bc
--- /dev/null
+++ b/data/inequalities/train.jsonl
@@ -0,0 +1,84 @@
+{"id": "inequalities-abs_ineq-d1-t0000", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 1, "seed": 0, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) and \\(y\\) be real numbers with \\(|x + 1| \\le 2\\) and \\(|y - 9| \\le 4\\). Prove that \\(|5x - 9y + 86| \\le 46\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- An error bound for a linear combination. -/\ntheorem abs_linear_bound (x y : ℝ) (hx : |x + 1| ≤ 2) (hy : |y - 9| ≤ 4) :\n |5 * x - 9 * y + 86| ≤ 46 := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d1-t0000"}
+{"id": "inequalities-amgm-d1-t0001", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 1, "seed": 1, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(a\\) and \\(b\\) be real numbers with \\(a + 4b = 23\\). Prove that \\[4ab \\le \\frac{23^2}{4}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The product is at most a quarter of the squared sum. -/\ntheorem amgm_constraint (a b : ℝ) (h : a + 4 * b = 23) :\n 4 * a * b ≤ 23 ^ 2 / 4 := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d1-t0001"}
+{"id": "inequalities-cauchy-d1-t0002", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 1, "seed": 2, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(a, b, c, d\\), \\[(7ac + bd)^2 \\le (7a^2 + b^2)(7c^2 + d^2).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Cauchy-Schwarz with positive weights for two pairs. -/\ntheorem weighted_cauchy (a b c d : ℝ) :\n (7 * a * c + b * d) ^ 2 ≤ (7 * a ^ 2 + b ^ 2) * (7 * c ^ 2 + d ^ 2) := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d1-t0002"}
+{"id": "inequalities-monotone-d1-t0003", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 1, "seed": 3, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(x \\le y\\), \\[9\\,x^3 + 7\\,x \\le 9\\,y^3 + 7\\,y.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The function is non-decreasing. -/\ntheorem monotone_sum (x y : ℝ) (h : x ≤ y) :\n 9 * x ^ 3 + 7 * x ≤ 9 * y ^ 3 + 7 * y := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d1-t0003"}
+{"id": "inequalities-abs_ineq-d2-t0004", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 2, "seed": 4, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) be a real number with \\(|x + 6| \\le 5\\). Prove that \\(|x^2 - (-6)^2| \\le 5(5 + 12)\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A bound on a difference of squares near a point. -/\ntheorem abs_square_bound (x : ℝ) (h : |x + 6| ≤ 5) :\n |x ^ 2 - (-6) ^ 2| ≤ 5 * (5 + 2 * 6) := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d2-t0004"}
+{"id": "inequalities-amgm-d2-t0005", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 2, "seed": 5, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(a\\) and \\(b\\) be positive real numbers. Prove that \\[48 \\le 16\\frac{a}{b} + 36\\frac{b}{a}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A weighted sum of a ratio and its reciprocal is bounded below. -/\ntheorem amgm_ratio (a b : ℝ) (ha : 0 < a) (hb : 0 < b) :\n 48 ≤ 16 * (a / b) + 36 * (b / a) := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d2-t0005"}
+{"id": "inequalities-cauchy-d2-t0006", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 2, "seed": 6, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) and \\(y\\) be real numbers with \\(x^2 + y^2 \\le 9\\). Prove that \\(12x - 16y \\le 60\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A linear form is bounded on a disc by the Cauchy-Schwarz inequality. -/\ntheorem cauchy_bound_circle (x y : ℝ) (h : x ^ 2 + y ^ 2 ≤ 9) :\n 12 * x - 16 * y ≤ 60 := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d2-t0006"}
+{"id": "inequalities-monotone-d2-t0007", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 2, "seed": 7, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that the function \\(f(x) = 3\\,e^{x} + 5\\,x^5 + x^3\\) is monotone on the real numbers: \\(x \\le y\\) implies \\(f(x) \\le f(y)\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The function is monotone. -/\ntheorem monotone_function : Monotone (fun x : ℝ => 3 * Real.exp x + 5 * x ^ 5 + x ^ 3) := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d2-t0007"}
+{"id": "inequalities-abs_ineq-d3-t0008", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 3, "seed": 8, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(a \\le c\\) and \\(x\\), \\(c - a \\le |x - a| + |x - c|\\). Then prove that for every real \\(x\\), \\[4 \\le |x - 1| + |x - 1| + |x - 2| + |x - 4|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The sum of the distances to two points is at least their gap. -/\ntheorem pair_abs_bound (x a c : ℝ) (h : a ≤ c) :\n c - a ≤ |x - a| + |x - c| := by\n sorry\n\n/-- The sum of four distances is bounded below. -/\ntheorem four_points_abs (x : ℝ) :\n 4 ≤ |x - 1| + |x - 1| + |x - 2| + |x - 4| := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d3-t0008"}
+{"id": "inequalities-amgm-d3-t0009", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 3, "seed": 9, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that \\(27xyz \\le (x+y+z)^3\\) for all non-negative real numbers \\(x, y, z\\). Then prove that for all non-negative real numbers \\(a, b, c\\), \\[6615\\,abc \\le (5a + 7b + 7c)^3.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The three-variable AM-GM inequality in cubic form. -/\ntheorem amgm_three (x y z : ℝ) (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 ≤ z) :\n 27 * x * y * z ≤ (x + y + z) ^ 3 := by\n sorry\n\n/-- The scaled three-variable inequality. -/\ntheorem amgm_three_scaled (a b c : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) (hc : 0 ≤ c) :\n 6615 * a * b * c ≤ (5 * a + 7 * b + 7 * c) ^ 3 := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d3-t0009"}
+{"id": "inequalities-cauchy-d3-t0010", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 3, "seed": 10, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(u, v, w, x, y, z\\), \\[(ux + vy + wz)^2 \\le (u^2 + v^2 + w^2)(x^2 + y^2 + z^2).\\] Then let \\(x, y, z\\) be real numbers with \\(x^2 + y^2 + z^2 \\le 4\\) and prove that \\(-6x - 9y - 2z \\le 22\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cauchy-Schwarz for three-term sums. -/\ntheorem cauchy_three (u v w x y z : ℝ) :\n (u * x + v * y + w * z) ^ 2 ≤ (u ^ 2 + v ^ 2 + w ^ 2) * (x ^ 2 + y ^ 2 + z ^ 2) := by\n sorry\n\n/-- A linear form is bounded on a ball. -/\ntheorem cauchy_bound_ball (x y z : ℝ) (h : x ^ 2 + y ^ 2 + z ^ 2 ≤ 4) :\n -6 * x - 9 * y - 2 * z ≤ 22 := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d3-t0010"}
+{"id": "inequalities-monotone-d3-t0011", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 3, "seed": 11, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that \\(0 \\le \\ln(1 + y^2) - \\ln(1 + x^2)\\) for real numbers \\(0 < x \\le y\\). Then prove that for such \\(x, y\\), \\[0 \\le \\left(4\\,y^2 + 5\\,\\sinh y + \\sqrt{y} + \\ln(1 + y^2)\\right) - \\left(4\\,x^2 + 5\\,\\sinh x + \\sqrt{x} + \\ln(1 + x^2)\\right).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The logarithm of one plus a square is increasing on the positive reals. -/\ntheorem log_one_add_sq_mono (x y : ℝ) (hx : 0 < x) (h : x ≤ y) :\n 0 ≤ Real.log (1 + y ^ 2) - Real.log (1 + x ^ 2) := by\n sorry\n\n/-- The combination is non-decreasing on the positive reals. -/\ntheorem monotone_combination (x y : ℝ) (hx : 0 < x) (h : x ≤ y) :\n 0 ≤ (4 * y ^ 2 + 5 * Real.sinh y + Real.sqrt y + Real.log (1 + y ^ 2)) - (4 * x ^ 2 + 5 * Real.sinh x + Real.sqrt x + Real.log (1 + x ^ 2)) := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d3-t0011"}
+{"id": "inequalities-abs_ineq-d1-t0012", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 1, "seed": 12, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) and \\(y\\) be real numbers with \\(|x + 5| \\le 2\\) and \\(|y + 4| \\le 1\\). Prove that \\(|9x - 9y + 9| \\le 27\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- An error bound for a linear combination. -/\ntheorem abs_linear_bound (x y : ℝ) (hx : |x + 5| ≤ 2) (hy : |y + 4| ≤ 1) :\n |9 * x - 9 * y + 9| ≤ 27 := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d1-t0012"}
+{"id": "inequalities-amgm-d1-t0013", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 1, "seed": 13, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(a\\) and \\(b\\) be real numbers with \\(a + 6b = 33\\). Prove that \\[6ab \\le \\frac{33^2}{4}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The product is at most a quarter of the squared sum. -/\ntheorem amgm_constraint (a b : ℝ) (h : a + 6 * b = 33) :\n 6 * a * b ≤ 33 ^ 2 / 4 := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d1-t0013"}
+{"id": "inequalities-cauchy-d1-t0014", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 1, "seed": 14, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(a, b, c, d\\), \\[(5ac + 4bd)^2 \\le (5a^2 + 4b^2)(5c^2 + 4d^2).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Cauchy-Schwarz with positive weights for two pairs. -/\ntheorem weighted_cauchy (a b c d : ℝ) :\n (5 * a * c + 4 * b * d) ^ 2 ≤ (5 * a ^ 2 + 4 * b ^ 2) * (5 * c ^ 2 + 4 * d ^ 2) := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d1-t0014"}
+{"id": "inequalities-monotone-d1-t0015", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 1, "seed": 15, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(x \\le y\\), \\[8\\,x^5 + 4\\,x \\le 8\\,y^5 + 4\\,y.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The function is non-decreasing. -/\ntheorem monotone_sum (x y : ℝ) (h : x ≤ y) :\n 8 * x ^ 5 + 4 * x ≤ 8 * y ^ 5 + 4 * y := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d1-t0015"}
+{"id": "inequalities-abs_ineq-d2-t0016", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 2, "seed": 16, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) be a real number with \\(|x + 1| \\le 1\\). Prove that \\(|x^2 - (-1)^2| \\le 1(1 + 2)\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A bound on a difference of squares near a point. -/\ntheorem abs_square_bound (x : ℝ) (h : |x + 1| ≤ 1) :\n |x ^ 2 - (-1) ^ 2| ≤ 1 * (1 + 2 * 1) := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d2-t0016"}
+{"id": "inequalities-amgm-d2-t0017", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 2, "seed": 17, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) be a positive real number. Prove that \\[8 \\le x + \\frac{16}{x}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sum of a linear term and an inverse term is bounded below. -/\ntheorem amgm_linear_plus_inverse (x : ℝ) (hx : 0 < x) :\n 8 ≤ x + 16 / x := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d2-t0017"}
+{"id": "inequalities-cauchy-d2-t0018", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 2, "seed": 18, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) and \\(y\\) be real numbers with \\(x^2 + y^2 \\le 25\\). Prove that \\(20x + 21y \\le 145\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A linear form is bounded on a disc by the Cauchy-Schwarz inequality. -/\ntheorem cauchy_bound_circle (x y : ℝ) (h : x ^ 2 + y ^ 2 ≤ 25) :\n 20 * x + 21 * y ≤ 145 := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d2-t0018"}
+{"id": "inequalities-monotone-d2-t0019", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 2, "seed": 19, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that the function \\(f(x) = 4\\,\\arctan x + 6\\,x^3 + x\\) is monotone on the real numbers: \\(x \\le y\\) implies \\(f(x) \\le f(y)\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The function is monotone. -/\ntheorem monotone_function : Monotone (fun x : ℝ => 4 * Real.arctan x + 6 * x ^ 3 + x) := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d2-t0019"}
+{"id": "inequalities-abs_ineq-d3-t0020", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 3, "seed": 20, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(a \\le c\\) and \\(x\\), \\(c - a \\le |x - a| + |x - c|\\). Then prove that for every real \\(x\\), \\[10 \\le |x - 2| + |x - 4| + |x - 8| + |x - 8|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The sum of the distances to two points is at least their gap. -/\ntheorem pair_abs_bound (x a c : ℝ) (h : a ≤ c) :\n c - a ≤ |x - a| + |x - c| := by\n sorry\n\n/-- The sum of four distances is bounded below. -/\ntheorem four_points_abs (x : ℝ) :\n 10 ≤ |x - 2| + |x - 4| + |x - 8| + |x - 8| := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d3-t0020"}
+{"id": "inequalities-amgm-d3-t0021", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 3, "seed": 21, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that \\(27xyz \\le (x+y+z)^3\\) for all non-negative real numbers \\(x, y, z\\). Then prove that for all non-negative real numbers \\(a, b, c\\), \\[2646\\,abc \\le (2a + 7b + 7c)^3.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The three-variable AM-GM inequality in cubic form. -/\ntheorem amgm_three (x y z : ℝ) (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 ≤ z) :\n 27 * x * y * z ≤ (x + y + z) ^ 3 := by\n sorry\n\n/-- The scaled three-variable inequality. -/\ntheorem amgm_three_scaled (a b c : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) (hc : 0 ≤ c) :\n 2646 * a * b * c ≤ (2 * a + 7 * b + 7 * c) ^ 3 := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d3-t0021"}
+{"id": "inequalities-cauchy-d3-t0022", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 3, "seed": 22, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(u, v, w, x, y, z\\), \\[(ux + vy + wz)^2 \\le (u^2 + v^2 + w^2)(x^2 + y^2 + z^2).\\] Then let \\(x, y, z\\) be real numbers with \\(x^2 + y^2 + z^2 \\le 16\\) and prove that \\(-3x - 4y + 12z \\le 52\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cauchy-Schwarz for three-term sums. -/\ntheorem cauchy_three (u v w x y z : ℝ) :\n (u * x + v * y + w * z) ^ 2 ≤ (u ^ 2 + v ^ 2 + w ^ 2) * (x ^ 2 + y ^ 2 + z ^ 2) := by\n sorry\n\n/-- A linear form is bounded on a ball. -/\ntheorem cauchy_bound_ball (x y z : ℝ) (h : x ^ 2 + y ^ 2 + z ^ 2 ≤ 16) :\n -3 * x - 4 * y + 12 * z ≤ 52 := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d3-t0022"}
+{"id": "inequalities-monotone-d3-t0023", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 3, "seed": 23, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that \\(0 \\le \\ln(1 + y^2) - \\ln(1 + x^2)\\) for real numbers \\(0 < x \\le y\\). Then prove that for such \\(x, y\\), \\[0 \\le \\left(e^{y} + 5\\,\\ln y + 3\\,\\sqrt{y} + 3\\,\\ln(1 + y^2)\\right) - \\left(e^{x} + 5\\,\\ln x + 3\\,\\sqrt{x} + 3\\,\\ln(1 + x^2)\\right).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The logarithm of one plus a square is increasing on the positive reals. -/\ntheorem log_one_add_sq_mono (x y : ℝ) (hx : 0 < x) (h : x ≤ y) :\n 0 ≤ Real.log (1 + y ^ 2) - Real.log (1 + x ^ 2) := by\n sorry\n\n/-- The combination is non-decreasing on the positive reals. -/\ntheorem monotone_combination (x y : ℝ) (hx : 0 < x) (h : x ≤ y) :\n 0 ≤ (Real.exp y + 5 * Real.log y + 3 * Real.sqrt y + 3 * Real.log (1 + y ^ 2)) - (Real.exp x + 5 * Real.log x + 3 * Real.sqrt x + 3 * Real.log (1 + x ^ 2)) := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d3-t0023"}
+{"id": "inequalities-abs_ineq-d1-t0024", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 1, "seed": 24, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) and \\(y\\) be real numbers with \\(|x + 6| \\le 7\\) and \\(|y + 6| \\le 3\\). Prove that \\(|2x - 7y - 30| \\le 35\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- An error bound for a linear combination. -/\ntheorem abs_linear_bound (x y : ℝ) (hx : |x + 6| ≤ 7) (hy : |y + 6| ≤ 3) :\n |2 * x - 7 * y - 30| ≤ 35 := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d1-t0024"}
+{"id": "inequalities-amgm-d1-t0025", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 1, "seed": 25, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(a\\) and \\(b\\) be real numbers with \\(2a + 2b = 1\\). Prove that \\[4ab \\le \\frac{1^2}{4}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The product is at most a quarter of the squared sum. -/\ntheorem amgm_constraint (a b : ℝ) (h : 2 * a + 2 * b = 1) :\n 4 * a * b ≤ 1 ^ 2 / 4 := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d1-t0025"}
+{"id": "inequalities-cauchy-d1-t0026", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 1, "seed": 26, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(x\\) and \\(y\\), \\[(8x + 4y)^2 \\le 80\\,(x^2 + y^2).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A two-term Cauchy-Schwarz bound. -/\ntheorem cauchy_two (x y : ℝ) :\n (8 * x + 4 * y) ^ 2 ≤ 80 * (x ^ 2 + y ^ 2) := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d1-t0026"}
+{"id": "inequalities-monotone-d1-t0027", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 1, "seed": 27, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(x \\le y\\), \\[9\\,e^{x} \\le 9\\,e^{y}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The function is non-decreasing. -/\ntheorem monotone_sum (x y : ℝ) (h : x ≤ y) :\n 9 * Real.exp x ≤ 9 * Real.exp y := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d1-t0027"}
+{"id": "inequalities-abs_ineq-d2-t0028", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 2, "seed": 28, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) be a real number with \\(|x + 6| \\le 2\\). Prove that \\(|x^2 - (-6)^2| \\le 2(2 + 12)\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A bound on a difference of squares near a point. -/\ntheorem abs_square_bound (x : ℝ) (h : |x + 6| ≤ 2) :\n |x ^ 2 - (-6) ^ 2| ≤ 2 * (2 + 2 * 6) := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d2-t0028"}
+{"id": "inequalities-amgm-d2-t0029", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 2, "seed": 29, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) be a positive real number. Prove that \\[40 \\le 50x + \\frac{8}{x}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sum of a linear term and an inverse term is bounded below. -/\ntheorem amgm_linear_plus_inverse (x : ℝ) (hx : 0 < x) :\n 40 ≤ 50 * x + 8 / x := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d2-t0029"}
+{"id": "inequalities-cauchy-d2-t0030", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 2, "seed": 30, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) and \\(y\\) be real numbers with \\(x^2 + y^2 \\le 25\\). Prove that \\(5x - 12y \\le 65\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A linear form is bounded on a disc by the Cauchy-Schwarz inequality. -/\ntheorem cauchy_bound_circle (x y : ℝ) (h : x ^ 2 + y ^ 2 ≤ 25) :\n 5 * x - 12 * y ≤ 65 := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d2-t0030"}
+{"id": "inequalities-monotone-d2-t0031", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 2, "seed": 31, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that the function \\(f(x) = 4\\,x^3 + 6\\,\\arctan x + 6\\,\\sinh x\\) is monotone on the real numbers: \\(x \\le y\\) implies \\(f(x) \\le f(y)\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The function is monotone. -/\ntheorem monotone_function : Monotone (fun x : ℝ => 4 * x ^ 3 + 6 * Real.arctan x + 6 * Real.sinh x) := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d2-t0031"}
+{"id": "inequalities-abs_ineq-d3-t0032", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 3, "seed": 32, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(a \\le c\\) and \\(x\\), \\(c - a \\le |x - a| + |x - c|\\). Then prove that for every real \\(x\\), \\[12 \\le |x - 2| + |x - 2| + |x - 7| + |x - 9|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The sum of the distances to two points is at least their gap. -/\ntheorem pair_abs_bound (x a c : ℝ) (h : a ≤ c) :\n c - a ≤ |x - a| + |x - c| := by\n sorry\n\n/-- The sum of four distances is bounded below. -/\ntheorem four_points_abs (x : ℝ) :\n 12 ≤ |x - 2| + |x - 2| + |x - 7| + |x - 9| := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d3-t0032"}
+{"id": "inequalities-amgm-d3-t0033", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 3, "seed": 33, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that \\(27xyz \\le (x+y+z)^3\\) for all non-negative real numbers \\(x, y, z\\). Then prove that for all non-negative real numbers \\(a, b, c\\), \\[135\\,abc \\le (5a + b + c)^3.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The three-variable AM-GM inequality in cubic form. -/\ntheorem amgm_three (x y z : ℝ) (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 ≤ z) :\n 27 * x * y * z ≤ (x + y + z) ^ 3 := by\n sorry\n\n/-- The scaled three-variable inequality. -/\ntheorem amgm_three_scaled (a b c : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) (hc : 0 ≤ c) :\n 135 * a * b * c ≤ (5 * a + b + c) ^ 3 := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d3-t0033"}
+{"id": "inequalities-cauchy-d3-t0034", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 3, "seed": 34, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(u, v, w, x, y, z\\), \\[(ux + vy + wz)^2 \\le (u^2 + v^2 + w^2)(x^2 + y^2 + z^2).\\] Then let \\(x, y, z\\) be real numbers with \\(x^2 + y^2 + z^2 \\le 16\\) and prove that \\(x - 2y + 2z \\le 12\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cauchy-Schwarz for three-term sums. -/\ntheorem cauchy_three (u v w x y z : ℝ) :\n (u * x + v * y + w * z) ^ 2 ≤ (u ^ 2 + v ^ 2 + w ^ 2) * (x ^ 2 + y ^ 2 + z ^ 2) := by\n sorry\n\n/-- A linear form is bounded on a ball. -/\ntheorem cauchy_bound_ball (x y z : ℝ) (h : x ^ 2 + y ^ 2 + z ^ 2 ≤ 16) :\n x - 2 * y + 2 * z ≤ 12 := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d3-t0034"}
+{"id": "inequalities-monotone-d3-t0035", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 3, "seed": 35, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that \\(0 \\le \\ln(1 + y^2) - \\ln(1 + x^2)\\) for real numbers \\(0 < x \\le y\\). Then prove that for such \\(x, y\\), \\[0 \\le \\left(5\\,\\arctan y + 2\\,y^2 + 2\\,\\sinh y + 4\\,\\ln(1 + y^2)\\right) - \\left(5\\,\\arctan x + 2\\,x^2 + 2\\,\\sinh x + 4\\,\\ln(1 + x^2)\\right).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The logarithm of one plus a square is increasing on the positive reals. -/\ntheorem log_one_add_sq_mono (x y : ℝ) (hx : 0 < x) (h : x ≤ y) :\n 0 ≤ Real.log (1 + y ^ 2) - Real.log (1 + x ^ 2) := by\n sorry\n\n/-- The combination is non-decreasing on the positive reals. -/\ntheorem monotone_combination (x y : ℝ) (hx : 0 < x) (h : x ≤ y) :\n 0 ≤ (5 * Real.arctan y + 2 * y ^ 2 + 2 * Real.sinh y + 4 * Real.log (1 + y ^ 2)) - (5 * Real.arctan x + 2 * x ^ 2 + 2 * Real.sinh x + 4 * Real.log (1 + x ^ 2)) := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d3-t0035"}
+{"id": "inequalities-abs_ineq-d1-t0036", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 1, "seed": 36, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) and \\(y\\) be real numbers with \\(|x - 8| \\le 1\\) and \\(|y - 4| \\le 3\\). Prove that \\(|2x - 4y| \\le 14\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- An error bound for a linear combination. -/\ntheorem abs_linear_bound (x y : ℝ) (hx : |x - 8| ≤ 1) (hy : |y - 4| ≤ 3) :\n |2 * x - 4 * y| ≤ 14 := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d1-t0036"}
+{"id": "inequalities-amgm-d1-t0037", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 1, "seed": 37, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(a\\) and \\(b\\), \\[168\\,ab \\le (7a + 6b)^2.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A square-completion bound for two real numbers. -/\ntheorem two_var_amgm (a b : ℝ) :\n 168 * a * b ≤ (7 * a + 6 * b) ^ 2 := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d1-t0037"}
+{"id": "inequalities-cauchy-d1-t0038", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 1, "seed": 38, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(a, b, c, d\\), \\[(7ac + 3bd)^2 \\le (7a^2 + 3b^2)(7c^2 + 3d^2).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Cauchy-Schwarz with positive weights for two pairs. -/\ntheorem weighted_cauchy (a b c d : ℝ) :\n (7 * a * c + 3 * b * d) ^ 2 ≤ (7 * a ^ 2 + 3 * b ^ 2) * (7 * c ^ 2 + 3 * d ^ 2) := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d1-t0038"}
+{"id": "inequalities-monotone-d1-t0039", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 1, "seed": 39, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(x \\le y\\), \\[6\\,\\sinh x + 3\\,x \\le 6\\,\\sinh y + 3\\,y.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The function is non-decreasing. -/\ntheorem monotone_sum (x y : ℝ) (h : x ≤ y) :\n 6 * Real.sinh x + 3 * x ≤ 6 * Real.sinh y + 3 * y := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d1-t0039"}
+{"id": "inequalities-abs_ineq-d2-t0040", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 2, "seed": 40, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for every real number \\(x\\), \\[33 \\le 3|x - 6| + 3|x - 17|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sum of two distances is at least p times the gap. -/\ntheorem abs_two_points (x : ℝ) :\n 33 ≤ 3 * |x - 6| + 3 * |x - 17| := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d2-t0040"}
+{"id": "inequalities-amgm-d2-t0041", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 2, "seed": 41, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(a\\) and \\(b\\) be positive real numbers. Prove that \\[72 \\le 36\\frac{a}{b} + 36\\frac{b}{a}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A weighted sum of a ratio and its reciprocal is bounded below. -/\ntheorem amgm_ratio (a b : ℝ) (ha : 0 < a) (hb : 0 < b) :\n 72 ≤ 36 * (a / b) + 36 * (b / a) := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d2-t0041"}
+{"id": "inequalities-cauchy-d2-t0042", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 2, "seed": 42, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) and \\(y\\) be real numbers with \\(x^2 + y^2 \\le 4\\). Prove that \\(20x - 21y \\le 58\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A linear form is bounded on a disc by the Cauchy-Schwarz inequality. -/\ntheorem cauchy_bound_circle (x y : ℝ) (h : x ^ 2 + y ^ 2 ≤ 4) :\n 20 * x - 21 * y ≤ 58 := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d2-t0042"}
+{"id": "inequalities-monotone-d2-t0043", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 2, "seed": 43, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that the function \\(f(x) = 6\\,x^3 + 5\\,\\arctan x + 2\\,\\sinh x\\) is monotone on the real numbers: \\(x \\le y\\) implies \\(f(x) \\le f(y)\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The function is monotone. -/\ntheorem monotone_function : Monotone (fun x : ℝ => 6 * x ^ 3 + 5 * Real.arctan x + 2 * Real.sinh x) := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d2-t0043"}
+{"id": "inequalities-abs_ineq-d3-t0044", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 3, "seed": 44, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(a \\le c\\) and \\(x\\), \\(c - a \\le |x - a| + |x - c|\\). Then prove that for every real \\(x\\), \\[5 \\le |x - 2| + |x - 2| + |x - 4| + |x - 5|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The sum of the distances to two points is at least their gap. -/\ntheorem pair_abs_bound (x a c : ℝ) (h : a ≤ c) :\n c - a ≤ |x - a| + |x - c| := by\n sorry\n\n/-- The sum of four distances is bounded below. -/\ntheorem four_points_abs (x : ℝ) :\n 5 ≤ |x - 2| + |x - 2| + |x - 4| + |x - 5| := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d3-t0044"}
+{"id": "inequalities-amgm-d3-t0045", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 3, "seed": 45, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that \\(27xyz \\le (x+y+z)^3\\) for all non-negative real numbers \\(x, y, z\\). Then prove that for all non-negative real numbers \\(a, b, c\\), \\[486\\,abc \\le (3a + 2b + 3c)^3.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The three-variable AM-GM inequality in cubic form. -/\ntheorem amgm_three (x y z : ℝ) (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 ≤ z) :\n 27 * x * y * z ≤ (x + y + z) ^ 3 := by\n sorry\n\n/-- The scaled three-variable inequality. -/\ntheorem amgm_three_scaled (a b c : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) (hc : 0 ≤ c) :\n 486 * a * b * c ≤ (3 * a + 2 * b + 3 * c) ^ 3 := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d3-t0045"}
+{"id": "inequalities-cauchy-d3-t0046", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 3, "seed": 46, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(u, v, w, x, y, z\\), \\[(ux + vy + wz)^2 \\le (u^2 + v^2 + w^2)(x^2 + y^2 + z^2).\\] Then let \\(x, y, z\\) be real numbers with \\(x^2 + y^2 + z^2 \\le 9\\) and prove that \\(2x - 10y - 11z \\le 45\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cauchy-Schwarz for three-term sums. -/\ntheorem cauchy_three (u v w x y z : ℝ) :\n (u * x + v * y + w * z) ^ 2 ≤ (u ^ 2 + v ^ 2 + w ^ 2) * (x ^ 2 + y ^ 2 + z ^ 2) := by\n sorry\n\n/-- A linear form is bounded on a ball. -/\ntheorem cauchy_bound_ball (x y z : ℝ) (h : x ^ 2 + y ^ 2 + z ^ 2 ≤ 9) :\n 2 * x - 10 * y - 11 * z ≤ 45 := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d3-t0046"}
+{"id": "inequalities-monotone-d3-t0047", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 3, "seed": 47, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that \\(0 \\le \\ln(1 + y^2) - \\ln(1 + x^2)\\) for real numbers \\(0 < x \\le y\\). Then prove that for such \\(x, y\\), \\[0 \\le \\left(3\\,e^{y} + 2\\,\\ln y + \\ln(1 + y^2)\\right) - \\left(3\\,e^{x} + 2\\,\\ln x + \\ln(1 + x^2)\\right).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The logarithm of one plus a square is increasing on the positive reals. -/\ntheorem log_one_add_sq_mono (x y : ℝ) (hx : 0 < x) (h : x ≤ y) :\n 0 ≤ Real.log (1 + y ^ 2) - Real.log (1 + x ^ 2) := by\n sorry\n\n/-- The combination is non-decreasing on the positive reals. -/\ntheorem monotone_combination (x y : ℝ) (hx : 0 < x) (h : x ≤ y) :\n 0 ≤ (3 * Real.exp y + 2 * Real.log y + Real.log (1 + y ^ 2)) - (3 * Real.exp x + 2 * Real.log x + Real.log (1 + x ^ 2)) := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d3-t0047"}
+{"id": "inequalities-abs_ineq-d1-t0048", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 1, "seed": 48, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) and \\(y\\) be real numbers with \\(|x - 2| \\le 8\\) and \\(|y - 9| \\le 3\\). Prove that \\(|7x - 3y + 13| \\le 65\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- An error bound for a linear combination. -/\ntheorem abs_linear_bound (x y : ℝ) (hx : |x - 2| ≤ 8) (hy : |y - 9| ≤ 3) :\n |7 * x - 3 * y + 13| ≤ 65 := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d1-t0048"}
+{"id": "inequalities-amgm-d1-t0049", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 1, "seed": 49, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(a\\) and \\(b\\), \\[144\\,ab \\le (4a + 9b)^2.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A square-completion bound for two real numbers. -/\ntheorem two_var_amgm (a b : ℝ) :\n 144 * a * b ≤ (4 * a + 9 * b) ^ 2 := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d1-t0049"}
+{"id": "inequalities-cauchy-d1-t0050", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 1, "seed": 50, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(a, b, c, d\\), \\[(7ac + 3bd)^2 \\le (7a^2 + 3b^2)(7c^2 + 3d^2).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Cauchy-Schwarz with positive weights for two pairs. -/\ntheorem weighted_cauchy (a b c d : ℝ) :\n (7 * a * c + 3 * b * d) ^ 2 ≤ (7 * a ^ 2 + 3 * b ^ 2) * (7 * c ^ 2 + 3 * d ^ 2) := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d1-t0050"}
+{"id": "inequalities-monotone-d1-t0051", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 1, "seed": 51, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(x \\le y\\), \\[4\\,\\sinh x + 7\\,x \\le 4\\,\\sinh y + 7\\,y.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The function is non-decreasing. -/\ntheorem monotone_sum (x y : ℝ) (h : x ≤ y) :\n 4 * Real.sinh x + 7 * x ≤ 4 * Real.sinh y + 7 * y := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d1-t0051"}
+{"id": "inequalities-abs_ineq-d2-t0052", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 2, "seed": 52, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for every real number \\(x\\), \\[54 \\le 6|x - 3| + 6|x - 12|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sum of two distances is at least p times the gap. -/\ntheorem abs_two_points (x : ℝ) :\n 54 ≤ 6 * |x - 3| + 6 * |x - 12| := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d2-t0052"}
+{"id": "inequalities-amgm-d2-t0053", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 2, "seed": 53, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(a\\) and \\(b\\) be positive real numbers. Prove that \\[96 \\le 64\\frac{a}{b} + 36\\frac{b}{a}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A weighted sum of a ratio and its reciprocal is bounded below. -/\ntheorem amgm_ratio (a b : ℝ) (ha : 0 < a) (hb : 0 < b) :\n 96 ≤ 64 * (a / b) + 36 * (b / a) := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d2-t0053"}
+{"id": "inequalities-cauchy-d2-t0054", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 2, "seed": 54, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) and \\(y\\) be real numbers with \\(x^2 + y^2 \\le 9\\). Prove that \\(4x - 3y \\le 15\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A linear form is bounded on a disc by the Cauchy-Schwarz inequality. -/\ntheorem cauchy_bound_circle (x y : ℝ) (h : x ^ 2 + y ^ 2 ≤ 9) :\n 4 * x - 3 * y ≤ 15 := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d2-t0054"}
+{"id": "inequalities-monotone-d2-t0055", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 2, "seed": 55, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that the function \\(f(x) = 3\\,\\arctan x + 2\\,\\sinh x\\) is monotone on the real numbers: \\(x \\le y\\) implies \\(f(x) \\le f(y)\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The function is monotone. -/\ntheorem monotone_function : Monotone (fun x : ℝ => 3 * Real.arctan x + 2 * Real.sinh x) := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d2-t0055"}
+{"id": "inequalities-abs_ineq-d3-t0056", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 3, "seed": 56, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(a \\le c\\) and \\(x\\), \\(c - a \\le |x - a| + |x - c|\\). Then prove that for every real \\(x\\), \\[8 \\le |x - 4| + |x - 4| + |x - 7| + |x - 9|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The sum of the distances to two points is at least their gap. -/\ntheorem pair_abs_bound (x a c : ℝ) (h : a ≤ c) :\n c - a ≤ |x - a| + |x - c| := by\n sorry\n\n/-- The sum of four distances is bounded below. -/\ntheorem four_points_abs (x : ℝ) :\n 8 ≤ |x - 4| + |x - 4| + |x - 7| + |x - 9| := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d3-t0056"}
+{"id": "inequalities-amgm-d3-t0057", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 3, "seed": 57, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that \\(27xyz \\le (x+y+z)^3\\) for all non-negative real numbers \\(x, y, z\\). Then prove that for all non-negative real numbers \\(a, b, c\\), \\[54\\,abc \\le (a + 2b + c)^3.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The three-variable AM-GM inequality in cubic form. -/\ntheorem amgm_three (x y z : ℝ) (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 ≤ z) :\n 27 * x * y * z ≤ (x + y + z) ^ 3 := by\n sorry\n\n/-- The scaled three-variable inequality. -/\ntheorem amgm_three_scaled (a b c : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) (hc : 0 ≤ c) :\n 54 * a * b * c ≤ (a + 2 * b + c) ^ 3 := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d3-t0057"}
+{"id": "inequalities-cauchy-d3-t0058", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 3, "seed": 58, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(u, v, w, x, y, z\\), \\[(ux + vy + wz)^2 \\le (u^2 + v^2 + w^2)(x^2 + y^2 + z^2).\\] Then let \\(x, y, z\\) be real numbers with \\(x^2 + y^2 + z^2 \\le 1\\) and prove that \\(x + 8y - 4z \\le 9\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cauchy-Schwarz for three-term sums. -/\ntheorem cauchy_three (u v w x y z : ℝ) :\n (u * x + v * y + w * z) ^ 2 ≤ (u ^ 2 + v ^ 2 + w ^ 2) * (x ^ 2 + y ^ 2 + z ^ 2) := by\n sorry\n\n/-- A linear form is bounded on a ball. -/\ntheorem cauchy_bound_ball (x y z : ℝ) (h : x ^ 2 + y ^ 2 + z ^ 2 ≤ 1) :\n x + 8 * y - 4 * z ≤ 9 := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d3-t0058"}
+{"id": "inequalities-monotone-d3-t0059", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 3, "seed": 59, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that \\(0 \\le \\ln(1 + y^2) - \\ln(1 + x^2)\\) for real numbers \\(0 < x \\le y\\). Then prove that for such \\(x, y\\), \\[0 \\le \\left(4\\,\\arctan y + 2\\,\\ln y + 3\\,\\sinh y + y^2 + 3\\,\\ln(1 + y^2)\\right) - \\left(4\\,\\arctan x + 2\\,\\ln x + 3\\,\\sinh x + x^2 + 3\\,\\ln(1 + x^2)\\right).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The logarithm of one plus a square is increasing on the positive reals. -/\ntheorem log_one_add_sq_mono (x y : ℝ) (hx : 0 < x) (h : x ≤ y) :\n 0 ≤ Real.log (1 + y ^ 2) - Real.log (1 + x ^ 2) := by\n sorry\n\n/-- The combination is non-decreasing on the positive reals. -/\ntheorem monotone_combination (x y : ℝ) (hx : 0 < x) (h : x ≤ y) :\n 0 ≤ (4 * Real.arctan y + 2 * Real.log y + 3 * Real.sinh y + y ^ 2 + 3 * Real.log (1 + y ^ 2)) - (4 * Real.arctan x + 2 * Real.log x + 3 * Real.sinh x + x ^ 2 + 3 * Real.log (1 + x ^ 2)) := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d3-t0059"}
+{"id": "inequalities-abs_ineq-d1-t0060", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 1, "seed": 60, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) and \\(y\\) be real numbers with \\(|x + 5| \\le 6\\) and \\(|y| \\le 6\\). Prove that \\(|2x - 9y + 10| \\le 66\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- An error bound for a linear combination. -/\ntheorem abs_linear_bound (x y : ℝ) (hx : |x + 5| ≤ 6) (hy : |y| ≤ 6) :\n |2 * x - 9 * y + 10| ≤ 66 := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d1-t0060"}
+{"id": "inequalities-amgm-d1-t0061", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 1, "seed": 61, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(a\\) and \\(b\\) be real numbers with \\(3a + b = 34\\). Prove that \\[3ab \\le \\frac{34^2}{4}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The product is at most a quarter of the squared sum. -/\ntheorem amgm_constraint (a b : ℝ) (h : 3 * a + b = 34) :\n 3 * a * b ≤ 34 ^ 2 / 4 := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d1-t0061"}
+{"id": "inequalities-cauchy-d1-t0062", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 1, "seed": 62, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(a, b, c, d\\), \\[(3ac + 2bd)^2 \\le (3a^2 + 2b^2)(3c^2 + 2d^2).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Cauchy-Schwarz with positive weights for two pairs. -/\ntheorem weighted_cauchy (a b c d : ℝ) :\n (3 * a * c + 2 * b * d) ^ 2 ≤ (3 * a ^ 2 + 2 * b ^ 2) * (3 * c ^ 2 + 2 * d ^ 2) := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d1-t0062"}
+{"id": "inequalities-monotone-d1-t0063", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 1, "seed": 63, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(x \\le y\\), \\[4\\,e^{x} + 9\\,x \\le 4\\,e^{y} + 9\\,y.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The function is non-decreasing. -/\ntheorem monotone_sum (x y : ℝ) (h : x ≤ y) :\n 4 * Real.exp x + 9 * x ≤ 4 * Real.exp y + 9 * y := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d1-t0063"}
+{"id": "inequalities-abs_ineq-d2-t0064", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 2, "seed": 64, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) be a real number with \\(|x - 5| \\le 4\\). Prove that \\(|x^2 - 5^2| \\le 4(4 + 10)\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A bound on a difference of squares near a point. -/\ntheorem abs_square_bound (x : ℝ) (h : |x - 5| ≤ 4) :\n |x ^ 2 - 5 ^ 2| ≤ 4 * (4 + 2 * 5) := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d2-t0064"}
+{"id": "inequalities-amgm-d2-t0065", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 2, "seed": 65, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(a\\) and \\(b\\) be positive real numbers. Prove that \\[10 \\le \\frac{a}{b} + 25\\frac{b}{a}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A weighted sum of a ratio and its reciprocal is bounded below. -/\ntheorem amgm_ratio (a b : ℝ) (ha : 0 < a) (hb : 0 < b) :\n 10 ≤ (a / b) + 25 * (b / a) := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d2-t0065"}
+{"id": "inequalities-cauchy-d2-t0066", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 2, "seed": 66, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) and \\(y\\) be real numbers with \\(x^2 + y^2 \\le 25\\). Prove that \\(9x + 12y \\le 75\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A linear form is bounded on a disc by the Cauchy-Schwarz inequality. -/\ntheorem cauchy_bound_circle (x y : ℝ) (h : x ^ 2 + y ^ 2 ≤ 25) :\n 9 * x + 12 * y ≤ 75 := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d2-t0066"}
+{"id": "inequalities-monotone-d2-t0067", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 2, "seed": 67, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that the function \\(f(x) = x^5 + 6\\,e^{x} + 2\\,\\arctan x\\) is monotone on the real numbers: \\(x \\le y\\) implies \\(f(x) \\le f(y)\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The function is monotone. -/\ntheorem monotone_function : Monotone (fun x : ℝ => x ^ 5 + 6 * Real.exp x + 2 * Real.arctan x) := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d2-t0067"}
+{"id": "inequalities-abs_ineq-d3-t0068", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 3, "seed": 68, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(a \\le c\\) and \\(x\\), \\(c - a \\le |x - a| + |x - c|\\). Then prove that for every real \\(x\\), \\[6 \\le |x - 1| + |x - 1| + |x - 4| + |x - 4|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The sum of the distances to two points is at least their gap. -/\ntheorem pair_abs_bound (x a c : ℝ) (h : a ≤ c) :\n c - a ≤ |x - a| + |x - c| := by\n sorry\n\n/-- The sum of four distances is bounded below. -/\ntheorem four_points_abs (x : ℝ) :\n 6 ≤ |x - 1| + |x - 1| + |x - 4| + |x - 4| := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d3-t0068"}
+{"id": "inequalities-amgm-d3-t0069", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 3, "seed": 69, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that \\(27xyz \\le (x+y+z)^3\\) for all non-negative real numbers \\(x, y, z\\). Then prove that for all non-negative real numbers \\(a, b, c\\), \\[864\\,abc \\le (2a + 4b + 4c)^3.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The three-variable AM-GM inequality in cubic form. -/\ntheorem amgm_three (x y z : ℝ) (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 ≤ z) :\n 27 * x * y * z ≤ (x + y + z) ^ 3 := by\n sorry\n\n/-- The scaled three-variable inequality. -/\ntheorem amgm_three_scaled (a b c : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) (hc : 0 ≤ c) :\n 864 * a * b * c ≤ (2 * a + 4 * b + 4 * c) ^ 3 := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d3-t0069"}
+{"id": "inequalities-cauchy-d3-t0070", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 3, "seed": 70, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(u, v, w, x, y, z\\), \\[(ux + vy + wz)^2 \\le (u^2 + v^2 + w^2)(x^2 + y^2 + z^2).\\] Then let \\(x, y, z\\) be real numbers with \\(x^2 + y^2 + z^2 \\le 4\\) and prove that \\(-6x + 2y + 3z \\le 14\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cauchy-Schwarz for three-term sums. -/\ntheorem cauchy_three (u v w x y z : ℝ) :\n (u * x + v * y + w * z) ^ 2 ≤ (u ^ 2 + v ^ 2 + w ^ 2) * (x ^ 2 + y ^ 2 + z ^ 2) := by\n sorry\n\n/-- A linear form is bounded on a ball. -/\ntheorem cauchy_bound_ball (x y z : ℝ) (h : x ^ 2 + y ^ 2 + z ^ 2 ≤ 4) :\n -6 * x + 2 * y + 3 * z ≤ 14 := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d3-t0070"}
+{"id": "inequalities-monotone-d3-t0071", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 3, "seed": 71, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that \\(0 \\le \\ln(1 + y^2) - \\ln(1 + x^2)\\) for real numbers \\(0 < x \\le y\\). Then prove that for such \\(x, y\\), \\[0 \\le \\left(\\sqrt{y} + 4\\,e^{y} + 5\\,\\ln y + \\ln(1 + y^2)\\right) - \\left(\\sqrt{x} + 4\\,e^{x} + 5\\,\\ln x + \\ln(1 + x^2)\\right).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The logarithm of one plus a square is increasing on the positive reals. -/\ntheorem log_one_add_sq_mono (x y : ℝ) (hx : 0 < x) (h : x ≤ y) :\n 0 ≤ Real.log (1 + y ^ 2) - Real.log (1 + x ^ 2) := by\n sorry\n\n/-- The combination is non-decreasing on the positive reals. -/\ntheorem monotone_combination (x y : ℝ) (hx : 0 < x) (h : x ≤ y) :\n 0 ≤ (Real.sqrt y + 4 * Real.exp y + 5 * Real.log y + Real.log (1 + y ^ 2)) - (Real.sqrt x + 4 * Real.exp x + 5 * Real.log x + Real.log (1 + x ^ 2)) := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d3-t0071"}
+{"id": "inequalities-abs_ineq-d1-t0072", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 1, "seed": 72, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) and \\(y\\) be real numbers with \\(|x + 8| \\le 4\\) and \\(|y - 3| \\le 7\\). Prove that \\(|8x - y + 67| \\le 39\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- An error bound for a linear combination. -/\ntheorem abs_linear_bound (x y : ℝ) (hx : |x + 8| ≤ 4) (hy : |y - 3| ≤ 7) :\n |8 * x - y + 67| ≤ 39 := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d1-t0072"}
+{"id": "inequalities-amgm-d1-t0073", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 1, "seed": 73, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(a\\) and \\(b\\) be real numbers with \\(3a + 6b = 35\\). Prove that \\[18ab \\le \\frac{35^2}{4}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The product is at most a quarter of the squared sum. -/\ntheorem amgm_constraint (a b : ℝ) (h : 3 * a + 6 * b = 35) :\n 18 * a * b ≤ 35 ^ 2 / 4 := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d1-t0073"}
+{"id": "inequalities-cauchy-d1-t0074", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 1, "seed": 74, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(a, b, c, d\\), \\[(4ac + 2bd)^2 \\le (4a^2 + 2b^2)(4c^2 + 2d^2).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Cauchy-Schwarz with positive weights for two pairs. -/\ntheorem weighted_cauchy (a b c d : ℝ) :\n (4 * a * c + 2 * b * d) ^ 2 ≤ (4 * a ^ 2 + 2 * b ^ 2) * (4 * c ^ 2 + 2 * d ^ 2) := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d1-t0074"}
+{"id": "inequalities-monotone-d1-t0075", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 1, "seed": 75, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(x \\le y\\), \\[9\\,\\sinh x + x \\le 9\\,\\sinh y + y.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The function is non-decreasing. -/\ntheorem monotone_sum (x y : ℝ) (h : x ≤ y) :\n 9 * Real.sinh x + x ≤ 9 * Real.sinh y + y := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d1-t0075"}
+{"id": "inequalities-abs_ineq-d2-t0076", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 2, "seed": 76, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) be a real number with \\(|x - 6| \\le 4\\). Prove that \\(|x^2 - 6^2| \\le 4(4 + 12)\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A bound on a difference of squares near a point. -/\ntheorem abs_square_bound (x : ℝ) (h : |x - 6| ≤ 4) :\n |x ^ 2 - 6 ^ 2| ≤ 4 * (4 + 2 * 6) := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d2-t0076"}
+{"id": "inequalities-amgm-d2-t0077", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 2, "seed": 77, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) be a positive real number. Prove that \\[8 \\le 4x + \\frac{4}{x}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sum of a linear term and an inverse term is bounded below. -/\ntheorem amgm_linear_plus_inverse (x : ℝ) (hx : 0 < x) :\n 8 ≤ 4 * x + 4 / x := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d2-t0077"}
+{"id": "inequalities-cauchy-d2-t0078", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 2, "seed": 78, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nLet \\(x\\) and \\(y\\) be real numbers with \\(x^2 + y^2 \\le 4\\). Prove that \\(8x - 6y \\le 20\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A linear form is bounded on a disc by the Cauchy-Schwarz inequality. -/\ntheorem cauchy_bound_circle (x y : ℝ) (h : x ^ 2 + y ^ 2 ≤ 4) :\n 8 * x - 6 * y ≤ 20 := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d2-t0078"}
+{"id": "inequalities-monotone-d2-t0079", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 2, "seed": 79, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that the function \\(f(x) = 6\\,\\sinh x + 2\\,x^3\\) is monotone on the real numbers: \\(x \\le y\\) implies \\(f(x) \\le f(y)\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The function is monotone. -/\ntheorem monotone_function : Monotone (fun x : ℝ => 6 * Real.sinh x + 2 * x ^ 3) := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d2-t0079"}
+{"id": "inequalities-abs_ineq-d3-t0080", "env": "inequalities", "msc": "26", "family": "abs_ineq", "difficulty": 3, "seed": 80, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(a \\le c\\) and \\(x\\), \\(c - a \\le |x - a| + |x - c|\\). Then prove that for every real \\(x\\), \\[6 \\le |x - 4| + |x - 6| + |x - 7| + |x - 9|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The sum of the distances to two points is at least their gap. -/\ntheorem pair_abs_bound (x a c : ℝ) (h : a ≤ c) :\n c - a ≤ |x - a| + |x - c| := by\n sorry\n\n/-- The sum of four distances is bounded below. -/\ntheorem four_points_abs (x : ℝ) :\n 6 ≤ |x - 4| + |x - 6| + |x - 7| + |x - 9| := by\n sorry\n", "path": "tasks/inequalities/inequalities-abs_ineq-d3-t0080"}
+{"id": "inequalities-amgm-d3-t0081", "env": "inequalities", "msc": "26", "family": "amgm", "difficulty": 3, "seed": 81, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that \\(27xyz \\le (x+y+z)^3\\) for all non-negative real numbers \\(x, y, z\\). Then prove that for all non-negative real numbers \\(a, b, c\\), \\[972\\,abc \\le (2a + 3b + 6c)^3.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The three-variable AM-GM inequality in cubic form. -/\ntheorem amgm_three (x y z : ℝ) (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 ≤ z) :\n 27 * x * y * z ≤ (x + y + z) ^ 3 := by\n sorry\n\n/-- The scaled three-variable inequality. -/\ntheorem amgm_three_scaled (a b c : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) (hc : 0 ≤ c) :\n 972 * a * b * c ≤ (2 * a + 3 * b + 6 * c) ^ 3 := by\n sorry\n", "path": "tasks/inequalities/inequalities-amgm-d3-t0081"}
+{"id": "inequalities-cauchy-d3-t0082", "env": "inequalities", "msc": "26", "family": "cauchy", "difficulty": 3, "seed": 82, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that for all real numbers \\(u, v, w, x, y, z\\), \\[(ux + vy + wz)^2 \\le (u^2 + v^2 + w^2)(x^2 + y^2 + z^2).\\] Then let \\(x, y, z\\) be real numbers with \\(x^2 + y^2 + z^2 \\le 1\\) and prove that \\(x - 4y - 8z \\le 9\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cauchy-Schwarz for three-term sums. -/\ntheorem cauchy_three (u v w x y z : ℝ) :\n (u * x + v * y + w * z) ^ 2 ≤ (u ^ 2 + v ^ 2 + w ^ 2) * (x ^ 2 + y ^ 2 + z ^ 2) := by\n sorry\n\n/-- A linear form is bounded on a ball. -/\ntheorem cauchy_bound_ball (x y z : ℝ) (h : x ^ 2 + y ^ 2 + z ^ 2 ≤ 1) :\n x - 4 * y - 8 * z ≤ 9 := by\n sorry\n", "path": "tasks/inequalities/inequalities-cauchy-d3-t0082"}
+{"id": "inequalities-monotone-d3-t0083", "env": "inequalities", "msc": "26", "family": "monotone", "difficulty": 3, "seed": 83, "kind": "prove", "instruction": "# Prove an inequality over the reals\n\nProve that \\(0 \\le \\ln(1 + y^2) - \\ln(1 + x^2)\\) for real numbers \\(0 < x \\le y\\). Then prove that for such \\(x, y\\), \\[0 \\le \\left(3\\,\\sqrt{y} + 4\\,\\arctan y + \\ln(1 + y^2)\\right) - \\left(3\\,\\sqrt{x} + 4\\,\\arctan x + \\ln(1 + x^2)\\right).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The logarithm of one plus a square is increasing on the positive reals. -/\ntheorem log_one_add_sq_mono (x y : ℝ) (hx : 0 < x) (h : x ≤ y) :\n 0 ≤ Real.log (1 + y ^ 2) - Real.log (1 + x ^ 2) := by\n sorry\n\n/-- The combination is non-decreasing on the positive reals. -/\ntheorem monotone_combination (x y : ℝ) (hx : 0 < x) (h : x ≤ y) :\n 0 ≤ (3 * Real.sqrt y + 4 * Real.arctan y + Real.log (1 + y ^ 2)) - (3 * Real.sqrt x + 4 * Real.arctan x + Real.log (1 + x ^ 2)) := by\n sorry\n", "path": "tasks/inequalities/inequalities-monotone-d3-t0083"}
diff --git a/data/linear-algebra/eval.jsonl b/data/linear-algebra/eval.jsonl
new file mode 100644
index 0000000000000000000000000000000000000000..4fd404e853d5ca6b0764f01e1d855e386a6088ec
--- /dev/null
+++ b/data/linear-algebra/eval.jsonl
@@ -0,0 +1,24 @@
+{"id": "linear-algebra-det_trace-d1-e0000", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 1, "seed": 10000, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nCompute the determinant of the product \\(\\begin{pmatrix} 4 & 1 \\\\ 1 & -3 \\end{pmatrix}\\) \\(\\begin{pmatrix} 3 & 1 \\\\ 1 & 1 \\end{pmatrix}\\) of integer matrices. Show that it equals -26.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The determinant of the product is the product of the determinants. -/\ntheorem det_of_product : Matrix.det (!![4, 1; 1, -3] * !![3, 1; 1, 1] : Matrix (Fin 2) (Fin 2) ℤ) = (-26 : ℤ) := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d1-e0000"}
+{"id": "linear-algebra-independence-d1-e0001", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 1, "seed": 10001, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^2\\) consider the vectors \\(\\begin{pmatrix} 0 \\\\ -2 \\end{pmatrix}\\), \\(\\begin{pmatrix} 0 \\\\ 6 \\end{pmatrix}\\). Show that they are not linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly dependent over the rationals. -/\ntheorem vectors_dependent : ¬ LinearIndependent ℚ ![(![0, -2] : Fin 2 → ℚ), ![0, 6]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d1-e0001"}
+{"id": "linear-algebra-linear_map-d1-e0002", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 1, "seed": 10002, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(q : V \\to V\\) be a linear map over \\(\\mathbb{Q}\\) with \\(q(v(v)) = v(v)\\) for every \\(v\\). Then \\(u - q(u)\\) lies in the kernel of \\(q\\) for every \\(u \\in V\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- x - p x lies in the kernel of an idempotent map p. -/\ntheorem sub_proj_mem_ker {V : Type*} [AddCommGroup V] [Module ℚ V] (q : V →ₗ[ℚ] V) (hp : ∀ x, q (q x) = q x) (u : V) :\n u - q u ∈ LinearMap.ker q := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d1-e0002"}
+{"id": "linear-algebra-matrix_pow-d1-e0003", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 1, "seed": 10003, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every natural number \\(n\\), \\[\\begin{pmatrix} 1 & 2 \\\\ 0 & 1 \\end{pmatrix}^n = \\begin{pmatrix} 1 & 2n \\\\ 0 & 1 \\end{pmatrix}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of a shear matrix. -/\ntheorem shear_power (n : ℕ) :\n (!![1, 2; 0, 1] : Matrix (Fin 2) (Fin 2) ℤ) ^ n = !![1, (n : ℤ) * 2; 0, 1] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d1-e0003"}
+{"id": "linear-algebra-det_trace-d2-e0004", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 2, "seed": 10004, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nFor every integer \\(x\\), the determinant of \\[\\begin{pmatrix} x-3 & 2 \\\\ 2 & x-1 \\end{pmatrix}\\begin{pmatrix} x & -1 \\\\ -1 & x+0 \\end{pmatrix}\\] equals \\(x^4 - 4x^3 - 2x^2 + 4x + 1\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The determinant of a product of matrices with a variable entry. -/\ntheorem det_of_polynomial_product (x : ℤ) :\n Matrix.det (!![x - 3, 2; 2, x - 1] * !![x, -1; -1, x + 0] : Matrix (Fin 2) (Fin 2) ℤ) = x ^ 4 - 4 * x ^ 3 - 2 * x ^ 2 + 4 * x + 1 := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d2-e0004"}
+{"id": "linear-algebra-independence-d2-e0005", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 2, "seed": 10005, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^2\\) consider the vectors \\(\\begin{pmatrix} 3 \\\\ 3 \\end{pmatrix}\\), \\(\\begin{pmatrix} -3 \\\\ -3 \\end{pmatrix}\\). Show that they are not linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly dependent over the rationals. -/\ntheorem vectors_dependent : ¬ LinearIndependent ℚ ![(![3, 3] : Fin 2 → ℚ), ![-3, -3]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d2-e0005"}
+{"id": "linear-algebra-linear_map-d2-e0006", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 2, "seed": 10006, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(f : V \\to W\\) and \\(g : W \\to U\\) be linear maps over \\(\\mathbb{R}\\). Then the kernel of \\(f\\) is contained in the kernel of \\(g \\circ f\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- ker f ≤ ker (g ∘ f). -/\ntheorem ker_le_comp {V W U : Type*} [AddCommGroup V] [Module ℝ V] [AddCommGroup W] [Module ℝ W] [AddCommGroup U] [Module ℝ U] (f : V →ₗ[ℝ] W) (g : W →ₗ[ℝ] U) :\n LinearMap.ker f ≤ LinearMap.ker (g ∘ₗ f) := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d2-e0006"}
+{"id": "linear-algebra-matrix_pow-d2-e0007", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 2, "seed": 10007, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every natural number \\(n\\), \\[\\begin{pmatrix} 3 & 1 \\\\ 0 & 3 \\end{pmatrix}^{n+1} = \\begin{pmatrix} (3)^{n+1} & (n+1)(3)^n \\\\ 0 & (3)^{n+1} \\end{pmatrix}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of a 2x2 Jordan block. -/\ntheorem jordan_power (n : ℕ) :\n (!![3, 1; 0, 3] : Matrix (Fin 2) (Fin 2) ℤ) ^ (n + 1) = !![3 ^ (n + 1), ((n : ℤ) + 1) * 3 ^ n; 0, 3 ^ (n + 1)] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d2-e0007"}
+{"id": "linear-algebra-det_trace-d3-e0008", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 3, "seed": 10008, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nLet \\(A\\) be a \\(2 \\times 2\\) integer matrix with trace -1 and determinant -3. Then the trace of \\(A^2\\) is 7. You may first prove \\(A^2 = (\\operatorname{tr} A) A - (\\det A) I\\) for every \\(2 \\times 2\\) integer matrix.\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cayley-Hamilton for 2x2 integer matrices. -/\ntheorem cayley_hamilton_two (A : Matrix (Fin 2) (Fin 2) ℤ) :\n A ^ 2 = Matrix.trace A • A - Matrix.det A • (1 : Matrix (Fin 2) (Fin 2) ℤ) := by\n sorry\n\n/-- The trace of A^2 from the trace and determinant of A. -/\ntheorem trace_of_square (A : Matrix (Fin 2) (Fin 2) ℤ) (ht : Matrix.trace A = (-1 : ℤ)) (hd : Matrix.det A = (-3 : ℤ)) :\n Matrix.trace (A ^ 2) = 7 := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d3-e0008"}
+{"id": "linear-algebra-independence-d3-e0009", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 3, "seed": 10009, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^3\\) consider the vectors \\(\\begin{pmatrix} 6 \\\\ 0 \\\\ -4 \\end{pmatrix}\\), \\(\\begin{pmatrix} 4 \\\\ 6 \\\\ 3 \\end{pmatrix}\\), \\(\\begin{pmatrix} -4 \\\\ 12 \\\\ 14 \\end{pmatrix}\\). Show that they are not linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly dependent over the rationals. -/\ntheorem vectors_dependent : ¬ LinearIndependent ℚ ![(![6, 0, -4] : Fin 3 → ℚ), ![4, 6, 3], ![-4, 12, 14]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d3-e0009"}
+{"id": "linear-algebra-linear_map-d3-e0010", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 3, "seed": 10010, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(p : V \\to V\\) be a linear map over \\(\\mathbb{R}\\) with \\(p \\circ p = p\\). Then \\(\\mathrm{id} - p\\) is also idempotent, and \\(p \\circ (\\mathrm{id} - p) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- If p is idempotent then so is id - p, and p kills its image. -/\ntheorem complement_idempotent {V : Type*} [AddCommGroup V] [Module ℝ V] (p : V →ₗ[ℝ] V) (hp : p ∘ₗ p = p) :\n (LinearMap.id - p) ∘ₗ (LinearMap.id - p) = LinearMap.id - p ∧ p ∘ₗ (LinearMap.id - p) = 0 := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d3-e0010"}
+{"id": "linear-algebra-matrix_pow-d3-e0011", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 3, "seed": 10011, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every integer \\(k\\) and natural number \\(n\\), \\[\\begin{pmatrix} 1 & k \\\\ 0 & 1 \\end{pmatrix}^n = \\begin{pmatrix} 1 & nk \\\\ 0 & 1 \\end{pmatrix}.\\] Deduce that for all natural numbers \\(n, m\\), \\[\\begin{pmatrix} 1 & 6 \\\\ 0 & 1 \\end{pmatrix}^n \\begin{pmatrix} 1 & -1 \\\\ 0 & 1 \\end{pmatrix}^m = \\begin{pmatrix} 1 & 6n + -1m \\\\ 0 & 1 \\end{pmatrix}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Powers of a shear matrix. -/\ntheorem shear_power (k : ℤ) (n : ℕ) :\n (!![1, k; 0, 1] : Matrix (Fin 2) (Fin 2) ℤ) ^ n = !![1, (n : ℤ) * k; 0, 1] := by\n sorry\n\n/-- A product of powers of two shears. -/\ntheorem shear_product (n m : ℕ) :\n (!![1, 6; 0, 1] : Matrix (Fin 2) (Fin 2) ℤ) ^ n * (!![1, (-1 : ℤ); 0, 1] : Matrix (Fin 2) (Fin 2) ℤ) ^ m = !![1, (n : ℤ) * 6 + (m : ℤ) * (-1 : ℤ); 0, 1] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d3-e0011"}
+{"id": "linear-algebra-det_trace-d1-e0012", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 1, "seed": 10012, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nCompute the determinant of the product \\(\\begin{pmatrix} 3 & 1 \\\\ -2 & 2 \\end{pmatrix}\\) \\(\\begin{pmatrix} 4 & -1 \\\\ -3 & 2 \\end{pmatrix}\\) of integer matrices. Show that it equals 40.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The determinant of the product is the product of the determinants. -/\ntheorem det_of_product : Matrix.det (!![3, 1; -2, 2] * !![4, -1; -3, 2] : Matrix (Fin 2) (Fin 2) ℤ) = 40 := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d1-e0012"}
+{"id": "linear-algebra-independence-d1-e0013", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 1, "seed": 10013, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^2\\) consider the vectors \\(\\begin{pmatrix} 2 \\\\ -3 \\end{pmatrix}\\), \\(\\begin{pmatrix} 1 \\\\ -1 \\end{pmatrix}\\). Show that they are linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly independent over the rationals. -/\ntheorem vectors_independent : LinearIndependent ℚ ![(![2, -3] : Fin 2 → ℚ), ![1, -1]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d1-e0013"}
+{"id": "linear-algebra-linear_map-d1-e0014", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 1, "seed": 10014, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(f : V \\to W\\) be a linear map of vector spaces over \\(\\mathbb{Q}\\) and \\(a, b \\in V\\) with \\(f(a) = 0\\) and \\(f(b) = 0\\). Then \\(f(7a + 2b) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The kernel is closed under linear combinations. -/\ntheorem kernel_combination {V W : Type*} [AddCommGroup V] [Module ℚ V] [AddCommGroup W] [Module ℚ W] (f : V →ₗ[ℚ] W) {a b : V}\n (hx : f a = 0) (hy : f b = 0) : f ((7 : ℚ) • a + (2 : ℚ) • b) = 0 := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d1-e0014"}
+{"id": "linear-algebra-matrix_pow-d1-e0015", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 1, "seed": 10015, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every natural number \\(n\\), \\[\\begin{pmatrix} 1 & 2 \\\\ 0 & 1 \\end{pmatrix}^n = \\begin{pmatrix} 1 & 2n \\\\ 0 & 1 \\end{pmatrix}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of a shear matrix. -/\ntheorem shear_power (n : ℕ) :\n (!![1, 2; 0, 1] : Matrix (Fin 2) (Fin 2) ℤ) ^ n = !![1, (n : ℤ) * 2; 0, 1] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d1-e0015"}
+{"id": "linear-algebra-det_trace-d2-e0016", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 2, "seed": 10016, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nFor every integer \\(x\\), \\[\\det\\left(x I - \\begin{pmatrix} 0 & 2 \\\\ -1 & -2 \\end{pmatrix}\\right) = x^2 - (-2)\\,x + (2),\\] where \\(I\\) is the \\(2 \\times 2\\) identity matrix.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The characteristic polynomial of a 2x2 matrix is x^2 - tr x + det. -/\ntheorem char_poly_value (x : ℤ) :\n Matrix.det (x • (1 : Matrix (Fin 2) (Fin 2) ℤ) - !![0, 2; -1, -2]) = x ^ 2 - (-2 : ℤ) * x + 2 := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d2-e0016"}
+{"id": "linear-algebra-independence-d2-e0017", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 2, "seed": 10017, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^2\\) consider the vectors \\(\\begin{pmatrix} -6 \\\\ -6 \\end{pmatrix}\\), \\(\\begin{pmatrix} -3 \\\\ 2 \\end{pmatrix}\\). Show that they are linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly independent over the rationals. -/\ntheorem vectors_independent : LinearIndependent ℚ ![(![-6, -6] : Fin 2 → ℚ), ![-3, 2]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d2-e0017"}
+{"id": "linear-algebra-linear_map-d2-e0018", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 2, "seed": 10018, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(f : V \\to W\\) be a linear map of vector spaces over \\(\\mathbb{R}\\). Then the kernel of \\(-1f\\) equals the kernel of \\(f\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A nonzero scalar multiple has the same kernel. -/\ntheorem ker_smul_eq {V W : Type*} [AddCommGroup V] [Module ℝ V] [AddCommGroup W] [Module ℝ W] (f : V →ₗ[ℝ] W) :\n LinearMap.ker ((-1 : ℝ) • f) = LinearMap.ker f := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d2-e0018"}
+{"id": "linear-algebra-matrix_pow-d2-e0019", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 2, "seed": 10019, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every natural number \\(n\\), \\[\\begin{pmatrix} 5 & 1 \\\\ 0 & 5 \\end{pmatrix}^{n+1} = \\begin{pmatrix} (5)^{n+1} & (n+1)(5)^n \\\\ 0 & (5)^{n+1} \\end{pmatrix}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of a 2x2 Jordan block. -/\ntheorem jordan_power (n : ℕ) :\n (!![5, 1; 0, 5] : Matrix (Fin 2) (Fin 2) ℤ) ^ (n + 1) = !![5 ^ (n + 1), ((n : ℤ) + 1) * 5 ^ n; 0, 5 ^ (n + 1)] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d2-e0019"}
+{"id": "linear-algebra-det_trace-d3-e0020", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 3, "seed": 10020, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nLet \\(A\\) be a \\(2 \\times 2\\) integer matrix with trace 2 and determinant -2. Then the trace of \\(A^2\\) is 8. You may first prove \\(A^2 = (\\operatorname{tr} A) A - (\\det A) I\\) for every \\(2 \\times 2\\) integer matrix.\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cayley-Hamilton for 2x2 integer matrices. -/\ntheorem cayley_hamilton_two (A : Matrix (Fin 2) (Fin 2) ℤ) :\n A ^ 2 = Matrix.trace A • A - Matrix.det A • (1 : Matrix (Fin 2) (Fin 2) ℤ) := by\n sorry\n\n/-- The trace of A^2 from the trace and determinant of A. -/\ntheorem trace_of_square (A : Matrix (Fin 2) (Fin 2) ℤ) (ht : Matrix.trace A = (2 : ℤ)) (hd : Matrix.det A = (-2 : ℤ)) :\n Matrix.trace (A ^ 2) = 8 := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d3-e0020"}
+{"id": "linear-algebra-independence-d3-e0021", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 3, "seed": 10021, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^3\\) consider the vectors \\(\\begin{pmatrix} -5 \\\\ 6 \\\\ -5 \\end{pmatrix}\\), \\(\\begin{pmatrix} 2 \\\\ 1 \\\\ 4 \\end{pmatrix}\\), \\(\\begin{pmatrix} -2 \\\\ 4 \\\\ 0 \\end{pmatrix}\\). Show that they are linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly independent over the rationals. -/\ntheorem vectors_independent : LinearIndependent ℚ ![(![-5, 6, -5] : Fin 3 → ℚ), ![2, 1, 4], ![-2, 4, 0]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d3-e0021"}
+{"id": "linear-algebra-linear_map-d3-e0022", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 3, "seed": 10022, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(e : V \\to V\\) be a linear map over \\(\\mathbb{R}\\) with \\(e^2 = e\\). Show that \\(\\ker e\\) and \\(\\operatorname{range} e\\) are complementary subspaces: their intersection is \\(\\{0\\}\\) and together they span \\(V\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The kernel and the range of an idempotent map meet only in 0. -/\ntheorem disjoint_ker_range {V : Type*} [AddCommGroup V] [Module ℝ V] (e : V →ₗ[ℝ] V) (hp : e * e = e) :\n Disjoint (LinearMap.ker e) (LinearMap.range e) := by\n sorry\n\n/-- The kernel and the range of an idempotent map are complements. -/\ntheorem ker_range_isCompl {V : Type*} [AddCommGroup V] [Module ℝ V] (e : V →ₗ[ℝ] V) (hp : e * e = e) :\n IsCompl (LinearMap.ker e) (LinearMap.range e) := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d3-e0022"}
+{"id": "linear-algebra-matrix_pow-d3-e0023", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 3, "seed": 10023, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every integer \\(k\\) and natural number \\(n\\), \\[\\begin{pmatrix} 1 & k \\\\ 0 & 1 \\end{pmatrix}^n = \\begin{pmatrix} 1 & nk \\\\ 0 & 1 \\end{pmatrix}.\\] Deduce that for all natural numbers \\(n, m\\), \\[\\begin{pmatrix} 1 & 5 \\\\ 0 & 1 \\end{pmatrix}^n \\begin{pmatrix} 1 & 1 \\\\ 0 & 1 \\end{pmatrix}^m = \\begin{pmatrix} 1 & 5n + 1m \\\\ 0 & 1 \\end{pmatrix}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Powers of a shear matrix. -/\ntheorem shear_power (k : ℤ) (n : ℕ) :\n (!![1, k; 0, 1] : Matrix (Fin 2) (Fin 2) ℤ) ^ n = !![1, (n : ℤ) * k; 0, 1] := by\n sorry\n\n/-- A product of powers of two shears. -/\ntheorem shear_product (n m : ℕ) :\n (!![1, 5; 0, 1] : Matrix (Fin 2) (Fin 2) ℤ) ^ n * (!![1, 1; 0, 1] : Matrix (Fin 2) (Fin 2) ℤ) ^ m = !![1, (n : ℤ) * 5 + (m : ℤ) * 1; 0, 1] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d3-e0023"}
diff --git a/data/linear-algebra/train.jsonl b/data/linear-algebra/train.jsonl
new file mode 100644
index 0000000000000000000000000000000000000000..954142d2879640f9ec5fa98e98eb1ed5a3827a87
--- /dev/null
+++ b/data/linear-algebra/train.jsonl
@@ -0,0 +1,84 @@
+{"id": "linear-algebra-det_trace-d1-t0000", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 1, "seed": 0, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nCompute the determinant of the product \\(\\begin{pmatrix} -2 & 3 \\\\ 3 & 0 \\end{pmatrix}\\) \\(\\begin{pmatrix} -2 & 4 \\\\ 3 & 0 \\end{pmatrix}\\) of integer matrices. Show that it equals 108.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The determinant of the product is the product of the determinants. -/\ntheorem det_of_product : Matrix.det (!![-2, 3; 3, 0] * !![-2, 4; 3, 0] : Matrix (Fin 2) (Fin 2) ℤ) = 108 := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d1-t0000"}
+{"id": "linear-algebra-independence-d1-t0001", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 1, "seed": 1, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^2\\) consider the vectors \\(\\begin{pmatrix} 0 \\\\ 2 \\end{pmatrix}\\), \\(\\begin{pmatrix} 2 \\\\ 3 \\end{pmatrix}\\). Show that they are linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly independent over the rationals. -/\ntheorem vectors_independent : LinearIndependent ℚ ![(![0, 2] : Fin 2 → ℚ), ![2, 3]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d1-t0001"}
+{"id": "linear-algebra-linear_map-d1-t0002", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 1, "seed": 2, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(f : V \\to W\\) be a linear map of vector spaces over \\(\\mathbb{R}\\) and \\(x, y \\in V\\) with \\(f(x) = 0\\) and \\(f(y) = 0\\). Then \\(f(3x + 4y) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The kernel is closed under linear combinations. -/\ntheorem kernel_combination {V W : Type*} [AddCommGroup V] [Module ℝ V] [AddCommGroup W] [Module ℝ W] (f : V →ₗ[ℝ] W) {x y : V}\n (hx : f x = 0) (hy : f y = 0) : f ((3 : ℝ) • x + (4 : ℝ) • y) = 0 := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d1-t0002"}
+{"id": "linear-algebra-matrix_pow-d1-t0003", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 1, "seed": 3, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every natural number \\(n\\), \\[\\begin{pmatrix} 1 & 0 \\\\ 6 & 1 \\end{pmatrix}^n = \\begin{pmatrix} 1 & 0 \\\\ 6n & 1 \\end{pmatrix}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of a lower shear matrix. -/\ntheorem lower_shear_power (n : ℕ) :\n (!![1, 0; 6, 1] : Matrix (Fin 2) (Fin 2) ℤ) ^ n = !![1, 0; (n : ℤ) * 6, 1] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d1-t0003"}
+{"id": "linear-algebra-det_trace-d2-t0004", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 2, "seed": 4, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nFor every integer \\(x\\), \\[\\det\\left(x I - \\begin{pmatrix} -3 & 3 \\\\ -2 & 1 \\end{pmatrix}\\right) = x^2 - (-2)\\,x + (3),\\] where \\(I\\) is the \\(2 \\times 2\\) identity matrix.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The characteristic polynomial of a 2x2 matrix is x^2 - tr x + det. -/\ntheorem char_poly_value (x : ℤ) :\n Matrix.det (x • (1 : Matrix (Fin 2) (Fin 2) ℤ) - !![-3, 3; -2, 1]) = x ^ 2 - (-2 : ℤ) * x + 3 := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d2-t0004"}
+{"id": "linear-algebra-independence-d2-t0005", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 2, "seed": 5, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^2\\) consider the vectors \\(\\begin{pmatrix} -3 \\\\ 5 \\end{pmatrix}\\), \\(\\begin{pmatrix} -9 \\\\ 15 \\end{pmatrix}\\). Show that they are not linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly dependent over the rationals. -/\ntheorem vectors_dependent : ¬ LinearIndependent ℚ ![(![-3, 5] : Fin 2 → ℚ), ![-9, 15]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d2-t0005"}
+{"id": "linear-algebra-linear_map-d2-t0006", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 2, "seed": 6, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(f : V \\to W\\) and \\(g : W \\to U\\) be linear maps over \\(\\mathbb{R}\\). Then the range of \\(g \\circ f\\) is contained in the range of \\(g\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- range (g ∘ f) ≤ range g. -/\ntheorem range_comp_le {V W U : Type*} [AddCommGroup V] [Module ℝ V] [AddCommGroup W] [Module ℝ W] [AddCommGroup U] [Module ℝ U] (f : V →ₗ[ℝ] W) (g : W →ₗ[ℝ] U) :\n LinearMap.range (g ∘ₗ f) ≤ LinearMap.range g := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d2-t0006"}
+{"id": "linear-algebra-matrix_pow-d2-t0007", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 2, "seed": 7, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every natural number \\(n\\), \\[\\begin{pmatrix} 6 & 1 \\\\ 0 & 6 \\end{pmatrix}^{n+1} = \\begin{pmatrix} (6)^{n+1} & (n+1)(6)^n \\\\ 0 & (6)^{n+1} \\end{pmatrix}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of a 2x2 Jordan block. -/\ntheorem jordan_power (n : ℕ) :\n (!![6, 1; 0, 6] : Matrix (Fin 2) (Fin 2) ℤ) ^ (n + 1) = !![6 ^ (n + 1), ((n : ℤ) + 1) * 6 ^ n; 0, 6 ^ (n + 1)] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d2-t0007"}
+{"id": "linear-algebra-det_trace-d3-t0008", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 3, "seed": 8, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nLet \\(A\\) be a \\(2 \\times 2\\) integer matrix with trace 1 and determinant 3. Then the trace of \\(A^2\\) is -5. You may first prove \\(A^2 = (\\operatorname{tr} A) A - (\\det A) I\\) for every \\(2 \\times 2\\) integer matrix.\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cayley-Hamilton for 2x2 integer matrices. -/\ntheorem cayley_hamilton_two (A : Matrix (Fin 2) (Fin 2) ℤ) :\n A ^ 2 = Matrix.trace A • A - Matrix.det A • (1 : Matrix (Fin 2) (Fin 2) ℤ) := by\n sorry\n\n/-- The trace of A^2 from the trace and determinant of A. -/\ntheorem trace_of_square (A : Matrix (Fin 2) (Fin 2) ℤ) (ht : Matrix.trace A = (1 : ℤ)) (hd : Matrix.det A = (3 : ℤ)) :\n Matrix.trace (A ^ 2) = (-5 : ℤ) := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d3-t0008"}
+{"id": "linear-algebra-independence-d3-t0009", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 3, "seed": 9, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^3\\) consider the vectors \\(\\begin{pmatrix} 6 \\\\ -6 \\\\ 5 \\end{pmatrix}\\), \\(\\begin{pmatrix} -5 \\\\ 6 \\\\ 2 \\end{pmatrix}\\), \\(\\begin{pmatrix} -1 \\\\ -5 \\\\ 0 \\end{pmatrix}\\). Show that they are linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly independent over the rationals. -/\ntheorem vectors_independent : LinearIndependent ℚ ![(![6, -6, 5] : Fin 3 → ℚ), ![-5, 6, 2], ![-1, -5, 0]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d3-t0009"}
+{"id": "linear-algebra-linear_map-d3-t0010", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 3, "seed": 10, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(e : V \\to V\\) be a linear map over \\(\\mathbb{Q}\\) with \\(e(e(x)) = e(x) for every vector x\\). Then the kernel of \\(\\mathrm{id} - e\\) equals the range of \\(e\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- For idempotent p, the kernel of id - p is the range of p. -/\ntheorem ker_id_sub {V : Type*} [AddCommGroup V] [Module ℚ V] (e : V →ₗ[ℚ] V) (hp : ∀ x, e (e x) = e x) :\n LinearMap.ker (LinearMap.id - e) = LinearMap.range e := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d3-t0010"}
+{"id": "linear-algebra-matrix_pow-d3-t0011", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 3, "seed": 11, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every natural number \\(n\\), \\[\\begin{pmatrix} -3 & -1 \\\\ 0 & 1 \\end{pmatrix}^n = \\begin{pmatrix} (-3)^n & -1 \\sum_{i=0}^{n-1} (-3)^i \\\\ 0 & 1 \\end{pmatrix}.\\] The sum is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of an affine map matrix, with a geometric sum. -/\ntheorem affine_power (n : ℕ) :\n (!![(-3 : ℤ), (-1 : ℤ); 0, 1] : Matrix (Fin 2) (Fin 2) ℤ) ^ n = !![(-3 : ℤ) ^ n, (-1 : ℤ) * ∑ i ∈ Finset.range n, (-3 : ℤ) ^ i; 0, 1] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d3-t0011"}
+{"id": "linear-algebra-det_trace-d1-t0012", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 1, "seed": 12, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nFor every integer \\(x\\), \\[\\begin{pmatrix} x+0 & 2 \\\\ -3 & x-3 \\end{pmatrix}\\begin{pmatrix} x-3 & -2 \\\\ 3 & x+0 \\end{pmatrix} = (x^2 -3 x +6) \\begin{pmatrix} 1 & 0 \\\\ 0 & 1 \\end{pmatrix}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A matrix times its adjugate is its determinant times the identity. -/\ntheorem adjugate_product (x : ℤ) :\n !![x + 0, 2; -3, x - 3] * !![x - 3, -2; 3, x + 0] = (x ^ 2 + -3 * x + 6) • (1 : Matrix (Fin 2) (Fin 2) ℤ) := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d1-t0012"}
+{"id": "linear-algebra-independence-d1-t0013", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 1, "seed": 13, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^2\\) consider the vectors \\(\\begin{pmatrix} -2 \\\\ 3 \\end{pmatrix}\\), \\(\\begin{pmatrix} 6 \\\\ -9 \\end{pmatrix}\\). Show that they are not linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly dependent over the rationals. -/\ntheorem vectors_dependent : ¬ LinearIndependent ℚ ![(![-2, 3] : Fin 2 → ℚ), ![6, -9]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d1-t0013"}
+{"id": "linear-algebra-linear_map-d1-t0014", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 1, "seed": 14, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(f : V \\to W\\) be a linear map of vector spaces over \\(\\mathbb{R}\\) and \\(x, y \\in V\\) with \\(f(x) = 0\\) and \\(f(y) = 0\\). Then \\(f(-3x + 5y) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The kernel is closed under linear combinations. -/\ntheorem kernel_combination {V W : Type*} [AddCommGroup V] [Module ℝ V] [AddCommGroup W] [Module ℝ W] (f : V →ₗ[ℝ] W) {x y : V}\n (hx : f x = 0) (hy : f y = 0) : f ((-3 : ℝ) • x + (5 : ℝ) • y) = 0 := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d1-t0014"}
+{"id": "linear-algebra-matrix_pow-d1-t0015", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 1, "seed": 15, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every natural number \\(n\\), \\[\\begin{pmatrix} 1 & -2 \\\\ 0 & 1 \\end{pmatrix}^n = \\begin{pmatrix} 1 & -2n \\\\ 0 & 1 \\end{pmatrix}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of a shear matrix. -/\ntheorem shear_power (n : ℕ) :\n (!![1, -2; 0, 1] : Matrix (Fin 2) (Fin 2) ℤ) ^ n = !![1, (n : ℤ) * (-2 : ℤ); 0, 1] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d1-t0015"}
+{"id": "linear-algebra-det_trace-d2-t0016", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 2, "seed": 16, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nFor every integer \\(x\\), \\[\\det\\left(x I - \\begin{pmatrix} -3 & -2 \\\\ -3 & 3 \\end{pmatrix}\\right) = x^2 - (0)\\,x + (-15),\\] where \\(I\\) is the \\(2 \\times 2\\) identity matrix.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The characteristic polynomial of a 2x2 matrix is x^2 - tr x + det. -/\ntheorem char_poly_value (x : ℤ) :\n Matrix.det (x • (1 : Matrix (Fin 2) (Fin 2) ℤ) - !![-3, -2; -3, 3]) = x ^ 2 - 0 * x + (-15 : ℤ) := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d2-t0016"}
+{"id": "linear-algebra-independence-d2-t0017", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 2, "seed": 17, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^2\\) consider the vectors \\(\\begin{pmatrix} 4 \\\\ 4 \\end{pmatrix}\\), \\(\\begin{pmatrix} 4 \\\\ 4 \\end{pmatrix}\\). Show that they are not linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly dependent over the rationals. -/\ntheorem vectors_dependent : ¬ LinearIndependent ℚ ![(![4, 4] : Fin 2 → ℚ), ![4, 4]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d2-t0017"}
+{"id": "linear-algebra-linear_map-d2-t0018", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 2, "seed": 18, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(f : V \\to W\\) be a linear map of vector spaces over \\(\\mathbb{Q}\\). Then the kernel of \\(3f\\) equals the kernel of \\(f\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A nonzero scalar multiple has the same kernel. -/\ntheorem ker_smul_eq {V W : Type*} [AddCommGroup V] [Module ℚ V] [AddCommGroup W] [Module ℚ W] (f : V →ₗ[ℚ] W) :\n LinearMap.ker ((3 : ℚ) • f) = LinearMap.ker f := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d2-t0018"}
+{"id": "linear-algebra-matrix_pow-d2-t0019", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 2, "seed": 19, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every natural number \\(n\\), \\[\\begin{pmatrix} 3 & 1 \\\\ 0 & 3 \\end{pmatrix}^{n+1} = \\begin{pmatrix} (3)^{n+1} & (n+1)(3)^n \\\\ 0 & (3)^{n+1} \\end{pmatrix}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of a 2x2 Jordan block. -/\ntheorem jordan_power (n : ℕ) :\n (!![3, 1; 0, 3] : Matrix (Fin 2) (Fin 2) ℤ) ^ (n + 1) = !![3 ^ (n + 1), ((n : ℤ) + 1) * 3 ^ n; 0, 3 ^ (n + 1)] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d2-t0019"}
+{"id": "linear-algebra-det_trace-d3-t0020", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 3, "seed": 20, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nLet \\(A\\) be a \\(2 \\times 2\\) integer matrix with trace 0 and determinant 1. Then the trace of \\(A^2\\) is -2. You may first prove \\(A^2 = (\\operatorname{tr} A) A - (\\det A) I\\) for every \\(2 \\times 2\\) integer matrix.\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cayley-Hamilton for 2x2 integer matrices. -/\ntheorem cayley_hamilton_two (A : Matrix (Fin 2) (Fin 2) ℤ) :\n A ^ 2 = Matrix.trace A • A - Matrix.det A • (1 : Matrix (Fin 2) (Fin 2) ℤ) := by\n sorry\n\n/-- The trace of A^2 from the trace and determinant of A. -/\ntheorem trace_of_square (A : Matrix (Fin 2) (Fin 2) ℤ) (ht : Matrix.trace A = (0 : ℤ)) (hd : Matrix.det A = (1 : ℤ)) :\n Matrix.trace (A ^ 2) = (-2 : ℤ) := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d3-t0020"}
+{"id": "linear-algebra-independence-d3-t0021", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 3, "seed": 21, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^3\\) consider the vectors \\(\\begin{pmatrix} -6 \\\\ -5 \\\\ -1 \\end{pmatrix}\\), \\(\\begin{pmatrix} 5 \\\\ -4 \\\\ -2 \\end{pmatrix}\\), \\(\\begin{pmatrix} 2 \\\\ -6 \\\\ 5 \\end{pmatrix}\\). Show that they are linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly independent over the rationals. -/\ntheorem vectors_independent : LinearIndependent ℚ ![(![-6, -5, -1] : Fin 3 → ℚ), ![5, -4, -2], ![2, -6, 5]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d3-t0021"}
+{"id": "linear-algebra-linear_map-d3-t0022", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 3, "seed": 22, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(q : V \\to V\\) be a linear map over \\(\\mathbb{R}\\) with \\(q^2 = q\\). Show that \\(\\ker q\\) and \\(\\operatorname{range} q\\) are complementary subspaces: their intersection is \\(\\{0\\}\\) and together they span \\(V\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The kernel and the range of an idempotent map meet only in 0. -/\ntheorem disjoint_ker_range {V : Type*} [AddCommGroup V] [Module ℝ V] (q : V →ₗ[ℝ] V) (hp : q * q = q) :\n Disjoint (LinearMap.ker q) (LinearMap.range q) := by\n sorry\n\n/-- The kernel and the range of an idempotent map are complements. -/\ntheorem ker_range_isCompl {V : Type*} [AddCommGroup V] [Module ℝ V] (q : V →ₗ[ℝ] V) (hp : q * q = q) :\n IsCompl (LinearMap.ker q) (LinearMap.range q) := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d3-t0022"}
+{"id": "linear-algebra-matrix_pow-d3-t0023", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 3, "seed": 23, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every natural number \\(n\\), \\[\\begin{pmatrix} -3 & -1 \\\\ 0 & 1 \\end{pmatrix}^n = \\begin{pmatrix} (-3)^n & -1 \\sum_{i=0}^{n-1} (-3)^i \\\\ 0 & 1 \\end{pmatrix}.\\] The sum is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of an affine map matrix, with a geometric sum. -/\ntheorem affine_power (n : ℕ) :\n (!![(-3 : ℤ), (-1 : ℤ); 0, 1] : Matrix (Fin 2) (Fin 2) ℤ) ^ n = !![(-3 : ℤ) ^ n, (-1 : ℤ) * ∑ i ∈ Finset.range n, (-3 : ℤ) ^ i; 0, 1] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d3-t0023"}
+{"id": "linear-algebra-det_trace-d1-t0024", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 1, "seed": 24, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nCompute the determinant of the product \\(\\begin{pmatrix} -2 & 0 \\\\ 1 & -3 \\end{pmatrix}\\) \\(\\begin{pmatrix} 3 & -2 \\\\ 4 & -1 \\end{pmatrix}\\) of integer matrices. Show that it equals 30.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The determinant of the product is the product of the determinants. -/\ntheorem det_of_product : Matrix.det (!![-2, 0; 1, -3] * !![3, -2; 4, -1] : Matrix (Fin 2) (Fin 2) ℤ) = 30 := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d1-t0024"}
+{"id": "linear-algebra-independence-d1-t0025", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 1, "seed": 25, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^2\\) consider the vectors \\(\\begin{pmatrix} -4 \\\\ -1 \\end{pmatrix}\\), \\(\\begin{pmatrix} 4 \\\\ 1 \\end{pmatrix}\\). Show that they are not linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly dependent over the rationals. -/\ntheorem vectors_dependent : ¬ LinearIndependent ℚ ![(![-4, -1] : Fin 2 → ℚ), ![4, 1]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d1-t0025"}
+{"id": "linear-algebra-linear_map-d1-t0026", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 1, "seed": 26, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(f : V \\to W\\) be a linear map of vector spaces over \\(\\mathbb{Q}\\) and \\(a, b \\in V\\) with \\(f(a) = 0\\) and \\(f(b) = 0\\). Then \\(f(7a + 3b) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The kernel is closed under linear combinations. -/\ntheorem kernel_combination {V W : Type*} [AddCommGroup V] [Module ℚ V] [AddCommGroup W] [Module ℚ W] (f : V →ₗ[ℚ] W) {a b : V}\n (hx : f a = 0) (hy : f b = 0) : f ((7 : ℚ) • a + (3 : ℚ) • b) = 0 := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d1-t0026"}
+{"id": "linear-algebra-matrix_pow-d1-t0027", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 1, "seed": 27, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every natural number \\(n\\), \\[\\begin{pmatrix} 1 & 0 \\\\ -2 & 1 \\end{pmatrix}^n = \\begin{pmatrix} 1 & 0 \\\\ -2n & 1 \\end{pmatrix}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of a lower shear matrix. -/\ntheorem lower_shear_power (n : ℕ) :\n (!![1, 0; -2, 1] : Matrix (Fin 2) (Fin 2) ℤ) ^ n = !![1, 0; (n : ℤ) * (-2 : ℤ), 1] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d1-t0027"}
+{"id": "linear-algebra-det_trace-d2-t0028", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 2, "seed": 28, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nFor every integer \\(x\\), the determinant of \\[\\begin{pmatrix} x-2 & 2 \\\\ 0 & x-1 \\end{pmatrix}\\begin{pmatrix} x & 3 \\\\ -1 & x-1 \\end{pmatrix}\\] equals \\(x^4 - 4x^3 + 8x^2 - 11x + 6\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The determinant of a product of matrices with a variable entry. -/\ntheorem det_of_polynomial_product (x : ℤ) :\n Matrix.det (!![x - 2, 2; 0, x - 1] * !![x, 3; -1, x - 1] : Matrix (Fin 2) (Fin 2) ℤ) = x ^ 4 - 4 * x ^ 3 + 8 * x ^ 2 - 11 * x + 6 := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d2-t0028"}
+{"id": "linear-algebra-independence-d2-t0029", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 2, "seed": 29, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^2\\) consider the vectors \\(\\begin{pmatrix} 2 \\\\ 3 \\end{pmatrix}\\), \\(\\begin{pmatrix} -3 \\\\ 3 \\end{pmatrix}\\). Show that they are linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly independent over the rationals. -/\ntheorem vectors_independent : LinearIndependent ℚ ![(![2, 3] : Fin 2 → ℚ), ![-3, 3]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d2-t0029"}
+{"id": "linear-algebra-linear_map-d2-t0030", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 2, "seed": 30, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(f : V \\to W\\) and \\(g : W \\to U\\) be linear maps over \\(\\mathbb{R}\\). Then the kernel of \\(f\\) is contained in the kernel of \\(g \\circ f\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- ker f ≤ ker (g ∘ f). -/\ntheorem ker_le_comp {V W U : Type*} [AddCommGroup V] [Module ℝ V] [AddCommGroup W] [Module ℝ W] [AddCommGroup U] [Module ℝ U] (f : V →ₗ[ℝ] W) (g : W →ₗ[ℝ] U) :\n LinearMap.ker f ≤ LinearMap.ker (g ∘ₗ f) := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d2-t0030"}
+{"id": "linear-algebra-matrix_pow-d2-t0031", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 2, "seed": 31, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every natural number \\(n\\), \\[\\begin{pmatrix} 4 & 0 \\\\ 0 & 7 \\end{pmatrix}^n = \\begin{pmatrix} (4)^n & 0 \\\\ 0 & (7)^n \\end{pmatrix}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of a diagonal matrix. -/\ntheorem diagonal_power (n : ℕ) :\n (!![4, 0; 0, 7] : Matrix (Fin 2) (Fin 2) ℤ) ^ n = !![4 ^ n, 0; 0, 7 ^ n] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d2-t0031"}
+{"id": "linear-algebra-det_trace-d3-t0032", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 3, "seed": 32, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nLet \\(A\\) be a \\(2 \\times 2\\) integer matrix with trace 2 and determinant 3. Then \\(A^3 = 1 A - 6 I\\), where \\(I\\) is the identity matrix. You may first prove \\(A^2 = (\\operatorname{tr} A) A - (\\det A) I\\) for every \\(2 \\times 2\\) integer matrix.\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cayley-Hamilton for 2x2 integer matrices. -/\ntheorem cayley_hamilton_two (A : Matrix (Fin 2) (Fin 2) ℤ) :\n A ^ 2 = Matrix.trace A • A - Matrix.det A • (1 : Matrix (Fin 2) (Fin 2) ℤ) := by\n sorry\n\n/-- A^3 in terms of the trace and determinant. -/\ntheorem cube_of_matrix (A : Matrix (Fin 2) (Fin 2) ℤ) (ht : Matrix.trace A = (2 : ℤ)) (hd : Matrix.det A = (3 : ℤ)) :\n A ^ 3 = (1 : ℤ) • A - (6 : ℤ) • (1 : Matrix (Fin 2) (Fin 2) ℤ) := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d3-t0032"}
+{"id": "linear-algebra-independence-d3-t0033", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 3, "seed": 33, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^3\\) consider the vectors \\(\\begin{pmatrix} 6 \\\\ -4 \\\\ -1 \\end{pmatrix}\\), \\(\\begin{pmatrix} -3 \\\\ -1 \\\\ 4 \\end{pmatrix}\\), \\(\\begin{pmatrix} -24 \\\\ 10 \\\\ 11 \\end{pmatrix}\\). Show that they are not linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly dependent over the rationals. -/\ntheorem vectors_dependent : ¬ LinearIndependent ℚ ![(![6, -4, -1] : Fin 3 → ℚ), ![-3, -1, 4], ![-24, 10, 11]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d3-t0033"}
+{"id": "linear-algebra-linear_map-d3-t0034", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 3, "seed": 34, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(p : V \\to V\\) be a linear map over \\(\\mathbb{R}\\) with \\(p \\circ p = p\\). Then the kernel of \\(\\mathrm{id} - p\\) equals the range of \\(p\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- For idempotent p, the kernel of id - p is the range of p. -/\ntheorem ker_id_sub {V : Type*} [AddCommGroup V] [Module ℝ V] (p : V →ₗ[ℝ] V) (hp : p ∘ₗ p = p) :\n LinearMap.ker (LinearMap.id - p) = LinearMap.range p := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d3-t0034"}
+{"id": "linear-algebra-matrix_pow-d3-t0035", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 3, "seed": 35, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every integer \\(k\\) and natural number \\(n\\), \\[\\begin{pmatrix} 1 & k \\\\ 0 & 1 \\end{pmatrix}^n = \\begin{pmatrix} 1 & nk \\\\ 0 & 1 \\end{pmatrix}.\\] Deduce that for all natural numbers \\(n, m\\), \\[\\begin{pmatrix} 1 & -3 \\\\ 0 & 1 \\end{pmatrix}^n \\begin{pmatrix} 1 & -1 \\\\ 0 & 1 \\end{pmatrix}^m = \\begin{pmatrix} 1 & -3n + -1m \\\\ 0 & 1 \\end{pmatrix}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Powers of a shear matrix. -/\ntheorem shear_power (k : ℤ) (n : ℕ) :\n (!![1, k; 0, 1] : Matrix (Fin 2) (Fin 2) ℤ) ^ n = !![1, (n : ℤ) * k; 0, 1] := by\n sorry\n\n/-- A product of powers of two shears. -/\ntheorem shear_product (n m : ℕ) :\n (!![1, (-3 : ℤ); 0, 1] : Matrix (Fin 2) (Fin 2) ℤ) ^ n * (!![1, (-1 : ℤ); 0, 1] : Matrix (Fin 2) (Fin 2) ℤ) ^ m = !![1, (n : ℤ) * (-3 : ℤ) + (m : ℤ) * (-1 : ℤ); 0, 1] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d3-t0035"}
+{"id": "linear-algebra-det_trace-d1-t0036", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 1, "seed": 36, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nCompute the determinant of the product \\(\\begin{pmatrix} 4 & 0 \\\\ -2 & 3 \\end{pmatrix}\\) \\(\\begin{pmatrix} 1 & 4 \\\\ -1 & 3 \\end{pmatrix}\\) of integer matrices. Show that it equals 84.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The determinant of the product is the product of the determinants. -/\ntheorem det_of_product : Matrix.det (!![4, 0; -2, 3] * !![1, 4; -1, 3] : Matrix (Fin 2) (Fin 2) ℤ) = 84 := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d1-t0036"}
+{"id": "linear-algebra-independence-d1-t0037", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 1, "seed": 37, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^2\\) consider the vectors \\(\\begin{pmatrix} -4 \\\\ -4 \\end{pmatrix}\\), \\(\\begin{pmatrix} 4 \\\\ 3 \\end{pmatrix}\\). Show that they are linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly independent over the rationals. -/\ntheorem vectors_independent : LinearIndependent ℚ ![(![-4, -4] : Fin 2 → ℚ), ![4, 3]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d1-t0037"}
+{"id": "linear-algebra-linear_map-d1-t0038", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 1, "seed": 38, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(e : V \\to V\\) be a linear map over \\(\\mathbb{R}\\) with \\(e(v(v)) = v(v)\\) for every \\(v\\). Then \\(x - e(x)\\) lies in the kernel of \\(e\\) for every \\(x \\in V\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- x - p x lies in the kernel of an idempotent map p. -/\ntheorem sub_proj_mem_ker {V : Type*} [AddCommGroup V] [Module ℝ V] (e : V →ₗ[ℝ] V) (hp : ∀ x, e (e x) = e x) (x : V) :\n x - e x ∈ LinearMap.ker e := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d1-t0038"}
+{"id": "linear-algebra-matrix_pow-d1-t0039", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 1, "seed": 39, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every natural number \\(n\\), \\[\\begin{pmatrix} 1 & 0 \\\\ 3 & 1 \\end{pmatrix}^n = \\begin{pmatrix} 1 & 0 \\\\ 3n & 1 \\end{pmatrix}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of a lower shear matrix. -/\ntheorem lower_shear_power (n : ℕ) :\n (!![1, 0; 3, 1] : Matrix (Fin 2) (Fin 2) ℤ) ^ n = !![1, 0; (n : ℤ) * 3, 1] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d1-t0039"}
+{"id": "linear-algebra-det_trace-d2-t0040", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 2, "seed": 40, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nFor every integer \\(x\\), \\[\\det\\left(x I - \\begin{pmatrix} -2 & -1 \\\\ -3 & -2 \\end{pmatrix}\\right) = x^2 - (-4)\\,x + (1),\\] where \\(I\\) is the \\(2 \\times 2\\) identity matrix.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The characteristic polynomial of a 2x2 matrix is x^2 - tr x + det. -/\ntheorem char_poly_value (x : ℤ) :\n Matrix.det (x • (1 : Matrix (Fin 2) (Fin 2) ℤ) - !![-2, -1; -3, -2]) = x ^ 2 - (-4 : ℤ) * x + 1 := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d2-t0040"}
+{"id": "linear-algebra-independence-d2-t0041", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 2, "seed": 41, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^2\\) consider the vectors \\(\\begin{pmatrix} 3 \\\\ 6 \\end{pmatrix}\\), \\(\\begin{pmatrix} 5 \\\\ -5 \\end{pmatrix}\\). Show that they are linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly independent over the rationals. -/\ntheorem vectors_independent : LinearIndependent ℚ ![(![3, 6] : Fin 2 → ℚ), ![5, -5]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d2-t0041"}
+{"id": "linear-algebra-linear_map-d2-t0042", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 2, "seed": 42, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(f : V \\to W\\) and \\(g : W \\to U\\) be linear maps over \\(\\mathbb{R}\\). Then the range of \\(g \\circ f\\) is contained in the range of \\(g\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- range (g ∘ f) ≤ range g. -/\ntheorem range_comp_le {V W U : Type*} [AddCommGroup V] [Module ℝ V] [AddCommGroup W] [Module ℝ W] [AddCommGroup U] [Module ℝ U] (f : V →ₗ[ℝ] W) (g : W →ₗ[ℝ] U) :\n LinearMap.range (g ∘ₗ f) ≤ LinearMap.range g := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d2-t0042"}
+{"id": "linear-algebra-matrix_pow-d2-t0043", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 2, "seed": 43, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every natural number \\(n\\), \\[\\begin{pmatrix} 6 & 1 \\\\ 0 & 6 \\end{pmatrix}^{n+1} = \\begin{pmatrix} (6)^{n+1} & (n+1)(6)^n \\\\ 0 & (6)^{n+1} \\end{pmatrix}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of a 2x2 Jordan block. -/\ntheorem jordan_power (n : ℕ) :\n (!![6, 1; 0, 6] : Matrix (Fin 2) (Fin 2) ℤ) ^ (n + 1) = !![6 ^ (n + 1), ((n : ℤ) + 1) * 6 ^ n; 0, 6 ^ (n + 1)] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d2-t0043"}
+{"id": "linear-algebra-det_trace-d3-t0044", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 3, "seed": 44, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nLet \\(A\\) be a \\(2 \\times 2\\) integer matrix with trace 2 and determinant -4. Then \\(A^3 = 8 A - -8 I\\), where \\(I\\) is the identity matrix. You may first prove \\(A^2 = (\\operatorname{tr} A) A - (\\det A) I\\) for every \\(2 \\times 2\\) integer matrix.\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cayley-Hamilton for 2x2 integer matrices. -/\ntheorem cayley_hamilton_two (A : Matrix (Fin 2) (Fin 2) ℤ) :\n A ^ 2 = Matrix.trace A • A - Matrix.det A • (1 : Matrix (Fin 2) (Fin 2) ℤ) := by\n sorry\n\n/-- A^3 in terms of the trace and determinant. -/\ntheorem cube_of_matrix (A : Matrix (Fin 2) (Fin 2) ℤ) (ht : Matrix.trace A = (2 : ℤ)) (hd : Matrix.det A = (-4 : ℤ)) :\n A ^ 3 = (8 : ℤ) • A - (-8 : ℤ) • (1 : Matrix (Fin 2) (Fin 2) ℤ) := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d3-t0044"}
+{"id": "linear-algebra-independence-d3-t0045", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 3, "seed": 45, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^3\\) consider the vectors \\(\\begin{pmatrix} -4 \\\\ 4 \\\\ -6 \\end{pmatrix}\\), \\(\\begin{pmatrix} -3 \\\\ -3 \\\\ 1 \\end{pmatrix}\\), \\(\\begin{pmatrix} 4 \\\\ -5 \\\\ 4 \\end{pmatrix}\\). Show that they are linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly independent over the rationals. -/\ntheorem vectors_independent : LinearIndependent ℚ ![(![-4, 4, -6] : Fin 3 → ℚ), ![-3, -3, 1], ![4, -5, 4]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d3-t0045"}
+{"id": "linear-algebra-linear_map-d3-t0046", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 3, "seed": 46, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(e : V \\to V\\) be a linear map over \\(\\mathbb{Q}\\) with \\(e^2 = e\\). Show that \\(\\ker e\\) and \\(\\operatorname{range} e\\) are complementary subspaces: their intersection is \\(\\{0\\}\\) and together they span \\(V\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The kernel and the range of an idempotent map meet only in 0. -/\ntheorem disjoint_ker_range {V : Type*} [AddCommGroup V] [Module ℚ V] (e : V →ₗ[ℚ] V) (hp : e * e = e) :\n Disjoint (LinearMap.ker e) (LinearMap.range e) := by\n sorry\n\n/-- The kernel and the range of an idempotent map are complements. -/\ntheorem ker_range_isCompl {V : Type*} [AddCommGroup V] [Module ℚ V] (e : V →ₗ[ℚ] V) (hp : e * e = e) :\n IsCompl (LinearMap.ker e) (LinearMap.range e) := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d3-t0046"}
+{"id": "linear-algebra-matrix_pow-d3-t0047", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 3, "seed": 47, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every natural number \\(n\\), \\[\\begin{pmatrix} 4 & 3 \\\\ 0 & 1 \\end{pmatrix}^n = \\begin{pmatrix} (4)^n & 3 \\sum_{i=0}^{n-1} (4)^i \\\\ 0 & 1 \\end{pmatrix}.\\] The sum is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of an affine map matrix, with a geometric sum. -/\ntheorem affine_power (n : ℕ) :\n (!![4, 3; 0, 1] : Matrix (Fin 2) (Fin 2) ℤ) ^ n = !![4 ^ n, 3 * ∑ i ∈ Finset.range n, 4 ^ i; 0, 1] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d3-t0047"}
+{"id": "linear-algebra-det_trace-d1-t0048", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 1, "seed": 48, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nCompute the determinant of the product \\(\\begin{pmatrix} -1 & 0 \\\\ 0 & 2 \\end{pmatrix}\\) \\(\\begin{pmatrix} 0 & -2 \\\\ 3 & 2 \\end{pmatrix}\\) of integer matrices. Show that it equals -12.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The determinant of the product is the product of the determinants. -/\ntheorem det_of_product : Matrix.det (!![-1, 0; 0, 2] * !![0, -2; 3, 2] : Matrix (Fin 2) (Fin 2) ℤ) = (-12 : ℤ) := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d1-t0048"}
+{"id": "linear-algebra-independence-d1-t0049", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 1, "seed": 49, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^2\\) consider the vectors \\(\\begin{pmatrix} 3 \\\\ 2 \\end{pmatrix}\\), \\(\\begin{pmatrix} -3 \\\\ -2 \\end{pmatrix}\\). Show that they are not linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly dependent over the rationals. -/\ntheorem vectors_dependent : ¬ LinearIndependent ℚ ![(![3, 2] : Fin 2 → ℚ), ![-3, -2]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d1-t0049"}
+{"id": "linear-algebra-linear_map-d1-t0050", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 1, "seed": 50, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(e : V \\to V\\) be a linear map over \\(\\mathbb{R}\\) with \\(e(v(v)) = v(v)\\) for every \\(v\\). Then \\(a - e(a)\\) lies in the kernel of \\(e\\) for every \\(a \\in V\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- x - p x lies in the kernel of an idempotent map p. -/\ntheorem sub_proj_mem_ker {V : Type*} [AddCommGroup V] [Module ℝ V] (e : V →ₗ[ℝ] V) (hp : ∀ x, e (e x) = e x) (a : V) :\n a - e a ∈ LinearMap.ker e := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d1-t0050"}
+{"id": "linear-algebra-matrix_pow-d1-t0051", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 1, "seed": 51, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every natural number \\(n\\), \\[\\begin{pmatrix} 1 & 2 \\\\ 0 & 1 \\end{pmatrix}^n = \\begin{pmatrix} 1 & 2n \\\\ 0 & 1 \\end{pmatrix}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of a shear matrix. -/\ntheorem shear_power (n : ℕ) :\n (!![1, 2; 0, 1] : Matrix (Fin 2) (Fin 2) ℤ) ^ n = !![1, (n : ℤ) * 2; 0, 1] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d1-t0051"}
+{"id": "linear-algebra-det_trace-d2-t0052", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 2, "seed": 52, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nFor every integer \\(x\\), \\[\\det\\left(x I - \\begin{pmatrix} 2 & 0 \\\\ -2 & -1 \\end{pmatrix}\\right) = x^2 - (1)\\,x + (-2),\\] where \\(I\\) is the \\(2 \\times 2\\) identity matrix.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The characteristic polynomial of a 2x2 matrix is x^2 - tr x + det. -/\ntheorem char_poly_value (x : ℤ) :\n Matrix.det (x • (1 : Matrix (Fin 2) (Fin 2) ℤ) - !![2, 0; -2, -1]) = x ^ 2 - 1 * x + (-2 : ℤ) := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d2-t0052"}
+{"id": "linear-algebra-independence-d2-t0053", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 2, "seed": 53, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^2\\) consider the vectors \\(\\begin{pmatrix} 3 \\\\ -1 \\end{pmatrix}\\), \\(\\begin{pmatrix} -6 \\\\ 2 \\end{pmatrix}\\). Show that they are not linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly dependent over the rationals. -/\ntheorem vectors_dependent : ¬ LinearIndependent ℚ ![(![3, -1] : Fin 2 → ℚ), ![-6, 2]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d2-t0053"}
+{"id": "linear-algebra-linear_map-d2-t0054", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 2, "seed": 54, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(q : V \\to V\\) be a linear map over \\(\\mathbb{R}\\) with \\(q(q(x)) = q(x) for every vector x\\). Then the kernel of \\(\\mathrm{id} - q\\) equals the range of \\(q\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- For idempotent p, the kernel of id - p is the range of p. -/\ntheorem ker_id_sub {V : Type*} [AddCommGroup V] [Module ℝ V] (q : V →ₗ[ℝ] V) (hp : ∀ x, q (q x) = q x) :\n LinearMap.ker (LinearMap.id - q) = LinearMap.range q := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d2-t0054"}
+{"id": "linear-algebra-matrix_pow-d2-t0055", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 2, "seed": 55, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every natural number \\(n\\), \\[\\begin{pmatrix} 4 & 1 \\\\ 0 & 4 \\end{pmatrix}^{n+1} = \\begin{pmatrix} (4)^{n+1} & (n+1)(4)^n \\\\ 0 & (4)^{n+1} \\end{pmatrix}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of a 2x2 Jordan block. -/\ntheorem jordan_power (n : ℕ) :\n (!![4, 1; 0, 4] : Matrix (Fin 2) (Fin 2) ℤ) ^ (n + 1) = !![4 ^ (n + 1), ((n : ℤ) + 1) * 4 ^ n; 0, 4 ^ (n + 1)] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d2-t0055"}
+{"id": "linear-algebra-det_trace-d3-t0056", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 3, "seed": 56, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nLet \\(A\\) be a \\(2 \\times 2\\) integer matrix with trace 2 and determinant 1. Then \\(A^3 = 3 A - 2 I\\), where \\(I\\) is the identity matrix. You may first prove \\(A^2 = (\\operatorname{tr} A) A - (\\det A) I\\) for every \\(2 \\times 2\\) integer matrix.\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cayley-Hamilton for 2x2 integer matrices. -/\ntheorem cayley_hamilton_two (A : Matrix (Fin 2) (Fin 2) ℤ) :\n A ^ 2 = Matrix.trace A • A - Matrix.det A • (1 : Matrix (Fin 2) (Fin 2) ℤ) := by\n sorry\n\n/-- A^3 in terms of the trace and determinant. -/\ntheorem cube_of_matrix (A : Matrix (Fin 2) (Fin 2) ℤ) (ht : Matrix.trace A = (2 : ℤ)) (hd : Matrix.det A = (1 : ℤ)) :\n A ^ 3 = (3 : ℤ) • A - (2 : ℤ) • (1 : Matrix (Fin 2) (Fin 2) ℤ) := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d3-t0056"}
+{"id": "linear-algebra-independence-d3-t0057", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 3, "seed": 57, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^3\\) consider the vectors \\(\\begin{pmatrix} 1 \\\\ 6 \\\\ 3 \\end{pmatrix}\\), \\(\\begin{pmatrix} 3 \\\\ 1 \\\\ -6 \\end{pmatrix}\\), \\(\\begin{pmatrix} 1 \\\\ 2 \\\\ -5 \\end{pmatrix}\\). Show that they are linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly independent over the rationals. -/\ntheorem vectors_independent : LinearIndependent ℚ ![(![1, 6, 3] : Fin 3 → ℚ), ![3, 1, -6], ![1, 2, -5]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d3-t0057"}
+{"id": "linear-algebra-linear_map-d3-t0058", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 3, "seed": 58, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(q : V \\to V\\) be a linear map over \\(\\mathbb{R}\\) with \\(q \\circ q = q\\). Then the kernel of \\(\\mathrm{id} - q\\) equals the range of \\(q\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- For idempotent p, the kernel of id - p is the range of p. -/\ntheorem ker_id_sub {V : Type*} [AddCommGroup V] [Module ℝ V] (q : V →ₗ[ℝ] V) (hp : q ∘ₗ q = q) :\n LinearMap.ker (LinearMap.id - q) = LinearMap.range q := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d3-t0058"}
+{"id": "linear-algebra-matrix_pow-d3-t0059", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 3, "seed": 59, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every natural number \\(n\\), \\[\\begin{pmatrix} 5 & 6 \\\\ 0 & 1 \\end{pmatrix}^n = \\begin{pmatrix} (5)^n & 6 \\sum_{i=0}^{n-1} (5)^i \\\\ 0 & 1 \\end{pmatrix}.\\] The sum is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of an affine map matrix, with a geometric sum. -/\ntheorem affine_power (n : ℕ) :\n (!![5, 6; 0, 1] : Matrix (Fin 2) (Fin 2) ℤ) ^ n = !![5 ^ n, 6 * ∑ i ∈ Finset.range n, 5 ^ i; 0, 1] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d3-t0059"}
+{"id": "linear-algebra-det_trace-d1-t0060", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 1, "seed": 60, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nFor every integer \\(x\\), \\[\\begin{pmatrix} x+1 & -2 \\\\ -2 & x+3 \\end{pmatrix}\\begin{pmatrix} x+3 & 2 \\\\ 2 & x+1 \\end{pmatrix} = (x^2 +4 x -1) \\begin{pmatrix} 1 & 0 \\\\ 0 & 1 \\end{pmatrix}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A matrix times its adjugate is its determinant times the identity. -/\ntheorem adjugate_product (x : ℤ) :\n !![x + 1, -2; -2, x + 3] * !![x + 3, 2; 2, x + 1] = (x ^ 2 + 4 * x + -1) • (1 : Matrix (Fin 2) (Fin 2) ℤ) := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d1-t0060"}
+{"id": "linear-algebra-independence-d1-t0061", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 1, "seed": 61, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^2\\) consider the vectors \\(\\begin{pmatrix} 2 \\\\ -1 \\end{pmatrix}\\), \\(\\begin{pmatrix} -2 \\\\ 1 \\end{pmatrix}\\). Show that they are not linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly dependent over the rationals. -/\ntheorem vectors_dependent : ¬ LinearIndependent ℚ ![(![2, -1] : Fin 2 → ℚ), ![-2, 1]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d1-t0061"}
+{"id": "linear-algebra-linear_map-d1-t0062", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 1, "seed": 62, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(e : V \\to V\\) be a linear map over \\(\\mathbb{R}\\) with \\(e(v(v)) = v(v)\\) for every \\(v\\). Then \\(u - e(u)\\) lies in the kernel of \\(e\\) for every \\(u \\in V\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- x - p x lies in the kernel of an idempotent map p. -/\ntheorem sub_proj_mem_ker {V : Type*} [AddCommGroup V] [Module ℝ V] (e : V →ₗ[ℝ] V) (hp : ∀ x, e (e x) = e x) (u : V) :\n u - e u ∈ LinearMap.ker e := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d1-t0062"}
+{"id": "linear-algebra-matrix_pow-d1-t0063", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 1, "seed": 63, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every natural number \\(n\\), \\[\\begin{pmatrix} 1 & 4 \\\\ 0 & 1 \\end{pmatrix}^n = \\begin{pmatrix} 1 & 4n \\\\ 0 & 1 \\end{pmatrix}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of a shear matrix. -/\ntheorem shear_power (n : ℕ) :\n (!![1, 4; 0, 1] : Matrix (Fin 2) (Fin 2) ℤ) ^ n = !![1, (n : ℤ) * 4; 0, 1] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d1-t0063"}
+{"id": "linear-algebra-det_trace-d2-t0064", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 2, "seed": 64, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nFor every integer \\(x\\), the determinant of \\[\\begin{pmatrix} x+1 & -1 \\\\ 1 & x+0 \\end{pmatrix}\\begin{pmatrix} x & -3 \\\\ 2 & x-1 \\end{pmatrix}\\] equals \\(x^4 + 6x^2 + 5x + 6\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The determinant of a product of matrices with a variable entry. -/\ntheorem det_of_polynomial_product (x : ℤ) :\n Matrix.det (!![x + 1, -1; 1, x + 0] * !![x, -3; 2, x - 1] : Matrix (Fin 2) (Fin 2) ℤ) = x ^ 4 + 6 * x ^ 2 + 5 * x + 6 := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d2-t0064"}
+{"id": "linear-algebra-independence-d2-t0065", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 2, "seed": 65, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^2\\) consider the vectors \\(\\begin{pmatrix} 0 \\\\ 6 \\end{pmatrix}\\), \\(\\begin{pmatrix} 0 \\\\ -6 \\end{pmatrix}\\). Show that they are not linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly dependent over the rationals. -/\ntheorem vectors_dependent : ¬ LinearIndependent ℚ ![(![0, 6] : Fin 2 → ℚ), ![0, -6]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d2-t0065"}
+{"id": "linear-algebra-linear_map-d2-t0066", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 2, "seed": 66, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(f : V \\to W\\) be a linear map of vector spaces over \\(\\mathbb{R}\\). Then the kernel of \\(-1f\\) equals the kernel of \\(f\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A nonzero scalar multiple has the same kernel. -/\ntheorem ker_smul_eq {V W : Type*} [AddCommGroup V] [Module ℝ V] [AddCommGroup W] [Module ℝ W] (f : V →ₗ[ℝ] W) :\n LinearMap.ker ((-1 : ℝ) • f) = LinearMap.ker f := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d2-t0066"}
+{"id": "linear-algebra-matrix_pow-d2-t0067", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 2, "seed": 67, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every natural number \\(n\\), \\[\\begin{pmatrix} 2 & 0 \\\\ 1 & 2 \\end{pmatrix}^{n+1} = \\begin{pmatrix} 2^{n+1} & 0 \\\\ (n+1)\\,2^{n} & 2^{n+1} \\end{pmatrix}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of a lower 2x2 Jordan block. -/\ntheorem lower_jordan_power (n : ℕ) :\n (!![2, 0; 1, 2] : Matrix (Fin 2) (Fin 2) ℤ) ^ (n + 1) = !![(2 : ℤ) ^ (n + 1), 0; ((n : ℤ) + 1) * 2 ^ n, (2 : ℤ) ^ (n + 1)] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d2-t0067"}
+{"id": "linear-algebra-det_trace-d3-t0068", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 3, "seed": 68, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nLet \\(A\\) be a \\(2 \\times 2\\) integer matrix with trace 0 and determinant 4. Then \\(A^3 = -4 A - 0 I\\), where \\(I\\) is the identity matrix. You may first prove \\(A^2 = (\\operatorname{tr} A) A - (\\det A) I\\) for every \\(2 \\times 2\\) integer matrix.\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cayley-Hamilton for 2x2 integer matrices. -/\ntheorem cayley_hamilton_two (A : Matrix (Fin 2) (Fin 2) ℤ) :\n A ^ 2 = Matrix.trace A • A - Matrix.det A • (1 : Matrix (Fin 2) (Fin 2) ℤ) := by\n sorry\n\n/-- A^3 in terms of the trace and determinant. -/\ntheorem cube_of_matrix (A : Matrix (Fin 2) (Fin 2) ℤ) (ht : Matrix.trace A = (0 : ℤ)) (hd : Matrix.det A = (4 : ℤ)) :\n A ^ 3 = (-4 : ℤ) • A - (0 : ℤ) • (1 : Matrix (Fin 2) (Fin 2) ℤ) := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d3-t0068"}
+{"id": "linear-algebra-independence-d3-t0069", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 3, "seed": 69, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^3\\) consider the vectors \\(\\begin{pmatrix} 4 \\\\ -1 \\\\ -4 \\end{pmatrix}\\), \\(\\begin{pmatrix} -1 \\\\ -4 \\\\ 4 \\end{pmatrix}\\), \\(\\begin{pmatrix} 6 \\\\ 3 \\\\ 6 \\end{pmatrix}\\). Show that they are linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly independent over the rationals. -/\ntheorem vectors_independent : LinearIndependent ℚ ![(![4, -1, -4] : Fin 3 → ℚ), ![-1, -4, 4], ![6, 3, 6]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d3-t0069"}
+{"id": "linear-algebra-linear_map-d3-t0070", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 3, "seed": 70, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(p : V \\to V\\) be a linear map over \\(\\mathbb{Q}\\) with \\(p(p(x)) = p(x) for every vector x\\). Show that \\(\\ker p\\) and \\(\\operatorname{range} p\\) are complementary subspaces: their intersection is \\(\\{0\\}\\) and together they span \\(V\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The kernel and the range of an idempotent map meet only in 0. -/\ntheorem disjoint_ker_range {V : Type*} [AddCommGroup V] [Module ℚ V] (p : V →ₗ[ℚ] V) (hp : ∀ x, p (p x) = p x) :\n Disjoint (LinearMap.ker p) (LinearMap.range p) := by\n sorry\n\n/-- The kernel and the range of an idempotent map are complements. -/\ntheorem ker_range_isCompl {V : Type*} [AddCommGroup V] [Module ℚ V] (p : V →ₗ[ℚ] V) (hp : ∀ x, p (p x) = p x) :\n IsCompl (LinearMap.ker p) (LinearMap.range p) := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d3-t0070"}
+{"id": "linear-algebra-matrix_pow-d3-t0071", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 3, "seed": 71, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every natural number \\(n\\), \\[\\begin{pmatrix} 3 & 3 \\\\ 0 & 1 \\end{pmatrix}^n = \\begin{pmatrix} (3)^n & 3 \\sum_{i=0}^{n-1} (3)^i \\\\ 0 & 1 \\end{pmatrix}.\\] The sum is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of an affine map matrix, with a geometric sum. -/\ntheorem affine_power (n : ℕ) :\n (!![3, 3; 0, 1] : Matrix (Fin 2) (Fin 2) ℤ) ^ n = !![3 ^ n, 3 * ∑ i ∈ Finset.range n, 3 ^ i; 0, 1] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d3-t0071"}
+{"id": "linear-algebra-det_trace-d1-t0072", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 1, "seed": 72, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nCompute the determinant of the product \\(\\begin{pmatrix} -2 & -3 \\\\ 4 & 4 \\end{pmatrix}\\) \\(\\begin{pmatrix} -1 & 0 \\\\ -2 & 2 \\end{pmatrix}\\) of integer matrices. Show that it equals -8.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The determinant of the product is the product of the determinants. -/\ntheorem det_of_product : Matrix.det (!![-2, -3; 4, 4] * !![-1, 0; -2, 2] : Matrix (Fin 2) (Fin 2) ℤ) = (-8 : ℤ) := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d1-t0072"}
+{"id": "linear-algebra-independence-d1-t0073", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 1, "seed": 73, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^2\\) consider the vectors \\(\\begin{pmatrix} -4 \\\\ 0 \\end{pmatrix}\\), \\(\\begin{pmatrix} 1 \\\\ -3 \\end{pmatrix}\\). Show that they are linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly independent over the rationals. -/\ntheorem vectors_independent : LinearIndependent ℚ ![(![-4, 0] : Fin 2 → ℚ), ![1, -3]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d1-t0073"}
+{"id": "linear-algebra-linear_map-d1-t0074", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 1, "seed": 74, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(q : V \\to V\\) be a linear map over \\(\\mathbb{Q}\\) with \\(q(v(v)) = v(v)\\) for every \\(v\\). Then \\(u - q(u)\\) lies in the kernel of \\(q\\) for every \\(u \\in V\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- x - p x lies in the kernel of an idempotent map p. -/\ntheorem sub_proj_mem_ker {V : Type*} [AddCommGroup V] [Module ℚ V] (q : V →ₗ[ℚ] V) (hp : ∀ x, q (q x) = q x) (u : V) :\n u - q u ∈ LinearMap.ker q := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d1-t0074"}
+{"id": "linear-algebra-matrix_pow-d1-t0075", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 1, "seed": 75, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every natural number \\(n\\), \\[\\begin{pmatrix} 1 & 1 \\\\ 0 & 1 \\end{pmatrix}^n = \\begin{pmatrix} 1 & 1n \\\\ 0 & 1 \\end{pmatrix}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of a shear matrix. -/\ntheorem shear_power (n : ℕ) :\n (!![1, 1; 0, 1] : Matrix (Fin 2) (Fin 2) ℤ) ^ n = !![1, (n : ℤ) * 1; 0, 1] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d1-t0075"}
+{"id": "linear-algebra-det_trace-d2-t0076", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 2, "seed": 76, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nLet \\(A\\) be a \\(2 \\times 2\\) integer matrix with trace 3 and determinant 1. Then \\(A^2 = 3 A - 1 I\\), where \\(I\\) is the identity matrix.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A^2 = tr(A) A - det(A) I with the given trace and determinant. -/\ntheorem square_of_matrix (A : Matrix (Fin 2) (Fin 2) ℤ) (ht : Matrix.trace A = (3 : ℤ)) (hd : Matrix.det A = (1 : ℤ)) :\n A ^ 2 = (3 : ℤ) • A - (1 : ℤ) • (1 : Matrix (Fin 2) (Fin 2) ℤ) := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d2-t0076"}
+{"id": "linear-algebra-independence-d2-t0077", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 2, "seed": 77, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^2\\) consider the vectors \\(\\begin{pmatrix} -2 \\\\ -1 \\end{pmatrix}\\), \\(\\begin{pmatrix} -6 \\\\ -6 \\end{pmatrix}\\). Show that they are linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly independent over the rationals. -/\ntheorem vectors_independent : LinearIndependent ℚ ![(![-2, -1] : Fin 2 → ℚ), ![-6, -6]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d2-t0077"}
+{"id": "linear-algebra-linear_map-d2-t0078", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 2, "seed": 78, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(q : V \\to V\\) be a linear map over \\(\\mathbb{Q}\\) with \\(q(q(x)) = q(x) for every vector x\\). Then the kernel of \\(\\mathrm{id} - q\\) equals the range of \\(q\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- For idempotent p, the kernel of id - p is the range of p. -/\ntheorem ker_id_sub {V : Type*} [AddCommGroup V] [Module ℚ V] (q : V →ₗ[ℚ] V) (hp : ∀ x, q (q x) = q x) :\n LinearMap.ker (LinearMap.id - q) = LinearMap.range q := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d2-t0078"}
+{"id": "linear-algebra-matrix_pow-d2-t0079", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 2, "seed": 79, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every natural number \\(n\\), \\[\\begin{pmatrix} 4 & 1 \\\\ 0 & 4 \\end{pmatrix}^{n+1} = \\begin{pmatrix} (4)^{n+1} & (n+1)(4)^n \\\\ 0 & (4)^{n+1} \\end{pmatrix}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of a 2x2 Jordan block. -/\ntheorem jordan_power (n : ℕ) :\n (!![4, 1; 0, 4] : Matrix (Fin 2) (Fin 2) ℤ) ^ (n + 1) = !![4 ^ (n + 1), ((n : ℤ) + 1) * 4 ^ n; 0, 4 ^ (n + 1)] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d2-t0079"}
+{"id": "linear-algebra-det_trace-d3-t0080", "env": "linear-algebra", "msc": "15", "family": "det_trace", "difficulty": 3, "seed": 80, "kind": "prove", "instruction": "# Determinant and trace of 2x2 matrices\n\nProve the following statement.\n\nLet \\(A\\) be a \\(2 \\times 2\\) integer matrix with trace 1 and determinant 4. Then the trace of \\(A^2\\) is -7. You may first prove \\(A^2 = (\\operatorname{tr} A) A - (\\det A) I\\) for every \\(2 \\times 2\\) integer matrix.\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Cayley-Hamilton for 2x2 integer matrices. -/\ntheorem cayley_hamilton_two (A : Matrix (Fin 2) (Fin 2) ℤ) :\n A ^ 2 = Matrix.trace A • A - Matrix.det A • (1 : Matrix (Fin 2) (Fin 2) ℤ) := by\n sorry\n\n/-- The trace of A^2 from the trace and determinant of A. -/\ntheorem trace_of_square (A : Matrix (Fin 2) (Fin 2) ℤ) (ht : Matrix.trace A = (1 : ℤ)) (hd : Matrix.det A = (4 : ℤ)) :\n Matrix.trace (A ^ 2) = (-7 : ℤ) := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-det_trace-d3-t0080"}
+{"id": "linear-algebra-independence-d3-t0081", "env": "linear-algebra", "msc": "15", "family": "independence", "difficulty": 3, "seed": 81, "kind": "prove", "instruction": "# Linear independence of explicit vectors\n\nProve the following statement.\n\nIn \\(\\mathbb{Q}^3\\) consider the vectors \\(\\begin{pmatrix} 5 \\\\ -4 \\\\ 1 \\end{pmatrix}\\), \\(\\begin{pmatrix} 4 \\\\ 2 \\\\ -1 \\end{pmatrix}\\), \\(\\begin{pmatrix} -9 \\\\ 2 \\\\ 0 \\end{pmatrix}\\). Show that they are not linearly independent over \\(\\mathbb{Q}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The given vectors are linearly dependent over the rationals. -/\ntheorem vectors_dependent : ¬ LinearIndependent ℚ ![(![5, -4, 1] : Fin 3 → ℚ), ![4, 2, -1], ![-9, 2, 0]] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-independence-d3-t0081"}
+{"id": "linear-algebra-linear_map-d3-t0082", "env": "linear-algebra", "msc": "15", "family": "linear_map", "difficulty": 3, "seed": 82, "kind": "prove", "instruction": "# Kernels, ranges and projections\n\nProve the following statement.\n\nLet \\(e : V \\to V\\) be a linear map over \\(\\mathbb{R}\\) with \\(e \\circ e = e\\). Then \\(\\mathrm{id} - e\\) is also idempotent, and \\(e \\circ (\\mathrm{id} - e) = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- If p is idempotent then so is id - p, and p kills its image. -/\ntheorem complement_idempotent {V : Type*} [AddCommGroup V] [Module ℝ V] (e : V →ₗ[ℝ] V) (hp : e ∘ₗ e = e) :\n (LinearMap.id - e) ∘ₗ (LinearMap.id - e) = LinearMap.id - e ∧ e ∘ₗ (LinearMap.id - e) = 0 := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-linear_map-d3-t0082"}
+{"id": "linear-algebra-matrix_pow-d3-t0083", "env": "linear-algebra", "msc": "15", "family": "matrix_pow", "difficulty": 3, "seed": 83, "kind": "prove", "instruction": "# Powers of 2x2 matrices\n\nProve the following statement.\n\nFor every natural number \\(n\\), \\[\\begin{pmatrix} 2 & 4 \\\\ 0 & 1 \\end{pmatrix}^n = \\begin{pmatrix} (2)^n & 4 \\sum_{i=0}^{n-1} (2)^i \\\\ 0 & 1 \\end{pmatrix}.\\] The sum is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Powers of an affine map matrix, with a geometric sum. -/\ntheorem affine_power (n : ℕ) :\n (!![2, 4; 0, 1] : Matrix (Fin 2) (Fin 2) ℤ) ^ n = !![2 ^ n, 4 * ∑ i ∈ Finset.range n, 2 ^ i; 0, 1] := by\n sorry\n", "path": "tasks/linear-algebra/linear-algebra-matrix_pow-d3-t0083"}
diff --git a/data/logic-and-sets/eval.jsonl b/data/logic-and-sets/eval.jsonl
new file mode 100644
index 0000000000000000000000000000000000000000..4520a9435de8a103acedbade3523f65b1d65e3b5
--- /dev/null
+++ b/data/logic-and-sets/eval.jsonl
@@ -0,0 +1,24 @@
+{"id": "logic-and-sets-finset_card-d1-e0000", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 1, "seed": 10000, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 3x + 2\\) on the natural numbers and let \\(s, t\\) be finite sets of natural numbers. Prove that the product \\(f(s) \\times t\\) has \\(|s| \\cdot |t|\\) elements.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s t : Finset ℕ) :\n ((s.image (fun x : ℕ => 3 * x + 2)) ×ˢ t).card = s.card * t.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d1-e0000"}
+{"id": "logic-and-sets-relations-d1-e0001", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 1, "seed": 10001, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn the integers define \\(x \\sim y \\iff 2 \\mid x - y\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun x y : ℤ => 2 ∣ x - y) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d1-e0001"}
+{"id": "logic-and-sets-set_identities-d1-e0002", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 1, "seed": 10002, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(S, T, U\\) be subsets of a type \\(\\alpha\\). Prove the set identity \\[U \\setminus (S \\cup T) = (U \\setminus S) \\cap (U \\setminus T).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated identity between sets. -/\ntheorem set_identity {α : Type*} (S T U : Set α) :\n U \\ (S ∪ T) = (U \\ S) ∩ (U \\ T) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d1-e0002"}
+{"id": "logic-and-sets-finset_card-d2-e0003", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 2, "seed": 10003, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 5x + 3\\) on the natural numbers and let \\(s, t\\) be finite sets of natural numbers. Prove that \\[|f(s \\setminus t)| + |s \\cap t| = |s|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s t : Finset ℕ) :\n ((s \\ t).image (fun x : ℕ => 5 * x + 3)).card + (s ∩ t).card = s.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d2-e0003"}
+{"id": "logic-and-sets-relations-d2-e0004", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 2, "seed": 10004, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn pairs of natural numbers define \\((x_1, y_1) \\sim (x_2, y_2) \\iff x_1 + 7 y_2 = x_2 + 7 y_1\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun p q : ℕ × ℕ => p.1 + 7 * q.2 = q.1 + 7 * p.2) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d2-e0004"}
+{"id": "logic-and-sets-set_identities-d2-e0005", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 2, "seed": 10005, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(g : \\alpha \\to \\beta\\) be a function that is injective and let \\(C\\) be subsets of \\(\\alpha\\). Write \\(g(X)\\) for the image and \\(g^{-1}(X)\\) for the preimage of a set \\(X\\). Prove \\[g^{-1}(g(C)) = C.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated statement about images and preimages. -/\ntheorem image_identity {α β : Type*} (g : α → β) (C : Set α) (hf : Function.Injective g) :\n g ⁻¹' (g '' C) = C := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d2-e0005"}
+{"id": "logic-and-sets-finset_card-d3-e0006", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 3, "seed": 10006, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(s, t, u\\) be finite sets of natural numbers. First prove the identity \\[|s \\cup t \\cup u| + |s \\cap t| + |s \\cap u| + |t \\cap u| = |s| + |t| + |u| + |s \\cap t \\cap u|.\\] Then use it to prove the following, where subtraction is truncated subtraction on the natural numbers: \\[|s \\cup t \\cup u| = |s| + |t| + |u| - |s \\cap t| - |s \\cap u| - |t \\cap u| + |s \\cap t \\cap u|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Inclusion and exclusion for three finite sets. -/\ntheorem incl_excl (s t u : Finset ℕ) :\n (s ∪ t ∪ u).card + (s ∩ t).card + (s ∩ u).card + (t ∩ u).card = s.card + t.card + u.card + (s ∩ t ∩ u).card := by\n sorry\n\n/-- The size of a union of three finite sets, in terms of the sizes of the intersections. -/\ntheorem card_union_three (s t u : Finset ℕ) :\n (s ∪ t ∪ u).card = s.card + t.card + u.card - (s ∩ t).card - (s ∩ u).card - (t ∩ u).card + (s ∩ t ∩ u).card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d3-e0006"}
+{"id": "logic-and-sets-relations-d3-e0007", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 3, "seed": 10007, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nFor an integer \\(q\\), define a relation on the integers by \\(x \\sim y \\iff x \\equiv y \\pmod{q}\\). Prove three things: (1) \\(\\sim\\) is an equivalence relation; (2) \\(\\sim\\) is compatible with addition: if \\(a \\equiv b \\pmod{q}\\) and \\(c \\equiv d \\pmod{q}\\) then \\(a+c \\equiv b+d \\pmod{q}\\); (3) \\(\\sim\\) is compatible with powers: if \\(a \\equiv b \\pmod{q}\\) then \\(a^k \\equiv b^k \\pmod{q}\\) for every natural number \\(k\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 3 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 3 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv (q : ℤ) :\n Equivalence (fun x y : ℤ => x ≡ y [ZMOD q]) := by\n sorry\n\n/-- The relation is compatible with addition. -/\ntheorem rel_add (q a b c d : ℤ) (h1 : a ≡ b [ZMOD q]) (h2 : c ≡ d [ZMOD q]) :\n a + c ≡ b + d [ZMOD q] := by\n sorry\n\n/-- The relation is compatible with taking powers. -/\ntheorem rel_pow (q a b : ℤ) (k : ℕ) (h : a ≡ b [ZMOD q]) :\n a ^ k ≡ b ^ k [ZMOD q] := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d3-e0007"}
+{"id": "logic-and-sets-set_identities-d3-e0008", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 3, "seed": 10008, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(h : \\alpha \\to \\beta\\) be a function that is injective and let \\(T, S\\) be subsets of \\(\\alpha\\). Write \\(h(X)\\) for the image and \\(h^{-1}(X)\\) for the preimage of a set \\(X\\). Prove \\[h^{-1}(h(T)) \\cap S = T \\cap S.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated statement about images and preimages. -/\ntheorem image_identity {α β : Type*} (h : α → β) (T S : Set α) (hf : Function.Injective h) :\n h ⁻¹' (h '' T) ∩ S = T ∩ S := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d3-e0008"}
+{"id": "logic-and-sets-finset_card-d1-e0009", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 1, "seed": 10009, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 5x + 3\\) on the natural numbers and let \\(s, t\\) be finite sets of natural numbers. Prove that the product \\(f(s) \\times t\\) has \\(|s| \\cdot |t|\\) elements.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s t : Finset ℕ) :\n ((s.image (fun x : ℕ => 5 * x + 3)) ×ˢ t).card = s.card * t.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d1-e0009"}
+{"id": "logic-and-sets-relations-d1-e0010", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 1, "seed": 10010, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn the integers define \\(x \\sim y \\iff 7 \\mid x - y\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun x y : ℤ => 7 ∣ x - y) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d1-e0010"}
+{"id": "logic-and-sets-set_identities-d1-e0011", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 1, "seed": 10011, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(B, A, C\\) be subsets of a type \\(\\alpha\\). Prove the set identity \\[(A \\setminus B)^{c} = A^{c} \\cup B.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated identity between sets. -/\ntheorem set_identity {α : Type*} (B A C : Set α) :\n (A \\ B)ᶜ = Aᶜ ∪ B := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d1-e0011"}
+{"id": "logic-and-sets-finset_card-d2-e0012", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 2, "seed": 10012, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 5x + 8\\) on the natural numbers and let \\(s, t\\) be finite sets of natural numbers. Prove that \\[|f(s \\cup t)| + |f(s \\cap t)| = |s| + |t|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s t : Finset ℕ) :\n ((s ∪ t).image (fun x : ℕ => 5 * x + 8)).card + ((s ∩ t).image (fun x : ℕ => 5 * x + 8)).card = s.card + t.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d2-e0012"}
+{"id": "logic-and-sets-relations-d2-e0013", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 2, "seed": 10013, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn the integers define \\(x \\sim y \\iff 12 \\mid x^{4} - y^{4}\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun x y : ℤ => 12 ∣ x ^ 4 - y ^ 4) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d2-e0013"}
+{"id": "logic-and-sets-set_identities-d2-e0014", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 2, "seed": 10014, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(f : \\alpha \\to \\beta\\) be a function and let \\(T\\) be subsets of \\(\\beta\\). Write \\(f(X)\\) for the image and \\(f^{-1}(X)\\) for the preimage of a set \\(X\\). Prove \\[f(f^{-1}(T)) = T \\cap \\operatorname{range} f.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated statement about images and preimages. -/\ntheorem image_identity {α β : Type*} (f : α → β) (T : Set β) :\n f '' (f ⁻¹' T) = T ∩ Set.range f := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d2-e0014"}
+{"id": "logic-and-sets-finset_card-d3-e0015", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 3, "seed": 10015, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 4x + 2\\) on the natural numbers and let \\(s, t\\) be disjoint finite sets of natural numbers. Prove that \\(|f(s \\cup t)| = |s| + |t|\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s t : Finset ℕ) (h : Disjoint s t) :\n ((s ∪ t).image (fun x : ℕ => 4 * x + 2)).card = s.card + t.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d3-e0015"}
+{"id": "logic-and-sets-relations-d3-e0016", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 3, "seed": 10016, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nFor an integer \\(m\\), define a relation on the integers by \\(x \\sim y \\iff m \\mid x - y\\). Prove three things: (1) \\(\\sim\\) is an equivalence relation; (2) \\(\\sim\\) is compatible with addition: if \\(m \\mid a - b\\) and \\(m \\mid c - d\\) then \\(m \\mid (a+c) - (b+d)\\); (3) \\(\\sim\\) is compatible with multiplication: if \\(m \\mid a - b\\) and \\(m \\mid c - d\\) then \\(m \\mid ac - bd\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 3 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 3 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv (m : ℤ) :\n Equivalence (fun x y : ℤ => m ∣ x - y) := by\n sorry\n\n/-- The relation is compatible with addition. -/\ntheorem rel_add (m a b c d : ℤ) (h1 : m ∣ a - b) (h2 : m ∣ c - d) :\n m ∣ (a + c) - (b + d) := by\n sorry\n\n/-- The relation is compatible with multiplication. -/\ntheorem rel_mul (m a b c d : ℤ) (h1 : m ∣ a - b) (h2 : m ∣ c - d) :\n m ∣ a * c - b * d := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d3-e0016"}
+{"id": "logic-and-sets-set_identities-d3-e0017", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 3, "seed": 10017, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(Y, A, C\\) be subsets of a type \\(\\alpha\\). Assume that \\(C \\subseteq Y\\). Prove the set identity \\[(A \\setminus (Y \\cup A)) \\cup C = (Y^{c} \\cup (Y \\setminus C))^{c}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated identity between sets. -/\ntheorem set_identity {α : Type*} (Y A C : Set α) (h : C ⊆ Y) :\n (A \\ (Y ∪ A)) ∪ C = (Yᶜ ∪ (Y \\ C))ᶜ := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d3-e0017"}
+{"id": "logic-and-sets-finset_card-d1-e0018", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 1, "seed": 10018, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 2x + 6\\) on the natural numbers and let \\(s, t\\) be finite sets of natural numbers. Prove that the product \\(f(s) \\times t\\) has \\(|s| \\cdot |t|\\) elements.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s t : Finset ℕ) :\n ((s.image (fun x : ℕ => 2 * x + 6)) ×ˢ t).card = s.card * t.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d1-e0018"}
+{"id": "logic-and-sets-relations-d1-e0019", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 1, "seed": 10019, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn the integers define \\(x \\sim y \\iff x \\bmod 9 = y \\bmod 9\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun x y : ℤ => x % 9 = y % 9) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d1-e0019"}
+{"id": "logic-and-sets-set_identities-d1-e0020", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 1, "seed": 10020, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(C, T, B\\) be subsets of a type \\(\\alpha\\). Prove the set identity \\[T \\cup (B \\cap C) = (T \\cup B) \\cap (T \\cup C).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated identity between sets. -/\ntheorem set_identity {α : Type*} (C T B : Set α) :\n T ∪ (B ∩ C) = (T ∪ B) ∩ (T ∪ C) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d1-e0020"}
+{"id": "logic-and-sets-finset_card-d2-e0021", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 2, "seed": 10021, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 2x + 6\\) on the natural numbers and let \\(s, t\\) be finite sets of natural numbers. Prove that \\[|f(s \\setminus t)| + |s \\cap t| = |s|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s t : Finset ℕ) :\n ((s \\ t).image (fun x : ℕ => 2 * x + 6)).card + (s ∩ t).card = s.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d2-e0021"}
+{"id": "logic-and-sets-relations-d2-e0022", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 2, "seed": 10022, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn pairs of natural numbers define \\((x_1, y_1) \\sim (x_2, y_2) \\iff x_1 + 6 y_2 = x_2 + 6 y_1\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun p q : ℕ × ℕ => p.1 + 6 * q.2 = q.1 + 6 * p.2) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d2-e0022"}
+{"id": "logic-and-sets-set_identities-d2-e0023", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 2, "seed": 10023, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(h : \\alpha \\to \\beta\\) be a function that is injective and let \\(B\\) be subsets of \\(\\alpha\\). Write \\(h(X)\\) for the image and \\(h^{-1}(X)\\) for the preimage of a set \\(X\\). Prove \\[h^{-1}(h(B)) = B.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated statement about images and preimages. -/\ntheorem image_identity {α β : Type*} (h : α → β) (B : Set α) (hf : Function.Injective h) :\n h ⁻¹' (h '' B) = B := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d2-e0023"}
diff --git a/data/logic-and-sets/train.jsonl b/data/logic-and-sets/train.jsonl
new file mode 100644
index 0000000000000000000000000000000000000000..27a70ff44f205e00d858f2c4f401d95cf2ea6104
--- /dev/null
+++ b/data/logic-and-sets/train.jsonl
@@ -0,0 +1,84 @@
+{"id": "logic-and-sets-finset_card-d1-t0000", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 1, "seed": 0, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 8x + 1\\) on the natural numbers and let \\(s\\) be a finite set of natural numbers. Prove that the image \\(f(s)\\) has the same number of elements as \\(s\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s : Finset ℕ) :\n (s.image (fun x : ℕ => 8 * x + 1)).card = s.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d1-t0000"}
+{"id": "logic-and-sets-relations-d1-t0001", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 1, "seed": 1, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn the integers define \\(x \\sim y \\iff 7 \\mid x - y\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun x y : ℤ => 7 ∣ x - y) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d1-t0001"}
+{"id": "logic-and-sets-set_identities-d1-t0002", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 1, "seed": 2, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(T, C, Y\\) be subsets of a type \\(\\alpha\\). Prove the set identity \\[(T \\cap C)^{c} = T^{c} \\cup C^{c}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated identity between sets. -/\ntheorem set_identity {α : Type*} (T C Y : Set α) :\n (T ∩ C)ᶜ = Tᶜ ∪ Cᶜ := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d1-t0002"}
+{"id": "logic-and-sets-finset_card-d2-t0003", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 2, "seed": 3, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 2x + 6\\) on the natural numbers and let \\(s, t\\) be finite sets of natural numbers. Prove that \\[|f(s \\cup t)| + |f(s \\cap t)| = |s| + |t|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s t : Finset ℕ) :\n ((s ∪ t).image (fun x : ℕ => 2 * x + 6)).card + ((s ∩ t).image (fun x : ℕ => 2 * x + 6)).card = s.card + t.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d2-t0003"}
+{"id": "logic-and-sets-relations-d2-t0004", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 2, "seed": 4, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn the integers define \\(x \\sim y \\iff 11 \\mid x^{3} - y^{3}\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun x y : ℤ => 11 ∣ x ^ 3 - y ^ 3) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d2-t0004"}
+{"id": "logic-and-sets-set_identities-d2-t0005", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 2, "seed": 5, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(f : \\alpha \\to \\beta\\) be a function that is injective and let \\(S\\) be subsets of \\(\\alpha\\). Write \\(f(X)\\) for the image and \\(f^{-1}(X)\\) for the preimage of a set \\(X\\). Prove \\[f^{-1}(f(S)) = S.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated statement about images and preimages. -/\ntheorem image_identity {α β : Type*} (f : α → β) (S : Set α) (hf : Function.Injective f) :\n f ⁻¹' (f '' S) = S := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d2-t0005"}
+{"id": "logic-and-sets-finset_card-d3-t0006", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 3, "seed": 6, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 4x + 6\\) on the natural numbers and let \\(s, t\\) be disjoint finite sets of natural numbers. Prove that \\(|f(s \\cup t)| = |s| + |t|\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s t : Finset ℕ) (h : Disjoint s t) :\n ((s ∪ t).image (fun x : ℕ => 4 * x + 6)).card = s.card + t.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d3-t0006"}
+{"id": "logic-and-sets-relations-d3-t0007", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 3, "seed": 7, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nFor an integer \\(n\\), define a relation on the integers by \\(x \\sim y \\iff x \\equiv y \\pmod{n}\\). Prove three things: (1) \\(\\sim\\) is an equivalence relation; (2) \\(\\sim\\) is compatible with addition: if \\(a \\equiv b \\pmod{n}\\) and \\(c \\equiv d \\pmod{n}\\) then \\(a+c \\equiv b+d \\pmod{n}\\); (3) \\(\\sim\\) is compatible with powers: if \\(a \\equiv b \\pmod{n}\\) then \\(a^k \\equiv b^k \\pmod{n}\\) for every natural number \\(k\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 3 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 3 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv (n : ℤ) :\n Equivalence (fun x y : ℤ => x ≡ y [ZMOD n]) := by\n sorry\n\n/-- The relation is compatible with addition. -/\ntheorem rel_add (n a b c d : ℤ) (h1 : a ≡ b [ZMOD n]) (h2 : c ≡ d [ZMOD n]) :\n a + c ≡ b + d [ZMOD n] := by\n sorry\n\n/-- The relation is compatible with taking powers. -/\ntheorem rel_pow (n a b : ℤ) (k : ℕ) (h : a ≡ b [ZMOD n]) :\n a ^ k ≡ b ^ k [ZMOD n] := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d3-t0007"}
+{"id": "logic-and-sets-set_identities-d3-t0008", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 3, "seed": 8, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(g : \\alpha \\to \\beta\\) be a function that is injective and let \\(A, C\\) be subsets of \\(\\alpha\\). Write \\(g(X)\\) for the image and \\(g^{-1}(X)\\) for the preimage of a set \\(X\\). Prove \\[g(A \\setminus C) = g(A) \\setminus g(C).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated statement about images and preimages. -/\ntheorem image_identity {α β : Type*} (g : α → β) (A C : Set α) (hf : Function.Injective g) :\n g '' (A \\ C) = g '' A \\ g '' C := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d3-t0008"}
+{"id": "logic-and-sets-finset_card-d1-t0009", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 1, "seed": 9, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 5x + 5\\) on the natural numbers and let \\(s, t\\) be finite sets of natural numbers. Prove that the product \\(f(s) \\times t\\) has \\(|s| \\cdot |t|\\) elements.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s t : Finset ℕ) :\n ((s.image (fun x : ℕ => 5 * x + 5)) ×ˢ t).card = s.card * t.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d1-t0009"}
+{"id": "logic-and-sets-relations-d1-t0010", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 1, "seed": 10, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn the integers define \\(x \\sim y \\iff x \\bmod 6 = y \\bmod 6\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun x y : ℤ => x % 6 = y % 6) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d1-t0010"}
+{"id": "logic-and-sets-set_identities-d1-t0011", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 1, "seed": 11, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(A, X, S\\) be subsets of a type \\(\\alpha\\). Prove the set identity \\[(A \\setminus S) \\cap (A \\setminus X) = A \\setminus (S \\cup X).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated identity between sets. -/\ntheorem set_identity {α : Type*} (A X S : Set α) :\n (A \\ S) ∩ (A \\ X) = A \\ (S ∪ X) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d1-t0011"}
+{"id": "logic-and-sets-finset_card-d2-t0012", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 2, "seed": 12, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 4x + 9\\) on the natural numbers and let \\(s, t\\) be finite sets of natural numbers. Prove that \\[|f(s \\setminus t)| + |s \\cap t| = |s|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s t : Finset ℕ) :\n ((s \\ t).image (fun x : ℕ => 4 * x + 9)).card + (s ∩ t).card = s.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d2-t0012"}
+{"id": "logic-and-sets-relations-d2-t0013", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 2, "seed": 13, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn the integers define \\(x \\sim y \\iff 7 \\mid x^{2} - y^{2}\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun x y : ℤ => 7 ∣ x ^ 2 - y ^ 2) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d2-t0013"}
+{"id": "logic-and-sets-set_identities-d2-t0014", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 2, "seed": 14, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(g : \\alpha \\to \\beta\\) be a function that is injective and let \\(B\\) be subsets of \\(\\alpha\\). Write \\(g(X)\\) for the image and \\(g^{-1}(X)\\) for the preimage of a set \\(X\\). Prove \\[g^{-1}(g(B)) = B.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated statement about images and preimages. -/\ntheorem image_identity {α β : Type*} (g : α → β) (B : Set α) (hf : Function.Injective g) :\n g ⁻¹' (g '' B) = B := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d2-t0014"}
+{"id": "logic-and-sets-finset_card-d3-t0015", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 3, "seed": 15, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 3x + 4\\) on the natural numbers and let \\(s, t\\) be disjoint finite sets of natural numbers. Prove that \\(|f(s \\cup t)| = |s| + |t|\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s t : Finset ℕ) (h : Disjoint s t) :\n ((s ∪ t).image (fun x : ℕ => 3 * x + 4)).card = s.card + t.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d3-t0015"}
+{"id": "logic-and-sets-relations-d3-t0016", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 3, "seed": 16, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nFor an integer \\(n\\), define a relation on the integers by \\(x \\sim y \\iff x \\equiv y \\pmod{n}\\). Prove three things: (1) \\(\\sim\\) is an equivalence relation; (2) \\(\\sim\\) is compatible with addition: if \\(a \\equiv b \\pmod{n}\\) and \\(c \\equiv d \\pmod{n}\\) then \\(a+c \\equiv b+d \\pmod{n}\\); (3) \\(\\sim\\) is compatible with multiplication: if \\(a \\equiv b \\pmod{n}\\) and \\(c \\equiv d \\pmod{n}\\) then \\(ac \\equiv bd \\pmod{n}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 3 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 3 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv (n : ℤ) :\n Equivalence (fun x y : ℤ => x ≡ y [ZMOD n]) := by\n sorry\n\n/-- The relation is compatible with addition. -/\ntheorem rel_add (n a b c d : ℤ) (h1 : a ≡ b [ZMOD n]) (h2 : c ≡ d [ZMOD n]) :\n a + c ≡ b + d [ZMOD n] := by\n sorry\n\n/-- The relation is compatible with multiplication. -/\ntheorem rel_mul (n a b c d : ℤ) (h1 : a ≡ b [ZMOD n]) (h2 : c ≡ d [ZMOD n]) :\n a * c ≡ b * d [ZMOD n] := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d3-t0016"}
+{"id": "logic-and-sets-set_identities-d3-t0017", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 3, "seed": 17, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(Z, S, A\\) be subsets of a type \\(\\alpha\\). Assume that \\(Z \\subseteq S\\). Prove the set identity \\[(A \\cup (Z \\cup S))^{c} = (A \\cup S)^{c}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated identity between sets. -/\ntheorem set_identity {α : Type*} (Z S A : Set α) (h : Z ⊆ S) :\n (A ∪ (Z ∪ S))ᶜ = (A ∪ S)ᶜ := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d3-t0017"}
+{"id": "logic-and-sets-finset_card-d1-t0018", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 1, "seed": 18, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 5x + 2\\) on the natural numbers and let \\(s\\) be a finite set of natural numbers. Prove that the image \\(f(s)\\) has the same number of elements as \\(s\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s : Finset ℕ) :\n (s.image (fun x : ℕ => 5 * x + 2)).card = s.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d1-t0018"}
+{"id": "logic-and-sets-relations-d1-t0019", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 1, "seed": 19, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn the integers define \\(x \\sim y \\iff x \\bmod 7 = y \\bmod 7\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun x y : ℤ => x % 7 = y % 7) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d1-t0019"}
+{"id": "logic-and-sets-set_identities-d1-t0020", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 1, "seed": 20, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(T, U, Z\\) be subsets of a type \\(\\alpha\\). Prove the set identity \\[U \\cup (U \\cap T) = U.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated identity between sets. -/\ntheorem set_identity {α : Type*} (T U Z : Set α) :\n U ∪ (U ∩ T) = U := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d1-t0020"}
+{"id": "logic-and-sets-finset_card-d2-t0021", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 2, "seed": 21, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 2x + 1\\) on the natural numbers and let \\(s, t\\) be finite sets of natural numbers. Prove that \\[|f(s \\cup t)| + |f(s \\cap t)| = |s| + |t|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s t : Finset ℕ) :\n ((s ∪ t).image (fun x : ℕ => 2 * x + 1)).card + ((s ∩ t).image (fun x : ℕ => 2 * x + 1)).card = s.card + t.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d2-t0021"}
+{"id": "logic-and-sets-relations-d2-t0022", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 2, "seed": 22, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn pairs of natural numbers define \\((x_1, y_1) \\sim (x_2, y_2) \\iff x_1 + 3 y_2 = x_2 + 3 y_1\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun p q : ℕ × ℕ => p.1 + 3 * q.2 = q.1 + 3 * p.2) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d2-t0022"}
+{"id": "logic-and-sets-set_identities-d2-t0023", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 2, "seed": 23, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(h : \\alpha \\to \\beta\\) be a function and let \\(A, S\\) be subsets of \\(\\alpha\\). Write \\(h(X)\\) for the image and \\(h^{-1}(X)\\) for the preimage of a set \\(X\\). Prove \\[h(A) \\setminus h(S) \\subseteq h(A \\setminus S).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated statement about images and preimages. -/\ntheorem image_identity {α β : Type*} (h : α → β) (A S : Set α) :\n h '' A \\ h '' S ⊆ h '' (A \\ S) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d2-t0023"}
+{"id": "logic-and-sets-finset_card-d3-t0024", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 3, "seed": 24, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(s, t, u\\) be finite sets of natural numbers. First prove the identity \\[|s \\cup t \\cup u| + |s \\cap t| + |s \\cap u| + |t \\cap u| = |s| + |t| + |u| + |s \\cap t \\cap u|.\\] Then use it to prove the following, where subtraction is truncated subtraction on the natural numbers: \\[|s \\cup t \\cup u| = |s| + |t| + |u| - |s \\cap t| - |s \\cap u| - |t \\cap u| + |s \\cap t \\cap u|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Inclusion and exclusion for three finite sets. -/\ntheorem incl_excl (s t u : Finset ℕ) :\n (s ∪ t ∪ u).card + (s ∩ t).card + (s ∩ u).card + (t ∩ u).card = s.card + t.card + u.card + (s ∩ t ∩ u).card := by\n sorry\n\n/-- The size of a union of three finite sets, in terms of the sizes of the intersections. -/\ntheorem card_union_three (s t u : Finset ℕ) :\n (s ∪ t ∪ u).card = s.card + t.card + u.card - (s ∩ t).card - (s ∩ u).card - (t ∩ u).card + (s ∩ t ∩ u).card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d3-t0024"}
+{"id": "logic-and-sets-relations-d3-t0025", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 3, "seed": 25, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nFor an integer \\(n\\), define a relation on the integers by \\(x \\sim y \\iff x \\equiv y \\pmod{n}\\). Prove three things: (1) \\(\\sim\\) is an equivalence relation; (2) \\(\\sim\\) is compatible with addition: if \\(a \\equiv b \\pmod{n}\\) and \\(c \\equiv d \\pmod{n}\\) then \\(a+c \\equiv b+d \\pmod{n}\\); (3) \\(\\sim\\) is compatible with multiplication: if \\(a \\equiv b \\pmod{n}\\) and \\(c \\equiv d \\pmod{n}\\) then \\(ac \\equiv bd \\pmod{n}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 3 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 3 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv (n : ℤ) :\n Equivalence (fun x y : ℤ => x ≡ y [ZMOD n]) := by\n sorry\n\n/-- The relation is compatible with addition. -/\ntheorem rel_add (n a b c d : ℤ) (h1 : a ≡ b [ZMOD n]) (h2 : c ≡ d [ZMOD n]) :\n a + c ≡ b + d [ZMOD n] := by\n sorry\n\n/-- The relation is compatible with multiplication. -/\ntheorem rel_mul (n a b c d : ℤ) (h1 : a ≡ b [ZMOD n]) (h2 : c ≡ d [ZMOD n]) :\n a * c ≡ b * d [ZMOD n] := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d3-t0025"}
+{"id": "logic-and-sets-set_identities-d3-t0026", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 3, "seed": 26, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(Y, T, A\\) be subsets of a type \\(\\alpha\\). Assume that \\(T \\subseteq Y\\). Prove the set identity \\[((Y \\setminus A) \\cap Y) \\cap T = (Y^{c} \\cup (T \\setminus A)) \\cap T.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated identity between sets. -/\ntheorem set_identity {α : Type*} (Y T A : Set α) (h : T ⊆ Y) :\n ((Y \\ A) ∩ Y) ∩ T = (Yᶜ ∪ (T \\ A)) ∩ T := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d3-t0026"}
+{"id": "logic-and-sets-finset_card-d1-t0027", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 1, "seed": 27, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 8x + 9\\) on the natural numbers and let \\(s\\) be a finite set of natural numbers. Prove that the image \\(f(s)\\) has the same number of elements as \\(s\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s : Finset ℕ) :\n (s.image (fun x : ℕ => 8 * x + 9)).card = s.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d1-t0027"}
+{"id": "logic-and-sets-relations-d1-t0028", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 1, "seed": 28, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn the integers define \\(x \\sim y \\iff x \\bmod 10 = y \\bmod 10\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun x y : ℤ => x % 10 = y % 10) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d1-t0028"}
+{"id": "logic-and-sets-set_identities-d1-t0029", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 1, "seed": 29, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(Y, C, Z\\) be subsets of a type \\(\\alpha\\). Prove the set identity \\[(Z \\setminus Y) \\cup (Z \\setminus C) = Z \\setminus (Y \\cap C).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated identity between sets. -/\ntheorem set_identity {α : Type*} (Y C Z : Set α) :\n (Z \\ Y) ∪ (Z \\ C) = Z \\ (Y ∩ C) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d1-t0029"}
+{"id": "logic-and-sets-finset_card-d2-t0030", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 2, "seed": 30, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 9x + 8\\) on the natural numbers and let \\(s, t\\) be finite sets of natural numbers. Prove that \\[|f(s \\setminus t)| + |s \\cap t| = |s|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s t : Finset ℕ) :\n ((s \\ t).image (fun x : ℕ => 9 * x + 8)).card + (s ∩ t).card = s.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d2-t0030"}
+{"id": "logic-and-sets-relations-d2-t0031", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 2, "seed": 31, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn pairs of natural numbers define \\((x_1, y_1) \\sim (x_2, y_2) \\iff x_1 + 6 y_2 = x_2 + 6 y_1\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun p q : ℕ × ℕ => p.1 + 6 * q.2 = q.1 + 6 * p.2) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d2-t0031"}
+{"id": "logic-and-sets-set_identities-d2-t0032", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 2, "seed": 32, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(f : \\alpha \\to \\beta\\) be a function and let \\(B\\) be subsets of \\(\\beta\\). Write \\(f(X)\\) for the image and \\(f^{-1}(X)\\) for the preimage of a set \\(X\\). Prove \\[f(f^{-1}(B)) = B \\cap \\operatorname{range} f.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated statement about images and preimages. -/\ntheorem image_identity {α β : Type*} (f : α → β) (B : Set β) :\n f '' (f ⁻¹' B) = B ∩ Set.range f := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d2-t0032"}
+{"id": "logic-and-sets-finset_card-d3-t0033", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 3, "seed": 33, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(s, t, u\\) be finite sets of natural numbers. First prove the identity \\[|s \\cup t \\cup u| + |s \\cap t| + |s \\cap u| + |t \\cap u| = |s| + |t| + |u| + |s \\cap t \\cap u|.\\] Then use it to prove the following, where subtraction is truncated subtraction on the natural numbers: \\[|s \\cup t \\cup u| = |s| + |t| + |u| - |s \\cap t| - |s \\cap u| - |t \\cap u| + |s \\cap t \\cap u|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Inclusion and exclusion for three finite sets. -/\ntheorem incl_excl (s t u : Finset ℕ) :\n (s ∪ t ∪ u).card + (s ∩ t).card + (s ∩ u).card + (t ∩ u).card = s.card + t.card + u.card + (s ∩ t ∩ u).card := by\n sorry\n\n/-- The size of a union of three finite sets, in terms of the sizes of the intersections. -/\ntheorem card_union_three (s t u : Finset ℕ) :\n (s ∪ t ∪ u).card = s.card + t.card + u.card - (s ∩ t).card - (s ∩ u).card - (t ∩ u).card + (s ∩ t ∩ u).card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d3-t0033"}
+{"id": "logic-and-sets-relations-d3-t0034", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 3, "seed": 34, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nFor an integer \\(m\\), define a relation on the integers by \\(x \\sim y \\iff m \\mid x - y\\). Prove three things: (1) \\(\\sim\\) is an equivalence relation; (2) \\(\\sim\\) is compatible with addition: if \\(m \\mid a - b\\) and \\(m \\mid c - d\\) then \\(m \\mid (a+c) - (b+d)\\); (3) \\(\\sim\\) is compatible with multiplication: if \\(m \\mid a - b\\) and \\(m \\mid c - d\\) then \\(m \\mid ac - bd\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 3 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 3 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv (m : ℤ) :\n Equivalence (fun x y : ℤ => m ∣ x - y) := by\n sorry\n\n/-- The relation is compatible with addition. -/\ntheorem rel_add (m a b c d : ℤ) (h1 : m ∣ a - b) (h2 : m ∣ c - d) :\n m ∣ (a + c) - (b + d) := by\n sorry\n\n/-- The relation is compatible with multiplication. -/\ntheorem rel_mul (m a b c d : ℤ) (h1 : m ∣ a - b) (h2 : m ∣ c - d) :\n m ∣ a * c - b * d := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d3-t0034"}
+{"id": "logic-and-sets-set_identities-d3-t0035", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 3, "seed": 35, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(C, A, X\\) be subsets of a type \\(\\alpha\\). Assume that \\(C \\subseteq A\\). Prove the set identity \\[((C \\cup A) \\cup X)^{c} = ((C \\cap A) \\cup (X \\cup A))^{c}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated identity between sets. -/\ntheorem set_identity {α : Type*} (C A X : Set α) (h : C ⊆ A) :\n ((C ∪ A) ∪ X)ᶜ = ((C ∩ A) ∪ (X ∪ A))ᶜ := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d3-t0035"}
+{"id": "logic-and-sets-finset_card-d1-t0036", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 1, "seed": 36, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 6x + 6\\) on the natural numbers and let \\(s\\) be a finite set of natural numbers. Prove that the image \\(f(s)\\) has the same number of elements as \\(s\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s : Finset ℕ) :\n (s.image (fun x : ℕ => 6 * x + 6)).card = s.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d1-t0036"}
+{"id": "logic-and-sets-relations-d1-t0037", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 1, "seed": 37, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn the integers define \\(x \\sim y \\iff x \\bmod 9 = y \\bmod 9\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun x y : ℤ => x % 9 = y % 9) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d1-t0037"}
+{"id": "logic-and-sets-set_identities-d1-t0038", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 1, "seed": 38, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(Y, B, X\\) be subsets of a type \\(\\alpha\\). Prove the set identity \\[X \\setminus (Y \\cap B) = (X \\setminus Y) \\cup (X \\setminus B).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated identity between sets. -/\ntheorem set_identity {α : Type*} (Y B X : Set α) :\n X \\ (Y ∩ B) = (X \\ Y) ∪ (X \\ B) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d1-t0038"}
+{"id": "logic-and-sets-finset_card-d2-t0039", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 2, "seed": 39, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 3x + 7\\) on the natural numbers and let \\(s, t\\) be finite sets of natural numbers. Prove that \\[|f(s \\setminus t)| + |s \\cap t| = |s|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s t : Finset ℕ) :\n ((s \\ t).image (fun x : ℕ => 3 * x + 7)).card + (s ∩ t).card = s.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d2-t0039"}
+{"id": "logic-and-sets-relations-d2-t0040", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 2, "seed": 40, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn pairs of natural numbers define \\((x_1, y_1) \\sim (x_2, y_2) \\iff x_1 + 4 y_2 = x_2 + 4 y_1\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun p q : ℕ × ℕ => p.1 + 4 * q.2 = q.1 + 4 * p.2) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d2-t0040"}
+{"id": "logic-and-sets-set_identities-d2-t0041", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 2, "seed": 41, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(f : \\alpha \\to \\beta\\) be a function and let \\(S\\) be subsets of \\(\\beta\\). Write \\(f(X)\\) for the image and \\(f^{-1}(X)\\) for the preimage of a set \\(X\\). Prove \\[f(f^{-1}(S)) = S \\cap \\operatorname{range} f.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated statement about images and preimages. -/\ntheorem image_identity {α β : Type*} (f : α → β) (S : Set β) :\n f '' (f ⁻¹' S) = S ∩ Set.range f := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d2-t0041"}
+{"id": "logic-and-sets-finset_card-d3-t0042", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 3, "seed": 42, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(s, t, u\\) be finite sets of natural numbers. First prove the identity \\[|s \\cup t \\cup u| + |s \\cap t| + |s \\cap u| + |t \\cap u| = |s| + |t| + |u| + |s \\cap t \\cap u|.\\] Then use it to prove the following, where subtraction is truncated subtraction on the natural numbers: \\[|s \\cup t \\cup u| = |s| + |t| + |u| - |s \\cap t| - |s \\cap u| - |t \\cap u| + |s \\cap t \\cap u|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Inclusion and exclusion for three finite sets. -/\ntheorem incl_excl (s t u : Finset ℕ) :\n (s ∪ t ∪ u).card + (s ∩ t).card + (s ∩ u).card + (t ∩ u).card = s.card + t.card + u.card + (s ∩ t ∩ u).card := by\n sorry\n\n/-- The size of a union of three finite sets, in terms of the sizes of the intersections. -/\ntheorem card_union_three (s t u : Finset ℕ) :\n (s ∪ t ∪ u).card = s.card + t.card + u.card - (s ∩ t).card - (s ∩ u).card - (t ∩ u).card + (s ∩ t ∩ u).card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d3-t0042"}
+{"id": "logic-and-sets-relations-d3-t0043", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 3, "seed": 43, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nFor an integer \\(q\\), define a relation on the integers by \\(x \\sim y \\iff q \\mid x - y\\). Prove three things: (1) \\(\\sim\\) is an equivalence relation; (2) \\(\\sim\\) is compatible with addition: if \\(q \\mid a - b\\) and \\(q \\mid c - d\\) then \\(q \\mid (a+c) - (b+d)\\); (3) \\(\\sim\\) is compatible with powers: if \\(q \\mid a - b\\) then \\(q \\mid a^k - b^k\\) for every natural number \\(k\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 3 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 3 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv (q : ℤ) :\n Equivalence (fun x y : ℤ => q ∣ x - y) := by\n sorry\n\n/-- The relation is compatible with addition. -/\ntheorem rel_add (q a b c d : ℤ) (h1 : q ∣ a - b) (h2 : q ∣ c - d) :\n q ∣ (a + c) - (b + d) := by\n sorry\n\n/-- The relation is compatible with taking powers. -/\ntheorem rel_pow (q a b : ℤ) (k : ℕ) (h : q ∣ a - b) :\n q ∣ a ^ k - b ^ k := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d3-t0043"}
+{"id": "logic-and-sets-set_identities-d3-t0044", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 3, "seed": 44, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(h : \\alpha \\to \\beta\\) be a function that is injective and let \\(A, C\\) be subsets of \\(\\alpha\\). Write \\(h(X)\\) for the image and \\(h^{-1}(X)\\) for the preimage of a set \\(X\\). Prove \\[h(A \\cap C) = h(A) \\cap h(C).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated statement about images and preimages. -/\ntheorem image_identity {α β : Type*} (h : α → β) (A C : Set α) (hf : Function.Injective h) :\n h '' (A ∩ C) = h '' A ∩ h '' C := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d3-t0044"}
+{"id": "logic-and-sets-finset_card-d1-t0045", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 1, "seed": 45, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 7x + 8\\) on the natural numbers and let \\(s\\) be a finite set of natural numbers. Prove that the image \\(f(s)\\) has the same number of elements as \\(s\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s : Finset ℕ) :\n (s.image (fun x : ℕ => 7 * x + 8)).card = s.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d1-t0045"}
+{"id": "logic-and-sets-relations-d1-t0046", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 1, "seed": 46, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn the integers define \\(x \\sim y \\iff x \\bmod 7 = y \\bmod 7\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun x y : ℤ => x % 7 = y % 7) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d1-t0046"}
+{"id": "logic-and-sets-set_identities-d1-t0047", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 1, "seed": 47, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(X, C, Y\\) be subsets of a type \\(\\alpha\\). Prove the set identity \\[C \\setminus (Y \\cup X) = (C \\setminus Y) \\cap (C \\setminus X).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated identity between sets. -/\ntheorem set_identity {α : Type*} (X C Y : Set α) :\n C \\ (Y ∪ X) = (C \\ Y) ∩ (C \\ X) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d1-t0047"}
+{"id": "logic-and-sets-finset_card-d2-t0048", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 2, "seed": 48, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 4x + 8\\) on the natural numbers and let \\(s, t\\) be finite sets of natural numbers. Prove that \\[|f(s \\setminus t)| + |s \\cap t| = |s|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s t : Finset ℕ) :\n ((s \\ t).image (fun x : ℕ => 4 * x + 8)).card + (s ∩ t).card = s.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d2-t0048"}
+{"id": "logic-and-sets-relations-d2-t0049", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 2, "seed": 49, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn pairs of natural numbers define \\((x_1, y_1) \\sim (x_2, y_2) \\iff x_1 + 6 y_2 = x_2 + 6 y_1\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun p q : ℕ × ℕ => p.1 + 6 * q.2 = q.1 + 6 * p.2) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d2-t0049"}
+{"id": "logic-and-sets-set_identities-d2-t0050", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 2, "seed": 50, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(g : \\alpha \\to \\beta\\) be a function and let \\(S\\) be subsets of \\(\\beta\\). Write \\(g(X)\\) for the image and \\(g^{-1}(X)\\) for the preimage of a set \\(X\\). Prove \\[g(g^{-1}(S)) = S \\cap \\operatorname{range} g.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated statement about images and preimages. -/\ntheorem image_identity {α β : Type*} (g : α → β) (S : Set β) :\n g '' (g ⁻¹' S) = S ∩ Set.range g := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d2-t0050"}
+{"id": "logic-and-sets-finset_card-d3-t0051", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 3, "seed": 51, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 5x + 2\\) on the natural numbers and let \\(s, t\\) be disjoint finite sets of natural numbers. Prove that \\(|f(s \\cup t)| = |s| + |t|\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s t : Finset ℕ) (h : Disjoint s t) :\n ((s ∪ t).image (fun x : ℕ => 5 * x + 2)).card = s.card + t.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d3-t0051"}
+{"id": "logic-and-sets-relations-d3-t0052", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 3, "seed": 52, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nFor an integer \\(n\\), define a relation on the integers by \\(x \\sim y \\iff x \\equiv y \\pmod{n}\\). Prove three things: (1) \\(\\sim\\) is an equivalence relation; (2) \\(\\sim\\) is compatible with addition: if \\(a \\equiv b \\pmod{n}\\) and \\(c \\equiv d \\pmod{n}\\) then \\(a+c \\equiv b+d \\pmod{n}\\); (3) \\(\\sim\\) is compatible with powers: if \\(a \\equiv b \\pmod{n}\\) then \\(a^k \\equiv b^k \\pmod{n}\\) for every natural number \\(k\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 3 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 3 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv (n : ℤ) :\n Equivalence (fun x y : ℤ => x ≡ y [ZMOD n]) := by\n sorry\n\n/-- The relation is compatible with addition. -/\ntheorem rel_add (n a b c d : ℤ) (h1 : a ≡ b [ZMOD n]) (h2 : c ≡ d [ZMOD n]) :\n a + c ≡ b + d [ZMOD n] := by\n sorry\n\n/-- The relation is compatible with taking powers. -/\ntheorem rel_pow (n a b : ℤ) (k : ℕ) (h : a ≡ b [ZMOD n]) :\n a ^ k ≡ b ^ k [ZMOD n] := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d3-t0052"}
+{"id": "logic-and-sets-set_identities-d3-t0053", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 3, "seed": 53, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(S, A, C\\) be subsets of a type \\(\\alpha\\). Assume that \\(C \\cap A = \\emptyset\\). Prove the set identity \\[(S \\cap (A \\cap C)) \\cup C = C \\cap (C \\cap A)^{c}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated identity between sets. -/\ntheorem set_identity {α : Type*} (S A C : Set α) (h : C ∩ A = ∅) :\n (S ∩ (A ∩ C)) ∪ C = C ∩ (C ∩ A)ᶜ := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d3-t0053"}
+{"id": "logic-and-sets-finset_card-d1-t0054", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 1, "seed": 54, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 9x + 0\\) on the natural numbers and let \\(s, t\\) be finite sets of natural numbers. Prove that the product \\(f(s) \\times t\\) has \\(|s| \\cdot |t|\\) elements.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s t : Finset ℕ) :\n ((s.image (fun x : ℕ => 9 * x + 0)) ×ˢ t).card = s.card * t.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d1-t0054"}
+{"id": "logic-and-sets-relations-d1-t0055", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 1, "seed": 55, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn the integers define \\(x \\sim y \\iff x \\bmod 12 = y \\bmod 12\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun x y : ℤ => x % 12 = y % 12) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d1-t0055"}
+{"id": "logic-and-sets-set_identities-d1-t0056", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 1, "seed": 56, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(X, Y, C\\) be subsets of a type \\(\\alpha\\). Prove the set identity \\[X \\cap C^{c} = X \\setminus C.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated identity between sets. -/\ntheorem set_identity {α : Type*} (X Y C : Set α) :\n X ∩ Cᶜ = X \\ C := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d1-t0056"}
+{"id": "logic-and-sets-finset_card-d2-t0057", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 2, "seed": 57, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 8x + 4\\) on the natural numbers and let \\(s, t\\) be finite sets of natural numbers. Prove that \\[|f(s \\cup t)| + |f(s \\cap t)| = |s| + |t|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s t : Finset ℕ) :\n ((s ∪ t).image (fun x : ℕ => 8 * x + 4)).card + ((s ∩ t).image (fun x : ℕ => 8 * x + 4)).card = s.card + t.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d2-t0057"}
+{"id": "logic-and-sets-relations-d2-t0058", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 2, "seed": 58, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn the integers define \\(x \\sim y \\iff 5 \\mid x^{3} - y^{3}\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun x y : ℤ => 5 ∣ x ^ 3 - y ^ 3) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d2-t0058"}
+{"id": "logic-and-sets-set_identities-d2-t0059", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 2, "seed": 59, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(g : \\alpha \\to \\beta\\) be a function and let \\(B, C\\) be subsets of \\(\\alpha\\). Write \\(g(X)\\) for the image and \\(g^{-1}(X)\\) for the preimage of a set \\(X\\). Prove \\[g(B) \\setminus g(C) \\subseteq g(B \\setminus C).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated statement about images and preimages. -/\ntheorem image_identity {α β : Type*} (g : α → β) (B C : Set α) :\n g '' B \\ g '' C ⊆ g '' (B \\ C) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d2-t0059"}
+{"id": "logic-and-sets-finset_card-d3-t0060", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 3, "seed": 60, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 8x + 7\\) on the natural numbers and let \\(s, t\\) be disjoint finite sets of natural numbers. Prove that \\(|f(s \\cup t)| = |s| + |t|\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s t : Finset ℕ) (h : Disjoint s t) :\n ((s ∪ t).image (fun x : ℕ => 8 * x + 7)).card = s.card + t.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d3-t0060"}
+{"id": "logic-and-sets-relations-d3-t0061", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 3, "seed": 61, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nFor an integer \\(n\\), define a relation on the integers by \\(x \\sim y \\iff x \\equiv y \\pmod{n}\\). Prove three things: (1) \\(\\sim\\) is an equivalence relation; (2) \\(\\sim\\) is compatible with addition: if \\(a \\equiv b \\pmod{n}\\) and \\(c \\equiv d \\pmod{n}\\) then \\(a+c \\equiv b+d \\pmod{n}\\); (3) \\(\\sim\\) is compatible with multiplication: if \\(a \\equiv b \\pmod{n}\\) and \\(c \\equiv d \\pmod{n}\\) then \\(ac \\equiv bd \\pmod{n}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 3 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 3 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv (n : ℤ) :\n Equivalence (fun x y : ℤ => x ≡ y [ZMOD n]) := by\n sorry\n\n/-- The relation is compatible with addition. -/\ntheorem rel_add (n a b c d : ℤ) (h1 : a ≡ b [ZMOD n]) (h2 : c ≡ d [ZMOD n]) :\n a + c ≡ b + d [ZMOD n] := by\n sorry\n\n/-- The relation is compatible with multiplication. -/\ntheorem rel_mul (n a b c d : ℤ) (h1 : a ≡ b [ZMOD n]) (h2 : c ≡ d [ZMOD n]) :\n a * c ≡ b * d [ZMOD n] := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d3-t0061"}
+{"id": "logic-and-sets-set_identities-d3-t0062", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 3, "seed": 62, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(f : \\alpha \\to \\beta\\) be a function that is injective and let \\(B, T\\) be subsets of \\(\\alpha\\). Write \\(f(X)\\) for the image and \\(f^{-1}(X)\\) for the preimage of a set \\(X\\). Prove \\[f(B \\cap T) = f(B) \\cap f(T).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated statement about images and preimages. -/\ntheorem image_identity {α β : Type*} (f : α → β) (B T : Set α) (hf : Function.Injective f) :\n f '' (B ∩ T) = f '' B ∩ f '' T := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d3-t0062"}
+{"id": "logic-and-sets-finset_card-d1-t0063", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 1, "seed": 63, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 2x + 8\\) on the natural numbers and let \\(s, t\\) be finite sets of natural numbers. Prove that the product \\(f(s) \\times t\\) has \\(|s| \\cdot |t|\\) elements.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s t : Finset ℕ) :\n ((s.image (fun x : ℕ => 2 * x + 8)) ×ˢ t).card = s.card * t.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d1-t0063"}
+{"id": "logic-and-sets-relations-d1-t0064", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 1, "seed": 64, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn the integers define \\(x \\sim y \\iff 7 \\mid x - y\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun x y : ℤ => 7 ∣ x - y) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d1-t0064"}
+{"id": "logic-and-sets-set_identities-d1-t0065", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 1, "seed": 65, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(Z, A, U\\) be subsets of a type \\(\\alpha\\). Prove the set identity \\[(U \\setminus A) \\cup (U \\cap Z) = U \\setminus (A \\setminus Z).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated identity between sets. -/\ntheorem set_identity {α : Type*} (Z A U : Set α) :\n (U \\ A) ∪ (U ∩ Z) = U \\ (A \\ Z) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d1-t0065"}
+{"id": "logic-and-sets-finset_card-d2-t0066", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 2, "seed": 66, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 6x + 8\\) on the natural numbers and let \\(s, t\\) be finite sets of natural numbers. Prove that \\[|f(s \\setminus t)| + |s \\cap t| = |s|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s t : Finset ℕ) :\n ((s \\ t).image (fun x : ℕ => 6 * x + 8)).card + (s ∩ t).card = s.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d2-t0066"}
+{"id": "logic-and-sets-relations-d2-t0067", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 2, "seed": 67, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn pairs of natural numbers define \\((x_1, y_1) \\sim (x_2, y_2) \\iff x_1 + 3 y_2 = x_2 + 3 y_1\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun p q : ℕ × ℕ => p.1 + 3 * q.2 = q.1 + 3 * p.2) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d2-t0067"}
+{"id": "logic-and-sets-set_identities-d2-t0068", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 2, "seed": 68, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(f : \\alpha \\to \\beta\\) be a function and let \\(A, T\\) be subsets of \\(\\alpha\\). Write \\(f(X)\\) for the image and \\(f^{-1}(X)\\) for the preimage of a set \\(X\\). Prove \\[f(A) \\setminus f(T) \\subseteq f(A \\setminus T).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated statement about images and preimages. -/\ntheorem image_identity {α β : Type*} (f : α → β) (A T : Set α) :\n f '' A \\ f '' T ⊆ f '' (A \\ T) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d2-t0068"}
+{"id": "logic-and-sets-finset_card-d3-t0069", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 3, "seed": 69, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 9x + 7\\) on the natural numbers and let \\(s, t\\) be disjoint finite sets of natural numbers. Prove that \\(|f(s \\cup t)| = |s| + |t|\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s t : Finset ℕ) (h : Disjoint s t) :\n ((s ∪ t).image (fun x : ℕ => 9 * x + 7)).card = s.card + t.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d3-t0069"}
+{"id": "logic-and-sets-relations-d3-t0070", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 3, "seed": 70, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nFor an integer \\(m\\), define a relation on the integers by \\(x \\sim y \\iff m \\mid x - y\\). Prove three things: (1) \\(\\sim\\) is an equivalence relation; (2) \\(\\sim\\) is compatible with addition: if \\(m \\mid a - b\\) and \\(m \\mid c - d\\) then \\(m \\mid (a+c) - (b+d)\\); (3) \\(\\sim\\) is compatible with powers: if \\(m \\mid a - b\\) then \\(m \\mid a^k - b^k\\) for every natural number \\(k\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 3 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 3 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv (m : ℤ) :\n Equivalence (fun x y : ℤ => m ∣ x - y) := by\n sorry\n\n/-- The relation is compatible with addition. -/\ntheorem rel_add (m a b c d : ℤ) (h1 : m ∣ a - b) (h2 : m ∣ c - d) :\n m ∣ (a + c) - (b + d) := by\n sorry\n\n/-- The relation is compatible with taking powers. -/\ntheorem rel_pow (m a b : ℤ) (k : ℕ) (h : m ∣ a - b) :\n m ∣ a ^ k - b ^ k := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d3-t0070"}
+{"id": "logic-and-sets-set_identities-d3-t0071", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 3, "seed": 71, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(Y, B, T\\) be subsets of a type \\(\\alpha\\). Assume that \\(T \\cap Y = \\emptyset\\). Prove the set identity \\[Y \\setminus (Y^{c} \\cap B) = Y \\cap T^{c}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated identity between sets. -/\ntheorem set_identity {α : Type*} (Y B T : Set α) (h : T ∩ Y = ∅) :\n Y \\ (Yᶜ ∩ B) = Y ∩ Tᶜ := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d3-t0071"}
+{"id": "logic-and-sets-finset_card-d1-t0072", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 1, "seed": 72, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 3x + 0\\) on the natural numbers and let \\(s\\) be a finite set of natural numbers. Prove that the image \\(f(s)\\) has the same number of elements as \\(s\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s : Finset ℕ) :\n (s.image (fun x : ℕ => 3 * x + 0)).card = s.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d1-t0072"}
+{"id": "logic-and-sets-relations-d1-t0073", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 1, "seed": 73, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn the integers define \\(x \\sim y \\iff x \\bmod 6 = y \\bmod 6\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun x y : ℤ => x % 6 = y % 6) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d1-t0073"}
+{"id": "logic-and-sets-set_identities-d1-t0074", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 1, "seed": 74, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(U, S, Y\\) be subsets of a type \\(\\alpha\\). Prove the set identity \\[(Y \\setminus U)^{c} = Y^{c} \\cup U.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated identity between sets. -/\ntheorem set_identity {α : Type*} (U S Y : Set α) :\n (Y \\ U)ᶜ = Yᶜ ∪ U := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d1-t0074"}
+{"id": "logic-and-sets-finset_card-d2-t0075", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 2, "seed": 75, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 5x + 3\\) on the natural numbers and let \\(s, t\\) be finite sets of natural numbers. Prove that \\[|f(s \\setminus t)| + |s \\cap t| = |s|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s t : Finset ℕ) :\n ((s \\ t).image (fun x : ℕ => 5 * x + 3)).card + (s ∩ t).card = s.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d2-t0075"}
+{"id": "logic-and-sets-relations-d2-t0076", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 2, "seed": 76, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn the integers define \\(x \\sim y \\iff 3 \\mid x^{2} - y^{2}\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun x y : ℤ => 3 ∣ x ^ 2 - y ^ 2) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d2-t0076"}
+{"id": "logic-and-sets-set_identities-d2-t0077", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 2, "seed": 77, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(f : \\alpha \\to \\beta\\) be a function and let \\(B\\) be subsets of \\(\\beta\\). Write \\(f(X)\\) for the image and \\(f^{-1}(X)\\) for the preimage of a set \\(X\\). Prove \\[f(f^{-1}(B)) = B \\cap \\operatorname{range} f.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated statement about images and preimages. -/\ntheorem image_identity {α β : Type*} (f : α → β) (B : Set β) :\n f '' (f ⁻¹' B) = B ∩ Set.range f := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d2-t0077"}
+{"id": "logic-and-sets-finset_card-d3-t0078", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 3, "seed": 78, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(s, t, u\\) be finite sets of natural numbers. First prove the identity \\[|s \\cup t \\cup u| + |s \\cap t| + |s \\cap u| + |t \\cap u| = |s| + |t| + |u| + |s \\cap t \\cap u|.\\] Then use it to prove the following, where subtraction is truncated subtraction on the natural numbers: \\[|s \\cup t \\cup u| = |s| + |t| + |u| - |s \\cap t| - |s \\cap u| - |t \\cap u| + |s \\cap t \\cap u|.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- Inclusion and exclusion for three finite sets. -/\ntheorem incl_excl (s t u : Finset ℕ) :\n (s ∪ t ∪ u).card + (s ∩ t).card + (s ∩ u).card + (t ∩ u).card = s.card + t.card + u.card + (s ∩ t ∩ u).card := by\n sorry\n\n/-- The size of a union of three finite sets, in terms of the sizes of the intersections. -/\ntheorem card_union_three (s t u : Finset ℕ) :\n (s ∪ t ∪ u).card = s.card + t.card + u.card - (s ∩ t).card - (s ∩ u).card - (t ∩ u).card + (s ∩ t ∩ u).card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d3-t0078"}
+{"id": "logic-and-sets-relations-d3-t0079", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 3, "seed": 79, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nFor an integer \\(m\\), define a relation on the integers by \\(x \\sim y \\iff x \\equiv y \\pmod{m}\\). Prove three things: (1) \\(\\sim\\) is an equivalence relation; (2) \\(\\sim\\) is compatible with addition: if \\(a \\equiv b \\pmod{m}\\) and \\(c \\equiv d \\pmod{m}\\) then \\(a+c \\equiv b+d \\pmod{m}\\); (3) \\(\\sim\\) is compatible with powers: if \\(a \\equiv b \\pmod{m}\\) then \\(a^k \\equiv b^k \\pmod{m}\\) for every natural number \\(k\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 3 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 3 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv (m : ℤ) :\n Equivalence (fun x y : ℤ => x ≡ y [ZMOD m]) := by\n sorry\n\n/-- The relation is compatible with addition. -/\ntheorem rel_add (m a b c d : ℤ) (h1 : a ≡ b [ZMOD m]) (h2 : c ≡ d [ZMOD m]) :\n a + c ≡ b + d [ZMOD m] := by\n sorry\n\n/-- The relation is compatible with taking powers. -/\ntheorem rel_pow (m a b : ℤ) (k : ℕ) (h : a ≡ b [ZMOD m]) :\n a ^ k ≡ b ^ k [ZMOD m] := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d3-t0079"}
+{"id": "logic-and-sets-set_identities-d3-t0080", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 3, "seed": 80, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(Z, X, U\\) be subsets of a type \\(\\alpha\\). Assume that \\(Z \\subseteq X\\). Prove the set identity \\[(U \\setminus X)^{c} \\cap Z = X \\cap (Z \\cap (X \\cap Z)).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated identity between sets. -/\ntheorem set_identity {α : Type*} (Z X U : Set α) (h : Z ⊆ X) :\n (U \\ X)ᶜ ∩ Z = X ∩ (Z ∩ (X ∩ Z)) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d3-t0080"}
+{"id": "logic-and-sets-finset_card-d1-t0081", "env": "logic-and-sets", "msc": "03", "family": "finset_card", "difficulty": 1, "seed": 81, "kind": "prove", "instruction": "# Prove a cardinality fact about finite sets\n\nProve the following.\n\nLet \\(f(x) = 2x + 7\\) on the natural numbers and let \\(s\\) be a finite set of natural numbers. Prove that the image \\(f(s)\\) has the same number of elements as \\(s\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A cardinality fact about finite sets. -/\ntheorem card_fact (s : Finset ℕ) :\n (s.image (fun x : ℕ => 2 * x + 7)).card = s.card := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-finset_card-d1-t0081"}
+{"id": "logic-and-sets-relations-d1-t0082", "env": "logic-and-sets", "msc": "03", "family": "relations", "difficulty": 1, "seed": 82, "kind": "prove", "instruction": "# Prove properties of a relation\n\nProve the following.\n\nOn the integers define \\(x \\sim y \\iff 3 \\mid x - y\\). Prove that \\(\\sim\\) is an equivalence relation.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The relation is reflexive, symmetric and transitive. -/\ntheorem rel_equiv :\n Equivalence (fun x y : ℤ => 3 ∣ x - y) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-relations-d1-t0082"}
+{"id": "logic-and-sets-set_identities-d1-t0083", "env": "logic-and-sets", "msc": "03", "family": "set_identities", "difficulty": 1, "seed": 83, "kind": "prove", "instruction": "# Prove an identity between sets\n\nProve the following.\n\nLet \\(Z, B, C\\) be subsets of a type \\(\\alpha\\). Prove the set identity \\[(B \\cup Z) \\setminus (B \\cap Z) = (B \\setminus Z) \\cup (Z \\setminus B).\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The stated identity between sets. -/\ntheorem set_identity {α : Type*} (Z B C : Set α) :\n (B ∪ Z) \\ (B ∩ Z) = (B \\ Z) ∪ (Z \\ B) := by\n sorry\n", "path": "tasks/logic-and-sets/logic-and-sets-set_identities-d1-t0083"}
diff --git a/data/modular-arithmetic/eval.jsonl b/data/modular-arithmetic/eval.jsonl
new file mode 100644
index 0000000000000000000000000000000000000000..8e6d135d11063484b4a8fb7183f0df54eeda0cc0
--- /dev/null
+++ b/data/modular-arithmetic/eval.jsonl
@@ -0,0 +1,24 @@
+{"id": "modular-arithmetic-congruence_chain-d1-e0000", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 1, "seed": 10000, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) be an integer with \\(x \\equiv 5 \\pmod{6}\\). Prove that \\(6x^2 + 3x + 5 \\equiv 2 \\pmod{6}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The polynomial is congruent to the stated residue. -/\ntheorem congr_poly (x : ℤ) (h : x ≡ 5 [ZMOD 6]) :\n 6 * x ^ 2 + 3 * x + 5 ≡ 2 [ZMOD 6] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d1-e0000"}
+{"id": "modular-arithmetic-divisibility-d1-e0001", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 1, "seed": 10001, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(6\\) divides \\(13n^3 - 19n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The integer divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (6 : ℤ) ∣ 13 * n ^ 3 - 19 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d1-e0001"}
+{"id": "modular-arithmetic-gcd_coprime-d1-e0002", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 1, "seed": 10002, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the integers \\(5n + 2\\) and \\(8n + 3\\) are coprime, in the sense that \\(u(5n + 2) + v(8n + 3) = 1\\) for some integers \\(u, v\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The two linear forms are coprime. -/\ntheorem coprime_int (n : ℤ) :\n IsCoprime (5 * n + 2) (8 * n + 3) := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d1-e0002"}
+{"id": "modular-arithmetic-power_residues-d1-e0003", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 1, "seed": 10003, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the remainder of \\(7n^2\\) on division by \\(8\\) is one of \\(0, 4, 7\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The remainder of the expression is one of the listed values. -/\ntheorem residues_of_power (n : ℕ) :\n (7 * n ^ 2) % 8 = 0 ∨ (7 * n ^ 2) % 8 = 4 ∨ (7 * n ^ 2) % 8 = 7 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d1-e0003"}
+{"id": "modular-arithmetic-congruence_chain-d2-e0004", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 2, "seed": 10004, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) and \\(y\\) be integers with \\(x \\equiv 7 \\pmod{13}\\) and \\(y \\equiv 4 \\pmod{13}\\). Prove that \\(4xy + 3y^2 + 7x \\equiv 1 \\pmod{13}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The expression is congruent to the stated residue. -/\ntheorem congr_poly2 (x y : ℤ) (hx : x ≡ 7 [ZMOD 13]) (hy : y ≡ 4 [ZMOD 13]) :\n 4 * (x * y) + 3 * y ^ 2 + 7 * x ≡ 1 [ZMOD 13] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d2-e0004"}
+{"id": "modular-arithmetic-divisibility-d2-e0005", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 2, "seed": 10005, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(42\\) divides \\(25n^7 + 101n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The integer divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (42 : ℤ) ∣ 25 * n ^ 7 + 101 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d2-e0005"}
+{"id": "modular-arithmetic-gcd_coprime-d2-e0006", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 2, "seed": 10006, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the numbers \\(3n + 1\\) and \\(7n + 2\\) are coprime.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The two linear forms are coprime. -/\ntheorem coprime_nat (n : ℕ) :\n Nat.Coprime (3 * n + 1) (7 * n + 2) := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d2-e0006"}
+{"id": "modular-arithmetic-power_residues-d2-e0007", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 2, "seed": 10007, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the remainder of \\(4n^3 + 4\\) on division by \\(9\\) is one of \\(0, 4, 8\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The remainder of the expression is one of the listed values. -/\ntheorem residues_of_power (n : ℕ) :\n (4 * n ^ 3 + 4) % 9 = 0 ∨ (4 * n ^ 3 + 4) % 9 = 4 ∨ (4 * n ^ 3 + 4) % 9 = 8 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d2-e0007"}
+{"id": "modular-arithmetic-congruence_chain-d3-e0008", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 3, "seed": 10008, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) and \\(y\\) be integers with \\(x \\equiv 3 \\pmod{10}\\) and \\(y \\equiv 4 \\pmod{10}\\). Prove that \\(x^{18} \\equiv 9 \\pmod{10}\\), and then that \\(x^{18} y^{12} + 4 \\equiv 8 \\pmod{10}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- A large power of x has the stated residue. -/\ntheorem congr_pow (x : ℤ) (h : x ≡ 3 [ZMOD 10]) :\n x ^ 18 ≡ 9 [ZMOD 10] := by\n sorry\n\n/-- The combined expression has the stated residue. -/\ntheorem congr_product (x y : ℤ) (hx : x ≡ 3 [ZMOD 10]) (hy : y ≡ 4 [ZMOD 10]) :\n x ^ 18 * y ^ 12 + 4 ≡ 8 [ZMOD 10] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d3-e0008"}
+{"id": "modular-arithmetic-divisibility-d3-e0009", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 3, "seed": 10009, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(42\\) divides \\(29n^7 - 155n\\). Prove it first for each prime factor of \\(42\\), then combine.\n\n## What to do\n\n`Solution.lean` in the working directory states 4 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 4 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The prime 2 divides the polynomial value. -/\ntheorem dvd_by_2 (n : ℤ) :\n (2 : ℤ) ∣ 29 * n ^ 7 - 155 * n := by\n sorry\n\n/-- The prime 3 divides the polynomial value. -/\ntheorem dvd_by_3 (n : ℤ) :\n (3 : ℤ) ∣ 29 * n ^ 7 - 155 * n := by\n sorry\n\n/-- The prime 7 divides the polynomial value. -/\ntheorem dvd_by_7 (n : ℤ) :\n (7 : ℤ) ∣ 29 * n ^ 7 - 155 * n := by\n sorry\n\n/-- The product of the primes divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (42 : ℤ) ∣ 29 * n ^ 7 - 155 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d3-e0009"}
+{"id": "modular-arithmetic-gcd_coprime-d3-e0010", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 3, "seed": 10010, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(n\\) be a natural number and \\(g = \\gcd(5n + 7, 6n + 9)\\). Prove that \\(g\\) divides \\(3\\), and conclude that \\(g = 1\\) or \\(g = 3\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The gcd divides the determinant. -/\ntheorem gcd_dvd_det (n : ℕ) :\n Nat.gcd (5 * n + 7) (6 * n + 9) ∣ 3 := by\n sorry\n\n/-- The gcd is 1 or the prime determinant. -/\ntheorem gcd_one_or_prime (n : ℕ) :\n Nat.gcd (5 * n + 7) (6 * n + 9) = 1 ∨ Nat.gcd (5 * n + 7) (6 * n + 9) = 3 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d3-e0010"}
+{"id": "modular-arithmetic-power_residues-d3-e0011", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 3, "seed": 10011, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for all natural numbers \\(a\\) and \\(b\\), the number \\(a^2 + 3b^2 + 6\\) never leaves remainder \\(8\\) on division by \\(9\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The expression never leaves the stated remainder. -/\ntheorem residue_never_attained (a b : ℕ) :\n (a ^ 2 + 3 * b ^ 2 + 6) % 9 ≠ 8 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d3-e0011"}
+{"id": "modular-arithmetic-congruence_chain-d1-e0012", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 1, "seed": 10012, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) be an integer with \\(x \\equiv 1 \\pmod{7}\\). Prove that \\(6x^2 + 7x + 4 \\equiv 3 \\pmod{7}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The polynomial is congruent to the stated residue. -/\ntheorem congr_poly (x : ℤ) (h : x ≡ 1 [ZMOD 7]) :\n 6 * x ^ 2 + 7 * x + 4 ≡ 3 [ZMOD 7] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d1-e0012"}
+{"id": "modular-arithmetic-divisibility-d1-e0013", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 1, "seed": 10013, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(30\\) divides \\(31n^5 + 29n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The integer divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (30 : ℤ) ∣ 31 * n ^ 5 + 29 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d1-e0013"}
+{"id": "modular-arithmetic-gcd_coprime-d1-e0014", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 1, "seed": 10014, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the integers \\(n + 8\\) and \\(3n + 23\\) are coprime, in the sense that \\(u(n + 8) + v(3n + 23) = 1\\) for some integers \\(u, v\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The two linear forms are coprime. -/\ntheorem coprime_int (n : ℤ) :\n IsCoprime (n + 8) (3 * n + 23) := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d1-e0014"}
+{"id": "modular-arithmetic-power_residues-d1-e0015", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 1, "seed": 10015, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the remainder of \\(4n^2 + 3\\) on division by \\(5\\) is one of \\(2, 3, 4\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The remainder of the expression is one of the listed values. -/\ntheorem residues_of_power (n : ℕ) :\n (4 * n ^ 2 + 3) % 5 = 2 ∨ (4 * n ^ 2 + 3) % 5 = 3 ∨ (4 * n ^ 2 + 3) % 5 = 4 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d1-e0015"}
+{"id": "modular-arithmetic-congruence_chain-d2-e0016", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 2, "seed": 10016, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) and \\(y\\) be integers with \\(x \\equiv 2 \\pmod{9}\\) and \\(y \\equiv 8 \\pmod{9}\\). Prove that \\(3xy + y^2 + 3x \\equiv 1 \\pmod{9}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The expression is congruent to the stated residue. -/\ntheorem congr_poly2 (x y : ℤ) (hx : x ≡ 2 [ZMOD 9]) (hy : y ≡ 8 [ZMOD 9]) :\n 3 * (x * y) + y ^ 2 + 3 * x ≡ 1 [ZMOD 9] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d2-e0016"}
+{"id": "modular-arithmetic-divisibility-d2-e0017", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 2, "seed": 10017, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(6\\) divides \\(29n^3 - 35n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The integer divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (6 : ℤ) ∣ 29 * n ^ 3 - 35 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d2-e0017"}
+{"id": "modular-arithmetic-gcd_coprime-d2-e0018", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 2, "seed": 10018, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the numbers \\(2n + 5\\) and \\(9n + 23\\) are coprime.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The two linear forms are coprime. -/\ntheorem coprime_nat (n : ℕ) :\n Nat.Coprime (2 * n + 5) (9 * n + 23) := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d2-e0018"}
+{"id": "modular-arithmetic-power_residues-d2-e0019", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 2, "seed": 10019, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the remainder of \\(2n^4 + 4\\) on division by \\(7\\) is one of \\(1, 4, 5, 6\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The remainder of the expression is one of the listed values. -/\ntheorem residues_of_power (n : ℕ) :\n (2 * n ^ 4 + 4) % 7 = 1 ∨ (2 * n ^ 4 + 4) % 7 = 4 ∨ (2 * n ^ 4 + 4) % 7 = 5 ∨ (2 * n ^ 4 + 4) % 7 = 6 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d2-e0019"}
+{"id": "modular-arithmetic-congruence_chain-d3-e0020", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 3, "seed": 10020, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) and \\(y\\) be integers with \\(x \\equiv 5 \\pmod{12}\\) and \\(y \\equiv 11 \\pmod{12}\\). Prove that \\(x^{36} \\equiv 1 \\pmod{12}\\), and then that \\(x^{36} y^{39} + 6 \\equiv 5 \\pmod{12}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- A large power of x has the stated residue. -/\ntheorem congr_pow (x : ℤ) (h : x ≡ 5 [ZMOD 12]) :\n x ^ 36 ≡ 1 [ZMOD 12] := by\n sorry\n\n/-- The combined expression has the stated residue. -/\ntheorem congr_product (x y : ℤ) (hx : x ≡ 5 [ZMOD 12]) (hy : y ≡ 11 [ZMOD 12]) :\n x ^ 36 * y ^ 39 + 6 ≡ 5 [ZMOD 12] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d3-e0020"}
+{"id": "modular-arithmetic-divisibility-d3-e0021", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 3, "seed": 10021, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(42\\) divides \\(n^7 - n\\). Prove it first for each prime factor of \\(42\\), then combine.\n\n## What to do\n\n`Solution.lean` in the working directory states 4 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 4 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The prime 2 divides the polynomial value. -/\ntheorem dvd_by_2 (n : ℤ) :\n (2 : ℤ) ∣ n ^ 7 - n := by\n sorry\n\n/-- The prime 3 divides the polynomial value. -/\ntheorem dvd_by_3 (n : ℤ) :\n (3 : ℤ) ∣ n ^ 7 - n := by\n sorry\n\n/-- The prime 7 divides the polynomial value. -/\ntheorem dvd_by_7 (n : ℤ) :\n (7 : ℤ) ∣ n ^ 7 - n := by\n sorry\n\n/-- The product of the primes divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (42 : ℤ) ∣ n ^ 7 - n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d3-e0021"}
+{"id": "modular-arithmetic-gcd_coprime-d3-e0022", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 3, "seed": 10022, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(n\\) be a natural number and \\(g = \\gcd(7n + 6, 8n + 5)\\). Prove that \\(g\\) divides \\(13\\), and conclude that \\(g = 1\\) or \\(g = 13\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The gcd divides the determinant. -/\ntheorem gcd_dvd_det (n : ℕ) :\n Nat.gcd (7 * n + 6) (8 * n + 5) ∣ 13 := by\n sorry\n\n/-- The gcd is 1 or the prime determinant. -/\ntheorem gcd_one_or_prime (n : ℕ) :\n Nat.gcd (7 * n + 6) (8 * n + 5) = 1 ∨ Nat.gcd (7 * n + 6) (8 * n + 5) = 13 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d3-e0022"}
+{"id": "modular-arithmetic-power_residues-d3-e0023", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 3, "seed": 10023, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for all natural numbers \\(a\\) and \\(b\\), the number \\(a^2 + 3b^2 + 1\\) never leaves remainder \\(7\\) on division by \\(8\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The expression never leaves the stated remainder. -/\ntheorem residue_never_attained (a b : ℕ) :\n (a ^ 2 + 3 * b ^ 2 + 1) % 8 ≠ 7 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d3-e0023"}
diff --git a/data/modular-arithmetic/train.jsonl b/data/modular-arithmetic/train.jsonl
new file mode 100644
index 0000000000000000000000000000000000000000..71c8479d639b0d3e952f1415ea844fa92199dce2
--- /dev/null
+++ b/data/modular-arithmetic/train.jsonl
@@ -0,0 +1,84 @@
+{"id": "modular-arithmetic-congruence_chain-d1-t0000", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 1, "seed": 0, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) be an integer with \\(x \\equiv 0 \\pmod{8}\\). Prove that \\(x^2 + 5x + 1 \\equiv 1 \\pmod{8}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The polynomial is congruent to the stated residue. -/\ntheorem congr_poly (x : ℤ) (h : x ≡ 0 [ZMOD 8]) :\n x ^ 2 + 5 * x + 1 ≡ 1 [ZMOD 8] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d1-t0000"}
+{"id": "modular-arithmetic-divisibility-d1-t0001", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 1, "seed": 1, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(2\\) divides \\(13n^5 - 9n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The integer divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (2 : ℤ) ∣ 13 * n ^ 5 - 9 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d1-t0001"}
+{"id": "modular-arithmetic-gcd_coprime-d1-t0002", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 1, "seed": 2, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the integers \\(n + 8\\) and \\(3n + 25\\) are coprime, in the sense that \\(u(n + 8) + v(3n + 25) = 1\\) for some integers \\(u, v\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The two linear forms are coprime. -/\ntheorem coprime_int (n : ℤ) :\n IsCoprime (n + 8) (3 * n + 25) := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d1-t0002"}
+{"id": "modular-arithmetic-power_residues-d1-t0003", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 1, "seed": 3, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the remainder of \\(n^2 + 6\\) on division by \\(7\\) is one of \\(0, 1, 3, 6\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The remainder of the expression is one of the listed values. -/\ntheorem residues_of_power (n : ℕ) :\n (n ^ 2 + 6) % 7 = 0 ∨ (n ^ 2 + 6) % 7 = 1 ∨ (n ^ 2 + 6) % 7 = 3 ∨ (n ^ 2 + 6) % 7 = 6 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d1-t0003"}
+{"id": "modular-arithmetic-congruence_chain-d2-t0004", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 2, "seed": 4, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) and \\(y\\) be integers with \\(x \\equiv 1 \\pmod{6}\\) and \\(y \\equiv 1 \\pmod{6}\\). Prove that \\(4xy + 7y^2 + 5x \\equiv 4 \\pmod{6}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The expression is congruent to the stated residue. -/\ntheorem congr_poly2 (x y : ℤ) (hx : x ≡ 1 [ZMOD 6]) (hy : y ≡ 1 [ZMOD 6]) :\n 4 * (x * y) + 7 * y ^ 2 + 5 * x ≡ 4 [ZMOD 6] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d2-t0004"}
+{"id": "modular-arithmetic-divisibility-d2-t0005", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 2, "seed": 5, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(6\\) divides \\(19n^3 - 7n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The integer divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (6 : ℤ) ∣ 19 * n ^ 3 - 7 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d2-t0005"}
+{"id": "modular-arithmetic-gcd_coprime-d2-t0006", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 2, "seed": 6, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the numbers \\(3n + 1\\) and \\(4n + 1\\) are coprime.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The two linear forms are coprime. -/\ntheorem coprime_nat (n : ℕ) :\n Nat.Coprime (3 * n + 1) (4 * n + 1) := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d2-t0006"}
+{"id": "modular-arithmetic-power_residues-d2-t0007", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 2, "seed": 7, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the remainder of \\(7n^3 + 7\\) on division by \\(13\\) is one of \\(0, 1, 3, 7, 11\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The remainder of the expression is one of the listed values. -/\ntheorem residues_of_power (n : ℕ) :\n (7 * n ^ 3 + 7) % 13 = 0 ∨ (7 * n ^ 3 + 7) % 13 = 1 ∨ (7 * n ^ 3 + 7) % 13 = 3 ∨ (7 * n ^ 3 + 7) % 13 = 7 ∨ (7 * n ^ 3 + 7) % 13 = 11 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d2-t0007"}
+{"id": "modular-arithmetic-congruence_chain-d3-t0008", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 3, "seed": 8, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) and \\(y\\) be integers with \\(x \\equiv 6 \\pmod{8}\\) and \\(y \\equiv 7 \\pmod{8}\\). Prove that \\(x^{38} \\equiv 0 \\pmod{8}\\), and then that \\(x^{38} y^{13} + 3 \\equiv 3 \\pmod{8}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- A large power of x has the stated residue. -/\ntheorem congr_pow (x : ℤ) (h : x ≡ 6 [ZMOD 8]) :\n x ^ 38 ≡ 0 [ZMOD 8] := by\n sorry\n\n/-- The combined expression has the stated residue. -/\ntheorem congr_product (x y : ℤ) (hx : x ≡ 6 [ZMOD 8]) (hy : y ≡ 7 [ZMOD 8]) :\n x ^ 38 * y ^ 13 + 3 ≡ 3 [ZMOD 8] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d3-t0008"}
+{"id": "modular-arithmetic-divisibility-d3-t0009", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 3, "seed": 9, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(42\\) divides \\(5n^7 - 89n\\). Prove it first for each prime factor of \\(42\\), then combine.\n\n## What to do\n\n`Solution.lean` in the working directory states 4 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 4 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The prime 2 divides the polynomial value. -/\ntheorem dvd_by_2 (n : ℤ) :\n (2 : ℤ) ∣ 5 * n ^ 7 - 89 * n := by\n sorry\n\n/-- The prime 3 divides the polynomial value. -/\ntheorem dvd_by_3 (n : ℤ) :\n (3 : ℤ) ∣ 5 * n ^ 7 - 89 * n := by\n sorry\n\n/-- The prime 7 divides the polynomial value. -/\ntheorem dvd_by_7 (n : ℤ) :\n (7 : ℤ) ∣ 5 * n ^ 7 - 89 * n := by\n sorry\n\n/-- The product of the primes divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (42 : ℤ) ∣ 5 * n ^ 7 - 89 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d3-t0009"}
+{"id": "modular-arithmetic-gcd_coprime-d3-t0010", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 3, "seed": 10, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(n\\) be a natural number and \\(g = \\gcd(2n + 4, 3n + 7)\\). Prove that \\(g\\) divides \\(2\\), and conclude that \\(g = 1\\) or \\(g = 2\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The gcd divides the determinant. -/\ntheorem gcd_dvd_det (n : ℕ) :\n Nat.gcd (2 * n + 4) (3 * n + 7) ∣ 2 := by\n sorry\n\n/-- The gcd is 1 or the prime determinant. -/\ntheorem gcd_one_or_prime (n : ℕ) :\n Nat.gcd (2 * n + 4) (3 * n + 7) = 1 ∨ Nat.gcd (2 * n + 4) (3 * n + 7) = 2 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d3-t0010"}
+{"id": "modular-arithmetic-power_residues-d3-t0011", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 3, "seed": 11, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for all natural numbers \\(a\\) and \\(b\\), the number \\(2a^3 + b^3\\) never leaves remainder \\(4\\) on division by \\(8\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The expression never leaves the stated remainder. -/\ntheorem residue_never_attained (a b : ℕ) :\n (2 * a ^ 3 + b ^ 3) % 8 ≠ 4 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d3-t0011"}
+{"id": "modular-arithmetic-congruence_chain-d1-t0012", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 1, "seed": 12, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) be an integer with \\(x \\equiv 0 \\pmod{10}\\). Prove that \\(5x^2 + x + 6 \\equiv 6 \\pmod{10}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The polynomial is congruent to the stated residue. -/\ntheorem congr_poly (x : ℤ) (h : x ≡ 0 [ZMOD 10]) :\n 5 * x ^ 2 + x + 6 ≡ 6 [ZMOD 10] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d1-t0012"}
+{"id": "modular-arithmetic-divisibility-d1-t0013", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 1, "seed": 13, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(2\\) divides \\(29n^7 - 35n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The integer divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (2 : ℤ) ∣ 29 * n ^ 7 - 35 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d1-t0013"}
+{"id": "modular-arithmetic-gcd_coprime-d1-t0014", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 1, "seed": 14, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the integers \\(3n + 1\\) and \\(5n + 2\\) are coprime, in the sense that \\(u(3n + 1) + v(5n + 2) = 1\\) for some integers \\(u, v\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The two linear forms are coprime. -/\ntheorem coprime_int (n : ℤ) :\n IsCoprime (3 * n + 1) (5 * n + 2) := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d1-t0014"}
+{"id": "modular-arithmetic-power_residues-d1-t0015", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 1, "seed": 15, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the remainder of \\(2n^2 + 4\\) on division by \\(8\\) is one of \\(4, 6\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The remainder of the expression is one of the listed values. -/\ntheorem residues_of_power (n : ℕ) :\n (2 * n ^ 2 + 4) % 8 = 4 ∨ (2 * n ^ 2 + 4) % 8 = 6 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d1-t0015"}
+{"id": "modular-arithmetic-congruence_chain-d2-t0016", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 2, "seed": 16, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) and \\(y\\) be integers with \\(x \\equiv 1 \\pmod{13}\\) and \\(y \\equiv 2 \\pmod{13}\\). Prove that \\(7xy + 5y^2 + 5x \\equiv 0 \\pmod{13}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The expression is congruent to the stated residue. -/\ntheorem congr_poly2 (x y : ℤ) (hx : x ≡ 1 [ZMOD 13]) (hy : y ≡ 2 [ZMOD 13]) :\n 7 * (x * y) + 5 * y ^ 2 + 5 * x ≡ 0 [ZMOD 13] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d2-t0016"}
+{"id": "modular-arithmetic-divisibility-d2-t0017", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 2, "seed": 17, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(6\\) divides \\(13n^3 - 25n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The integer divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (6 : ℤ) ∣ 13 * n ^ 3 - 25 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d2-t0017"}
+{"id": "modular-arithmetic-gcd_coprime-d2-t0018", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 2, "seed": 18, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the numbers \\(n + 5\\) and \\(9n + 46\\) are coprime.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The two linear forms are coprime. -/\ntheorem coprime_nat (n : ℕ) :\n Nat.Coprime (n + 5) (9 * n + 46) := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d2-t0018"}
+{"id": "modular-arithmetic-power_residues-d2-t0019", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 2, "seed": 19, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the remainder of \\(12n^3 + 3\\) on division by \\(16\\) is one of \\(3, 7, 15\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The remainder of the expression is one of the listed values. -/\ntheorem residues_of_power (n : ℕ) :\n (12 * n ^ 3 + 3) % 16 = 3 ∨ (12 * n ^ 3 + 3) % 16 = 7 ∨ (12 * n ^ 3 + 3) % 16 = 15 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d2-t0019"}
+{"id": "modular-arithmetic-congruence_chain-d3-t0020", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 3, "seed": 20, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) and \\(y\\) be integers with \\(x \\equiv 9 \\pmod{11}\\) and \\(y \\equiv 4 \\pmod{11}\\). Prove that \\(x^{27} \\equiv 4 \\pmod{11}\\), and then that \\(x^{27} y^{13} + 1 \\equiv 4 \\pmod{11}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- A large power of x has the stated residue. -/\ntheorem congr_pow (x : ℤ) (h : x ≡ 9 [ZMOD 11]) :\n x ^ 27 ≡ 4 [ZMOD 11] := by\n sorry\n\n/-- The combined expression has the stated residue. -/\ntheorem congr_product (x y : ℤ) (hx : x ≡ 9 [ZMOD 11]) (hy : y ≡ 4 [ZMOD 11]) :\n x ^ 27 * y ^ 13 + 1 ≡ 4 [ZMOD 11] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d3-t0020"}
+{"id": "modular-arithmetic-divisibility-d3-t0021", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 3, "seed": 21, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(42\\) divides \\(17n^7 - 143n\\). Prove it first for each prime factor of \\(42\\), then combine.\n\n## What to do\n\n`Solution.lean` in the working directory states 4 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 4 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The prime 2 divides the polynomial value. -/\ntheorem dvd_by_2 (n : ℤ) :\n (2 : ℤ) ∣ 17 * n ^ 7 - 143 * n := by\n sorry\n\n/-- The prime 3 divides the polynomial value. -/\ntheorem dvd_by_3 (n : ℤ) :\n (3 : ℤ) ∣ 17 * n ^ 7 - 143 * n := by\n sorry\n\n/-- The prime 7 divides the polynomial value. -/\ntheorem dvd_by_7 (n : ℤ) :\n (7 : ℤ) ∣ 17 * n ^ 7 - 143 * n := by\n sorry\n\n/-- The product of the primes divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (42 : ℤ) ∣ 17 * n ^ 7 - 143 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d3-t0021"}
+{"id": "modular-arithmetic-gcd_coprime-d3-t0022", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 3, "seed": 22, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(n\\) be a natural number and \\(g = \\gcd(3n + 5, 4n + 6)\\). Prove that \\(g\\) divides \\(2\\), and conclude that \\(g = 1\\) or \\(g = 2\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The gcd divides the determinant. -/\ntheorem gcd_dvd_det (n : ℕ) :\n Nat.gcd (3 * n + 5) (4 * n + 6) ∣ 2 := by\n sorry\n\n/-- The gcd is 1 or the prime determinant. -/\ntheorem gcd_one_or_prime (n : ℕ) :\n Nat.gcd (3 * n + 5) (4 * n + 6) = 1 ∨ Nat.gcd (3 * n + 5) (4 * n + 6) = 2 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d3-t0022"}
+{"id": "modular-arithmetic-power_residues-d3-t0023", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 3, "seed": 23, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for all natural numbers \\(a\\) and \\(b\\), the number \\(3a^2 + b^2 + 2\\) never leaves remainder \\(0\\) on division by \\(8\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The expression never leaves the stated remainder. -/\ntheorem residue_never_attained (a b : ℕ) :\n (3 * a ^ 2 + b ^ 2 + 2) % 8 ≠ 0 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d3-t0023"}
+{"id": "modular-arithmetic-congruence_chain-d1-t0024", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 1, "seed": 24, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) be an integer with \\(x \\equiv 2 \\pmod{6}\\). Prove that \\(x^2 + 4x + 2 \\equiv 2 \\pmod{6}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The polynomial is congruent to the stated residue. -/\ntheorem congr_poly (x : ℤ) (h : x ≡ 2 [ZMOD 6]) :\n x ^ 2 + 4 * x + 2 ≡ 2 [ZMOD 6] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d1-t0024"}
+{"id": "modular-arithmetic-divisibility-d1-t0025", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 1, "seed": 25, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(7\\) divides \\(19n^7 - 19n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The integer divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (7 : ℤ) ∣ 19 * n ^ 7 - 19 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d1-t0025"}
+{"id": "modular-arithmetic-gcd_coprime-d1-t0026", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 1, "seed": 26, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the integers \\(2n + 3\\) and \\(5n + 7\\) are coprime, in the sense that \\(u(2n + 3) + v(5n + 7) = 1\\) for some integers \\(u, v\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The two linear forms are coprime. -/\ntheorem coprime_int (n : ℤ) :\n IsCoprime (2 * n + 3) (5 * n + 7) := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d1-t0026"}
+{"id": "modular-arithmetic-power_residues-d1-t0027", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 1, "seed": 27, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the remainder of \\(2n^2 + 1\\) on division by \\(3\\) is one of \\(0, 1\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The remainder of the expression is one of the listed values. -/\ntheorem residues_of_power (n : ℕ) :\n (2 * n ^ 2 + 1) % 3 = 0 ∨ (2 * n ^ 2 + 1) % 3 = 1 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d1-t0027"}
+{"id": "modular-arithmetic-congruence_chain-d2-t0028", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 2, "seed": 28, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) and \\(y\\) be integers with \\(x \\equiv 3 \\pmod{6}\\) and \\(y \\equiv 5 \\pmod{6}\\). Prove that \\(4xy + 3y^2 + 5x \\equiv 0 \\pmod{6}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The expression is congruent to the stated residue. -/\ntheorem congr_poly2 (x y : ℤ) (hx : x ≡ 3 [ZMOD 6]) (hy : y ≡ 5 [ZMOD 6]) :\n 4 * (x * y) + 3 * y ^ 2 + 5 * x ≡ 0 [ZMOD 6] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d2-t0028"}
+{"id": "modular-arithmetic-divisibility-d2-t0029", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 2, "seed": 29, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(30\\) divides \\(29n^5 + 31n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The integer divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (30 : ℤ) ∣ 29 * n ^ 5 + 31 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d2-t0029"}
+{"id": "modular-arithmetic-gcd_coprime-d2-t0030", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 2, "seed": 30, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the numbers \\(3n + 5\\) and \\(2n + 3\\) are coprime.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The two linear forms are coprime. -/\ntheorem coprime_nat (n : ℕ) :\n Nat.Coprime (3 * n + 5) (2 * n + 3) := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d2-t0030"}
+{"id": "modular-arithmetic-power_residues-d2-t0031", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 2, "seed": 31, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the remainder of \\(4n^4 + 8\\) on division by \\(9\\) is one of \\(0, 3, 6, 8\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The remainder of the expression is one of the listed values. -/\ntheorem residues_of_power (n : ℕ) :\n (4 * n ^ 4 + 8) % 9 = 0 ∨ (4 * n ^ 4 + 8) % 9 = 3 ∨ (4 * n ^ 4 + 8) % 9 = 6 ∨ (4 * n ^ 4 + 8) % 9 = 8 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d2-t0031"}
+{"id": "modular-arithmetic-congruence_chain-d3-t0032", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 3, "seed": 32, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) and \\(y\\) be integers with \\(x \\equiv 2 \\pmod{9}\\) and \\(y \\equiv 2 \\pmod{9}\\). Prove that \\(x^{14} \\equiv 4 \\pmod{9}\\), and then that \\(x^{14} y^{11} + 4 \\equiv 6 \\pmod{9}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- A large power of x has the stated residue. -/\ntheorem congr_pow (x : ℤ) (h : x ≡ 2 [ZMOD 9]) :\n x ^ 14 ≡ 4 [ZMOD 9] := by\n sorry\n\n/-- The combined expression has the stated residue. -/\ntheorem congr_product (x y : ℤ) (hx : x ≡ 2 [ZMOD 9]) (hy : y ≡ 2 [ZMOD 9]) :\n x ^ 14 * y ^ 11 + 4 ≡ 6 [ZMOD 9] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d3-t0032"}
+{"id": "modular-arithmetic-divisibility-d3-t0033", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 3, "seed": 33, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(30\\) divides \\(11n^5 - 71n\\). Prove it first for each prime factor of \\(30\\), then combine.\n\n## What to do\n\n`Solution.lean` in the working directory states 4 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 4 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The prime 2 divides the polynomial value. -/\ntheorem dvd_by_2 (n : ℤ) :\n (2 : ℤ) ∣ 11 * n ^ 5 - 71 * n := by\n sorry\n\n/-- The prime 3 divides the polynomial value. -/\ntheorem dvd_by_3 (n : ℤ) :\n (3 : ℤ) ∣ 11 * n ^ 5 - 71 * n := by\n sorry\n\n/-- The prime 5 divides the polynomial value. -/\ntheorem dvd_by_5 (n : ℤ) :\n (5 : ℤ) ∣ 11 * n ^ 5 - 71 * n := by\n sorry\n\n/-- The product of the primes divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (30 : ℤ) ∣ 11 * n ^ 5 - 71 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d3-t0033"}
+{"id": "modular-arithmetic-gcd_coprime-d3-t0034", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 3, "seed": 34, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(n\\) be a natural number and \\(g = \\gcd(n + 5, 3n + 4)\\). Prove that \\(g\\) divides \\(11\\), and conclude that \\(g = 1\\) or \\(g = 11\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The gcd divides the determinant. -/\ntheorem gcd_dvd_det (n : ℕ) :\n Nat.gcd (n + 5) (3 * n + 4) ∣ 11 := by\n sorry\n\n/-- The gcd is 1 or the prime determinant. -/\ntheorem gcd_one_or_prime (n : ℕ) :\n Nat.gcd (n + 5) (3 * n + 4) = 1 ∨ Nat.gcd (n + 5) (3 * n + 4) = 11 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d3-t0034"}
+{"id": "modular-arithmetic-power_residues-d3-t0035", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 3, "seed": 35, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for all natural numbers \\(a\\) and \\(b\\), the number \\(3a^2 + 3b^2\\) never leaves remainder \\(1\\) on division by \\(8\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The expression never leaves the stated remainder. -/\ntheorem residue_never_attained (a b : ℕ) :\n (3 * a ^ 2 + 3 * b ^ 2) % 8 ≠ 1 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d3-t0035"}
+{"id": "modular-arithmetic-congruence_chain-d1-t0036", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 1, "seed": 36, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) be an integer with \\(x \\equiv 3 \\pmod{5}\\). Prove that \\(x^2 + 2x + 5 \\equiv 0 \\pmod{5}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The polynomial is congruent to the stated residue. -/\ntheorem congr_poly (x : ℤ) (h : x ≡ 3 [ZMOD 5]) :\n x ^ 2 + 2 * x + 5 ≡ 0 [ZMOD 5] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d1-t0036"}
+{"id": "modular-arithmetic-divisibility-d1-t0037", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 1, "seed": 37, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(6\\) divides \\(19n^3 - 37n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The integer divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (6 : ℤ) ∣ 19 * n ^ 3 - 37 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d1-t0037"}
+{"id": "modular-arithmetic-gcd_coprime-d1-t0038", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 1, "seed": 38, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the integers \\(n + 4\\) and \\(5n + 19\\) are coprime, in the sense that \\(u(n + 4) + v(5n + 19) = 1\\) for some integers \\(u, v\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The two linear forms are coprime. -/\ntheorem coprime_int (n : ℤ) :\n IsCoprime (n + 4) (5 * n + 19) := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d1-t0038"}
+{"id": "modular-arithmetic-power_residues-d1-t0039", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 1, "seed": 39, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the remainder of \\(3n^2 + 2\\) on division by \\(7\\) is one of \\(0, 1, 2, 5\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The remainder of the expression is one of the listed values. -/\ntheorem residues_of_power (n : ℕ) :\n (3 * n ^ 2 + 2) % 7 = 0 ∨ (3 * n ^ 2 + 2) % 7 = 1 ∨ (3 * n ^ 2 + 2) % 7 = 2 ∨ (3 * n ^ 2 + 2) % 7 = 5 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d1-t0039"}
+{"id": "modular-arithmetic-congruence_chain-d2-t0040", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 2, "seed": 40, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) and \\(y\\) be integers with \\(x \\equiv 5 \\pmod{8}\\) and \\(y \\equiv 0 \\pmod{8}\\). Prove that \\(2xy + 6y^2 + 4x \\equiv 4 \\pmod{8}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The expression is congruent to the stated residue. -/\ntheorem congr_poly2 (x y : ℤ) (hx : x ≡ 5 [ZMOD 8]) (hy : y ≡ 0 [ZMOD 8]) :\n 2 * (x * y) + 6 * y ^ 2 + 4 * x ≡ 4 [ZMOD 8] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d2-t0040"}
+{"id": "modular-arithmetic-divisibility-d2-t0041", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 2, "seed": 41, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(30\\) divides \\(31n^5 - n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The integer divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (30 : ℤ) ∣ 31 * n ^ 5 - n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d2-t0041"}
+{"id": "modular-arithmetic-gcd_coprime-d2-t0042", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 2, "seed": 42, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the numbers \\(3n + 7\\) and \\(4n + 9\\) are coprime.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The two linear forms are coprime. -/\ntheorem coprime_nat (n : ℕ) :\n Nat.Coprime (3 * n + 7) (4 * n + 9) := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d2-t0042"}
+{"id": "modular-arithmetic-power_residues-d2-t0043", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 2, "seed": 43, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the remainder of \\(7n^4 + 3\\) on division by \\(9\\) is one of \\(1, 3, 4, 7\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The remainder of the expression is one of the listed values. -/\ntheorem residues_of_power (n : ℕ) :\n (7 * n ^ 4 + 3) % 9 = 1 ∨ (7 * n ^ 4 + 3) % 9 = 3 ∨ (7 * n ^ 4 + 3) % 9 = 4 ∨ (7 * n ^ 4 + 3) % 9 = 7 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d2-t0043"}
+{"id": "modular-arithmetic-congruence_chain-d3-t0044", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 3, "seed": 44, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) and \\(y\\) be integers with \\(x \\equiv 7 \\pmod{9}\\) and \\(y \\equiv 5 \\pmod{9}\\). Prove that \\(x^{31} \\equiv 7 \\pmod{9}\\), and then that \\(x^{31} y^{23} + 2 \\equiv 7 \\pmod{9}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- A large power of x has the stated residue. -/\ntheorem congr_pow (x : ℤ) (h : x ≡ 7 [ZMOD 9]) :\n x ^ 31 ≡ 7 [ZMOD 9] := by\n sorry\n\n/-- The combined expression has the stated residue. -/\ntheorem congr_product (x y : ℤ) (hx : x ≡ 7 [ZMOD 9]) (hy : y ≡ 5 [ZMOD 9]) :\n x ^ 31 * y ^ 23 + 2 ≡ 7 [ZMOD 9] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d3-t0044"}
+{"id": "modular-arithmetic-divisibility-d3-t0045", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 3, "seed": 45, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(30\\) divides \\(31n^5 - 121n\\). Prove it first for each prime factor of \\(30\\), then combine.\n\n## What to do\n\n`Solution.lean` in the working directory states 4 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 4 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The prime 2 divides the polynomial value. -/\ntheorem dvd_by_2 (n : ℤ) :\n (2 : ℤ) ∣ 31 * n ^ 5 - 121 * n := by\n sorry\n\n/-- The prime 3 divides the polynomial value. -/\ntheorem dvd_by_3 (n : ℤ) :\n (3 : ℤ) ∣ 31 * n ^ 5 - 121 * n := by\n sorry\n\n/-- The prime 5 divides the polynomial value. -/\ntheorem dvd_by_5 (n : ℤ) :\n (5 : ℤ) ∣ 31 * n ^ 5 - 121 * n := by\n sorry\n\n/-- The product of the primes divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (30 : ℤ) ∣ 31 * n ^ 5 - 121 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d3-t0045"}
+{"id": "modular-arithmetic-gcd_coprime-d3-t0046", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 3, "seed": 46, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(n\\) be a natural number and \\(g = \\gcd(n + 7, 2n + 7)\\). Prove that \\(g\\) divides \\(7\\), and conclude that \\(g = 1\\) or \\(g = 7\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The gcd divides the determinant. -/\ntheorem gcd_dvd_det (n : ℕ) :\n Nat.gcd (n + 7) (2 * n + 7) ∣ 7 := by\n sorry\n\n/-- The gcd is 1 or the prime determinant. -/\ntheorem gcd_one_or_prime (n : ℕ) :\n Nat.gcd (n + 7) (2 * n + 7) = 1 ∨ Nat.gcd (n + 7) (2 * n + 7) = 7 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d3-t0046"}
+{"id": "modular-arithmetic-power_residues-d3-t0047", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 3, "seed": 47, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for all natural numbers \\(a\\) and \\(b\\), the number \\(a^2 + 3b^2 + 3\\) never leaves remainder \\(1\\) on division by \\(4\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The expression never leaves the stated remainder. -/\ntheorem residue_never_attained (a b : ℕ) :\n (a ^ 2 + 3 * b ^ 2 + 3) % 4 ≠ 1 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d3-t0047"}
+{"id": "modular-arithmetic-congruence_chain-d1-t0048", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 1, "seed": 48, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) be an integer with \\(x \\equiv 4 \\pmod{12}\\). Prove that \\(5x^2 + 3x + 3 \\equiv 11 \\pmod{12}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The polynomial is congruent to the stated residue. -/\ntheorem congr_poly (x : ℤ) (h : x ≡ 4 [ZMOD 12]) :\n 5 * x ^ 2 + 3 * x + 3 ≡ 11 [ZMOD 12] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d1-t0048"}
+{"id": "modular-arithmetic-divisibility-d1-t0049", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 1, "seed": 49, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(3\\) divides \\(22n^3 - 22n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The integer divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (3 : ℤ) ∣ 22 * n ^ 3 - 22 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d1-t0049"}
+{"id": "modular-arithmetic-gcd_coprime-d1-t0050", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 1, "seed": 50, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the integers \\(2n + 7\\) and \\(9n + 31\\) are coprime, in the sense that \\(u(2n + 7) + v(9n + 31) = 1\\) for some integers \\(u, v\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The two linear forms are coprime. -/\ntheorem coprime_int (n : ℤ) :\n IsCoprime (2 * n + 7) (9 * n + 31) := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d1-t0050"}
+{"id": "modular-arithmetic-power_residues-d1-t0051", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 1, "seed": 51, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the remainder of \\(n^2\\) on division by \\(7\\) is one of \\(0, 1, 2, 4\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The remainder of the expression is one of the listed values. -/\ntheorem residues_of_power (n : ℕ) :\n (n ^ 2) % 7 = 0 ∨ (n ^ 2) % 7 = 1 ∨ (n ^ 2) % 7 = 2 ∨ (n ^ 2) % 7 = 4 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d1-t0051"}
+{"id": "modular-arithmetic-congruence_chain-d2-t0052", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 2, "seed": 52, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) and \\(y\\) be integers with \\(x \\equiv 6 \\pmod{9}\\) and \\(y \\equiv 1 \\pmod{9}\\). Prove that \\(xy + 5y^2 + 3x \\equiv 2 \\pmod{9}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The expression is congruent to the stated residue. -/\ntheorem congr_poly2 (x y : ℤ) (hx : x ≡ 6 [ZMOD 9]) (hy : y ≡ 1 [ZMOD 9]) :\n (x * y) + 5 * y ^ 2 + 3 * x ≡ 2 [ZMOD 9] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d2-t0052"}
+{"id": "modular-arithmetic-divisibility-d2-t0053", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 2, "seed": 53, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(42\\) divides \\(n^7 - 127n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The integer divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (42 : ℤ) ∣ n ^ 7 - 127 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d2-t0053"}
+{"id": "modular-arithmetic-gcd_coprime-d2-t0054", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 2, "seed": 54, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the numbers \\(5n + 2\\) and \\(2n + 1\\) are coprime.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The two linear forms are coprime. -/\ntheorem coprime_nat (n : ℕ) :\n Nat.Coprime (5 * n + 2) (2 * n + 1) := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d2-t0054"}
+{"id": "modular-arithmetic-power_residues-d2-t0055", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 2, "seed": 55, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the remainder of \\(7n^4 + 3\\) on division by \\(11\\) is one of \\(0, 2, 3, 5, 9, 10\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The remainder of the expression is one of the listed values. -/\ntheorem residues_of_power (n : ℕ) :\n (7 * n ^ 4 + 3) % 11 = 0 ∨ (7 * n ^ 4 + 3) % 11 = 2 ∨ (7 * n ^ 4 + 3) % 11 = 3 ∨ (7 * n ^ 4 + 3) % 11 = 5 ∨ (7 * n ^ 4 + 3) % 11 = 9 ∨ (7 * n ^ 4 + 3) % 11 = 10 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d2-t0055"}
+{"id": "modular-arithmetic-congruence_chain-d3-t0056", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 3, "seed": 56, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) and \\(y\\) be integers with \\(x \\equiv 3 \\pmod{11}\\) and \\(y \\equiv 8 \\pmod{11}\\). Prove that \\(x^{37} \\equiv 9 \\pmod{11}\\), and then that \\(x^{37} y^{10} + 6 \\equiv 4 \\pmod{11}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- A large power of x has the stated residue. -/\ntheorem congr_pow (x : ℤ) (h : x ≡ 3 [ZMOD 11]) :\n x ^ 37 ≡ 9 [ZMOD 11] := by\n sorry\n\n/-- The combined expression has the stated residue. -/\ntheorem congr_product (x y : ℤ) (hx : x ≡ 3 [ZMOD 11]) (hy : y ≡ 8 [ZMOD 11]) :\n x ^ 37 * y ^ 10 + 6 ≡ 4 [ZMOD 11] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d3-t0056"}
+{"id": "modular-arithmetic-divisibility-d3-t0057", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 3, "seed": 57, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(42\\) divides \\(23n^7 + 61n\\). Prove it first for each prime factor of \\(42\\), then combine.\n\n## What to do\n\n`Solution.lean` in the working directory states 4 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 4 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The prime 2 divides the polynomial value. -/\ntheorem dvd_by_2 (n : ℤ) :\n (2 : ℤ) ∣ 23 * n ^ 7 + 61 * n := by\n sorry\n\n/-- The prime 3 divides the polynomial value. -/\ntheorem dvd_by_3 (n : ℤ) :\n (3 : ℤ) ∣ 23 * n ^ 7 + 61 * n := by\n sorry\n\n/-- The prime 7 divides the polynomial value. -/\ntheorem dvd_by_7 (n : ℤ) :\n (7 : ℤ) ∣ 23 * n ^ 7 + 61 * n := by\n sorry\n\n/-- The product of the primes divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (42 : ℤ) ∣ 23 * n ^ 7 + 61 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d3-t0057"}
+{"id": "modular-arithmetic-gcd_coprime-d3-t0058", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 3, "seed": 58, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(n\\) be a natural number and \\(g = \\gcd(5n + 6, 3n + 4)\\). Prove that \\(g\\) divides \\(2\\), and conclude that \\(g = 1\\) or \\(g = 2\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The gcd divides the determinant. -/\ntheorem gcd_dvd_det (n : ℕ) :\n Nat.gcd (5 * n + 6) (3 * n + 4) ∣ 2 := by\n sorry\n\n/-- The gcd is 1 or the prime determinant. -/\ntheorem gcd_one_or_prime (n : ℕ) :\n Nat.gcd (5 * n + 6) (3 * n + 4) = 1 ∨ Nat.gcd (5 * n + 6) (3 * n + 4) = 2 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d3-t0058"}
+{"id": "modular-arithmetic-power_residues-d3-t0059", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 3, "seed": 59, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for all natural numbers \\(a\\) and \\(b\\), the number \\(2a^3 + 2b^3 + 6\\) never leaves remainder \\(0\\) on division by \\(7\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The expression never leaves the stated remainder. -/\ntheorem residue_never_attained (a b : ℕ) :\n (2 * a ^ 3 + 2 * b ^ 3 + 6) % 7 ≠ 0 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d3-t0059"}
+{"id": "modular-arithmetic-congruence_chain-d1-t0060", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 1, "seed": 60, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) be an integer with \\(x \\equiv 4 \\pmod{9}\\). Prove that \\(7x^2 + x + 1 \\equiv 0 \\pmod{9}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The polynomial is congruent to the stated residue. -/\ntheorem congr_poly (x : ℤ) (h : x ≡ 4 [ZMOD 9]) :\n 7 * x ^ 2 + x + 1 ≡ 0 [ZMOD 9] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d1-t0060"}
+{"id": "modular-arithmetic-divisibility-d1-t0061", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 1, "seed": 61, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(3\\) divides \\(31n^7 - 28n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The integer divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (3 : ℤ) ∣ 31 * n ^ 7 - 28 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d1-t0061"}
+{"id": "modular-arithmetic-gcd_coprime-d1-t0062", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 1, "seed": 62, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the integers \\(n + 1\\) and \\(5n + 6\\) are coprime, in the sense that \\(u(n + 1) + v(5n + 6) = 1\\) for some integers \\(u, v\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The two linear forms are coprime. -/\ntheorem coprime_int (n : ℤ) :\n IsCoprime (n + 1) (5 * n + 6) := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d1-t0062"}
+{"id": "modular-arithmetic-power_residues-d1-t0063", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 1, "seed": 63, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the remainder of \\(n^2 + 2\\) on division by \\(9\\) is one of \\(0, 2, 3, 6\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The remainder of the expression is one of the listed values. -/\ntheorem residues_of_power (n : ℕ) :\n (n ^ 2 + 2) % 9 = 0 ∨ (n ^ 2 + 2) % 9 = 2 ∨ (n ^ 2 + 2) % 9 = 3 ∨ (n ^ 2 + 2) % 9 = 6 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d1-t0063"}
+{"id": "modular-arithmetic-congruence_chain-d2-t0064", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 2, "seed": 64, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) and \\(y\\) be integers with \\(x \\equiv 0 \\pmod{10}\\) and \\(y \\equiv 6 \\pmod{10}\\). Prove that \\(2xy + y^2 + 7x \\equiv 6 \\pmod{10}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The expression is congruent to the stated residue. -/\ntheorem congr_poly2 (x y : ℤ) (hx : x ≡ 0 [ZMOD 10]) (hy : y ≡ 6 [ZMOD 10]) :\n 2 * (x * y) + y ^ 2 + 7 * x ≡ 6 [ZMOD 10] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d2-t0064"}
+{"id": "modular-arithmetic-divisibility-d2-t0065", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 2, "seed": 65, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(42\\) divides \\(29n^7 - 71n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The integer divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (42 : ℤ) ∣ 29 * n ^ 7 - 71 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d2-t0065"}
+{"id": "modular-arithmetic-gcd_coprime-d2-t0066", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 2, "seed": 66, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the numbers \\(4n + 5\\) and \\(n + 1\\) are coprime.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The two linear forms are coprime. -/\ntheorem coprime_nat (n : ℕ) :\n Nat.Coprime (4 * n + 5) (n + 1) := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d2-t0066"}
+{"id": "modular-arithmetic-power_residues-d2-t0067", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 2, "seed": 67, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the remainder of \\(8n^3 + 3\\) on division by \\(9\\) is one of \\(2, 3, 4\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The remainder of the expression is one of the listed values. -/\ntheorem residues_of_power (n : ℕ) :\n (8 * n ^ 3 + 3) % 9 = 2 ∨ (8 * n ^ 3 + 3) % 9 = 3 ∨ (8 * n ^ 3 + 3) % 9 = 4 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d2-t0067"}
+{"id": "modular-arithmetic-congruence_chain-d3-t0068", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 3, "seed": 68, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) and \\(y\\) be integers with \\(x \\equiv 5 \\pmod{8}\\) and \\(y \\equiv 4 \\pmod{8}\\). Prove that \\(x^{28} \\equiv 1 \\pmod{8}\\), and then that \\(x^{28} y^{11} + 6 \\equiv 6 \\pmod{8}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- A large power of x has the stated residue. -/\ntheorem congr_pow (x : ℤ) (h : x ≡ 5 [ZMOD 8]) :\n x ^ 28 ≡ 1 [ZMOD 8] := by\n sorry\n\n/-- The combined expression has the stated residue. -/\ntheorem congr_product (x y : ℤ) (hx : x ≡ 5 [ZMOD 8]) (hy : y ≡ 4 [ZMOD 8]) :\n x ^ 28 * y ^ 11 + 6 ≡ 6 [ZMOD 8] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d3-t0068"}
+{"id": "modular-arithmetic-divisibility-d3-t0069", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 3, "seed": 69, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(42\\) divides \\(17n^7 + 109n\\). Prove it first for each prime factor of \\(42\\), then combine.\n\n## What to do\n\n`Solution.lean` in the working directory states 4 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 4 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The prime 2 divides the polynomial value. -/\ntheorem dvd_by_2 (n : ℤ) :\n (2 : ℤ) ∣ 17 * n ^ 7 + 109 * n := by\n sorry\n\n/-- The prime 3 divides the polynomial value. -/\ntheorem dvd_by_3 (n : ℤ) :\n (3 : ℤ) ∣ 17 * n ^ 7 + 109 * n := by\n sorry\n\n/-- The prime 7 divides the polynomial value. -/\ntheorem dvd_by_7 (n : ℤ) :\n (7 : ℤ) ∣ 17 * n ^ 7 + 109 * n := by\n sorry\n\n/-- The product of the primes divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (42 : ℤ) ∣ 17 * n ^ 7 + 109 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d3-t0069"}
+{"id": "modular-arithmetic-gcd_coprime-d3-t0070", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 3, "seed": 70, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(n\\) be a natural number and \\(g = \\gcd(3n + 9, 3n + 8)\\). Prove that \\(g\\) divides \\(3\\), and conclude that \\(g = 1\\) or \\(g = 3\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The gcd divides the determinant. -/\ntheorem gcd_dvd_det (n : ℕ) :\n Nat.gcd (3 * n + 9) (3 * n + 8) ∣ 3 := by\n sorry\n\n/-- The gcd is 1 or the prime determinant. -/\ntheorem gcd_one_or_prime (n : ℕ) :\n Nat.gcd (3 * n + 9) (3 * n + 8) = 1 ∨ Nat.gcd (3 * n + 9) (3 * n + 8) = 3 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d3-t0070"}
+{"id": "modular-arithmetic-power_residues-d3-t0071", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 3, "seed": 71, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for all natural numbers \\(a\\) and \\(b\\), the number \\(3a^2 + 2b^2 + 5\\) never leaves remainder \\(0\\) on division by \\(9\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The expression never leaves the stated remainder. -/\ntheorem residue_never_attained (a b : ℕ) :\n (3 * a ^ 2 + 2 * b ^ 2 + 5) % 9 ≠ 0 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d3-t0071"}
+{"id": "modular-arithmetic-congruence_chain-d1-t0072", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 1, "seed": 72, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) be an integer with \\(x \\equiv 4 \\pmod{7}\\). Prove that \\(3x^2 + 2x + 4 \\equiv 4 \\pmod{7}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The polynomial is congruent to the stated residue. -/\ntheorem congr_poly (x : ℤ) (h : x ≡ 4 [ZMOD 7]) :\n 3 * x ^ 2 + 2 * x + 4 ≡ 4 [ZMOD 7] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d1-t0072"}
+{"id": "modular-arithmetic-divisibility-d1-t0073", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 1, "seed": 73, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(6\\) divides \\(n^3 + 17n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The integer divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (6 : ℤ) ∣ n ^ 3 + 17 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d1-t0073"}
+{"id": "modular-arithmetic-gcd_coprime-d1-t0074", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 1, "seed": 74, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the integers \\(2n + 9\\) and \\(3n + 14\\) are coprime, in the sense that \\(u(2n + 9) + v(3n + 14) = 1\\) for some integers \\(u, v\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The two linear forms are coprime. -/\ntheorem coprime_int (n : ℤ) :\n IsCoprime (2 * n + 9) (3 * n + 14) := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d1-t0074"}
+{"id": "modular-arithmetic-power_residues-d1-t0075", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 1, "seed": 75, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the remainder of \\(2n^2\\) on division by \\(5\\) is one of \\(0, 2, 3\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The remainder of the expression is one of the listed values. -/\ntheorem residues_of_power (n : ℕ) :\n (2 * n ^ 2) % 5 = 0 ∨ (2 * n ^ 2) % 5 = 2 ∨ (2 * n ^ 2) % 5 = 3 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d1-t0075"}
+{"id": "modular-arithmetic-congruence_chain-d2-t0076", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 2, "seed": 76, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) and \\(y\\) be integers with \\(x \\equiv 0 \\pmod{13}\\) and \\(y \\equiv 9 \\pmod{13}\\). Prove that \\(5xy + 2y^2 + 2x \\equiv 6 \\pmod{13}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The expression is congruent to the stated residue. -/\ntheorem congr_poly2 (x y : ℤ) (hx : x ≡ 0 [ZMOD 13]) (hy : y ≡ 9 [ZMOD 13]) :\n 5 * (x * y) + 2 * y ^ 2 + 2 * x ≡ 6 [ZMOD 13] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d2-t0076"}
+{"id": "modular-arithmetic-divisibility-d2-t0077", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 2, "seed": 77, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(30\\) divides \\(31n^5 - 61n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The integer divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (30 : ℤ) ∣ 31 * n ^ 5 - 61 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d2-t0077"}
+{"id": "modular-arithmetic-gcd_coprime-d2-t0078", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 2, "seed": 78, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the numbers \\(2n + 5\\) and \\(3n + 7\\) are coprime.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The two linear forms are coprime. -/\ntheorem coprime_nat (n : ℕ) :\n Nat.Coprime (2 * n + 5) (3 * n + 7) := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d2-t0078"}
+{"id": "modular-arithmetic-power_residues-d2-t0079", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 2, "seed": 79, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every natural number \\(n\\), the remainder of \\(9n^4 + 5\\) on division by \\(11\\) is one of \\(3, 5, 6, 8, 9, 10\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The remainder of the expression is one of the listed values. -/\ntheorem residues_of_power (n : ℕ) :\n (9 * n ^ 4 + 5) % 11 = 3 ∨ (9 * n ^ 4 + 5) % 11 = 5 ∨ (9 * n ^ 4 + 5) % 11 = 6 ∨ (9 * n ^ 4 + 5) % 11 = 8 ∨ (9 * n ^ 4 + 5) % 11 = 9 ∨ (9 * n ^ 4 + 5) % 11 = 10 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d2-t0079"}
+{"id": "modular-arithmetic-congruence_chain-d3-t0080", "env": "modular-arithmetic", "msc": "11", "family": "congruence_chain", "difficulty": 3, "seed": 80, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(x\\) and \\(y\\) be integers with \\(x \\equiv 2 \\pmod{10}\\) and \\(y \\equiv 8 \\pmod{10}\\). Prove that \\(x^{8} \\equiv 6 \\pmod{10}\\), and then that \\(x^{8} y^{25} + 8 \\equiv 6 \\pmod{10}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- A large power of x has the stated residue. -/\ntheorem congr_pow (x : ℤ) (h : x ≡ 2 [ZMOD 10]) :\n x ^ 8 ≡ 6 [ZMOD 10] := by\n sorry\n\n/-- The combined expression has the stated residue. -/\ntheorem congr_product (x y : ℤ) (hx : x ≡ 2 [ZMOD 10]) (hy : y ≡ 8 [ZMOD 10]) :\n x ^ 8 * y ^ 25 + 8 ≡ 6 [ZMOD 10] := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-congruence_chain-d3-t0080"}
+{"id": "modular-arithmetic-divisibility-d3-t0081", "env": "modular-arithmetic", "msc": "11", "family": "divisibility", "difficulty": 3, "seed": 81, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for every integer \\(n\\), the number \\(42\\) divides \\(19n^7 - 19n\\). Prove it first for each prime factor of \\(42\\), then combine.\n\n## What to do\n\n`Solution.lean` in the working directory states 4 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 4 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The prime 2 divides the polynomial value. -/\ntheorem dvd_by_2 (n : ℤ) :\n (2 : ℤ) ∣ 19 * n ^ 7 - 19 * n := by\n sorry\n\n/-- The prime 3 divides the polynomial value. -/\ntheorem dvd_by_3 (n : ℤ) :\n (3 : ℤ) ∣ 19 * n ^ 7 - 19 * n := by\n sorry\n\n/-- The prime 7 divides the polynomial value. -/\ntheorem dvd_by_7 (n : ℤ) :\n (7 : ℤ) ∣ 19 * n ^ 7 - 19 * n := by\n sorry\n\n/-- The product of the primes divides the polynomial value. -/\ntheorem dvd_poly (n : ℤ) :\n (42 : ℤ) ∣ 19 * n ^ 7 - 19 * n := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-divisibility-d3-t0081"}
+{"id": "modular-arithmetic-gcd_coprime-d3-t0082", "env": "modular-arithmetic", "msc": "11", "family": "gcd_coprime", "difficulty": 3, "seed": 82, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nLet \\(n\\) be a natural number and \\(g = \\gcd(n + 6, n + 1)\\). Prove that \\(g\\) divides \\(5\\), and conclude that \\(g = 1\\) or \\(g = 5\\).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\n/-- The gcd divides the determinant. -/\ntheorem gcd_dvd_det (n : ℕ) :\n Nat.gcd (n + 6) (n + 1) ∣ 5 := by\n sorry\n\n/-- The gcd is 1 or the prime determinant. -/\ntheorem gcd_one_or_prime (n : ℕ) :\n Nat.gcd (n + 6) (n + 1) = 1 ∨ Nat.gcd (n + 6) (n + 1) = 5 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-gcd_coprime-d3-t0082"}
+{"id": "modular-arithmetic-power_residues-d3-t0083", "env": "modular-arithmetic", "msc": "11", "family": "power_residues", "difficulty": 3, "seed": 83, "kind": "prove", "instruction": "# Prove a fact about divisibility and residues\n\nProve that for all natural numbers \\(a\\) and \\(b\\), the number \\(2a^2 + 2b^2 + 2\\) never leaves remainder \\(5\\) on division by \\(9\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The expression never leaves the stated remainder. -/\ntheorem residue_never_attained (a b : ℕ) :\n (2 * a ^ 2 + 2 * b ^ 2 + 2) % 9 ≠ 5 := by\n sorry\n", "path": "tasks/modular-arithmetic/modular-arithmetic-power_residues-d3-t0083"}
diff --git a/data/real-analysis/eval.jsonl b/data/real-analysis/eval.jsonl
new file mode 100644
index 0000000000000000000000000000000000000000..91b86daab1f1b7a18ae576516875b7797c7b790d
--- /dev/null
+++ b/data/real-analysis/eval.jsonl
@@ -0,0 +1,24 @@
+{"id": "real-analysis-continuity-d1-e0000", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 1, "seed": 10000, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = -4x + 3\\) is continuous at \\(x_0 = 0\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of a linear function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (0 : ℝ)| < δ → |((-4 : ℝ) * x + (3 : ℝ)) - ((-4 : ℝ) * (0 : ℝ) + (3 : ℝ))| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d1-e0000"}
+{"id": "real-analysis-limit_sequence-d1-e0001", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 1, "seed": 10001, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that the sequence \\(u_n = \\dfrac{4}{n + 3}\\) tends to \\(0\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|u_n - 0| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence tends to 0 (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |(4 : ℝ) / ((n : ℝ) + (3 : ℝ)) - 0| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d1-e0001"}
+{"id": "real-analysis-sequence_bounds-d1-e0002", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 1, "seed": 10002, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = \\frac{8}{3}\\) and \\(a_{n+1} = \\frac{a_n}{2} + \\frac{4}{3}\\). Prove that \\(0 \\le a_n \\le \\frac{8}{3}\\) for every \\(n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (8 / 3 : ℝ)\n | (n + 1) => a n / 2 + (4 / 3 : ℝ)\n\n/-- The sequence stays between 0 and its upper bound. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (8 / 3 : ℝ) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d1-e0002"}
+{"id": "real-analysis-uniform_bounds-d1-e0003", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 1, "seed": 10003, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that for every natural number \\(n\\) and every real \\(x\\) with \\(-\\frac{4}{5} \\le x \\le \\frac{4}{5}\\), \\[|3\\,x^{n+1}| \\le 3 \\cdot \\frac{4}{5}^{n+1}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A bound that does not depend on the point x. -/\ntheorem uniform_bound :\n ∀ n : ℕ, ∀ x ∈ Set.Icc (-(4 / 5 : ℝ)) (4 / 5 : ℝ), |3 * x ^ (n + 1)| ≤ 3 * (4 / 5 : ℝ) ^ (n + 1) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d1-e0003"}
+{"id": "real-analysis-continuity-d2-e0004", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 2, "seed": 10004, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = x^2 + 5\\) is continuous at \\(x_0 = -4\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\). Do not use any continuity lemma from the library.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of a quadratic function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (-4 : ℝ)| < δ → |((1 : ℝ) * x ^ 2 + (5 : ℝ)) - ((1 : ℝ) * (-4 : ℝ) ^ 2 + (5 : ℝ))| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d2-e0004"}
+{"id": "real-analysis-limit_sequence-d2-e0005", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 2, "seed": 10005, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that \\(u_n = \\dfrac{2n + 8}{2n + 3}\\) tends to \\(\\dfrac{2}{2}\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(\\left|u_n - \\frac{2}{2}\\right| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence converges to a/c (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |((2 : ℝ) * (n : ℝ) + (8 : ℝ)) / ((2 : ℝ) * (n : ℝ) + (3 : ℝ)) - (2 : ℝ) / (2 : ℝ)| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d2-e0005"}
+{"id": "real-analysis-sequence_bounds-d2-e0006", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 2, "seed": 10006, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = \\frac{5}{2}\\) and \\(a_{n+1} = \\frac{a_n}{2} + \\frac{5}{2}\\). Prove that \\(0 \\le a_n \\le 5\\) for every \\(n\\), and then that the sequence is monotone (non-decreasing).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (5 / 2 : ℝ)\n | (n + 1) => a n / 2 + (5 / 2 : ℝ)\n\n/-- The sequence stays between 0 and its upper bound. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (5 : ℝ) := by\n sorry\n\n/-- The sequence is increasing. -/\ntheorem a_monotone :\n Monotone a := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d2-e0006"}
+{"id": "real-analysis-uniform_bounds-d2-e0007", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 2, "seed": 10007, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that for every natural number \\(n\\) and every real \\(x\\) with \\(0 \\le x \\le \\frac{1}{4}\\), \\[\\sum_{i=0}^{n-1} x^{i} \\le \\frac{1}{1 - \\frac{1}{4}}.\\] The sum is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A bound on partial geometric sums that does not depend on n or x. -/\ntheorem uniform_bound :\n ∀ n : ℕ, ∀ x ∈ Set.Icc (0 : ℝ) (1 / 4 : ℝ), ∑ i ∈ Finset.range n, x ^ i ≤ 1 / (1 - (1 / 4 : ℝ)) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d2-e0007"}
+{"id": "real-analysis-continuity-d3-e0008", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 3, "seed": 10008, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = \\dfrac{2}{x}\\) is continuous at \\(x_0 = 5\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\). Here \\(x\\) ranges over all real numbers (in Lean, division by 0 gives 0, which does not matter for small \\(\\delta\\)).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of the reciprocal function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (5 : ℝ)| < δ → |(2 : ℝ) / x - (2 : ℝ) / (5 : ℝ)| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d3-e0008"}
+{"id": "real-analysis-limit_sequence-d3-e0009", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 3, "seed": 10009, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that \\(u_n = \\dfrac{6n + 4}{n^2 + 6}\\) tends to \\(0\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|u_n - 0| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence tends to 0 (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |((6 : ℝ) * (n : ℝ) + (4 : ℝ)) / ((n : ℝ) ^ 2 + (6 : ℝ)) - 0| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d3-e0009"}
+{"id": "real-analysis-sequence_bounds-d3-e0010", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 3, "seed": 10010, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = \\frac{2}{5}\\) and \\(a_{n+1} = \\dfrac{a_n^2 + \\frac{16}{25}}{2}\\). Prove that \\(0 \\le a_n \\le \\frac{2}{5}\\) for every \\(n\\) (note that \\(\\frac{2}{5}\\) is a fixed point of the recursion), and then that the sequence is monotone (non-decreasing).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (2 / 5 : ℝ)\n | (n + 1) => (a n ^ 2 + (16 / 25 : ℝ)) / 2\n\n/-- The sequence stays between 0 and the smaller fixed point. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (2 / 5 : ℝ) := by\n sorry\n\n/-- The sequence is increasing. -/\ntheorem a_monotone :\n Monotone a := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d3-e0010"}
+{"id": "real-analysis-uniform_bounds-d3-e0011", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 3, "seed": 10011, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that \\(c\\,x^n\\) with \\(c = 5\\) tends to \\(0\\) uniformly on \\([-\\frac{1}{4}, \\frac{1}{4}]\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|5\\,x^n| < \\varepsilon\\) for all \\(n \\ge N\\) and all real \\(x\\) with \\(|x| \\le \\frac{1}{4}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Uniform convergence of a geometric sequence on an interval. -/\ntheorem uniform_convergence :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, ∀ x : ℝ, |x| ≤ (1 / 4 : ℝ) → |5 * x ^ n| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d3-e0011"}
+{"id": "real-analysis-continuity-d1-e0012", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 1, "seed": 10012, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = -6x - 1\\) is continuous at \\(x_0 = -3\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of a linear function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (-3 : ℝ)| < δ → |((-6 : ℝ) * x + (-1 : ℝ)) - ((-6 : ℝ) * (-3 : ℝ) + (-1 : ℝ))| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d1-e0012"}
+{"id": "real-analysis-limit_sequence-d1-e0013", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 1, "seed": 10013, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that the sequence \\(u_n = \\dfrac{4}{n + 9}\\) tends to \\(0\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|u_n - 0| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence tends to 0 (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |(4 : ℝ) / ((n : ℝ) + (9 : ℝ)) - 0| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d1-e0013"}
+{"id": "real-analysis-sequence_bounds-d1-e0014", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 1, "seed": 10014, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = \\frac{7}{2}\\) and \\(a_{n+1} = \\frac{a_n}{2} + \\frac{7}{2}\\). Prove that \\(0 \\le a_n \\le 7\\) for every \\(n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (7 / 2 : ℝ)\n | (n + 1) => a n / 2 + (7 / 2 : ℝ)\n\n/-- The sequence stays between 0 and its upper bound. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (7 : ℝ) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d1-e0014"}
+{"id": "real-analysis-uniform_bounds-d1-e0015", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 1, "seed": 10015, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that for every natural number \\(n\\) and every real \\(x\\) with \\(-\\frac{4}{5} \\le x \\le \\frac{4}{5}\\), \\[|7\\,x^{n+1}| \\le 7 \\cdot \\frac{4}{5}^{n+1}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A bound that does not depend on the point x. -/\ntheorem uniform_bound :\n ∀ n : ℕ, ∀ x ∈ Set.Icc (-(4 / 5 : ℝ)) (4 / 5 : ℝ), |7 * x ^ (n + 1)| ≤ 7 * (4 / 5 : ℝ) ^ (n + 1) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d1-e0015"}
+{"id": "real-analysis-continuity-d2-e0016", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 2, "seed": 10016, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = 2x^2 + 4\\) is continuous at \\(x_0 = 4\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\). Do not use any continuity lemma from the library.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of a quadratic function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (4 : ℝ)| < δ → |((2 : ℝ) * x ^ 2 + (4 : ℝ)) - ((2 : ℝ) * (4 : ℝ) ^ 2 + (4 : ℝ))| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d2-e0016"}
+{"id": "real-analysis-limit_sequence-d2-e0017", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 2, "seed": 10017, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that \\(u_n = \\dfrac{-3n + 4}{2n + 5}\\) tends to \\(\\dfrac{-3}{2}\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(\\left|u_n - \\frac{-3}{2}\\right| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence converges to a/c (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |((-3 : ℝ) * (n : ℝ) + (4 : ℝ)) / ((2 : ℝ) * (n : ℝ) + (5 : ℝ)) - (-3 : ℝ) / (2 : ℝ)| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d2-e0017"}
+{"id": "real-analysis-sequence_bounds-d2-e0018", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 2, "seed": 10018, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = 9\\) and \\(a_{n+1} = \\frac{a_n}{2} + 6\\). Prove that \\(0 \\le a_n \\le 12\\) for every \\(n\\), and then that the sequence is monotone (non-decreasing).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (9 : ℝ)\n | (n + 1) => a n / 2 + (6 : ℝ)\n\n/-- The sequence stays between 0 and its upper bound. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (12 : ℝ) := by\n sorry\n\n/-- The sequence is increasing. -/\ntheorem a_monotone :\n Monotone a := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d2-e0018"}
+{"id": "real-analysis-uniform_bounds-d2-e0019", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 2, "seed": 10019, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that for every natural number \\(n\\) and every real \\(x\\) with \\(0 \\le x \\le \\frac{1}{2}\\), \\[\\sum_{i=0}^{n-1} x^{i} \\le \\frac{1}{1 - \\frac{1}{2}}.\\] The sum is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A bound on partial geometric sums that does not depend on n or x. -/\ntheorem uniform_bound :\n ∀ n : ℕ, ∀ x ∈ Set.Icc (0 : ℝ) (1 / 2 : ℝ), ∑ i ∈ Finset.range n, x ^ i ≤ 1 / (1 - (1 / 2 : ℝ)) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d2-e0019"}
+{"id": "real-analysis-continuity-d3-e0020", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 3, "seed": 10020, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = \\dfrac{3}{x}\\) is continuous at \\(x_0 = 5\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\). Here \\(x\\) ranges over all real numbers (in Lean, division by 0 gives 0, which does not matter for small \\(\\delta\\)).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of the reciprocal function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (5 : ℝ)| < δ → |(3 : ℝ) / x - (3 : ℝ) / (5 : ℝ)| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d3-e0020"}
+{"id": "real-analysis-limit_sequence-d3-e0021", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 3, "seed": 10021, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that \\(u_n = \\dfrac{n + 1}{n^2 + 1}\\) tends to \\(0\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|u_n - 0| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence tends to 0 (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |((1 : ℝ) * (n : ℝ) + (1 : ℝ)) / ((n : ℝ) ^ 2 + (1 : ℝ)) - 0| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d3-e0021"}
+{"id": "real-analysis-sequence_bounds-d3-e0022", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 3, "seed": 10022, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = \\frac{1}{2}\\) and \\(a_{n+1} = \\dfrac{a_n^2 + \\frac{8}{9}}{2}\\). Prove that \\(0 \\le a_n \\le \\frac{2}{3}\\) for every \\(n\\) (note that \\(\\frac{2}{3}\\) is a fixed point of the recursion), and then that the sequence is monotone (non-decreasing).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (1 / 2 : ℝ)\n | (n + 1) => (a n ^ 2 + (8 / 9 : ℝ)) / 2\n\n/-- The sequence stays between 0 and the smaller fixed point. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (2 / 3 : ℝ) := by\n sorry\n\n/-- The sequence is increasing. -/\ntheorem a_monotone :\n Monotone a := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d3-e0022"}
+{"id": "real-analysis-uniform_bounds-d3-e0023", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 3, "seed": 10023, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that \\(c\\,x^n\\) with \\(c = 4\\) tends to \\(0\\) uniformly on \\([-\\frac{1}{3}, \\frac{1}{3}]\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|4\\,x^n| < \\varepsilon\\) for all \\(n \\ge N\\) and all real \\(x\\) with \\(|x| \\le \\frac{1}{3}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Uniform convergence of a geometric sequence on an interval. -/\ntheorem uniform_convergence :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, ∀ x : ℝ, |x| ≤ (1 / 3 : ℝ) → |4 * x ^ n| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d3-e0023"}
diff --git a/data/real-analysis/train.jsonl b/data/real-analysis/train.jsonl
new file mode 100644
index 0000000000000000000000000000000000000000..ad4f118cbdc77e224bcc7a7f541fd911082221bf
--- /dev/null
+++ b/data/real-analysis/train.jsonl
@@ -0,0 +1,84 @@
+{"id": "real-analysis-continuity-d1-t0000", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 1, "seed": 0, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = 7x - 5\\) is continuous at \\(x_0 = -2\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of a linear function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (-2 : ℝ)| < δ → |((7 : ℝ) * x + (-5 : ℝ)) - ((7 : ℝ) * (-2 : ℝ) + (-5 : ℝ))| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d1-t0000"}
+{"id": "real-analysis-limit_sequence-d1-t0001", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 1, "seed": 1, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that the sequence \\(u_n = \\dfrac{7}{n + 8}\\) tends to \\(0\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|u_n - 0| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence tends to 0 (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |(7 : ℝ) / ((n : ℝ) + (8 : ℝ)) - 0| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d1-t0001"}
+{"id": "real-analysis-sequence_bounds-d1-t0002", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 1, "seed": 2, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = \\frac{3}{2}\\) and \\(a_{n+1} = \\frac{a_n}{2} + 1\\). Prove that \\(0 \\le a_n \\le 2\\) for every \\(n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (3 / 2 : ℝ)\n | (n + 1) => a n / 2 + (1 : ℝ)\n\n/-- The sequence stays between 0 and its upper bound. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (2 : ℝ) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d1-t0002"}
+{"id": "real-analysis-uniform_bounds-d1-t0003", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 1, "seed": 3, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that for every natural number \\(n\\) and every real \\(x\\) with \\(-\\frac{2}{3} \\le x \\le \\frac{2}{3}\\), \\[|8\\,x^{n+1}| \\le 8 \\cdot \\frac{2}{3}^{n+1}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A bound that does not depend on the point x. -/\ntheorem uniform_bound :\n ∀ n : ℕ, ∀ x ∈ Set.Icc (-(2 / 3 : ℝ)) (2 / 3 : ℝ), |8 * x ^ (n + 1)| ≤ 8 * (2 / 3 : ℝ) ^ (n + 1) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d1-t0003"}
+{"id": "real-analysis-continuity-d2-t0004", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 2, "seed": 4, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = 2x^2 - 2\\) is continuous at \\(x_0 = 2\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\). Do not use any continuity lemma from the library.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of a quadratic function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (2 : ℝ)| < δ → |((2 : ℝ) * x ^ 2 + (-2 : ℝ)) - ((2 : ℝ) * (2 : ℝ) ^ 2 + (-2 : ℝ))| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d2-t0004"}
+{"id": "real-analysis-limit_sequence-d2-t0005", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 2, "seed": 5, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that \\(u_n = \\dfrac{-5n + 2}{2n + 9}\\) tends to \\(\\dfrac{-5}{2}\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(\\left|u_n - \\frac{-5}{2}\\right| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence converges to a/c (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |((-5 : ℝ) * (n : ℝ) + (2 : ℝ)) / ((2 : ℝ) * (n : ℝ) + (9 : ℝ)) - (-5 : ℝ) / (2 : ℝ)| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d2-t0005"}
+{"id": "real-analysis-sequence_bounds-d2-t0006", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 2, "seed": 6, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = \\frac{21}{4}\\) and \\(a_{n+1} = \\frac{a_n}{2} + \\frac{7}{2}\\). Prove that \\(0 \\le a_n \\le 7\\) for every \\(n\\), and then that the sequence is monotone (non-decreasing).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (21 / 4 : ℝ)\n | (n + 1) => a n / 2 + (7 / 2 : ℝ)\n\n/-- The sequence stays between 0 and its upper bound. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (7 : ℝ) := by\n sorry\n\n/-- The sequence is increasing. -/\ntheorem a_monotone :\n Monotone a := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d2-t0006"}
+{"id": "real-analysis-uniform_bounds-d2-t0007", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 2, "seed": 7, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that for every natural number \\(n\\) and every real \\(x\\) with \\(0 \\le x \\le \\frac{1}{2}\\), \\[\\sum_{i=0}^{n-1} x^{i} \\le \\frac{1}{1 - \\frac{1}{2}}.\\] The sum is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A bound on partial geometric sums that does not depend on n or x. -/\ntheorem uniform_bound :\n ∀ n : ℕ, ∀ x ∈ Set.Icc (0 : ℝ) (1 / 2 : ℝ), ∑ i ∈ Finset.range n, x ^ i ≤ 1 / (1 - (1 / 2 : ℝ)) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d2-t0007"}
+{"id": "real-analysis-continuity-d3-t0008", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 3, "seed": 8, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = \\dfrac{3}{x}\\) is continuous at \\(x_0 = 1\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\). Here \\(x\\) ranges over all real numbers (in Lean, division by 0 gives 0, which does not matter for small \\(\\delta\\)).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of the reciprocal function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (1 : ℝ)| < δ → |(3 : ℝ) / x - (3 : ℝ) / (1 : ℝ)| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d3-t0008"}
+{"id": "real-analysis-limit_sequence-d3-t0009", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 3, "seed": 9, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that \\(u_n = \\dfrac{5n + 5}{n^2 + 5}\\) tends to \\(0\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|u_n - 0| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence tends to 0 (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |((5 : ℝ) * (n : ℝ) + (5 : ℝ)) / ((n : ℝ) ^ 2 + (5 : ℝ)) - 0| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d3-t0009"}
+{"id": "real-analysis-sequence_bounds-d3-t0010", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 3, "seed": 10, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = \\frac{2}{5}\\) and \\(a_{n+1} = \\dfrac{a_n^2 + \\frac{24}{25}}{2}\\). Prove that \\(0 \\le a_n \\le \\frac{4}{5}\\) for every \\(n\\) (note that \\(\\frac{4}{5}\\) is a fixed point of the recursion), and then that the sequence is monotone (non-decreasing).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (2 / 5 : ℝ)\n | (n + 1) => (a n ^ 2 + (24 / 25 : ℝ)) / 2\n\n/-- The sequence stays between 0 and the smaller fixed point. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (4 / 5 : ℝ) := by\n sorry\n\n/-- The sequence is increasing. -/\ntheorem a_monotone :\n Monotone a := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d3-t0010"}
+{"id": "real-analysis-uniform_bounds-d3-t0011", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 3, "seed": 11, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that \\(c\\,x^n\\) with \\(c = 1\\) tends to \\(0\\) uniformly on \\([-\\frac{1}{3}, \\frac{1}{3}]\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|1\\,x^n| < \\varepsilon\\) for all \\(n \\ge N\\) and all real \\(x\\) with \\(|x| \\le \\frac{1}{3}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Uniform convergence of a geometric sequence on an interval. -/\ntheorem uniform_convergence :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, ∀ x : ℝ, |x| ≤ (1 / 3 : ℝ) → |1 * x ^ n| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d3-t0011"}
+{"id": "real-analysis-continuity-d1-t0012", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 1, "seed": 12, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = -x + 5\\) is continuous at \\(x_0 = 0\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of a linear function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (0 : ℝ)| < δ → |((-1 : ℝ) * x + (5 : ℝ)) - ((-1 : ℝ) * (0 : ℝ) + (5 : ℝ))| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d1-t0012"}
+{"id": "real-analysis-limit_sequence-d1-t0013", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 1, "seed": 13, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that the sequence \\(u_n = \\dfrac{4}{n + 2}\\) tends to \\(0\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|u_n - 0| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence tends to 0 (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |(4 : ℝ) / ((n : ℝ) + (2 : ℝ)) - 0| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d1-t0013"}
+{"id": "real-analysis-sequence_bounds-d1-t0014", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 1, "seed": 14, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = 0\\) and \\(a_{n+1} = \\frac{a_n}{2} + \\frac{5}{2}\\). Prove that \\(0 \\le a_n \\le 5\\) for every \\(n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (0 : ℝ)\n | (n + 1) => a n / 2 + (5 / 2 : ℝ)\n\n/-- The sequence stays between 0 and its upper bound. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (5 : ℝ) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d1-t0014"}
+{"id": "real-analysis-uniform_bounds-d1-t0015", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 1, "seed": 15, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that for every natural number \\(n\\) and every real \\(x\\) with \\(-\\frac{2}{5} \\le x \\le \\frac{2}{5}\\), \\[|3\\,x^{n+1}| \\le 3 \\cdot \\frac{2}{5}^{n+1}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A bound that does not depend on the point x. -/\ntheorem uniform_bound :\n ∀ n : ℕ, ∀ x ∈ Set.Icc (-(2 / 5 : ℝ)) (2 / 5 : ℝ), |3 * x ^ (n + 1)| ≤ 3 * (2 / 5 : ℝ) ^ (n + 1) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d1-t0015"}
+{"id": "real-analysis-continuity-d2-t0016", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 2, "seed": 16, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = -3x^2 + 2\\) is continuous at \\(x_0 = 3\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\). Do not use any continuity lemma from the library.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of a quadratic function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (3 : ℝ)| < δ → |((-3 : ℝ) * x ^ 2 + (2 : ℝ)) - ((-3 : ℝ) * (3 : ℝ) ^ 2 + (2 : ℝ))| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d2-t0016"}
+{"id": "real-analysis-limit_sequence-d2-t0017", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 2, "seed": 17, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that \\(u_n = \\dfrac{3n + 2}{n + 7}\\) tends to \\(\\dfrac{3}{1}\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(\\left|u_n - \\frac{3}{1}\\right| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence converges to a/c (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |((3 : ℝ) * (n : ℝ) + (2 : ℝ)) / ((1 : ℝ) * (n : ℝ) + (7 : ℝ)) - (3 : ℝ) / (1 : ℝ)| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d2-t0017"}
+{"id": "real-analysis-sequence_bounds-d2-t0018", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 2, "seed": 18, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = \\frac{3}{2}\\) and \\(a_{n+1} = \\frac{a_n}{2} + 3\\). Prove that \\(0 \\le a_n \\le 6\\) for every \\(n\\), and then that the sequence is monotone (non-decreasing).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (3 / 2 : ℝ)\n | (n + 1) => a n / 2 + (3 : ℝ)\n\n/-- The sequence stays between 0 and its upper bound. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (6 : ℝ) := by\n sorry\n\n/-- The sequence is increasing. -/\ntheorem a_monotone :\n Monotone a := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d2-t0018"}
+{"id": "real-analysis-uniform_bounds-d2-t0019", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 2, "seed": 19, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that for every natural number \\(n\\) and every real \\(x\\) with \\(0 \\le x \\le \\frac{1}{4}\\), \\[\\sum_{i=0}^{n-1} x^{i} \\le \\frac{1}{1 - \\frac{1}{4}}.\\] The sum is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A bound on partial geometric sums that does not depend on n or x. -/\ntheorem uniform_bound :\n ∀ n : ℕ, ∀ x ∈ Set.Icc (0 : ℝ) (1 / 4 : ℝ), ∑ i ∈ Finset.range n, x ^ i ≤ 1 / (1 - (1 / 4 : ℝ)) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d2-t0019"}
+{"id": "real-analysis-continuity-d3-t0020", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 3, "seed": 20, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = \\dfrac{6}{x}\\) is continuous at \\(x_0 = 4\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\). Here \\(x\\) ranges over all real numbers (in Lean, division by 0 gives 0, which does not matter for small \\(\\delta\\)).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of the reciprocal function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (4 : ℝ)| < δ → |(6 : ℝ) / x - (6 : ℝ) / (4 : ℝ)| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d3-t0020"}
+{"id": "real-analysis-limit_sequence-d3-t0021", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 3, "seed": 21, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that \\(u_n = \\dfrac{3n + 2}{n^2 + 5}\\) tends to \\(0\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|u_n - 0| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence tends to 0 (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |((3 : ℝ) * (n : ℝ) + (2 : ℝ)) / ((n : ℝ) ^ 2 + (5 : ℝ)) - 0| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d3-t0021"}
+{"id": "real-analysis-sequence_bounds-d3-t0022", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 3, "seed": 22, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = \\frac{2}{15}\\) and \\(a_{n+1} = \\dfrac{a_n^2 + \\frac{16}{25}}{2}\\). Prove that \\(0 \\le a_n \\le \\frac{2}{5}\\) for every \\(n\\) (note that \\(\\frac{2}{5}\\) is a fixed point of the recursion), and then that the sequence is monotone (non-decreasing).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (2 / 15 : ℝ)\n | (n + 1) => (a n ^ 2 + (16 / 25 : ℝ)) / 2\n\n/-- The sequence stays between 0 and the smaller fixed point. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (2 / 5 : ℝ) := by\n sorry\n\n/-- The sequence is increasing. -/\ntheorem a_monotone :\n Monotone a := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d3-t0022"}
+{"id": "real-analysis-uniform_bounds-d3-t0023", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 3, "seed": 23, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that \\(c\\,x^n\\) with \\(c = 2\\) tends to \\(0\\) uniformly on \\([-\\frac{1}{2}, \\frac{1}{2}]\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|2\\,x^n| < \\varepsilon\\) for all \\(n \\ge N\\) and all real \\(x\\) with \\(|x| \\le \\frac{1}{2}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Uniform convergence of a geometric sequence on an interval. -/\ntheorem uniform_convergence :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, ∀ x : ℝ, |x| ≤ (1 / 2 : ℝ) → |2 * x ^ n| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d3-t0023"}
+{"id": "real-analysis-continuity-d1-t0024", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 1, "seed": 24, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = 7x - 1\\) is continuous at \\(x_0 = -4\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of a linear function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (-4 : ℝ)| < δ → |((7 : ℝ) * x + (-1 : ℝ)) - ((7 : ℝ) * (-4 : ℝ) + (-1 : ℝ))| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d1-t0024"}
+{"id": "real-analysis-limit_sequence-d1-t0025", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 1, "seed": 25, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that the sequence \\(u_n = \\dfrac{6}{n + 4}\\) tends to \\(0\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|u_n - 0| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence tends to 0 (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |(6 : ℝ) / ((n : ℝ) + (4 : ℝ)) - 0| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d1-t0025"}
+{"id": "real-analysis-sequence_bounds-d1-t0026", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 1, "seed": 26, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = 3\\) and \\(a_{n+1} = \\frac{a_n}{2} + 3\\). Prove that \\(0 \\le a_n \\le 6\\) for every \\(n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (3 : ℝ)\n | (n + 1) => a n / 2 + (3 : ℝ)\n\n/-- The sequence stays between 0 and its upper bound. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (6 : ℝ) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d1-t0026"}
+{"id": "real-analysis-uniform_bounds-d1-t0027", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 1, "seed": 27, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that for every natural number \\(n\\) and every real \\(x\\) with \\(-\\frac{2}{3} \\le x \\le \\frac{2}{3}\\), \\[|9\\,x^{n+1}| \\le 9 \\cdot \\frac{2}{3}^{n+1}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A bound that does not depend on the point x. -/\ntheorem uniform_bound :\n ∀ n : ℕ, ∀ x ∈ Set.Icc (-(2 / 3 : ℝ)) (2 / 3 : ℝ), |9 * x ^ (n + 1)| ≤ 9 * (2 / 3 : ℝ) ^ (n + 1) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d1-t0027"}
+{"id": "real-analysis-continuity-d2-t0028", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 2, "seed": 28, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = 6x^2 + 4\\) is continuous at \\(x_0 = 2\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\). Do not use any continuity lemma from the library.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of a quadratic function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (2 : ℝ)| < δ → |((6 : ℝ) * x ^ 2 + (4 : ℝ)) - ((6 : ℝ) * (2 : ℝ) ^ 2 + (4 : ℝ))| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d2-t0028"}
+{"id": "real-analysis-limit_sequence-d2-t0029", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 2, "seed": 29, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that \\(u_n = \\dfrac{4n + 9}{4n + 2}\\) tends to \\(\\dfrac{4}{4}\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(\\left|u_n - \\frac{4}{4}\\right| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence converges to a/c (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |((4 : ℝ) * (n : ℝ) + (9 : ℝ)) / ((4 : ℝ) * (n : ℝ) + (2 : ℝ)) - (4 : ℝ) / (4 : ℝ)| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d2-t0029"}
+{"id": "real-analysis-sequence_bounds-d2-t0030", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 2, "seed": 30, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = \\frac{5}{2}\\) and \\(a_{n+1} = \\frac{a_n}{2} + \\frac{5}{3}\\). Prove that \\(0 \\le a_n \\le \\frac{10}{3}\\) for every \\(n\\), and then that the sequence is monotone (non-decreasing).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (5 / 2 : ℝ)\n | (n + 1) => a n / 2 + (5 / 3 : ℝ)\n\n/-- The sequence stays between 0 and its upper bound. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (10 / 3 : ℝ) := by\n sorry\n\n/-- The sequence is increasing. -/\ntheorem a_monotone :\n Monotone a := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d2-t0030"}
+{"id": "real-analysis-uniform_bounds-d2-t0031", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 2, "seed": 31, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that for every natural number \\(n\\) and every real \\(x\\) with \\(0 \\le x \\le \\frac{2}{5}\\), \\[\\sum_{i=0}^{n-1} x^{i} \\le \\frac{1}{1 - \\frac{2}{5}}.\\] The sum is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A bound on partial geometric sums that does not depend on n or x. -/\ntheorem uniform_bound :\n ∀ n : ℕ, ∀ x ∈ Set.Icc (0 : ℝ) (2 / 5 : ℝ), ∑ i ∈ Finset.range n, x ^ i ≤ 1 / (1 - (2 / 5 : ℝ)) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d2-t0031"}
+{"id": "real-analysis-continuity-d3-t0032", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 3, "seed": 32, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = \\dfrac{3}{x}\\) is continuous at \\(x_0 = 2\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\). Here \\(x\\) ranges over all real numbers (in Lean, division by 0 gives 0, which does not matter for small \\(\\delta\\)).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of the reciprocal function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (2 : ℝ)| < δ → |(3 : ℝ) / x - (3 : ℝ) / (2 : ℝ)| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d3-t0032"}
+{"id": "real-analysis-limit_sequence-d3-t0033", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 3, "seed": 33, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that \\(u_n = \\dfrac{2n + 2}{n^2 + 6}\\) tends to \\(0\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|u_n - 0| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence tends to 0 (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |((2 : ℝ) * (n : ℝ) + (2 : ℝ)) / ((n : ℝ) ^ 2 + (6 : ℝ)) - 0| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d3-t0033"}
+{"id": "real-analysis-sequence_bounds-d3-t0034", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 3, "seed": 34, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = \\frac{1}{8}\\) and \\(a_{n+1} = \\dfrac{a_n^2 + \\frac{7}{16}}{2}\\). Prove that \\(0 \\le a_n \\le \\frac{1}{4}\\) for every \\(n\\) (note that \\(\\frac{1}{4}\\) is a fixed point of the recursion), and then that the sequence is monotone (non-decreasing).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (1 / 8 : ℝ)\n | (n + 1) => (a n ^ 2 + (7 / 16 : ℝ)) / 2\n\n/-- The sequence stays between 0 and the smaller fixed point. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (1 / 4 : ℝ) := by\n sorry\n\n/-- The sequence is increasing. -/\ntheorem a_monotone :\n Monotone a := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d3-t0034"}
+{"id": "real-analysis-uniform_bounds-d3-t0035", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 3, "seed": 35, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that \\(c\\,x^n\\) with \\(c = 8\\) tends to \\(0\\) uniformly on \\([-\\frac{4}{5}, \\frac{4}{5}]\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|8\\,x^n| < \\varepsilon\\) for all \\(n \\ge N\\) and all real \\(x\\) with \\(|x| \\le \\frac{4}{5}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Uniform convergence of a geometric sequence on an interval. -/\ntheorem uniform_convergence :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, ∀ x : ℝ, |x| ≤ (4 / 5 : ℝ) → |8 * x ^ n| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d3-t0035"}
+{"id": "real-analysis-continuity-d1-t0036", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 1, "seed": 36, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = -5x - 2\\) is continuous at \\(x_0 = 3\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of a linear function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (3 : ℝ)| < δ → |((-5 : ℝ) * x + (-2 : ℝ)) - ((-5 : ℝ) * (3 : ℝ) + (-2 : ℝ))| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d1-t0036"}
+{"id": "real-analysis-limit_sequence-d1-t0037", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 1, "seed": 37, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that the sequence \\(u_n = \\dfrac{3}{n + 2}\\) tends to \\(0\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|u_n - 0| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence tends to 0 (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |(3 : ℝ) / ((n : ℝ) + (2 : ℝ)) - 0| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d1-t0037"}
+{"id": "real-analysis-sequence_bounds-d1-t0038", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 1, "seed": 38, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = \\frac{1}{6}\\) and \\(a_{n+1} = \\frac{a_n}{2} + \\frac{1}{3}\\). Prove that \\(0 \\le a_n \\le \\frac{2}{3}\\) for every \\(n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (1 / 6 : ℝ)\n | (n + 1) => a n / 2 + (1 / 3 : ℝ)\n\n/-- The sequence stays between 0 and its upper bound. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (2 / 3 : ℝ) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d1-t0038"}
+{"id": "real-analysis-uniform_bounds-d1-t0039", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 1, "seed": 39, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that for every natural number \\(n\\) and every real \\(x\\) with \\(-\\frac{3}{5} \\le x \\le \\frac{3}{5}\\), \\[|3\\,x^{n+1}| \\le 3 \\cdot \\frac{3}{5}^{n+1}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A bound that does not depend on the point x. -/\ntheorem uniform_bound :\n ∀ n : ℕ, ∀ x ∈ Set.Icc (-(3 / 5 : ℝ)) (3 / 5 : ℝ), |3 * x ^ (n + 1)| ≤ 3 * (3 / 5 : ℝ) ^ (n + 1) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d1-t0039"}
+{"id": "real-analysis-continuity-d2-t0040", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 2, "seed": 40, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = -4x^2 + 3\\) is continuous at \\(x_0 = 0\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\). Do not use any continuity lemma from the library.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of a quadratic function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (0 : ℝ)| < δ → |((-4 : ℝ) * x ^ 2 + (3 : ℝ)) - ((-4 : ℝ) * (0 : ℝ) ^ 2 + (3 : ℝ))| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d2-t0040"}
+{"id": "real-analysis-limit_sequence-d2-t0041", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 2, "seed": 41, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that \\(u_n = \\dfrac{-3n + 3}{4n + 7}\\) tends to \\(\\dfrac{-3}{4}\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(\\left|u_n - \\frac{-3}{4}\\right| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence converges to a/c (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |((-3 : ℝ) * (n : ℝ) + (3 : ℝ)) / ((4 : ℝ) * (n : ℝ) + (7 : ℝ)) - (-3 : ℝ) / (4 : ℝ)| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d2-t0041"}
+{"id": "real-analysis-sequence_bounds-d2-t0042", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 2, "seed": 42, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = 2\\) and \\(a_{n+1} = \\frac{a_n}{2} + 1\\). Prove that \\(0 \\le a_n \\le 2\\) for every \\(n\\), and then that the sequence is monotone (non-decreasing).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (2 : ℝ)\n | (n + 1) => a n / 2 + (1 : ℝ)\n\n/-- The sequence stays between 0 and its upper bound. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (2 : ℝ) := by\n sorry\n\n/-- The sequence is increasing. -/\ntheorem a_monotone :\n Monotone a := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d2-t0042"}
+{"id": "real-analysis-uniform_bounds-d2-t0043", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 2, "seed": 43, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that for every natural number \\(n\\) and every real \\(x\\) with \\(0 \\le x \\le \\frac{3}{4}\\), \\[\\sum_{i=0}^{n-1} x^{i} \\le \\frac{1}{1 - \\frac{3}{4}}.\\] The sum is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A bound on partial geometric sums that does not depend on n or x. -/\ntheorem uniform_bound :\n ∀ n : ℕ, ∀ x ∈ Set.Icc (0 : ℝ) (3 / 4 : ℝ), ∑ i ∈ Finset.range n, x ^ i ≤ 1 / (1 - (3 / 4 : ℝ)) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d2-t0043"}
+{"id": "real-analysis-continuity-d3-t0044", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 3, "seed": 44, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = \\dfrac{3}{x}\\) is continuous at \\(x_0 = 5\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\). Here \\(x\\) ranges over all real numbers (in Lean, division by 0 gives 0, which does not matter for small \\(\\delta\\)).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of the reciprocal function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (5 : ℝ)| < δ → |(3 : ℝ) / x - (3 : ℝ) / (5 : ℝ)| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d3-t0044"}
+{"id": "real-analysis-limit_sequence-d3-t0045", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 3, "seed": 45, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that \\(u_n = \\dfrac{4n + 3}{n^2 + 6}\\) tends to \\(0\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|u_n - 0| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence tends to 0 (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |((4 : ℝ) * (n : ℝ) + (3 : ℝ)) / ((n : ℝ) ^ 2 + (6 : ℝ)) - 0| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d3-t0045"}
+{"id": "real-analysis-sequence_bounds-d3-t0046", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 3, "seed": 46, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = 0\\) and \\(a_{n+1} = \\dfrac{a_n^2 + \\frac{7}{16}}{2}\\). Prove that \\(0 \\le a_n \\le \\frac{1}{4}\\) for every \\(n\\) (note that \\(\\frac{1}{4}\\) is a fixed point of the recursion), and then that the sequence is monotone (non-decreasing).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (0 : ℝ)\n | (n + 1) => (a n ^ 2 + (7 / 16 : ℝ)) / 2\n\n/-- The sequence stays between 0 and the smaller fixed point. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (1 / 4 : ℝ) := by\n sorry\n\n/-- The sequence is increasing. -/\ntheorem a_monotone :\n Monotone a := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d3-t0046"}
+{"id": "real-analysis-uniform_bounds-d3-t0047", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 3, "seed": 47, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that \\(c\\,x^n\\) with \\(c = 3\\) tends to \\(0\\) uniformly on \\([-\\frac{2}{3}, \\frac{2}{3}]\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|3\\,x^n| < \\varepsilon\\) for all \\(n \\ge N\\) and all real \\(x\\) with \\(|x| \\le \\frac{2}{3}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Uniform convergence of a geometric sequence on an interval. -/\ntheorem uniform_convergence :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, ∀ x : ℝ, |x| ≤ (2 / 3 : ℝ) → |3 * x ^ n| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d3-t0047"}
+{"id": "real-analysis-continuity-d1-t0048", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 1, "seed": 48, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = 4x + 3\\) is continuous at \\(x_0 = -4\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of a linear function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (-4 : ℝ)| < δ → |((4 : ℝ) * x + (3 : ℝ)) - ((4 : ℝ) * (-4 : ℝ) + (3 : ℝ))| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d1-t0048"}
+{"id": "real-analysis-limit_sequence-d1-t0049", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 1, "seed": 49, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that the sequence \\(u_n = \\dfrac{3}{n + 6}\\) tends to \\(0\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|u_n - 0| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence tends to 0 (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |(3 : ℝ) / ((n : ℝ) + (6 : ℝ)) - 0| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d1-t0049"}
+{"id": "real-analysis-sequence_bounds-d1-t0050", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 1, "seed": 50, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = 3\\) and \\(a_{n+1} = \\frac{a_n}{2} + 2\\). Prove that \\(0 \\le a_n \\le 4\\) for every \\(n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (3 : ℝ)\n | (n + 1) => a n / 2 + (2 : ℝ)\n\n/-- The sequence stays between 0 and its upper bound. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (4 : ℝ) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d1-t0050"}
+{"id": "real-analysis-uniform_bounds-d1-t0051", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 1, "seed": 51, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that for every natural number \\(n\\) and every real \\(x\\) with \\(-\\frac{2}{3} \\le x \\le \\frac{2}{3}\\), \\[|8\\,x^{n+1}| \\le 8 \\cdot \\frac{2}{3}^{n+1}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A bound that does not depend on the point x. -/\ntheorem uniform_bound :\n ∀ n : ℕ, ∀ x ∈ Set.Icc (-(2 / 3 : ℝ)) (2 / 3 : ℝ), |8 * x ^ (n + 1)| ≤ 8 * (2 / 3 : ℝ) ^ (n + 1) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d1-t0051"}
+{"id": "real-analysis-continuity-d2-t0052", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 2, "seed": 52, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = -3x^2 - 1\\) is continuous at \\(x_0 = -2\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\). Do not use any continuity lemma from the library.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of a quadratic function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (-2 : ℝ)| < δ → |((-3 : ℝ) * x ^ 2 + (-1 : ℝ)) - ((-3 : ℝ) * (-2 : ℝ) ^ 2 + (-1 : ℝ))| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d2-t0052"}
+{"id": "real-analysis-limit_sequence-d2-t0053", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 2, "seed": 53, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that \\(u_n = \\dfrac{5n - 5}{6n + 2}\\) tends to \\(\\dfrac{5}{6}\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(\\left|u_n - \\frac{5}{6}\\right| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence converges to a/c (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |((5 : ℝ) * (n : ℝ) + (-5 : ℝ)) / ((6 : ℝ) * (n : ℝ) + (2 : ℝ)) - (5 : ℝ) / (6 : ℝ)| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d2-t0053"}
+{"id": "real-analysis-sequence_bounds-d2-t0054", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 2, "seed": 54, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = 2\\) and \\(a_{n+1} = \\frac{a_n}{2} + 2\\). Prove that \\(0 \\le a_n \\le 4\\) for every \\(n\\), and then that the sequence is monotone (non-decreasing).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (2 : ℝ)\n | (n + 1) => a n / 2 + (2 : ℝ)\n\n/-- The sequence stays between 0 and its upper bound. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (4 : ℝ) := by\n sorry\n\n/-- The sequence is increasing. -/\ntheorem a_monotone :\n Monotone a := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d2-t0054"}
+{"id": "real-analysis-uniform_bounds-d2-t0055", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 2, "seed": 55, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that for every natural number \\(n\\) and every real \\(x\\) with \\(0 \\le x \\le \\frac{1}{4}\\), \\[\\sum_{i=0}^{n-1} x^{i} \\le \\frac{1}{1 - \\frac{1}{4}}.\\] The sum is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A bound on partial geometric sums that does not depend on n or x. -/\ntheorem uniform_bound :\n ∀ n : ℕ, ∀ x ∈ Set.Icc (0 : ℝ) (1 / 4 : ℝ), ∑ i ∈ Finset.range n, x ^ i ≤ 1 / (1 - (1 / 4 : ℝ)) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d2-t0055"}
+{"id": "real-analysis-continuity-d3-t0056", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 3, "seed": 56, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = \\dfrac{3}{x}\\) is continuous at \\(x_0 = 2\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\). Here \\(x\\) ranges over all real numbers (in Lean, division by 0 gives 0, which does not matter for small \\(\\delta\\)).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of the reciprocal function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (2 : ℝ)| < δ → |(3 : ℝ) / x - (3 : ℝ) / (2 : ℝ)| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d3-t0056"}
+{"id": "real-analysis-limit_sequence-d3-t0057", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 3, "seed": 57, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that \\(u_n = \\dfrac{4n + 2}{n^2 + 2}\\) tends to \\(0\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|u_n - 0| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence tends to 0 (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |((4 : ℝ) * (n : ℝ) + (2 : ℝ)) / ((n : ℝ) ^ 2 + (2 : ℝ)) - 0| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d3-t0057"}
+{"id": "real-analysis-sequence_bounds-d3-t0058", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 3, "seed": 58, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = \\frac{4}{5}\\) and \\(a_{n+1} = \\dfrac{a_n^2 + \\frac{24}{25}}{2}\\). Prove that \\(0 \\le a_n \\le \\frac{4}{5}\\) for every \\(n\\) (note that \\(\\frac{4}{5}\\) is a fixed point of the recursion), and then that the sequence is monotone (non-decreasing).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (4 / 5 : ℝ)\n | (n + 1) => (a n ^ 2 + (24 / 25 : ℝ)) / 2\n\n/-- The sequence stays between 0 and the smaller fixed point. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (4 / 5 : ℝ) := by\n sorry\n\n/-- The sequence is increasing. -/\ntheorem a_monotone :\n Monotone a := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d3-t0058"}
+{"id": "real-analysis-uniform_bounds-d3-t0059", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 3, "seed": 59, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that \\(c\\,x^n\\) with \\(c = 3\\) tends to \\(0\\) uniformly on \\([-\\frac{1}{2}, \\frac{1}{2}]\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|3\\,x^n| < \\varepsilon\\) for all \\(n \\ge N\\) and all real \\(x\\) with \\(|x| \\le \\frac{1}{2}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Uniform convergence of a geometric sequence on an interval. -/\ntheorem uniform_convergence :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, ∀ x : ℝ, |x| ≤ (1 / 2 : ℝ) → |3 * x ^ n| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d3-t0059"}
+{"id": "real-analysis-continuity-d1-t0060", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 1, "seed": 60, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = 6x - 1\\) is continuous at \\(x_0 = 0\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of a linear function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (0 : ℝ)| < δ → |((6 : ℝ) * x + (-1 : ℝ)) - ((6 : ℝ) * (0 : ℝ) + (-1 : ℝ))| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d1-t0060"}
+{"id": "real-analysis-limit_sequence-d1-t0061", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 1, "seed": 61, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that the sequence \\(u_n = \\dfrac{3}{n + 1}\\) tends to \\(0\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|u_n - 0| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence tends to 0 (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |(3 : ℝ) / ((n : ℝ) + (1 : ℝ)) - 0| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d1-t0061"}
+{"id": "real-analysis-sequence_bounds-d1-t0062", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 1, "seed": 62, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = 0\\) and \\(a_{n+1} = \\frac{a_n}{2} + \\frac{7}{2}\\). Prove that \\(0 \\le a_n \\le 7\\) for every \\(n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (0 : ℝ)\n | (n + 1) => a n / 2 + (7 / 2 : ℝ)\n\n/-- The sequence stays between 0 and its upper bound. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (7 : ℝ) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d1-t0062"}
+{"id": "real-analysis-uniform_bounds-d1-t0063", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 1, "seed": 63, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that for every natural number \\(n\\) and every real \\(x\\) with \\(-\\frac{3}{5} \\le x \\le \\frac{3}{5}\\), \\[|8\\,x^{n+1}| \\le 8 \\cdot \\frac{3}{5}^{n+1}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A bound that does not depend on the point x. -/\ntheorem uniform_bound :\n ∀ n : ℕ, ∀ x ∈ Set.Icc (-(3 / 5 : ℝ)) (3 / 5 : ℝ), |8 * x ^ (n + 1)| ≤ 8 * (3 / 5 : ℝ) ^ (n + 1) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d1-t0063"}
+{"id": "real-analysis-continuity-d2-t0064", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 2, "seed": 64, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = 5x^2 - 6\\) is continuous at \\(x_0 = 4\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\). Do not use any continuity lemma from the library.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of a quadratic function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (4 : ℝ)| < δ → |((5 : ℝ) * x ^ 2 + (-6 : ℝ)) - ((5 : ℝ) * (4 : ℝ) ^ 2 + (-6 : ℝ))| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d2-t0064"}
+{"id": "real-analysis-limit_sequence-d2-t0065", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 2, "seed": 65, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that \\(u_n = \\dfrac{-2n - 3}{3n + 1}\\) tends to \\(\\dfrac{-2}{3}\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(\\left|u_n - \\frac{-2}{3}\\right| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence converges to a/c (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |((-2 : ℝ) * (n : ℝ) + (-3 : ℝ)) / ((3 : ℝ) * (n : ℝ) + (1 : ℝ)) - (-2 : ℝ) / (3 : ℝ)| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d2-t0065"}
+{"id": "real-analysis-sequence_bounds-d2-t0066", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 2, "seed": 66, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = \\frac{1}{2}\\) and \\(a_{n+1} = \\frac{a_n}{2} + \\frac{1}{2}\\). Prove that \\(0 \\le a_n \\le 1\\) for every \\(n\\), and then that the sequence is monotone (non-decreasing).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (1 / 2 : ℝ)\n | (n + 1) => a n / 2 + (1 / 2 : ℝ)\n\n/-- The sequence stays between 0 and its upper bound. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (1 : ℝ) := by\n sorry\n\n/-- The sequence is increasing. -/\ntheorem a_monotone :\n Monotone a := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d2-t0066"}
+{"id": "real-analysis-uniform_bounds-d2-t0067", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 2, "seed": 67, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that for every natural number \\(n\\) and every real \\(x\\) with \\(0 \\le x \\le \\frac{3}{4}\\), \\[\\sum_{i=0}^{n-1} x^{i} \\le \\frac{1}{1 - \\frac{3}{4}}.\\] The sum is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A bound on partial geometric sums that does not depend on n or x. -/\ntheorem uniform_bound :\n ∀ n : ℕ, ∀ x ∈ Set.Icc (0 : ℝ) (3 / 4 : ℝ), ∑ i ∈ Finset.range n, x ^ i ≤ 1 / (1 - (3 / 4 : ℝ)) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d2-t0067"}
+{"id": "real-analysis-continuity-d3-t0068", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 3, "seed": 68, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = \\dfrac{4}{x}\\) is continuous at \\(x_0 = 2\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\). Here \\(x\\) ranges over all real numbers (in Lean, division by 0 gives 0, which does not matter for small \\(\\delta\\)).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of the reciprocal function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (2 : ℝ)| < δ → |(4 : ℝ) / x - (4 : ℝ) / (2 : ℝ)| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d3-t0068"}
+{"id": "real-analysis-limit_sequence-d3-t0069", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 3, "seed": 69, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that \\(u_n = \\dfrac{5n + 6}{n^2 + 8}\\) tends to \\(0\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|u_n - 0| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence tends to 0 (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |((5 : ℝ) * (n : ℝ) + (6 : ℝ)) / ((n : ℝ) ^ 2 + (8 : ℝ)) - 0| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d3-t0069"}
+{"id": "real-analysis-sequence_bounds-d3-t0070", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 3, "seed": 70, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = \\frac{1}{2}\\) and \\(a_{n+1} = \\dfrac{a_n^2 + \\frac{8}{9}}{2}\\). Prove that \\(0 \\le a_n \\le \\frac{2}{3}\\) for every \\(n\\) (note that \\(\\frac{2}{3}\\) is a fixed point of the recursion), and then that the sequence is monotone (non-decreasing).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (1 / 2 : ℝ)\n | (n + 1) => (a n ^ 2 + (8 / 9 : ℝ)) / 2\n\n/-- The sequence stays between 0 and the smaller fixed point. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (2 / 3 : ℝ) := by\n sorry\n\n/-- The sequence is increasing. -/\ntheorem a_monotone :\n Monotone a := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d3-t0070"}
+{"id": "real-analysis-uniform_bounds-d3-t0071", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 3, "seed": 71, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that \\(c\\,x^n\\) with \\(c = 3\\) tends to \\(0\\) uniformly on \\([-\\frac{1}{4}, \\frac{1}{4}]\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|3\\,x^n| < \\varepsilon\\) for all \\(n \\ge N\\) and all real \\(x\\) with \\(|x| \\le \\frac{1}{4}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Uniform convergence of a geometric sequence on an interval. -/\ntheorem uniform_convergence :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, ∀ x : ℝ, |x| ≤ (1 / 4 : ℝ) → |3 * x ^ n| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d3-t0071"}
+{"id": "real-analysis-continuity-d1-t0072", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 1, "seed": 72, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = -3x + 2\\) is continuous at \\(x_0 = 0\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of a linear function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (0 : ℝ)| < δ → |((-3 : ℝ) * x + (2 : ℝ)) - ((-3 : ℝ) * (0 : ℝ) + (2 : ℝ))| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d1-t0072"}
+{"id": "real-analysis-limit_sequence-d1-t0073", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 1, "seed": 73, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that the sequence \\(u_n = \\dfrac{1}{n + 6}\\) tends to \\(0\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|u_n - 0| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence tends to 0 (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |(1 : ℝ) / ((n : ℝ) + (6 : ℝ)) - 0| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d1-t0073"}
+{"id": "real-analysis-sequence_bounds-d1-t0074", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 1, "seed": 74, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = 6\\) and \\(a_{n+1} = \\frac{a_n}{2} + 3\\). Prove that \\(0 \\le a_n \\le 6\\) for every \\(n\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (6 : ℝ)\n | (n + 1) => a n / 2 + (3 : ℝ)\n\n/-- The sequence stays between 0 and its upper bound. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (6 : ℝ) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d1-t0074"}
+{"id": "real-analysis-uniform_bounds-d1-t0075", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 1, "seed": 75, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that for every natural number \\(n\\) and every real \\(x\\) with \\(-\\frac{1}{3} \\le x \\le \\frac{1}{3}\\), \\[|5\\,x^{n+1}| \\le 5 \\cdot \\frac{1}{3}^{n+1}.\\]\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A bound that does not depend on the point x. -/\ntheorem uniform_bound :\n ∀ n : ℕ, ∀ x ∈ Set.Icc (-(1 / 3 : ℝ)) (1 / 3 : ℝ), |5 * x ^ (n + 1)| ≤ 5 * (1 / 3 : ℝ) ^ (n + 1) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d1-t0075"}
+{"id": "real-analysis-continuity-d2-t0076", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 2, "seed": 76, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = 4x^2 + 4\\) is continuous at \\(x_0 = 3\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\). Do not use any continuity lemma from the library.\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of a quadratic function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (3 : ℝ)| < δ → |((4 : ℝ) * x ^ 2 + (4 : ℝ)) - ((4 : ℝ) * (3 : ℝ) ^ 2 + (4 : ℝ))| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d2-t0076"}
+{"id": "real-analysis-limit_sequence-d2-t0077", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 2, "seed": 77, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that \\(u_n = \\dfrac{6n}{6n + 5}\\) tends to \\(\\dfrac{6}{6}\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(\\left|u_n - \\frac{6}{6}\\right| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence converges to a/c (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |((6 : ℝ) * (n : ℝ) + (0 : ℝ)) / ((6 : ℝ) * (n : ℝ) + (5 : ℝ)) - (6 : ℝ) / (6 : ℝ)| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d2-t0077"}
+{"id": "real-analysis-sequence_bounds-d2-t0078", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 2, "seed": 78, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = 4\\) and \\(a_{n+1} = \\frac{a_n}{2} + 8\\). Prove that \\(0 \\le a_n \\le 16\\) for every \\(n\\), and then that the sequence is monotone (non-decreasing).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (4 : ℝ)\n | (n + 1) => a n / 2 + (8 : ℝ)\n\n/-- The sequence stays between 0 and its upper bound. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (16 : ℝ) := by\n sorry\n\n/-- The sequence is increasing. -/\ntheorem a_monotone :\n Monotone a := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d2-t0078"}
+{"id": "real-analysis-uniform_bounds-d2-t0079", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 2, "seed": 79, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that for every natural number \\(n\\) and every real \\(x\\) with \\(0 \\le x \\le \\frac{2}{3}\\), \\[\\sum_{i=0}^{n-1} x^{i} \\le \\frac{1}{1 - \\frac{2}{3}}.\\] The sum is empty when \\(n = 0\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- A bound on partial geometric sums that does not depend on n or x. -/\ntheorem uniform_bound :\n ∀ n : ℕ, ∀ x ∈ Set.Icc (0 : ℝ) (2 / 3 : ℝ), ∑ i ∈ Finset.range n, x ^ i ≤ 1 / (1 - (2 / 3 : ℝ)) := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d2-t0079"}
+{"id": "real-analysis-continuity-d3-t0080", "env": "real-analysis", "msc": "26", "family": "continuity", "difficulty": 3, "seed": 80, "kind": "prove", "instruction": "# Prove continuity from the epsilon-delta definition\n\nProve, from the epsilon-delta definition, that \\(f(x) = \\dfrac{1}{x}\\) is continuous at \\(x_0 = 1\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\). Here \\(x\\) ranges over all real numbers (in Lean, division by 0 gives 0, which does not matter for small \\(\\delta\\)).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Epsilon-delta continuity of the reciprocal function at a point. -/\ntheorem continuous_at :\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - (1 : ℝ)| < δ → |(1 : ℝ) / x - (1 : ℝ) / (1 : ℝ)| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-continuity-d3-t0080"}
+{"id": "real-analysis-limit_sequence-d3-t0081", "env": "real-analysis", "msc": "26", "family": "limit_sequence", "difficulty": 3, "seed": 81, "kind": "prove", "instruction": "# Prove a limit from the definition\n\nProve, directly from the definition of a limit, that \\(u_n = \\dfrac{6n}{n^2 + 4}\\) tends to \\(0\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|u_n - 0| < \\varepsilon\\) for all \\(n \\ge N\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- The sequence tends to 0 (epsilon-N definition). -/\ntheorem seq_limit :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |((6 : ℝ) * (n : ℝ) + (0 : ℝ)) / ((n : ℝ) ^ 2 + (4 : ℝ)) - 0| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-limit_sequence-d3-t0081"}
+{"id": "real-analysis-sequence_bounds-d3-t0082", "env": "real-analysis", "msc": "26", "family": "sequence_bounds", "difficulty": 3, "seed": 82, "kind": "prove", "instruction": "# Bound a recursive sequence\n\nDefine a real sequence by \\(a_0 = \\frac{1}{4}\\) and \\(a_{n+1} = \\dfrac{a_n^2 + \\frac{7}{16}}{2}\\). Prove that \\(0 \\le a_n \\le \\frac{1}{4}\\) for every \\(n\\) (note that \\(\\frac{1}{4}\\) is a fixed point of the recursion), and then that the sequence is monotone (non-decreasing).\n\n## What to do\n\n`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.\n", "start_file": "import Mathlib\n\nnoncomputable def a : ℕ → ℝ\n | 0 => (1 / 4 : ℝ)\n | (n + 1) => (a n ^ 2 + (7 / 16 : ℝ)) / 2\n\n/-- The sequence stays between 0 and the smaller fixed point. -/\ntheorem a_bounds :\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ (1 / 4 : ℝ) := by\n sorry\n\n/-- The sequence is increasing. -/\ntheorem a_monotone :\n Monotone a := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-sequence_bounds-d3-t0082"}
+{"id": "real-analysis-uniform_bounds-d3-t0083", "env": "real-analysis", "msc": "26", "family": "uniform_bounds", "difficulty": 3, "seed": 83, "kind": "prove", "instruction": "# Prove a uniform bound\n\nProve that \\(c\\,x^n\\) with \\(c = 5\\) tends to \\(0\\) uniformly on \\([-\\frac{3}{5}, \\frac{3}{5}]\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|5\\,x^n| < \\varepsilon\\) for all \\(n \\ge N\\) and all real \\(x\\) with \\(|x| \\le \\frac{3}{5}\\).\n\n## What to do\n\n`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.\n\n- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.\n- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.\n- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.\n- The reward is 1 if the theorem is proved and 0 otherwise.\n", "start_file": "import Mathlib\n\n/-- Uniform convergence of a geometric sequence on an interval. -/\ntheorem uniform_convergence :\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, ∀ x : ℝ, |x| ≤ (3 / 5 : ℝ) → |5 * x ^ n| < ε := by\n sorry\n", "path": "tasks/real-analysis/real-analysis-uniform_bounds-d3-t0083"}
diff --git a/docker/Dockerfile b/docker/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..90bd9fbb7f68600ce598f52616a29b5a2c5db265
--- /dev/null
+++ b/docker/Dockerfile
@@ -0,0 +1,16 @@
+# Image for the Lean arena tasks: Lean 4 toolchain, Mathlib with its prebuilt cache, the grader.
+# Build once, run every task from it. Needs network at build time only; tasks run offline.
+# docker build -t lean-arena -f docker/Dockerfile .
+FROM debian:bookworm-slim
+RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates git python3 zstd xz-utils \
+ && rm -rf /var/lib/apt/lists/*
+ENV ELAN_HOME=/opt/elan PATH=/opt/elan/bin:$PATH
+RUN curl -sSf https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh | sh -s -- -y --default-toolchain none
+COPY lean/lean-toolchain lean/lakefile.toml lean/lake-manifest.json lean/Arena.lean /opt/arena/lean/
+WORKDIR /opt/arena/lean
+RUN lake exe cache get && lake build Arena
+COPY lean/verifier/Verify.lean /opt/arena/Verify.lean
+COPY arena/grade.py /opt/arena/grade.py
+RUN lake env printenv LEAN_PATH > .lake/lean_path.txt && chmod -R a+rX /opt/arena /opt/elan
+ENV ARENA_LEAN=/opt/arena/lean
+WORKDIR /app
diff --git a/envs/__init__.py b/envs/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/envs/combinatorial_identities/__init__.py b/envs/combinatorial_identities/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/envs/combinatorial_identities/env.toml b/envs/combinatorial_identities/env.toml
new file mode 100644
index 0000000000000000000000000000000000000000..c784574ad6ad622d000fc96c4c7baa2dcc20638d
--- /dev/null
+++ b/envs/combinatorial_identities/env.toml
@@ -0,0 +1,8 @@
+name = "combinatorial-identities"
+title = "Combinatorial identities and counting"
+msc = "05"
+kind = "prove"
+summary = "Prove binomial sums, Fibonacci identities, closed forms of linear recurrences, and counting arguments with injections and pigeonholes."
+skill = "Induction, binomial identities, pigeonhole"
+good_for = ["induction on sequences", "Nat.choose lemmas", "Nat.fib", "Finset.card injections and pigeonhole"]
+families = ["binomial_sums", "counting", "fibonacci", "linear_recurrence"]
diff --git a/envs/combinatorial_identities/gen.py b/envs/combinatorial_identities/gen.py
new file mode 100644
index 0000000000000000000000000000000000000000..116ecc9a230072f5ef40ac31ae612b225e429b24
--- /dev/null
+++ b/envs/combinatorial_identities/gen.py
@@ -0,0 +1,163 @@
+"""Combinatorial identities and counting (MSC 05: combinatorics; 05A10, 05A19, 05D05).
+
+Families: sums of binomial coefficients; Fibonacci identities by induction; closed forms for
+linear recurrences defined in a preamble; counting with injections and the pigeonhole principle.
+Second code path: every identity is checked in Python on small cases (math.comb, a direct
+Fibonacci/recurrence loop, brute-force pigeonhole and injection counts) before it is returned.
+"""
+from math import comb
+from itertools import combinations
+from arena.core import Task, Theorem, rng_for
+
+ENV = "combinatorial_identities"
+FAMILIES = ["binomial_sums", "counting", "fibonacci", "linear_recurrence"]
+
+def fibs(n):
+ f = [0, 1]
+ while len(f) <= n: f.append(f[-1] + f[-2])
+ return f
+
+# ---------------------------------------------------------------- binomial sums
+def binomial_sums(rng, difficulty):
+ if difficulty == 1:
+ a = rng.randrange(2, 10)
+ assert all(sum(comb(n, i) * a ** i for i in range(n + 1)) == (a + 1) ** n for n in range(9))
+ stmt = "(n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), n.choose i * %d ^ i = %d ^ n" % (a, a + 1)
+ proof = ("by\n have h := (add_pow (%d : ℕ) 1 n).symm\n simp only [one_pow, mul_one, Nat.cast_id] at h\n rw [Finset.sum_congr rfl (fun i _ => mul_comm (n.choose i) (%d ^ i))]\n exact h" % (a, a))
+ info = "For every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\binom{n}{i}\\, %d^{i} = %d^{n}.\\]" % (a, a + 1)
+ return info, [Theorem("binomial_sum", stmt, proof, "A weighted sum of binomial coefficients.")]
+ if difficulty == 2:
+ k = rng.randrange(1, 8); c = rng.choice([1, 1, 2, 3, 5])
+ assert all(sum(c * comb(i + k, k) for i in range(n + 1)) == c * comb(n + k + 1, k + 1) for n in range(10))
+ stmt = "(n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), %s(i + %d).choose %d = %s(n + %d).choose %d" % (
+ ("%d * " % c) if c != 1 else "", k, k, ("%d * " % c) if c != 1 else "", k + 1, k + 1)
+ proof = ("by\n rw [← Finset.mul_sum, Nat.sum_range_add_choose n %d]" % k) if c != 1 else "by\n exact Nat.sum_range_add_choose n %d" % k
+ info = "For every natural number \\(n\\), \\[%s\\sum_{i=0}^{n} \\binom{i+%d}{%d} = %s\\binom{n+%d}{%d}.\\]" % (("%d \\cdot " % c) if c != 1 else "", k, k, ("%d \\cdot " % c) if c != 1 else "", k + 1, k + 1)
+ info += " (This is the hockey stick identity.)"
+ return info, [Theorem("hockey_stick", stmt, proof, "A hockey stick identity for binomial coefficients.")]
+ a = rng.randrange(1, 6); c = rng.randrange(1, 8)
+ def lhs(n): return sum((a * i + c) * comb(n, i) for i in range(n + 1))
+ assert all(lhs(n) == a * n * 2 ** max(n - 1, 0) + c * 2 ** n for n in range(10))
+ lemma = Theorem("sum_i_choose", "(n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), i * n.choose i = n * 2 ^ (n - 1)", "by\n exact Nat.sum_range_mul_choose n", "The sum of i times n choose i.")
+ main = Theorem("weighted_sum", "(n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (%d * i + %d) * n.choose i = %d * (n * 2 ^ (n - 1)) + %d * 2 ^ n" % (a, c, a, c),
+ "by\n have h1 := sum_i_choose n\n have h2 := Nat.sum_range_choose n\n have e : ∀ i : ℕ, (%d * i + %d) * n.choose i = %d * (i * n.choose i) + %d * n.choose i := fun i => by ring\n simp only [e, Finset.sum_add_distrib, ← Finset.mul_sum, h1, h2]" % (a, c, a, c),
+ "A weighted binomial sum.", weight=2.0)
+ info = ("First prove \\[\\sum_{i=0}^{n} i \\binom{n}{i} = n \\cdot 2^{n-1},\\] where \\(n - 1\\) is truncated subtraction on the natural numbers. Then use it, and the value of \\(\\sum_{i=0}^{n} \\binom{n}{i}\\), to prove "
+ "\\[\\sum_{i=0}^{n} (%di + %d) \\binom{n}{i} = %d \\cdot n \\cdot 2^{n-1} + %d \\cdot 2^{n}.\\]") % (a, c, a, c)
+ return info, [lemma, main]
+
+# ---------------------------------------------------------------- Fibonacci
+def fibonacci(rng, difficulty):
+ f = fibs(120)
+ if difficulty == 1:
+ a = rng.randrange(0, 15)
+ assert all(sum(f[i + a] for i in range(n)) + f[a + 1] == f[n + a + 1] for n in range(12))
+ stmt = "(n : ℕ) :\n ∑ i ∈ Finset.range n, Nat.fib (i + %d) + Nat.fib %d = Nat.fib (n + %d)" % (a, a + 1, a + 1)
+ proof = ("by\n induction n with\n | zero => simp\n | succ k ih =>\n have e : Nat.fib (k + 1 + %d) = Nat.fib (k + %d) + Nat.fib (k + %d) := by\n rw [show k + 1 + %d = (k + %d) + 2 from by omega, show k + %d = (k + %d) + 1 from by omega]\n exact Nat.fib_add_two\n rw [Finset.sum_range_succ, e]\n omega" % (a + 1, a, a + 1, a + 1, a, a + 1, a))
+ info = "For every natural number \\(n\\), with \\(F\\) the Fibonacci sequence (\\(F_0 = 0\\), \\(F_1 = 1\\), \\(F_{k+2} = F_k + F_{k+1}\\)), \\[\\sum_{i=0}^{n-1} F_{i+%d} + F_{%d} = F_{n+%d}.\\]" % (a, a + 1, a + 1)
+ return info, [Theorem("fib_shifted_sum", stmt, proof, "A telescoping sum of Fibonacci numbers.")]
+ if difficulty == 2:
+ if rng.random() < 0.5:
+ a = rng.randrange(0, 12)
+ assert all(sum(f[2 * i + a + 1] for i in range(n)) + f[a] == f[2 * n + a] for n in range(12))
+ stmt = "(n : ℕ) :\n ∑ i ∈ Finset.range n, Nat.fib (2 * i + %d) + Nat.fib %d = Nat.fib (2 * n + %d)" % (a + 1, a, a)
+ proof = ("by\n induction n with\n | zero => simp\n | succ k ih =>\n have e : Nat.fib (2 * (k + 1) + %d) = Nat.fib (2 * k + %d) + Nat.fib (2 * k + %d) := by\n rw [show 2 * (k + 1) + %d = (2 * k + %d) + 2 from by omega, show 2 * k + %d = (2 * k + %d) + 1 from by omega]\n exact Nat.fib_add_two\n rw [Finset.sum_range_succ, e]\n omega" % (a, a, a + 1, a, a, a + 1, a))
+ info = "For every natural number \\(n\\), with \\(F\\) the Fibonacci sequence, \\[\\sum_{i=0}^{n-1} F_{2i+%d} + F_{%d} = F_{2n+%d}.\\]" % (a + 1, a, a)
+ return info, [Theorem("fib_odd_sum", stmt, proof, "A sum of every second Fibonacci number.")]
+ c = rng.randrange(1, 9)
+ assert all(sum(c * f[i] ** 2 for i in range(n + 1)) == c * f[n] * f[n + 1] for n in range(12))
+ stmt = "(n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), %d * Nat.fib i ^ 2 = %d * (Nat.fib n * Nat.fib (n + 1))" % (c, c)
+ proof = "by\n induction n with\n | zero => simp\n | succ k ih =>\n rw [Finset.sum_range_succ, ih, Nat.fib_add_two (n := k)]\n ring"
+ info = "For every natural number \\(n\\), with \\(F\\) the Fibonacci sequence, \\[\\sum_{i=0}^{n} %d\\,F_i^2 = %d\\,F_n F_{n+1}.\\]" % (c, c)
+ return info, [Theorem("fib_square_sum", stmt, proof, "A sum of squares of Fibonacci numbers.")]
+ while True:
+ c = rng.randrange(1, 8); b = rng.randrange(0, 9)
+ if (c, b) != (1, 0): break
+ for n in range(10):
+ idx = c * n + b
+ assert f[idx + 1] ** 2 - f[idx] * f[idx + 2] == (-1) ** idx
+ lemma = Theorem("cassini", "(n : ℕ) :\n (Nat.fib (n + 1) : ℤ) ^ 2 - Nat.fib n * Nat.fib (n + 2) = (-1) ^ n",
+ "by\n induction n with\n | zero => simp\n | succ k ih =>\n have e1 : Nat.fib (k + 2) = Nat.fib k + Nat.fib (k + 1) := Nat.fib_add_two\n have e2 : Nat.fib (k + 1 + 2) = Nat.fib (k + 1) + Nat.fib (k + 2) := Nat.fib_add_two\n rw [e2, pow_succ]\n rw [e1] at ih ⊢\n push_cast at ih ⊢\n linear_combination (-1 : ℤ) * ih",
+ "Cassini's identity for Fibonacci numbers.")
+ cn = ("%d * n" % c) if c != 1 else "n"
+ idx = ("%s + %d" % (cn, b)) if b else cn
+ main = Theorem("cassini_pm_one", "(n : ℕ) :\n (Nat.fib (%s + 1) : ℤ) ^ 2 - Nat.fib (%s) * Nat.fib (%s + 2) = 1 ∨ (Nat.fib (%s + 1) : ℤ) ^ 2 - Nat.fib (%s) * Nat.fib (%s + 2) = -1" % ((idx,) * 6),
+ "by\n rw [cassini (%s)]\n rcases neg_one_pow_eq_or ℤ (%s) with h | h\n · exact Or.inl h\n · exact Or.inr h" % (idx, idx),
+ "Cassini's determinant is plus or minus one at the index given.", weight=2.0)
+ info = ("First prove Cassini's identity: for every natural number \\(n\\), \\[F_{n+1}^2 - F_n F_{n+2} = (-1)^n,\\] computed in the integers, where \\(F\\) is the Fibonacci sequence. "
+ "Then conclude that \\(F_{m+1}^2 - F_m F_{m+2}\\) is either \\(1\\) or \\(-1\\) when \\(m = %s\\).") % (("%sn + %d" % ("" if c == 1 else c, b)) if b else "%sn" % ("" if c == 1 else c))
+ return info, [lemma, main]
+
+# ---------------------------------------------------------------- linear recurrences
+def linear_recurrence(rng, difficulty):
+ def sgn(x): return "(%d)" % x if x < 0 else "%d" % x
+ if difficulty < 3:
+ pool = [1, 2, 3, 4, 5] if difficulty == 1 else [-4, -3, -2, -1, 1, 2, 3, 4, 5]
+ r, s = rng.sample(pool, 2)
+ A = rng.choice([x for x in range(-3, 5) if x]); B = rng.choice([x for x in range(-3, 5) if x])
+ u0, u1 = A + B, A * r + B * s; p, q = r + s, r * s
+ closed = lambda n: A * r ** n + B * s ** n
+ form = "%s * %s ^ n + %s * %s ^ n" % (sgn(A), sgn(r), sgn(B), sgn(s))
+ tx = "%d \\cdot %s^{n} + %d \\cdot %s^{n}" % (A, "(%d)" % r if r < 0 else r, B, "(%d)" % s if s < 0 else s)
+ desc_roots = "\\(%s\\) and \\(%s\\)" % (r, s)
+ else:
+ r = rng.choice([-3, -2, -1, 2, 3, 4]); A = rng.choice([x for x in range(-3, 5) if x]); B = rng.choice([x for x in range(-3, 5) if x])
+ u0, u1 = A, (A + B) * r; p, q = 2 * r, r * r
+ closed = lambda n: (A + B * n) * r ** n
+ form = "(%s + %s * (n : ℤ)) * %s ^ n" % (sgn(A), sgn(B), sgn(r))
+ tx = "(%d + %d n) \\cdot %s^{n}" % (A, B, "(%d)" % r if r < 0 else r)
+ seq = [u0, u1]
+ while len(seq) < 15: seq.append(p * seq[-1] - q * seq[-2])
+ assert all(seq[n] == closed(n) for n in range(15))
+ rec = "%s * u (n + 1) - %s * u n" % (sgn(p), sgn(q))
+ pre = "def u : ℕ → ℤ\n | 0 => %s\n | 1 => %s\n | (n + 2) => %s" % (sgn(u0), sgn(u1), rec)
+ stmt = "(n : ℕ) :\n u n = %s" % form
+ proof = ("by\n induction n using Nat.strong_induction_on with\n | _ n ih =>\n match n, ih with\n | 0, _ => norm_num [u]\n | 1, _ => norm_num [u]\n"
+ " | n + 2, ih =>\n have h1 := ih (n + 1) (by omega)\n have h0 := ih n (by omega)\n rw [u, h1, h0]\n push_cast\n ring")
+ info = ("Define a sequence of integers by \\(u_0 = %d\\), \\(u_1 = %d\\) and \\(u_{n+2} = %d\\,u_{n+1} - %d\\,u_{n}\\). Prove that for every natural number \\(n\\), \\[u_n = %s.\\]" % (u0, u1, p, q, tx))
+ return info, pre, [Theorem("seq_closed_form", stmt, proof, "A closed form for the sequence defined by the recurrence.")]
+
+# ---------------------------------------------------------------- counting
+def counting(rng, difficulty):
+ if difficulty == 1:
+ m = rng.randrange(2, 9)
+ # brute-force check: any m+1 integers in a window contain two with the same residue
+ for _ in range(50):
+ xs = rng.sample(range(-20, 20), m + 1)
+ assert len({x % m for x in xs}) <= m
+ stmt = "(s : Finset ℤ) (h : %d < s.card) :\n ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ x %% %d = y %% %d" % (m, m, m)
+ proof = ("by\n have hmaps : Set.MapsTo (fun x : ℤ => x %% %d) (s : Set ℤ) (Finset.Ico (0 : ℤ) %d : Finset ℤ) := by\n intro x _\n simp only [Finset.coe_Ico, Set.mem_Ico]\n omega\n"
+ " have hc : (Finset.Ico (0 : ℤ) %d).card < s.card := by simpa using h\n exact Finset.exists_ne_map_eq_of_card_lt_of_maps_to hc hmaps" % (m, m, m))
+ info = "Let \\(s\\) be a finite set of integers with more than %d elements. Prove that \\(s\\) contains two different integers \\(x \\ne y\\) that leave the same remainder on division by %d." % (m, m)
+ return info, [], [Theorem("pigeonhole_mod", stmt, proof, "Pigeonhole principle for remainders.")]
+ if difficulty == 2:
+ p = rng.randrange(2, 7); r = rng.randrange(0, p)
+ for n in range(1, 15):
+ assert len([y for y in range(p * n) if y % p == r]) == n >= n
+ stmt = "(n : ℕ) :\n (Finset.range n).card ≤ ((Finset.range (%d * n)).filter (fun y => y %% %d = %d)).card" % (p, p, r)
+ proof = ("by\n apply Finset.card_le_card_of_injOn (fun x => %d * x + %d)\n · intro x hx\n simp only [Finset.coe_range, Set.mem_Iio] at hx\n simp only [Finset.coe_filter, Finset.mem_range, Set.mem_setOf_eq]\n constructor <;> omega\n"
+ " · intro x _ y _ h\n simp only at h\n omega" % (p, r))
+ info = "Let \\(n\\) be a natural number. Prove that the set \\(\\{0, 1, \\dots, n-1\\}\\) has at most as many elements as the set of integers \\(y\\) with \\(0 \\le y < %d n\\) and \\(y \\equiv %d \\pmod{%d}\\). (Construct an injection.)" % (p, r, p)
+ return info, [], [Theorem("card_le_residue_class", stmt, proof, "An injection into a residue class gives a cardinality bound.")]
+ k = rng.randrange(2, 8); m = rng.randrange(2, 8)
+ stmt = "(s : Finset ℕ) (hs : s ⊆ Finset.range (%d * %d)) (h : %d < s.card) :\n ∃ x ∈ s, ∃ y ∈ s, x < y ∧ y < x + %d" % (k, m, m, k)
+ proof = ("by\n have hmaps : Set.MapsTo (fun x : ℕ => x / %d) (s : Set ℕ) (Finset.range %d : Finset ℕ) := by\n intro x hx\n have hx' := hs hx\n simp only [Finset.mem_range] at hx'\n simp only [Finset.coe_range, Set.mem_Iio]\n omega\n"
+ " have hc : (Finset.range %d).card < s.card := by simpa using h\n obtain ⟨x, hx, y, hy, hne, heq⟩ := Finset.exists_ne_map_eq_of_card_lt_of_maps_to hc hmaps\n"
+ " replace heq : x / %d = y / %d := heq\n rcases lt_or_gt_of_ne hne with hlt | hgt\n · exact ⟨x, hx, y, hy, hlt, by omega⟩\n · exact ⟨y, hy, x, hx, hgt, by omega⟩" % (k, m, m, k, k))
+ info = ("Let \\(s\\) be a set of natural numbers that are all less than \\(%d \\cdot %d = %d\\), and suppose \\(s\\) has more than %d elements. Prove that \\(s\\) contains two elements \\(x < y\\) with \\(y - x < %d\\)." % (k, m, k * m, m, k))
+ return info, [], [Theorem("close_pair", stmt, proof, "Pigeonhole principle for blocks of consecutive numbers.")]
+
+def generate(seed, difficulty, family=None):
+ family = family or sorted(FAMILIES)[seed % len(FAMILIES)]
+ rng = rng_for(ENV + "/" + family, seed, difficulty)
+ pre = ""
+ if family == "linear_recurrence":
+ info, pre, thms = linear_recurrence(rng, difficulty)
+ elif family == "counting":
+ info, _, thms = counting(rng, difficulty)
+ else:
+ info, thms = {"binomial_sums": binomial_sums, "fibonacci": fibonacci}[family](rng, difficulty)
+ titles = {"binomial_sums": "Prove an identity for binomial coefficients", "fibonacci": "Prove an identity for Fibonacci numbers",
+ "linear_recurrence": "Find the closed form of a recurrence", "counting": "Prove a counting statement"}
+ return Task(env=ENV, family=family, seed=seed, difficulty=difficulty, kind="prove", title=titles[family],
+ informal="Prove the following.\n\n" + info, preamble=pre, theorems=thms)
diff --git a/envs/definitions/__init__.py b/envs/definitions/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/envs/definitions/env.toml b/envs/definitions/env.toml
new file mode 100644
index 0000000000000000000000000000000000000000..c23898a2e9459aa225fe145177f7e588c7b230dd
--- /dev/null
+++ b/envs/definitions/env.toml
@@ -0,0 +1,8 @@
+name = "definitions"
+title = "Definitions from words"
+msc = "11"
+kind = "define"
+summary = "Turn a number-theoretic definition written in words into a computable Lean function that agrees with it on hidden inputs."
+skill = "Autoformalization of definitions"
+good_for = ["autoformalization", "reading a specification exactly", "boundary cases"]
+families = ["count", "divisors", "extremum", "pairs", "sequence", "sum"]
diff --git a/envs/definitions/gen.py b/envs/definitions/gen.py
new file mode 100644
index 0000000000000000000000000000000000000000..5f61fdf9b009092071d1f91b42708748704afd83
--- /dev/null
+++ b/envs/definitions/gen.py
@@ -0,0 +1,170 @@
+"""Definitions from words: write `f : ℕ → ℕ` from an English description.
+
+Two code paths: the Lean reference definition and the expected values are produced separately.
+The expected values in the hidden test come from the Python functions below; the Lean reference
+is compiled and run against them in the self-test. Elementary number theory only (MSC 11A, 11B).
+"""
+from math import gcd, isqrt
+from arena.core import Task, Theorem, rng_for
+
+ENV = "definitions"
+FAMILIES = ["count", "divisors", "extremum", "pairs", "sequence", "sum"]
+
+def digits(k): return [int(c) for c in str(k)] if k > 0 else []
+def is_prime(k): return k >= 2 and all(k % d for d in range(2, isqrt(k) + 1))
+def is_square(k): return isqrt(k) ** 2 == k
+def squarefree(k): return k >= 1 and all(k % (d * d) for d in range(2, isqrt(k) + 1))
+def ndiv(k): return sum(1 for d in range(1, k + 1) if k % d == 0)
+
+# A predicate on a positive integer k: (words, lean, python, period or None)
+def pred(rng, var, allow_n=False, periodic=False):
+ lv = var; var = "\\(%s\\)" % var # `var` for words, `lv` for Lean
+ kinds = ["div", "mod", "coprime_c"] + ([] if periodic else ["prime", "square", "digitsum", "palin", "squarefree"]) + (["coprime_n", "divides_n"] if allow_n else [])
+ kind = rng.choice(kinds)
+ if kind == "div":
+ d = rng.choice([2, 3, 4, 5, 6, 7])
+ return ("%s is divisible by %d" % (var, d), "%d ∣ %s" % (d, lv), lambda k, n, d=d: k % d == 0, d)
+ if kind == "mod":
+ m = rng.choice([3, 4, 5, 6, 7, 8, 9]); r = rng.randrange(1, m)
+ return ("%s leaves remainder %d on division by %d" % (var, r, m), "%s %% %d = %d" % (lv, m, r), lambda k, n, m=m, r=r: k % m == r, m)
+ if kind == "coprime_c":
+ c = rng.choice([6, 10, 12, 14, 15, 21, 30])
+ return ("%s is coprime to %d" % (var, c), "Nat.Coprime %s %d" % (lv, c), lambda k, n, c=c: gcd(k, c) == 1, c)
+ if kind == "prime":
+ return ("%s is prime" % var, "Nat.Prime %s" % lv, lambda k, n: is_prime(k), None)
+ if kind == "square":
+ return ("%s is a perfect square" % var, "IsSquare %s" % lv, lambda k, n: is_square(k), None)
+ if kind == "squarefree":
+ return ("%s is squarefree (no square larger than 1 divides it)" % var, "Squarefree %s" % lv, lambda k, n: squarefree(k), None)
+ if kind == "digitsum":
+ m = rng.choice([3, 4, 5, 7]); r = rng.randrange(0, m)
+ return ("the sum of the decimal digits of %s leaves remainder %d on division by %d" % (var, r, m),
+ "(Nat.digits 10 %s).sum %% %d = %d" % (lv, m, r), lambda k, n, m=m, r=r: sum(digits(k)) % m == r, None)
+ if kind == "palin":
+ return ("the decimal digits of %s read the same forwards and backwards" % var,
+ "Nat.digits 10 %s = (Nat.digits 10 %s).reverse" % (lv, lv), lambda k, n: str(k) == str(k)[::-1], None)
+ if kind == "coprime_n":
+ return ("%s is coprime to \\(n\\)" % var, "Nat.Coprime %s n" % lv, lambda k, n: gcd(k, n) == 1, None)
+ return ("%s divides \\(n\\)" % var, "%s ∣ n" % lv, lambda k, n: n % k == 0, None)
+
+def combine(rng, difficulty, var, allow_n=False, periodic=False):
+ """One predicate at difficulty 1, two joined by and / or / and-not above that."""
+ a = pred(rng, var, allow_n, periodic)
+ if difficulty == 1: return a
+ while True:
+ b = pred(rng, var, allow_n, periodic)
+ if b[1].split()[0:2] != a[1].split()[0:2] and b[1] != a[1]: break
+ op = rng.choice(["and", "or", "andnot"])
+ per = (a[3] * b[3] // gcd(a[3], b[3])) if a[3] and b[3] else None
+ if op == "and": return ("%s and %s" % (a[0], b[0]), "(%s) ∧ (%s)" % (a[1], b[1]), lambda k, n: a[2](k, n) and b[2](k, n), per)
+ if op == "or": return ("%s or %s (or both)" % (a[0], b[0]), "(%s) ∨ (%s)" % (a[1], b[1]), lambda k, n: a[2](k, n) or b[2](k, n), per)
+ return ("%s but it is not the case that %s" % (a[0], b[0]), "(%s) ∧ ¬ (%s)" % (a[1], b[1]), lambda k, n: a[2](k, n) and not b[2](k, n), per)
+
+def weight(rng, var):
+ return rng.choice([
+ ("\\(%s\\)" % var, "%s" % var, lambda k: k),
+ ("\\(%s^2\\)" % var, "%s ^ 2" % var, lambda k: k * k),
+ ("the digit sums \\(s(%s)\\), where \\(s(m)\\) is the sum of the decimal digits of \\(m\\)," % var, "(Nat.digits 10 %s).sum" % var, lambda k: sum(digits(k))),
+ ("the values \\(\\tau(%s)\\), where \\(\\tau(m)\\) is the number of positive divisors of \\(m\\)," % var, "(Nat.divisors %s).card" % var, lambda k: ndiv(k)),
+ ])
+
+def build(rng, family, difficulty):
+ """Returns (description, lean body with `n` free or a full equation-style definition, python f, N)."""
+ N = 40
+ if family == "count":
+ w, l, p, _ = combine(rng, difficulty, "k", allow_n=difficulty == 3)
+ desc = "\\(f(n)\\) is the number of integers \\(k\\) with \\(1 \\le k \\le n\\) such that %s." % w
+ return desc, "((Finset.Icc 1 n).filter (fun k => %s)).card" % l, lambda n: sum(1 for k in range(1, n + 1) if p(k, n)), N
+ if family == "sum":
+ w, l, p, _ = combine(rng, max(1, difficulty - 1), "k", allow_n=difficulty == 3)
+ gw, gl, g = weight(rng, "k") if difficulty > 1 else ("\\(k\\)", "k", lambda k: k)
+ desc = "\\(f(n)\\) is the sum of %s over all integers \\(k\\) with \\(1 \\le k \\le n\\) such that %s. An empty sum is 0." % (gw, w)
+ return desc, "∑ k ∈ (Finset.Icc 1 n).filter (fun k => %s), %s" % (l, gl), lambda n: sum(g(k) for k in range(1, n + 1) if p(k, n)), N
+ if family == "divisors":
+ w, l, p, _ = combine(rng, max(1, difficulty - 1), "d")
+ if difficulty == 1:
+ desc = "\\(f(n)\\) is the number of positive divisors \\(d\\) of \\(n\\) such that %s. Take \\(f(0) = 0\\)." % w
+ return desc, "((Nat.divisors n).filter (fun d => %s)).card" % l, lambda n: sum(1 for d in range(1, n + 1) if n % d == 0 and p(d, n)), N
+ gw, gl, g = weight(rng, "d")
+ desc = "\\(f(n)\\) is the sum of %s over all positive divisors \\(d\\) of \\(n\\) such that %s. An empty sum is 0, and \\(f(0) = 0\\)." % (gw, w)
+ return desc, "∑ d ∈ (Nat.divisors n).filter (fun d => %s), %s" % (l, gl), lambda n: sum(g(d) for d in range(1, n + 1) if n % d == 0 and p(d, n)), N
+ if family == "extremum":
+ if rng.random() < 0.5:
+ w, l, p, _ = combine(rng, difficulty, "k")
+ desc = "\\(f(n)\\) is the largest integer \\(k\\) with \\(1 \\le k \\le n\\) such that %s. If there is no such \\(k\\), then \\(f(n) = 0\\)." % w
+ return desc, "((List.range (n + 1)).filter (fun k => decide (1 ≤ k ∧ (%s)))).foldl max 0" % l, lambda n: max([k for k in range(1, n + 1) if p(k, n)] or [0]), N
+ w, l, p, per = combine(rng, min(difficulty, 2), "k", periodic=True)
+ while not any(p(k, 0) for k in range(1, per + 1)):
+ w, l, p, per = combine(rng, min(difficulty, 2), "k", periodic=True)
+ strict = difficulty == 3 or rng.random() < 0.5
+ desc = "\\(f(n)\\) is the smallest integer \\(k\\) with \\(k %s n\\) and \\(k \\ge 1\\) such that %s." % (">" if strict else "\\ge", w)
+ start = "n + 1" if strict else "max n 1"
+ def py(n, p=p, strict=strict):
+ k = n + 1 if strict else max(n, 1)
+ while not p(k, n): k += 1
+ return k
+ return desc, "(((List.range %d).map (fun i => %s + i)).find? (fun k => decide (%s))).getD 0" % (per + 1, start, l), py, N
+ if family == "pairs":
+ N = 25
+ rels = [
+ ("\\(\\gcd(a, b) = %d\\)", "Nat.gcd p.1 p.2 = %d", lambda a, b, n, c: gcd(a, b) == c, [1, 2, 3]),
+ ("\\(a \\cdot b \\le n\\)", "p.1 * p.2 ≤ n", lambda a, b, n, c: a * b <= n, [0]),
+ ("\\(a\\) divides \\(b\\)", "p.1 ∣ p.2", lambda a, b, n, c: b % a == 0, [0]),
+ ("\\(a^2 + b^2 \\le n^2\\)", "p.1 ^ 2 + p.2 ^ 2 ≤ n ^ 2", lambda a, b, n, c: a * a + b * b <= n * n, [0]),
+ ("\\(a + b\\) is prime", "Nat.Prime (p.1 + p.2)", lambda a, b, n, c: is_prime(a + b), [0]),
+ ("\\(a \\cdot b\\) is a perfect square", "IsSquare (p.1 * p.2)", lambda a, b, n, c: is_square(a * b), [0]),
+ ("\\(a + b\\) is divisible by %d", "%d ∣ p.1 + p.2", lambda a, b, n, c: (a + b) % c == 0, [3, 4, 5]),
+ ("\\(a \\cdot b = n\\)", "p.1 * p.2 = n", lambda a, b, n, c: a * b == n, [0]),
+ ]
+ def pick():
+ w, l, r, cs = rng.choice(rels); c = rng.choice(cs)
+ return (w % c if "%d" in w else w), (l % c if "%d" in l else l), (lambda a, b, n, r=r, c=c: r(a, b, n, c))
+ w, l, r = pick()
+ order = ""
+ if difficulty >= 2:
+ order_kind = rng.choice(["le", "lt"])
+ order = " and \\(a %s b\\)" % ("\\le" if order_kind == "le" else "<")
+ l = "(%s) ∧ p.1 %s p.2" % (l, "≤" if order_kind == "le" else "<")
+ r0 = r; r = (lambda a, b, n, r0=r0, k=order_kind: r0(a, b, n) and (a <= b if k == "le" else a < b))
+ if difficulty == 3:
+ w2, l2, r2 = pick()
+ while w2 == w: w2, l2, r2 = pick()
+ w = w + ", " + w2; l = "(%s) ∧ (%s)" % (l, l2); r1 = r; r = (lambda a, b, n, r1=r1, r2=r2: r1(a, b, n) and r2(a, b, n))
+ desc = "\\(f(n)\\) is the number of ordered pairs \\((a, b)\\) of integers with \\(1 \\le a \\le n\\) and \\(1 \\le b \\le n\\) such that %s%s." % (w, order)
+ return desc, "((Finset.Icc 1 n ×ˢ Finset.Icc 1 n).filter (fun p => %s)).card" % l, lambda n: sum(1 for a in range(1, n + 1) for b in range(1, n + 1) if r(a, b, n)), N
+ # sequence
+ N = 28
+ m = rng.choice([7, 10, 11, 13, 17, 100, 101]); c0, c1 = rng.randrange(0, 5), rng.randrange(1, 6)
+ p, q = rng.randrange(1, 5), rng.randrange(1, 5); r = rng.randrange(0, 4) if difficulty >= 2 else 0
+ rec = "%s\\,a(n+1) + %s\\,a(n)%s" % (p if p > 1 else "", q if q > 1 else "", (" + %d" % r) if r else "")
+ lean_rec = "(%d * a (n + 1) + %d * a n + %d) %% %d" % (p, q, r, m)
+ seqdesc = "Let \\(a(0) = %d\\), \\(a(1) = %d\\) and, for \\(n \\ge 0\\), let \\(a(n+2)\\) be the remainder of \\(%s\\) on division by %d." % (c0, c1, rec, m)
+ def a(n, memo={}):
+ key = (c0, c1, p, q, r, m)
+ vals = memo.setdefault(key, [c0, c1])
+ while len(vals) <= n: vals.append((p * vals[-1] + q * vals[-2] + r) % m)
+ return vals[n]
+ helper = "def a : ℕ → ℕ\n | 0 => %d\n | 1 => %d\n | n + 2 => %s\n" % (c0, c1, lean_rec)
+ if difficulty == 1:
+ return seqdesc + " Then \\(f(n) = a(n)\\).", ("FULL", "def f : ℕ → ℕ\n | 0 => %d\n | 1 => %d\n | n + 2 => (%d * f (n + 1) + %d * f n + %d) %% %d\n" % (c0, c1, p, q, r, m)), a, N
+ if difficulty == 2:
+ return seqdesc + " Then \\(f(n) = a(0) + a(1) + \\dots + a(n)\\).", ("FULL", helper + "\ndef f (n : ℕ) : ℕ := ∑ i ∈ Finset.range (n + 1), a i\n"), lambda n: sum(a(i) for i in range(n + 1)), N
+ return (seqdesc + " Then \\(f(n)\\) is the number of indices \\(i\\) with \\(0 \\le i < n\\) such that \\(a(i) < a(i+1)\\).",
+ ("FULL", helper + "\ndef f (n : ℕ) : ℕ := ((Finset.range n).filter (fun i => a i < a (i + 1))).card\n"), lambda n: sum(1 for i in range(n) if a(i) < a(i + 1)), N)
+
+def generate(seed, difficulty, family=None):
+ family = family or sorted(FAMILIES)[seed % len(FAMILIES)]
+ rng = rng_for(ENV + "/" + family, seed, difficulty)
+ while True:
+ desc, lean, py, N = build(rng, family, difficulty)
+ vals = [py(n) for n in range(N)]
+ if len(set(vals)) >= 6: break # reject near-constant functions
+ solution = lean[1] if isinstance(lean, tuple) else "def f (n : ℕ) : ℕ := %s\n" % lean
+ shown = [n for n in (3, 10, 17, 24) if n < N]
+ examples = "\n".join("- \\(f(%d) = %d\\)" % (n, vals[n]) for n in shown)
+ test = Theorem("hidden_values", ": (List.range %d).map f = [%s]" % (N, ", ".join(map(str, vals))), "by native_decide")
+ return Task(env=ENV, family=family, seed=seed, difficulty=difficulty, kind="define",
+ title="Define a function from its description",
+ informal="Define the function \\(f\\) from the natural numbers (including 0) to the natural numbers as follows.\n\n" + desc,
+ stub="def f (n : ℕ) : ℕ := sorry\n", solution=solution, free=["f"], tests=[test], examples=examples,
+ meta={"values_tested": N})
diff --git a/envs/finite_sums/__init__.py b/envs/finite_sums/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/envs/finite_sums/env.toml b/envs/finite_sums/env.toml
new file mode 100644
index 0000000000000000000000000000000000000000..1fa2197d98c3d29fe5c2288bcd0d13333a89b59f
--- /dev/null
+++ b/envs/finite_sums/env.toml
@@ -0,0 +1,8 @@
+name = "finite-sums"
+title = "Closed forms for finite sums"
+msc = "40"
+kind = "prove"
+summary = "Prove a closed form for a finite sum: polynomial, geometric or telescoping, by induction on the number of terms."
+skill = "Induction over Finset sums"
+good_for = ["induction", "Finset.sum lemmas", "casts and field arithmetic"]
+families = ["geometric", "polynomial", "telescoping"]
diff --git a/envs/finite_sums/gen.py b/envs/finite_sums/gen.py
new file mode 100644
index 0000000000000000000000000000000000000000..71b8125681113ff73d436e55e4af22fe69e92b23
--- /dev/null
+++ b/envs/finite_sums/gen.py
@@ -0,0 +1,82 @@
+"""Closed forms for finite sums (MSC 40: sequences, series, summability; 05A19 identities).
+
+Formulas: sum_{i=0}^{n} i = n(n+1)/2, sum i^2 = n(n+1)(2n+1)/6, sum i^3 = n^2(n+1)^2/4;
+geometric (r-1) * sum_{i simp\n | succ k ih =>\n rw [Finset.sum_range_succ, ih]\n push_cast\n ring"
+
+def term(c, var, power):
+ """Lean text for c * var^power, with c a nonzero int."""
+ v = "" if power == 0 else ("(%s : ℚ)" % var if power == 1 else "(%s : ℚ) ^ %d" % (var, power))
+ if power == 0: return "%d" % c
+ return v if c == 1 else "%d * %s" % (c, v)
+
+def tex_poly(cs, var):
+ out = []
+ for power in range(len(cs) - 1, -1, -1):
+ c = cs[power]
+ if not c: continue
+ v = "" if power == 0 else (var if power == 1 else "%s^%d" % (var, power))
+ mag = abs(c); body = v if (mag == 1 and power) else "%d%s" % (mag, v)
+ out.append(("- " if c < 0 else ("+ " if out else "")) + body)
+ return " ".join(out)
+
+def polynomial(rng, difficulty):
+ deg = difficulty
+ while True:
+ cs = [rng.randrange(-4, 6) for _ in range(deg + 1)] # cs[p] multiplies i^p
+ if cs[deg] > 0 and sum(1 for c in cs if c) >= min(2, deg + 1): break
+ summand = " + ".join(term(c, "i", p) for p, c in reversed(list(enumerate(cs))) if c)
+ n = "(n : ℚ)"
+ closed = {0: "(%s + 1)" % n, 1: "%s * (%s + 1) / 2" % (n, n), 2: "%s * (%s + 1) * (2 * %s + 1) / 6" % (n, n, n), 3: "%s ^ 2 * (%s + 1) ^ 2 / 4" % (n, n)}
+ rhs = " + ".join(("%d * (%s)" % (c, closed[p])) for p, c in reversed(list(enumerate(cs))) if c)
+ def lhs_val(m): return sum(sum(F(c) * i ** p for p, c in enumerate(cs)) for i in range(m + 1))
+ def rhs_val(m):
+ cl = {0: F(m + 1), 1: F(m * (m + 1), 2), 2: F(m * (m + 1) * (2 * m + 1), 6), 3: F(m * m * (m + 1) ** 2, 4)}
+ return sum(c * cl[p] for p, c in enumerate(cs))
+ assert all(lhs_val(m) == rhs_val(m) for m in range(8))
+ tex_closed = {0: "(n+1)", 1: "\\frac{n(n+1)}{2}", 2: "\\frac{n(n+1)(2n+1)}{6}", 3: "\\frac{n^2(n+1)^2}{4}"}
+ tex_rhs = " + ".join("%d \\cdot %s" % (c, tex_closed[p]) for p, c in reversed(list(enumerate(cs))) if c).replace("+ -", "- ")
+ informal = "For every natural number \\(n\\), \\[\\sum_{i=0}^{n} \\left(%s\\right) = %s.\\]" % (tex_poly(cs, "i"), tex_rhs)
+ stmt = "(n : ℕ) :\n ∑ i ∈ Finset.range (n + 1), (%s) = %s" % (summand, rhs)
+ return informal, stmt, IND
+
+def geometric(rng, difficulty):
+ r = rng.choice([2, 3, 4, 5, 6, 7, 8, 9] if difficulty < 3 else [-2, -3, -4, 3, 5, 6, 7]); c = rng.randrange(1, 10) if difficulty > 1 else rng.choice([1, 1, 2, 3])
+ shift = rng.randrange(1, 4) if difficulty == 3 else 0
+ rl = "(%d : ℤ)" % r
+ summand = ("%d * " % c if c != 1 else "") + "%s ^ (i + %d)" % (rl, shift) if shift else ("%d * " % c if c != 1 else "") + "%s ^ i" % rl
+ stmt = "(n : ℕ) :\n (%d : ℤ) * ∑ i ∈ Finset.range n, %s = %d * (%s ^ n - 1)" % (r - 1, summand, c * r ** shift, rl)
+ assert all((r - 1) * sum(c * r ** (i + shift) for i in range(m)) == c * r ** shift * (r ** m - 1) for m in range(8))
+ tex_r = "(%d)" % r if r < 0 else "%d" % r
+ informal = "For every natural number \\(n\\), \\[%d \\sum_{i=0}^{n-1} %s%s^{%s} = %d\\left(%s^{n} - 1\\right).\\] The sum is over the integers and is empty when \\(n = 0\\)." % (
+ r - 1, ("%d \\cdot " % c) if c != 1 else "", tex_r, "i+%d" % shift if shift else "i", c * r ** shift, tex_r)
+ proof = "by\n induction n with\n | zero => simp\n | succ k ih =>\n rw [Finset.sum_range_succ, mul_add, ih]\n ring"
+ return informal, stmt, proof
+
+def telescoping(rng, difficulty):
+ a = rng.randrange(1, 5) if difficulty == 1 else rng.randrange(2, 9); c = rng.choice([1, 1, 2]) if difficulty < 3 else rng.randrange(2, 9)
+ # sum_{i simp\n | succ k ih =>\n rw [Finset.sum_range_succ, ih]\n"
+ " have h1 : ((k : ℚ) + %d) ≠ 0 := by positivity\n have h2 : ((k : ℚ) + %d) ≠ 0 := by positivity\n"
+ " have h3 : (((k + 1 : ℕ) : ℚ) + %d) ≠ 0 := by positivity\n push_cast\n field_simp\n ring") % (a, a + 1, a)
+ return informal, stmt, proof
+
+def generate(seed, difficulty, family=None):
+ family = family or sorted(FAMILIES)[seed % len(FAMILIES)]
+ rng = rng_for(ENV + "/" + family, seed, difficulty)
+ informal, stmt, proof = {"polynomial": polynomial, "geometric": geometric, "telescoping": telescoping}[family](rng, difficulty)
+ return Task(env=ENV, family=family, seed=seed, difficulty=difficulty, kind="prove",
+ title="Prove a closed form for a finite sum", informal="Prove the following identity.\n\n" + informal,
+ theorems=[Theorem("sum_closed_form", stmt, proof, "The closed form stated in the task.")])
diff --git a/envs/group_theory/__init__.py b/envs/group_theory/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/envs/group_theory/env.toml b/envs/group_theory/env.toml
new file mode 100644
index 0000000000000000000000000000000000000000..e421256a6827a7c9c2974f39379ce29dc06e6beb
--- /dev/null
+++ b/envs/group_theory/env.toml
@@ -0,0 +1,8 @@
+name = "group-theory"
+title = "Proofs about groups and subgroups"
+msc = "20"
+kind = "prove"
+summary = "Prove facts about abstract groups: commutativity from exponent laws, inverses, subgroup membership and Lagrange, homomorphism kernels."
+skill = "Group identities and the Subgroup API"
+good_for = ["calc chains in groups", "Subgroup and MonoidHom.ker API", "Nat.card and orderOf"]
+families = ["hom", "inverse", "involution", "subgroup"]
diff --git a/envs/group_theory/gen.py b/envs/group_theory/gen.py
new file mode 100644
index 0000000000000000000000000000000000000000..04419ed1a8c0f45edf538a9dfe3da7a5b6f8e3a0
--- /dev/null
+++ b/envs/group_theory/gen.py
@@ -0,0 +1,330 @@
+"""Group theory (MSC 20: group theory and generalizations).
+
+Families: involution (an exponent or inverse law forces commutativity), inverse (uniqueness and
+cancellation facts in monoids and groups), subgroup (membership, normal subgroups, a union of two
+subgroups, Lagrange with Nat.card), hom (kernels of group homomorphisms).
+Second code path: numeric parameters (cyclic rotation, cardinalities) are checked in Python with
+permutations and integer arithmetic before the task is returned; the Lean reference proofs are
+compiled in the self-test.
+"""
+import itertools
+from arena.core import Task, Theorem, rng_for
+
+ENV = "group_theory"
+FAMILIES = ["hom", "inverse", "involution", "subgroup"]
+TYPES = ["G", "A", "Q"]
+NAMES3 = [("x", "y", "z"), ("a", "b", "c"), ("g", "k", "m"), ("p", "q", "r"), ("u", "v", "w")]
+NAMES2 = [("x", "y"), ("a", "b"), ("g", "k"), ("u", "v"), ("s", "t"), ("p", "q")]
+
+def indent(text, n):
+ pad = " " * n
+ return "\n".join(pad + l if l.strip() else l for l in text.split("\n"))
+
+def sub(n): return "".join("₀₁₂₃₄₅₆₇₈₉"[int(c)] for c in str(n))
+
+# ---------------------------------------------------------------- involution
+
+def inv_hyps(T, u, v):
+ """kind -> (lean hypothesis, TeX hypothesis, proof of `∀ u v : T, u * v = v * u` from h)."""
+ return {
+ "self": ("∀ g : %s, g * g = 1" % T, "g \\cdot g = e \\text{ for every } g",
+ "by\n intro %s %s\n have hi : ∀ g : %s, g⁻¹ = g := fun g => inv_eq_of_mul_eq_one_right (h g)\n"
+ " calc %s * %s = (%s * %s)⁻¹ := (hi _).symm\n _ = %s⁻¹ * %s⁻¹ := mul_inv_rev %s %s\n _ = %s * %s := by rw [hi, hi]" % (u, v, T, u, v, u, v, v, u, u, v, v, u)),
+ "inveq": ("∀ g : %s, g⁻¹ = g" % T, "g^{-1} = g \\text{ for every } g",
+ "by\n intro %s %s\n calc %s * %s = (%s * %s)⁻¹ := (h _).symm\n _ = %s⁻¹ * %s⁻¹ := mul_inv_rev %s %s\n _ = %s * %s := by rw [h, h]" % (u, v, u, v, u, v, v, u, u, v, v, u)),
+ "sq": ("∀ g : %s, g ^ 2 = 1" % T, "g^2 = e \\text{ for every } g",
+ "by\n intro %s %s\n have hi : ∀ g : %s, g⁻¹ = g := fun g => inv_eq_of_mul_eq_one_right (by rw [← pow_two]; exact h g)\n"
+ " calc %s * %s = (%s * %s)⁻¹ := (hi _).symm\n _ = %s⁻¹ * %s⁻¹ := mul_inv_rev %s %s\n _ = %s * %s := by rw [hi, hi]" % (u, v, T, u, v, u, v, v, u, u, v, v, u)),
+ "sqmul": ("∀ %s %s : %s, (%s * %s) ^ 2 = %s ^ 2 * %s ^ 2" % (u, v, T, u, v, u, v), "(ab)^2 = a^2 b^2 \\text{ for all } a, b",
+ "by\n intro %s %s\n have h1 := h %s %s\n simp only [pow_two, mul_assoc] at h1\n have h2 := mul_left_cancel h1\n"
+ " have h3 : (%s * %s) * %s = (%s * %s) * %s := by simpa [mul_assoc] using h2\n exact (mul_right_cancel h3).symm" % (u, v, u, v, v, u, v, u, v, v)),
+ "invmul": ("∀ %s %s : %s, (%s * %s)⁻¹ = %s⁻¹ * %s⁻¹" % (u, v, T, u, v, u, v), "(ab)^{-1} = a^{-1} b^{-1} \\text{ for all } a, b",
+ "by\n intro %s %s\n have h1 := h %s⁻¹ %s⁻¹\n simp at h1\n exact h1.symm" % (u, v, u, v)),
+ "aba": ("∀ %(u)s %(v)s : %(T)s, %(u)s * %(v)s * %(u)s = %(v)s" % dict(u=u, v=v, T=T), "aba = b \\text{ for all } a, b",
+ ("by\n intro %(u)s %(v)s\n have h1 : ∀ g : %(T)s, g * g = 1 := fun g => by\n have := h g 1\n rwa [mul_one] at this\n"
+ " calc %(u)s * %(v)s = %(u)s * %(v)s * (%(u)s * %(u)s) := by rw [h1 %(u)s, mul_one]\n"
+ " _ = (%(u)s * %(v)s * %(u)s) * %(u)s := by rw [mul_assoc (%(u)s * %(v)s)]\n _ = %(v)s * %(u)s := by rw [h %(u)s %(v)s]") % dict(u=u, v=v, T=T)),
+ }
+
+def involution(rng, difficulty):
+ T = rng.choice(TYPES); u, v = rng.choice(NAMES2)
+ kinds = {1: ["self", "inveq"], 2: ["sq", "sqmul", "invmul"], 3: ["aba", "sqmul", "invmul", "sq"]}[difficulty]
+ kind = rng.choice(kinds)
+ hl, ht, proof = inv_hyps(T, u, v)[kind]
+ concl = rng.choice(["comm"] if difficulty == 1 else ["comm", "conj", "center"])
+ if concl == "comm":
+ goal = "∀ %s %s : %s, %s * %s = %s * %s" % (u, v, T, u, v, v, u)
+ words = "Then \\(G\\) is commutative: \\(ab = ba\\) for all \\(a, b \\in G\\)."
+ final = proof
+ else:
+ key = "have key : ∀ %s %s : %s, %s * %s = %s * %s := %s" % (u, v, T, u, v, v, u, indent(proof, 2).lstrip())
+ if concl == "conj":
+ goal = "∀ %s %s : %s, %s * %s * %s⁻¹ = %s" % (u, v, T, u, v, u, v)
+ words = "Then \\(a b a^{-1} = b\\) for all \\(a, b \\in G\\)."
+ final = "by\n %s\n intro %s %s\n rw [mul_inv_eq_iff_eq_mul]\n exact key %s %s" % (key, u, v, u, v)
+ else:
+ goal = "∀ z : %s, z ∈ Subgroup.center %s" % (T, T)
+ words = "Then every element of \\(G\\) lies in the center of \\(G\\)."
+ final = "by\n %s\n intro z\n rw [Subgroup.mem_center_iff]\n intro g\n exact key g z" % key
+ informal = "Let \\(G\\) be a group such that \\(%s\\). %s" % (ht, words)
+ ths = []
+ if difficulty == 3 and concl == "comm":
+ n = rng.randrange(3, 10)
+ lem = Theorem("involution_comm", "{%s : Type*} [Group %s] (h : %s) :\n %s" % (T, T, hl, goal), final, "The group is commutative.", 0.4)
+ main = Theorem("power_of_product", "{%s : Type*} [Group %s] (h : %s) (%s %s : %s) :\n (%s * %s) ^ %d = %s ^ %d * %s ^ %d" % (T, T, hl, u, v, T, u, v, n, u, n, v, n),
+ "by\n exact Commute.mul_pow (involution_comm h %s %s) %d" % (u, v, n), "In this group \\((ab)^%d = a^%d b^%d\\)." % (n, n, n), 0.6)
+ informal += " Deduce that \\((ab)^{%d} = a^{%d} b^{%d}\\) for all \\(a, b \\in G\\)." % (n, n, n)
+ return informal, [lem, main]
+ return informal, [Theorem("group_commutes", "{%s : Type*} [Group %s] (h : %s) :\n %s" % (T, T, hl, goal), final,
+ "The stated consequence of the hypothesis on the group.")]
+
+# ---------------------------------------------------------------- inverse
+
+def perm_mul(p, q): return tuple(p[i] for i in q) # (p * q)(i) = p(q(i))
+def perm_inv(p):
+ r = [0] * len(p)
+ for i, x in enumerate(p): r[x] = i
+ return tuple(r)
+
+def cyclic(rng, difficulty):
+ k = {1: 3, 2: rng.randrange(4, 7), 3: rng.randrange(6, 9)}[difficulty]
+ r = rng.randrange(1, k)
+ base = rng.choice(["x", "a", "g", "t"]); T = rng.choice(TYPES)
+ names = [base + sub(i + 1) for i in range(k)]
+ # second code path: in S_5, choose a_2..a_k at random, a_1 = (a_2...a_k)^{-1}; then the rotation is e
+ for _ in range(5):
+ els = [tuple(rng.sample(range(5), 5)) for _ in range(k - 1)]
+ prod = tuple(range(5))
+ for e in els: prod = perm_mul(prod, e)
+ els = [perm_inv(prod)] + els
+ full = tuple(range(5))
+ for e in els: full = perm_mul(full, e)
+ assert full == tuple(range(5))
+ rot = els[r:] + els[:r]; res = tuple(range(5))
+ for e in rot: res = perm_mul(res, e)
+ assert res == tuple(range(5))
+ prod_l = " * ".join(names); rot_l = " * ".join(names[r:] + names[:r])
+ pre = " * ".join(names[:r])
+ stmt = "{%s : Type*} [Group %s] (%s : %s)\n (h : %s = 1) : %s = 1" % (T, T, " ".join(names), T, prod_l, rot_l)
+ proof = "by\n calc %s = (%s)⁻¹ * (%s) * (%s) := by group\n _ = 1 := by rw [h]; group" % (rot_l, pre, prod_l, pre)
+ tp = lambda ns: " ".join(n.replace(base, "a_") if False else n for n in ns)
+ tex = lambda ns: " ".join("%s_{%d}" % (base, int(n[len(base):].translate(str.maketrans("₀₁₂₃₄₅₆₇₈₉", "0123456789")))) for n in ns)
+ informal = "Let \\(G\\) be a group and \\(%s \\in G\\) with \\(%s = e\\). Then \\(%s = e\\)." % (
+ ", ".join("%s_{%d}" % (base, i + 1) for i in range(k)), tex(names), tex(names[r:] + names[:r]))
+ return informal, [Theorem("rotate_product", stmt, proof, "A product equal to the identity stays equal to the identity after a cyclic rotation.")]
+
+def inverse(rng, difficulty):
+ kinds = {1: ["unique", "cyclic"], 2: ["cyclic", "conj", "conj", "powinv"], 3: ["right", "right", "cyclic"]}[difficulty]
+ kind = rng.choice(kinds)
+ if kind == "cyclic": return cyclic(rng, difficulty)
+ T = rng.choice(["M", "S", "N"]); x, y, z = rng.choice(NAMES3)
+ if kind == "unique":
+ order = rng.choice([0, 1])
+ h1, h2 = ("%s * %s = 1" % (x, y), "%s * %s = 1" % (z, x)) if order == 0 else ("%s * %s = 1" % (z, x), "%s * %s = 1" % (x, y))
+ informal = "Let \\(M\\) be a monoid and \\(%s, %s, %s \\in M\\) with \\(%s %s = 1\\) and \\(%s %s = 1\\). Then \\(%s = %s\\)." % (x, y, z, x, y, z, x, y, z)
+ proof = ("by\n calc %s = (%s * %s) * %s := by rw [%s, one_mul]\n _ = %s * (%s * %s) := mul_assoc _ _ _\n _ = %s := by rw [%s, mul_one]" % (
+ y, z, x, y, "h2" if order == 0 else "h1", z, x, y, z, "h1" if order == 0 else "h2"))
+ return informal, [Theorem("inverses_agree", "{%s : Type*} [Monoid %s] (%s %s %s : %s)\n (h1 : %s) (h2 : %s) : %s = %s" % (T, T, x, y, z, T, h1, h2, y, z), proof,
+ "A left inverse and a right inverse of the same element are equal.")]
+ if kind == "conj":
+ shape = rng.choice(["conj", "invconj", "order"]); T = rng.choice(TYPES)
+ if shape == "conj":
+ stmt = "{%s : Type*} [Group %s] (%s %s : %s) (n : ℕ) :\n (%s * %s * %s⁻¹) ^ n = %s * %s ^ n * %s⁻¹" % (T, T, x, y, T, x, y, x, x, y, x)
+ proof = "by\n induction n with\n | zero => simp\n | succ j ih =>\n rw [pow_succ, ih]\n group"
+ informal = "Let \\(G\\) be a group, \\(%s, %s \\in G\\) and \\(n \\in \\mathbb{N}\\). Then \\((%s %s %s^{-1})^n = %s %s^n %s^{-1}\\)." % (x, y, x, y, x, x, y, x)
+ elif shape == "invconj":
+ stmt = "{%s : Type*} [Group %s] (%s %s : %s) (n : ℕ) :\n (%s⁻¹ * %s * %s) ^ n = %s⁻¹ * %s ^ n * %s" % (T, T, x, y, T, x, y, x, x, y, x)
+ proof = "by\n induction n with\n | zero => simp\n | succ j ih =>\n rw [pow_succ, ih]\n group"
+ informal = "Let \\(G\\) be a group, \\(%s, %s \\in G\\) and \\(n \\in \\mathbb{N}\\). Then \\((%s^{-1} %s %s)^n = %s^{-1} %s^n %s\\)." % (x, y, x, y, x, x, y, x)
+ else:
+ stmt = "{%s : Type*} [Group %s] (%s %s : %s) :\n orderOf (%s * %s * %s⁻¹) = orderOf %s" % (T, T, x, y, T, x, y, x, y)
+ proof = "by\n exact orderOf_injective (MulAut.conj %s).toMonoidHom (MulAut.conj %s).injective %s" % (x, x, y)
+ informal = "Let \\(G\\) be a group and \\(%s, %s \\in G\\). Then the order of \\(%s %s %s^{-1}\\) equals the order of \\(%s\\) (orders are in \\(\\mathbb{N}\\), with 0 meaning infinite order)." % (x, y, x, y, x, y)
+ return informal, [Theorem("conjugate_fact", stmt, proof, "A fact about conjugation and powers.")]
+ if kind == "powinv":
+ T = rng.choice(["M", "S"])
+ proof = ("by\n induction n with\n | zero => simp\n | succ j ih =>\n calc %(x)s ^ (j + 1) * %(y)s ^ (j + 1) = %(x)s ^ j * (%(x)s * %(y)s) * %(y)s ^ j := by rw [pow_succ, pow_succ']; simp only [mul_assoc]\n"
+ " _ = 1 := by rw [h, mul_one]; exact ih") % dict(x=x, y=y)
+ informal = "Let \\(M\\) be a monoid and \\(%s, %s \\in M\\) with \\(%s %s = 1\\). Then \\(%s^n %s^n = 1\\) for every \\(n \\in \\mathbb{N}\\)." % (x, y, x, y, x, y)
+ return informal, [Theorem("pow_pair_one", "{%s : Type*} [Monoid %s] (%s %s : %s) (h : %s * %s = 1) (n : ℕ) :\n %s ^ n * %s ^ n = 1" % (T, T, x, y, T, x, y, x, y), proof,
+ "If xy = 1 then x^n y^n = 1.")]
+ # right: elements with a right inverse are invertible on both sides
+ left = rng.choice([0, 1])
+ hh = "∀ %s : %s, ∃ %s, %s * %s = 1" % (x, T, y, x, y) if left == 0 else "∀ %s : %s, ∃ %s, %s * %s = 1" % (x, T, y, y, x)
+ if left == 0:
+ goal = "∀ %s %s : %s, %s * %s = 1 → %s * %s = 1" % (x, y, T, x, y, y, x)
+ proof = ("by\n intro %s %s hxy\n obtain ⟨%s, hyz⟩ := h %s\n calc %s * %s = %s * %s * (%s * %s) := by rw [hyz, mul_one]\n _ = %s * (%s * %s) * %s := by simp only [mul_assoc]\n _ = %s * %s := by rw [hxy, mul_one]\n _ = 1 := hyz" % (
+ x, y, z, y, y, x, y, x, y, z, y, x, y, z, y, z))
+ informal = "Let \\(M\\) be a monoid in which every element \\(x\\) has some \\(y\\) with \\(xy = 1\\). Then \\(xy = 1\\) implies \\(yx = 1\\) for all \\(x, y \\in M\\)."
+ main_stmt = "{%s : Type*} [Monoid %s] (h : %s) (%s %s %s : %s)\n (h1 : %s * %s = 1) (h2 : %s * %s = 1) : %s = %s" % (T, T, hh, x, y, z, T, x, y, x, z, y, z)
+ main_proof = "by\n have hyx := right_inverse_comm h %s %s h1\n calc %s = %s * (%s * %s) := by rw [h2, mul_one]\n _ = (%s * %s) * %s := (mul_assoc _ _ _).symm\n _ = %s := by rw [hyx, one_mul]" % (x, y, y, y, x, z, y, x, z, z)
+ main_inf = "Under the same hypothesis, if \\(%s %s = 1\\) and \\(%s %s = 1\\) then \\(%s = %s\\)." % (x, y, x, z, y, z)
+ else:
+ goal = "∀ %s %s : %s, %s * %s = 1 → %s * %s = 1" % (x, y, T, y, x, x, y)
+ proof = ("by\n intro %s %s hyx\n obtain ⟨%s, hzy⟩ := h %s\n have hzx : %s = %s := by\n calc %s = %s * (%s * %s) := by rw [hyx, mul_one]\n _ = (%s * %s) * %s := (mul_assoc _ _ _).symm\n _ = %s := by rw [hzy, one_mul]\n rw [← hzx]\n exact hzy" % (
+ x, y, z, y, z, x, z, z, y, x, z, y, x, x))
+ informal = "Let \\(M\\) be a monoid in which every element \\(x\\) has some \\(y\\) with \\(yx = 1\\). Then \\(yx = 1\\) implies \\(xy = 1\\) for all \\(x, y \\in M\\)."
+ main_stmt = "{%s : Type*} [Monoid %s] (h : %s) (%s %s %s : %s)\n (h1 : %s * %s = 1) (h2 : %s * %s = 1) : %s = %s" % (T, T, hh, x, y, z, T, y, x, z, x, y, z)
+ main_proof = ("by\n have hxy := right_inverse_comm h %s %s h1\n calc %s = (%s * %s) * %s := by rw [h2, one_mul]\n _ = %s * (%s * %s) := mul_assoc _ _ _\n _ = %s := by rw [hxy, mul_one]") % (
+ x, y, y, z, x, y, z, x, y, z)
+ main_inf = "Under the same hypothesis, if \\(%s %s = 1\\) and \\(%s %s = 1\\) then \\(%s = %s\\)." % (y, x, z, x, y, z)
+ lem = Theorem("right_inverse_comm", "{%s : Type*} [Monoid %s] (h : %s) :\n %s" % (T, T, hh, goal), proof, "One-sided inverses are two-sided.", 0.4)
+ main = Theorem("inverse_unique", main_stmt, main_proof, "The inverse is unique.", 0.6)
+ return informal + " " + main_inf, [lem, main]
+
+# ---------------------------------------------------------------- subgroup
+
+def member(rng, difficulty, S, names):
+ """A random product of elements of the subgroup S. Returns (Lean expression, TeX, proof term)."""
+ k = {1: rng.randrange(2, 4), 2: rng.randrange(4, 6), 3: 5}[difficulty]
+ facs = []
+ for i in range(k):
+ n = names[i % len(names)]
+ form = rng.choice(["plain", "inv", "pow"] if difficulty > 1 else ["plain", "inv"])
+ facs.append((n, form, rng.randrange(2, 6)))
+ def fl(f): return f[0] if f[1] == "plain" else (f[0] + "⁻¹" if f[1] == "inv" else "%s ^ %d" % (f[0], f[2]))
+ def ft(f): return f[0] if f[1] == "plain" else (f[0] + "^{-1}" if f[1] == "inv" else "%s^{%d}" % (f[0], f[2]))
+ def fp(f): return "h" + f[0] if f[1] == "plain" else ("(inv_mem h%s)" % f[0] if f[1] == "inv" else "(pow_mem h%s %d)" % (f[0], f[2]))
+ expr = " * ".join(fl(f) for f in facs); tex = " ".join(ft(f) for f in facs)
+ proof = fp(facs[0])
+ for f in facs[1:]: proof = "(mul_mem %s %s)" % (proof, fp(f))
+ if proof.startswith("(") and len(facs) > 1: proof = proof[1:-1]
+ return expr, tex, proof, sorted({f[0] for f in facs})
+
+def lagrange_numbers(rng, difficulty):
+ m = rng.choice([2, 3, 4, 5, 6, 8, 9, 10]); k = rng.choice([2, 3, 4, 5, 6, 7]); n = m * k
+ assert Nat_card_check(m, k, n)
+ return m, k, n
+def Nat_card_check(m, k, n): return m * k == n and n % m == 0 and n // m == k
+
+def subgroup(rng, difficulty):
+ T = rng.choice(TYPES)
+ kinds = {1: ["member"], 2: ["normal", "lagrange", "index"], 3: ["union", "union2", "prime", "index"]}[difficulty]
+ kind = rng.choice(kinds)
+ S = rng.choice(["H", "K", "N", "L"]); names = list(rng.choice(NAMES3))
+ if kind == "member":
+ expr, tex, pr, used = member(rng, difficulty, S, names)
+ binders = " ".join(used)
+ hyps = " ".join("(h%s : %s ∈ %s)" % (n, n, S) for n in used)
+ informal = "Let \\(%s\\) be a subgroup of a group \\(G\\) and let %s lie in \\(%s\\). Then \\(%s \\in %s\\)." % (S, ", ".join("\\(%s\\)" % n for n in used), S, tex, S)
+ return informal, [Theorem("product_mem", "{%s : Type*} [Group %s] (%s : Subgroup %s) {%s : %s}\n %s : %s ∈ %s" % (T, T, S, T, binders, T, hyps, expr, S), "by\n exact " + pr,
+ "A product of elements of a subgroup, with inverses and powers, lies in the subgroup.")]
+ if kind == "normal":
+ x, g = names[0], names[1]; n = rng.randrange(2, 8); shape = rng.choice(["pow", "comm"])
+ if shape == "pow":
+ goal = "%s * %s ^ %d * %s⁻¹ ∈ %s" % (g, x, n, g, S); pr = "hN.conj_mem _ (pow_mem hx %d) %s" % (n, g)
+ words = "\\(%s %s^{%d} %s^{-1} \\in %s\\)" % (g, x, n, g, S)
+ else:
+ goal = "%s * %s * %s⁻¹ * %s⁻¹ ∈ %s" % (g, x, g, x, S); pr = "mul_mem (hN.conj_mem _ hx %s) (inv_mem hx)" % g
+ words = "\\(%s %s %s^{-1} %s^{-1} \\in %s\\)" % (g, x, g, x, S)
+ informal = "Let \\(%s\\) be a normal subgroup of a group \\(G\\), let \\(%s \\in %s\\) and \\(%s \\in G\\). Then %s." % (S, x, S, g, words)
+ return informal, [Theorem("normal_conj", "{%s : Type*} [Group %s] (%s : Subgroup %s) (hN : %s.Normal) {%s : %s} (hx : %s ∈ %s) (%s : %s) :\n %s" % (T, T, S, T, S, x, T, x, S, g, T, goal),
+ "by\n exact " + pr, "Conjugates of elements of a normal subgroup stay in it.")]
+ if kind == "lagrange":
+ m, k, n = lagrange_numbers(rng, difficulty); n_ord = n
+ shape = rng.choice(["card", "order"])
+ if shape == "card":
+ informal = "Let \\(G\\) be a group with \\(|G| = %d\\) and \\(%s\\) a subgroup of \\(G\\). Then \\(|%s|\\) divides %d." % (n, S, S, n)
+ return informal, [Theorem("subgroup_card_dvd", "{%s : Type*} [Group %s] (hG : Nat.card %s = %d) (%s : Subgroup %s) :\n Nat.card %s ∣ %d" % (T, T, T, n, S, T, S, n),
+ "by\n rw [← hG]\n exact Subgroup.card_subgroup_dvd_card %s" % S, "Lagrange: the order of a subgroup divides the order of the group.")]
+ informal = "Let \\(G\\) be a group with \\(|G| = %d\\) and \\(%s \\in G\\). Then the order of \\(%s\\) divides %d." % (n, names[0], names[0], n)
+ return informal, [Theorem("order_dvd", "{%s : Type*} [Group %s] (hG : Nat.card %s = %d) (%s : %s) :\n orderOf %s ∣ %d" % (T, T, T, n, names[0], T, names[0], n),
+ "by\n rw [← hG]\n exact orderOf_dvd_natCard %s" % names[0], "The order of an element divides the order of the group.")]
+ if kind == "index":
+ m, k, n = lagrange_numbers(rng, difficulty)
+ informal = "Let \\(G\\) be a group with \\(|G| = %d\\) and \\(%s\\) a subgroup with \\(|%s| = %d\\). Then \\(%s\\) has index %d in \\(G\\)." % (n, S, S, m, S, k)
+ return informal, [Theorem("subgroup_index", "{%s : Type*} [Group %s] (hG : Nat.card %s = %d) (%s : Subgroup %s) (hH : Nat.card %s = %d) :\n %s.index = %d" % (T, T, T, n, S, T, S, m, S, k),
+ "by\n have h := Subgroup.card_mul_index %s\n rw [hG, hH] at h\n omega" % S, "Lagrange: the cardinality is the product of subgroup order and index.")]
+ if kind in ("union", "union2"):
+ A, B = rng.choice([("H", "K"), ("A", "B"), ("P", "R")])
+ if kind == "union":
+ hyp = "∀ a b : %s, (a ∈ %s ∨ a ∈ %s) → (b ∈ %s ∨ b ∈ %s) → (a * b ∈ %s ∨ a * b ∈ %s)" % (T, A, B, A, B, A, B)
+ use = "h a b (Or.inl haH) (Or.inr hbK)"
+ words = "whenever \\(a\\) and \\(b\\) each lie in \\(%s\\) or in \\(%s\\), the product \\(ab\\) lies in \\(%s\\) or in \\(%s\\)" % (A, B, A, B)
+ else:
+ hyp = "∀ a ∈ %s, ∀ b ∈ %s, a * b ∈ %s ∨ a * b ∈ %s" % (A, B, A, B)
+ use = "h a haH b hbK"
+ words = "for all \\(a \\in %s\\) and \\(b \\in %s\\) the product \\(ab\\) lies in \\(%s\\) or in \\(%s\\)" % (A, B, A, B)
+ stmt = "{%s : Type*} [Group %s] (%s %s : Subgroup %s)\n (h : %s) : %s ≤ %s ∨ %s ≤ %s" % (T, T, A, B, T, hyp, A, B, B, A)
+ proof = ("by\n by_contra hcon\n rw [not_or] at hcon\n obtain ⟨h1, h2⟩ := hcon\n rw [SetLike.not_le_iff_exists] at h1 h2\n"
+ " obtain ⟨a, haH, haK⟩ := h1\n obtain ⟨b, hbK, hbH⟩ := h2\n rcases %s with hab | hab\n"
+ " · exact hbH (by simpa using mul_mem (inv_mem haH) hab)\n · exact haK (by simpa using mul_mem hab (inv_mem hbK))") % use
+ informal = "Let \\(%s\\) and \\(%s\\) be subgroups of a group \\(G\\) such that %s. Then \\(%s \\subseteq %s\\) or \\(%s \\subseteq %s\\)." % (A, B, words, A, B, B, A)
+ return informal, [Theorem("subgroup_union", stmt, proof, "A product-closed union of two subgroups is one of them.")]
+ # prime
+ p = rng.choice([3, 5, 7, 11, 13, 17, 19])
+ assert all(p % d for d in range(2, p))
+ g = names[0]
+ informal = "Let \\(G\\) be a group with \\(|G| = %d\\). Then \\(x^{%d} = e\\) for every \\(x \\in G\\), and every element \\(%s \\neq e\\) has order exactly %d." % (p, p, g, p)
+ lem = Theorem("pow_card", "{%s : Type*} [Group %s] (hG : Nat.card %s = %d) (x : %s) :\n x ^ %d = 1" % (T, T, T, p, T, p), "by\n rw [← hG]\n exact pow_card_eq_one'", "Every element satisfies x^|G| = 1.", 0.4)
+ main = Theorem("order_prime", "{%s : Type*} [Group %s] (hG : Nat.card %s = %d) (%s : %s) (hne : %s ≠ 1) :\n orderOf %s = %d" % (T, T, T, p, g, T, g, g, p),
+ "by\n haveI : Fact (Nat.Prime %d) := ⟨by norm_num⟩\n exact orderOf_eq_prime (pow_card %s %s) hne" % (p, "hG", g), "In a group of prime order p, every non-identity element has order p.", 0.6)
+ return informal, [lem, main]
+
+# ---------------------------------------------------------------- hom
+
+def hom(rng, difficulty):
+ G, H = rng.choice([("G", "H"), ("A", "B"), ("G", "K"), ("X", "Y")])
+ x, y = rng.choice(NAMES2)
+ kinds = {1: ["prod", "pow", "inv", "normal"], 2: ["inj", "comp", "inj", "comp"], 3: ["injcomp", "inj", "cardinj", "range"]}[difficulty]
+ kind = rng.choice(kinds)
+ pre = "{%s %s : Type*} [Group %s] [Group %s] (f : %s →* %s)" % (G, H, G, H, G, H)
+ if kind == "prod":
+ informal = "Let \\(f : G \\to H\\) be a group homomorphism and \\(%s, %s\\) in its kernel. Then \\(%s %s^{-1}\\) lies in the kernel." % (x, y, x, y)
+ return informal, [Theorem("kernel_mul_inv", "%s {%s %s : %s}\n (hx : %s ∈ f.ker) (hy : %s ∈ f.ker) : %s * %s⁻¹ ∈ f.ker" % (pre, x, y, G, x, y, x, y), "by\n exact mul_mem hx (inv_mem hy)",
+ "The kernel is closed under x y⁻¹.")]
+ if kind == "pow":
+ n = rng.randrange(2, 12)
+ informal = "Let \\(f : G \\to H\\) be a group homomorphism and \\(%s\\) an element of \\(G\\) with \\(f(%s) = e\\). Then \\(f(%s^{%d}) = e\\)." % (x, x, x, n)
+ return informal, [Theorem("image_of_power", "%s (%s : %s)\n (hx : f %s = 1) : f (%s ^ %d) = 1" % (pre, x, G, x, x, n), "by\n rw [map_pow, hx, one_pow]", "Powers of kernel elements are in the kernel.")]
+ if kind == "inv":
+ informal = "Let \\(f : G \\to H\\) be a group homomorphism and \\(%s, %s \\in G\\). Then \\(f(%s) = f(%s)\\) if and only if \\(%s^{-1} %s\\) lies in the kernel of \\(f\\)." % (x, y, x, y, x, y)
+ return informal, [Theorem("eq_iff_mem_ker", "%s (%s %s : %s) :\n f %s = f %s ↔ %s⁻¹ * %s ∈ f.ker" % (pre, x, y, G, x, y, x, y),
+ "by\n rw [MonoidHom.mem_ker, map_mul, map_inv, inv_mul_eq_one]", "Two elements have the same image exactly when x⁻¹ y is in the kernel.")]
+ if kind == "conj":
+ n = rng.randrange(1, 6)
+ informal = "Let \\(f : G \\to H\\) be a group homomorphism, \\(%s \\in G\\) with \\(f(%s) = e\\) and \\(%s \\in G\\). Then \\(f(%s %s^{%d} %s^{-1}) = e\\)." % (x, x, y, y, x, n, y)
+ return informal, [Theorem("conj_in_kernel", "%s (%s %s : %s)\n (hx : f %s = 1) : f (%s * %s ^ %d * %s⁻¹) = 1" % (pre, x, y, G, x, y, x, n, y),
+ "by\n rw [map_mul, map_mul, map_pow, map_inv, hx, one_pow, mul_one, mul_inv_cancel]", "The kernel is normal.")]
+ if kind == "normal":
+ informal = "Let \\(f : G \\to H\\) be a group homomorphism and \\(%s, %s \\in G\\) with \\(f(%s) = e\\). Then \\(%s %s %s^{-1} %s^{-1}\\) lies in the kernel of \\(f\\)." % (x, y, x, y, x, y, x)
+ return informal, [Theorem("commutator_in_kernel", "%s (%s %s : %s)\n (hx : f %s = 1) : %s * %s * %s⁻¹ * %s⁻¹ ∈ f.ker" % (pre, x, y, G, x, y, x, y, x),
+ "by\n exact mul_mem (f.normal_ker.conj_mem _ hx %s) (inv_mem hx)" % y, "Commutators with a kernel element lie in the kernel.")]
+ if kind == "inj":
+ informal = "Let \\(f : G \\to H\\) be a group homomorphism such that \\(f(%s) = e\\) implies \\(%s = e\\) for every \\(%s \\in G\\). Then \\(f\\) is injective." % (x, x, x)
+ return informal, [Theorem("injective_of_trivial_kernel", "%s\n (h : ∀ %s : %s, f %s = 1 → %s = 1) : Function.Injective f" % (pre, x, G, x, x),
+ "by\n intro a b hab\n have h1 : f (a⁻¹ * b) = 1 := by rw [map_mul, map_inv, hab, inv_mul_cancel]\n exact inv_mul_eq_one.mp (h _ h1)",
+ "A homomorphism with trivial kernel is injective.")]
+ if kind == "comp":
+ K = "Z"
+ informal = "Let \\(f : G \\to H\\) and \\(g : H \\to K\\) be group homomorphisms. Then every element of the kernel of \\(f\\) lies in the kernel of \\(g \\circ f\\)."
+ return informal, [Theorem("ker_le_ker_comp", "{%s %s %s : Type*} [Group %s] [Group %s] [Group %s] (f : %s →* %s) (g : %s →* %s) :\n f.ker ≤ (g.comp f).ker" % (G, H, K, G, H, K, G, H, H, K),
+ "by\n intro %s hx\n rw [MonoidHom.mem_ker] at hx ⊢\n rw [MonoidHom.comp_apply, hx, map_one]" % x, "The kernel of f lies in the kernel of g after f.")]
+ if kind == "injcomp":
+ K = "Z"
+ informal = "Let \\(f : G \\to H\\) and \\(g : H \\to K\\) be group homomorphisms with \\(g\\) injective. Then \\(g \\circ f\\) and \\(f\\) have the same kernel."
+ lem = Theorem("ker_le_ker_comp", "{%s %s %s : Type*} [Group %s] [Group %s] [Group %s] (f : %s →* %s) (g : %s →* %s) :\n f.ker ≤ (g.comp f).ker" % (G, H, K, G, H, K, G, H, H, K),
+ "by\n intro %s hx\n rw [MonoidHom.mem_ker] at hx ⊢\n rw [MonoidHom.comp_apply, hx, map_one]" % x, "The kernel of f lies in the kernel of g after f.", 0.3)
+ main = Theorem("ker_comp_eq", "{%s %s %s : Type*} [Group %s] [Group %s] [Group %s] (f : %s →* %s) (g : %s →* %s)\n (hg : Function.Injective g) : (g.comp f).ker = f.ker" % (G, H, K, G, H, K, G, H, H, K),
+ "by\n apply le_antisymm\n · intro %s hx\n rw [MonoidHom.mem_ker, MonoidHom.comp_apply] at hx\n rw [MonoidHom.mem_ker]\n exact hg (by rw [hx, map_one])\n · exact ker_le_ker_comp f g" % x,
+ "If g is injective the kernels agree.", 0.7)
+ return informal + " Show that \\(\\ker f \\subseteq \\ker(g \\circ f)\\) and then the equality.", [lem, main]
+ if kind == "cardinj":
+ informal = "Let \\(f : G \\to H\\) be a group homomorphism whose kernel has exactly one element. Then \\(f\\) is injective."
+ return informal, [Theorem("injective_of_card_ker", "%s\n (h : Nat.card f.ker = 1) : Function.Injective f" % pre, "by\n exact (MonoidHom.ker_eq_bot_iff f).mp (Subgroup.card_eq_one.mp h)",
+ "A homomorphism whose kernel has one element is injective.")]
+ # range: an injective hom from G into H gives |G| dividing |H|
+ informal = "Let \\(f : G \\to H\\) be an injective group homomorphism of groups. Then \\(|G|\\) divides \\(|H|\\) (cardinalities are in \\(\\mathbb{N}\\), with 0 for an infinite group)."
+ return informal, [Theorem("card_dvd_of_injective", "%s\n (hf : Function.Injective f) : Nat.card %s ∣ Nat.card %s" % (pre, G, H),
+ "by\n have h1 : Nat.card %s = Nat.card f.range := Nat.card_congr (MonoidHom.ofInjective hf).toEquiv\n rw [h1]\n exact Subgroup.card_subgroup_dvd_card f.range" % G,
+ "Lagrange for an injective homomorphism.")]
+
+FAM = {"involution": involution, "inverse": inverse, "subgroup": subgroup, "hom": hom}
+TITLES = {"involution": "Commutativity from a group law", "inverse": "Inverses and cancellation", "subgroup": "Subgroups and their orders", "hom": "Kernels of group homomorphisms"}
+
+def generate(seed, difficulty, family=None):
+ family = family or sorted(FAMILIES)[seed % len(FAMILIES)]
+ rng = rng_for(ENV + "/" + family, seed, difficulty)
+ informal, theorems = FAM[family](rng, difficulty)
+ return Task(env=ENV, family=family, seed=seed, difficulty=difficulty, kind="prove",
+ title=TITLES[family], informal="Prove the following statement.\n\n" + informal, theorems=theorems)
diff --git a/envs/inequalities/__init__.py b/envs/inequalities/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/envs/inequalities/env.toml b/envs/inequalities/env.toml
new file mode 100644
index 0000000000000000000000000000000000000000..2bda664431c4a29595366bdd17369b4c8fbd5d41
--- /dev/null
+++ b/envs/inequalities/env.toml
@@ -0,0 +1,8 @@
+name = "inequalities"
+title = "Inequalities over the reals"
+msc = "26"
+kind = "prove"
+summary = "Prove real inequalities: AM-GM, Cauchy-Schwarz, absolute values and monotone functions, with hints, case splits and lemma reuse."
+skill = "Real inequalities with nlinarith hints"
+good_for = ["nlinarith with hints", "abs_le and case splits", "field_simp then positivity", "monotonicity lemmas"]
+families = ["abs_ineq", "amgm", "cauchy", "monotone"]
diff --git a/envs/inequalities/gen.py b/envs/inequalities/gen.py
new file mode 100644
index 0000000000000000000000000000000000000000..fe4bd49c2e4a1178690059a46460b5367183676b
--- /dev/null
+++ b/envs/inequalities/gen.py
@@ -0,0 +1,305 @@
+"""Inequalities over the reals (MSC 26: real functions; 26D05, 26D07, 26D15 inequalities).
+
+Families:
+ amgm AM-GM in two or three variables (squares, field_simp then positivity, a cross-lemma step);
+ cauchy Cauchy-Schwarz small cases, including the bound u x + v y <= w when x^2 + y^2 <= 1;
+ abs_ineq absolute-value inequalities (abs_le, case splits on abs_cases, a product bound);
+ monotone inequalities between values of increasing functions (exp, arctan, sinh, odd powers, sqrt, log).
+Second code path: every numeric constant and every inequality is rechecked in Python with exact
+fractions (or a float grid for transcendental functions) before the task is returned.
+"""
+import math
+from fractions import Fraction as F
+from arena.core import Task, Theorem, rng_for
+
+ENV = "inequalities"
+FAMILIES = ["abs_ineq", "amgm", "cauchy", "monotone"]
+
+
+def mono(c, body):
+ return body if c == 1 else "%d * %s" % (c, body)
+
+
+def tmono(c, body):
+ return body if c == 1 else "%d%s" % (c, body)
+
+
+def sgn_term(c, body, first=False, tex=False):
+ """' + c * body' / ' - |c| * body' (or without sign when first)."""
+ mag = abs(c)
+ b = (body if mag == 1 else ("%d%s" % (mag, body) if tex else "%d * %s" % (mag, body)))
+ if first: return ("-" if c < 0 else "") + b
+ return (" - " if c < 0 else " + ") + b
+
+
+def shift(var, c):
+ """Lean text of var + c (c an integer)."""
+ if c == 0: return var
+ return "%s + %d" % (var, c) if c > 0 else "%s - %d" % (var, -c)
+
+
+def tshift(var, c):
+ return shift(var, c)
+
+
+# ---------------------------------------------------------------- amgm
+def amgm(rng, difficulty):
+ if difficulty == 1:
+ if rng.random() < 0.5:
+ p, q = rng.randrange(1, 10), rng.randrange(1, 10)
+ K = 4 * p * q
+ for a in range(-4, 5):
+ for b in range(-4, 5): assert K * a * b <= (p * a + q * b) ** 2
+ lhs = "%s * a * b" % K
+ pa, qb = mono(p, "a"), mono(q, "b")
+ informal = "Prove that for all real numbers \\(a\\) and \\(b\\), \\[%d\\,ab \\le (%s + %s)^2.\\]" % (K, tmono(p, "a"), tmono(q, "b"))
+ stmt = "(a b : ℝ) :\n %s ≤ (%s + %s) ^ 2" % (lhs, pa, qb)
+ proof = "by\n nlinarith [sq_nonneg (%s - %s)]" % (pa, qb)
+ return informal, [Theorem("two_var_amgm", stmt, proof, "A square-completion bound for two real numbers.")]
+ p, q = rng.randrange(1, 7), rng.randrange(1, 7); s = rng.randrange(1, 41)
+ for a in range(-6, 7):
+ for b in range(-6, 7):
+ if p * a + q * b == s: assert p * q * a * b <= F(s * s, 4)
+ pa, qb = mono(p, "a"), mono(q, "b")
+ informal = ("Let \\(a\\) and \\(b\\) be real numbers with \\(%s + %s = %d\\). Prove that \\[%s \\le \\frac{%d^2}{4}.\\]"
+ % (tmono(p, "a"), tmono(q, "b"), s, tmono(p * q, "ab"), s))
+ stmt = "(a b : ℝ) (h : %s + %s = %d) :\n %s ≤ %d ^ 2 / 4" % (pa, qb, s, mono(p * q, "a * b"), s)
+ proof = ("by\n have h2 : (%s + %s) ^ 2 = %d ^ 2 := by rw [h]\n nlinarith [sq_nonneg (%s - %s), h2]" % (pa, qb, s, pa, qb))
+ return informal, [Theorem("amgm_constraint", stmt, proof, "The product is at most a quarter of the squared sum.")]
+ if difficulty == 2:
+ m, u, v = rng.randrange(1, 5), rng.randrange(1, 6), rng.randrange(1, 6)
+ k1, k2, T = m * u * u, m * v * v, 2 * m * u * v
+ for a in (F(1, 3), F(2), F(7, 5), F(5)):
+ for b in (F(1, 2), F(3), F(11, 7), F(1)):
+ assert k1 * (a / b) + k2 * (b / a) - T == m * (u * a - v * b) ** 2 / (a * b) >= 0
+ if rng.random() < 0.5:
+ informal = ("Let \\(a\\) and \\(b\\) be positive real numbers. Prove that \\[%d \\le %s\\frac{a}{b} + %s\\frac{b}{a}.\\]" % (T, tmono(k1, ""), tmono(k2, "")))
+ stmt = "(a b : ℝ) (ha : 0 < a) (hb : 0 < b) :\n %d ≤ %s + %s" % (T, mono(k1, "(a / b)"), mono(k2, "(b / a)"))
+ key = "%s + %s - %d = %d * (%s - %s) ^ 2 / (a * b)" % (mono(k1, "(a / b)"), mono(k2, "(b / a)"), T, m, mono(u, "a"), mono(v, "b"))
+ proof = ("by\n have ha' := ha.ne'\n have hb' := hb.ne'\n have key : %s := by\n field_simp\n ring\n"
+ " have h : 0 ≤ %d * (%s - %s) ^ 2 / (a * b) := by positivity\n linarith" % (key, m, mono(u, "a"), mono(v, "b")))
+ return informal, [Theorem("amgm_ratio", stmt, proof, "A weighted sum of a ratio and its reciprocal is bounded below.")]
+ informal = "Let \\(x\\) be a positive real number. Prove that \\[%d \\le %s + \\frac{%d}{x}.\\]" % (T, tmono(k1, "x"), k2)
+ stmt = "(x : ℝ) (hx : 0 < x) :\n %d ≤ %s + %d / x" % (T, mono(k1, "x"), k2)
+ key = "%s + %d / x - %d = %d * (%s - %d) ^ 2 / x" % (mono(k1, "x"), k2, T, m, mono(u, "x"), v)
+ proof = ("by\n have hx' := hx.ne'\n have key : %s := by\n field_simp\n ring\n"
+ " have h : 0 ≤ %d * (%s - %d) ^ 2 / x := by positivity\n linarith" % (key, m, mono(u, "x"), v))
+ return informal, [Theorem("amgm_linear_plus_inverse", stmt, proof, "The sum of a linear term and an inverse term is bounded below.")]
+ p, q, r = rng.randrange(1, 8), rng.randrange(1, 8), rng.randrange(1, 8)
+ P = p * q * r
+ for a in (F(1), F(2, 3), F(5), F(0)):
+ for b in (F(3, 2), F(1, 7), F(4)):
+ for c in (F(2), F(9, 4), F(0)):
+ assert 27 * P * a * b * c <= (p * a + q * b + r * c) ** 3
+ pa, qb, rc = mono(p, "a"), mono(q, "b"), mono(r, "c")
+ informal = ("Prove that \\(27xyz \\le (x+y+z)^3\\) for all non-negative real numbers \\(x, y, z\\). "
+ "Then prove that for all non-negative real numbers \\(a, b, c\\), \\[%d\\,abc \\le (%s + %s + %s)^3.\\]" % (27 * P, tmono(p, "a"), tmono(q, "b"), tmono(r, "c")))
+ hints = ", ".join("mul_nonneg h%s (sq_nonneg (%s - %s))" % (v, w, z) for v, w, z in
+ [("x", "y", "z"), ("y", "z", "x"), ("z", "x", "y"), ("x", "x", "y"), ("x", "x", "z"), ("y", "y", "x"), ("y", "y", "z"), ("z", "z", "x"), ("z", "z", "y")])
+ lemma = Theorem("amgm_three", "(x y z : ℝ) (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 ≤ z) :\n 27 * x * y * z ≤ (x + y + z) ^ 3",
+ "by\n nlinarith [%s]" % hints, "The three-variable AM-GM inequality in cubic form.")
+ main = Theorem("amgm_three_scaled", "(a b c : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) (hc : 0 ≤ c) :\n %d * a * b * c ≤ (%s + %s + %s) ^ 3" % (27 * P, pa, qb, rc),
+ "by\n have h := amgm_three (%s) (%s) (%s) (by linarith) (by linarith) (by linarith)\n nlinarith [h]" % (pa, qb, rc),
+ "The scaled three-variable inequality.", weight=2.0)
+ return informal, [lemma, main]
+
+
+# ---------------------------------------------------------------- cauchy
+TRIPLES2 = [(3, 4, 5), (5, 12, 13), (8, 15, 17), (7, 24, 25), (20, 21, 29), (6, 8, 10), (9, 12, 15), (12, 16, 20), (15, 8, 17), (12, 5, 13)]
+TRIPLES3 = [(1, 2, 2, 3), (2, 3, 6, 7), (1, 4, 8, 9), (4, 4, 7, 9), (2, 6, 9, 11), (6, 6, 7, 11), (3, 4, 12, 13), (2, 10, 11, 15), (1, 12, 12, 17), (4, 8, 8, 12), (2, 2, 1, 3), (6, 2, 3, 7)]
+
+
+def cauchy(rng, difficulty):
+ if difficulty == 1:
+ if rng.random() < 0.5:
+ p, q = rng.randrange(1, 10), rng.randrange(1, 10); P = p * q
+ for a, b, c, d in [(1, 2, 3, 4), (-2, 5, 1, -1), (3, -3, 2, 7)]:
+ assert (p * a * c + q * b * d) ** 2 <= (p * a * a + q * b * b) * (p * c * c + q * d * d)
+ informal = ("Prove that for all real numbers \\(a, b, c, d\\), \\[(%s + %s)^2 \\le (%s + %s)(%s + %s).\\]"
+ % (tmono(p, "ac"), tmono(q, "bd"), tmono(p, "a^2"), tmono(q, "b^2"), tmono(p, "c^2"), tmono(q, "d^2")))
+ stmt = "(a b c d : ℝ) :\n (%s + %s) ^ 2 ≤ (%s + %s) * (%s + %s)" % (mono(p, "a * c"), mono(q, "b * d"), mono(p, "a ^ 2"), mono(q, "b ^ 2"), mono(p, "c ^ 2"), mono(q, "d ^ 2"))
+ proof = "by\n nlinarith [mul_nonneg (show (0 : ℝ) ≤ %d by norm_num) (sq_nonneg (a * d - b * c))]" % P
+ return informal, [Theorem("weighted_cauchy", stmt, proof, "Cauchy-Schwarz with positive weights for two pairs.")]
+ p, q = rng.randrange(1, 13), rng.randrange(1, 13); S = p * p + q * q
+ for x, y in [(F(1), F(2)), (F(-3), F(5, 2)), (F(0), F(7))]: assert (p * x + q * y) ** 2 <= S * (x * x + y * y)
+ informal = "Prove that for all real numbers \\(x\\) and \\(y\\), \\[(%s + %s)^2 \\le %d\\,(x^2 + y^2).\\]" % (tmono(p, "x"), tmono(q, "y"), S)
+ stmt = "(x y : ℝ) :\n (%s + %s) ^ 2 ≤ %d * (x ^ 2 + y ^ 2)" % (mono(p, "x"), mono(q, "y"), S)
+ proof = "by\n nlinarith [sq_nonneg (%s - %s)]" % (mono(q, "x"), mono(p, "y"))
+ return informal, [Theorem("cauchy_two", stmt, proof, "A two-term Cauchy-Schwarz bound.")]
+ if difficulty == 2:
+ u, v, w = rng.choice(TRIPLES2)
+ if rng.random() < 0.5: u, v = v, u
+ sv = rng.choice([1, -1]); s = rng.randrange(1, 6); B = w * s
+ for k in range(0, 360):
+ x, y = F(s * math.cos(k * math.pi / 180)).limit_denominator(1000), F(s * math.sin(k * math.pi / 180)).limit_denominator(1000)
+ if x * x + y * y <= s * s: assert u * x + sv * v * y <= B
+ form = sgn_term(u, "x", True) + sgn_term(sv * v, "y")
+ tform = sgn_term(u, "x", True, True) + sgn_term(sv * v, "y", False, True)
+ informal = ("Let \\(x\\) and \\(y\\) be real numbers with \\(x^2 + y^2 \\le %d\\). Prove that \\(%s \\le %d\\)." % (s * s, tform, B))
+ stmt = "(x y : ℝ) (h : x ^ 2 + y ^ 2 ≤ %d) :\n %s ≤ %d" % (s * s, form, B)
+ proof = ("by\n have h1 : (%s) ^ 2 ≤ %d ^ 2 := by\n nlinarith [sq_nonneg (%s - %s)]\n by_contra hc\n push_neg at hc\n nlinarith [h1, hc]"
+ % (form, B, mono(v, "x"), ("(%d) * y" % (sv * u)) if sv * u != 1 else "y"))
+ return informal, [Theorem("cauchy_bound_circle", stmt, proof, "A linear form is bounded on a disc by the Cauchy-Schwarz inequality.")]
+ u, v, w, t = rng.choice(TRIPLES3)
+ cs = [u, v, w]; rng.shuffle(cs)
+ cs = [c * rng.choice([1, -1]) for c in cs]
+ s = rng.randrange(1, 5); B = t * s
+ assert sum(c * c for c in cs) == t * t
+ # exact check on the boundary points in the direction of the coefficient vector and a few others
+ for x, y, z in [(F(c * s, t) for c in cs), (F(s, 3), F(-s, 3), F(s, 3)), (F(0), F(s), F(0))]:
+ if x * x + y * y + z * z <= s * s: assert cs[0] * x + cs[1] * y + cs[2] * z <= B
+ form = sgn_term(cs[0], "x", True) + sgn_term(cs[1], "y") + sgn_term(cs[2], "z")
+ tform = sgn_term(cs[0], "x", True, True) + sgn_term(cs[1], "y", False, True) + sgn_term(cs[2], "z", False, True)
+ informal = ("Prove that for all real numbers \\(u, v, w, x, y, z\\), \\[(ux + vy + wz)^2 \\le (u^2 + v^2 + w^2)(x^2 + y^2 + z^2).\\] "
+ "Then let \\(x, y, z\\) be real numbers with \\(x^2 + y^2 + z^2 \\le %d\\) and prove that \\(%s \\le %d\\)." % (s * s, tform, B))
+ lemma = Theorem("cauchy_three", "(u v w x y z : ℝ) :\n (u * x + v * y + w * z) ^ 2 ≤ (u ^ 2 + v ^ 2 + w ^ 2) * (x ^ 2 + y ^ 2 + z ^ 2)",
+ "by\n nlinarith [sq_nonneg (u * y - v * x), sq_nonneg (u * z - w * x), sq_nonneg (v * z - w * y)]",
+ "Cauchy-Schwarz for three-term sums.")
+ inst = " ".join("(%d)" % c if c < 0 else "%d" % c for c in cs)
+ main = Theorem("cauchy_bound_ball", "(x y z : ℝ) (h : x ^ 2 + y ^ 2 + z ^ 2 ≤ %d) :\n %s ≤ %d" % (s * s, form, B),
+ "by\n have h1 := cauchy_three %s x y z\n by_contra hc\n push_neg at hc\n nlinarith [h1, hc]" % inst,
+ "A linear form is bounded on a ball.", weight=2.0)
+ return informal, [lemma, main]
+
+
+# ---------------------------------------------------------------- abs_ineq
+def abs_ineq(rng, difficulty):
+ if difficulty == 1:
+ p, q = rng.randrange(1, 10), rng.randrange(1, 10)
+ a, b = rng.randrange(-9, 10), rng.randrange(-9, 10); r, s = rng.randrange(1, 10), rng.randrange(1, 10)
+ K = p * a - q * b; bound = p * r + q * s
+ for x in (a - r, a + r, a):
+ for y in (b - s, b + s, b): assert abs(p * x - q * y - K) <= bound
+ expr = sgn_term(p, "x", True) + sgn_term(-q, "y") + ((" + %d" % -K if -K > 0 else " - %d" % K) if K != 0 else "")
+ tex = expr.replace(" * ", "")
+ informal = ("Let \\(x\\) and \\(y\\) be real numbers with \\(|%s| \\le %d\\) and \\(|%s| \\le %d\\). Prove that \\(|%s| \\le %d\\)."
+ % (shift("x", -a), r, shift("y", -b), s, tex, bound))
+ stmt = "(x y : ℝ) (hx : |%s| ≤ %d) (hy : |%s| ≤ %d) :\n |%s| ≤ %d" % (shift("x", -a), r, shift("y", -b), s, expr, bound)
+ proof = "by\n rw [abs_le] at hx hy ⊢\n obtain ⟨h1, h2⟩ := hx\n obtain ⟨h3, h4⟩ := hy\n constructor <;> linarith"
+ return informal, [Theorem("abs_linear_bound", stmt, proof, "An error bound for a linear combination.")]
+ if difficulty == 2 and rng.random() < 0.5:
+ p = rng.randrange(1, 7); a = rng.randrange(1, 10); gap = rng.randrange(1, 13); b = a + gap
+ for x in range(-20, 30): assert p * gap <= p * abs(x - a) + p * abs(x - b)
+ K = p * gap
+ informal = "Prove that for every real number \\(x\\), \\[%d \\le %s|x - %d| + %s|x - %d|.\\]" % (K, tmono(p, ""), a, tmono(p, ""), b)
+ stmt = "(x : ℝ) :\n %d ≤ %s + %s" % (K, mono(p, "|x - %d|" % a), mono(p, "|x - %d|" % b))
+ proof = ("by\n rcases abs_cases (x - %d) with ⟨h1, _⟩ | ⟨h1, _⟩ <;> rcases abs_cases (x - %d) with ⟨h2, _⟩ | ⟨h2, _⟩ <;> linarith" % (a, b))
+ return informal, [Theorem("abs_two_points", stmt, proof, "The sum of two distances is at least p times the gap.")]
+ if difficulty == 2:
+ a = rng.choice([c for c in range(-7, 8) if c != 0]); r = rng.randrange(1, 6); A = abs(a)
+ bound = r * (r + 2 * A)
+ for k in range(-20, 21):
+ x = F(a) + F(k, 20) * r
+ assert abs(x * x - a * a) <= bound
+ informal = "Let \\(x\\) be a real number with \\(|%s| \\le %d\\). Prove that \\(|x^2 - %s^2| \\le %d\\)." % (shift("x", -a), r, ("(%d)" % a) if a < 0 else a, bound)
+ ap = "(%d)" % a if a < 0 else "%d" % a
+ stmt = "(x : ℝ) (h : |%s| ≤ %d) :\n |x ^ 2 - %s ^ 2| ≤ %d * (%d + 2 * %d)" % (shift("x", -a), r, ap, r, r, A)
+ informal = informal.replace("\\le %d\\)." % bound, "\\le %d(%d + %d)\\)." % (r, r, 2 * A))
+ proof = ("by\n have h1 : |%s| ≤ %d + 2 * %d := by\n rw [abs_le] at h ⊢\n constructor <;> linarith [h.1, h.2]\n"
+ " have h2 : |x ^ 2 - %s ^ 2| = |%s| * |%s| := by\n rw [← abs_mul]\n congr 1\n ring\n"
+ " rw [h2]\n exact mul_le_mul h h1 (abs_nonneg _) (by norm_num)" % (shift("x", a), r, A, ap, shift("x", -a), shift("x", a)))
+ return informal, [Theorem("abs_square_bound", stmt, proof, "A bound on a difference of squares near a point.")]
+ pts = sorted(rng.randrange(1, 10) for _ in range(4)); a, b, c, e = pts
+ K = (e - a) + (c - b)
+ for x in range(-5, 20): assert K <= abs(x - a) + abs(x - b) + abs(x - c) + abs(x - e)
+ informal = ("Prove that for all real numbers \\(a \\le c\\) and \\(x\\), \\(c - a \\le |x - a| + |x - c|\\). "
+ "Then prove that for every real \\(x\\), \\[%d \\le |x - %d| + |x - %d| + |x - %d| + |x - %d|.\\]" % (K, a, b, c, e))
+ lemma = Theorem("pair_abs_bound", "(x a c : ℝ) (h : a ≤ c) :\n c - a ≤ |x - a| + |x - c|",
+ "by\n rcases abs_cases (x - a) with ⟨h1, _⟩ | ⟨h1, _⟩ <;> rcases abs_cases (x - c) with ⟨h2, _⟩ | ⟨h2, _⟩ <;> linarith",
+ "The sum of the distances to two points is at least their gap.")
+ main = Theorem("four_points_abs", "(x : ℝ) :\n %d ≤ |x - %d| + |x - %d| + |x - %d| + |x - %d|" % (K, a, b, c, e),
+ "by\n have h1 := pair_abs_bound x %d %d (by norm_num)\n have h2 := pair_abs_bound x %d %d (by norm_num)\n linarith" % (a, e, b, c),
+ "The sum of four distances is bounded below.", weight=2.0)
+ return informal, [lemma, main]
+
+
+# ---------------------------------------------------------------- monotone
+# name: (lean template, tex template, python function, proof of T(x) <= T(y) from h [and hx])
+UNCOND = {
+ "exp": ("Real.exp %s", "e^{%s}", math.exp, "Real.exp_le_exp.2 h"),
+ "cube": ("%s ^ 3", "%s^3", lambda t: t ** 3, "(Odd.strictMono_pow (by decide : Odd 3)).monotone h"),
+ "quint": ("%s ^ 5", "%s^5", lambda t: t ** 5, "(Odd.strictMono_pow (by decide : Odd 5)).monotone h"),
+ "arctan": ("Real.arctan %s", "\\arctan %s", math.atan, "Real.arctan_strictMono.monotone h"),
+ "sinh": ("Real.sinh %s", "\\sinh %s", math.sinh, "Real.sinh_strictMono.monotone h"),
+}
+COND = { # need 0 < x
+ "sqrt": ("Real.sqrt %s", "\\sqrt{%s}", math.sqrt, "Real.sqrt_le_sqrt h"),
+ "log": ("Real.log %s", "\\ln %s", math.log, "Real.log_le_log hx h"),
+ "sq": ("%s ^ 2", "%s^2", lambda t: t * t, "pow_le_pow_left₀ hx.le h 2"),
+}
+LOG1SQ = ("Real.log (1 + %s ^ 2)", "\\ln(1 + %s^2)", lambda t: math.log(1 + t * t))
+
+
+def mono_expr(terms, c0, var, tex=False):
+ """terms: list of (coef, template) ; c0 coefficient of the linear term (0 for none)."""
+ parts = []
+ for c, t in terms:
+ parts.append((c, t % var))
+ if c0: parts.append((c0, var))
+ out = ""
+ for i, (c, body) in enumerate(parts):
+ if tex: out += ("" if i == 0 else " + ") + (body if c == 1 else "%d\\,%s" % (c, body))
+ else: out += ("" if i == 0 else " + ") + (body if c == 1 else "%d * %s" % (c, body))
+ return out
+
+
+def monotone(rng, difficulty):
+ names = sorted(UNCOND)
+ if difficulty == 1:
+ n1 = rng.choice(names); c1 = rng.randrange(1, 10); c0 = rng.randrange(0, 10)
+ tm = [(c1, UNCOND[n1][0])]; tt = [(c1, UNCOND[n1][1])]
+ f = lambda t: c1 * UNCOND[n1][2](t) + c0 * t
+ for x, y in [(-1.5, -1.0), (-0.3, 0.2), (0.5, 2.0), (1.0, 1.0)]: assert f(x) <= f(y) + 1e-12
+ informal = "Prove that for all real numbers \\(x \\le y\\), \\[%s \\le %s.\\]" % (mono_expr(tt, c0, "x", True), mono_expr(tt, c0, "y", True))
+ stmt = "(x y : ℝ) (h : x ≤ y) :\n %s ≤ %s" % (mono_expr(tm, c0, "x"), mono_expr(tm, c0, "y"))
+ have = " have h1 : %s ≤ %s := %s" % (UNCOND[n1][0] % "x", UNCOND[n1][0] % "y", UNCOND[n1][3])
+ return informal, [Theorem("monotone_sum", stmt, "by\n%s\n linarith" % have, "The function is non-decreasing.")]
+ if difficulty == 2:
+ k = rng.choice([2, 3]); chosen = rng.sample(names, k)
+ cs = [rng.randrange(1, 7) for _ in chosen]; c0 = rng.choice([0, 0, rng.randrange(1, 6)])
+ tm = [(c, UNCOND[n][0]) for c, n in zip(cs, chosen)]; tt = [(c, UNCOND[n][1]) for c, n in zip(cs, chosen)]
+ f = lambda t: sum(c * UNCOND[n][2](t) for c, n in zip(cs, chosen)) + c0 * t
+ for x, y in [(-1.5, -1.0), (-0.3, 0.2), (0.5, 2.0), (-2.0, 2.0)]: assert f(x) <= f(y) + 1e-12
+ informal = "Prove that the function \\(f(x) = %s\\) is monotone on the real numbers: \\(x \\le y\\) implies \\(f(x) \\le f(y)\\)." % mono_expr(tt, c0, "x", True)
+ stmt = ": Monotone (fun x : ℝ => %s)" % mono_expr(tm, c0, "x")
+ haves = "\n".join(" have h%d : %s ≤ %s := %s" % (i + 1, UNCOND[n][0] % "x", UNCOND[n][0] % "y", UNCOND[n][3]) for i, n in enumerate(chosen))
+ proof = "by\n intro x y h\n%s\n show %s ≤ %s\n linarith" % (haves, mono_expr(tm, c0, "x"), mono_expr(tm, c0, "y"))
+ return informal, [Theorem("monotone_function", stmt, proof, "The function is monotone.")]
+ cn = rng.sample(sorted(COND), rng.choice([1, 2])); un = rng.sample(names, rng.choice([1, 2]))
+ c_log = rng.randrange(1, 6)
+ items = [(rng.randrange(1, 6), "u", n) for n in un] + [(rng.randrange(1, 6), "c", n) for n in cn]
+ rng.shuffle(items)
+ items.append((c_log, "l", "log1sq"))
+ tm = []; tt = []
+ for c, kind, n in items:
+ tpl = LOG1SQ if kind == "l" else (UNCOND if kind == "u" else COND)[n]
+ tm.append((c, tpl[0])); tt.append((c, tpl[1]))
+ def pyf(t):
+ s = 0.0
+ for c, kind, n in items:
+ fn = LOG1SQ[2] if kind == "l" else (UNCOND if kind == "u" else COND)[n][2]
+ s += c * fn(t)
+ return s
+ for x, y in [(0.1, 0.5), (0.5, 0.5), (0.3, 4.0), (1.0, 9.0)]: assert pyf(x) <= pyf(y) + 1e-12
+ informal = ("Prove that \\(0 \\le \\ln(1 + y^2) - \\ln(1 + x^2)\\) for real numbers \\(0 < x \\le y\\). Then prove that for such \\(x, y\\), \\[0 \\le \\left(%s\\right) - \\left(%s\\right).\\]"
+ % (mono_expr(tt, 0, "y", True), mono_expr(tt, 0, "x", True)))
+ lemma = Theorem("log_one_add_sq_mono", "(x y : ℝ) (hx : 0 < x) (h : x ≤ y) :\n 0 ≤ Real.log (1 + y ^ 2) - Real.log (1 + x ^ 2)",
+ "by\n have hy : 0 < y := lt_of_lt_of_le hx h\n have h3 : Real.log (1 + x ^ 2) ≤ Real.log (1 + y ^ 2) := by\n apply Real.log_le_log (by positivity)\n nlinarith [mul_pos hx hy, mul_nonneg (sub_nonneg.2 h) hx.le]\n linarith",
+ "The logarithm of one plus a square is increasing on the positive reals.")
+ haves = []
+ for i, (c, kind, n) in enumerate(items):
+ if kind == "l":
+ haves.append(" have h%d := log_one_add_sq_mono x y hx h" % (i + 1)); continue
+ tpl, pr = (UNCOND if kind == "u" else COND)[n][0], (UNCOND if kind == "u" else COND)[n][3]
+ haves.append(" have h%d : %s ≤ %s := %s" % (i + 1, tpl % "x", tpl % "y", pr))
+ main = Theorem("monotone_combination", "(x y : ℝ) (hx : 0 < x) (h : x ≤ y) :\n 0 ≤ (%s) - (%s)" % (mono_expr(tm, 0, "y"), mono_expr(tm, 0, "x")),
+ "by\n%s\n linarith" % "\n".join(haves), "The combination is non-decreasing on the positive reals.", weight=2.0)
+ return informal, [lemma, main]
+
+
+def generate(seed, difficulty, family=None):
+ family = family or sorted(FAMILIES)[seed % len(FAMILIES)]
+ rng = rng_for(ENV + "/" + family, seed, difficulty)
+ informal, theorems = {"amgm": amgm, "cauchy": cauchy, "abs_ineq": abs_ineq, "monotone": monotone}[family](rng, difficulty)
+ return Task(env=ENV, family=family, seed=seed, difficulty=difficulty, kind="prove",
+ title="Prove an inequality over the reals", informal=informal, theorems=theorems)
diff --git a/envs/linear_algebra/__init__.py b/envs/linear_algebra/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/envs/linear_algebra/env.toml b/envs/linear_algebra/env.toml
new file mode 100644
index 0000000000000000000000000000000000000000..b26056e61e372637d7cbbd3726491eeaba899e94
--- /dev/null
+++ b/envs/linear_algebra/env.toml
@@ -0,0 +1,8 @@
+name = "linear-algebra"
+title = "Proofs about matrices and vector spaces"
+msc = "15"
+kind = "prove"
+summary = "Prove facts about 2x2 matrices, matrix powers, linear independence of explicit vectors, and kernels, ranges and projections of linear maps."
+skill = "Matrix computation and linear map API"
+good_for = ["Matrix.det_fin_two and trace identities", "induction on matrix powers", "LinearMap.ker and range"]
+families = ["det_trace", "independence", "linear_map", "matrix_pow"]
diff --git a/envs/linear_algebra/gen.py b/envs/linear_algebra/gen.py
new file mode 100644
index 0000000000000000000000000000000000000000..4491908c4910792420eba3561f94eee519fab061
--- /dev/null
+++ b/envs/linear_algebra/gen.py
@@ -0,0 +1,322 @@
+"""Linear algebra (MSC 15: linear and multilinear algebra, matrix theory).
+
+Families: det_trace (determinant, trace and Cayley-Hamilton for 2x2 integer matrices),
+matrix_pow (closed forms for powers of 2x2 matrices by induction), independence (linear
+independence or dependence of explicit vectors in Fin 2 -> Q and Fin 3 -> Q), linear_map
+(kernel, range and idempotent maps on vector spaces).
+Second code path: every numeric claim is re-checked in Python with exact integer or Fraction
+arithmetic (matrix products, determinants, Gaussian elimination) before the task is returned;
+the Lean reference proofs are compiled in the self-test.
+"""
+from fractions import Fraction as F
+from arena.core import Task, Theorem, rng_for
+
+ENV = "linear_algebra"
+FAMILIES = ["det_trace", "independence", "linear_map", "matrix_pow"]
+M2 = "Matrix (Fin 2) (Fin 2) ℤ"
+
+def mm(A, B): return [[sum(A[i][k] * B[k][j] for k in range(2)) for j in range(2)] for i in range(2)]
+def det2(A): return A[0][0] * A[1][1] - A[0][1] * A[1][0]
+def tr2(A): return A[0][0] + A[1][1]
+def mat(A): return "!![%s]" % "; ".join(", ".join(str(x) for x in row) for row in A)
+def tex(A): return "\\begin{pmatrix} %s \\end{pmatrix}" % " \\\\ ".join(" & ".join(str(x) for x in row) for row in A)
+def rmat(rng, lo, hi): return [[rng.randrange(lo, hi + 1) for _ in range(2)] for _ in range(2)]
+def zn(x): return "(%d : ℤ)" % x
+def num(x): return "(%d : ℤ)" % x if x < 0 else str(x)
+
+FIN2 = "rw [Matrix.one_fin_two, Matrix.mul_fin_two]\n ext i j\n fin_cases i <;> fin_cases j <;> simp <;> ring"
+
+# ---------------------------------------------------------------- det_trace
+
+CAYLEY = Theorem("cayley_hamilton_two", "(A : %s) :\n A ^ 2 = Matrix.trace A • A - Matrix.det A • (1 : %s)" % (M2, M2),
+ "by\n rw [Matrix.eta_fin_two A, Matrix.one_fin_two, pow_two, Matrix.mul_fin_two, Matrix.trace_fin_two, Matrix.det_fin_two]\n ext i j\n fin_cases i <;> fin_cases j <;> simp <;> ring",
+ "Cayley-Hamilton for 2x2 integer matrices.", 0.4)
+
+def det_trace(rng, difficulty):
+ kind = rng.choice({1: ["detprod", "adjugate"], 2: ["charpoly", "cayley", "detprodx"], 3: ["cayley3", "trace_sq"]}[difficulty])
+ if kind in ("detprod", "detprod3"):
+ k = 2 if kind == "detprod" else 3
+ Ms = [rmat(rng, -3, 4) for _ in range(k)]
+ P = Ms[0]
+ for X in Ms[1:]: P = mm(P, X)
+ v = 1
+ for X in Ms: v *= det2(X)
+ assert det2(P) == v and all(det2(mm(X, Y)) == det2(X) * det2(Y) for X in Ms for Y in Ms)
+ if abs(v) < 2 and difficulty > 1: return det_trace(rng, difficulty)
+ prod = " * ".join(mat(X) for X in Ms)
+ rw = ", ".join(["Matrix.det_mul"] * (k - 1) + ["Matrix.det_fin_two_of"] * k)
+ informal = "Compute the determinant of the product %s of integer matrices. Show that it equals %d." % (" ".join("\\(%s\\)" % tex(X) for X in Ms), v)
+ return informal, [Theorem("det_of_product", ": Matrix.det (%s : %s) = %s" % (prod, M2, num(v)), "by\n rw [%s]\n norm_num" % rw, "The determinant of the product is the product of the determinants.")]
+ if kind == "detprodx":
+ p, q, r, s_ = [rng.randrange(-3, 4) for _ in range(4)]; u, v, w = [rng.randrange(-3, 4) for _ in range(3)]
+ A = lambda x: [[x + p, q], [r, x + s_]]; B = lambda x: [[x, u], [v, x + w]]
+ pa = [p * s_ - q * r, p + s_, 1]; pb = [-u * v, w, 1]
+ prod = [sum(pa[i] * pb[k - i] for i in range(3) if 0 <= k - i < 3) for k in range(5)]
+ for x in range(-4, 5):
+ assert det2(mm(A(x), B(x))) == sum(c * x ** i for i, c in enumerate(prod))
+ if prod[0] == 0 and prod[1] == 0: return det_trace(rng, difficulty)
+ def e(c): return "x + %d" % c if c >= 0 else "x - %d" % -c
+ La = "!![%s, %d; %d, %s]" % (e(p), q, r, e(s_)); Lb = "!![x, %d; %d, %s]" % (u, v, e(w))
+ poly = " + ".join("%d * x ^ %d" % (c, i) if i > 1 else ("%d * x" % c if i == 1 else "%d" % c) for i, c in reversed(list(enumerate(prod))) if c)
+ poly = poly.replace("+ -", "- ").replace("1 * x", "x") if False else poly
+ def poly_str(cs, times, pw):
+ out = ""
+ for i in range(len(cs) - 1, -1, -1):
+ c = cs[i]
+ if not c: continue
+ mag = abs(c); body = ("%d" % mag) if i == 0 else (("x" if i == 1 else pw % i) if mag == 1 else "%d%sx%s" % (mag, times, "" if i == 1 else pw % i if False else (pw % i)[1:]) if False else (("%d%s" % (mag, times) + ("x" if i == 1 else pw % i))))
+ out += (("-" if c < 0 else "") + body) if not out else (" - " if c < 0 else " + ") + body
+ return out
+ stmt = "(x : ℤ) :\n Matrix.det (%s * %s : %s) = %s" % (La, Lb, M2, poly_str(prod, " * ", "x ^ %d"))
+ informal = "For every integer \\(x\\), the determinant of \\[\\begin{pmatrix} x%+d & %d \\\\ %d & x%+d \\end{pmatrix}\\begin{pmatrix} x & %d \\\\ %d & x%+d \\end{pmatrix}\\] equals \\(%s\\)." % (
+ p, q, r, s_, u, v, w, poly_str(prod, "", "x^%d"))
+ return informal, [Theorem("det_of_polynomial_product", stmt, "by\n rw [Matrix.det_mul, Matrix.det_fin_two_of, Matrix.det_fin_two_of]\n ring", "The determinant of a product of matrices with a variable entry.")]
+ if kind == "adjugate":
+ p, q, r, s = [rng.randrange(-3, 5) for _ in range(4)]
+ A = lambda x: [[x + p, q], [r, x + s]]; Adj = lambda x: [[x + s, -q], [-r, x + p]]
+ for x in range(-4, 5):
+ P = mm(A(x), Adj(x)); d = x * x + (p + s) * x + (p * s - q * r)
+ assert P == [[d, 0], [0, d]]
+ def ent(top, a, b): return "x + %d" % top if top >= 0 else "x - %d" % -top
+ def e(c): return "x + %d" % c if c >= 0 else "x - %d" % -c
+ L = "!![%s, %d; %d, %s]" % (e(p), q, r, e(s)); R = "!![%s, %d; %d, %s]" % (e(s), -q, -r, e(p))
+ poly = "x ^ 2 + %d * x + %d" % (p + s, p * s - q * r)
+ stmt = "(x : ℤ) :\n %s * %s = (%s) • (1 : %s)" % (L, R, poly, M2)
+ proof = "by\n " + FIN2
+ informal = "For every integer \\(x\\), \\[\\begin{pmatrix} x%+d & %d \\\\ %d & x%+d \\end{pmatrix}\\begin{pmatrix} x%+d & %d \\\\ %d & x%+d \\end{pmatrix} = (x^2 %+d x %+d) \\begin{pmatrix} 1 & 0 \\\\ 0 & 1 \\end{pmatrix}.\\]" % (p, q, r, s, s, -q, -r, p, p + s, p * s - q * r)
+ return informal, [Theorem("adjugate_product", stmt, proof, "A matrix times its adjugate is its determinant times the identity.")]
+ if kind == "charpoly":
+ A = rmat(rng, -3, 4)
+ T, D = tr2(A), det2(A)
+ for x in range(-5, 6): assert det2([[x - A[0][0], -A[0][1]], [-A[1][0], x - A[1][1]]]) == x * x - T * x + D
+ poly = "x ^ 2 - %s * x + %s" % (num(T), num(D))
+ stmt = "(x : ℤ) :\n Matrix.det (x • (1 : %s) - %s) = %s" % (M2, mat(A), poly)
+ informal = "For every integer \\(x\\), the determinant of \\(x I - %s\\), where \\(I\\) is the \\(2 \\times 2\\) identity matrix, equals \\(x^2 - (%d)x + (%d)\\)." % ("\\(%s\\)" % tex(A) if False else tex(A), T, D)
+ informal = "For every integer \\(x\\), \\[\\det\\left(x I - %s\\right) = x^2 - (%d)\\,x + (%d),\\] where \\(I\\) is the \\(2 \\times 2\\) identity matrix." % (tex(A), T, D)
+ return informal, [Theorem("char_poly_value", stmt, "by\n rw [Matrix.one_fin_two, Matrix.det_fin_two]\n simp\n ring", "The characteristic polynomial of a 2x2 matrix is x^2 - tr x + det.")]
+ # Cayley-Hamilton based
+ t, d = rng.randrange(-3, 4), rng.randrange(-4, 5)
+ # second path: A^2 - tr A + det I = 0 on random integer matrices
+ for _ in range(20):
+ B = rmat(rng, -5, 5); B2 = mm(B, B)
+ for i in range(2):
+ for j in range(2): assert B2[i][j] - tr2(B) * B[i][j] + det2(B) * (1 if i == j else 0) == 0
+ B3 = mm(B2, B)
+ for i in range(2):
+ for j in range(2): assert B3[i][j] == (tr2(B) ** 2 - det2(B)) * B[i][j] - tr2(B) * det2(B) * (1 if i == j else 0)
+ assert tr2(B2) == tr2(B) ** 2 - 2 * det2(B)
+ hyps = "(ht : Matrix.trace A = %s) (hd : Matrix.det A = %s)" % (zn(t), zn(d))
+ words = "Let \\(A\\) be a \\(2 \\times 2\\) integer matrix with trace %d and determinant %d. " % (t, d)
+ if kind == "cayley":
+ stmt = "(A : %s) %s :\n A ^ 2 = %s • A - %s • (1 : %s)" % (M2, hyps, zn(t), zn(d), M2)
+ proof = ("by\n have key : A ^ 2 = Matrix.trace A • A - Matrix.det A • (1 : %s) := by\n rw [Matrix.eta_fin_two A, Matrix.one_fin_two, pow_two, Matrix.mul_fin_two, Matrix.trace_fin_two, Matrix.det_fin_two]\n"
+ " ext i j\n fin_cases i <;> fin_cases j <;> simp <;> ring\n rw [key, ht, hd]") % M2
+ return words + "Then \\(A^2 = %d A - %d I\\), where \\(I\\) is the identity matrix." % (t, d), [Theorem("square_of_matrix", stmt, proof, "A^2 = tr(A) A - det(A) I with the given trace and determinant.")]
+ if kind == "cayley3":
+ stmt = "(A : %s) %s :\n A ^ 3 = %s • A - %s • (1 : %s)" % (M2, hyps, zn(t * t - d), zn(t * d), M2)
+ proof = ("by\n have h2 := cayley_hamilton_two A\n rw [ht, hd] at h2\n calc A ^ 3 = A * A ^ 2 := by rw [pow_succ']\n _ = A * (%s • A - %s • (1 : %s)) := by rw [h2]\n"
+ " _ = %s • (A * A) - %s • A := by simp only [mul_sub, mul_smul_comm, mul_one]\n _ = %s • (%s • A - %s • (1 : %s)) - %s • A := by rw [← pow_two, h2]\n"
+ " _ = %s • A - %s • (1 : %s) := by module") % (zn(t), zn(d), M2, zn(t), zn(d), zn(t), zn(t), zn(d), M2, zn(d), zn(t * t - d), zn(t * d), M2)
+ main = Theorem("cube_of_matrix", stmt, proof, "A^3 in terms of the trace and determinant.", 0.6)
+ return words + "Then \\(A^3 = %d A - %d I\\), where \\(I\\) is the identity matrix. You may first prove \\(A^2 = (\\operatorname{tr} A) A - (\\det A) I\\) for every \\(2 \\times 2\\) integer matrix." % (t * t - d, t * d), [CAYLEY, main]
+ stmt = "(A : %s) %s :\n Matrix.trace (A ^ 2) = %s" % (M2, hyps, num(t * t - 2 * d))
+ proof = "by\n rw [cayley_hamilton_two A, Matrix.trace_sub, Matrix.trace_smul, Matrix.trace_smul, Matrix.trace_one, ht, hd]\n norm_num"
+ main = Theorem("trace_of_square", stmt, proof, "The trace of A^2 from the trace and determinant of A.", 0.6)
+ return words + "Then the trace of \\(A^2\\) is %d. You may first prove \\(A^2 = (\\operatorname{tr} A) A - (\\det A) I\\) for every \\(2 \\times 2\\) integer matrix." % (t * t - 2 * d), [CAYLEY, main]
+
+# ---------------------------------------------------------------- matrix_pow
+
+def matrix_pow(rng, difficulty):
+ kind = rng.choice({1: ["shear", "shear", "lower"], 2: ["diag", "jordan", "shear2"], 3: ["affine", "shearprod", "affine"]}[difficulty])
+ ind = "by\n induction n with\n | zero =>\n ext i j\n fin_cases i <;> fin_cases j <;> simp\n | succ j ih =>\n rw [pow_succ, ih, Matrix.mul_fin_two]\n ext i j\n fin_cases i <;> fin_cases j <;> simp <;> ring"
+ def check(A, form, extra=lambda n: n):
+ P = [[1, 0], [0, 1]]
+ for n in range(7):
+ assert P == form(n), (A, n, P, form(n))
+ P = mm(P, A)
+ if kind == "shear":
+ k = rng.choice([1, 2, 3, 4, 5, 7, -1, -2, -3])
+ check([[1, k], [0, 1]], lambda n: [[1, n * k], [0, 1]])
+ stmt = "(n : ℕ) :\n (!![1, %s; 0, 1] : %s) ^ n = !![1, (n : ℤ) * %s; 0, 1]" % (k, M2, num(k))
+ informal = "For every natural number \\(n\\), \\[\\begin{pmatrix} 1 & %d \\\\ 0 & 1 \\end{pmatrix}^n = \\begin{pmatrix} 1 & %dn \\\\ 0 & 1 \\end{pmatrix}.\\]" % (k, k)
+ return informal, [Theorem("shear_power", stmt, ind, "Powers of a shear matrix.")]
+ if kind == "lower":
+ k = rng.choice([1, 2, 3, 4, 5, 6, -1, -2, -4])
+ check([[1, 0], [k, 1]], lambda n: [[1, 0], [n * k, 1]])
+ stmt = "(n : ℕ) :\n (!![1, 0; %s, 1] : %s) ^ n = !![1, 0; (n : ℤ) * %s, 1]" % (k, M2, num(k))
+ informal = "For every natural number \\(n\\), \\[\\begin{pmatrix} 1 & 0 \\\\ %d & 1 \\end{pmatrix}^n = \\begin{pmatrix} 1 & 0 \\\\ %dn & 1 \\end{pmatrix}.\\]" % (k, k)
+ return informal, [Theorem("lower_shear_power", stmt, ind, "Powers of a lower shear matrix.")]
+ if kind == "diag":
+ p, q = rng.sample([2, 3, 4, 5, -2, -3, 6, 7], 2)
+ check([[p, 0], [0, q]], lambda n: [[p ** n, 0], [0, q ** n]])
+ stmt = "(n : ℕ) :\n (!![%s, 0; 0, %s] : %s) ^ n = !![%s ^ n, 0; 0, %s ^ n]" % (num(p), num(q), M2, num(p), num(q))
+ informal = "For every natural number \\(n\\), \\[\\begin{pmatrix} %d & 0 \\\\ 0 & %d \\end{pmatrix}^n = \\begin{pmatrix} (%d)^n & 0 \\\\ 0 & (%d)^n \\end{pmatrix}.\\]" % (p, q, p, q)
+ return informal, [Theorem("diagonal_power", stmt, ind, "Powers of a diagonal matrix.")]
+ if kind == "jordan":
+ p = rng.choice([2, 3, 4, 5, -2, -3, 6])
+ check([[p, 1], [0, p]], lambda n: [[p ** n, n * p ** (n - 1) if n else 0], [0, p ** n]])
+ stmt = "(n : ℕ) :\n (!![%s, 1; 0, %s] : %s) ^ (n + 1) = !![%s ^ (n + 1), ((n : ℤ) + 1) * %s ^ n; 0, %s ^ (n + 1)]" % (num(p), num(p), M2, num(p), num(p), num(p))
+ proof = "by\n induction n with\n | zero =>\n ext i j\n fin_cases i <;> fin_cases j <;> simp\n | succ j ih =>\n rw [pow_succ, ih, Matrix.mul_fin_two]\n ext i j\n fin_cases i <;> fin_cases j <;> simp [pow_succ] <;> ring"
+ informal = "For every natural number \\(n\\), \\[\\begin{pmatrix} %d & 1 \\\\ 0 & %d \\end{pmatrix}^{n+1} = \\begin{pmatrix} (%d)^{n+1} & (n+1)(%d)^n \\\\ 0 & (%d)^{n+1} \\end{pmatrix}.\\]" % (p, p, p, p, p)
+ return informal, [Theorem("jordan_power", stmt, proof, "Powers of a 2x2 Jordan block.")]
+ if kind == "shear2":
+ k, l = rng.sample([1, 2, 3, 4, 5, -1, -2], 2)
+ check([[1, k], [l * 0, 1]], lambda n: [[1, n * k], [0, 1]])
+ a = rng.choice([2, 3, 4, 5]); b = rng.choice([1, 2, 3, 4, 5, 6])
+ # (diag(1,1) shear)^n times a scalar: (a * S)^n = a^n * S^n
+ stmt = "(n : ℕ) :\n (!![%d, %d; 0, %d] : %s) ^ n = !![(%d : ℤ) ^ n, (n : ℤ) * %d * %d ^ (n - 1); 0, (%d : ℤ) ^ n]" % (a, a * k, a, M2, a, a * k, a, a) if False else None
+ # an exact variant: lower triangular with equal diagonal: !![a, 0; 1, a]^(n+1)
+ check([[a, 0], [1, a]], lambda n: [[a ** n, 0], [n * a ** (n - 1) if n else 0, a ** n]])
+ stmt = "(n : ℕ) :\n (!![%d, 0; 1, %d] : %s) ^ (n + 1) = !![(%d : ℤ) ^ (n + 1), 0; ((n : ℤ) + 1) * %d ^ n, (%d : ℤ) ^ (n + 1)]" % (a, a, M2, a, a, a)
+ proof = "by\n induction n with\n | zero =>\n ext i j\n fin_cases i <;> fin_cases j <;> simp\n | succ j ih =>\n rw [pow_succ, ih, Matrix.mul_fin_two]\n ext i j\n fin_cases i <;> fin_cases j <;> simp [pow_succ] <;> ring"
+ informal = "For every natural number \\(n\\), \\[\\begin{pmatrix} %d & 0 \\\\ 1 & %d \\end{pmatrix}^{n+1} = \\begin{pmatrix} %d^{n+1} & 0 \\\\ (n+1)\\,%d^{n} & %d^{n+1} \\end{pmatrix}.\\]" % (a, a, a, a, a)
+ return informal, [Theorem("lower_jordan_power", stmt, proof, "Powers of a lower 2x2 Jordan block.")]
+ if kind == "affine":
+ a = rng.choice([2, 3, 4, 5, -2, -3]); b = rng.choice([1, 2, 3, 4, 5, 6, -1, -2])
+ check([[a, b], [0, 1]], lambda n: [[a ** n, b * sum(a ** i for i in range(n))], [0, 1]])
+ stmt = "(n : ℕ) :\n (!![%s, %s; 0, 1] : %s) ^ n = !![%s ^ n, %s * ∑ i ∈ Finset.range n, %s ^ i; 0, 1]" % (num(a), num(b), M2, num(a), num(b), num(a))
+ proof = "by\n induction n with\n | zero =>\n ext i j\n fin_cases i <;> fin_cases j <;> simp\n | succ j ih =>\n rw [pow_succ, ih, Matrix.mul_fin_two]\n ext i j\n fin_cases i <;> fin_cases j <;> simp [Finset.sum_range_succ, pow_succ] <;> ring"
+ informal = "For every natural number \\(n\\), \\[\\begin{pmatrix} %d & %d \\\\ 0 & 1 \\end{pmatrix}^n = \\begin{pmatrix} (%d)^n & %d \\sum_{i=0}^{n-1} (%d)^i \\\\ 0 & 1 \\end{pmatrix}.\\] The sum is empty when \\(n = 0\\)." % (a, b, a, b, a)
+ return informal, [Theorem("affine_power", stmt, proof, "Powers of an affine map matrix, with a geometric sum.")]
+ k, l = rng.sample([1, 2, 3, 4, 5, 6, -1, -2, -3], 2)
+ for n in range(5):
+ for m in range(5): assert mm([[1, n * k], [0, 1]], [[1, m * l], [0, 1]]) == [[1, n * k + m * l], [0, 1]]
+ lem = Theorem("shear_power", "(k : ℤ) (n : ℕ) :\n (!![1, k; 0, 1] : %s) ^ n = !![1, (n : ℤ) * k; 0, 1]" % M2, ind, "Powers of a shear matrix.", 0.4)
+ main = Theorem("shear_product", "(n m : ℕ) :\n (!![1, %s; 0, 1] : %s) ^ n * (!![1, %s; 0, 1] : %s) ^ m = !![1, (n : ℤ) * %s + (m : ℤ) * %s; 0, 1]" % (num(k), M2, num(l), M2, num(k), num(l)),
+ "by\n rw [shear_power, shear_power, Matrix.mul_fin_two]\n ext i j\n fin_cases i <;> fin_cases j <;> simp <;> ring", "A product of powers of two shears.", 0.6)
+ informal = ("For every integer \\(k\\) and natural number \\(n\\), \\[\\begin{pmatrix} 1 & k \\\\ 0 & 1 \\end{pmatrix}^n = \\begin{pmatrix} 1 & nk \\\\ 0 & 1 \\end{pmatrix}.\\] "
+ "Deduce that for all natural numbers \\(n, m\\), \\[\\begin{pmatrix} 1 & %d \\\\ 0 & 1 \\end{pmatrix}^n \\begin{pmatrix} 1 & %d \\\\ 0 & 1 \\end{pmatrix}^m = \\begin{pmatrix} 1 & %dn + %dm \\\\ 0 & 1 \\end{pmatrix}.\\]" % (k, l, k, l))
+ return informal, [lem, main]
+
+# ---------------------------------------------------------------- independence
+
+def det3(M):
+ return (M[0][0] * (M[1][1] * M[2][2] - M[1][2] * M[2][1]) - M[0][1] * (M[1][0] * M[2][2] - M[1][2] * M[2][0]) + M[0][2] * (M[1][0] * M[2][1] - M[1][1] * M[2][0]))
+
+def rank_frac(rows):
+ A = [[F(x) for x in r] for r in rows]; rank = 0
+ for c in range(len(A[0])):
+ piv = next((r for r in range(rank, len(A)) if A[r][c] != 0), None)
+ if piv is None: continue
+ A[rank], A[piv] = A[piv], A[rank]
+ for r in range(len(A)):
+ if r != rank and A[r][c] != 0:
+ f = A[r][c] / A[rank][c]; A[r] = [x - f * y for x, y in zip(A[r], A[rank])]
+ rank += 1
+ return rank
+
+def vec(v, n): return "(![%s] : Fin %d → ℚ)" % (", ".join(str(x) for x in v), n)
+def vecs(vs, n): return "![%s, %s]" % (vec(vs[0], n), ", ".join("![%s]" % ", ".join(str(x) for x in v) for v in vs[1:]))
+def tv(v): return "\\begin{pmatrix} %s \\end{pmatrix}" % " \\\\ ".join(str(x) for x in v)
+
+def independence(rng, difficulty):
+ n = 2 if difficulty < 3 else 3
+ dependent = rng.random() < (0.35 if difficulty == 1 else 0.5)
+ r = 4 if difficulty == 1 else 6
+ while True:
+ vs = [[rng.randrange(-r, r + 1) for _ in range(n)] for _ in range(n)]
+ if any(all(x == 0 for x in v) for v in vs): continue
+ if dependent:
+ coef = [rng.choice([-3, -2, -1, 1, 2, 3]) for _ in range(n - 1)]
+ vs[-1] = [sum(c * vs[i][j] for i, c in enumerate(coef)) for j in range(n)]
+ if all(x == 0 for x in vs[-1]) or rank_frac(vs) != n - 1: continue
+ break
+ if rank_frac(vs) == n and (det3(vs) if n == 3 else det2(vs)) != 0: break
+ assert (rank_frac(vs) == n) == (not dependent)
+ S = vecs(vs, n)
+ names = "two" if n == 2 else "three"
+ informal = "In \\(\\mathbb{Q}^%d\\) consider the vectors %s. " % (n, ", ".join("\\(%s\\)" % tv(v) for v in vs))
+ if not dependent:
+ informal += "Show that they are linearly independent over \\(\\mathbb{Q}\\)."
+ if n == 2:
+ proof = ("by\n rw [LinearIndependent.pair_iff]\n intro s t h\n have h0 := congr_fun h 0\n have h1 := congr_fun h 1\n simp at h0 h1\n constructor <;> linarith")
+ else:
+ proof = ("by\n rw [Fintype.linearIndependent_iff]\n intro g hg\n have h0 := congr_fun hg 0\n have h1 := congr_fun hg 1\n have h2 := congr_fun hg 2\n"
+ " simp [Fin.sum_univ_three] at h0 h1 h2\n intro i\n fin_cases i <;> simp <;> linarith")
+ return informal, [Theorem("vectors_independent", ": LinearIndependent ℚ %s" % S, proof, "The given vectors are linearly independent over the rationals.")]
+ informal += "Show that they are not linearly independent over \\(\\mathbb{Q}\\)."
+ coefs = coef + [-1]
+ gl = "![%s]" % ", ".join("(%d : ℚ)" % c for c in coefs)
+ sumfn = "Fin.sum_univ_two" if n == 2 else "Fin.sum_univ_three"
+ proof = ("by\n rw [Fintype.not_linearIndependent_iff]\n refine ⟨%s, ?_, %d, by simp⟩\n ext i\n fin_cases i <;> simp [%s] <;> norm_num") % (gl, n - 1, sumfn)
+ return informal, [Theorem("vectors_dependent", ": ¬ LinearIndependent ℚ %s" % S, proof, "The given vectors are linearly dependent over the rationals.")]
+
+# ---------------------------------------------------------------- linear_map
+
+HP = {
+ "pt": ("(hp : ∀ x, {p} ({p} x) = {p} x)", "{p}({p}(x)) = {p}(x) for every vector x", "have hp' : ∀ x, {p} ({p} x) = {p} x := hp"),
+ "comp": ("(hp : {p} ∘ₗ {p} = {p})", "{p} \\circ {p} = {p}", "have hp' : ∀ x, {p} ({p} x) = {p} x := fun x => LinearMap.congr_fun hp x"),
+ "mul": ("(hp : {p} * {p} = {p})", "{p}^2 = {p}", "have hp' : ∀ x, {p} ({p} x) = {p} x := fun x => LinearMap.congr_fun hp x"),
+}
+
+def linear_map(rng, difficulty):
+ Fd, Ftex = rng.choice([("ℚ", "\\mathbb{Q}"), ("ℝ", "\\mathbb{R}")])
+ V, W = "V", "W"; p = rng.choice(["p", "e", "q"]); x, y = rng.choice([("x", "y"), ("u", "v"), ("a", "b")])
+ kind = rng.choice({1: ["kercomb", "projsub", "kercomb"], 2: ["kersmul", "rangecomp", "kercomp", "kerid"], 3: ["iscompl", "iscompl", "kerid", "idem"]}[difficulty])
+ sp = "{%s %s : Type*} [AddCommGroup %s] [Module %s %s] [AddCommGroup %s] [Module %s %s]" % (V, W, V, Fd, V, W, Fd, W)
+ sv = "{%s : Type*} [AddCommGroup %s] [Module %s %s]" % (V, V, Fd, V)
+ hpl, hpt, hpf = HP[rng.choice((["comp", "mul"] if kind == "idem" else ["pt", "comp", "mul"]) if difficulty > 1 else ["pt"])]
+ if difficulty == 3 and kind in ("kerid", "idem"):
+ pass
+ key = None
+ for k in HP:
+ if HP[k][0] == hpl: key = k
+ hpl, hpt, hpf = (s.replace("{p}", p) for s in (hpl, hpt, hpf))
+ if kind == "kercomb":
+ a, b = rng.sample([2, 3, 4, 5, -1, -2, -3, 7], 2)
+ stmt = "%s (f : %s →ₗ[%s] %s) {%s %s : %s}\n (hx : f %s = 0) (hy : f %s = 0) : f ((%d : %s) • %s + (%d : %s) • %s) = 0" % (sp, V, Fd, W, x, y, V, x, y, a, Fd, x, b, Fd, y)
+ informal = "Let \\(f : V \\to W\\) be a linear map of vector spaces over \\(%s\\) and \\(%s, %s \\in V\\) with \\(f(%s) = 0\\) and \\(f(%s) = 0\\). Then \\(f(%d%s + %d%s) = 0\\)." % (Ftex, x, y, x, y, a, x, b, y)
+ return informal, [Theorem("kernel_combination", stmt, "by\n rw [map_add, map_smul, map_smul, hx, hy]\n simp", "The kernel is closed under linear combinations.")]
+ if kind == "projsub":
+ stmt = "%s (%s : %s →ₗ[%s] %s) (hp : ∀ x, %s (%s x) = %s x) (%s : %s) :\n %s - %s %s ∈ LinearMap.ker %s" % (sv, p, V, Fd, V, p, p, p, x, V, x, p, x, p)
+ informal = "Let \\(%s : V \\to V\\) be a linear map over \\(%s\\) with \\(%s(%s(v)) = %s(v)\\) for every \\(v\\). Then \\(%s - %s(%s)\\) lies in the kernel of \\(%s\\) for every \\(%s \\in V\\)." % (p, Ftex, p, "v", "v", x, p, x, p, x)
+ return informal, [Theorem("sub_proj_mem_ker", stmt, "by\n rw [LinearMap.mem_ker, map_sub, hp, sub_self]", "x - p x lies in the kernel of an idempotent map p.")]
+ if kind == "kersmul":
+ c = rng.choice([2, 3, 4, 5, 7, -1, -2, -3])
+ stmt = "%s (f : %s →ₗ[%s] %s) :\n LinearMap.ker ((%d : %s) • f) = LinearMap.ker f" % (sp, V, Fd, W, c, Fd)
+ informal = "Let \\(f : V \\to W\\) be a linear map of vector spaces over \\(%s\\). Then the kernel of \\(%df\\) equals the kernel of \\(f\\)." % (Ftex, c)
+ proof = "by\n ext %s\n simp only [LinearMap.mem_ker, LinearMap.smul_apply, smul_eq_zero]\n constructor\n · rintro (h | h)\n · norm_num at h\n · exact h\n · intro h\n exact Or.inr h" % x
+ return informal, [Theorem("ker_smul_eq", stmt, proof, "A nonzero scalar multiple has the same kernel.")]
+ if kind in ("rangecomp", "kercomp"):
+ U = "U"
+ pre = "{%s %s %s : Type*} [AddCommGroup %s] [Module %s %s] [AddCommGroup %s] [Module %s %s] [AddCommGroup %s] [Module %s %s]" % (V, W, U, V, Fd, V, W, Fd, W, U, Fd, U)
+ if kind == "rangecomp":
+ stmt = "%s (f : %s →ₗ[%s] %s) (g : %s →ₗ[%s] %s) :\n LinearMap.range (g ∘ₗ f) ≤ LinearMap.range g" % (pre, V, Fd, W, W, Fd, U)
+ informal = "Let \\(f : V \\to W\\) and \\(g : W \\to U\\) be linear maps over \\(%s\\). Then the range of \\(g \\circ f\\) is contained in the range of \\(g\\)." % Ftex
+ proof = "by\n rintro z ⟨%s, rfl⟩\n exact ⟨f %s, rfl⟩" % (x, x)
+ return informal, [Theorem("range_comp_le", stmt, proof, "range (g ∘ f) ≤ range g.")]
+ stmt = "%s (f : %s →ₗ[%s] %s) (g : %s →ₗ[%s] %s) :\n LinearMap.ker f ≤ LinearMap.ker (g ∘ₗ f)" % (pre, V, Fd, W, W, Fd, U)
+ informal = "Let \\(f : V \\to W\\) and \\(g : W \\to U\\) be linear maps over \\(%s\\). Then the kernel of \\(f\\) is contained in the kernel of \\(g \\circ f\\)." % Ftex
+ proof = "by\n intro %s hx\n rw [LinearMap.mem_ker] at hx ⊢\n rw [LinearMap.comp_apply, hx, map_zero]" % x
+ return informal, [Theorem("ker_le_comp", stmt, proof, "ker f ≤ ker (g ∘ f).")]
+ if kind == "idem":
+ stmt = "%s (%s : %s →ₗ[%s] %s) %s :\n (LinearMap.id - %s) ∘ₗ (LinearMap.id - %s) = LinearMap.id - %s ∧ %s ∘ₗ (LinearMap.id - %s) = 0" % (sv, p, V, Fd, V, hpl, p, p, p, p, p)
+ informal = "Let \\(%s : V \\to V\\) be a linear map over \\(%s\\) with \\(%s\\). Then \\(\\mathrm{id} - %s\\) is also idempotent, and \\(%s \\circ (\\mathrm{id} - %s) = 0\\)." % (p, Ftex, hpt, p, p, p)
+ proof = "by\n %s\n refine ⟨?_, ?_⟩ <;> ext %s <;> simp [hp']" % (hpf, x)
+ return informal, [Theorem("complement_idempotent", stmt, proof, "If p is idempotent then so is id - p, and p kills its image.")]
+ if kind == "kerid":
+ stmt = "%s (%s : %s →ₗ[%s] %s) %s :\n LinearMap.ker (LinearMap.id - %s) = LinearMap.range %s" % (sv, p, V, Fd, V, hpl, p, p)
+ informal = "Let \\(%s : V \\to V\\) be a linear map over \\(%s\\) with \\(%s\\). Then the kernel of \\(\\mathrm{id} - %s\\) equals the range of \\(%s\\)." % (p, Ftex, hpt, p, p)
+ proof = ("by\n %s\n ext %s\n constructor\n · intro h\n rw [LinearMap.mem_ker, LinearMap.sub_apply, LinearMap.id_apply, sub_eq_zero] at h\n exact ⟨%s, h.symm⟩\n"
+ " · rintro ⟨%s, rfl⟩\n rw [LinearMap.mem_ker, LinearMap.sub_apply, LinearMap.id_apply, hp', sub_self]") % (hpf, x, x, y)
+ return informal, [Theorem("ker_id_sub", stmt, proof, "For idempotent p, the kernel of id - p is the range of p.")]
+ # iscompl
+ stmt0 = "%s (%s : %s →ₗ[%s] %s) %s" % (sv, p, V, Fd, V, hpl)
+ lem = Theorem("disjoint_ker_range", stmt0 + " :\n Disjoint (LinearMap.ker %s) (LinearMap.range %s)" % (p, p),
+ "by\n %s\n rw [Submodule.disjoint_def]\n rintro %s h1 ⟨%s, rfl⟩\n rw [LinearMap.mem_ker, hp'] at h1\n rw [h1]" % (hpf, x, y), "The kernel and the range of an idempotent map meet only in 0.", 0.4)
+ main = Theorem("ker_range_isCompl", stmt0 + " :\n IsCompl (LinearMap.ker %s) (LinearMap.range %s)" % (p, p),
+ ("by\n %s\n refine ⟨disjoint_ker_range %s hp, ?_⟩\n rw [codisjoint_iff, eq_top_iff]\n intro %s _\n rw [Submodule.mem_sup]\n"
+ " exact ⟨%s - %s %s, by rw [LinearMap.mem_ker, map_sub, hp', sub_self], %s %s, LinearMap.mem_range_self %s %s, by abel⟩") % (hpf, p, x, x, p, x, p, x, p, x),
+ "The kernel and the range of an idempotent map are complements.", 0.6)
+ informal = "Let \\(%s : V \\to V\\) be a linear map over \\(%s\\) with \\(%s\\). Show that \\(\\ker %s\\) and \\(\\operatorname{range} %s\\) are complementary subspaces: their intersection is \\(\\{0\\}\\) and together they span \\(V\\)." % (p, Ftex, hpt, p, p)
+ return informal, [lem, main]
+
+FAM = {"det_trace": det_trace, "matrix_pow": matrix_pow, "independence": independence, "linear_map": linear_map}
+TITLES = {"det_trace": "Determinant and trace of 2x2 matrices", "matrix_pow": "Powers of 2x2 matrices", "independence": "Linear independence of explicit vectors", "linear_map": "Kernels, ranges and projections"}
+
+def generate(seed, difficulty, family=None):
+ family = family or sorted(FAMILIES)[seed % len(FAMILIES)]
+ rng = rng_for(ENV + "/" + family, seed, difficulty)
+ informal, theorems = FAM[family](rng, difficulty)
+ return Task(env=ENV, family=family, seed=seed, difficulty=difficulty, kind="prove",
+ title=TITLES[family], informal="Prove the following statement.\n\n" + informal, theorems=theorems)
diff --git a/envs/logic_and_sets/__init__.py b/envs/logic_and_sets/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/envs/logic_and_sets/env.toml b/envs/logic_and_sets/env.toml
new file mode 100644
index 0000000000000000000000000000000000000000..f271c17d821119e3faa50eada4d30735ceb18ce6
--- /dev/null
+++ b/envs/logic_and_sets/env.toml
@@ -0,0 +1,8 @@
+name = "logic-and-sets"
+title = "Logic and set algebra"
+msc = "03"
+kind = "prove"
+summary = "Prove set identities and image statements, Finset cardinality facts and equivalence relations."
+skill = "Set algebra, cardinality, relations"
+good_for = ["ext and tauto", "Finset.card lemmas", "equivalence relations"]
+families = ["finset_card", "relations", "set_identities"]
diff --git a/envs/logic_and_sets/gen.py b/envs/logic_and_sets/gen.py
new file mode 100644
index 0000000000000000000000000000000000000000..23909bcfb4b2bbfcc83ba34e3a44171a84afdcdc
--- /dev/null
+++ b/envs/logic_and_sets/gen.py
@@ -0,0 +1,355 @@
+"""Logic and set algebra (MSC 03: mathematical logic and foundations; 03B, 03E).
+
+Families: predicate-logic equivalences; set identities over `Set α` proved by extensionality (algebra at
+difficulties 1 and 3, images and preimages at 2 and sometimes 3);
+cardinality facts on `Finset ℕ`; equivalence relations on integers and pairs.
+Second code path: every set identity is checked on a truth table (membership of one element in
+each variable set) in Python before it is returned, including the rows allowed by a hypothesis.
+"""
+import itertools
+from arena.core import Task, Theorem, rng_for
+
+ENV = "logic_and_sets"
+# `quantifiers` is retired: aesop closes every task in it, so it teaches nothing. The generator stays for tests.
+FAMILIES = ["finset_card", "relations", "set_identities"]
+
+# ---------------------------------------------------------------- quantifiers
+# Each item: (needs_nonempty, uses_prop, statement body, tex, proof). Placeholders: %(P)s %(Q)s %(R)s %(c)s.
+Q1 = [
+ (False, False, "(¬ ∀ x, %(P)s x) ↔ ∃ x, ¬ %(P)s x", "\\neg \\forall x\\, %(P)s(x) \\iff \\exists x\\, \\neg %(P)s(x)",
+ "by\n constructor\n · intro h\n by_contra h'\n apply h\n intro x\n by_contra hx\n exact h' ⟨x, hx⟩\n · rintro ⟨x, hx⟩ h\n exact hx (h x)"),
+ (False, False, "(¬ ∃ x, %(P)s x) ↔ ∀ x, ¬ %(P)s x", "\\neg \\exists x\\, %(P)s(x) \\iff \\forall x\\, \\neg %(P)s(x)",
+ "by\n constructor\n · intro h x hx\n exact h ⟨x, hx⟩\n · rintro h ⟨x, hx⟩\n exact h x hx"),
+ (False, False, "(∀ x, %(P)s x ∧ %(Q)s x) ↔ (∀ x, %(P)s x) ∧ ∀ x, %(Q)s x", "\\forall x\\, (%(P)s(x) \\wedge %(Q)s(x)) \\iff (\\forall x\\, %(P)s(x)) \\wedge (\\forall x\\, %(Q)s(x))",
+ "⟨fun h => ⟨fun x => (h x).1, fun x => (h x).2⟩, fun h x => ⟨h.1 x, h.2 x⟩⟩"),
+ (False, False, "(∃ x, %(P)s x ∨ %(Q)s x) ↔ (∃ x, %(P)s x) ∨ ∃ x, %(Q)s x", "\\exists x\\, (%(P)s(x) \\vee %(Q)s(x)) \\iff (\\exists x\\, %(P)s(x)) \\vee (\\exists x\\, %(Q)s(x))",
+ "by\n constructor\n · rintro ⟨x, hx | hx⟩\n · exact Or.inl ⟨x, hx⟩\n · exact Or.inr ⟨x, hx⟩\n · rintro (⟨x, hx⟩ | ⟨x, hx⟩)\n · exact ⟨x, Or.inl hx⟩\n · exact ⟨x, Or.inr hx⟩"),
+]
+Q2 = [
+ (True, True, "(∃ x, %(P)s x → %(c)s) ↔ ((∀ x, %(P)s x) → %(c)s)", "\\exists x\\, (%(P)s(x) \\to %(c)s) \\iff ((\\forall x\\, %(P)s(x)) \\to %(c)s)",
+ "by\n constructor\n · rintro ⟨x, hx⟩ h\n exact hx (h x)\n · intro h\n by_cases hall : ∀ x, %(P)s x\n · exact ⟨Classical.arbitrary _, fun _ => h hall⟩\n · push_neg at hall\n obtain ⟨x, hx⟩ := hall\n exact ⟨x, fun hp => absurd hp hx⟩"),
+ (False, False, "(¬ ∀ x, %(P)s x → %(Q)s x) ↔ ∃ x, %(P)s x ∧ ¬ %(Q)s x", "\\neg \\forall x\\, (%(P)s(x) \\to %(Q)s(x)) \\iff \\exists x\\, (%(P)s(x) \\wedge \\neg %(Q)s(x))",
+ "by\n constructor\n · intro h\n by_contra h'\n apply h\n intro x hp\n by_contra hq\n exact h' ⟨x, hp, hq⟩\n · rintro ⟨x, hp, hq⟩ h\n exact hq (h x hp)"),
+ (False, True, "(∀ x, %(P)s x ∨ %(c)s) ↔ (∀ x, %(P)s x) ∨ %(c)s", "\\forall x\\, (%(P)s(x) \\vee %(c)s) \\iff (\\forall x\\, %(P)s(x)) \\vee %(c)s",
+ "by\n constructor\n · intro h\n by_cases hc : %(c)s\n · exact Or.inr hc\n · exact Or.inl fun x => (h x).resolve_right hc\n · rintro (h | h) x\n · exact Or.inl (h x)\n · exact Or.inr h"),
+ (False, True, "(∀ x, %(P)s x → %(c)s) ↔ ((∃ x, %(P)s x) → %(c)s)", "\\forall x\\, (%(P)s(x) \\to %(c)s) \\iff ((\\exists x\\, %(P)s(x)) \\to %(c)s)",
+ "⟨fun h ⟨x, hx⟩ => h x hx, fun h x hx => h ⟨x, hx⟩⟩"),
+ (False, False, "(∀ x, (%(P)s x ↔ %(Q)s x)) → ((∃ x, %(P)s x) ↔ ∃ x, %(Q)s x)", "(\\forall x\\, (%(P)s(x) \\iff %(Q)s(x))) \\to ((\\exists x\\, %(P)s(x)) \\iff (\\exists x\\, %(Q)s(x)))",
+ "by\n intro h\n constructor\n · rintro ⟨x, hx⟩\n exact ⟨x, (h x).1 hx⟩\n · rintro ⟨x, hx⟩\n exact ⟨x, (h x).2 hx⟩"),
+]
+Q3 = [
+ (True, False, "∃ x, %(P)s x → ∀ y, %(P)s y", "\\exists x\\, (%(P)s(x) \\to \\forall y\\, %(P)s(y))",
+ "by\n by_cases h : ∀ y, %(P)s y\n · exact ⟨Classical.arbitrary _, fun _ => h⟩\n · push_neg at h\n obtain ⟨x, hx⟩ := h\n exact ⟨x, fun hp => absurd hp hx⟩"),
+ (False, False, "¬ ∃ x, ∀ y, (%(R)s x y ↔ ¬ %(R)s y y)", "\\neg \\exists x\\, \\forall y\\, (%(R)s(x, y) \\iff \\neg %(R)s(y, y))",
+ "by\n rintro ⟨x, hx⟩\n have h := hx x\n tauto"),
+ (False, False, "(¬ ∃ x, ∀ y, %(R)s x y) ↔ ∀ x, ∃ y, ¬ %(R)s x y", "\\neg \\exists x\\, \\forall y\\, %(R)s(x, y) \\iff \\forall x\\, \\exists y\\, \\neg %(R)s(x, y)",
+ "by\n constructor\n · intro h x\n by_contra h'\n apply h\n refine ⟨x, fun y => ?_⟩\n by_contra hy\n exact h' ⟨y, hy⟩\n · rintro h ⟨x, hx⟩\n obtain ⟨y, hy⟩ := h x\n exact hy (hx y)"),
+ (False, False, "(∃ x, %(P)s x ∧ ∀ y, %(P)s y → %(R)s x y) → ∀ y, %(P)s y → ∃ x, %(P)s x ∧ %(R)s x y", "(\\exists x\\, (%(P)s(x) \\wedge \\forall y\\, (%(P)s(y) \\to %(R)s(x, y)))) \\to \\forall y\\, (%(P)s(y) \\to \\exists x\\, (%(P)s(x) \\wedge %(R)s(x, y)))",
+ "by\n rintro ⟨x, hx, h⟩ y hy\n exact ⟨x, hx, h y hy⟩"),
+ (False, False, "((∀ x, %(P)s x → %(Q)s x) ∧ ∃ x, %(P)s x ∧ %(R)s x x) → ∃ x, %(Q)s x ∧ %(R)s x x", "((\\forall x\\, (%(P)s(x) \\to %(Q)s(x))) \\wedge \\exists x\\, (%(P)s(x) \\wedge %(R)s(x, x))) \\to \\exists x\\, (%(Q)s(x) \\wedge %(R)s(x, x))",
+ "by\n rintro ⟨h, x, hp, hr⟩\n exact ⟨x, h x hp, hr⟩"),
+ (True, False, "(∃ x, ∀ y, %(R)s x y) ∨ (∀ x, ∃ y, ¬ %(R)s x y)", "(\\exists x\\, \\forall y\\, %(R)s(x, y)) \\vee (\\forall x\\, \\exists y\\, \\neg %(R)s(x, y))",
+ "by\n by_cases h : ∃ x, ∀ y, %(R)s x y\n · exact Or.inl h\n · right\n intro x\n by_contra h'\n apply h\n refine ⟨x, fun y => ?_⟩\n by_contra hy\n exact h' ⟨y, hy⟩"),
+]
+
+def quantifiers(rng, difficulty):
+ pool = {1: Q1, 2: Q2, 3: Q3}[difficulty]
+ nonempty, useprop, body, tex, proof = rng.choice(pool)
+ P, Q = rng.sample(["P", "Q", "S", "T"], 2)
+ R = rng.choice(["R", "r", "E", "L"])
+ c = rng.choice(["p", "q", "r2"]) if useprop else ""
+ sub = {"P": P, "Q": Q, "R": R, "c": c}
+ uses_R = "%(R)s" in body; uses_Q = "%(Q)s" in body
+ binders = ["{α : Type*}"] + (["[Nonempty α]"] if nonempty else [])
+ binders.append("(%s : α → Prop)" % P if not uses_Q else "(%s %s : α → Prop)" % (P, Q))
+ if uses_R: binders[-1] = (binders[-1] + " (%s : α → α → Prop)" % R) if "%(P)s" in body else "(%s : α → α → Prop)" % R
+ if useprop: binders.append("(%s : Prop)" % c)
+ stmt = " ".join(binders) + " :\n " + body % sub
+ words = []
+ if "%(P)s" in body: words.append("\\(%s\\)%s" % (P, " and \\(%s\\)" % Q if uses_Q else ""))
+ pred_names = [P] + ([Q] if uses_Q else []) if "%(P)s" in body else []
+ info = "Let \\(\\alpha\\) be a type" + (" (nonempty)" if nonempty else "")
+ parts = []
+ if pred_names: parts.append(" and ".join("\\(%s\\)" % n for n in pred_names) + (" predicates" if len(pred_names) > 1 else " a predicate") + " on \\(\\alpha\\)")
+ if uses_R: parts.append("\\(%s\\) a binary relation on \\(\\alpha\\)" % R)
+ if useprop: parts.append("\\(%s\\) a proposition" % c)
+ info += ", " + ", ".join(parts) + ". Prove \\[%s.\\]" % (tex % sub)
+ thm = "pred_logic"
+ return info, [Theorem(thm, stmt, proof % sub, "The stated statement of predicate logic.")]
+
+# ---------------------------------------------------------------- set identities
+SIMP = "simp only [Set.mem_union, Set.mem_inter_iff, Set.mem_diff, Set.mem_compl_iff]"
+
+# Laws: (lhs, rhs) over metavariables a, b, c.
+V = lambda n: ("v", n)
+LAWS = [
+ (("c", ("u", V("a"), V("b"))), ("i", ("c", V("a")), ("c", V("b")))),
+ (("c", ("i", V("a"), V("b"))), ("u", ("c", V("a")), ("c", V("b")))),
+ (("i", V("a"), ("u", V("b"), V("c"))), ("u", ("i", V("a"), V("b")), ("i", V("a"), V("c")))),
+ (("u", V("a"), ("i", V("b"), V("c"))), ("i", ("u", V("a"), V("b")), ("u", V("a"), V("c")))),
+ (("d", V("a"), ("u", V("b"), V("c"))), ("i", ("d", V("a"), V("b")), ("d", V("a"), V("c")))),
+ (("d", V("a"), ("i", V("b"), V("c"))), ("u", ("d", V("a"), V("b")), ("d", V("a"), V("c")))),
+ (("d", ("u", V("a"), V("b")), V("c")), ("u", ("d", V("a"), V("c")), ("d", V("b"), V("c")))),
+ (("d", V("a"), ("d", V("b"), V("c"))), ("u", ("d", V("a"), V("b")), ("i", V("a"), V("c")))),
+ (("d", V("a"), V("b")), ("i", V("a"), ("c", V("b")))),
+ (("c", ("d", V("a"), V("b"))), ("u", ("c", V("a")), V("b"))),
+ (("u", V("a"), ("i", V("a"), V("b"))), V("a")),
+ (("u", ("d", V("a"), V("b")), ("d", V("b"), V("a"))), ("d", ("u", V("a"), V("b")), ("i", V("a"), V("b")))),
+ (("i", ("d", V("a"), V("b")), ("d", V("a"), V("c"))), ("d", V("a"), ("u", V("b"), V("c")))),
+]
+
+def subst(e, m):
+ if e[0] == "v": return m[e[1]]
+ return (e[0],) + tuple(subst(x, m) for x in e[1:])
+
+def ev(e, env):
+ if e[0] == "v": return env[e[1]]
+ if e[0] == "c": return not ev(e[1], env)
+ a, b = ev(e[1], env), ev(e[2], env)
+ return {"u": a or b, "i": a and b, "d": a and not b}[e[0]]
+
+def lean(e, top=False):
+ if e[0] == "v": return e[1]
+ if e[0] == "c":
+ return "%sᶜ" % (lean(e[1]) if e[1][0] in ("v", "c") else "(%s)" % lean(e[1], True))
+ s = "%s %s %s" % (lean(e[1]), {"u": "∪", "i": "∩", "d": "\\"}[e[0]], lean(e[2]))
+ return s if top else "(%s)" % s
+
+def tex(e, top=False):
+ if e[0] == "v": return e[1]
+ if e[0] == "c":
+ return "%s^{c}" % (tex(e[1]) if e[1][0] in ("v", "c") else "(%s)" % tex(e[1], True))
+ s = "%s %s %s" % (tex(e[1]), {"u": "\\cup", "i": "\\cap", "d": "\\setminus"}[e[0]], tex(e[2]))
+ return s if top else "(%s)" % s
+
+def degenerate(e):
+ if e[0] == "v": return False
+ if e[0] == "c": return e[1][0] == "c" or degenerate(e[1])
+ return e[1] == e[2] or degenerate(e[1]) or degenerate(e[2])
+
+def count_vars(e, acc=None):
+ acc = {} if acc is None else acc
+ if e[0] == "v": acc[e[1]] = acc.get(e[1], 0) + 1
+ else:
+ for x in e[1:]: count_vars(x, acc)
+ return acc
+
+def vars_of(e): return {e[1]} if e[0] == "v" else set().union(*[vars_of(x) for x in e[1:]])
+def size(e): return 1 if e[0] == "v" else 1 + sum(size(x) for x in e[1:])
+
+def rand_expr(rng, depth, names):
+ if depth == 0 or (depth < 3 and rng.random() < 0.3): return ("v", rng.choice(names))
+ op = rng.choice(["u", "i", "d", "u", "i", "c"])
+ if op == "c": return ("c", rand_expr(rng, depth - 1, names))
+ return (op, rand_expr(rng, depth - 1, names), rand_expr(rng, depth - 1, names))
+
+def simple_expr(rng, names):
+ k = rng.random()
+ if k < 0.45: return ("v", rng.choice(names))
+ if k < 0.6: return ("c", ("v", rng.choice(names)))
+ a, b = rng.sample(names, 2)
+ return (rng.choice(["u", "i", "d"]), ("v", a), ("v", b))
+
+
+# Image and preimage statements: (needs_inj, binder over sets, statement, tex, proof). Placeholders: %(A)s %(B)s %(f)s.
+IMG2 = [
+ (False, "A B", "%(f)s '' %(A)s \\ %(f)s '' %(B)s ⊆ %(f)s '' (%(A)s \\ %(B)s)", "%(f)s(%(A)s) \\setminus %(f)s(%(B)s) \\subseteq %(f)s(%(A)s \\setminus %(B)s)",
+ "by\n rintro y ⟨⟨x, hx, rfl⟩, hy⟩\n exact ⟨x, ⟨hx, fun hb => hy ⟨x, hb, rfl⟩⟩, rfl⟩", "image"),
+ (False, "B", "%(f)s '' (%(f)s ⁻¹' %(B)s) = %(B)s ∩ Set.range %(f)s", "%(f)s(%(f)s^{-1}(%(B)s)) = %(B)s \\cap \\operatorname{range} %(f)s",
+ "by\n ext y\n constructor\n · rintro ⟨x, hx, rfl⟩\n exact ⟨hx, x, rfl⟩\n · rintro ⟨hy, x, rfl⟩\n exact ⟨x, hy, rfl⟩", "preimage"),
+ (True, "A", "%(f)s ⁻¹' (%(f)s '' %(A)s) = %(A)s", "%(f)s^{-1}(%(f)s(%(A)s)) = %(A)s",
+ "by\n ext x\n constructor\n · rintro ⟨y, hy, hxy⟩\n exact (hf hxy) ▸ hy\n · intro hx\n exact ⟨x, hx, rfl⟩", "preimage"),
+]
+IMG3 = [
+ (True, "A B", "%(f)s '' (%(A)s ∩ %(B)s) = %(f)s '' %(A)s ∩ %(f)s '' %(B)s", "%(f)s(%(A)s \\cap %(B)s) = %(f)s(%(A)s) \\cap %(f)s(%(B)s)",
+ "by\n ext y\n constructor\n · rintro ⟨x, ⟨ha, hb⟩, rfl⟩\n exact ⟨⟨x, ha, rfl⟩, ⟨x, hb, rfl⟩⟩\n · rintro ⟨⟨x, ha, rfl⟩, ⟨x', hb, hx⟩⟩\n have hxx : x' = x := hf hx\n subst hxx\n exact ⟨x', ⟨ha, hb⟩, rfl⟩", "image"),
+ (True, "A B", "%(f)s '' (%(A)s \\ %(B)s) = %(f)s '' %(A)s \\ %(f)s '' %(B)s", "%(f)s(%(A)s \\setminus %(B)s) = %(f)s(%(A)s) \\setminus %(f)s(%(B)s)",
+ "by\n ext y\n constructor\n · rintro ⟨x, ⟨ha, hb⟩, rfl⟩\n exact ⟨⟨x, ha, rfl⟩, fun ⟨x', hb', hx⟩ => hb ((hf hx) ▸ hb')⟩\n · rintro ⟨⟨x, ha, rfl⟩, hy⟩\n exact ⟨x, ⟨ha, fun hb => hy ⟨x, hb, rfl⟩⟩, rfl⟩", "image"),
+ (True, "A B", "%(f)s ⁻¹' (%(f)s '' %(A)s) ∩ %(B)s = %(A)s ∩ %(B)s", "%(f)s^{-1}(%(f)s(%(A)s)) \\cap %(B)s = %(A)s \\cap %(B)s",
+ "by\n ext x\n constructor\n · rintro ⟨⟨y, hy, hxy⟩, hb⟩\n exact ⟨(hf hxy) ▸ hy, hb⟩\n · rintro ⟨ha, hb⟩\n exact ⟨⟨x, ha, rfl⟩, hb⟩", "preimage"),
+]
+
+def image_statements(rng, difficulty):
+ needs_inj, sets, body, tx, proof, _ = rng.choice(IMG2 if difficulty == 2 else IMG3)
+ f = rng.choice(["f", "g", "h"]); A, B = rng.sample(["A", "B", "C", "S", "T"], 2)
+ sub = {"f": f, "A": A, "B": B}
+ names = [{"A": A, "B": B}[c] for c in sets.split()]
+ stype = {"A": "α", "B": "β"}
+ # sets live in α, except the lone preimage-of-B statement which lives in β
+ ssort = "β" if (sets == "B") else "α"
+ binder = "{α β : Type*} (%s : α → β) (%s : Set %s)" % (f, " ".join(names), ssort)
+ if needs_inj: binder += " (hf : Function.Injective %s)" % f
+ stmt = "%s :\n %s" % (binder, body % sub)
+ if sets == "B": # sets named B in the statement; rename B to the chosen name for the second letter
+ pass
+ info = "Let \\(%s : \\alpha \\to \\beta\\) be a function%s and let \\(%s\\) be subsets of \\(%s\\). Write \\(%s(X)\\) for the image and \\(%s^{-1}(X)\\) for the preimage of a set \\(X\\). Prove \\[%s.\\]" % (
+ f, " that is injective" if needs_inj else "", ", ".join(names), "\\beta" if ssort == "β" else "\\alpha", f, f, tx % sub)
+ return info, [Theorem("image_identity", stmt, proof.replace("hf", "hf"), "The stated statement about images and preimages.")]
+
+def set_identities(rng, difficulty):
+ if difficulty == 2 or (difficulty == 3 and rng.random() < 0.5):
+ return image_statements(rng, difficulty)
+ return set_algebra(rng, difficulty)
+
+def set_algebra(rng, difficulty):
+ names = rng.sample(["A", "B", "C", "S", "T", "U", "X", "Y", "Z"], 3)
+ rows = list(itertools.product([False, True], repeat=3))
+ envs = [dict(zip(names, r)) for r in rows]
+ hyp = None
+ if difficulty < 3:
+ while True:
+ l, r = rng.choice(LAWS)
+ if difficulty == 1:
+ m = dict(zip("abc", rng.sample(names, 3)))
+ m = {k: ("v", v) for k, v in m.items()}
+ else:
+ m = {k: simple_expr(rng, names) for k in "abc"}
+ e1, e2 = subst(l, m), subst(r, m)
+ if lean(e1) == lean(e2) or degenerate(e1) or degenerate(e2): continue
+ if difficulty == 2 and size(e1) + size(e2) < 12: continue
+ if difficulty == 2 and rng.random() < 0.7 and len(vars_of(e1) | vars_of(e2)) < 3: continue
+ break
+ if rng.random() < 0.5: e1, e2 = e2, e1
+ allowed = envs
+ else:
+ a, b = rng.sample(names, 2)
+ if rng.random() < 0.5:
+ hyp = ("sub", a, b, "(h : %s ⊆ %s)" % (a, b), "%s \\subseteq %s" % (a, b), lambda env, a=a, b=b: (not env[a]) or env[b])
+ else:
+ hyp = ("dis", a, b, "(h : %s ∩ %s = ∅)" % (a, b), "%s \\cap %s = \\emptyset" % (a, b), lambda env, a=a, b=b: not (env[a] and env[b]))
+ allowed = [e for e in envs if hyp[5](e)]
+ for _ in range(200000):
+ e1 = rand_expr(rng, 3, names); e2 = rand_expr(rng, 3, names)
+ if lean(e1) == lean(e2) or degenerate(e1) or degenerate(e2) or not (4 <= size(e1) <= 8 and 4 <= size(e2) <= 8): continue
+ if len(vars_of(e1) | vars_of(e2)) < 3: continue
+ if max(count_vars(e1).values()) > 2 or max(count_vars(e2).values()) > 2: continue
+ if not all(ev(e1, e) == ev(e2, e) for e in allowed): continue
+ if all(ev(e1, e) == ev(e2, e) for e in envs): continue
+ if len({ev(e1, e) for e in allowed}) < 2 or len({ev(e2, e) for e in allowed}) < 2: continue
+ break
+ else: raise RuntimeError("no identity found")
+ assert all(ev(e1, e) == ev(e2, e) for e in allowed)
+ binder = "{α : Type*} (%s : Set α)" % " ".join(names) + ((" " + hyp[3]) if hyp else "")
+ stmt = "%s :\n %s = %s" % (binder, lean(e1, True), lean(e2, True))
+ if hyp is None:
+ proof = "by\n ext x\n %s\n all_goals tauto" % SIMP; extra = ""
+ elif hyp[0] == "sub":
+ proof = "by\n ext x\n have hx : x ∈ %s → x ∈ %s := @h x\n %s\n all_goals tauto" % (hyp[1], hyp[2], SIMP)
+ extra = " Assume that \\(%s\\)." % hyp[4]
+ else:
+ proof = ("by\n ext x\n have hx : x ∈ %s → x ∈ %s → False := fun ha hb => by\n have hm : x ∈ %s ∩ %s := ⟨ha, hb⟩\n simp [h] at hm\n %s\n tauto" % (hyp[1], hyp[2], hyp[1], hyp[2], SIMP)).replace("\n tauto", "\n all_goals tauto")
+ extra = " Assume that \\(%s\\)." % hyp[4]
+ info = "Let \\(%s\\) be subsets of a type \\(\\alpha\\).%s Prove the set identity \\[%s = %s.\\]" % (", ".join(names), extra, tex(e1, True), tex(e2, True))
+ return info, [Theorem("set_identity", stmt, proof, "The stated identity between sets.")]
+
+# ---------------------------------------------------------------- finset cardinalities
+INJ = "have hinj : Function.Injective (fun x : ℕ => %d * x + %d) := by\n intro x y h\n simp only at h\n omega\n "
+
+def finset_card(rng, difficulty):
+ a = rng.randrange(2, 10); b = rng.randrange(0, 10)
+ f = "(fun x : ℕ => %d * x + %d)" % (a, b); ftex = "x \\mapsto %dx + %d" % (a, b)
+ inj = INJ % (a, b)
+ if difficulty == 1:
+ if rng.random() < 0.5:
+ stmt = "(s : Finset ℕ) :\n (s.image %s).card = s.card" % f
+ proof = "by\n " + inj + "exact Finset.card_image_of_injective s hinj"
+ info = "Let \\(f(x) = %dx + %d\\) on the natural numbers and let \\(s\\) be a finite set of natural numbers. Prove that the image \\(f(s)\\) has the same number of elements as \\(s\\)." % (a, b)
+ else:
+ stmt = "(s t : Finset ℕ) :\n ((s.image %s) ×ˢ t).card = s.card * t.card" % f
+ proof = "by\n " + inj + "rw [Finset.card_product, Finset.card_image_of_injective s hinj]"
+ info = "Let \\(f(x) = %dx + %d\\) on the natural numbers and let \\(s, t\\) be finite sets of natural numbers. Prove that the product \\(f(s) \\times t\\) has \\(|s| \\cdot |t|\\) elements." % (a, b)
+ return info, [Theorem("card_fact", stmt, proof, "A cardinality fact about finite sets.")]
+ if difficulty == 2:
+ if rng.random() < 0.5:
+ stmt = "(s t : Finset ℕ) :\n ((s ∪ t).image %s).card + ((s ∩ t).image %s).card = s.card + t.card" % (f, f)
+ proof = ("by\n " + inj + "rw [Finset.image_union, Finset.image_inter _ _ hinj, Finset.card_union_add_card_inter,\n Finset.card_image_of_injective s hinj, Finset.card_image_of_injective t hinj]")
+ info = "Let \\(f(x) = %dx + %d\\) on the natural numbers and let \\(s, t\\) be finite sets of natural numbers. Prove that \\[|f(s \\cup t)| + |f(s \\cap t)| = |s| + |t|.\\]" % (a, b)
+ else:
+ stmt = "(s t : Finset ℕ) :\n ((s \\ t).image %s).card + (s ∩ t).card = s.card" % f
+ proof = ("by\n " + inj + "rw [Finset.card_image_of_injective _ hinj]\n have h := Finset.card_sdiff_add_card_inter s t\n omega")
+ info = "Let \\(f(x) = %dx + %d\\) on the natural numbers and let \\(s, t\\) be finite sets of natural numbers. Prove that \\[|f(s \\setminus t)| + |s \\cap t| = |s|.\\]" % (a, b)
+ return info, [Theorem("card_fact", stmt, proof, "A cardinality fact about finite sets.")]
+ if rng.random() < 0.5:
+ stmt = "(s t : Finset ℕ) (h : Disjoint s t) :\n ((s ∪ t).image %s).card = s.card + t.card" % f
+ proof = "by\n " + inj + "rw [Finset.card_image_of_injective _ hinj, Finset.card_union_of_disjoint h]"
+ info = "Let \\(f(x) = %dx + %d\\) on the natural numbers and let \\(s, t\\) be disjoint finite sets of natural numbers. Prove that \\(|f(s \\cup t)| = |s| + |t|\\)." % (a, b)
+ return info, [Theorem("card_fact", stmt, proof, "A cardinality fact about finite sets.")]
+ lemma = Theorem("incl_excl", "(s t u : Finset ℕ) :\n (s ∪ t ∪ u).card + (s ∩ t).card + (s ∩ u).card + (t ∩ u).card = s.card + t.card + u.card + (s ∩ t ∩ u).card",
+ "by\n have h1 := Finset.card_union_add_card_inter (s ∪ t) u\n have h2 := Finset.card_union_add_card_inter s t\n have h3 := Finset.card_union_add_card_inter (s ∩ u) (t ∩ u)\n"
+ " have e1 : (s ∪ t) ∩ u = s ∩ u ∪ t ∩ u := Finset.union_inter_distrib_right s t u\n have e2 : s ∩ u ∩ (t ∩ u) = s ∩ t ∩ u := by\n ext x\n simp only [Finset.mem_inter]\n tauto\n rw [e1] at h1\n rw [e2] at h3\n omega",
+ "Inclusion and exclusion for three finite sets.")
+ main = Theorem("card_union_three", "(s t u : Finset ℕ) :\n (s ∪ t ∪ u).card = s.card + t.card + u.card - (s ∩ t).card - (s ∩ u).card - (t ∩ u).card + (s ∩ t ∩ u).card",
+ "by\n have h := incl_excl s t u\n have h7 : (s ∩ t ∩ u).card ≤ (s ∪ t ∪ u).card :=\n Finset.card_le_card (fun x hx => by\n simp only [Finset.mem_inter, Finset.mem_union] at hx ⊢\n tauto)\n omega",
+ "The size of a union of three finite sets, in terms of the sizes of the intersections.", weight=2.0)
+ info = ("Let \\(s, t, u\\) be finite sets of natural numbers. First prove the identity \\[|s \\cup t \\cup u| + |s \\cap t| + |s \\cap u| + |t \\cap u| = |s| + |t| + |u| + |s \\cap t \\cap u|.\\] "
+ "Then use it to prove the following, where subtraction is truncated subtraction on the natural numbers: \\[|s \\cup t \\cup u| = |s| + |t| + |u| - |s \\cap t| - |s \\cap u| - |t \\cap u| + |s \\cap t \\cap u|.\\]")
+ return info, [lemma, main]
+
+# ---------------------------------------------------------------- relations
+def relations(rng, difficulty):
+ if difficulty == 1:
+ m = rng.randrange(2, 13)
+ if rng.random() < 0.5:
+ rel = "fun x y : ℤ => %d ∣ x - y" % m; tx = "x \\sim y \\iff %d \\mid x - y" % m
+ else:
+ rel = "fun x y : ℤ => x %% %d = y %% %d" % (m, m); tx = "x \\sim y \\iff x \\bmod %d = y \\bmod %d" % (m, m)
+ proof = "⟨fun x => by omega, fun {x y} h => by omega, fun {x y z} h1 h2 => by omega⟩"
+ info = "On the integers define \\(%s\\). Prove that \\(\\sim\\) is an equivalence relation." % tx
+ return info, [Theorem("rel_equiv", ":\n Equivalence (%s)" % rel, proof, "The relation is reflexive, symmetric and transitive.")]
+ if difficulty == 2:
+ if rng.random() < 0.5:
+ a = rng.randrange(2, 8)
+ rel = "fun p q : ℕ × ℕ => p.1 + %d * q.2 = q.1 + %d * p.2" % (a, a)
+ tx = "(x_1, y_1) \\sim (x_2, y_2) \\iff x_1 + %d y_2 = x_2 + %d y_1" % (a, a)
+ proof = "⟨fun p => by omega, fun {p q} h => by omega, fun {p q r} h1 h2 => by omega⟩"
+ info = "On pairs of natural numbers define \\(%s\\). Prove that \\(\\sim\\) is an equivalence relation." % tx
+ else:
+ m = rng.randrange(2, 13); k = rng.choice([2, 3, 4])
+ rel = "fun x y : ℤ => %d ∣ x ^ %d - y ^ %d" % (m, k, k)
+ tx = "x \\sim y \\iff %d \\mid x^{%d} - y^{%d}" % (m, k, k)
+ proof = ("⟨fun x => by simp, fun {x y} h => (dvd_sub_comm).mp h, fun {x y z} h1 h2 => by\n have h := dvd_add h1 h2\n rwa [sub_add_sub_cancel] at h⟩")
+ info = "On the integers define \\(%s\\). Prove that \\(\\sim\\) is an equivalence relation." % tx
+ return info, [Theorem("rel_equiv", ":\n Equivalence (%s)" % rel, proof, "The relation is reflexive, symmetric and transitive.")]
+ n = rng.choice(["m", "n", "q"])
+ form = rng.choice(["dvd", "modeq"]); second = rng.choice(["mul", "pow"])
+ if form == "dvd":
+ rel = "fun x y : ℤ => %s ∣ x - y" % n; tx = "x \\sim y \\iff %s \\mid x - y" % n
+ p1 = ("⟨fun x => by simp, fun {x y} h => (dvd_sub_comm).mp h, fun {x y z} h1 h2 => by\n have h := dvd_add h1 h2\n rwa [sub_add_sub_cancel] at h⟩")
+ hyp = lambda a, b: "%s ∣ %s - %s" % (n, a, b)
+ add_p = "by\n have h := dvd_add h1 h2\n have e : (a + c) - (b + d) = (a - b) + (c - d) := by ring\n rw [e]\n exact h"
+ base = lambda lhs, rhs: "%s ∣ %s - %s" % (n, ("(%s)" % lhs) if "+" in lhs else lhs, ("(%s)" % rhs) if "+" in rhs else rhs)
+ tex_h = lambda a, b: "%s \\mid %s - %s" % (n, ("(%s)" % a) if "+" in a else a, ("(%s)" % b) if "+" in b else b)
+ else:
+ rel = "fun x y : ℤ => x ≡ y [ZMOD %s]" % n; tx = "x \\sim y \\iff x \\equiv y \\pmod{%s}" % n
+ p1 = "Int.ModEq.refl, fun {x y} h => h.symm, fun {x y z} h1 h2 => h1.trans h2"
+ p1 = "⟨%s⟩" % p1.replace("Int.ModEq.refl,", "fun x => Int.ModEq.refl x,")
+ hyp = lambda a, b: "%s ≡ %s [ZMOD %s]" % (a, b, n)
+ add_p = "h1.add h2"
+ base = lambda lhs, rhs: "%s ≡ %s [ZMOD %s]" % (lhs, rhs, n)
+ tex_h = lambda a, b: "%s \\equiv %s \\pmod{%s}" % (a, b, n)
+ t1 = Theorem("rel_equiv", "(%s : ℤ) :\n Equivalence (%s)" % (n, rel), p1, "The relation is reflexive, symmetric and transitive.")
+ t2 = Theorem("rel_add", "(%s a b c d : ℤ) (h1 : %s) (h2 : %s) :\n %s" % (n, hyp("a", "b"), hyp("c", "d"), base("a + c", "b + d")), add_p, "The relation is compatible with addition.")
+ if second == "mul":
+ if form == "dvd":
+ pm = "by\n have e : a * c - b * d = a * (c - d) + (a - b) * d := by ring\n rw [e]\n exact dvd_add (dvd_mul_of_dvd_right h2 a) (dvd_mul_of_dvd_left h1 d)"
+ else: pm = "h1.mul h2"
+ t3 = Theorem("rel_mul", "(%s a b c d : ℤ) (h1 : %s) (h2 : %s) :\n %s" % (n, hyp("a", "b"), hyp("c", "d"), base("a * c", "b * d")), pm, "The relation is compatible with multiplication.", weight=2.0)
+ what = "\\(a c \\sim b d\\)"; tx3 = "multiplication: if \\(%s\\) and \\(%s\\) then \\(%s\\)" % (tex_h("a", "b"), tex_h("c", "d"), tex_h("ac", "bd"))
+ else:
+ if form == "dvd":
+ pm = "by\n exact h.trans (sub_dvd_pow_sub_pow a b k)"
+ else: pm = "h.pow k"
+ t3 = Theorem("rel_pow", "(%s a b : ℤ) (k : ℕ) (h : %s) :\n %s" % (n, hyp("a", "b"), base("a ^ k", "b ^ k")), pm, "The relation is compatible with taking powers.", weight=2.0)
+ tx3 = "powers: if \\(%s\\) then \\(%s\\) for every natural number \\(k\\)" % (tex_h("a", "b"), tex_h("a^k", "b^k"))
+ info = ("For an integer \\(%s\\), define a relation on the integers by \\(%s\\). Prove three things: (1) \\(\\sim\\) is an equivalence relation; (2) \\(\\sim\\) is compatible with addition: if \\(%s\\) and \\(%s\\) then \\(%s\\); (3) \\(\\sim\\) is compatible with %s."
+ % (n, tx, tex_h("a", "b"), tex_h("c", "d"), tex_h("a+c", "b+d"), tx3))
+ return info, [t1, t2, t3]
+
+def generate(seed, difficulty, family=None):
+ family = family or sorted(FAMILIES)[seed % len(FAMILIES)]
+ rng = rng_for(ENV + "/" + family, seed, difficulty)
+ info, thms = {"quantifiers": quantifiers, "set_identities": set_identities, "finset_card": finset_card, "relations": relations}[family](rng, difficulty)
+ titles = {"quantifiers": "Prove a statement of predicate logic", "set_identities": "Prove an identity between sets",
+ "finset_card": "Prove a cardinality fact about finite sets", "relations": "Prove properties of a relation"}
+ return Task(env=ENV, family=family, seed=seed, difficulty=difficulty, kind="prove", title=titles[family],
+ informal="Prove the following.\n\n" + info, theorems=thms)
diff --git a/envs/modular_arithmetic/__init__.py b/envs/modular_arithmetic/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/envs/modular_arithmetic/env.toml b/envs/modular_arithmetic/env.toml
new file mode 100644
index 0000000000000000000000000000000000000000..5bed835d058cd8106c1b768432ddc0f9b57cb3c7
--- /dev/null
+++ b/envs/modular_arithmetic/env.toml
@@ -0,0 +1,8 @@
+name = "modular-arithmetic"
+title = "Divisibility, congruences and parity"
+msc = "11"
+kind = "prove"
+summary = "Prove facts about residues, divisibility, congruences and coprimality for natural numbers and integers, by case analysis on residues."
+skill = "Residue arithmetic and divisibility"
+good_for = ["case analysis on residues", "Int.ModEq and Nat.ModEq", "ZMod and decide", "coprimality and gcd"]
+families = ["congruence_chain", "divisibility", "gcd_coprime", "power_residues"]
diff --git a/envs/modular_arithmetic/gen.py b/envs/modular_arithmetic/gen.py
new file mode 100644
index 0000000000000000000000000000000000000000..c64faf9998253f4c9a11ff88b9e8ee55be1eaa60
--- /dev/null
+++ b/envs/modular_arithmetic/gen.py
@@ -0,0 +1,229 @@
+"""Divisibility, congruences, parity and coprimality (MSC 11: number theory, 11A07 congruences, 11A05 gcd).
+
+Families:
+ power_residues residues of u*n^k + w (one variable) or non-attained residues of u*a^k + v*b^k + w;
+ divisibility m | a*n^p + b*n over the integers (Fermat-style p-th powers), proved in ZMod;
+ congruence_chain from x = r (mod m) derive a congruence for a polynomial in x (Int.ModEq);
+ gcd_coprime coprimality of two linear forms and their gcd.
+Second code path: every residue set, every divisibility claim, every congruence value and every gcd
+claim is recomputed by brute force in Python before the task is returned.
+"""
+from math import gcd
+from arena.core import Task, Theorem, rng_for
+
+ENV = "modular_arithmetic"
+FAMILIES = ["congruence_chain", "divisibility", "gcd_coprime", "power_residues"]
+
+PRIMES_FOR = {2: [2], 3: [2, 3], 5: [2, 3, 5], 7: [2, 3, 7]} # primes q with n^p = n (mod q)
+
+
+def poly(terms, tex=False):
+ """terms: list of (coef, lean monomial, tex monomial); '' means the constant term."""
+ out = ""
+ for i, (c, lm, tm) in enumerate(terms):
+ m = tm if tex else lm
+ mag = abs(c)
+ if m == "": body = "%d" % mag
+ elif mag == 1: body = m
+ elif tex: body = "%d%s" % (mag, m)
+ else: body = "%d * %s" % (mag, m)
+ if i == 0: out += ("-" if c < 0 else "") + body
+ else: out += (" - " if c < 0 else " + ") + body
+ return out
+
+
+def ml(proof, c):
+ """ModEq proof of c * (...) from a proof of (...), skipping the factor 1."""
+ return proof if c == 1 else "(%s).mul_left %d" % (proof, c)
+
+
+def mono(c, body):
+ return body if c == 1 else "%d * %s" % (c, body)
+
+
+def paren(c):
+ return "(%d)" % c if c < 0 else "%d" % c
+
+
+# ---------------------------------------------------------------- power_residues
+def power_residues(rng, difficulty):
+ if difficulty < 3:
+ while True:
+ m = rng.choice([3, 4, 5, 7, 8, 9] if difficulty == 1 else [5, 7, 9, 11, 13, 16])
+ k = 2 if difficulty == 1 else rng.choice([3, 4])
+ u = rng.randrange(1, m); w = rng.randrange(0, m)
+ res = sorted({(u * x ** k + w) % m for x in range(m)})
+ free = {(u * x + w) % m for x in range(m)} # residues if n^k were an arbitrary number
+ if 2 <= len(res) and len(res) < len(free): break
+ # second path: the residues over a long range of n agree with the residues over one period
+ assert sorted({(u * n ** k + w) % m for n in range(5 * m + 3)}) == res
+ expr = poly([(u, "n ^ %d" % k, "n^%d" % k)] + ([(w, "", "")] if w else []))
+ texexpr = poly([(u, "n ^ %d" % k, "n^%d" % k)] + ([(w, "", "")] if w else []), tex=True)
+ cases = " ∨ ".join("(%s) %% %d = %d" % (expr, m, r) for r in res)
+ tex = ", ".join("%d" % r for r in res)
+ informal = ("Prove that for every natural number \\(n\\), the remainder of \\(%s\\) on division by \\(%d\\) is one of \\(%s\\)."
+ % (texexpr, m, tex))
+ stmt = "(n : ℕ) :\n %s" % cases
+ proof = ("by\n have key : (%s) %% %d = (%s) %% %d :=\n (%s).add_right %d\n"
+ " have h := Nat.mod_lt n (show 0 < %d by norm_num)\n rw [key]\n generalize n %% %d = r at h ⊢\n interval_cases r <;> decide"
+ % (expr, m, mono(u, "(n %% %d) ^ %d" % (m, k)) + " + %d" % w, m, ml("((Nat.mod_modEq n %d).symm.pow %d)" % (m, k), u), w, m, m))
+ return informal, [Theorem("residues_of_power", stmt, proof, "The remainder of the expression is one of the listed values.")]
+ while True:
+ m = rng.choice([4, 5, 7, 8, 9]); k = rng.choice([2, 3])
+ u = rng.randrange(1, 4); v = rng.randrange(1, 4); w = rng.randrange(0, m)
+ got = {(u * a ** k + v * b ** k + w) % m for a in range(m) for b in range(m)}
+ free = {(u * x + v * y + w) % m for x in range(m) for y in range(m)} # if the powers were arbitrary numbers
+ missing = [r for r in range(m) if r not in got and r in free]
+ if missing: break
+ r = rng.choice(missing)
+ for a in range(2 * m + 2):
+ for b in range(2 * m + 2): assert (u * a ** k + v * b ** k + w) % m != r
+ expr = poly([(u, "a ^ %d" % k, "a^%d" % k), (v, "b ^ %d" % k, "b^%d" % k)] + ([(w, "", "")] if w else []))
+ texexpr = poly([(u, "a^%d" % k, "a^%d" % k), (v, "b^%d" % k, "b^%d" % k)] + ([(w, "", "")] if w else []), tex=True)
+ informal = "Prove that for all natural numbers \\(a\\) and \\(b\\), the number \\(%s\\) never leaves remainder \\(%d\\) on division by \\(%d\\)." % (texexpr, r, m)
+ stmt = "(a b : ℕ) :\n (%s) %% %d ≠ %d" % (expr, m, r)
+ sub = "%s + %s + %d" % (mono(u, "(a %% %d) ^ %d" % (m, k)), mono(v, "(b %% %d) ^ %d" % (m, k)), w)
+ proof = ("by\n have key : (%s) %% %d = (%s) %% %d :=\n"
+ " ((%s).add (%s)).add_right %d\n"
+ " have ha := Nat.mod_lt a (show 0 < %d by norm_num)\n have hb := Nat.mod_lt b (show 0 < %d by norm_num)\n rw [key]\n"
+ " generalize a %% %d = x at ha ⊢\n generalize b %% %d = y at hb ⊢\n interval_cases x <;> interval_cases y <;> decide"
+ % (expr, m, sub, m, ml("((Nat.mod_modEq a %d).symm.pow %d)" % (m, k), u), ml("((Nat.mod_modEq b %d).symm.pow %d)" % (m, k), v), w, m, m, m, m))
+ return informal, [Theorem("residue_never_attained", stmt, proof, "The expression never leaves the stated remainder.")]
+
+
+# ---------------------------------------------------------------- divisibility
+def zmod_proof(M, expr):
+ return ("by\n have h : ((%s : ℤ) : ZMod %d) = 0 := by\n push_cast\n generalize (n : ZMod %d) = x\n revert x\n decide +kernel\n"
+ " exact (ZMod.intCast_zmod_eq_zero_iff_dvd _ _).1 h" % (expr, M, M))
+
+
+def divisibility(rng, difficulty):
+ if difficulty == 1:
+ p = rng.choice([3, 5, 7]); ps = PRIMES_FOR[p]
+ sub = [q for q in ps if rng.random() < 0.6] or [rng.choice(ps)]
+ M = 1
+ for q in sub: M *= q
+ else:
+ p = rng.choice([3, 5, 7] if difficulty == 2 else [5, 7]); ps = PRIMES_FOR[p]
+ M = 1
+ for q in ps: M *= q
+ while True:
+ a = rng.randrange(1, 41); t = rng.randrange(-3, 4); b = M * t - a
+ if b != 0 and gcd(a, M) == 1: break
+ for n in range(-60, 61): assert (a * n ** p + b * n) % M == 0
+ terms = [(a, "n ^ %d" % p, "n^%d" % p), (b, "n", "n")]
+ expr = poly(terms); texexpr = poly(terms, tex=True)
+ informal = "Prove that for every integer \\(n\\), the number \\(%d\\) divides \\(%s\\)." % (M, texexpr)
+ if difficulty < 3:
+ stmt = "(n : ℤ) :\n (%d : ℤ) ∣ %s" % (M, expr)
+ return informal, [Theorem("dvd_poly", stmt, zmod_proof(M, expr), "The integer divides the polynomial value.")]
+ ths = []
+ for q in ps:
+ ths.append(Theorem("dvd_by_%d" % q, "(n : ℤ) :\n (%d : ℤ) ∣ %s" % (q, expr), zmod_proof(q, expr),
+ "The prime %d divides the polynomial value." % q))
+ haves = "\n".join(" have h%d := dvd_by_%d n" % (q, q) for q in ps)
+ main = Theorem("dvd_poly", "(n : ℤ) :\n (%d : ℤ) ∣ %s" % (M, expr), "by\n%s\n generalize %s = e at %s ⊢\n omega" % (haves, expr, " ".join("h%d" % q for q in ps)),
+ "The product of the primes divides the polynomial value.", weight=float(len(ps)))
+ return informal + " Prove it first for each prime factor of \\(%d\\), then combine." % M, ths + [main]
+
+
+# ---------------------------------------------------------------- congruence_chain
+def congruence_chain(rng, difficulty):
+ m = rng.randrange(5, 14)
+ if difficulty == 1:
+ r = rng.randrange(0, m); u, v, w = rng.randrange(1, 8), rng.randrange(1, 8), rng.randrange(1, 8)
+ val = (u * r * r + v * r + w) % m
+ for x in range(-3 * m, 3 * m):
+ if x % m == r: assert (u * x * x + v * x + w - val) % m == 0
+ terms = [(u, "x ^ 2", "x^2"), (v, "x", "x"), (w, "", "")]
+ expr = poly(terms); tex = poly(terms, tex=True)
+ informal = "Let \\(x\\) be an integer with \\(x \\equiv %d \\pmod{%d}\\). Prove that \\(%s \\equiv %d \\pmod{%d}\\)." % (r, m, tex, val, m)
+ stmt = "(x : ℤ) (h : x ≡ %d [ZMOD %d]) :\n %s ≡ %d [ZMOD %d]" % (r, m, expr, val, m)
+ proof = ("by\n have h1 := ((%s).add (%s)).add_right %d\n refine h1.trans ?_\n norm_num [Int.ModEq]" % (ml("h.pow 2", u), ml("h", v), w))
+ return informal, [Theorem("congr_poly", stmt, proof, "The polynomial is congruent to the stated residue.")]
+ if difficulty == 2:
+ r, s = rng.randrange(0, m), rng.randrange(0, m)
+ u, v, w = rng.randrange(1, 8), rng.randrange(1, 8), rng.randrange(1, 8)
+ val = (u * r * s + v * s * s + w * r) % m
+ for x in range(-2 * m, 2 * m, 3):
+ for y in range(-2 * m, 2 * m, 5):
+ if x % m == r and y % m == s: assert (u * x * y + v * y * y + w * x - val) % m == 0
+ terms = [(u, "x * y", "xy"), (v, "y ^ 2", "y^2"), (w, "x", "x")]
+ expr = mono(u, "(x * y)") + " + " + mono(v, "y ^ 2") + " + " + mono(w, "x"); tex = poly(terms, tex=True)
+ informal = "Let \\(x\\) and \\(y\\) be integers with \\(x \\equiv %d \\pmod{%d}\\) and \\(y \\equiv %d \\pmod{%d}\\). Prove that \\(%s \\equiv %d \\pmod{%d}\\)." % (r, m, s, m, tex, val, m)
+ stmt = "(x y : ℤ) (hx : x ≡ %d [ZMOD %d]) (hy : y ≡ %d [ZMOD %d]) :\n %s ≡ %d [ZMOD %d]" % (r, m, s, m, expr, val, m)
+ proof = ("by\n have h1 := ((%s).add (%s)).add (%s)\n refine h1.trans ?_\n norm_num [Int.ModEq]" % (ml("hx.mul hy", u), ml("hy.pow 2", v), ml("hx", w)))
+ return informal, [Theorem("congr_poly2", stmt, proof, "The expression is congruent to the stated residue.")]
+ m = rng.randrange(7, 14)
+ r, s = rng.randrange(2, m), rng.randrange(2, m)
+ e, f = rng.randrange(8, 40), rng.randrange(8, 40); w = rng.randrange(1, 9)
+ ve, vf = pow(r, e, m), pow(s, f, m)
+ val = (ve * vf + w) % m
+ for x in (r, r + m, r - 2 * m):
+ for y in (s, s + 3 * m, s - m): assert (x ** e * y ** f + w - val) % m == 0
+ informal = ("Let \\(x\\) and \\(y\\) be integers with \\(x \\equiv %d \\pmod{%d}\\) and \\(y \\equiv %d \\pmod{%d}\\). "
+ "Prove that \\(x^{%d} \\equiv %d \\pmod{%d}\\), and then that \\(x^{%d} y^{%d} + %d \\equiv %d \\pmod{%d}\\)."
+ % (r, m, s, m, e, ve, m, e, f, w, val, m))
+ lemma = Theorem("congr_pow", "(x : ℤ) (h : x ≡ %d [ZMOD %d]) :\n x ^ %d ≡ %d [ZMOD %d]" % (r, m, e, ve, m),
+ "by\n refine (h.pow %d).trans ?_\n norm_num [Int.ModEq]" % e, "A large power of x has the stated residue.")
+ main = Theorem("congr_product", "(x y : ℤ) (hx : x ≡ %d [ZMOD %d]) (hy : y ≡ %d [ZMOD %d]) :\n x ^ %d * y ^ %d + %d ≡ %d [ZMOD %d]" % (r, m, s, m, e, f, w, val, m),
+ "by\n have h1 := congr_pow x hx\n have h2 : y ^ %d ≡ %d [ZMOD %d] := by\n refine (hy.pow %d).trans ?_\n norm_num [Int.ModEq]\n"
+ " refine ((h1.mul h2).add_right %d).trans ?_\n norm_num [Int.ModEq]" % (f, vf, m, f, w),
+ "The combined expression has the stated residue.", weight=2.0)
+ return informal, [lemma, main]
+
+
+# ---------------------------------------------------------------- gcd_coprime
+def linear_pair(rng, want_prime_det):
+ while True:
+ a, b, c = rng.randrange(1, 10), rng.randrange(1, 10), rng.randrange(1, 10)
+ if want_prime_det:
+ d = rng.randrange(1, 10)
+ D = abs(a * d - b * c)
+ if D in (2, 3, 5, 7, 11, 13): return a, b, c, d, a * d - b * c
+ else:
+ s = rng.choice([1, -1])
+ if (b * c + s) % a == 0 and (b * c + s) // a >= 1:
+ d = (b * c + s) // a
+ return a, b, c, d, a * d - b * c
+
+
+def gcd_coprime(rng, difficulty):
+ a, b, c, d, det = linear_pair(rng, difficulty == 3)
+ A = poly([(a, "n", "n"), (b, "", "")]); B = poly([(c, "n", "n"), (d, "", "")])
+ tA = poly([(a, "n", "n"), (b, "", "")], tex=True); tB = poly([(c, "n", "n"), (d, "", "")], tex=True)
+ if difficulty < 3:
+ assert abs(det) == 1 and all(gcd(a * n + b, c * n + d) == 1 for n in range(300))
+ s = det
+ wit = "⟨%s, %s, by ring⟩" % (paren(-s * c), paren(s * a))
+ if difficulty == 1:
+ informal = "Prove that for every integer \\(n\\), the integers \\(%s\\) and \\(%s\\) are coprime, in the sense that \\(u(%s) + v(%s) = 1\\) for some integers \\(u, v\\)." % (tA, tB, tA, tB)
+ stmt = "(n : ℤ) :\n IsCoprime (%s) (%s)" % (A, B)
+ return informal, [Theorem("coprime_int", stmt, "by\n exact %s" % wit, "The two linear forms are coprime.")]
+ informal = "Prove that for every natural number \\(n\\), the numbers \\(%s\\) and \\(%s\\) are coprime." % (tA, tB)
+ stmt = "(n : ℕ) :\n Nat.Coprime (%s) (%s)" % (A, B)
+ proof = "by\n rw [← Nat.isCoprime_iff_coprime]\n push_cast\n exact %s" % wit
+ return informal, [Theorem("coprime_nat", stmt, proof, "The two linear forms are coprime.")]
+ D = abs(det)
+ assert all(D % gcd(a * n + b, c * n + d) == 0 for n in range(300))
+ g = "Nat.gcd (%s) (%s)" % (A, B)
+ if a * d > b * c: first = "Dvd.dvd.mul_left h2 %d" % a; second = "Dvd.dvd.mul_left h1 %d" % c; e = "%d * (%s) - %d * (%s) = %d" % (a, B, c, A, D)
+ else: first = "Dvd.dvd.mul_left h1 %d" % c; second = "Dvd.dvd.mul_left h2 %d" % a; e = "%d * (%s) - %d * (%s) = %d" % (c, A, a, B, D)
+ informal = ("Let \\(n\\) be a natural number and \\(g = \\gcd(%s, %s)\\). Prove that \\(g\\) divides \\(%d\\), "
+ "and conclude that \\(g = 1\\) or \\(g = %d\\)." % (tA, tB, D, D))
+ lemma = Theorem("gcd_dvd_det", "(n : ℕ) :\n %s ∣ %d" % (g, D),
+ "by\n have h1 : %s ∣ %s := Nat.gcd_dvd_left _ _\n have h2 : %s ∣ %s := Nat.gcd_dvd_right _ _\n"
+ " have h3 := Nat.dvd_sub (%s) (%s)\n have e : %s := by omega\n rw [e] at h3\n exact h3" % (g, A, g, B, first, second, e),
+ "The gcd divides the determinant.")
+ main = Theorem("gcd_one_or_prime", "(n : ℕ) :\n %s = 1 ∨ %s = %d" % (g, g, D),
+ "by\n exact (Nat.dvd_prime (by norm_num)).1 (gcd_dvd_det n)", "The gcd is 1 or the prime determinant.", weight=2.0)
+ return informal, [lemma, main]
+
+
+def generate(seed, difficulty, family=None):
+ family = family or sorted(FAMILIES)[seed % len(FAMILIES)]
+ rng = rng_for(ENV + "/" + family, seed, difficulty)
+ informal, theorems = {"power_residues": power_residues, "divisibility": divisibility,
+ "congruence_chain": congruence_chain, "gcd_coprime": gcd_coprime}[family](rng, difficulty)
+ return Task(env=ENV, family=family, seed=seed, difficulty=difficulty, kind="prove",
+ title="Prove a fact about divisibility and residues", informal=informal, theorems=theorems)
diff --git a/envs/real_analysis/__init__.py b/envs/real_analysis/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/envs/real_analysis/env.toml b/envs/real_analysis/env.toml
new file mode 100644
index 0000000000000000000000000000000000000000..5bbd9170fb632f56e29d8d1a684d240af139c736
--- /dev/null
+++ b/envs/real_analysis/env.toml
@@ -0,0 +1,8 @@
+name = "real-analysis"
+title = "Real analysis with epsilon and delta"
+msc = "26"
+kind = "prove"
+summary = "Prove limits of explicit sequences, epsilon-delta continuity, bounds on recursive sequences and uniform bounds, from the definitions."
+skill = "Epsilon-delta arguments and induction on real sequences"
+good_for = ["choosing N and delta", "abs and inequality estimates", "induction on recursive sequences", "geometric sums"]
+families = ["continuity", "limit_sequence", "sequence_bounds", "uniform_bounds"]
diff --git a/envs/real_analysis/gen.py b/envs/real_analysis/gen.py
new file mode 100644
index 0000000000000000000000000000000000000000..09449f0b94d1a13f6965d11260b3b3236de562fb
--- /dev/null
+++ b/envs/real_analysis/gen.py
@@ -0,0 +1,282 @@
+"""Real analysis from the definitions (MSC 26: real functions; 26A03, 26A15, 26D05).
+
+Families: limits of explicit sequences stated by the epsilon-N definition; epsilon-delta continuity
+of explicit functions; bounds and monotonicity of recursively defined real sequences; uniform
+bounds and uniform convergence on intervals.
+Second code path: the constants used in a statement (the limit, the bound, the fixed point) are
+computed with exact fractions and checked against the recursion or the function on many points
+before the task is returned.
+"""
+from fractions import Fraction as F
+from arena.core import Task, Theorem, rng_for
+
+ENV = "real_analysis"
+FAMILIES = ["continuity", "limit_sequence", "sequence_bounds", "uniform_bounds"]
+
+def lit(x):
+ """Lean text of a rational constant as a real number."""
+ x = F(x)
+ if x.denominator == 1: return "(%d : ℝ)" % x.numerator
+ return "(%d / %d : ℝ)" % (x.numerator, x.denominator)
+
+def tex(x):
+ x = F(x)
+ if x.denominator == 1: return "%d" % x.numerator
+ return ("-" if x < 0 else "") + "\\frac{%d}{%d}" % (abs(x.numerator), x.denominator)
+
+def texp(x):
+ """TeX of a constant used as a base or factor, parenthesized when needed."""
+ x = F(x)
+ return "(%s)" % tex(x) if x < 0 else tex(x)
+
+def ptex(*terms):
+ """TeX of a sum of integer-coefficient terms [(coef, 'x^2'), (coef, '')]: -x - 3, 7x + 1, ..."""
+ out = ""
+ for c, v in terms:
+ if c == 0: continue
+ body = v if (abs(c) == 1 and v) else "%d%s" % (abs(c), v)
+ if not out: out = ("-" if c < 0 else "") + body
+ else: out += (" - " if c < 0 else " + ") + body
+ return out or "0"
+
+def T(text, **kw):
+ """Fill @name@ tokens: Lean literals for constants."""
+ for k, v in kw.items(): text = text.replace("@%s@" % k, lit(v) if not isinstance(v, str) else v)
+ assert "@" not in text, text
+ return text
+
+# ---------------------------------------------------------------- limits of sequences
+def limit_sequence(rng, difficulty):
+ n = "(n : ℝ)"
+ if difficulty == 1:
+ c = rng.randrange(1, 10); a = rng.randrange(1, 10)
+ for m in range(1, 200):
+ assert abs(F(c, m + a)) <= F(c, m)
+ expr = "%s / (%s + %s)" % (lit(c), n, lit(a))
+ stmt = ":\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |%s - 0| < ε" % expr
+ proof = T("""by
+ intro ε hε
+ refine ⟨⌈@c@ / ε⌉₊, fun n hn => ?_⟩
+ have h1 : @c@ / ε ≤ (n : ℝ) := (Nat.le_ceil _).trans (by exact_mod_cast hn)
+ have h2 : @c@ ≤ (n : ℝ) * ε := (div_le_iff₀ hε).mp h1
+ have hpos : (0 : ℝ) < (n : ℝ) + @a@ := by positivity
+ rw [sub_zero, abs_of_pos (by positivity), div_lt_iff₀ hpos]
+ nlinarith [mul_pos hε (by norm_num : (0 : ℝ) < @a@)]""", c=c, a=a)
+ info = "Prove, directly from the definition of a limit, that the sequence \\(u_n = \\dfrac{%d}{n + %d}\\) tends to \\(0\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|u_n - 0| < \\varepsilon\\) for all \\(n \\ge N\\)." % (c, a)
+ return info, [], [Theorem("seq_limit", stmt, proof, "The sequence tends to 0 (epsilon-N definition).")]
+ if difficulty == 2:
+ while True:
+ a = rng.choice([x for x in range(-5, 10) if x]); b = rng.randrange(-5, 10); c = rng.randrange(1, 7); d = rng.randrange(1, 10)
+ if c * b - a * d != 0: break
+ K = abs(c * b - a * d)
+ for m in range(1, 100):
+ assert F(a * m + b, c * m + d) - F(a, c) == F(c * b - a * d, c * (c * m + d))
+ expr = "(%s * %s + %s) / (%s * %s + %s)" % (lit(a), n, lit(b), lit(c), n, lit(d))
+ stmt = ":\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |%s - %s / %s| < ε" % (expr, lit(a), lit(c))
+ proof = T("""by
+ intro ε hε
+ refine ⟨⌈@K@ / ε⌉₊, fun n hn => ?_⟩
+ have h1 : @K@ / ε ≤ (n : ℝ) := (Nat.le_ceil _).trans (by exact_mod_cast hn)
+ have h2 : @K@ ≤ (n : ℝ) * ε := (div_le_iff₀ hε).mp h1
+ have hn0 : (0 : ℝ) ≤ (n : ℝ) := Nat.cast_nonneg n
+ have hden : (0 : ℝ) < @c@ * (n : ℝ) + @d@ := by positivity
+ have e : @E@ - @a@ / @c@ = (@c@ * @b@ - @a@ * @d@) / (@c@ * (@c@ * (n : ℝ) + @d@)) := by
+ field_simp
+ ring
+ have hk : |(@c@ * @b@ - @a@ * @d@ : ℝ)| = @K@ := by norm_num [abs_of_nonneg, abs_of_nonpos]
+ rw [e, abs_div, hk, abs_of_pos (by positivity), div_lt_iff₀ (by positivity)]
+ nlinarith [mul_nonneg hn0 hε.le, hε]""", K=K, c=c, d=d, a=a, b=b, E=expr)
+ info = "Prove, directly from the definition of a limit, that \\(u_n = \\dfrac{%s}{%s}\\) tends to \\(\\dfrac{%d}{%d}\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(\\left|u_n - \\frac{%d}{%d}\\right| < \\varepsilon\\) for all \\(n \\ge N\\)." % (ptex((a, "n"), (b, "")), ptex((c, "n"), (d, "")), a, c, a, c)
+ return info, [], [Theorem("seq_limit", stmt, proof, "The sequence converges to a/c (epsilon-N definition).")]
+ a = rng.randrange(1, 8); b = rng.randrange(0, 8); c = rng.randrange(1, 9)
+ for m in range(1, 200):
+ assert F(a * m + b, m * m + c) <= F(a + b, m)
+ expr = "(%s * %s + %s) / (%s ^ 2 + %s)" % (lit(a), n, lit(b), n, lit(c))
+ stmt = ":\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, |%s - 0| < ε" % expr
+ M = a + b
+ proof = T("""by
+ intro ε hε
+ refine ⟨⌈@M@ / ε⌉₊ + 1, fun n hn => ?_⟩
+ have h1 : @M@ / ε ≤ ((⌈@M@ / ε⌉₊ : ℕ) : ℝ) := Nat.le_ceil _
+ have h1' : (((⌈@M@ / ε⌉₊ + 1 : ℕ)) : ℝ) ≤ (n : ℝ) := by exact_mod_cast hn
+ push_cast at h1'
+ have h2 : @M@ ≤ ((⌈@M@ / ε⌉₊ : ℕ) : ℝ) * ε := (div_le_iff₀ hε).mp h1
+ have hn1 : (1 : ℝ) ≤ (n : ℝ) := by linarith [Nat.cast_nonneg (α := ℝ) ⌈@M@ / ε⌉₊]
+ have hM : @M@ < (n : ℝ) * ε := by nlinarith
+ have hpos : (0 : ℝ) < (n : ℝ) ^ 2 + @c@ := by positivity
+ rw [sub_zero, abs_of_pos (by positivity), div_lt_iff₀ hpos]
+ nlinarith [mul_pos hε (by norm_num : (0 : ℝ) < @c@), mul_le_mul_of_nonneg_left hn1 (by positivity : (0 : ℝ) ≤ @b@), mul_pos hε (by linarith : (0 : ℝ) < (n : ℝ))]""", M=M, c=c, b=b)
+ info = "Prove, directly from the definition of a limit, that \\(u_n = \\dfrac{%s}{n^2 + %d}\\) tends to \\(0\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|u_n - 0| < \\varepsilon\\) for all \\(n \\ge N\\)." % (ptex((a, "n"), (b, "")), c)
+ return info, [], [Theorem("seq_limit", stmt, proof, "The sequence tends to 0 (epsilon-N definition).")]
+
+# ---------------------------------------------------------------- continuity
+def continuity(rng, difficulty):
+ x0 = rng.randrange(-4, 5)
+ if difficulty == 1:
+ a = rng.choice([x for x in range(-7, 8) if x]); b = rng.randrange(-6, 7); A = abs(a)
+ for t in range(-20, 21):
+ assert abs((a * t + b) - (a * x0 + b)) == A * abs(t - x0)
+ stmt = ":\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - %s| < δ → |(%s * x + %s) - (%s * %s + %s)| < ε" % (lit(x0), lit(a), lit(b), lit(a), lit(x0), lit(b))
+ proof = T("""by
+ intro ε hε
+ refine ⟨ε / @A@, by positivity, fun x hx => ?_⟩
+ have e : (@a@ * x + @b@) - (@a@ * @x0@ + @b@) = @a@ * (x - @x0@) := by ring
+ rw [e, abs_mul, show |@a@| = @A@ by norm_num]
+ rw [lt_div_iff₀ (by norm_num)] at hx
+ linarith""", A=A, a=a, b=b, x0=x0)
+ info = "Prove, from the epsilon-delta definition, that \\(f(x) = %s\\) is continuous at \\(x_0 = %d\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\)." % (ptex((a, "x"), (b, "")), x0)
+ return info, [Theorem("continuous_at", stmt, proof, "Epsilon-delta continuity of a linear function at a point.")]
+ if difficulty == 2:
+ a = rng.choice([x for x in range(-6, 7) if x]); b = rng.randrange(-6, 7); A = abs(a); X0 = abs(x0); P = A * (2 * X0 + 1)
+ for t in [F(k, 7) for k in range(-60, 60)]:
+ if abs(t - x0) < 1: assert abs(a * t * t - a * x0 * x0) <= P * abs(t - x0)
+ stmt = ":\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - %s| < δ → |(%s * x ^ 2 + %s) - (%s * %s ^ 2 + %s)| < ε" % (lit(x0), lit(a), lit(b), lit(a), lit(x0), lit(b))
+ proof = T("""by
+ intro ε hε
+ refine ⟨min 1 (ε / @P@), lt_min one_pos (by positivity), fun x hx => ?_⟩
+ have h1 : |x - @x0@| < 1 := lt_of_lt_of_le hx (min_le_left _ _)
+ have h2 : |x - @x0@| < ε / @P@ := lt_of_lt_of_le hx (min_le_right _ _)
+ have h3 : |x + @x0@| < 2 * @X0@ + 1 := by
+ rw [abs_lt] at h1 ⊢
+ constructor <;> norm_num <;> linarith [h1.1, h1.2]
+ have e : (@a@ * x ^ 2 + @b@) - (@a@ * @x0@ ^ 2 + @b@) = @a@ * ((x - @x0@) * (x + @x0@)) := by ring
+ rw [e, abs_mul, abs_mul, show |@a@| = @A@ by norm_num]
+ have h4 : |x - @x0@| * @P@ < ε := by rwa [lt_div_iff₀ (by norm_num)] at h2
+ have h5 := mul_le_mul_of_nonneg_left h3.le (mul_nonneg (by norm_num : (0 : ℝ) ≤ @A@) (abs_nonneg (x - @x0@)))
+ nlinarith [abs_nonneg (x - @x0@), abs_nonneg (x + @x0@)]""", P=P, x0=x0, X0=X0, a=a, b=b, A=A)
+ info = "Prove, from the epsilon-delta definition, that \\(f(x) = %s\\) is continuous at \\(x_0 = %d\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\). Do not use any continuity lemma from the library." % (ptex((a, "x^2"), (b, "")), x0)
+ return info, [Theorem("continuous_at", stmt, proof, "Epsilon-delta continuity of a quadratic function at a point.")]
+ x0 = rng.randrange(1, 6); c = rng.randrange(1, 7)
+ for t in [F(k, 9) for k in range(1, 100)]:
+ if abs(t - x0) < F(x0, 2): assert abs(F(c) / t - F(c, x0)) * 1 <= F(2 * c, x0 * x0) * abs(t - x0)
+ stmt = ":\n ∀ ε > 0, ∃ δ > 0, ∀ x : ℝ, |x - %s| < δ → |%s / x - %s / %s| < ε" % (lit(x0), lit(c), lit(c), lit(x0))
+ proof = T("""by
+ intro ε hε
+ refine ⟨min (@x0@ / 2) (ε * @x0@ ^ 2 / (2 * @c@)), lt_min (by norm_num) (by positivity), fun x hx => ?_⟩
+ have h1 : |x - @x0@| < @x0@ / 2 := lt_of_lt_of_le hx (min_le_left _ _)
+ have h2 : |x - @x0@| < ε * @x0@ ^ 2 / (2 * @c@) := lt_of_lt_of_le hx (min_le_right _ _)
+ have hx0 : @x0@ / 2 < x := by
+ have := (abs_lt.mp h1).1
+ linarith
+ have hxpos : (0 : ℝ) < x := by linarith
+ have e : @c@ / x - @c@ / @x0@ = @c@ * (@x0@ - x) / (x * @x0@) := by
+ field_simp
+ have h3 : @c@ * |x - @x0@| < ε * @x0@ ^ 2 / 2 := by
+ rw [lt_div_iff₀ (by norm_num)] at h2 ⊢
+ nlinarith [abs_nonneg (x - @x0@)]
+ have h4 : ε * @x0@ ^ 2 / 2 < ε * (x * @x0@) := by nlinarith [mul_pos hε (sub_pos.mpr hx0), mul_pos hε hxpos]
+ rw [e, abs_div, abs_mul, abs_of_pos (by positivity : (0 : ℝ) < x * @x0@), abs_sub_comm, show |@c@| = @c@ by norm_num, div_lt_iff₀ (by positivity)]
+ linarith""", x0=x0, c=c)
+ info = "Prove, from the epsilon-delta definition, that \\(f(x) = \\dfrac{%d}{x}\\) is continuous at \\(x_0 = %d\\): for every \\(\\varepsilon > 0\\) there is \\(\\delta > 0\\) such that \\(|f(x) - f(x_0)| < \\varepsilon\\) whenever \\(|x - x_0| < \\delta\\). Here \\(x\\) ranges over all real numbers (in Lean, division by 0 gives 0, which does not matter for small \\(\\delta\\))." % (c, x0)
+ return info, [Theorem("continuous_at", stmt, proof, "Epsilon-delta continuity of the reciprocal function at a point.")]
+
+# ---------------------------------------------------------------- recursive sequences
+def sequence_bounds(rng, difficulty):
+ if difficulty < 3:
+ c = F(rng.randrange(1, 9), rng.choice([1, 2, 3]))
+ a0 = rng.choice([F(0), c / 2, c, 3 * c / 2, 2 * c])
+ B = 2 * c
+ a = [a0]
+ for _ in range(40): a.append(a[-1] / 2 + c)
+ assert all(0 <= x <= B for x in a) and all(a[i] <= a[i + 1] for i in range(40))
+ pre = "noncomputable def a : ℕ → ℝ\n | 0 => %s\n | (n + 1) => a n / 2 + %s" % (lit(a0), lit(c))
+ bound = Theorem("a_bounds", ":\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ %s" % lit(B),
+ "by\n intro n\n induction n with\n | zero => norm_num [a]\n | succ k ih =>\n obtain ⟨h0, h1⟩ := ih\n simp only [a]\n constructor <;> linarith")
+ mono = Theorem("a_monotone", ":\n Monotone a",
+ "by\n apply monotone_nat_of_le_succ\n intro n\n have h := (a_bounds n).2\n simp only [a]\n linarith", "The sequence is increasing.", weight=2.0)
+ bound.informal = "The sequence stays between 0 and its upper bound."
+ rec_tex = "a_{n+1} = \\frac{a_n}{2} + %s" % tex(c)
+ info = "Define a real sequence by \\(a_0 = %s\\) and \\(%s\\)." % (tex(a0), rec_tex)
+ if difficulty == 1:
+ info += " Prove that \\(0 \\le a_n \\le %s\\) for every \\(n\\)." % tex(B)
+ return info, pre, [bound]
+ info += " Prove that \\(0 \\le a_n \\le %s\\) for every \\(n\\), and then that the sequence is monotone (non-decreasing)." % tex(B)
+ return info, pre, [bound, mono]
+ while True:
+ u, v = rng.choice([(1, 2), (1, 3), (2, 3), (1, 4), (3, 4), (1, 5), (2, 5), (3, 5), (4, 5)])
+ s = F(u, v); r = 1 - s
+ a0 = rng.choice([F(0), r / 2, r / 3, r * 3 / 4, r])
+ break
+ c = 1 - s * s
+ a = [a0]
+ for _ in range(9): a.append((a[-1] ** 2 + c) / 2)
+ assert all(0 <= x <= r for x in a) and all(a[i] <= a[i + 1] for i in range(9)) and r * r + c == 2 * r
+ pre = "noncomputable def a : ℕ → ℝ\n | 0 => %s\n | (n + 1) => (a n ^ 2 + %s) / 2" % (lit(a0), lit(c))
+ bound = Theorem("a_bounds", ":\n ∀ n : ℕ, 0 ≤ a n ∧ a n ≤ %s" % lit(r),
+ "by\n intro n\n induction n with\n | zero => norm_num [a]\n | succ k ih =>\n obtain ⟨h0, h1⟩ := ih\n have h2 : a k ^ 2 ≤ %s ^ 2 := by nlinarith\n simp only [a]\n constructor\n · nlinarith [sq_nonneg (a k)]\n · norm_num at h2 ⊢\n linarith" % lit(r),
+ "The sequence stays between 0 and the smaller fixed point.")
+ mono = Theorem("a_monotone", ":\n Monotone a",
+ "by\n apply monotone_nat_of_le_succ\n intro n\n obtain ⟨h0, h1⟩ := a_bounds n\n simp only [a]\n nlinarith [mul_nonneg (sub_nonneg.mpr h1) (by linarith : (0 : ℝ) ≤ %s - a n)]" % lit(1 + s),
+ "The sequence is increasing.", weight=2.0)
+ info = ("Define a real sequence by \\(a_0 = %s\\) and \\(a_{n+1} = \\dfrac{a_n^2 + %s}{2}\\). Prove that \\(0 \\le a_n \\le %s\\) for every \\(n\\) (note that \\(%s\\) is a fixed point of the recursion), and then that the sequence is monotone (non-decreasing)."
+ % (tex(a0), tex(c), tex(r), tex(r)))
+ return info, pre, [bound, mono]
+
+# ---------------------------------------------------------------- uniform bounds
+def uniform_bounds(rng, difficulty):
+ q = rng.choice([F(1, 2), F(1, 3), F(2, 3), F(3, 4), F(1, 4), F(3, 5), F(2, 5), F(4, 5)])
+ c = rng.randrange(1, 10)
+ if difficulty == 1:
+ for n in range(8):
+ for k in range(-20, 21):
+ x = q * F(k, 20)
+ assert abs(c * x ** (n + 1)) <= c * q ** (n + 1)
+ stmt = ":\n ∀ n : ℕ, ∀ x ∈ Set.Icc (-%s) %s, |%d * x ^ (n + 1)| ≤ %d * %s ^ (n + 1)" % (lit(q), lit(q), c, c, lit(q))
+ proof = T("""by
+ intro n x hx
+ rw [abs_mul, abs_pow, show |(@c@)| = @c@ by norm_num]
+ have hx' : |x| ≤ @q@ := abs_le.mpr ⟨hx.1, hx.2⟩
+ have := pow_le_pow_left₀ (abs_nonneg x) hx' (n + 1)
+ linarith""", c=c, q=q)
+ info = "Prove that for every natural number \\(n\\) and every real \\(x\\) with \\(-%s \\le x \\le %s\\), \\[|%d\\,x^{n+1}| \\le %d \\cdot %s^{n+1}.\\]" % (tex(q), tex(q), c, c, texp(q))
+ return info, [Theorem("uniform_bound", stmt, proof, "A bound that does not depend on the point x.")]
+ if difficulty == 2:
+ bound = F(1) / (1 - q)
+ for n in range(12):
+ for k in range(0, 21):
+ x = q * F(k, 20)
+ assert sum(x ** i for i in range(n)) <= bound
+ stmt = ":\n ∀ n : ℕ, ∀ x ∈ Set.Icc (0 : ℝ) %s, ∑ i ∈ Finset.range n, x ^ i ≤ 1 / (1 - %s)" % (lit(q), lit(q))
+ proof = T("""by
+ intro n x hx
+ have hq : (@q@ : ℝ) ≠ 1 := by norm_num
+ have h1 : ∑ i ∈ Finset.range n, x ^ i ≤ ∑ i ∈ Finset.range n, (@q@ : ℝ) ^ i :=
+ Finset.sum_le_sum fun i _ => pow_le_pow_left₀ hx.1 hx.2 i
+ have h2 : ∑ i ∈ Finset.range n, (@q@ : ℝ) ^ i = (1 - @q@ ^ n) / (1 - @q@) := by
+ rw [geom_sum_eq hq n, ← neg_sub, ← neg_sub 1, neg_div_neg_eq]
+ have h3 : (1 - @q@ ^ n) / (1 - @q@) ≤ 1 / (1 - @q@) := by
+ have : (0 : ℝ) < @q@ ^ n := by positivity
+ apply div_le_div_of_nonneg_right (by linarith) (by norm_num)
+ linarith""", q=q)
+ info = "Prove that for every natural number \\(n\\) and every real \\(x\\) with \\(0 \\le x \\le %s\\), \\[\\sum_{i=0}^{n-1} x^{i} \\le \\frac{1}{1 - %s}.\\] The sum is empty when \\(n = 0\\)." % (tex(q), texp(q))
+ return info, [Theorem("uniform_bound", stmt, proof, "A bound on partial geometric sums that does not depend on n or x.")]
+ for n in range(1, 30):
+ assert all(abs(c * (q * F(k, 20)) ** n) <= c * q ** n for k in range(-20, 21))
+ stmt = ":\n ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, ∀ x : ℝ, |x| ≤ %s → |%d * x ^ n| < ε" % (lit(q), c)
+ proof = T("""by
+ intro ε hε
+ obtain ⟨N, hN⟩ := exists_pow_lt_of_lt_one (div_pos hε (by norm_num : (0 : ℝ) < @c@)) (by norm_num : (@q@ : ℝ) < 1)
+ refine ⟨N, fun n hn x hx => ?_⟩
+ rw [abs_mul, abs_pow, show |(@c@)| = @c@ by norm_num]
+ have h1 : |x| ^ n ≤ (@q@ : ℝ) ^ n := pow_le_pow_left₀ (abs_nonneg x) hx n
+ have h2 : (@q@ : ℝ) ^ n ≤ (@q@ : ℝ) ^ N := pow_le_pow_of_le_one (by norm_num) (by norm_num) hn
+ have h3 : (@q@ : ℝ) ^ N < ε / @c@ := hN
+ rw [lt_div_iff₀ (by norm_num)] at h3
+ nlinarith""", c=c, q=q)
+ info = "Prove that \\(c\\,x^n\\) with \\(c = %d\\) tends to \\(0\\) uniformly on \\([-%s, %s]\\): for every \\(\\varepsilon > 0\\) there is \\(N\\) such that \\(|%d\\,x^n| < \\varepsilon\\) for all \\(n \\ge N\\) and all real \\(x\\) with \\(|x| \\le %s\\)." % (c, tex(q), tex(q), c, tex(q))
+ return info, [Theorem("uniform_convergence", stmt, proof, "Uniform convergence of a geometric sequence on an interval.")]
+
+def generate(seed, difficulty, family=None):
+ family = family or sorted(FAMILIES)[seed % len(FAMILIES)]
+ rng = rng_for(ENV + "/" + family, seed, difficulty)
+ pre = ""
+ if family == "limit_sequence":
+ info, _, thms = limit_sequence(rng, difficulty)
+ elif family == "sequence_bounds":
+ info, pre, thms = sequence_bounds(rng, difficulty)
+ else:
+ info, thms = {"continuity": continuity, "uniform_bounds": uniform_bounds}[family](rng, difficulty)
+ titles = {"continuity": "Prove continuity from the epsilon-delta definition", "limit_sequence": "Prove a limit from the definition",
+ "sequence_bounds": "Bound a recursive sequence", "uniform_bounds": "Prove a uniform bound"}
+ return Task(env=ENV, family=family, seed=seed, difficulty=difficulty, kind="prove", title=titles[family],
+ informal=info, preamble=pre, theorems=thms)
diff --git a/reference/automation_baseline.json b/reference/automation_baseline.json
new file mode 100644
index 0000000000000000000000000000000000000000..7915059e40886643e09ce7109989bcfcbe45af66
--- /dev/null
+++ b/reference/automation_baseline.json
@@ -0,0 +1,114 @@
+{
+ "combinatorial-identities": {
+ "1": {
+ "closed": 0,
+ "tasks": 8
+ },
+ "2": {
+ "closed": 0,
+ "tasks": 8
+ },
+ "3": {
+ "closed": 0,
+ "tasks": 8
+ }
+ },
+ "finite-sums": {
+ "1": {
+ "closed": 0,
+ "tasks": 8
+ },
+ "2": {
+ "closed": 0,
+ "tasks": 8
+ },
+ "3": {
+ "closed": 0,
+ "tasks": 8
+ }
+ },
+ "group-theory": {
+ "1": {
+ "closed": 2,
+ "tasks": 8
+ },
+ "2": {
+ "closed": 1,
+ "tasks": 8
+ },
+ "3": {
+ "closed": 0,
+ "tasks": 8
+ }
+ },
+ "inequalities": {
+ "1": {
+ "closed": 2,
+ "tasks": 8
+ },
+ "2": {
+ "closed": 0,
+ "tasks": 8
+ },
+ "3": {
+ "closed": 2,
+ "tasks": 8
+ }
+ },
+ "linear-algebra": {
+ "1": {
+ "closed": 3,
+ "tasks": 8
+ },
+ "2": {
+ "closed": 0,
+ "tasks": 8
+ },
+ "3": {
+ "closed": 0,
+ "tasks": 8
+ }
+ },
+ "logic-and-sets": {
+ "1": {
+ "closed": 2,
+ "tasks": 8
+ },
+ "2": {
+ "closed": 2,
+ "tasks": 8
+ },
+ "3": {
+ "closed": 1,
+ "tasks": 8
+ }
+ },
+ "modular-arithmetic": {
+ "1": {
+ "closed": 0,
+ "tasks": 8
+ },
+ "2": {
+ "closed": 0,
+ "tasks": 8
+ },
+ "3": {
+ "closed": 0,
+ "tasks": 8
+ }
+ },
+ "real-analysis": {
+ "1": {
+ "closed": 0,
+ "tasks": 8
+ },
+ "2": {
+ "closed": 0,
+ "tasks": 8
+ },
+ "3": {
+ "closed": 0,
+ "tasks": 8
+ }
+ }
+}
\ No newline at end of file
diff --git a/reference/mathlib_coverage.json b/reference/mathlib_coverage.json
new file mode 100644
index 0000000000000000000000000000000000000000..d1bb1cb70e715dbe153293e6e6ed42c2907b36c4
--- /dev/null
+++ b/reference/mathlib_coverage.json
@@ -0,0 +1,1733 @@
+{
+ "mathlib_commit": "5e932f97dd25535344f80f9dd8da3aab83df0fe6",
+ "mathlib_theorems": 177553,
+ "mathlib_modules": 7468,
+ "areas": {
+ "00": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "01": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "03": {
+ "theorems": 8694,
+ "modules": 209,
+ "dirs": [
+ {
+ "dir": "Data/Set",
+ "theorems": 2873
+ },
+ {
+ "dir": "SetTheory/Cardinal",
+ "theorems": 1165
+ },
+ {
+ "dir": "SetTheory/Ordinal",
+ "theorems": 1079
+ },
+ {
+ "dir": "Logic/Equiv",
+ "theorems": 658
+ }
+ ]
+ },
+ "05": {
+ "theorems": 10440,
+ "modules": 331,
+ "dirs": [
+ {
+ "dir": "Combinatorics/SimpleGraph",
+ "theorems": 2496
+ },
+ {
+ "dir": "Data/Finset",
+ "theorems": 2304
+ },
+ {
+ "dir": "Combinatorics/Matroid",
+ "theorems": 1180
+ },
+ {
+ "dir": "Algebra/BigOperators",
+ "theorems": 1104
+ }
+ ]
+ },
+ "06": {
+ "theorems": 14355,
+ "modules": 450,
+ "dirs": [
+ {
+ "dir": "Algebra/Order",
+ "theorems": 4762
+ },
+ {
+ "dir": "Order/Interval",
+ "theorems": 1887
+ },
+ {
+ "dir": "Order/Hom",
+ "theorems": 446
+ },
+ {
+ "dir": "Order/SuccPred",
+ "theorems": 366
+ }
+ ]
+ },
+ "08": {
+ "theorems": 2867,
+ "modules": 147,
+ "dirs": [
+ {
+ "dir": "Algebra/Quaternion.lean",
+ "theorems": 241
+ },
+ {
+ "dir": "Algebra/GCDMonoid",
+ "theorems": 238
+ },
+ {
+ "dir": "Algebra/DirectSum",
+ "theorems": 225
+ },
+ {
+ "dir": "Algebra/SkewMonoidAlgebra",
+ "theorems": 179
+ }
+ ]
+ },
+ "11": {
+ "theorems": 8235,
+ "modules": 382,
+ "dirs": [
+ {
+ "dir": "Data/Nat",
+ "theorems": 1849
+ },
+ {
+ "dir": "Data/Int",
+ "theorems": 512
+ },
+ {
+ "dir": "NumberTheory/Padics",
+ "theorems": 489
+ },
+ {
+ "dir": "NumberTheory/LSeries",
+ "theorems": 485
+ }
+ ]
+ },
+ "12": {
+ "theorems": 5794,
+ "modules": 208,
+ "dirs": [
+ {
+ "dir": "Algebra/Polynomial",
+ "theorems": 2390
+ },
+ {
+ "dir": "NumberTheory/NumberField",
+ "theorems": 481
+ },
+ {
+ "dir": "FieldTheory/IntermediateField",
+ "theorems": 364
+ },
+ {
+ "dir": "RingTheory/Valuation",
+ "theorems": 298
+ }
+ ]
+ },
+ "13": {
+ "theorems": 11260,
+ "modules": 527,
+ "dirs": [
+ {
+ "dir": "RingTheory/Ideal",
+ "theorems": 1189
+ },
+ {
+ "dir": "RingTheory/Polynomial",
+ "theorems": 902
+ },
+ {
+ "dir": "Algebra/Module",
+ "theorems": 810
+ },
+ {
+ "dir": "Algebra/MvPolynomial",
+ "theorems": 763
+ }
+ ]
+ },
+ "14": {
+ "theorems": 3140,
+ "modules": 135,
+ "dirs": [
+ {
+ "dir": "AlgebraicGeometry/EllipticCurve",
+ "theorems": 1055
+ },
+ {
+ "dir": "AlgebraicGeometry/Morphisms",
+ "theorems": 396
+ },
+ {
+ "dir": "RingTheory/Spectrum",
+ "theorems": 176
+ },
+ {
+ "dir": "AlgebraicGeometry/IdealSheaf",
+ "theorems": 170
+ }
+ ]
+ },
+ "15": {
+ "theorems": 8537,
+ "modules": 358,
+ "dirs": [
+ {
+ "dir": "LinearAlgebra/Matrix",
+ "theorems": 1975
+ },
+ {
+ "dir": "Algebra/Module",
+ "theorems": 810
+ },
+ {
+ "dir": "Data/Matrix",
+ "theorems": 671
+ },
+ {
+ "dir": "LinearAlgebra/TensorProduct",
+ "theorems": 548
+ }
+ ]
+ },
+ "16": {
+ "theorems": 7186,
+ "modules": 360,
+ "dirs": [
+ {
+ "dir": "Algebra/Ring",
+ "theorems": 1595
+ },
+ {
+ "dir": "Algebra/Algebra",
+ "theorems": 1247
+ },
+ {
+ "dir": "Algebra/MonoidAlgebra",
+ "theorems": 356
+ },
+ {
+ "dir": "RingTheory/MvPolynomial",
+ "theorems": 206
+ }
+ ]
+ },
+ "17": {
+ "theorems": 1926,
+ "modules": 79,
+ "dirs": [
+ {
+ "dir": "Algebra/Lie",
+ "theorems": 1330
+ },
+ {
+ "dir": "LinearAlgebra/RootSystem",
+ "theorems": 596
+ }
+ ]
+ },
+ "18": {
+ "theorems": 15754,
+ "modules": 1372,
+ "dirs": [
+ {
+ "dir": "CategoryTheory/Limits",
+ "theorems": 2939
+ },
+ {
+ "dir": "Algebra/Homology",
+ "theorems": 2311
+ },
+ {
+ "dir": "CategoryTheory/Monoidal",
+ "theorems": 1317
+ },
+ {
+ "dir": "CategoryTheory/Sites",
+ "theorems": 1235
+ }
+ ]
+ },
+ "19": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "20": {
+ "theorems": 9310,
+ "modules": 384,
+ "dirs": [
+ {
+ "dir": "Algebra/Group",
+ "theorems": 4124
+ },
+ {
+ "dir": "Algebra/GroupWithZero",
+ "theorems": 860
+ },
+ {
+ "dir": "GroupTheory/Perm",
+ "theorems": 686
+ },
+ {
+ "dir": "GroupTheory/GroupAction",
+ "theorems": 573
+ }
+ ]
+ },
+ "22": {
+ "theorems": 1692,
+ "modules": 79,
+ "dirs": [
+ {
+ "dir": "Topology/Algebra",
+ "theorems": 1692
+ }
+ ]
+ },
+ "26": {
+ "theorems": 6537,
+ "modules": 192,
+ "dirs": [
+ {
+ "dir": "Analysis/SpecialFunctions",
+ "theorems": 1976
+ },
+ {
+ "dir": "Analysis/Calculus",
+ "theorems": 1833
+ },
+ {
+ "dir": "Data/Real",
+ "theorems": 405
+ },
+ {
+ "dir": "Analysis/Asymptotics",
+ "theorems": 386
+ }
+ ]
+ },
+ "28": {
+ "theorems": 10010,
+ "modules": 316,
+ "dirs": [
+ {
+ "dir": "MeasureTheory/Measure",
+ "theorems": 2736
+ },
+ {
+ "dir": "MeasureTheory/Function",
+ "theorems": 2253
+ },
+ {
+ "dir": "MeasureTheory/Integral",
+ "theorems": 1931
+ },
+ {
+ "dir": "Data/ENNReal",
+ "theorems": 649
+ }
+ ]
+ },
+ "30": {
+ "theorems": 2265,
+ "modules": 92,
+ "dirs": [
+ {
+ "dir": "Analysis/Complex",
+ "theorems": 1420
+ },
+ {
+ "dir": "Analysis/Analytic",
+ "theorems": 392
+ },
+ {
+ "dir": "NumberTheory/ModularForms",
+ "theorems": 266
+ },
+ {
+ "dir": "Data/Complex",
+ "theorems": 187
+ }
+ ]
+ },
+ "31": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "32": {
+ "theorems": 392,
+ "modules": 10,
+ "dirs": [
+ {
+ "dir": "Analysis/Analytic",
+ "theorems": 392
+ }
+ ]
+ },
+ "33": {
+ "theorems": 1976,
+ "modules": 50,
+ "dirs": [
+ {
+ "dir": "Analysis/SpecialFunctions",
+ "theorems": 1976
+ }
+ ]
+ },
+ "34": {
+ "theorems": 109,
+ "modules": 4,
+ "dirs": [
+ {
+ "dir": "Analysis/ODE",
+ "theorems": 109
+ }
+ ]
+ },
+ "35": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "37": {
+ "theorems": 668,
+ "modules": 31,
+ "dirs": [
+ {
+ "dir": "Dynamics/TopologicalEntropy",
+ "theorems": 149
+ },
+ {
+ "dir": "Dynamics/Circle",
+ "theorems": 123
+ },
+ {
+ "dir": "Dynamics/Ergodic",
+ "theorems": 123
+ },
+ {
+ "dir": "Dynamics/PeriodicPts",
+ "theorems": 118
+ }
+ ]
+ },
+ "39": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "40": {
+ "theorems": 198,
+ "modules": 6,
+ "dirs": [
+ {
+ "dir": "Analysis/SpecificLimits",
+ "theorems": 198
+ }
+ ]
+ },
+ "41": {
+ "theorems": 386,
+ "modules": 5,
+ "dirs": [
+ {
+ "dir": "Analysis/Asymptotics",
+ "theorems": 386
+ }
+ ]
+ },
+ "42": {
+ "theorems": 291,
+ "modules": 14,
+ "dirs": [
+ {
+ "dir": "Analysis/Fourier",
+ "theorems": 291
+ }
+ ]
+ },
+ "43": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "44": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "45": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "46": {
+ "theorems": 7967,
+ "modules": 338,
+ "dirs": [
+ {
+ "dir": "Analysis/Normed",
+ "theorems": 3558
+ },
+ {
+ "dir": "Analysis/CStarAlgebra",
+ "theorems": 938
+ },
+ {
+ "dir": "Analysis/Convex",
+ "theorems": 870
+ },
+ {
+ "dir": "Analysis/InnerProductSpace",
+ "theorems": 770
+ }
+ ]
+ },
+ "47": {
+ "theorems": 770,
+ "modules": 26,
+ "dirs": [
+ {
+ "dir": "Analysis/InnerProductSpace",
+ "theorems": 770
+ }
+ ]
+ },
+ "49": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "51": {
+ "theorems": 2632,
+ "modules": 71,
+ "dirs": [
+ {
+ "dir": "Geometry/Euclidean",
+ "theorems": 1352
+ },
+ {
+ "dir": "LinearAlgebra/AffineSpace",
+ "theorems": 1012
+ },
+ {
+ "dir": "Geometry/RingedSpace",
+ "theorems": 203
+ },
+ {
+ "dir": "Geometry/Diffeology",
+ "theorems": 56
+ }
+ ]
+ },
+ "52": {
+ "theorems": 1044,
+ "modules": 38,
+ "dirs": [
+ {
+ "dir": "Analysis/Convex",
+ "theorems": 870
+ },
+ {
+ "dir": "Geometry/Convex",
+ "theorems": 173
+ }
+ ]
+ },
+ "53": {
+ "theorems": 748,
+ "modules": 24,
+ "dirs": [
+ {
+ "dir": "Geometry/Manifold",
+ "theorems": 748
+ }
+ ]
+ },
+ "54": {
+ "theorems": 16146,
+ "modules": 567,
+ "dirs": [
+ {
+ "dir": "Order/Filter",
+ "theorems": 2193
+ },
+ {
+ "dir": "Topology/MetricSpace",
+ "theorems": 1878
+ },
+ {
+ "dir": "Topology/Algebra",
+ "theorems": 1692
+ },
+ {
+ "dir": "Topology/Order",
+ "theorems": 1373
+ }
+ ]
+ },
+ "55": {
+ "theorems": 1568,
+ "modules": 156,
+ "dirs": [
+ {
+ "dir": "AlgebraicTopology/SimplicialSet",
+ "theorems": 585
+ },
+ {
+ "dir": "Topology/Homotopy",
+ "theorems": 204
+ },
+ {
+ "dir": "AlgebraicTopology/SimplexCategory",
+ "theorems": 194
+ },
+ {
+ "dir": "AlgebraicTopology/ModelCategory",
+ "theorems": 188
+ }
+ ]
+ },
+ "57": {
+ "theorems": 857,
+ "modules": 28,
+ "dirs": [
+ {
+ "dir": "Geometry/Manifold",
+ "theorems": 748
+ },
+ {
+ "dir": "Topology/CWComplex",
+ "theorems": 109
+ }
+ ]
+ },
+ "58": {
+ "theorems": 2581,
+ "modules": 85,
+ "dirs": [
+ {
+ "dir": "Analysis/Calculus",
+ "theorems": 1833
+ },
+ {
+ "dir": "Geometry/Manifold",
+ "theorems": 748
+ }
+ ]
+ },
+ "60": {
+ "theorems": 3185,
+ "modules": 128,
+ "dirs": [
+ {
+ "dir": "Probability/Kernel",
+ "theorems": 998
+ },
+ {
+ "dir": "Probability/Independence",
+ "theorems": 514
+ },
+ {
+ "dir": "Probability/Moments",
+ "theorems": 403
+ },
+ {
+ "dir": "Probability/Distributions",
+ "theorems": 364
+ }
+ ]
+ },
+ "62": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "65": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "68": {
+ "theorems": 6654,
+ "modules": 237,
+ "dirs": [
+ {
+ "dir": "Data/List",
+ "theorems": 1849
+ },
+ {
+ "dir": "Data/Seq",
+ "theorems": 330
+ },
+ {
+ "dir": "Data/ENat",
+ "theorems": 243
+ },
+ {
+ "dir": "Data/PNat",
+ "theorems": 239
+ }
+ ]
+ },
+ "70": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "74": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "76": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "78": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "80": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "81": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "82": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "83": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "85": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "86": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "90": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "91": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "92": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ },
+ "93": {
+ "theorems": 201,
+ "modules": 25,
+ "dirs": [
+ {
+ "dir": "Control/Traversable",
+ "theorems": 57
+ },
+ {
+ "dir": "Control/Monad",
+ "theorems": 25
+ },
+ {
+ "dir": "Control/Fold.lean",
+ "theorems": 22
+ },
+ {
+ "dir": "Control/LawfulFix.lean",
+ "theorems": 15
+ }
+ ]
+ },
+ "94": {
+ "theorems": 117,
+ "modules": 6,
+ "dirs": [
+ {
+ "dir": "InformationTheory/KullbackLeibler",
+ "theorems": 58
+ },
+ {
+ "dir": "InformationTheory/Hamming.lean",
+ "theorems": 52
+ },
+ {
+ "dir": "InformationTheory/Coding",
+ "theorems": 7
+ }
+ ]
+ },
+ "97": {
+ "theorems": 0,
+ "modules": 0,
+ "dirs": []
+ }
+ },
+ "unmapped": {},
+ "hundred": [
+ {
+ "n": 1,
+ "title": "The Irrationality of the Square Root of 2",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "irrational_sqrt_two",
+ "authors": "mathlib"
+ },
+ {
+ "n": 2,
+ "title": "Fundamental Theorem of Algebra",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Complex.exists_root",
+ "authors": "Chris Hughes"
+ },
+ {
+ "n": 3,
+ "title": "The Denumerability of the Rational Numbers",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Rat.instDenumerable",
+ "authors": "Chris Hughes"
+ },
+ {
+ "n": 4,
+ "title": "Pythagorean Theorem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "EuclideanGeometry.dist_sq_eq_dist_sq_add_dist_sq_iff_angle_eq_pi_div_two",
+ "authors": "Joseph Myers"
+ },
+ {
+ "n": 5,
+ "title": "Prime Number Theorem",
+ "formalized": true,
+ "in_mathlib": false,
+ "decl": null,
+ "authors": "Alex Kontorovich, Terry Tao, and the Prime Number Theorem + Project"
+ },
+ {
+ "n": 6,
+ "title": "Gödel’s Incompleteness Theorem",
+ "formalized": true,
+ "in_mathlib": false,
+ "decl": null,
+ "authors": "Shogo Saito"
+ },
+ {
+ "n": 7,
+ "title": "Law of Quadratic Reciprocity",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "legendreSym.quadratic_reciprocity",
+ "authors": "Chris Hughes (first) and Michael Stoll (second)"
+ },
+ {
+ "n": 8,
+ "title": "The Impossibility of Trisecting the Angle and Doubling the Cube",
+ "formalized": false,
+ "in_mathlib": false,
+ "decl": null,
+ "authors": ""
+ },
+ {
+ "n": 9,
+ "title": "The Area of a Circle",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Theorems100.area_disc",
+ "authors": "James Arthur and Benjamin Davidson and Andrew Souther"
+ },
+ {
+ "n": 10,
+ "title": "Euler’s Generalization of Fermat’s Little Theorem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Nat.ModEq.pow_totient",
+ "authors": "Chris Hughes"
+ },
+ {
+ "n": 11,
+ "title": "The Infinitude of Primes",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Nat.exists_infinite_primes",
+ "authors": "Jeremy Avigad"
+ },
+ {
+ "n": 12,
+ "title": "The Independence of the Parallel Postulate",
+ "formalized": false,
+ "in_mathlib": false,
+ "decl": null,
+ "authors": ""
+ },
+ {
+ "n": 13,
+ "title": "Polyhedron Formula",
+ "formalized": false,
+ "in_mathlib": false,
+ "decl": null,
+ "authors": ""
+ },
+ {
+ "n": 14,
+ "title": "Euler’s Summation of 1 + (1/2)^2 + (1/3)^2 + ….",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "hasSum_zeta_two",
+ "authors": "Marc Masdeu and David Loeffler"
+ },
+ {
+ "n": 15,
+ "title": "Fundamental Theorem of Integral Calculus",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "intervalIntegral.integral_hasStrictDerivAt_of_tendsto_ae_right",
+ "authors": "Yury G. Kudryashov (first) and Benjamin Davidson (second)"
+ },
+ {
+ "n": 16,
+ "title": "Insolvability of General Higher Degree Equations (Abel-Ruffini Theorem)",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "AbelRuffini.exists_not_solvable_by_rad",
+ "authors": "Thomas Browning"
+ },
+ {
+ "n": 17,
+ "title": "De Moivre’s Formula",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Complex.cos_add_sin_mul_I_pow",
+ "authors": "Abhimanyu Pallavi Sudhir"
+ },
+ {
+ "n": 18,
+ "title": "Liouville’s Theorem and the Construction of Transcendental Numbers",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Liouville.transcendental",
+ "authors": "Jujian Zhang"
+ },
+ {
+ "n": 19,
+ "title": "Four Squares Theorem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Nat.sum_four_squares",
+ "authors": "Chris Hughes"
+ },
+ {
+ "n": 20,
+ "title": "All Primes (1 mod 4) Equal the Sum of Two Squares",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Nat.Prime.sq_add_sq",
+ "authors": "Chris Hughes"
+ },
+ {
+ "n": 21,
+ "title": "Green’s Theorem",
+ "formalized": false,
+ "in_mathlib": false,
+ "decl": null,
+ "authors": ""
+ },
+ {
+ "n": 22,
+ "title": "The Non-Denumerability of the Continuum",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Cardinal.not_countable_real",
+ "authors": "Floris van Doorn"
+ },
+ {
+ "n": 23,
+ "title": "Formula for Pythagorean Triples",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "PythagoreanTriple.classification",
+ "authors": "Paul van Wamelen"
+ },
+ {
+ "n": 24,
+ "title": "The Independence of the Continuum Hypothesis",
+ "formalized": true,
+ "in_mathlib": false,
+ "decl": null,
+ "authors": "Jesse Michael Han and Floris van Doorn"
+ },
+ {
+ "n": 25,
+ "title": "Schroeder-Bernstein Theorem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Function.Embedding.schroeder_bernstein",
+ "authors": "Mario Carneiro"
+ },
+ {
+ "n": 26,
+ "title": "Leibniz’s Series for Pi",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Real.tendsto_sum_pi_div_four",
+ "authors": "Benjamin Davidson"
+ },
+ {
+ "n": 27,
+ "title": "Sum of the Angles of a Triangle",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "EuclideanGeometry.angle_add_angle_add_angle_eq_pi",
+ "authors": "Joseph Myers"
+ },
+ {
+ "n": 28,
+ "title": "Pascal’s Hexagon Theorem",
+ "formalized": false,
+ "in_mathlib": false,
+ "decl": null,
+ "authors": ""
+ },
+ {
+ "n": 29,
+ "title": "Feuerbach’s Theorem",
+ "formalized": false,
+ "in_mathlib": false,
+ "decl": null,
+ "authors": ""
+ },
+ {
+ "n": 30,
+ "title": "The Ballot Problem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Ballot.ballot_problem",
+ "authors": "Bhavik Mehta and Kexing Ying"
+ },
+ {
+ "n": 31,
+ "title": "Ramsey’s Theorem",
+ "formalized": true,
+ "in_mathlib": false,
+ "decl": null,
+ "authors": "Bhavik Mehta"
+ },
+ {
+ "n": 32,
+ "title": "The Four Color Problem",
+ "formalized": false,
+ "in_mathlib": false,
+ "decl": null,
+ "authors": ""
+ },
+ {
+ "n": 33,
+ "title": "Fermat’s Last Theorem",
+ "formalized": false,
+ "in_mathlib": false,
+ "decl": null,
+ "authors": ""
+ },
+ {
+ "n": 34,
+ "title": "Divergence of the Harmonic Series",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Real.tendsto_sum_range_one_div_nat_succ_atTop",
+ "authors": "Anatole Dedecker and Yury Kudryashov"
+ },
+ {
+ "n": 35,
+ "title": "Taylor’s Theorem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "taylor_mean_remainder_lagrange",
+ "authors": "Moritz Doll"
+ },
+ {
+ "n": 36,
+ "title": "Brouwer Fixed Point Theorem",
+ "formalized": true,
+ "in_mathlib": false,
+ "decl": null,
+ "authors": "Brendan Seamas Murphy"
+ },
+ {
+ "n": 37,
+ "title": "The Solution of a Cubic",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Theorems100.cubic_eq_zero_iff",
+ "authors": "Jeoff Lee"
+ },
+ {
+ "n": 38,
+ "title": "Arithmetic Mean/Geometric Mean",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Real.geom_mean_le_arith_mean_weighted",
+ "authors": "Yury G. Kudryashov"
+ },
+ {
+ "n": 39,
+ "title": "Solutions to Pell’s Equation",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Pell.eq_pell",
+ "authors": "Mario Carneiro (first), Michael Stoll (second)"
+ },
+ {
+ "n": 40,
+ "title": "Minkowski’s Fundamental Theorem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "MeasureTheory.exists_ne_zero_mem_lattice_of_measure_mul_two_pow_lt_measure",
+ "authors": "Alex J. Best and Yaël Dillies"
+ },
+ {
+ "n": 41,
+ "title": "Puiseux’s Theorem",
+ "formalized": false,
+ "in_mathlib": false,
+ "decl": null,
+ "authors": ""
+ },
+ {
+ "n": 42,
+ "title": "Sum of the Reciprocals of the Triangular Numbers",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Theorems100.inverse_triangle_sum",
+ "authors": "Jalex Stark and Yury Kudryashov"
+ },
+ {
+ "n": 43,
+ "title": "The Isoperimetric Theorem",
+ "formalized": false,
+ "in_mathlib": false,
+ "decl": null,
+ "authors": ""
+ },
+ {
+ "n": 44,
+ "title": "The Binomial Theorem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "add_pow",
+ "authors": "Chris Hughes"
+ },
+ {
+ "n": 45,
+ "title": "The Partition Theorem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Nat.Partition.card_odds_eq_card_distincts",
+ "authors": "Bhavik Mehta, Aaron Anderson, and Weiyi Wang"
+ },
+ {
+ "n": 46,
+ "title": "The Solution of the General Quartic Equation",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Theorems100.quartic_eq_zero_iff",
+ "authors": "Thomas Zhu"
+ },
+ {
+ "n": 47,
+ "title": "The Central Limit Theorem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "ProbabilityTheory.tendstoInDistribution_inv_sqrt_mul_sum_sub",
+ "authors": "Thomas Zhu, Rémy Degenne, Etienne Marion"
+ },
+ {
+ "n": 48,
+ "title": "Dirichlet’s Theorem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Nat.infinite_setOf_prime_and_eq_mod",
+ "authors": "David Loeffler, Michael Stoll"
+ },
+ {
+ "n": 49,
+ "title": "The Cayley-Hamilton Theorem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Matrix.aeval_self_charpoly",
+ "authors": "Kim Morrison"
+ },
+ {
+ "n": 50,
+ "title": "The Number of Platonic Solids",
+ "formalized": false,
+ "in_mathlib": false,
+ "decl": null,
+ "authors": ""
+ },
+ {
+ "n": 51,
+ "title": "Wilson’s Lemma",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "ZMod.wilsons_lemma",
+ "authors": "Chris Hughes"
+ },
+ {
+ "n": 52,
+ "title": "The Number of Subsets of a Set",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Finset.card_powerset",
+ "authors": "mathlib"
+ },
+ {
+ "n": 53,
+ "title": "Pi is Transcendental",
+ "formalized": false,
+ "in_mathlib": false,
+ "decl": null,
+ "authors": ""
+ },
+ {
+ "n": 54,
+ "title": "Königsberg Bridges Problem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Konigsberg.not_isEulerian",
+ "authors": "Kyle Miller"
+ },
+ {
+ "n": 55,
+ "title": "Product of Segments of Chords",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "EuclideanGeometry.mul_dist_eq_mul_dist_of_cospherical_of_angle_eq_pi",
+ "authors": "Manuel Candales"
+ },
+ {
+ "n": 56,
+ "title": "The Hermite-Lindemann Transcendence Theorem",
+ "formalized": false,
+ "in_mathlib": false,
+ "decl": null,
+ "authors": ""
+ },
+ {
+ "n": 57,
+ "title": "Heron’s Formula",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Theorems100.heron",
+ "authors": "Matt Kempster"
+ },
+ {
+ "n": 58,
+ "title": "Formula for the Number of Combinations",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Finset.card_powersetCard",
+ "authors": "mathlib "
+ },
+ {
+ "n": 59,
+ "title": "The Laws of Large Numbers",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "ProbabilityTheory.strong_law_ae",
+ "authors": "Sébastien Gouëzel"
+ },
+ {
+ "n": 60,
+ "title": "Bezout’s Theorem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Nat.gcd_eq_gcd_ab",
+ "authors": "mathlib"
+ },
+ {
+ "n": 61,
+ "title": "Theorem of Ceva",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Affine.Triangle.prod_dist_div_dist_eq_one_of_mem_line_of_mem_line",
+ "authors": "Joseph Myers"
+ },
+ {
+ "n": 62,
+ "title": "Fair Games Theorem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "MeasureTheory.submartingale_iff_expected_stoppedValue_mono",
+ "authors": "Kexing Ying"
+ },
+ {
+ "n": 63,
+ "title": "Cantor’s Theorem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Function.cantor_surjective",
+ "authors": "Johannes Hölzl and Mario Carneiro"
+ },
+ {
+ "n": 64,
+ "title": "L’Hopital’s Rule",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "deriv.lhopital_zero_nhds",
+ "authors": "Anatole Dedecker"
+ },
+ {
+ "n": 65,
+ "title": "Isosceles Triangle Theorem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "EuclideanGeometry.angle_eq_angle_of_dist_eq",
+ "authors": "Joseph Myers"
+ },
+ {
+ "n": 66,
+ "title": "Sum of a Geometric Series",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "geom_sum_Ico",
+ "authors": "Sander R. Dahmen (finite) and Johannes Hölzl (infinite)"
+ },
+ {
+ "n": 67,
+ "title": "e is Transcendental",
+ "formalized": true,
+ "in_mathlib": false,
+ "decl": null,
+ "authors": "Jujian Zhang"
+ },
+ {
+ "n": 68,
+ "title": "Sum of an arithmetic series",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Finset.sum_range_id",
+ "authors": "Johannes Hölzl"
+ },
+ {
+ "n": 69,
+ "title": "Greatest Common Divisor Algorithm",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "EuclideanDomain.gcd",
+ "authors": "mathlib"
+ },
+ {
+ "n": 70,
+ "title": "The Perfect Number Theorem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Theorems100.Nat.eq_two_pow_mul_prime_mersenne_of_even_perfect",
+ "authors": "Aaron Anderson"
+ },
+ {
+ "n": 71,
+ "title": "Order of a Subgroup",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Subgroup.card_subgroup_dvd_card",
+ "authors": "mathlib"
+ },
+ {
+ "n": 72,
+ "title": "Sylow’s Theorem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Sylow.exists_subgroup_card_pow_prime",
+ "authors": "Chris Hughes"
+ },
+ {
+ "n": 73,
+ "title": "Ascending or Descending Sequences (Erdős–Szekeres Theorem)",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Theorems100.erdos_szekeres",
+ "authors": "Bhavik Mehta"
+ },
+ {
+ "n": 74,
+ "title": "The Principle of Mathematical Induction",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Nat",
+ "authors": "Leonardo de Moura"
+ },
+ {
+ "n": 75,
+ "title": "The Mean Value Theorem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "exists_deriv_eq_slope",
+ "authors": "Yury G. Kudryashov"
+ },
+ {
+ "n": 76,
+ "title": "Fourier Series",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "fourierCoeff",
+ "authors": "Heather Macbeth"
+ },
+ {
+ "n": 77,
+ "title": "Sum of kth powers",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "sum_range_pow",
+ "authors": "Moritz Firsching and Fabian Kruse and Ashvni Narayanan"
+ },
+ {
+ "n": 78,
+ "title": "The Cauchy-Schwarz Inequality",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "inner_mul_inner_self_le",
+ "authors": "Zhouhang Zhou"
+ },
+ {
+ "n": 79,
+ "title": "The Intermediate Value Theorem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "intermediate_value_Icc",
+ "authors": "Rob Lewis and Chris Hughes"
+ },
+ {
+ "n": 80,
+ "title": "The Fundamental Theorem of Arithmetic",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Nat.primeFactorsList_unique",
+ "authors": "Chris Hughes"
+ },
+ {
+ "n": 81,
+ "title": "Divergence of the Prime Reciprocal Series",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Theorems100.Real.tendsto_sum_one_div_prime_atTop",
+ "authors": "Manuel Candales (archive), Michael Stoll (mathlib)"
+ },
+ {
+ "n": 82,
+ "title": "Dissection of Cubes (J.E. Littlewood’s ‘elegant’ proof)",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Theorems100.«82».cannot_cube_a_cube",
+ "authors": "Floris van Doorn"
+ },
+ {
+ "n": 83,
+ "title": "The Friendship Theorem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Theorems100.friendship_theorem",
+ "authors": "Aaron Anderson and Jalex Stark and Kyle Miller"
+ },
+ {
+ "n": 84,
+ "title": "Morley’s Theorem",
+ "formalized": false,
+ "in_mathlib": false,
+ "decl": null,
+ "authors": ""
+ },
+ {
+ "n": 85,
+ "title": "Divisibility by 3 Rule",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Nat.three_dvd_iff",
+ "authors": "Kim Morrison"
+ },
+ {
+ "n": 86,
+ "title": "Lebesgue Measure and Integration",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "MeasureTheory.lintegral",
+ "authors": "Johannes Hölzl"
+ },
+ {
+ "n": 87,
+ "title": "Desargues’s Theorem",
+ "formalized": false,
+ "in_mathlib": false,
+ "decl": null,
+ "authors": ""
+ },
+ {
+ "n": 88,
+ "title": "Derangements Formula",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "card_derangements_eq_numDerangements",
+ "authors": "Henry Swanson"
+ },
+ {
+ "n": 89,
+ "title": "The Factor and Remainder Theorems",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Polynomial.dvd_iff_isRoot",
+ "authors": "Chris Hughes"
+ },
+ {
+ "n": 90,
+ "title": "Stirling’s Formula",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Stirling.tendsto_stirlingSeq_sqrt_pi",
+ "authors": "Moritz Firsching and Fabian Kruse and Nikolas Kuhn and Heather Macbeth"
+ },
+ {
+ "n": 91,
+ "title": "The Triangle Inequality",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "norm_add_le",
+ "authors": "Zhouhang Zhou"
+ },
+ {
+ "n": 92,
+ "title": "Pick’s Theorem",
+ "formalized": false,
+ "in_mathlib": false,
+ "decl": null,
+ "authors": ""
+ },
+ {
+ "n": 93,
+ "title": "The Birthday Problem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Theorems100.birthday",
+ "authors": "Eric Rodriguez"
+ },
+ {
+ "n": 94,
+ "title": "The Law of Cosines",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "EuclideanGeometry.dist_sq_eq_dist_sq_add_dist_sq_sub_two_mul_dist_mul_dist_mul_cos_angle",
+ "authors": "Joseph Myers"
+ },
+ {
+ "n": 95,
+ "title": "Ptolemy’s Theorem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "EuclideanGeometry.mul_dist_add_mul_dist_eq_mul_dist_of_cospherical",
+ "authors": "Manuel Candales"
+ },
+ {
+ "n": 96,
+ "title": "Principle of Inclusion/Exclusion",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Finset.inclusion_exclusion_sum_biUnion",
+ "authors": "Neil Strickland (outside mathlib), Yaël Dillies (in mathlib)"
+ },
+ {
+ "n": 97,
+ "title": "Cramer’s Rule",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Matrix.mulVec_cramer",
+ "authors": "Anne Baanen"
+ },
+ {
+ "n": 98,
+ "title": "Bertrand’s Postulate",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Nat.bertrand",
+ "authors": "Bolton Bailey and Patrick Stevens"
+ },
+ {
+ "n": 99,
+ "title": "Buffon Needle Problem",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "BuffonsNeedle.buffon_short",
+ "authors": "Enrico Z. Borba"
+ },
+ {
+ "n": 100,
+ "title": "Descartes Rule of Signs",
+ "formalized": true,
+ "in_mathlib": true,
+ "decl": "Polynomial.roots_countP_pos_le_signVariations",
+ "authors": "Alex Meiburg"
+ }
+ ],
+ "thousand": {
+ "listed": 1199,
+ "in_mathlib": 200
+ },
+ "undergrad": [
+ {
+ "topic": "Linear algebra",
+ "items": 60,
+ "in_mathlib": 50
+ },
+ {
+ "topic": "Group Theory",
+ "items": 39,
+ "in_mathlib": 32
+ },
+ {
+ "topic": "Ring Theory",
+ "items": 61,
+ "in_mathlib": 58
+ },
+ {
+ "topic": "Bilinear and Quadratic Forms Over a Vector Space",
+ "items": 39,
+ "in_mathlib": 32
+ },
+ {
+ "topic": "Affine and Euclidean Geometry",
+ "items": 29,
+ "in_mathlib": 14
+ },
+ {
+ "topic": "Single Variable Real Analysis",
+ "items": 73,
+ "in_mathlib": 58
+ },
+ {
+ "topic": "Single Variable Complex Analysis",
+ "items": 25,
+ "in_mathlib": 13
+ },
+ {
+ "topic": "Topology",
+ "items": 44,
+ "in_mathlib": 41
+ },
+ {
+ "topic": "Multivariable calculus",
+ "items": 41,
+ "in_mathlib": 16
+ },
+ {
+ "topic": "Measures and integral calculus",
+ "items": 38,
+ "in_mathlib": 33
+ },
+ {
+ "topic": "Probability Theory",
+ "items": 38,
+ "in_mathlib": 22
+ },
+ {
+ "topic": "Distribution calculus",
+ "items": 39,
+ "in_mathlib": 14
+ },
+ {
+ "topic": "Numerical Analysis",
+ "items": 36,
+ "in_mathlib": 2
+ }
+ ],
+ "overview": [
+ {
+ "topic": "General algebra",
+ "items": 134,
+ "in_mathlib": 134
+ },
+ {
+ "topic": "Linear algebra",
+ "items": 35,
+ "in_mathlib": 35
+ },
+ {
+ "topic": "Topology",
+ "items": 53,
+ "in_mathlib": 53
+ },
+ {
+ "topic": "Analysis",
+ "items": 97,
+ "in_mathlib": 97
+ },
+ {
+ "topic": "Probability Theory",
+ "items": 24,
+ "in_mathlib": 24
+ },
+ {
+ "topic": "Geometry",
+ "items": 52,
+ "in_mathlib": 52
+ },
+ {
+ "topic": "Combinatorics",
+ "items": 43,
+ "in_mathlib": 43
+ },
+ {
+ "topic": "Dynamics",
+ "items": 6,
+ "in_mathlib": 6
+ },
+ {
+ "topic": "Data structures",
+ "items": 20,
+ "in_mathlib": 20
+ },
+ {
+ "topic": "Logic and computation",
+ "items": 28,
+ "in_mathlib": 28
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tasks/group-theory/group-theory-hom-d1-e0000/environment/Dockerfile b/tasks/group-theory/group-theory-hom-d1-e0000/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-e0000/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-hom-d1-e0000/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-hom-d1-e0000/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..aa55c6fc4cc6878187814a7ebd8c15b1340caf48
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-e0000/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- Commutators with a kernel element lie in the kernel. -/
+theorem commutator_in_kernel {G H : Type*} [Group G] [Group H] (f : G →* H) (x y : G)
+ (hx : f x = 1) : y * x * y⁻¹ * x⁻¹ ∈ f.ker := by
+ sorry
diff --git a/tasks/group-theory/group-theory-hom-d1-e0000/instruction.md b/tasks/group-theory/group-theory-hom-d1-e0000/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..d665f665acac969df0d5ec8fa6f6aa4f7dd2722b
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-e0000/instruction.md
@@ -0,0 +1,14 @@
+# Kernels of group homomorphisms
+
+Prove the following statement.
+
+Let \(f : G \to H\) be a group homomorphism and \(x, y \in G\) with \(f(x) = e\). Then \(y x y^{-1} x^{-1}\) lies in the kernel of \(f\).
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-hom-d1-e0000/solution/Solution.lean b/tasks/group-theory/group-theory-hom-d1-e0000/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..ea02c0b8e5936fe7d4c83cfd86674a8974da65dd
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-e0000/solution/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- Commutators with a kernel element lie in the kernel. -/
+theorem commutator_in_kernel {G H : Type*} [Group G] [Group H] (f : G →* H) (x y : G)
+ (hx : f x = 1) : y * x * y⁻¹ * x⁻¹ ∈ f.ker := by
+ exact mul_mem (f.normal_ker.conj_mem _ hx y) (inv_mem hx)
diff --git a/tasks/group-theory/group-theory-hom-d1-e0000/solution/solve.sh b/tasks/group-theory/group-theory-hom-d1-e0000/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-e0000/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-hom-d1-e0000/task.toml b/tasks/group-theory/group-theory-hom-d1-e0000/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..6a89ad37664b20f673d25fbf659571dd9551b17c
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-e0000/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "easy"
+category = "group-theory"
+tags = ["group-theory", "hom", "msc-20", "eval", "lean4"]
+msc = "20"
+family = "hom"
+split = "eval"
+seed = 10000
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-hom-d1-e0000/tests/Verify.lean b/tasks/group-theory/group-theory-hom-d1-e0000/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-e0000/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-hom-d1-e0000/tests/grade.py b/tasks/group-theory/group-theory-hom-d1-e0000/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-e0000/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-hom-d1-e0000/tests/spec.json b/tasks/group-theory/group-theory-hom-d1-e0000/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..ef69f32f2c5487414e06616648dadec0fa6f5537
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-e0000/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- Commutators with a kernel element lie in the kernel. -/\ntheorem commutator_in_kernel {G H : Type*} [Group G] [Group H] (f : G →* H) (x y : G)\n (hx : f x = 1) : y * x * y⁻¹ * x⁻¹ ∈ f.ker := by\n sorry\n",
+ "targets": [
+ {
+ "name": "commutator_in_kernel",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-hom-d1-e0000/tests/test.sh b/tasks/group-theory/group-theory-hom-d1-e0000/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-e0000/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-hom-d1-e0012/environment/Dockerfile b/tasks/group-theory/group-theory-hom-d1-e0012/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-e0012/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-hom-d1-e0012/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-hom-d1-e0012/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..4b29f6e2032e2e0d28c0fc2287d05c174111260e
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-e0012/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- Powers of kernel elements are in the kernel. -/
+theorem image_of_power {G H : Type*} [Group G] [Group H] (f : G →* H) (a : G)
+ (hx : f a = 1) : f (a ^ 7) = 1 := by
+ sorry
diff --git a/tasks/group-theory/group-theory-hom-d1-e0012/instruction.md b/tasks/group-theory/group-theory-hom-d1-e0012/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..d9942f3ea4decabfed16754767ee426866ea4b4b
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-e0012/instruction.md
@@ -0,0 +1,14 @@
+# Kernels of group homomorphisms
+
+Prove the following statement.
+
+Let \(f : G \to H\) be a group homomorphism and \(a\) an element of \(G\) with \(f(a) = e\). Then \(f(a^{7}) = e\).
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-hom-d1-e0012/solution/Solution.lean b/tasks/group-theory/group-theory-hom-d1-e0012/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..d0f9508b7d448aef4cefca3122c6fb45b6d7cbb3
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-e0012/solution/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- Powers of kernel elements are in the kernel. -/
+theorem image_of_power {G H : Type*} [Group G] [Group H] (f : G →* H) (a : G)
+ (hx : f a = 1) : f (a ^ 7) = 1 := by
+ rw [map_pow, hx, one_pow]
diff --git a/tasks/group-theory/group-theory-hom-d1-e0012/solution/solve.sh b/tasks/group-theory/group-theory-hom-d1-e0012/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-e0012/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-hom-d1-e0012/task.toml b/tasks/group-theory/group-theory-hom-d1-e0012/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..e11e8487a16d06b245dc10f348d42184479a35d7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-e0012/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "easy"
+category = "group-theory"
+tags = ["group-theory", "hom", "msc-20", "eval", "lean4"]
+msc = "20"
+family = "hom"
+split = "eval"
+seed = 10012
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-hom-d1-e0012/tests/Verify.lean b/tasks/group-theory/group-theory-hom-d1-e0012/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-e0012/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-hom-d1-e0012/tests/grade.py b/tasks/group-theory/group-theory-hom-d1-e0012/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-e0012/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-hom-d1-e0012/tests/spec.json b/tasks/group-theory/group-theory-hom-d1-e0012/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..da57068e43abe7159a8598130ece541cab639450
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-e0012/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- Powers of kernel elements are in the kernel. -/\ntheorem image_of_power {G H : Type*} [Group G] [Group H] (f : G →* H) (a : G)\n (hx : f a = 1) : f (a ^ 7) = 1 := by\n sorry\n",
+ "targets": [
+ {
+ "name": "image_of_power",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-hom-d1-e0012/tests/test.sh b/tasks/group-theory/group-theory-hom-d1-e0012/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-e0012/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-hom-d1-t0000/environment/Dockerfile b/tasks/group-theory/group-theory-hom-d1-t0000/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0000/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-hom-d1-t0000/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-hom-d1-t0000/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..910a21fe96592ec04f4d378452b9179851878c74
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0000/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- Two elements have the same image exactly when x⁻¹ y is in the kernel. -/
+theorem eq_iff_mem_ker {X Y : Type*} [Group X] [Group Y] (f : X →* Y) (x y : X) :
+ f x = f y ↔ x⁻¹ * y ∈ f.ker := by
+ sorry
diff --git a/tasks/group-theory/group-theory-hom-d1-t0000/instruction.md b/tasks/group-theory/group-theory-hom-d1-t0000/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..79369c84294fed97e2baaa953e9b88b121797ba2
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0000/instruction.md
@@ -0,0 +1,14 @@
+# Kernels of group homomorphisms
+
+Prove the following statement.
+
+Let \(f : G \to H\) be a group homomorphism and \(x, y \in G\). Then \(f(x) = f(y)\) if and only if \(x^{-1} y\) lies in the kernel of \(f\).
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-hom-d1-t0000/solution/Solution.lean b/tasks/group-theory/group-theory-hom-d1-t0000/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..372dc28ab724f1dd83de375a6990c8b9c13148fa
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0000/solution/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- Two elements have the same image exactly when x⁻¹ y is in the kernel. -/
+theorem eq_iff_mem_ker {X Y : Type*} [Group X] [Group Y] (f : X →* Y) (x y : X) :
+ f x = f y ↔ x⁻¹ * y ∈ f.ker := by
+ rw [MonoidHom.mem_ker, map_mul, map_inv, inv_mul_eq_one]
diff --git a/tasks/group-theory/group-theory-hom-d1-t0000/solution/solve.sh b/tasks/group-theory/group-theory-hom-d1-t0000/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0000/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-hom-d1-t0000/task.toml b/tasks/group-theory/group-theory-hom-d1-t0000/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..c47b1384c74a8148a922dc423bb356d8c89e95ed
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0000/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "easy"
+category = "group-theory"
+tags = ["group-theory", "hom", "msc-20", "train", "lean4"]
+msc = "20"
+family = "hom"
+split = "train"
+seed = 0
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-hom-d1-t0000/tests/Verify.lean b/tasks/group-theory/group-theory-hom-d1-t0000/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0000/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-hom-d1-t0000/tests/grade.py b/tasks/group-theory/group-theory-hom-d1-t0000/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0000/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-hom-d1-t0000/tests/spec.json b/tasks/group-theory/group-theory-hom-d1-t0000/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..fd50bddf75546900a7430128ad04bd2d4a892e68
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0000/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- Two elements have the same image exactly when x⁻¹ y is in the kernel. -/\ntheorem eq_iff_mem_ker {X Y : Type*} [Group X] [Group Y] (f : X →* Y) (x y : X) :\n f x = f y ↔ x⁻¹ * y ∈ f.ker := by\n sorry\n",
+ "targets": [
+ {
+ "name": "eq_iff_mem_ker",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-hom-d1-t0000/tests/test.sh b/tasks/group-theory/group-theory-hom-d1-t0000/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0000/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-hom-d1-t0012/environment/Dockerfile b/tasks/group-theory/group-theory-hom-d1-t0012/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0012/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-hom-d1-t0012/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-hom-d1-t0012/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..9f0755971b0d30e381d3ca2b129a4ca86b7d71cf
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0012/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- Powers of kernel elements are in the kernel. -/
+theorem image_of_power {X Y : Type*} [Group X] [Group Y] (f : X →* Y) (s : X)
+ (hx : f s = 1) : f (s ^ 3) = 1 := by
+ sorry
diff --git a/tasks/group-theory/group-theory-hom-d1-t0012/instruction.md b/tasks/group-theory/group-theory-hom-d1-t0012/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..964e7453e04f3ba23c587493be30feeb6d1255a2
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0012/instruction.md
@@ -0,0 +1,14 @@
+# Kernels of group homomorphisms
+
+Prove the following statement.
+
+Let \(f : G \to H\) be a group homomorphism and \(s\) an element of \(G\) with \(f(s) = e\). Then \(f(s^{3}) = e\).
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-hom-d1-t0012/solution/Solution.lean b/tasks/group-theory/group-theory-hom-d1-t0012/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..591a8d1e61b198dadf998b6f20ee544cf6c9edc4
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0012/solution/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- Powers of kernel elements are in the kernel. -/
+theorem image_of_power {X Y : Type*} [Group X] [Group Y] (f : X →* Y) (s : X)
+ (hx : f s = 1) : f (s ^ 3) = 1 := by
+ rw [map_pow, hx, one_pow]
diff --git a/tasks/group-theory/group-theory-hom-d1-t0012/solution/solve.sh b/tasks/group-theory/group-theory-hom-d1-t0012/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0012/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-hom-d1-t0012/task.toml b/tasks/group-theory/group-theory-hom-d1-t0012/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..70baa9b03c1aed7fa44d1827e2cceabe43977594
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0012/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "easy"
+category = "group-theory"
+tags = ["group-theory", "hom", "msc-20", "train", "lean4"]
+msc = "20"
+family = "hom"
+split = "train"
+seed = 12
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-hom-d1-t0012/tests/Verify.lean b/tasks/group-theory/group-theory-hom-d1-t0012/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0012/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-hom-d1-t0012/tests/grade.py b/tasks/group-theory/group-theory-hom-d1-t0012/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0012/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-hom-d1-t0012/tests/spec.json b/tasks/group-theory/group-theory-hom-d1-t0012/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..df19c24e802b57de67d429560704c687c4300676
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0012/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- Powers of kernel elements are in the kernel. -/\ntheorem image_of_power {X Y : Type*} [Group X] [Group Y] (f : X →* Y) (s : X)\n (hx : f s = 1) : f (s ^ 3) = 1 := by\n sorry\n",
+ "targets": [
+ {
+ "name": "image_of_power",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-hom-d1-t0012/tests/test.sh b/tasks/group-theory/group-theory-hom-d1-t0012/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0012/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-hom-d1-t0024/environment/Dockerfile b/tasks/group-theory/group-theory-hom-d1-t0024/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0024/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-hom-d1-t0024/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-hom-d1-t0024/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..70491e06f02397adda131acf0ed76406878504a4
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0024/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- Powers of kernel elements are in the kernel. -/
+theorem image_of_power {G K : Type*} [Group G] [Group K] (f : G →* K) (a : G)
+ (hx : f a = 1) : f (a ^ 11) = 1 := by
+ sorry
diff --git a/tasks/group-theory/group-theory-hom-d1-t0024/instruction.md b/tasks/group-theory/group-theory-hom-d1-t0024/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..1233f37150e722200a5b38981e095d875379fc75
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0024/instruction.md
@@ -0,0 +1,14 @@
+# Kernels of group homomorphisms
+
+Prove the following statement.
+
+Let \(f : G \to H\) be a group homomorphism and \(a\) an element of \(G\) with \(f(a) = e\). Then \(f(a^{11}) = e\).
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-hom-d1-t0024/solution/Solution.lean b/tasks/group-theory/group-theory-hom-d1-t0024/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..4b2f516122533b73c30db4701b19333d96acc0d8
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0024/solution/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- Powers of kernel elements are in the kernel. -/
+theorem image_of_power {G K : Type*} [Group G] [Group K] (f : G →* K) (a : G)
+ (hx : f a = 1) : f (a ^ 11) = 1 := by
+ rw [map_pow, hx, one_pow]
diff --git a/tasks/group-theory/group-theory-hom-d1-t0024/solution/solve.sh b/tasks/group-theory/group-theory-hom-d1-t0024/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0024/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-hom-d1-t0024/task.toml b/tasks/group-theory/group-theory-hom-d1-t0024/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..192e6cebf65cea1e162e55c4f17e9f7f4387a77a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0024/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "easy"
+category = "group-theory"
+tags = ["group-theory", "hom", "msc-20", "train", "lean4"]
+msc = "20"
+family = "hom"
+split = "train"
+seed = 24
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-hom-d1-t0024/tests/Verify.lean b/tasks/group-theory/group-theory-hom-d1-t0024/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0024/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-hom-d1-t0024/tests/grade.py b/tasks/group-theory/group-theory-hom-d1-t0024/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0024/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-hom-d1-t0024/tests/spec.json b/tasks/group-theory/group-theory-hom-d1-t0024/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..82bae2baed8bde8c757e61da58490264e9c2e833
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0024/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- Powers of kernel elements are in the kernel. -/\ntheorem image_of_power {G K : Type*} [Group G] [Group K] (f : G →* K) (a : G)\n (hx : f a = 1) : f (a ^ 11) = 1 := by\n sorry\n",
+ "targets": [
+ {
+ "name": "image_of_power",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-hom-d1-t0024/tests/test.sh b/tasks/group-theory/group-theory-hom-d1-t0024/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0024/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-hom-d1-t0036/environment/Dockerfile b/tasks/group-theory/group-theory-hom-d1-t0036/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0036/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-hom-d1-t0036/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-hom-d1-t0036/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..4eb95384ce76aff667fe04bd7247b7a29c0f114a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0036/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- Powers of kernel elements are in the kernel. -/
+theorem image_of_power {X Y : Type*} [Group X] [Group Y] (f : X →* Y) (p : X)
+ (hx : f p = 1) : f (p ^ 6) = 1 := by
+ sorry
diff --git a/tasks/group-theory/group-theory-hom-d1-t0036/instruction.md b/tasks/group-theory/group-theory-hom-d1-t0036/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..cc43d41cfa888fcdb34e77a42a735dfca08d15fd
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0036/instruction.md
@@ -0,0 +1,14 @@
+# Kernels of group homomorphisms
+
+Prove the following statement.
+
+Let \(f : G \to H\) be a group homomorphism and \(p\) an element of \(G\) with \(f(p) = e\). Then \(f(p^{6}) = e\).
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-hom-d1-t0036/solution/Solution.lean b/tasks/group-theory/group-theory-hom-d1-t0036/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..7523d7d3372c3c9319bf3d2f758a20ae31c7d040
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0036/solution/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- Powers of kernel elements are in the kernel. -/
+theorem image_of_power {X Y : Type*} [Group X] [Group Y] (f : X →* Y) (p : X)
+ (hx : f p = 1) : f (p ^ 6) = 1 := by
+ rw [map_pow, hx, one_pow]
diff --git a/tasks/group-theory/group-theory-hom-d1-t0036/solution/solve.sh b/tasks/group-theory/group-theory-hom-d1-t0036/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0036/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-hom-d1-t0036/task.toml b/tasks/group-theory/group-theory-hom-d1-t0036/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..1904df8fca10dd269f0a122a08819376aff1c7c8
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0036/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "easy"
+category = "group-theory"
+tags = ["group-theory", "hom", "msc-20", "train", "lean4"]
+msc = "20"
+family = "hom"
+split = "train"
+seed = 36
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-hom-d1-t0036/tests/Verify.lean b/tasks/group-theory/group-theory-hom-d1-t0036/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0036/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-hom-d1-t0036/tests/grade.py b/tasks/group-theory/group-theory-hom-d1-t0036/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0036/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-hom-d1-t0036/tests/spec.json b/tasks/group-theory/group-theory-hom-d1-t0036/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..9d2a8f369cc259a2a52a0319f9bd12d43d9cc046
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0036/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- Powers of kernel elements are in the kernel. -/\ntheorem image_of_power {X Y : Type*} [Group X] [Group Y] (f : X →* Y) (p : X)\n (hx : f p = 1) : f (p ^ 6) = 1 := by\n sorry\n",
+ "targets": [
+ {
+ "name": "image_of_power",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-hom-d1-t0036/tests/test.sh b/tasks/group-theory/group-theory-hom-d1-t0036/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0036/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-hom-d1-t0048/environment/Dockerfile b/tasks/group-theory/group-theory-hom-d1-t0048/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0048/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-hom-d1-t0048/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-hom-d1-t0048/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..d9292a10ae7ae1ad569d478a4b6ccda1c03883de
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0048/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- Two elements have the same image exactly when x⁻¹ y is in the kernel. -/
+theorem eq_iff_mem_ker {G K : Type*} [Group G] [Group K] (f : G →* K) (s t : G) :
+ f s = f t ↔ s⁻¹ * t ∈ f.ker := by
+ sorry
diff --git a/tasks/group-theory/group-theory-hom-d1-t0048/instruction.md b/tasks/group-theory/group-theory-hom-d1-t0048/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..521d7570651cc83fc4e30f5cad52c09d06f3dcbb
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0048/instruction.md
@@ -0,0 +1,14 @@
+# Kernels of group homomorphisms
+
+Prove the following statement.
+
+Let \(f : G \to H\) be a group homomorphism and \(s, t \in G\). Then \(f(s) = f(t)\) if and only if \(s^{-1} t\) lies in the kernel of \(f\).
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-hom-d1-t0048/solution/Solution.lean b/tasks/group-theory/group-theory-hom-d1-t0048/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..344e8feac814dabb70535e41ace08b51fa737b15
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0048/solution/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- Two elements have the same image exactly when x⁻¹ y is in the kernel. -/
+theorem eq_iff_mem_ker {G K : Type*} [Group G] [Group K] (f : G →* K) (s t : G) :
+ f s = f t ↔ s⁻¹ * t ∈ f.ker := by
+ rw [MonoidHom.mem_ker, map_mul, map_inv, inv_mul_eq_one]
diff --git a/tasks/group-theory/group-theory-hom-d1-t0048/solution/solve.sh b/tasks/group-theory/group-theory-hom-d1-t0048/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0048/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-hom-d1-t0048/task.toml b/tasks/group-theory/group-theory-hom-d1-t0048/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..2e5c7b75e10dc96cdc2c364d44f93f1749a4218b
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0048/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "easy"
+category = "group-theory"
+tags = ["group-theory", "hom", "msc-20", "train", "lean4"]
+msc = "20"
+family = "hom"
+split = "train"
+seed = 48
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-hom-d1-t0048/tests/Verify.lean b/tasks/group-theory/group-theory-hom-d1-t0048/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0048/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-hom-d1-t0048/tests/grade.py b/tasks/group-theory/group-theory-hom-d1-t0048/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0048/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-hom-d1-t0048/tests/spec.json b/tasks/group-theory/group-theory-hom-d1-t0048/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..a5f90b9aa06e1d15255816e142c9c4080d9d1e55
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0048/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- Two elements have the same image exactly when x⁻¹ y is in the kernel. -/\ntheorem eq_iff_mem_ker {G K : Type*} [Group G] [Group K] (f : G →* K) (s t : G) :\n f s = f t ↔ s⁻¹ * t ∈ f.ker := by\n sorry\n",
+ "targets": [
+ {
+ "name": "eq_iff_mem_ker",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-hom-d1-t0048/tests/test.sh b/tasks/group-theory/group-theory-hom-d1-t0048/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0048/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-hom-d1-t0072/environment/Dockerfile b/tasks/group-theory/group-theory-hom-d1-t0072/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0072/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-hom-d1-t0072/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-hom-d1-t0072/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..56273f20e9cada7de71f9fcbc7dd432c4cfe8c9b
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0072/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- Commutators with a kernel element lie in the kernel. -/
+theorem commutator_in_kernel {A B : Type*} [Group A] [Group B] (f : A →* B) (p q : A)
+ (hx : f p = 1) : q * p * q⁻¹ * p⁻¹ ∈ f.ker := by
+ sorry
diff --git a/tasks/group-theory/group-theory-hom-d1-t0072/instruction.md b/tasks/group-theory/group-theory-hom-d1-t0072/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..cdecd84b85bde925d3267276614a77493c5093ee
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0072/instruction.md
@@ -0,0 +1,14 @@
+# Kernels of group homomorphisms
+
+Prove the following statement.
+
+Let \(f : G \to H\) be a group homomorphism and \(p, q \in G\) with \(f(p) = e\). Then \(q p q^{-1} p^{-1}\) lies in the kernel of \(f\).
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-hom-d1-t0072/solution/Solution.lean b/tasks/group-theory/group-theory-hom-d1-t0072/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..13d252dcdfb079acf063de623dd74083049c26c9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0072/solution/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- Commutators with a kernel element lie in the kernel. -/
+theorem commutator_in_kernel {A B : Type*} [Group A] [Group B] (f : A →* B) (p q : A)
+ (hx : f p = 1) : q * p * q⁻¹ * p⁻¹ ∈ f.ker := by
+ exact mul_mem (f.normal_ker.conj_mem _ hx q) (inv_mem hx)
diff --git a/tasks/group-theory/group-theory-hom-d1-t0072/solution/solve.sh b/tasks/group-theory/group-theory-hom-d1-t0072/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0072/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-hom-d1-t0072/task.toml b/tasks/group-theory/group-theory-hom-d1-t0072/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..a9c4ffab4ad5a7bd7f8c537996ee197c7ee81374
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0072/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "easy"
+category = "group-theory"
+tags = ["group-theory", "hom", "msc-20", "train", "lean4"]
+msc = "20"
+family = "hom"
+split = "train"
+seed = 72
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-hom-d1-t0072/tests/Verify.lean b/tasks/group-theory/group-theory-hom-d1-t0072/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0072/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-hom-d1-t0072/tests/grade.py b/tasks/group-theory/group-theory-hom-d1-t0072/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0072/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-hom-d1-t0072/tests/spec.json b/tasks/group-theory/group-theory-hom-d1-t0072/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..ac9616eae6c3beca6024094d41a37eec8412f5b2
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0072/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- Commutators with a kernel element lie in the kernel. -/\ntheorem commutator_in_kernel {A B : Type*} [Group A] [Group B] (f : A →* B) (p q : A)\n (hx : f p = 1) : q * p * q⁻¹ * p⁻¹ ∈ f.ker := by\n sorry\n",
+ "targets": [
+ {
+ "name": "commutator_in_kernel",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-hom-d1-t0072/tests/test.sh b/tasks/group-theory/group-theory-hom-d1-t0072/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d1-t0072/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-hom-d2-e0004/environment/Dockerfile b/tasks/group-theory/group-theory-hom-d2-e0004/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-e0004/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-hom-d2-e0004/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-hom-d2-e0004/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..ab5ef8b2925d6cf1e9e7971afdef3fbf30bb89bd
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-e0004/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- The kernel of f lies in the kernel of g after f. -/
+theorem ker_le_ker_comp {G K Z : Type*} [Group G] [Group K] [Group Z] (f : G →* K) (g : K →* Z) :
+ f.ker ≤ (g.comp f).ker := by
+ sorry
diff --git a/tasks/group-theory/group-theory-hom-d2-e0004/instruction.md b/tasks/group-theory/group-theory-hom-d2-e0004/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..e81ae2b8465e7aa0f31ddb8bde4a4afad0d9fbd0
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-e0004/instruction.md
@@ -0,0 +1,14 @@
+# Kernels of group homomorphisms
+
+Prove the following statement.
+
+Let \(f : G \to H\) and \(g : H \to K\) be group homomorphisms. Then every element of the kernel of \(f\) lies in the kernel of \(g \circ f\).
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-hom-d2-e0004/solution/Solution.lean b/tasks/group-theory/group-theory-hom-d2-e0004/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..2dbdcc030582cae6c481050ebd9c61892d908f33
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-e0004/solution/Solution.lean
@@ -0,0 +1,8 @@
+import Mathlib
+
+/-- The kernel of f lies in the kernel of g after f. -/
+theorem ker_le_ker_comp {G K Z : Type*} [Group G] [Group K] [Group Z] (f : G →* K) (g : K →* Z) :
+ f.ker ≤ (g.comp f).ker := by
+ intro g hx
+ rw [MonoidHom.mem_ker] at hx ⊢
+ rw [MonoidHom.comp_apply, hx, map_one]
diff --git a/tasks/group-theory/group-theory-hom-d2-e0004/solution/solve.sh b/tasks/group-theory/group-theory-hom-d2-e0004/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-e0004/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-hom-d2-e0004/task.toml b/tasks/group-theory/group-theory-hom-d2-e0004/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..135f60bcb2c32fc17e590fdc60ea18bb18cc369d
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-e0004/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "medium"
+category = "group-theory"
+tags = ["group-theory", "hom", "msc-20", "eval", "lean4"]
+msc = "20"
+family = "hom"
+split = "eval"
+seed = 10004
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-hom-d2-e0004/tests/Verify.lean b/tasks/group-theory/group-theory-hom-d2-e0004/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-e0004/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-hom-d2-e0004/tests/grade.py b/tasks/group-theory/group-theory-hom-d2-e0004/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-e0004/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-hom-d2-e0004/tests/spec.json b/tasks/group-theory/group-theory-hom-d2-e0004/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..7962b4001fa9b5513a5fb2e08194716d2ebb41b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-e0004/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- The kernel of f lies in the kernel of g after f. -/\ntheorem ker_le_ker_comp {G K Z : Type*} [Group G] [Group K] [Group Z] (f : G →* K) (g : K →* Z) :\n f.ker ≤ (g.comp f).ker := by\n sorry\n",
+ "targets": [
+ {
+ "name": "ker_le_ker_comp",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-hom-d2-e0004/tests/test.sh b/tasks/group-theory/group-theory-hom-d2-e0004/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-e0004/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-hom-d2-t0004/environment/Dockerfile b/tasks/group-theory/group-theory-hom-d2-t0004/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0004/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-hom-d2-t0004/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-hom-d2-t0004/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..152f9f122a13be3f1fa99822da829834fb9dd896
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0004/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- The kernel of f lies in the kernel of g after f. -/
+theorem ker_le_ker_comp {G H Z : Type*} [Group G] [Group H] [Group Z] (f : G →* H) (g : H →* Z) :
+ f.ker ≤ (g.comp f).ker := by
+ sorry
diff --git a/tasks/group-theory/group-theory-hom-d2-t0004/instruction.md b/tasks/group-theory/group-theory-hom-d2-t0004/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..e81ae2b8465e7aa0f31ddb8bde4a4afad0d9fbd0
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0004/instruction.md
@@ -0,0 +1,14 @@
+# Kernels of group homomorphisms
+
+Prove the following statement.
+
+Let \(f : G \to H\) and \(g : H \to K\) be group homomorphisms. Then every element of the kernel of \(f\) lies in the kernel of \(g \circ f\).
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-hom-d2-t0004/solution/Solution.lean b/tasks/group-theory/group-theory-hom-d2-t0004/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..048ccad6966bc45aea7ea852b77fb7cbe05f3360
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0004/solution/Solution.lean
@@ -0,0 +1,8 @@
+import Mathlib
+
+/-- The kernel of f lies in the kernel of g after f. -/
+theorem ker_le_ker_comp {G H Z : Type*} [Group G] [Group H] [Group Z] (f : G →* H) (g : H →* Z) :
+ f.ker ≤ (g.comp f).ker := by
+ intro s hx
+ rw [MonoidHom.mem_ker] at hx ⊢
+ rw [MonoidHom.comp_apply, hx, map_one]
diff --git a/tasks/group-theory/group-theory-hom-d2-t0004/solution/solve.sh b/tasks/group-theory/group-theory-hom-d2-t0004/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0004/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-hom-d2-t0004/task.toml b/tasks/group-theory/group-theory-hom-d2-t0004/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..1864a097ebf4b15da6423ccc1bbeeb317e73138f
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0004/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "medium"
+category = "group-theory"
+tags = ["group-theory", "hom", "msc-20", "train", "lean4"]
+msc = "20"
+family = "hom"
+split = "train"
+seed = 4
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-hom-d2-t0004/tests/Verify.lean b/tasks/group-theory/group-theory-hom-d2-t0004/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0004/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-hom-d2-t0004/tests/grade.py b/tasks/group-theory/group-theory-hom-d2-t0004/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0004/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-hom-d2-t0004/tests/spec.json b/tasks/group-theory/group-theory-hom-d2-t0004/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..6c2af8d040762704e79fbcbb5c7de6416788ec17
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0004/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- The kernel of f lies in the kernel of g after f. -/\ntheorem ker_le_ker_comp {G H Z : Type*} [Group G] [Group H] [Group Z] (f : G →* H) (g : H →* Z) :\n f.ker ≤ (g.comp f).ker := by\n sorry\n",
+ "targets": [
+ {
+ "name": "ker_le_ker_comp",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-hom-d2-t0004/tests/test.sh b/tasks/group-theory/group-theory-hom-d2-t0004/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0004/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-hom-d2-t0016/environment/Dockerfile b/tasks/group-theory/group-theory-hom-d2-t0016/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0016/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-hom-d2-t0016/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-hom-d2-t0016/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..ab5ef8b2925d6cf1e9e7971afdef3fbf30bb89bd
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0016/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- The kernel of f lies in the kernel of g after f. -/
+theorem ker_le_ker_comp {G K Z : Type*} [Group G] [Group K] [Group Z] (f : G →* K) (g : K →* Z) :
+ f.ker ≤ (g.comp f).ker := by
+ sorry
diff --git a/tasks/group-theory/group-theory-hom-d2-t0016/instruction.md b/tasks/group-theory/group-theory-hom-d2-t0016/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..e81ae2b8465e7aa0f31ddb8bde4a4afad0d9fbd0
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0016/instruction.md
@@ -0,0 +1,14 @@
+# Kernels of group homomorphisms
+
+Prove the following statement.
+
+Let \(f : G \to H\) and \(g : H \to K\) be group homomorphisms. Then every element of the kernel of \(f\) lies in the kernel of \(g \circ f\).
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-hom-d2-t0016/solution/Solution.lean b/tasks/group-theory/group-theory-hom-d2-t0016/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..2dbdcc030582cae6c481050ebd9c61892d908f33
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0016/solution/Solution.lean
@@ -0,0 +1,8 @@
+import Mathlib
+
+/-- The kernel of f lies in the kernel of g after f. -/
+theorem ker_le_ker_comp {G K Z : Type*} [Group G] [Group K] [Group Z] (f : G →* K) (g : K →* Z) :
+ f.ker ≤ (g.comp f).ker := by
+ intro g hx
+ rw [MonoidHom.mem_ker] at hx ⊢
+ rw [MonoidHom.comp_apply, hx, map_one]
diff --git a/tasks/group-theory/group-theory-hom-d2-t0016/solution/solve.sh b/tasks/group-theory/group-theory-hom-d2-t0016/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0016/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-hom-d2-t0016/task.toml b/tasks/group-theory/group-theory-hom-d2-t0016/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..741fa71d0e4cdb2f3a6348ad52af4916ec5a8831
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0016/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "medium"
+category = "group-theory"
+tags = ["group-theory", "hom", "msc-20", "train", "lean4"]
+msc = "20"
+family = "hom"
+split = "train"
+seed = 16
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-hom-d2-t0016/tests/Verify.lean b/tasks/group-theory/group-theory-hom-d2-t0016/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0016/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-hom-d2-t0016/tests/grade.py b/tasks/group-theory/group-theory-hom-d2-t0016/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0016/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-hom-d2-t0016/tests/spec.json b/tasks/group-theory/group-theory-hom-d2-t0016/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..7962b4001fa9b5513a5fb2e08194716d2ebb41b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0016/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- The kernel of f lies in the kernel of g after f. -/\ntheorem ker_le_ker_comp {G K Z : Type*} [Group G] [Group K] [Group Z] (f : G →* K) (g : K →* Z) :\n f.ker ≤ (g.comp f).ker := by\n sorry\n",
+ "targets": [
+ {
+ "name": "ker_le_ker_comp",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-hom-d2-t0016/tests/test.sh b/tasks/group-theory/group-theory-hom-d2-t0016/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0016/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-hom-d2-t0028/environment/Dockerfile b/tasks/group-theory/group-theory-hom-d2-t0028/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0028/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-hom-d2-t0028/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-hom-d2-t0028/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..2b4b47d3590be582ecca853d176d7259af18d432
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0028/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- A homomorphism with trivial kernel is injective. -/
+theorem injective_of_trivial_kernel {G K : Type*} [Group G] [Group K] (f : G →* K)
+ (h : ∀ p : G, f p = 1 → p = 1) : Function.Injective f := by
+ sorry
diff --git a/tasks/group-theory/group-theory-hom-d2-t0028/instruction.md b/tasks/group-theory/group-theory-hom-d2-t0028/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..b2134f4b31d6fd61b2b63acbbb801d600b2ac187
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0028/instruction.md
@@ -0,0 +1,14 @@
+# Kernels of group homomorphisms
+
+Prove the following statement.
+
+Let \(f : G \to H\) be a group homomorphism such that \(f(p) = e\) implies \(p = e\) for every \(p \in G\). Then \(f\) is injective.
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-hom-d2-t0028/solution/Solution.lean b/tasks/group-theory/group-theory-hom-d2-t0028/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..2659cbd37bbb9a44c91dbd8cd906557c0d8f4762
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0028/solution/Solution.lean
@@ -0,0 +1,8 @@
+import Mathlib
+
+/-- A homomorphism with trivial kernel is injective. -/
+theorem injective_of_trivial_kernel {G K : Type*} [Group G] [Group K] (f : G →* K)
+ (h : ∀ p : G, f p = 1 → p = 1) : Function.Injective f := by
+ intro a b hab
+ have h1 : f (a⁻¹ * b) = 1 := by rw [map_mul, map_inv, hab, inv_mul_cancel]
+ exact inv_mul_eq_one.mp (h _ h1)
diff --git a/tasks/group-theory/group-theory-hom-d2-t0028/solution/solve.sh b/tasks/group-theory/group-theory-hom-d2-t0028/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0028/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-hom-d2-t0028/task.toml b/tasks/group-theory/group-theory-hom-d2-t0028/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..f5607dd73c2a4cb10f0c9cc4a090a3119f0fbf9d
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0028/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "medium"
+category = "group-theory"
+tags = ["group-theory", "hom", "msc-20", "train", "lean4"]
+msc = "20"
+family = "hom"
+split = "train"
+seed = 28
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-hom-d2-t0028/tests/Verify.lean b/tasks/group-theory/group-theory-hom-d2-t0028/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0028/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-hom-d2-t0028/tests/grade.py b/tasks/group-theory/group-theory-hom-d2-t0028/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0028/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-hom-d2-t0028/tests/spec.json b/tasks/group-theory/group-theory-hom-d2-t0028/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..245b7a9e096450cd092ccc6f14724deccb051ba7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0028/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- A homomorphism with trivial kernel is injective. -/\ntheorem injective_of_trivial_kernel {G K : Type*} [Group G] [Group K] (f : G →* K)\n (h : ∀ p : G, f p = 1 → p = 1) : Function.Injective f := by\n sorry\n",
+ "targets": [
+ {
+ "name": "injective_of_trivial_kernel",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-hom-d2-t0028/tests/test.sh b/tasks/group-theory/group-theory-hom-d2-t0028/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0028/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-hom-d2-t0040/environment/Dockerfile b/tasks/group-theory/group-theory-hom-d2-t0040/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0040/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-hom-d2-t0040/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-hom-d2-t0040/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..8b3f31d79766ae92633a62dde868151917df37df
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0040/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- A homomorphism with trivial kernel is injective. -/
+theorem injective_of_trivial_kernel {G H : Type*} [Group G] [Group H] (f : G →* H)
+ (h : ∀ x : G, f x = 1 → x = 1) : Function.Injective f := by
+ sorry
diff --git a/tasks/group-theory/group-theory-hom-d2-t0040/instruction.md b/tasks/group-theory/group-theory-hom-d2-t0040/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..fd75014c3b20c36a36461b64bc1cf16937938453
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0040/instruction.md
@@ -0,0 +1,14 @@
+# Kernels of group homomorphisms
+
+Prove the following statement.
+
+Let \(f : G \to H\) be a group homomorphism such that \(f(x) = e\) implies \(x = e\) for every \(x \in G\). Then \(f\) is injective.
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-hom-d2-t0040/solution/Solution.lean b/tasks/group-theory/group-theory-hom-d2-t0040/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..16b4a5ae65d0a7c1a5f3c6135e92ed00089afa5e
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0040/solution/Solution.lean
@@ -0,0 +1,8 @@
+import Mathlib
+
+/-- A homomorphism with trivial kernel is injective. -/
+theorem injective_of_trivial_kernel {G H : Type*} [Group G] [Group H] (f : G →* H)
+ (h : ∀ x : G, f x = 1 → x = 1) : Function.Injective f := by
+ intro a b hab
+ have h1 : f (a⁻¹ * b) = 1 := by rw [map_mul, map_inv, hab, inv_mul_cancel]
+ exact inv_mul_eq_one.mp (h _ h1)
diff --git a/tasks/group-theory/group-theory-hom-d2-t0040/solution/solve.sh b/tasks/group-theory/group-theory-hom-d2-t0040/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0040/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-hom-d2-t0040/task.toml b/tasks/group-theory/group-theory-hom-d2-t0040/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..0843aedf2a295b11768c7caa4cea63bc0d490621
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0040/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "medium"
+category = "group-theory"
+tags = ["group-theory", "hom", "msc-20", "train", "lean4"]
+msc = "20"
+family = "hom"
+split = "train"
+seed = 40
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-hom-d2-t0040/tests/Verify.lean b/tasks/group-theory/group-theory-hom-d2-t0040/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0040/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-hom-d2-t0040/tests/grade.py b/tasks/group-theory/group-theory-hom-d2-t0040/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0040/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-hom-d2-t0040/tests/spec.json b/tasks/group-theory/group-theory-hom-d2-t0040/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..6298443f287ca07cbfa89f288a62c11529cbc8ed
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0040/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- A homomorphism with trivial kernel is injective. -/\ntheorem injective_of_trivial_kernel {G H : Type*} [Group G] [Group H] (f : G →* H)\n (h : ∀ x : G, f x = 1 → x = 1) : Function.Injective f := by\n sorry\n",
+ "targets": [
+ {
+ "name": "injective_of_trivial_kernel",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-hom-d2-t0040/tests/test.sh b/tasks/group-theory/group-theory-hom-d2-t0040/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0040/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-hom-d2-t0052/environment/Dockerfile b/tasks/group-theory/group-theory-hom-d2-t0052/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0052/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-hom-d2-t0052/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-hom-d2-t0052/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..a288ffdbcc3a616acad657dd69904254af3bb374
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0052/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- A homomorphism with trivial kernel is injective. -/
+theorem injective_of_trivial_kernel {G K : Type*} [Group G] [Group K] (f : G →* K)
+ (h : ∀ g : G, f g = 1 → g = 1) : Function.Injective f := by
+ sorry
diff --git a/tasks/group-theory/group-theory-hom-d2-t0052/instruction.md b/tasks/group-theory/group-theory-hom-d2-t0052/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..8dd1a6f477d81dc41061dd383310e5cdeca3b8d2
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0052/instruction.md
@@ -0,0 +1,14 @@
+# Kernels of group homomorphisms
+
+Prove the following statement.
+
+Let \(f : G \to H\) be a group homomorphism such that \(f(g) = e\) implies \(g = e\) for every \(g \in G\). Then \(f\) is injective.
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-hom-d2-t0052/solution/Solution.lean b/tasks/group-theory/group-theory-hom-d2-t0052/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5847376cf87da4e83b89acddd98a0f9272ef6791
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0052/solution/Solution.lean
@@ -0,0 +1,8 @@
+import Mathlib
+
+/-- A homomorphism with trivial kernel is injective. -/
+theorem injective_of_trivial_kernel {G K : Type*} [Group G] [Group K] (f : G →* K)
+ (h : ∀ g : G, f g = 1 → g = 1) : Function.Injective f := by
+ intro a b hab
+ have h1 : f (a⁻¹ * b) = 1 := by rw [map_mul, map_inv, hab, inv_mul_cancel]
+ exact inv_mul_eq_one.mp (h _ h1)
diff --git a/tasks/group-theory/group-theory-hom-d2-t0052/solution/solve.sh b/tasks/group-theory/group-theory-hom-d2-t0052/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0052/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-hom-d2-t0052/task.toml b/tasks/group-theory/group-theory-hom-d2-t0052/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..486a5b1bd16d032f683d1597fb0fbe9649cf1a88
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0052/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "medium"
+category = "group-theory"
+tags = ["group-theory", "hom", "msc-20", "train", "lean4"]
+msc = "20"
+family = "hom"
+split = "train"
+seed = 52
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-hom-d2-t0052/tests/Verify.lean b/tasks/group-theory/group-theory-hom-d2-t0052/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0052/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-hom-d2-t0052/tests/grade.py b/tasks/group-theory/group-theory-hom-d2-t0052/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0052/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-hom-d2-t0052/tests/spec.json b/tasks/group-theory/group-theory-hom-d2-t0052/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..689f9166782c820df0e7c603e2cc6af26e3372ea
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0052/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- A homomorphism with trivial kernel is injective. -/\ntheorem injective_of_trivial_kernel {G K : Type*} [Group G] [Group K] (f : G →* K)\n (h : ∀ g : G, f g = 1 → g = 1) : Function.Injective f := by\n sorry\n",
+ "targets": [
+ {
+ "name": "injective_of_trivial_kernel",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-hom-d2-t0052/tests/test.sh b/tasks/group-theory/group-theory-hom-d2-t0052/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0052/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-hom-d2-t0064/environment/Dockerfile b/tasks/group-theory/group-theory-hom-d2-t0064/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0064/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-hom-d2-t0064/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-hom-d2-t0064/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..2701cefd042b8aaa88d70698db777c77a939e5e3
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0064/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- A homomorphism with trivial kernel is injective. -/
+theorem injective_of_trivial_kernel {A B : Type*} [Group A] [Group B] (f : A →* B)
+ (h : ∀ s : A, f s = 1 → s = 1) : Function.Injective f := by
+ sorry
diff --git a/tasks/group-theory/group-theory-hom-d2-t0064/instruction.md b/tasks/group-theory/group-theory-hom-d2-t0064/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..4030b50886e0f97537469ea7f767591396e48270
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0064/instruction.md
@@ -0,0 +1,14 @@
+# Kernels of group homomorphisms
+
+Prove the following statement.
+
+Let \(f : G \to H\) be a group homomorphism such that \(f(s) = e\) implies \(s = e\) for every \(s \in G\). Then \(f\) is injective.
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-hom-d2-t0064/solution/Solution.lean b/tasks/group-theory/group-theory-hom-d2-t0064/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..d7e062aff7bf7881a14393b0c431faf6d7c01248
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0064/solution/Solution.lean
@@ -0,0 +1,8 @@
+import Mathlib
+
+/-- A homomorphism with trivial kernel is injective. -/
+theorem injective_of_trivial_kernel {A B : Type*} [Group A] [Group B] (f : A →* B)
+ (h : ∀ s : A, f s = 1 → s = 1) : Function.Injective f := by
+ intro a b hab
+ have h1 : f (a⁻¹ * b) = 1 := by rw [map_mul, map_inv, hab, inv_mul_cancel]
+ exact inv_mul_eq_one.mp (h _ h1)
diff --git a/tasks/group-theory/group-theory-hom-d2-t0064/solution/solve.sh b/tasks/group-theory/group-theory-hom-d2-t0064/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0064/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-hom-d2-t0064/task.toml b/tasks/group-theory/group-theory-hom-d2-t0064/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..17da285028bed8442108e3684b3aeb9e0dfb8ee3
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0064/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "medium"
+category = "group-theory"
+tags = ["group-theory", "hom", "msc-20", "train", "lean4"]
+msc = "20"
+family = "hom"
+split = "train"
+seed = 64
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-hom-d2-t0064/tests/Verify.lean b/tasks/group-theory/group-theory-hom-d2-t0064/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0064/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-hom-d2-t0064/tests/grade.py b/tasks/group-theory/group-theory-hom-d2-t0064/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0064/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-hom-d2-t0064/tests/spec.json b/tasks/group-theory/group-theory-hom-d2-t0064/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..e78c0cf376f624d1318ef03f62677b3fa9a0e3d6
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0064/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- A homomorphism with trivial kernel is injective. -/\ntheorem injective_of_trivial_kernel {A B : Type*} [Group A] [Group B] (f : A →* B)\n (h : ∀ s : A, f s = 1 → s = 1) : Function.Injective f := by\n sorry\n",
+ "targets": [
+ {
+ "name": "injective_of_trivial_kernel",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-hom-d2-t0064/tests/test.sh b/tasks/group-theory/group-theory-hom-d2-t0064/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0064/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-hom-d2-t0076/environment/Dockerfile b/tasks/group-theory/group-theory-hom-d2-t0076/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0076/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-hom-d2-t0076/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-hom-d2-t0076/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..061c0022a0f87fc8e45c98c35e4bc888c565dcf2
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0076/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- A homomorphism with trivial kernel is injective. -/
+theorem injective_of_trivial_kernel {X Y : Type*} [Group X] [Group Y] (f : X →* Y)
+ (h : ∀ s : X, f s = 1 → s = 1) : Function.Injective f := by
+ sorry
diff --git a/tasks/group-theory/group-theory-hom-d2-t0076/instruction.md b/tasks/group-theory/group-theory-hom-d2-t0076/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..4030b50886e0f97537469ea7f767591396e48270
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0076/instruction.md
@@ -0,0 +1,14 @@
+# Kernels of group homomorphisms
+
+Prove the following statement.
+
+Let \(f : G \to H\) be a group homomorphism such that \(f(s) = e\) implies \(s = e\) for every \(s \in G\). Then \(f\) is injective.
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-hom-d2-t0076/solution/Solution.lean b/tasks/group-theory/group-theory-hom-d2-t0076/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..91f7898d80c6c71692489c30eecc989bff8e4624
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0076/solution/Solution.lean
@@ -0,0 +1,8 @@
+import Mathlib
+
+/-- A homomorphism with trivial kernel is injective. -/
+theorem injective_of_trivial_kernel {X Y : Type*} [Group X] [Group Y] (f : X →* Y)
+ (h : ∀ s : X, f s = 1 → s = 1) : Function.Injective f := by
+ intro a b hab
+ have h1 : f (a⁻¹ * b) = 1 := by rw [map_mul, map_inv, hab, inv_mul_cancel]
+ exact inv_mul_eq_one.mp (h _ h1)
diff --git a/tasks/group-theory/group-theory-hom-d2-t0076/solution/solve.sh b/tasks/group-theory/group-theory-hom-d2-t0076/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0076/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-hom-d2-t0076/task.toml b/tasks/group-theory/group-theory-hom-d2-t0076/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..b68b7bf552ad540e127b33a98683e1677b5dfed2
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0076/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "medium"
+category = "group-theory"
+tags = ["group-theory", "hom", "msc-20", "train", "lean4"]
+msc = "20"
+family = "hom"
+split = "train"
+seed = 76
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-hom-d2-t0076/tests/Verify.lean b/tasks/group-theory/group-theory-hom-d2-t0076/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0076/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-hom-d2-t0076/tests/grade.py b/tasks/group-theory/group-theory-hom-d2-t0076/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0076/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-hom-d2-t0076/tests/spec.json b/tasks/group-theory/group-theory-hom-d2-t0076/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..ada25f7e857eebe8ee712485f986238eb87aa7ac
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0076/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- A homomorphism with trivial kernel is injective. -/\ntheorem injective_of_trivial_kernel {X Y : Type*} [Group X] [Group Y] (f : X →* Y)\n (h : ∀ s : X, f s = 1 → s = 1) : Function.Injective f := by\n sorry\n",
+ "targets": [
+ {
+ "name": "injective_of_trivial_kernel",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-hom-d2-t0076/tests/test.sh b/tasks/group-theory/group-theory-hom-d2-t0076/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d2-t0076/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-hom-d3-e0008/environment/Dockerfile b/tasks/group-theory/group-theory-hom-d3-e0008/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-e0008/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-hom-d3-e0008/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-hom-d3-e0008/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..e9e911b2792219f082d3ed11f7bc93b307093edd
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-e0008/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- A homomorphism with trivial kernel is injective. -/
+theorem injective_of_trivial_kernel {X Y : Type*} [Group X] [Group Y] (f : X →* Y)
+ (h : ∀ u : X, f u = 1 → u = 1) : Function.Injective f := by
+ sorry
diff --git a/tasks/group-theory/group-theory-hom-d3-e0008/instruction.md b/tasks/group-theory/group-theory-hom-d3-e0008/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..d3042f6ebab072b9fa1797ac21bc39c4bb501c74
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-e0008/instruction.md
@@ -0,0 +1,14 @@
+# Kernels of group homomorphisms
+
+Prove the following statement.
+
+Let \(f : G \to H\) be a group homomorphism such that \(f(u) = e\) implies \(u = e\) for every \(u \in G\). Then \(f\) is injective.
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-hom-d3-e0008/solution/Solution.lean b/tasks/group-theory/group-theory-hom-d3-e0008/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..fe8b7661230a7912e58928871c278ee4ef627acb
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-e0008/solution/Solution.lean
@@ -0,0 +1,8 @@
+import Mathlib
+
+/-- A homomorphism with trivial kernel is injective. -/
+theorem injective_of_trivial_kernel {X Y : Type*} [Group X] [Group Y] (f : X →* Y)
+ (h : ∀ u : X, f u = 1 → u = 1) : Function.Injective f := by
+ intro a b hab
+ have h1 : f (a⁻¹ * b) = 1 := by rw [map_mul, map_inv, hab, inv_mul_cancel]
+ exact inv_mul_eq_one.mp (h _ h1)
diff --git a/tasks/group-theory/group-theory-hom-d3-e0008/solution/solve.sh b/tasks/group-theory/group-theory-hom-d3-e0008/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-e0008/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-hom-d3-e0008/task.toml b/tasks/group-theory/group-theory-hom-d3-e0008/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..391a7f815c06a2c1ab5087acbb8e01e7529e4470
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-e0008/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "hard"
+category = "group-theory"
+tags = ["group-theory", "hom", "msc-20", "eval", "lean4"]
+msc = "20"
+family = "hom"
+split = "eval"
+seed = 10008
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-hom-d3-e0008/tests/Verify.lean b/tasks/group-theory/group-theory-hom-d3-e0008/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-e0008/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-hom-d3-e0008/tests/grade.py b/tasks/group-theory/group-theory-hom-d3-e0008/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-e0008/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-hom-d3-e0008/tests/spec.json b/tasks/group-theory/group-theory-hom-d3-e0008/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..f83028a542f898d34c55a72c020be26fd80a82b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-e0008/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- A homomorphism with trivial kernel is injective. -/\ntheorem injective_of_trivial_kernel {X Y : Type*} [Group X] [Group Y] (f : X →* Y)\n (h : ∀ u : X, f u = 1 → u = 1) : Function.Injective f := by\n sorry\n",
+ "targets": [
+ {
+ "name": "injective_of_trivial_kernel",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-hom-d3-e0008/tests/test.sh b/tasks/group-theory/group-theory-hom-d3-e0008/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-e0008/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-hom-d3-e0020/environment/Dockerfile b/tasks/group-theory/group-theory-hom-d3-e0020/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-e0020/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-hom-d3-e0020/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-hom-d3-e0020/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..48ae8204657976ddb5cc53f4179f2d2baa379792
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-e0020/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- A homomorphism with trivial kernel is injective. -/
+theorem injective_of_trivial_kernel {G K : Type*} [Group G] [Group K] (f : G →* K)
+ (h : ∀ s : G, f s = 1 → s = 1) : Function.Injective f := by
+ sorry
diff --git a/tasks/group-theory/group-theory-hom-d3-e0020/instruction.md b/tasks/group-theory/group-theory-hom-d3-e0020/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..4030b50886e0f97537469ea7f767591396e48270
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-e0020/instruction.md
@@ -0,0 +1,14 @@
+# Kernels of group homomorphisms
+
+Prove the following statement.
+
+Let \(f : G \to H\) be a group homomorphism such that \(f(s) = e\) implies \(s = e\) for every \(s \in G\). Then \(f\) is injective.
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-hom-d3-e0020/solution/Solution.lean b/tasks/group-theory/group-theory-hom-d3-e0020/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..fc70388ab0b109c7c823548483f4f3db1411b699
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-e0020/solution/Solution.lean
@@ -0,0 +1,8 @@
+import Mathlib
+
+/-- A homomorphism with trivial kernel is injective. -/
+theorem injective_of_trivial_kernel {G K : Type*} [Group G] [Group K] (f : G →* K)
+ (h : ∀ s : G, f s = 1 → s = 1) : Function.Injective f := by
+ intro a b hab
+ have h1 : f (a⁻¹ * b) = 1 := by rw [map_mul, map_inv, hab, inv_mul_cancel]
+ exact inv_mul_eq_one.mp (h _ h1)
diff --git a/tasks/group-theory/group-theory-hom-d3-e0020/solution/solve.sh b/tasks/group-theory/group-theory-hom-d3-e0020/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-e0020/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-hom-d3-e0020/task.toml b/tasks/group-theory/group-theory-hom-d3-e0020/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..e3c33e4d1eb7bdfacbceaf2ae0049c17340d91f6
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-e0020/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "hard"
+category = "group-theory"
+tags = ["group-theory", "hom", "msc-20", "eval", "lean4"]
+msc = "20"
+family = "hom"
+split = "eval"
+seed = 10020
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-hom-d3-e0020/tests/Verify.lean b/tasks/group-theory/group-theory-hom-d3-e0020/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-e0020/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-hom-d3-e0020/tests/grade.py b/tasks/group-theory/group-theory-hom-d3-e0020/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-e0020/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-hom-d3-e0020/tests/spec.json b/tasks/group-theory/group-theory-hom-d3-e0020/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..01e3704f9b74c7f304e8810d90a88cfa8fe4679e
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-e0020/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- A homomorphism with trivial kernel is injective. -/\ntheorem injective_of_trivial_kernel {G K : Type*} [Group G] [Group K] (f : G →* K)\n (h : ∀ s : G, f s = 1 → s = 1) : Function.Injective f := by\n sorry\n",
+ "targets": [
+ {
+ "name": "injective_of_trivial_kernel",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-hom-d3-e0020/tests/test.sh b/tasks/group-theory/group-theory-hom-d3-e0020/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-e0020/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-hom-d3-t0008/environment/Dockerfile b/tasks/group-theory/group-theory-hom-d3-t0008/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0008/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-hom-d3-t0008/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-hom-d3-t0008/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..e00567a42f83340607a95d9d7563cd54ff7b0119
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0008/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- A homomorphism whose kernel has one element is injective. -/
+theorem injective_of_card_ker {G H : Type*} [Group G] [Group H] (f : G →* H)
+ (h : Nat.card f.ker = 1) : Function.Injective f := by
+ sorry
diff --git a/tasks/group-theory/group-theory-hom-d3-t0008/instruction.md b/tasks/group-theory/group-theory-hom-d3-t0008/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..3428c2f6e268acb8d0a055bc3386ae9db2aabd6a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0008/instruction.md
@@ -0,0 +1,14 @@
+# Kernels of group homomorphisms
+
+Prove the following statement.
+
+Let \(f : G \to H\) be a group homomorphism whose kernel has exactly one element. Then \(f\) is injective.
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-hom-d3-t0008/solution/Solution.lean b/tasks/group-theory/group-theory-hom-d3-t0008/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..fc0bdbb83a6364d1727fafc5e70f96f0f506064d
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0008/solution/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- A homomorphism whose kernel has one element is injective. -/
+theorem injective_of_card_ker {G H : Type*} [Group G] [Group H] (f : G →* H)
+ (h : Nat.card f.ker = 1) : Function.Injective f := by
+ exact (MonoidHom.ker_eq_bot_iff f).mp (Subgroup.card_eq_one.mp h)
diff --git a/tasks/group-theory/group-theory-hom-d3-t0008/solution/solve.sh b/tasks/group-theory/group-theory-hom-d3-t0008/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0008/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-hom-d3-t0008/task.toml b/tasks/group-theory/group-theory-hom-d3-t0008/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..2b47747b29ebcbed207ec6feed663773210ef022
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0008/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "hard"
+category = "group-theory"
+tags = ["group-theory", "hom", "msc-20", "train", "lean4"]
+msc = "20"
+family = "hom"
+split = "train"
+seed = 8
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-hom-d3-t0008/tests/Verify.lean b/tasks/group-theory/group-theory-hom-d3-t0008/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0008/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-hom-d3-t0008/tests/grade.py b/tasks/group-theory/group-theory-hom-d3-t0008/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0008/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-hom-d3-t0008/tests/spec.json b/tasks/group-theory/group-theory-hom-d3-t0008/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..7387d56376e0e99af8e528a1156e3784f847c2b7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0008/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- A homomorphism whose kernel has one element is injective. -/\ntheorem injective_of_card_ker {G H : Type*} [Group G] [Group H] (f : G →* H)\n (h : Nat.card f.ker = 1) : Function.Injective f := by\n sorry\n",
+ "targets": [
+ {
+ "name": "injective_of_card_ker",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-hom-d3-t0008/tests/test.sh b/tasks/group-theory/group-theory-hom-d3-t0008/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0008/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-hom-d3-t0020/environment/Dockerfile b/tasks/group-theory/group-theory-hom-d3-t0020/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0020/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-hom-d3-t0020/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-hom-d3-t0020/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..559a7bff6b42cae7abf9a8f9c34da336b64b0fd3
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0020/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- A homomorphism whose kernel has one element is injective. -/
+theorem injective_of_card_ker {G K : Type*} [Group G] [Group K] (f : G →* K)
+ (h : Nat.card f.ker = 1) : Function.Injective f := by
+ sorry
diff --git a/tasks/group-theory/group-theory-hom-d3-t0020/instruction.md b/tasks/group-theory/group-theory-hom-d3-t0020/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..3428c2f6e268acb8d0a055bc3386ae9db2aabd6a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0020/instruction.md
@@ -0,0 +1,14 @@
+# Kernels of group homomorphisms
+
+Prove the following statement.
+
+Let \(f : G \to H\) be a group homomorphism whose kernel has exactly one element. Then \(f\) is injective.
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-hom-d3-t0020/solution/Solution.lean b/tasks/group-theory/group-theory-hom-d3-t0020/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..c16728c11e842bd092a4bedf6f81c54dc7251b2e
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0020/solution/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- A homomorphism whose kernel has one element is injective. -/
+theorem injective_of_card_ker {G K : Type*} [Group G] [Group K] (f : G →* K)
+ (h : Nat.card f.ker = 1) : Function.Injective f := by
+ exact (MonoidHom.ker_eq_bot_iff f).mp (Subgroup.card_eq_one.mp h)
diff --git a/tasks/group-theory/group-theory-hom-d3-t0020/solution/solve.sh b/tasks/group-theory/group-theory-hom-d3-t0020/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0020/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-hom-d3-t0020/task.toml b/tasks/group-theory/group-theory-hom-d3-t0020/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..0831bdd755a0394f0f47c2431ea9b4a7deda56a9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0020/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "hard"
+category = "group-theory"
+tags = ["group-theory", "hom", "msc-20", "train", "lean4"]
+msc = "20"
+family = "hom"
+split = "train"
+seed = 20
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-hom-d3-t0020/tests/Verify.lean b/tasks/group-theory/group-theory-hom-d3-t0020/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0020/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-hom-d3-t0020/tests/grade.py b/tasks/group-theory/group-theory-hom-d3-t0020/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0020/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-hom-d3-t0020/tests/spec.json b/tasks/group-theory/group-theory-hom-d3-t0020/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..4506025f1cf5b24832957bd9e0bfaa1de40be5fd
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0020/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- A homomorphism whose kernel has one element is injective. -/\ntheorem injective_of_card_ker {G K : Type*} [Group G] [Group K] (f : G →* K)\n (h : Nat.card f.ker = 1) : Function.Injective f := by\n sorry\n",
+ "targets": [
+ {
+ "name": "injective_of_card_ker",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-hom-d3-t0020/tests/test.sh b/tasks/group-theory/group-theory-hom-d3-t0020/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0020/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-hom-d3-t0044/environment/Dockerfile b/tasks/group-theory/group-theory-hom-d3-t0044/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0044/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-hom-d3-t0044/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-hom-d3-t0044/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..8a1bce7be700db359a3a9b001fea56aed9a3cc26
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0044/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- Lagrange for an injective homomorphism. -/
+theorem card_dvd_of_injective {X Y : Type*} [Group X] [Group Y] (f : X →* Y)
+ (hf : Function.Injective f) : Nat.card X ∣ Nat.card Y := by
+ sorry
diff --git a/tasks/group-theory/group-theory-hom-d3-t0044/instruction.md b/tasks/group-theory/group-theory-hom-d3-t0044/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..878f09b7882f18703131040f9e19b511f88ff4b3
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0044/instruction.md
@@ -0,0 +1,14 @@
+# Kernels of group homomorphisms
+
+Prove the following statement.
+
+Let \(f : G \to H\) be an injective group homomorphism of groups. Then \(|G|\) divides \(|H|\) (cardinalities are in \(\mathbb{N}\), with 0 for an infinite group).
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-hom-d3-t0044/solution/Solution.lean b/tasks/group-theory/group-theory-hom-d3-t0044/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..7624f92a71ab789e77e7e6245706b9d07238ebb2
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0044/solution/Solution.lean
@@ -0,0 +1,8 @@
+import Mathlib
+
+/-- Lagrange for an injective homomorphism. -/
+theorem card_dvd_of_injective {X Y : Type*} [Group X] [Group Y] (f : X →* Y)
+ (hf : Function.Injective f) : Nat.card X ∣ Nat.card Y := by
+ have h1 : Nat.card X = Nat.card f.range := Nat.card_congr (MonoidHom.ofInjective hf).toEquiv
+ rw [h1]
+ exact Subgroup.card_subgroup_dvd_card f.range
diff --git a/tasks/group-theory/group-theory-hom-d3-t0044/solution/solve.sh b/tasks/group-theory/group-theory-hom-d3-t0044/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0044/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-hom-d3-t0044/task.toml b/tasks/group-theory/group-theory-hom-d3-t0044/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..f06f5e54abb64f532f4bbdb26eedfc7e7eb22745
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0044/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "hard"
+category = "group-theory"
+tags = ["group-theory", "hom", "msc-20", "train", "lean4"]
+msc = "20"
+family = "hom"
+split = "train"
+seed = 44
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-hom-d3-t0044/tests/Verify.lean b/tasks/group-theory/group-theory-hom-d3-t0044/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0044/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-hom-d3-t0044/tests/grade.py b/tasks/group-theory/group-theory-hom-d3-t0044/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0044/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-hom-d3-t0044/tests/spec.json b/tasks/group-theory/group-theory-hom-d3-t0044/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..5622835e654f386f1d07d00175aba043526771ab
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0044/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- Lagrange for an injective homomorphism. -/\ntheorem card_dvd_of_injective {X Y : Type*} [Group X] [Group Y] (f : X →* Y)\n (hf : Function.Injective f) : Nat.card X ∣ Nat.card Y := by\n sorry\n",
+ "targets": [
+ {
+ "name": "card_dvd_of_injective",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-hom-d3-t0044/tests/test.sh b/tasks/group-theory/group-theory-hom-d3-t0044/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0044/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-hom-d3-t0068/environment/Dockerfile b/tasks/group-theory/group-theory-hom-d3-t0068/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0068/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-hom-d3-t0068/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-hom-d3-t0068/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..ee3d8c6470c83582f7de4beaaf04482781fc8de3
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0068/environment/workdir/Solution.lean
@@ -0,0 +1,11 @@
+import Mathlib
+
+/-- The kernel of f lies in the kernel of g after f. -/
+theorem ker_le_ker_comp {X Y Z : Type*} [Group X] [Group Y] [Group Z] (f : X →* Y) (g : Y →* Z) :
+ f.ker ≤ (g.comp f).ker := by
+ sorry
+
+/-- If g is injective the kernels agree. -/
+theorem ker_comp_eq {X Y Z : Type*} [Group X] [Group Y] [Group Z] (f : X →* Y) (g : Y →* Z)
+ (hg : Function.Injective g) : (g.comp f).ker = f.ker := by
+ sorry
diff --git a/tasks/group-theory/group-theory-hom-d3-t0068/instruction.md b/tasks/group-theory/group-theory-hom-d3-t0068/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..b75a9dce3fc3144cddf72f5af83e56657a2d2579
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0068/instruction.md
@@ -0,0 +1,14 @@
+# Kernels of group homomorphisms
+
+Prove the following statement.
+
+Let \(f : G \to H\) and \(g : H \to K\) be group homomorphisms with \(g\) injective. Then \(g \circ f\) and \(f\) have the same kernel. Show that \(\ker f \subseteq \ker(g \circ f)\) and then the equality.
+
+## What to do
+
+`Solution.lean` in the working directory states 2 theorems in Lean 4 with Mathlib, with `sorry` in place of each proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is the share of the 2 theorems that are proved. If the file does not compile the reward is 0, so leave `sorry` on a theorem you cannot finish rather than a broken proof.
diff --git a/tasks/group-theory/group-theory-hom-d3-t0068/solution/Solution.lean b/tasks/group-theory/group-theory-hom-d3-t0068/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..6d8eb490c10f273323ca7c58e832e58f030736e3
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0068/solution/Solution.lean
@@ -0,0 +1,18 @@
+import Mathlib
+
+/-- The kernel of f lies in the kernel of g after f. -/
+theorem ker_le_ker_comp {X Y Z : Type*} [Group X] [Group Y] [Group Z] (f : X →* Y) (g : Y →* Z) :
+ f.ker ≤ (g.comp f).ker := by
+ intro p hx
+ rw [MonoidHom.mem_ker] at hx ⊢
+ rw [MonoidHom.comp_apply, hx, map_one]
+
+/-- If g is injective the kernels agree. -/
+theorem ker_comp_eq {X Y Z : Type*} [Group X] [Group Y] [Group Z] (f : X →* Y) (g : Y →* Z)
+ (hg : Function.Injective g) : (g.comp f).ker = f.ker := by
+ apply le_antisymm
+ · intro p hx
+ rw [MonoidHom.mem_ker, MonoidHom.comp_apply] at hx
+ rw [MonoidHom.mem_ker]
+ exact hg (by rw [hx, map_one])
+ · exact ker_le_ker_comp f g
diff --git a/tasks/group-theory/group-theory-hom-d3-t0068/solution/solve.sh b/tasks/group-theory/group-theory-hom-d3-t0068/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0068/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-hom-d3-t0068/task.toml b/tasks/group-theory/group-theory-hom-d3-t0068/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..765f53dc4ff0bb0aace9b5559faaf08803242b75
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0068/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "hard"
+category = "group-theory"
+tags = ["group-theory", "hom", "msc-20", "train", "lean4"]
+msc = "20"
+family = "hom"
+split = "train"
+seed = 68
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-hom-d3-t0068/tests/Verify.lean b/tasks/group-theory/group-theory-hom-d3-t0068/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0068/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-hom-d3-t0068/tests/grade.py b/tasks/group-theory/group-theory-hom-d3-t0068/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0068/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-hom-d3-t0068/tests/spec.json b/tasks/group-theory/group-theory-hom-d3-t0068/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..2525c05c1f7a699a0adccc225e8db30e2892f92c
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0068/tests/spec.json
@@ -0,0 +1,13 @@
+{
+ "reference": "import Mathlib\n\n/-- The kernel of f lies in the kernel of g after f. -/\ntheorem ker_le_ker_comp {X Y Z : Type*} [Group X] [Group Y] [Group Z] (f : X →* Y) (g : Y →* Z) :\n f.ker ≤ (g.comp f).ker := by\n sorry\n\n/-- If g is injective the kernels agree. -/\ntheorem ker_comp_eq {X Y Z : Type*} [Group X] [Group Y] [Group Z] (f : X →* Y) (g : Y →* Z)\n (hg : Function.Injective g) : (g.comp f).ker = f.ker := by\n sorry\n",
+ "targets": [
+ {
+ "name": "ker_le_ker_comp",
+ "weight": 0.3
+ },
+ {
+ "name": "ker_comp_eq",
+ "weight": 0.7
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-hom-d3-t0068/tests/test.sh b/tasks/group-theory/group-theory-hom-d3-t0068/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0068/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-hom-d3-t0080/environment/Dockerfile b/tasks/group-theory/group-theory-hom-d3-t0080/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0080/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-hom-d3-t0080/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-hom-d3-t0080/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..48ae8204657976ddb5cc53f4179f2d2baa379792
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0080/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- A homomorphism with trivial kernel is injective. -/
+theorem injective_of_trivial_kernel {G K : Type*} [Group G] [Group K] (f : G →* K)
+ (h : ∀ s : G, f s = 1 → s = 1) : Function.Injective f := by
+ sorry
diff --git a/tasks/group-theory/group-theory-hom-d3-t0080/instruction.md b/tasks/group-theory/group-theory-hom-d3-t0080/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..4030b50886e0f97537469ea7f767591396e48270
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0080/instruction.md
@@ -0,0 +1,14 @@
+# Kernels of group homomorphisms
+
+Prove the following statement.
+
+Let \(f : G \to H\) be a group homomorphism such that \(f(s) = e\) implies \(s = e\) for every \(s \in G\). Then \(f\) is injective.
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-hom-d3-t0080/solution/Solution.lean b/tasks/group-theory/group-theory-hom-d3-t0080/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..fc70388ab0b109c7c823548483f4f3db1411b699
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0080/solution/Solution.lean
@@ -0,0 +1,8 @@
+import Mathlib
+
+/-- A homomorphism with trivial kernel is injective. -/
+theorem injective_of_trivial_kernel {G K : Type*} [Group G] [Group K] (f : G →* K)
+ (h : ∀ s : G, f s = 1 → s = 1) : Function.Injective f := by
+ intro a b hab
+ have h1 : f (a⁻¹ * b) = 1 := by rw [map_mul, map_inv, hab, inv_mul_cancel]
+ exact inv_mul_eq_one.mp (h _ h1)
diff --git a/tasks/group-theory/group-theory-hom-d3-t0080/solution/solve.sh b/tasks/group-theory/group-theory-hom-d3-t0080/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0080/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-hom-d3-t0080/task.toml b/tasks/group-theory/group-theory-hom-d3-t0080/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..c73e6d4e07cba5ae219e82a2058f8010237b3954
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0080/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "hard"
+category = "group-theory"
+tags = ["group-theory", "hom", "msc-20", "train", "lean4"]
+msc = "20"
+family = "hom"
+split = "train"
+seed = 80
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-hom-d3-t0080/tests/Verify.lean b/tasks/group-theory/group-theory-hom-d3-t0080/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0080/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-hom-d3-t0080/tests/grade.py b/tasks/group-theory/group-theory-hom-d3-t0080/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0080/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-hom-d3-t0080/tests/spec.json b/tasks/group-theory/group-theory-hom-d3-t0080/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..01e3704f9b74c7f304e8810d90a88cfa8fe4679e
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0080/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- A homomorphism with trivial kernel is injective. -/\ntheorem injective_of_trivial_kernel {G K : Type*} [Group G] [Group K] (f : G →* K)\n (h : ∀ s : G, f s = 1 → s = 1) : Function.Injective f := by\n sorry\n",
+ "targets": [
+ {
+ "name": "injective_of_trivial_kernel",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-hom-d3-t0080/tests/test.sh b/tasks/group-theory/group-theory-hom-d3-t0080/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-hom-d3-t0080/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-inverse-d1-e0001/environment/Dockerfile b/tasks/group-theory/group-theory-inverse-d1-e0001/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-e0001/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-inverse-d1-e0001/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-inverse-d1-e0001/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..fe1dfee29e08e558f6a84b904537c03d690ab852
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-e0001/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- A left inverse and a right inverse of the same element are equal. -/
+theorem inverses_agree {N : Type*} [Monoid N] (g k m : N)
+ (h1 : m * g = 1) (h2 : g * k = 1) : k = m := by
+ sorry
diff --git a/tasks/group-theory/group-theory-inverse-d1-e0001/instruction.md b/tasks/group-theory/group-theory-inverse-d1-e0001/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..9bc08766d9a3ec0b9fb3f6f4f11febf4b9488031
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-e0001/instruction.md
@@ -0,0 +1,14 @@
+# Inverses and cancellation
+
+Prove the following statement.
+
+Let \(M\) be a monoid and \(g, k, m \in M\) with \(g k = 1\) and \(m g = 1\). Then \(k = m\).
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-inverse-d1-e0001/solution/Solution.lean b/tasks/group-theory/group-theory-inverse-d1-e0001/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..682a31acc61aaea36ea949bac4cd21b125abe692
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-e0001/solution/Solution.lean
@@ -0,0 +1,8 @@
+import Mathlib
+
+/-- A left inverse and a right inverse of the same element are equal. -/
+theorem inverses_agree {N : Type*} [Monoid N] (g k m : N)
+ (h1 : m * g = 1) (h2 : g * k = 1) : k = m := by
+ calc k = (m * g) * k := by rw [h1, one_mul]
+ _ = m * (g * k) := mul_assoc _ _ _
+ _ = m := by rw [h2, mul_one]
diff --git a/tasks/group-theory/group-theory-inverse-d1-e0001/solution/solve.sh b/tasks/group-theory/group-theory-inverse-d1-e0001/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-e0001/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-inverse-d1-e0001/task.toml b/tasks/group-theory/group-theory-inverse-d1-e0001/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..312c85ea6a70e3c9330653da9571e5e4a997a5de
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-e0001/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "easy"
+category = "group-theory"
+tags = ["group-theory", "inverse", "msc-20", "eval", "lean4"]
+msc = "20"
+family = "inverse"
+split = "eval"
+seed = 10001
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-inverse-d1-e0001/tests/Verify.lean b/tasks/group-theory/group-theory-inverse-d1-e0001/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-e0001/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-inverse-d1-e0001/tests/grade.py b/tasks/group-theory/group-theory-inverse-d1-e0001/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-e0001/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-inverse-d1-e0001/tests/spec.json b/tasks/group-theory/group-theory-inverse-d1-e0001/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..87ccaf4f7b79f6cbf02be7026caab485b65146c5
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-e0001/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- A left inverse and a right inverse of the same element are equal. -/\ntheorem inverses_agree {N : Type*} [Monoid N] (g k m : N)\n (h1 : m * g = 1) (h2 : g * k = 1) : k = m := by\n sorry\n",
+ "targets": [
+ {
+ "name": "inverses_agree",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-inverse-d1-e0001/tests/test.sh b/tasks/group-theory/group-theory-inverse-d1-e0001/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-e0001/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-inverse-d1-e0013/environment/Dockerfile b/tasks/group-theory/group-theory-inverse-d1-e0013/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-e0013/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-inverse-d1-e0013/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-inverse-d1-e0013/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..37819259cf2413907b01e12b3693a8aa627735f8
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-e0013/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- A left inverse and a right inverse of the same element are equal. -/
+theorem inverses_agree {S : Type*} [Monoid S] (a b c : S)
+ (h1 : a * b = 1) (h2 : c * a = 1) : b = c := by
+ sorry
diff --git a/tasks/group-theory/group-theory-inverse-d1-e0013/instruction.md b/tasks/group-theory/group-theory-inverse-d1-e0013/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..731df4d8cca36a43b16e91c2e9a164e79e9f5182
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-e0013/instruction.md
@@ -0,0 +1,14 @@
+# Inverses and cancellation
+
+Prove the following statement.
+
+Let \(M\) be a monoid and \(a, b, c \in M\) with \(a b = 1\) and \(c a = 1\). Then \(b = c\).
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-inverse-d1-e0013/solution/Solution.lean b/tasks/group-theory/group-theory-inverse-d1-e0013/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..c2e0e5acb6483ac1ef0356904176065f0898c901
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-e0013/solution/Solution.lean
@@ -0,0 +1,8 @@
+import Mathlib
+
+/-- A left inverse and a right inverse of the same element are equal. -/
+theorem inverses_agree {S : Type*} [Monoid S] (a b c : S)
+ (h1 : a * b = 1) (h2 : c * a = 1) : b = c := by
+ calc b = (c * a) * b := by rw [h2, one_mul]
+ _ = c * (a * b) := mul_assoc _ _ _
+ _ = c := by rw [h1, mul_one]
diff --git a/tasks/group-theory/group-theory-inverse-d1-e0013/solution/solve.sh b/tasks/group-theory/group-theory-inverse-d1-e0013/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-e0013/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-inverse-d1-e0013/task.toml b/tasks/group-theory/group-theory-inverse-d1-e0013/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..a169c637fc4ce3945bdde1185a6c92d967180f7b
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-e0013/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "easy"
+category = "group-theory"
+tags = ["group-theory", "inverse", "msc-20", "eval", "lean4"]
+msc = "20"
+family = "inverse"
+split = "eval"
+seed = 10013
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-inverse-d1-e0013/tests/Verify.lean b/tasks/group-theory/group-theory-inverse-d1-e0013/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-e0013/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-inverse-d1-e0013/tests/grade.py b/tasks/group-theory/group-theory-inverse-d1-e0013/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-e0013/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-inverse-d1-e0013/tests/spec.json b/tasks/group-theory/group-theory-inverse-d1-e0013/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..e76a44931286d12b57a810495356a50545e04b1a
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-e0013/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- A left inverse and a right inverse of the same element are equal. -/\ntheorem inverses_agree {S : Type*} [Monoid S] (a b c : S)\n (h1 : a * b = 1) (h2 : c * a = 1) : b = c := by\n sorry\n",
+ "targets": [
+ {
+ "name": "inverses_agree",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-inverse-d1-e0013/tests/test.sh b/tasks/group-theory/group-theory-inverse-d1-e0013/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-e0013/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0013/environment/Dockerfile b/tasks/group-theory/group-theory-inverse-d1-t0013/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0013/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0013/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-inverse-d1-t0013/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5a9c185bee22247b49a656e96dfc1184cd115469
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0013/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- A product equal to the identity stays equal to the identity after a cyclic rotation. -/
+theorem rotate_product {G : Type*} [Group G] (g₁ g₂ g₃ : G)
+ (h : g₁ * g₂ * g₃ = 1) : g₃ * g₁ * g₂ = 1 := by
+ sorry
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0013/instruction.md b/tasks/group-theory/group-theory-inverse-d1-t0013/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..35a6a92e9b709c3218e2e00e9e69f6d2a88ae25e
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0013/instruction.md
@@ -0,0 +1,14 @@
+# Inverses and cancellation
+
+Prove the following statement.
+
+Let \(G\) be a group and \(g_{1}, g_{2}, g_{3} \in G\) with \(g_{1} g_{2} g_{3} = e\). Then \(g_{3} g_{1} g_{2} = e\).
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0013/solution/Solution.lean b/tasks/group-theory/group-theory-inverse-d1-t0013/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..51fe76edb64590eb68a6c1d7e5f50bbf04a2ca62
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0013/solution/Solution.lean
@@ -0,0 +1,7 @@
+import Mathlib
+
+/-- A product equal to the identity stays equal to the identity after a cyclic rotation. -/
+theorem rotate_product {G : Type*} [Group G] (g₁ g₂ g₃ : G)
+ (h : g₁ * g₂ * g₃ = 1) : g₃ * g₁ * g₂ = 1 := by
+ calc g₃ * g₁ * g₂ = (g₁ * g₂)⁻¹ * (g₁ * g₂ * g₃) * (g₁ * g₂) := by group
+ _ = 1 := by rw [h]; group
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0013/solution/solve.sh b/tasks/group-theory/group-theory-inverse-d1-t0013/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0013/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0013/task.toml b/tasks/group-theory/group-theory-inverse-d1-t0013/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..74fe98e2497815e85790305fafb8aed0943c350d
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0013/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "easy"
+category = "group-theory"
+tags = ["group-theory", "inverse", "msc-20", "train", "lean4"]
+msc = "20"
+family = "inverse"
+split = "train"
+seed = 13
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0013/tests/Verify.lean b/tasks/group-theory/group-theory-inverse-d1-t0013/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0013/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0013/tests/grade.py b/tasks/group-theory/group-theory-inverse-d1-t0013/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0013/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0013/tests/spec.json b/tasks/group-theory/group-theory-inverse-d1-t0013/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..3b5e9b35cc277e8c97a89808d477dc91c3b1b48c
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0013/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- A product equal to the identity stays equal to the identity after a cyclic rotation. -/\ntheorem rotate_product {G : Type*} [Group G] (g₁ g₂ g₃ : G)\n (h : g₁ * g₂ * g₃ = 1) : g₃ * g₁ * g₂ = 1 := by\n sorry\n",
+ "targets": [
+ {
+ "name": "rotate_product",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0013/tests/test.sh b/tasks/group-theory/group-theory-inverse-d1-t0013/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0013/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0025/environment/Dockerfile b/tasks/group-theory/group-theory-inverse-d1-t0025/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0025/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0025/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-inverse-d1-t0025/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..d738159c69f6c8f9082036617631766de3c5dc55
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0025/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- A product equal to the identity stays equal to the identity after a cyclic rotation. -/
+theorem rotate_product {Q : Type*} [Group Q] (x₁ x₂ x₃ : Q)
+ (h : x₁ * x₂ * x₃ = 1) : x₂ * x₃ * x₁ = 1 := by
+ sorry
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0025/instruction.md b/tasks/group-theory/group-theory-inverse-d1-t0025/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..51d9194aa6d1315f7b5fc9d74aa7d3307183e63d
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0025/instruction.md
@@ -0,0 +1,14 @@
+# Inverses and cancellation
+
+Prove the following statement.
+
+Let \(G\) be a group and \(x_{1}, x_{2}, x_{3} \in G\) with \(x_{1} x_{2} x_{3} = e\). Then \(x_{2} x_{3} x_{1} = e\).
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0025/solution/Solution.lean b/tasks/group-theory/group-theory-inverse-d1-t0025/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..7d282b1087da579afc6f33f658dd9cff4a2a462e
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0025/solution/Solution.lean
@@ -0,0 +1,7 @@
+import Mathlib
+
+/-- A product equal to the identity stays equal to the identity after a cyclic rotation. -/
+theorem rotate_product {Q : Type*} [Group Q] (x₁ x₂ x₃ : Q)
+ (h : x₁ * x₂ * x₃ = 1) : x₂ * x₃ * x₁ = 1 := by
+ calc x₂ * x₃ * x₁ = (x₁)⁻¹ * (x₁ * x₂ * x₃) * (x₁) := by group
+ _ = 1 := by rw [h]; group
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0025/solution/solve.sh b/tasks/group-theory/group-theory-inverse-d1-t0025/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0025/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0025/task.toml b/tasks/group-theory/group-theory-inverse-d1-t0025/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..3e592b9c07ae20173f8b531ab72d3f5595256c70
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0025/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "easy"
+category = "group-theory"
+tags = ["group-theory", "inverse", "msc-20", "train", "lean4"]
+msc = "20"
+family = "inverse"
+split = "train"
+seed = 25
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0025/tests/Verify.lean b/tasks/group-theory/group-theory-inverse-d1-t0025/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0025/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native] ..."
+ return 2
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0025/tests/grade.py b/tasks/group-theory/group-theory-inverse-d1-t0025/tests/grade.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05ea58ae77e2559c3044dd77c7be559206b9
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0025/tests/grade.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Grade a Lean submission against a task. Standard library only.
+
+ python3 grade.py --spec spec.json --solution Solution.lean --out
+
+`spec.json` holds the hidden reference file, the target theorem names and their weights (see
+arena/core.py). The reward is the weighted share of targets that are proved: stated exactly as
+asked, with no `sorry`, depending only on propext, Classical.choice and Quot.sound, and passing a
+second kernel check by `leanchecker`. A submission that does not compile scores 0.
+
+The Lean project (toolchain + Mathlib) is found through $ARENA_LEAN, default: ../lean next to this
+file, then /opt/arena/lean.
+"""
+import argparse, json, os, shutil, subprocess, sys, tempfile, time
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+TIMEOUT = int(os.environ.get("ARENA_TIMEOUT", "600"))
+
+def project():
+ for p in (os.environ.get("ARENA_LEAN"), os.path.join(HERE, "..", "lean"), "/opt/arena/lean"):
+ if p and os.path.exists(os.path.join(p, "lean-toolchain")): return os.path.abspath(p)
+ raise SystemExit("Lean project not found; set ARENA_LEAN")
+
+_lp = {}
+def lean_path(proj):
+ if proj not in _lp:
+ cache = os.path.join(proj, ".lake", "lean_path.txt")
+ if os.path.exists(cache): _lp[proj] = open(cache).read().strip()
+ else:
+ _lp[proj] = subprocess.run(["lake", "env", "printenv", "LEAN_PATH"], cwd=proj, capture_output=True, text=True, check=True).stdout.strip()
+ try: open(cache, "w").write(_lp[proj])
+ except OSError: pass
+ return _lp[proj]
+
+class Slot:
+ """Optional machine-wide cap on concurrent Lean processes: ARENA_SLOTS=n, ARENA_LOCKDIR=dir."""
+ def __enter__(self):
+ self.path = None
+ n = int(os.environ.get("ARENA_SLOTS", "0"))
+ if not n: return self
+ d = os.environ.get("ARENA_LOCKDIR", os.path.join(tempfile.gettempdir(), "arena-locks")); os.makedirs(d, exist_ok=True)
+ while True:
+ for i in range(n):
+ p = os.path.join(d, "slot%d" % i)
+ try:
+ os.mkdir(p); open(os.path.join(p, "pid"), "w").write(str(os.getpid())); self.path = p; return self
+ except FileExistsError:
+ try:
+ pid = int(open(os.path.join(p, "pid")).read()); os.kill(pid, 0)
+ except (OSError, ValueError):
+ shutil.rmtree(p, ignore_errors=True) # stale
+ time.sleep(1)
+ def __exit__(self, *a):
+ if self.path: shutil.rmtree(self.path, ignore_errors=True)
+
+def run(cmd, proj, extra_path=None, timeout=TIMEOUT):
+ env = dict(os.environ); env["LEAN_PATH"] = lean_path(proj) + ((":" + extra_path) if extra_path else "")
+ with Slot():
+ try:
+ r = subprocess.run(cmd, cwd=proj, env=env, capture_output=True, text=True, timeout=timeout)
+ return r.returncode, (r.stdout + r.stderr)
+ except subprocess.TimeoutExpired:
+ return 124, "timed out after %d s" % timeout
+
+def compile_lean(proj, src, work):
+ """Compile work/.lean to work/.olean. Returns (ok, messages)."""
+ olean = os.path.join(work, src + ".olean")
+ if os.path.exists(olean): os.remove(olean)
+ code, out = run(["lean", "--root=" + work, "-o", olean, os.path.join(work, src + ".lean")], proj, work)
+ return code == 0 and os.path.exists(olean), out
+
+def grade(spec, solution_text, keep=None):
+ proj = project(); work = keep or tempfile.mkdtemp(prefix="arena-")
+ os.makedirs(work, exist_ok=True)
+ targets = spec["targets"]; total = float(sum(t["weight"] for t in targets))
+ res = {"reward": 0.0, "stage": "", "targets": [], "log": ""}
+ def fail(stage, log):
+ res["stage"] = stage; res["log"] = log[-4000:]
+ res["targets"] = [{"target": t["name"], "ok": False, "why": stage} for t in targets]
+ return res
+ try:
+ open(os.path.join(work, "Reference.lean"), "w").write(spec["reference"])
+ open(os.path.join(work, "Solution.lean"), "w").write(solution_text)
+ ok, out = compile_lean(proj, "Reference", work)
+ if not ok: return fail("the reference file did not compile (a fault in the task, not in the submission)", out)
+ ok, out = compile_lean(proj, "Solution", work)
+ if not ok: return fail("the submission does not compile", out)
+ code, out = run(["leanchecker", "Solution"], proj, work)
+ if code != 0: return fail("the submission fails the kernel re-check", out)
+ sub = "Solution"; flags = []
+ if spec.get("tests"):
+ open(os.path.join(work, "Tests.lean"), "w").write(spec["tests"])
+ ok, out = compile_lean(proj, "Tests", work)
+ if not ok: return fail("the hidden tests do not pass", out)
+ code, out = run(["leanchecker", "Tests"], proj, work)
+ if code != 0: return fail("the tests fail the kernel re-check", out)
+ sub = "Tests"; flags = ["--native"]
+ if spec.get("free"): flags += ["--free", ",".join(spec["free"])]
+ verify = os.path.join(HERE, "Verify.lean")
+ if not os.path.exists(verify): verify = os.path.join(proj, "verifier", "Verify.lean")
+ code, out = run(["lean", "--run", verify] + flags + ["Reference", sub] + [t["name"] for t in targets], proj, work)
+ got = {}
+ for line in out.splitlines():
+ if line.startswith("{"):
+ try: j = json.loads(line); got[j["target"]] = j
+ except ValueError: pass
+ if code != 0 or len(got) != len(targets): return fail("the verifier did not finish", out)
+ res["targets"] = [got[t["name"]] for t in targets]
+ res["reward"] = round(sum(t["weight"] for t in targets if got[t["name"]]["ok"]) / total, 4)
+ res["stage"] = "graded"
+ return res
+ finally:
+ if not keep: shutil.rmtree(work, ignore_errors=True)
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--spec", required=True); ap.add_argument("--solution", required=True); ap.add_argument("--out", default=None)
+ a = ap.parse_args()
+ spec = json.load(open(a.spec, encoding="utf-8"))
+ try: text = open(a.solution, encoding="utf-8").read()
+ except OSError: text = None
+ res = grade(spec, text) if text is not None else {"reward": 0.0, "stage": "no Solution.lean found", "targets": [], "log": ""}
+ print(json.dumps(res, indent=1, ensure_ascii=False))
+ if a.out:
+ os.makedirs(a.out, exist_ok=True)
+ open(os.path.join(a.out, "reward.txt"), "w").write("%g\n" % res["reward"])
+ json.dump(res, open(os.path.join(a.out, "result.json"), "w"), indent=1, ensure_ascii=False)
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0025/tests/spec.json b/tasks/group-theory/group-theory-inverse-d1-t0025/tests/spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..04f07b21edb1199703ff847395e402bec84b110b
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0025/tests/spec.json
@@ -0,0 +1,9 @@
+{
+ "reference": "import Mathlib\n\n/-- A product equal to the identity stays equal to the identity after a cyclic rotation. -/\ntheorem rotate_product {Q : Type*} [Group Q] (x₁ x₂ x₃ : Q)\n (h : x₁ * x₂ * x₃ = 1) : x₂ * x₃ * x₁ = 1 := by\n sorry\n",
+ "targets": [
+ {
+ "name": "rotate_product",
+ "weight": 1.0
+ }
+ ]
+}
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0025/tests/test.sh b/tasks/group-theory/group-theory-inverse-d1-t0025/tests/test.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b366909050f1dd7ef36e114efc8ef6e55c11834a
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0025/tests/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p /logs/verifier
+python3 /tests/grade.py --spec /tests/spec.json --solution /app/Solution.lean --out /logs/verifier || echo 0 > /logs/verifier/reward.txt
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0037/environment/Dockerfile b/tasks/group-theory/group-theory-inverse-d1-t0037/environment/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d205e4e509e27565b0b394ac0caf379bc83524a1
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0037/environment/Dockerfile
@@ -0,0 +1,3 @@
+FROM lean-arena
+WORKDIR /app
+COPY workdir/ /app/
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0037/environment/workdir/Solution.lean b/tasks/group-theory/group-theory-inverse-d1-t0037/environment/workdir/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..2aba043268f10db0c8893ffc3db9baa38c5b374f
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0037/environment/workdir/Solution.lean
@@ -0,0 +1,6 @@
+import Mathlib
+
+/-- A left inverse and a right inverse of the same element are equal. -/
+theorem inverses_agree {M : Type*} [Monoid M] (p q r : M)
+ (h1 : r * p = 1) (h2 : p * q = 1) : q = r := by
+ sorry
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0037/instruction.md b/tasks/group-theory/group-theory-inverse-d1-t0037/instruction.md
new file mode 100644
index 0000000000000000000000000000000000000000..bbfcf60fb43759f88fa46c7a1ba13c90295f3f33
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0037/instruction.md
@@ -0,0 +1,14 @@
+# Inverses and cancellation
+
+Prove the following statement.
+
+Let \(M\) be a monoid and \(p, q, r \in M\) with \(p q = 1\) and \(r p = 1\). Then \(q = r\).
+
+## What to do
+
+`Solution.lean` in the working directory states the theorem in Lean 4 with Mathlib, with `sorry` in place of the proof. Replace every `sorry` with a proof.
+
+- Do not change the statement of any theorem or any definition the file gives you. You may add your own lemmas and definitions.
+- Check your work with `lake env lean Solution.lean` (run it inside `/opt/arena/lean`, giving the full path to the file). It must compile without errors.
+- A theorem counts only if its proof is complete: no `sorry`, no new axioms, no `native_decide`.
+- The reward is 1 if the theorem is proved and 0 otherwise.
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0037/solution/Solution.lean b/tasks/group-theory/group-theory-inverse-d1-t0037/solution/Solution.lean
new file mode 100644
index 0000000000000000000000000000000000000000..0c6cde0a6ac2e25f4f9176bf89dbae565d23adef
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0037/solution/Solution.lean
@@ -0,0 +1,8 @@
+import Mathlib
+
+/-- A left inverse and a right inverse of the same element are equal. -/
+theorem inverses_agree {M : Type*} [Monoid M] (p q r : M)
+ (h1 : r * p = 1) (h2 : p * q = 1) : q = r := by
+ calc q = (r * p) * q := by rw [h1, one_mul]
+ _ = r * (p * q) := mul_assoc _ _ _
+ _ = r := by rw [h2, mul_one]
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0037/solution/solve.sh b/tasks/group-theory/group-theory-inverse-d1-t0037/solution/solve.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b3f52d5f1892ce8e7279a2afa35d39094f971237
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0037/solution/solve.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+set -e
+cp /solution/Solution.lean /app/Solution.lean
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0037/task.toml b/tasks/group-theory/group-theory-inverse-d1-t0037/task.toml
new file mode 100644
index 0000000000000000000000000000000000000000..fb4ed3bd80d38b5d951994a5d494d81e5ff425f1
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0037/task.toml
@@ -0,0 +1,25 @@
+version = "1.0"
+
+[metadata]
+author_name = "Renaissance Labs"
+author_email = "unknown"
+difficulty = "easy"
+category = "group-theory"
+tags = ["group-theory", "inverse", "msc-20", "train", "lean4"]
+msc = "20"
+family = "inverse"
+split = "train"
+seed = 37
+
+[verifier]
+timeout_sec = 900.0
+
+[agent]
+timeout_sec = 1800.0
+
+[environment]
+build_timeout_sec = 1800.0
+cpus = 2
+memory_mb = 6144
+storage_mb = 10240
+allow_internet = false
diff --git a/tasks/group-theory/group-theory-inverse-d1-t0037/tests/Verify.lean b/tasks/group-theory/group-theory-inverse-d1-t0037/tests/Verify.lean
new file mode 100644
index 0000000000000000000000000000000000000000..5fa146726ab53f1507be3681f82bab84fc1097e7
--- /dev/null
+++ b/tasks/group-theory/group-theory-inverse-d1-t0037/tests/Verify.lean
@@ -0,0 +1,135 @@
+/-
+Verify.lean: decides whether a submitted Lean module proves the theorems a task asked for.
+
+ lean --run Verify.lean [--free a,b] [--native] ...
+
+`--free a,b` names definitions the task asks the solver to write: their type must match the
+reference, their value is the solver's own. `--native` additionally accepts the axioms that
+`native_decide` introduces; it is used only for hidden test theorems the grader itself proves.
+
+Both modules must already be compiled to .olean files on LEAN_PATH. This program imports only
+`Lean`, never the submission, so nothing the submission declares (notation, macros, instances)
+can change how the check itself is read. It reads the reference module's constants from its .olean, imports the
+submission as an environment, and compares kernel terms:
+
+ 1. every non-target constant the reference module declares (the task's own definitions) must be
+ present in the submission with the same kind, type and value;
+ 2. every target must be present with exactly the reference type;
+ 3. the proof of every target may depend only on the three standard axioms.
+
+It prints one JSON object per target and exits 0. The caller turns that into a reward.
+-/
+import Lean
+open Lean
+
+def allowedAxioms : List Name := [``propext, ``Classical.choice, ``Quot.sound]
+
+/-- All axioms a constant depends on, found by walking every constant it mentions. -/
+partial def axiomsOf (env : Environment) (root : Name) : Array Name := Id.run do
+ let mut seen : NameSet := {}
+ let mut todo : Array Name := #[root]
+ let mut out : Array Name := #[]
+ while h : todo.size > 0 do
+ let c := todo[todo.size - 1]
+ todo := todo.pop
+ if seen.contains c then continue
+ seen := seen.insert c
+ match env.find? c with
+ | none => out := out.push (`missing ++ c)
+ | some info =>
+ let mut es : Array Expr := #[info.type]
+ match info with
+ | .axiomInfo _ => out := out.push c
+ | .defnInfo v => es := es.push v.value
+ | .thmInfo v => es := es.push v.value
+ | .opaqueInfo v => es := es.push v.value
+ | .ctorInfo v => todo := todo.push v.induct
+ | .inductInfo v => for k in v.ctors do todo := todo.push k
+ | .recInfo v => for r in v.rules do es := es.push r.rhs
+ | .quotInfo _ => pure ()
+ for e in es do
+ for k in e.getUsedConstants do
+ if !seen.contains k then todo := todo.push k
+ return out
+
+def kindOf : ConstantInfo → String
+ | .axiomInfo _ => "axiom" | .defnInfo _ => "def" | .thmInfo _ => "theorem"
+ | .opaqueInfo _ => "opaque" | .quotInfo _ => "quot" | .inductInfo _ => "inductive"
+ | .ctorInfo _ => "constructor" | .recInfo _ => "recursor"
+
+def valueOf : ConstantInfo → Option Expr
+ | .defnInfo v => some v.value | .thmInfo v => some v.value | .opaqueInfo v => some v.value
+ | _ => none
+
+def sameDecl (a b : ConstantInfo) : Bool :=
+ kindOf a == kindOf b && a.levelParams == b.levelParams && a.type == b.type && valueOf a == valueOf b
+
+def jstr (s : String) : String := (Json.str s).compress
+
+def isNativeAxiom (n : Name) : Bool :=
+ n == ``Lean.ofReduceBool || n == ``Lean.trustCompiler ||
+ n.components.any (fun c => c == `native_decide)
+
+def isUnder (frees : List Name) (c : Name) : Bool := frees.any (fun f => f.isPrefixOf c)
+
+partial def parseFlags (args : List String) (free : List Name) (native : Bool) :
+ List Name × Bool × List String :=
+ match args with
+ | "--free" :: v :: rest => parseFlags rest (free ++ (v.splitOn ",").map String.toName) native
+ | "--native" :: rest => parseFlags rest free true
+ | rest => (free, native, rest)
+
+def main (args : List String) : IO UInt32 := do
+ let (free, native, args) := parseFlags args [] false
+ match args with
+ | refMod :: solMod :: targets =>
+ initSearchPath (← findSysroot)
+ let refName := refMod.toName
+ let solName := solMod.toName
+ let targetNames := targets.map String.toName
+ -- The reference is read straight from its .olean: that file holds exactly the constants the
+ -- reference module declares, which is all the comparison needs. Only the submission is imported
+ -- as a full environment (Mathlib included), so memory stays at one copy of Mathlib, not two.
+ let (refData, _) ← readModuleData (← findOLean refName)
+ let mut refMap : Std.HashMap Name ConstantInfo := {}
+ for i in [0:refData.constNames.size] do
+ refMap := refMap.insert refData.constNames[i]! refData.constants[i]!
+ let solEnv ← importModules #[{ module := solName }] {} (trustLevel := 0)
+ -- 1. the task's own definitions are unchanged
+ let mut tampered : Array Name := #[]
+ for c in refData.constNames do
+ if targetNames.contains c then continue
+ let some r := refMap[c]? | continue
+ if free.contains c then
+ match solEnv.find? c with
+ | some s =>
+ if r.levelParams != s.levelParams || r.type != s.type then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ continue
+ if isUnder free c then continue
+ match solEnv.find? c with
+ | some s => if !sameDecl r s then tampered := tampered.push c
+ | none => tampered := tampered.push c
+ for t in targetNames do
+ let mut ok := true
+ let mut why := ""
+ match refMap[t]?, solEnv.find? t with
+ | none, _ => ok := false; why := "target missing from reference"
+ | _, none => ok := false; why := "theorem not found in the submission"
+ | some r, some s =>
+ if !tampered.isEmpty then
+ ok := false; why := s!"the task's definitions were changed or are missing: {tampered.toList}"
+ else if kindOf s != "theorem" && kindOf s != "def" then
+ ok := false; why := s!"declared as {kindOf s}, not proved"
+ else if r.levelParams != s.levelParams || r.type != s.type then
+ ok := false; why := "the statement differs from the one asked for"
+ else
+ let ax := axiomsOf solEnv t
+ let bad := ax.filter (fun a => !allowedAxioms.contains a && !(native && isNativeAxiom a))
+ if !bad.isEmpty then
+ ok := false; why := s!"depends on axioms that are not allowed: {bad.toList}"
+ IO.println s!"\{\"target\": {jstr t.toString}, \"ok\": {ok}, \"why\": {jstr why}}"
+ return 0
+ | _ =>
+ IO.eprintln "usage: lean --run Verify.lean [--free a,b] [--native]