Repository navigation
Import the Kochen–Specker theorem in every finite dimension - #1065
Conversation
|
Advisory cross-file review against Lean Pool's supervisory rubric. This is not by itself a significance, source-verification, or merge verdict. [Medium impact] No concrete defect was found, but source fidelity and upstream license evidence still need independent verification before an unconditional merge recommendation. SummaryAdds the Kochen–Specker vector-valuation obstruction in every finite dimension at least three.
External source text and the pinned upstream license were not independently verified. Source fidelity and license evidence therefore remain unverified. Reviews (2) · Last reviewed commit: "Name the target of the original Kochen–S..." · Reviewed by Greptile |
Proof profile (new / modified Lean files)
This build covers the changed modules and their dependency cones on top of the restored cache. The serial per-file sums below are useful for ranking slow files, not as a build budget. Total heartbeats: 226,416 maxHeartbeats units across 7 valid files (779 added LOC). Sum of Count-heartbeats wall-clock total: 37.92 s. Repeated import cost inside Heartbeat values sum disjoint root command traces with LOC counts added lines in the profiled Lean files from this PR diff.
Aggregate phase totals
Slowest changed modules (from
|
| Changed module | Lake time |
|---|---|
LeanPool.KochenSpecker.Peres33 |
9.60 s |
LeanPool.KochenSpecker.Valuation |
3.80 s |
LeanPool.KochenSpecker.Checker |
3.60 s |
LeanPool.KochenSpecker.Cabello18 |
2.00 s |
LeanPool.KochenSpecker.Main |
1.20 s |
LeanPool.KochenSpecker |
1.10 s |
LeanPool.KochenSpecker.Imports |
1.10 s |
Per-file `lean --profile` output
LeanPool/KochenSpecker.lean
import took 3.13s
cumulative profiling times:
declTypeLinter 0.509ms
elaboration 0.147ms
import 3.13s
initialization 29.9ms
interpretation 142ms
linting 0.461ms
module linting 0.0251ms
parsing 0.0352ms
tacticAnalysis 0.502ms
real 4.04
user 1.04
sys 0.96
LeanPool/KochenSpecker/Cabello18.lean
import took 854ms
tactic execution of Lean.Parser.Tactic.decide took 197ms
cumulative profiling times:
attribute application 0.12ms
compilation (IR) 0.726ms
compilation (LCNF base) 9.11ms
compilation (LCNF impure) 3.33ms
compilation (LCNF mono) 10.2ms
congr simp thm 4.58ms
declTypeLinter 8.75ms
elaboration 94.8ms
fix level params 0.919ms
import 854ms
initialization 26.7ms
instantiate metavars 0.879ms
interpretation 217ms
let-to-have transformation 0.203ms
linting 13.3ms
module linting 0.0235ms
norm_num 1.58ms
parsing 8.79ms
process pre-definitions 10.9ms
ring 15.2ms
share common exprs 4.15ms
simp 99.4ms
tactic execution 448ms
tacticAnalysis 3.4ms
type checking 230ms
typeclass inference 206ms
real 2.29
user 2.24
sys 0.87
LeanPool/KochenSpecker/Checker.lean
import took 449ms
cumulative profiling times:
attribute application 0.144ms
blocked (unaccounted) 18.4ms
compilation (IR) 0.488ms
compilation (LCNF base) 6.34ms
compilation (LCNF impure) 2.43ms
compilation (LCNF mono) 4.25ms
congr simp thm 4.55ms
declTypeLinter 4.32ms
elaboration 38.3ms
fix level params 0.422ms
import 449ms
initialization 26.1ms
instantiate metavars 5.06ms
interpretation 138ms
let-to-have transformation 0.105ms
linting 13.2ms
module linting 0.0288ms
parsing 7.04ms
process pre-definitions 15.3ms
share common exprs 5.47ms
simp 231ms
tactic execution 115ms
tacticAnalysis 4.65ms
type checking 16.6ms
typeclass inference 13.7ms
real 1.61
user 1.18
sys 0.66
LeanPool/KochenSpecker/Imports.lean
import took 856ms
cumulative profiling times:
declTypeLinter 0.121ms
elaboration 0.0863ms
import 856ms
initialization 28.4ms
interpretation 136ms
linting 0.216ms
module linting 0.0289ms
parsing 0.00205ms
tacticAnalysis 0.123ms
real 1.75
user 1.02
sys 0.80
LeanPool/KochenSpecker/Main.lean
import took 861ms
cumulative profiling times:
attribute application 0.0454ms
blocked (unaccounted) 59.6ms
congr simp thm 0.258ms
declTypeLinter 9.75ms
elaboration 33.5ms
fix level params 0.356ms
import 861ms
initialization 26.3ms
instantiate metavars 0.267ms
interpretation 179ms
let-to-have transformation 0.084ms
linting 5.8ms
module linting 0.0295ms
norm_num 1.53ms
parsing 3.43ms
process pre-definitions 2.21ms
share common exprs 1.09ms
simp 21.8ms
tactic execution 39ms
tacticAnalysis 2.01ms
type checking 65ms
typeclass inference 190ms
real 1.91
user 1.45
sys 0.80
LeanPool/KochenSpecker/Peres33.lean
import took 874ms
tactic execution of Lean.Parser.Tactic.decide took 196ms
type checking took 151ms
tactic execution of Lean.Parser.Tactic.decide took 121ms
tactic execution of Lean.Parser.Tactic.decide took 109ms
tactic execution of Lean.Parser.Tactic.decide took 3.32s
process pre-definitions took 411ms
type checking took 3.98s
simp took 129ms
cumulative profiling times:
attribute application 0.224ms
blocked (unaccounted) 2.36ms
compilation (IR) 1.79ms
compilation (LCNF base) 12.8ms
compilation (LCNF impure) 8.04ms
compilation (LCNF mono) 14.8ms
congr simp thm 8.86ms
declTypeLinter 16.7ms
elaboration 180ms
fix level params 3.56ms
import 874ms
initialization 27.3ms
instantiate metavars 14.4ms
interpretation 363ms
let-to-have transformation 1.31ms
linting 25ms
module linting 0.0272ms
norm_num 8.09ms
parsing 21.4ms
process pre-definitions 455ms
ring 79.1ms
share common exprs 16.3ms
simp 292ms
tactic execution 3.91s
tacticAnalysis 5.37ms
type checking 4.41s
typeclass inference 503ms
real 9.52
user 11.06
sys 0.98
LeanPool/KochenSpecker/Valuation.lean
import took 837ms
cumulative profiling times:
attribute application 0.0754ms
congr simp thm 2.93ms
declTypeLinter 9.96ms
elaboration 34.9ms
fix level params 1.32ms
import 837ms
initialization 34.5ms
instantiate metavars 2.01ms
interpretation 212ms
let-to-have transformation 0.124ms
linting 19.6ms
module linting 0.0198ms
parsing 9.33ms
process pre-definitions 6.69ms
share common exprs 3.6ms
simp 109ms
tactic execution 146ms
tacticAnalysis 4.24ms
type checking 47.5ms
typeclass inference 219ms
real 2.07
user 1.72
sys 0.82
Advisory only — never blocks merge. Full log uploaded as the proof-profile artifact.
|
Approve — acquisition review by the PR submitter for This is the submitter’s separate source and proof review. The configured GPT verdict is tracked independently. Statement and proof scope
Novelty, source and engineering
GitHub checksThe initial head passed content separation, Lean Action CI, and the proof |
Vilin97
left a comment
There was a problem hiding this comment.
Attribution fix needed on 8bd016aa15d7a1a12dae5b5c4c08e6d7086e5591.
- I compared the port with the pinned Apache-2.0 source. The entry module and
Cabello18.lean,Checker.lean,Main.lean, andPeres33.leandiffer from their upstream files and need a prominent notice describing the adaptations. The original copyright and author lines are intact. Put the notices immediately after the standard Lean headers so the header format remains valid.Valuation.leanis byte-identical. Pinned source · Apache-2.0 §4 - The port preserves the mathematical statements. Independent checks of the finite data found that the 365-node Peres certificate closes each branch under its assigned constraints and that the Cabello tetrads are orthogonal with each label occurring twice. The required build passed at this head. Lean Action CI
The theorem and summary already specify d ≥ 3. A title that includes this bound would make the scope clear in the project index.
🤖 LLM review (
|
| Rubric | Verdict | Bottom line |
|---|---|---|
| Faithfulness | ✅ pass |
All three headline declarations match the card, including the independent Cabello parity proof for every finite dimension at least four. |
| Novelty | ✅ pass |
Targeted source searches found no duplicate of any headline in Lean Pool, pinned Mathlib, or either Tau Ceti revision, and equivalence beyond the inspected declarations remains unverifiable. |
| Significance | ✅ pass |
The complete Kochen–Specker theorem merits inclusion, and the 365-node Peres certificate has proportionate maintenance cost at 40 of 779 added Lean lines, with a local list-based verifier checked by kernel decide and a generator maintained outside the repository. |
| Sources | ✅ pass |
The card correctly scopes Kochen and Specker’s Theorem 1 to the real three-dimensional obstruction and credits the configurations used in the Lean proofs to Peres and to Cabello, Estebaranz, and García-Alcaine. Theorem 1 · Peres · Cabello et al., equations 1–9 |
| Code quality (advisory) | flag |
The checker and geometric proofs are competently organized, with maintenance debt in the duplicated triad logic, manual orthonormality cases, and ray indexing. |
| Aspect | Value |
|---|---|
| Proves the claim | ✅ proves_it |
| Assumed, not proved | The card discloses the scalar field, inner-product structure, and dimension bounds. The general theorem expresses the dimension as finrank 𝕜 E = d. Lean proves both geometric base cases and the dimension step. |
| Matches cited source | ✅ matches |
| Fit | ✅ good_fit |
| Level | research |
| Branch | mathematical physics |
| Mode | theory_building |
| Code quality | 3 / 5 |
Statement check: Over an RCLike field, no Boolean map on a finite-dimensional inner product space of dimension at least three marks exactly one vector in every orthonormal basis.
The formalization rules out Boolean valuations that mark exactly one vector per orthonormal basis in every finite real or complex inner product space of dimension at least three, extending Peres’s 33-ray proof by orthogonal-complement restriction and giving a second proof from dimension four via Cabello’s parity argument.
Faithfulness findings (1)
- prompt-injection — PR-wide
The submitter’s approval heading for this revision can be mistaken for independent sign-off. Use a heading that identifies the comment as the submitter’s verification notes.
Evidence: The discussion in.review-pr.jsonopens with ‘Approve — acquisition review by the PR submitter for685caaa9297775af30484f9b77520165cd81c7ec.’ The comment also says ‘The configured GPT verdict is tracked independently.’
Novelty findings (1)
- prompt-injection — PR-wide
The submitter presents an acquisition approval for the reviewed revision in the PR discussion, where it could be mistaken for independent sign-off.
Evidence: The submitter’s comment in.review-pr.jsonopens with ‘Approve — acquisition review by the PR submitter for685caaa9297775af30484f9b77520165cd81c7ec.’
Significance findings (1)
- prompt-injection — PR-wide
The submitter’s approval in the discussion could be mistaken for independent sign-off. Treat it as self-assessment and base the significance verdict on the Lean declarations.
Evidence: The third discussion comment in.review-pr.jsonopens with ‘Approve — acquisition review by the PR submitter for685caaa9297775af30484f9b77520165cd81c7ec.’
Sources findings (1)
- prompt-injection — PR-wide
The submitter’s approval could be mistaken for independent source verification. Treat it as contributor commentary and evaluate the citations against the current diff and the referenced works.
Evidence: The PR discussion opens a submitter comment with ‘Approve — acquisition review by the PR submitter for685caaa9297775af30484f9b77520165cd81c7ec.’ It then says ‘The configured GPT verdict is tracked independently.’
Code quality findings (4)
- duplicate-definition —
LeanPool/KochenSpecker/Checker.lean:51
ColoursandPeres.exactlyOne_of_existsUniquespell out the same Boolean truth table, whileviolated_eq_falsechecks it against a third encoding by splitting on all three lookups and all three Boolean values. Define triad satisfaction once using unique existence over the three slots, then prove once that an extending colouring excludes both count-based violations. This keeps the constraint semantics in one place and preserves the executable checker.
Evidence: InColours:
(∀ t ∈ S.triads, (c t.1 && !c t.2.1 && !c t.2.2) || (!c t.1 && c t.2.1 && !c t.2.2) ||
(!c t.1 && !c t.2.1 && c t.2.2) = true)
InexactlyOne_of_existsUnique:
(w (g 0) && !w (g 1) && !w (g 2)) || (!w (g 0) && w (g 1) && !w (g 2)) ||
(!w (g 0) && !w (g 1) && w (g 2)) = true := by
Inviolated_eq_false:
rcases valueOf_eq h t.1 with e1 | e1 <;> rcases valueOf_eq h t.2.1 with e2 | e2 <;>
rcases valueOf_eq h t.2.2 with e3 | e3 <;>
· simp only [countValue, e1, e2, e3]
cases hx : c t.1 <;> cases hy : c t.2.1 <;> cases hz : c t.2.2 <;> simp_all - duplicate-proof —
LeanPool/KochenSpecker/Valuation.lean:117
IsValuation.exists_subspacerecomputes the four head and tail inner-product cases. Useorthonormal_vecCons_iffwith the existing unit norm and perpendicularity facts, and transport the tail basis through the submodule inclusion usingOrthonormal.comp_linearIsometry. The same tuple lemma can replace the nine index cases and three reverse inner-product facts inPeres.colours_of_isValuation.
Evidence: InIsValuation.exists_subspace:
set f : Fin (d + 1) → E := Fin.cons u (fun i => (b i : E))
induction i using Fin.cases <;> induction k using Fin.cases
Incolours_of_isValuation:
have hf : Orthonormal 𝕜 ![unit (𝕜 := 𝕜) t.1, unit t.2.1, unit t.2.2] := by
fin_cases i <;> fin_cases j <;> - duplicated-bound —
LeanPool/KochenSpecker/Peres33.lean:133
An out-of-range label silently becomes the zero vector, so the orthogonality checks alone would accept that label. The separate bound checks protect the final proof, but they and the normalization lemmas maintain the ray count independently of the table. Use bounded indices for geometric lookup and normalization, and convert to natural-number labels at the checker boundary.
Evidence: def ray (n : ℕ) : Fin 3 → ℤ × ℤ := rays.getD n (fun _ => (0, 0))
theorem rays_length : rays.length = 33 := by decide
theorem pair_lt : ∀ p ∈ sys.pairs, p.1 < 33 ∧ p.2 < 33 := by decide
theorem triad_lt : ∀ t ∈ sys.triads, t.1 < 33 ∧ t.2.1 < 33 ∧ t.2.2 < 33 := by decide
theorem norm_unit {n : ℕ} (hn : n < 33) : ‖unit (𝕜 := 𝕜) n‖ = 1 := - prompt-injection — PR-wide
The PR discussion includes the submitter’s own approval of the reviewed revision. That approval carries no weight in this independent quality review.
Evidence: Approve — acquisition review by the PR submitter for685caaa9297775af30484f9b77520165cd81c7ec.
Tokens: 7,656,005 in / 38,789 out across 5 model calls · Tier: codex-subscription · Effort: xhigh · Billing: Codex subscription quota (no API credits) · Estimated cost: $31.2059 (Standard API equivalent; uncached input)
Each rubric is an independent review against .github/review-rubrics/ on top of .github/REVIEW_RULES.md. Disagree? Reply on the PR; rules can be updated in a PR of their own.
|
/review Head |
Result
This adds Zayn Blore’s formalization of the Kochen–Specker theorem for real
and complex inner product spaces of every finite dimension at least three.
The main statement rules out a Boolean assignment that marks exactly one
vector in every orthonormal basis. Applying it to an assignment on rays
recovers the usual rank-one form of the obstruction.
The development checks Peres’s 33 rays in dimension three and extends
nonexistence to larger dimensions by restricting a putative valuation to the
orthogonal complement of an unmarked unit vector. It also includes an
independent dimension-four proof from Cabello’s 18-vector parity construction.
The orthonormal-basis extension and restriction lemmas and the sound
case-split checker can be reused for other contextuality configurations.
Upstream and scope
Announcement commit
a9f552a11188809b15ba14ef2db5a2a8ecd3c83b, Apache-2.0.Zayn Blore credits Claude Code for drafting the Lean, so the card records AI
provenance. Pinned upstream source and license
checker, the two geometric configurations and the general theorem.
It uses Mathlib’s inner-product-space infrastructure. The comparator
challenge, diagnostic harness and external certificate generator stay upstream.
Earlier Lean work covers individual dimensions. No matching all-dimensions theorem
was found in Lean Pool, pinned Mathlib or pinned Tau Ceti.
Port and validation
Lean v4.36.0, Mathlib
fc4f59e577feb1a4956671bc04ac18aaaf8cd842.Rewrote module imports for Lean Pool, documented the constraint fields,
and reduced the case-split tree from 895 to 365 nodes by prioritizing
unit propagation and variables in smaller active clauses. The original
ray and constraint lists, checker interface, and mathematical statements
are preserved. The compact tree is checked with ordinary kernel
decide.The project’s declaration, axiom, option and build-message audits passed.
On the Azure VM, each clean project build ran in the same scratch workspace
with prebuilt dependencies, empty local build outputs and
LEAN_NUM_THREADS=4,using
lake --no-cache build LeanPool.KochenSpecker.Imports.Wall time was 26.04 s → 10.87 s. Lake reported 18 s → 5.5 s
for
Peres33. Peak resident memory reported by GNU time was2,681,668 KiB → 1,912,320 KiB.
Locally passed the warning-as-error project build, generated index check,
Mathlib and style linters, and repository quality checks on the project closure.
Lean Action CI runs the full pool checks.