{"data":{"kind":"file","path":"README.md","version_id":"y1aeaogicu3dp6mvbdn5jjh8","entry":{"name":"README.md","path":"README.md","is_directory":false,"size":8411,"modified_at":"2026-08-28T01:08:33.615000","content_hash":"dceab64c52da5b1dd51e2cca5d145d091e7bc4d6b641480784b40999f3e7b297"},"entries":[],"content":"# ladr-axler\n\n**Linear Algebra Done Right** (Sheldon Axler, 4th edition) as an exactly-graded RL environment.\n\n186 single-turn tasks across 25 topics spanning chapters 1–9. Binary reward from exact\narithmetic over ℚ. **No LLM judge, no tools, no network, no clock** — a rollout that scores 1.0\ntoday scores 1.0 in a year on a different machine.\n\n```bash\nprime env install <username>/ladr-axler\n```\n\n---\n\n## The problem this had to solve\n\nAxler is a proof-based book. Proofs need a theorem prover, and there isn't one here — so the\nobvious reading is that the material can't be graded automatically.\n\nIt can, because **what the book is actually about is operator invariants.** Dimension of a null\nspace, minimal polynomial, eigenvalues with multiplicity, diagonalizability, nilpotency index,\ngeneralized eigenspaces, singular values, orthogonal decompositions. Every one of those is\nexactly computable over the rationals, and every one of them is a theorem in the text rather\nthan a computation bolted on beside it.\n\nSo the reward is binary and exact. Nothing is compared with a tolerance, because a tolerance\nwide enough to absorb float noise is wide enough to accept an operator with minimal polynomial\n`(x-2)` where the answer is `(x-2)²` — and that distinction *is* chapters 5 and 8.\n\n## Why this is not another linear algebra environment\n\n`strang-env` already exists on the Hub and covers computational linear algebra: RREF, the four\nsubspaces, elimination.\n\n**Axler deliberately avoids exactly that.** LADR is determinant-free — determinants don't appear\nuntil chapter 9, after eigenvalues — and works on abstract vector spaces rather than on ℝⁿ with\ncoordinates. Its subject is operators: invariant subspaces, minimal polynomials, the spectral\ntheorem, generalized eigenspaces. The overlap is close to zero, and the tasks here reflect that:\npolynomial spaces `P_m(ℝ)`, weighted and integral inner products, and operators handed over as\ndifferential expressions rather than as matrices.\n\n## Coverage\n\n| Topic | LADR 4e | Answer type |\n|---|---|---|\n| Subspace test (on `P_m(ℝ)` and matrix spaces) | 1C | bool |\n| Linear independence of polynomials | 2A | bool |\n| dim(U+W), dim(U∩W) | 2C | int |\n| Null space and range of a power of an operator | 3B | int |\n| Matrix of an operator on `P_m(ℝ)` | 3C | matrix over ℚ |\n| Invertibility | 3D | bool |\n| Quotient spaces | 3E | int |\n| Annihilators and the dual map | 3F | int |\n| Polynomial division with remainder | 4 | polynomial |\n| Eigenvalues with multiplicity | 5A | multiset |\n| Invariant subspaces (2-dimensional) | 5B | bool |\n| **Minimal polynomial** | 5A | polynomial |\n| Diagonalizability over ℝ vs over ℂ | 5C | bool |\n| Eigenspace and **generalized eigenspace** dimension | 5D, 8B | int |\n| Inner products (weighted, and `∫₀¹pq`) | 6A | rational |\n| Gram–Schmidt | 6B | vectors over ℚ |\n| Orthogonal projection (weighted inner product) | 6C | vector over ℚ |\n| Orthogonal complements | 6C | int |\n| Riesz representation | 6C | vector over ℚ |\n| Adjoints, self-adjoint, normal | 7A | bool |\n| Positive operators | 7C | bool |\n| **Singular values, squared** | 7E | multiset |\n| Nilpotency index | 8B | int |\n| Characteristic polynomial | 8 | polynomial |\n| Trace and determinant | 9 | rational |\n\n## Three deviations from the book, and why\n\nEach one exists to keep grading exact. An unexplained deviation reads as an error, so they are\nstated here rather than buried.\n\n**Singular values are asked for squared.** The singular values of a rational matrix are almost\nnever rational; returning them forces a float. Their squares — the eigenvalues of `T*T` — are\nexact, carry identical information, and can be asked for exactly.\n\n**Gram–Schmidt stops before normalising.** The book normalises at each step, which introduces a\nsquare root and leaves ℚ. Removing only the projection gives the same orthogonal *directions*\nwith every entry rational.\n\n**The minimal polynomial is computed from 5.24's own definition** — walk the powers\n`I, T, T², …`, stop at the first that is a linear combination of its predecessors — rather than\nthrough a CAS shortcut. Sympy reaches the same answer by a different route; the book's route is\nthe one a reader can check by hand, and a grader nobody can check by hand is a grader nobody\nshould trust.\n\n## No problem comes from the book\n\nEvery instance is generated fresh from a published seed. None of Axler's exercises appear here,\nand neither does his text.\n\nThat is not only a licence question — LADR 4e is CC BY-NC, which permits reuse but not the\ncommercial training this exists to serve. It is a **contamination** question. The book's\nexercises and worked solutions to most of them have been on the web for years, and are therefore\nin the training data of every model this will grade. A score on memorised problems measures\nrecall, not linear algebra.\n\nThe recurring construction is conjugation: build an operator whose invariants are known by\nconstruction — a chosen spectrum, a Jordan form — then conjugate by a random unimodular integer\nmatrix. The invariants survive similarity, the entries stop being readable, and the task becomes\nwork rather than recognition while the answer stays exact.\n\n## Calibration\n\nPrime Intellect's stated bar: a small model scoring 90%+ means too easy; a strong model scoring\n≤10% means too hard or broken. Measured against **`openai/gpt-4.1-mini`**, 186 tasks, one\nrollout each:\n\n**Overall: 79%** — inside the band.\n\n| | topics |\n|---|---|\n| **Hard** (25–35%) | minimal polynomial, eigenvalues |\n| **Medium** (55–85%) | matrix of an operator, Gram–Schmidt, dim(U+W), dim(U∩W), rank–nullity, eigenspace dimension |\n| **Flat** (90–100%) | the yes/no topics and the single-step computations |\n\nThe flat end is real and worth naming. Thirteen topics score at or near 100%: subspace tests,\nindependence, invertibility, quotients, annihilators, polynomial division, invariant subspaces,\ninner products, Riesz, adjoints, positive operators, trace and determinant. `gpt-4.1-mini` is\nsimply competent at these — you either know the definition or you don't.\n\nThey are kept, for two reasons. The bounty asks for coverage of the book, and an environment\nneeds an easy end to climb from: 0% and 100% are equally useless as signal, but a *spread* is\nthe point. They are held to 3–5 instances each, with the weight moved to the topics where the\nmodel actually fails. **31% of tasks sit in the flat topics, down from 40% at equal weight.**\n\nPer-topic figures below ~10 tasks are noisy at one rollout — a 4-task topic moves in 25% steps.\nThe overall has been stable at 77–83% across six runs.\n\nRecalibrate with:\n\n```bash\nexport PRIME_API_KEY=...\npython calibrate.py --model openai/gpt-4.1-mini --n 186 --rollouts 3\n```\n\n## Answer format\n\nTasks ask for the final answer in `\\boxed{}`. Answers are normalised by kind before comparison,\nso `2,2,3` and `3,2,2` agree for a multiset of eigenvalues while `[1,2]` and `[2,1]` stay\ndifferent for a vector. `x^2 - 6x + 9`, `(x-3)^2` and `9-6x+x^2` all match; `x-3` does not.\n\nGrading rejects an answer that contains both a yes and a no, or two candidate values — hedging\nacross both outcomes is a bet, not an answer, and accepting it would make guessing free.\n\n## Configuration\n\n```python\nload_environment(seed=20260825, scale=1.0, topics=None)\n```\n\n`seed` — generation is deterministic in it; publishing the seed is what makes every answer\nindependently re-derivable. `scale` — multiplies per-topic counts for a smoke set or a larger\ntraining set. `topics` — restrict to named topics, for debugging one generator in isolation.\n\n## Development\n\n```bash\npytest tests/ -q          # 145 tests; asserts theorems, not shapes\npython calibrate.py --dry-run --n 186   # exercises scoring with no API calls\n```\n\nThe tests assert statements from the book that must hold for every generated instance —\nrank–nullity, minimal polynomial divides characteristic polynomial, projection is idempotent,\nGram–Schmidt output is orthogonal and rational — plus a round trip checking that every published\nanswer scores 1.0 through the real grader. `assert result is not None` would pass on a grader\nthat is consistently wrong, which is the failure mode that actually matters: a wrong grader does\nnot crash, it quietly teaches the model something false.\n\nLicence: Apache-2.0.\n","encoding":"utf-8","truncated":false,"total_bytes":8411},"status":null}