# radian-ramsey **The radian nine-gon is Euclidean Ramsey if and only if `e^{iθ}` is algebraic, proved in Lean 4.** A finite set of points in Euclidean space is *Ramsey* if for every number of colours `r ≥ 2` there is a dimension `D` such that every `r`-colouring of `ℝ^D` contains a monochromatic congruent copy of the set. OpenAI's result 172 classified the finite Ramsey configurations by a tensor condition over their coordinate field. This repository applies the classification to one explicit family, the nine points at angles `0, θ, 2θ, …, 8θ` on the unit circle: > **Theorem D.** Let `θ` be real and let `E_θ = {(cos kθ, sin kθ) : k = 0, 1, …, 8}`. > 1. If `tan(θ/2)` is transcendental, the nine points are distinct and `E_θ` is **not** Ramsey. > 2. If the nine points are distinct, `E_θ` is Ramsey if and only if `cos θ` and `sin θ` are > algebraic (that is, iff `e^{iθ}` is algebraic), if and only if `tan(θ/2)` is algebraic. **Corollary** ([HAND], not in Lean): the nine points at `0, 1, 2, …, 8` radians are not Ramsey. This is Theorem D at `θ = 1`, plus the Lindemann–Weierstrass theorem (`e^{i}` is transcendental, hence so is `tan(1/2)`), which is not in Mathlib. Nine is the exact threshold: for every θ with distinct points, the eight points at `0, θ, …, 7θ` are Ramsey (spherical-ramsey, the radian 8-gon corollary; [HAND], AI-reviewed, not in Lean). At `θ = e`, Theorem D makes the Ramsey question equivalent to whether `e^{ie}` is algebraic, which appears to be open (Schanuel's conjecture would settle it). **Why it is of interest.** Explicit examples of Ramsey and non-Ramsey sets with a transcendental parameter were known before (OpenAI's Proposition 7.7 and Corollary 7.5; see Prior work). Theorem D is instead an *if and only if* for a whole one-parameter family: as `θ` varies, the same nine-point pattern switches between Ramsey and non-Ramsey exactly as `e^{iθ}` switches between algebraic and transcendental, so the Ramsey question for an explicit set can be exactly as hard as a transcendence question. The deep work is OpenAI's: the non-Ramsey direction is the argument of their Proposition 7.6 (nine points with algebraically independent parameters), run for a single parameter, and the Lean proof here builds on their Lean proof. Theorem D is Theorem D of the note of the [spherical-ramsey](https://doi.org/10.5281/zenodo.23396387) release (v1.1.0), where it is stated with a proof sketch and proved in Lean at OpenAI's pin. **What this repository is.** The Lean proof here is already public, in rope AV3 (`ropes/av3`) of spherical-ramsey, at Lean v4.34.1 and checked there. This repository is a port of that proof to the Lean module system (Lean v4.35.0-rc2), with no statement or proof line changed apart from the renamed namespace (`docs/PORT-LOG.md`), packaged as a standalone repository in the Palomar registry's layout so that Theorem D can be checked and cited on its own, without the rest of spherical-ramsey: one Mathlib-only challenge file for all seven statements, the toolchain's `lake comparator` with three kernels, negative controls, CI and the `formalization.yaml` metadata. It contains no new mathematics beyond spherical-ramsey v1.1.0. ## The statements, verbatim Definitions (`Challenge.lean`; `Space`, `Congruent`, `Ramsey` are OpenAI's, verbatim from their `Model.lean`): ```lean abbrev Space (d : ℕ) := EuclideanSpace ℝ (Fin d) def Congruent {s d D : ℕ} (a : Fin s → Space d) (b : Fin s → Space D) : Prop := ∀ i j, dist (b i) (b j) = dist (a i) (a j) def Ramsey {s d : ℕ} (a : Fin s → Space d) : Prop := ∀ r : ℕ, 2 ≤ r → ∃ D : ℕ, 1 ≤ D ∧ ∀ c : Space D → Fin r, ∃ b : Fin s → Space D, Congruent a b ∧ ∃ k : Fin r, ∀ i, c (b i) = k def radianConfig (θ : ℝ) (k : Fin 9) : Space 2 := WithLp.toLp 2 ![Real.cos ((k : ℕ) * θ), Real.sin ((k : ℕ) * θ)] ``` The advertised theorems (`comparator.json`). In namespace `OAI.EuclideanRamsey.Radian`: ```lean theorem radian_configuration (θ : ℝ) (ht : Transcendental ℚ (Real.tan (θ / 2))) : Function.Injective (radianConfig θ) ∧ (∀ k, dist (radianConfig θ k) 0 = 1) ∧ ¬ Ramsey (radianConfig θ) theorem radian_not_ramsey (θ : ℝ) (ht : Transcendental ℚ (Real.tan (θ / 2))) : ¬ Ramsey (radianConfig θ) theorem radian_ramsey_iff (θ : ℝ) (hinj : Function.Injective (radianConfig θ)) : Ramsey (radianConfig θ) ↔ IsAlgebraic ℚ (Real.cos θ) ∧ IsAlgebraic ℚ (Real.sin θ) theorem radian_ramsey_iff_tan (θ : ℝ) (hinj : Function.Injective (radianConfig θ)) : Ramsey (radianConfig θ) ↔ IsAlgebraic ℚ (Real.tan (θ / 2)) ``` and, in namespace `RadianRamsey`, the same three statements with no definitions beyond Mathlib (the nine points written out, `Metric.sphere` for the unit circle, `Ramsey` unfolded, and Mathlib's `Congruent`): ```lean theorem radian_configuration_mathlib (θ : ℝ) (ht : Transcendental ℚ (Real.tan (θ / 2))) : let a : Fin 9 → EuclideanSpace ℝ (Fin 2) := fun k => WithLp.toLp 2 ![Real.cos ((k : ℕ) * θ), Real.sin ((k : ℕ) * θ)] Function.Injective a ∧ (∀ k, a k ∈ Metric.sphere (0 : EuclideanSpace ℝ (Fin 2)) 1) ∧ ¬ (∀ r : ℕ, 2 ≤ r → ∃ D : ℕ, 1 ≤ D ∧ ∀ χ : EuclideanSpace ℝ (Fin D) → Fin r, ∃ b : Fin 9 → EuclideanSpace ℝ (Fin D), Congruent a b ∧ ∃ k : Fin r, ∀ i, χ (b i) = k) theorem radian_ramsey_iff_mathlib (θ : ℝ) : let a : Fin 9 → EuclideanSpace ℝ (Fin 2) := fun k => WithLp.toLp 2 ![Real.cos ((k : ℕ) * θ), Real.sin ((k : ℕ) * θ)] Function.Injective a → ((∀ r : ℕ, 2 ≤ r → ∃ D : ℕ, 1 ≤ D ∧ ∀ χ : EuclideanSpace ℝ (Fin D) → Fin r, ∃ b : Fin 9 → EuclideanSpace ℝ (Fin D), Congruent a b ∧ ∃ k : Fin r, ∀ i, χ (b i) = k) ↔ IsAlgebraic ℚ (Real.cos θ) ∧ IsAlgebraic ℚ (Real.sin θ)) theorem radian_ramsey_iff_tan_mathlib (θ : ℝ) : let a : Fin 9 → EuclideanSpace ℝ (Fin 2) := fun k => WithLp.toLp 2 ![Real.cos ((k : ℕ) * θ), Real.sin ((k : ℕ) * θ)] Function.Injective a → ((∀ r : ℕ, 2 ≤ r → ∃ D : ℕ, 1 ≤ D ∧ ∀ χ : EuclideanSpace ℝ (Fin D) → Fin r, ∃ b : Fin 9 → EuclideanSpace ℝ (Fin D), Congruent a b ∧ ∃ k : Fin r, ∀ i, χ (b i) = k) ↔ IsAlgebraic ℚ (Real.tan (θ / 2))) ``` There are no hypotheses beyond the ones shown. For the non-Ramsey direction, distinctness is a conclusion, not a hypothesis. The iffs assume distinctness, because a non-injective `radianConfig θ` is not a nine-point set. ## What is checked, and how **Verification level: Comparator-checked** (the toolchain's `lake comparator` with three kernels, on a fresh GitHub runner, with negative controls refused). The same theorems at OpenAI's pin (Lean v4.34.1, Mathlib `d13f23b7`), in rope AV3 of spherical-ramsey (`ropes/av3`), passed that release's full gate: stock Comparator on a fresh runner (run 38555249049 of github.com/wstrinz/spherical-ramsey, at v1.0.0, commit e09ca09; `ropes/av3` is unchanged in v1.1.0), a fidelity review by an AI agent that did not build it, and a fresh reproduction by another AI agent from the README alone. This package is the same proof, ported (`docs/PORT-LOG.md`); the port has been checked by the machine checks below, and its statements and documentation were reviewed by a further AI agent that did not build them (statements identical to the rope's; documentation fixes applied). - **Kernels and statements.** The toolchain's own `lake comparator` (Lean v4.35.0-rc2) compiles `Challenge.lean` (Mathlib only: the definitions above and the seven statements with `sorry`) and `Solution.lean` (the proofs). It checks that every advertised theorem has exactly the challenge's statement and that every definition it mentions has exactly the challenge's body, checks that only `propext`, `Classical.choice` and `Quot.sound` are used, and replays the whole proof (including the Mathlib declarations it uses) through three independent kernels: Lean's own, NanoDa and con-ron. It accepts: "Your solution is okay!". `scripts/verify-comparator.sh` is PalomarTemplate's script, unmodified; it runs this check in a bubblewrap sandbox, as the Palomar registry does. - **Negative controls.** `tests/controls/` holds five altered challenges, each refused for its expected reason: the challenge as its own solution (`sorryAx`); `Ramsey` with `3 ≤ r`; `radianConfig` with its two coordinates swapped; `radian_ramsey_iff` without the distinctness hypothesis; and `radian_configuration_mathlib` without its injectivity conclusion (a weaker statement, true, refused because it is not the advertised one). - **Axioms.** `lake build` prints `#print axioms` for the seven theorems (`Solution.lean`) and for `ramsey_of_algebraic`: `[propext, Classical.choice, Quot.sound]` throughout. There is no `sorry`, `admit` or `native_decide` outside the statement-only `Challenge.lean`. The 9×9 determinant certificate is checked by `decide +kernel` over `ℤ` (kernel reduction; no extra axiom). - **The trusted surface** is `Challenge.lean`: OpenAI's three definitions, the two lines of `radianConfig`, and the seven statements. Read it. - **CI.** `.github/workflows/verify.yml` runs all of this on a fresh GitHub runner on every push. - **Fidelity.** `docs/FIDELITY.md` goes through the statements item by item: Ramsey quantifiers, pairs, set versus tuple, metric, distinctness, embeddings, the junk value of `tan`, vacuity and the edge cases. ### How the proof goes - **Half-angle trigonometry.** With `t = tan(θ/2)`, every point `(cos kθ, sin kθ)` is a rational function of `t`, so the coordinate field is `ℚ(t)`; when `t` is transcendental, `ℚ(t) ⊗ ℚ(t)` embeds in `ℚ(T, U)` (OpenAI's `IndependentTensor`). - **One determinant.** The denominator-cleared 9×9 evaluation matrix of OpenAI's linear obstruction is nonsingular over `ℚ(T, U)`: it is certified at `(T, U) = (2, 3)` by an explicit integer triangular factorization, checked by `decide +kernel`. This replaces OpenAI's nine-parameter Kronecker argument. OpenAI's `NineLinearObstruction.not_ramsey_of_det_ne_zero` then gives non-Ramsey. - **The converse.** If `cos θ` and `sin θ` are algebraic, all nine points have algebraic coordinates, and `ramsey_of_algebraic` (finite spherical sets with algebraic coordinates are Ramsey; prior work, see below) applies. ### Independence **This work trusts OpenAI's Lean proof of result 172.** OpenAI's 35 Lean files used here (the import closure, within their development, of this proof) are included and replayed by the kernels, but the classification is theirs, not re-proved. The files were ported to the Lean module system by header-only changes (a `module` line, `public import`, `@[expose] public section`, and an Apache-2.0 modification notice); no statement or proof line changed (`docs/PORT-LOG.md`). This project's own Lean (`RadianRamsey/`, 859 lines with comments) was ported the same way, with comment-only edits and the namespace `SphericalRamsey` renamed to `RadianRamsey`. ## Limitations - **No explicit transcendental `θ` in Lean.** The hypothesis `ht` holds for every `θ` outside a countable set (the algebraic numbers are countable and `θ ↦ tan(θ/2)` is injective on `(−π, π)`; by hand). The case `θ = 1` needs Lindemann–Weierstrass, which is not in Mathlib at this pin, so the corollary above is [HAND]. An explicit witness is available in principle (`θ = 2·arctan L` with `L` a Liouville number, via Mathlib's `Liouville.transcendental`), but it is not done. - **The `ℂ` form** `IsAlgebraic ℚ (Complex.exp (θ * I))` of the iff is not stated; the equivalence with "`cos θ` and `sin θ` are algebraic" is a one-line hand step. - **Normal form.** The points are stated on the unit circle about `0`, starting at `(1, 0)`. `Ramsey` is invariant under congruence, so the theorems cover every congruent copy (any centre, any starting angle); that step is by hand. - **Junk value of `tan`.** Mathlib's `Real.tan` is `sin / cos` with `x / 0 = 0`, so `tan(θ/2) = 0` at `θ ≡ π (mod 2π)`. There `ht` fails (0 is algebraic) and the nine points are not distinct, so the iffs do not apply either; the junk value never makes a statement wrong. - **Review.** No human expert has reviewed this work. The proofs and checks were produced by AI agents; see `DISCLOSURE.md`. ## Prior work - **OpenAI**, *A classification of finite Euclidean Ramsey configurations* (openai/math, commit `fd4aeeb2`, result 172): the foundation, and the Lean proof this one builds on. Their Proposition 7.6 is the generic case: nine points on a circle with algebraically independent parameters are not Ramsey. It does not apply directly to Theorem D, whose nine angles `kθ` all depend on one parameter; the Lean proof here mirrors their `EuclideanRamseyNine`. Their Proposition 7.7 (a 12-point three-squares set with a Liouville parameter, not Ramsey) and Corollary 7.5 (kites with a transcendental parameter, Ramsey) are earlier explicit examples with a transcendental parameter; Theorem D instead gives an iff for a whole one-parameter family. - **spherical-ramsey** v1.1.0 (Will Strinz, doi:10.5281/zenodo.23396387): the release this result comes from. Its note states Theorem D with a proof sketch (and the θ = 1 corollary and the sharpness remarks: eight consecutive multiples are Ramsey for every θ), and its rope AV3 is this proof at OpenAI's pin. - **mobius-ramsey** v1.0.0 (Will Strinz, doi:10.5281/zenodo.23339523): the sibling package, with the same port of OpenAI's files and the same check; Palomar entry PALOMAR-2026-10-14-000008. - **Algebraic coordinates ⇒ Ramsey**, used for the converse, is prior work: JD-Jones-ASES/six-concyclic-lean (Lean, criterion level, Ramsey conclusion conditional on a hypothesis `hsuff`), Rogerhu12/openai-math-extensions (TeX), and atimics/math2 (Lean, end to end for algebraic configurations with full affine span). `ramsey_of_algebraic` here is a further proof, not a first one. - **No prior statement of Theorem D was found** (`docs/PRIOR-WORK-SEARCH.md`). This is a search result, not a proof of novelty. ## Reproduce Full instructions, with the exact commands and expected output, are in `REPRODUCE.md`. In short, on Linux with [elan](https://github.com/leanprover/elan) on `PATH` (`export PATH="$HOME/.elan/bin:$PATH"`) and `bwrap` installed: ```sh python3 scripts/check-lean-sources.py # Palomar's source rules: exit 0 lake exe cache get # Mathlib's prebuilt files (about 5 GB) lake build # prints the axioms lines bash scripts/verify-comparator.sh # "Your solution is okay!" bash tests/controls/run-controls.sh # five "REFUSED as expected" lines ``` **Time and memory.** On a fresh GitHub runner with a cold cache the whole check took 21 minutes (build 3 minutes, Comparator 5.5, the five controls 5.4); on a loaded desktop machine allow much longer. Plan on **about 16 GB of RAM**. The build prints seven expected warnings, `declaration uses 'sorry'`, for the statement-only `Challenge.lean`, and two linter warnings (`This simp argument is unused`) in `RadianRamsey/AlgebraicRamsey.lean`; none is an error. ## Licence and citation This is a mixed tree. MIT (`LICENSE`) for this project's files. Apache-2.0 (`LICENSES/Apache-2.0.txt`) for OpenAI's files under `OAI/`, modified in their headers only (listed in `NOTICE` and `docs/PORT-LOG.md`), for the two adaptations of OpenAI's code that `NOTICE` lists, and for the two unmodified PalomarTemplate scripts under `scripts/`. `NOTICE` says which file is under which licence. Cite with `CITATION.cff`. ## Authorship Will Strinz is the sole human author. AI agents (Claude Opus 5.5 and Claude Sonnet 5.5, Anthropic) produced the proofs, the port, the checks and the documentation under his direction. `DISCLOSURE.md` says who did what and which reviews were AI reviews.