Skip to content

Commit b1f162c

Browse files
fluffy314cursoragent
authored andcommitted
feat(autoresearch): seed sourced RH strategy tournament
Bind three user-authorized RH criteria to independent host plans, selecting only a Lean-validated Jensen quadratic subgoal while preserving Li and Weil blockers as planning-only evidence. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 7e34d49 commit b1f162c

4 files changed

Lines changed: 711 additions & 0 deletions

File tree

KakeyaLeanGate/RHJensen.lean

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import Mathlib
2+
3+
/-!
4+
A small, target-supporting Jensen-polynomial lemma.
5+
6+
This file does not define the Riemann xi function and does not claim any
7+
finite computation proves the Riemann Hypothesis. It only validates the
8+
quadratic formula for the degree-two Jensen polynomial attached to an
9+
arbitrary real coefficient sequence.
10+
-/
11+
12+
def jensenQuadratic (a : ℕ → ℝ) (n : ℕ) (x : ℝ) : ℝ :=
13+
a n + 2 * a (n + 1) * x + a (n + 2) * x ^ 2
14+
15+
theorem jensenQuadratic_has_two_real_roots
16+
(a : ℕ → ℝ) (n : ℕ)
17+
(hc : a (n + 2) ≠ 0)
18+
(hdisc : 0 ≤ a (n + 1) ^ 2 - a n * a (n + 2)) :
19+
jensenQuadratic a n
20+
((-a (n + 1) + Real.sqrt
21+
(a (n + 1) ^ 2 - a n * a (n + 2))) / a (n + 2)) = 0
22+
jensenQuadratic a n
23+
((-a (n + 1) - Real.sqrt
24+
(a (n + 1) ^ 2 - a n * a (n + 2))) / a (n + 2)) = 0 := by
25+
have hsqrt :
26+
(Real.sqrt (a (n + 1) ^ 2 - a n * a (n + 2))) ^ 2 =
27+
a (n + 1) ^ 2 - a n * a (n + 2) :=
28+
Real.sq_sqrt hdisc
29+
constructor <;>
30+
simp only [jensenQuadratic] <;>
31+
field_simp <;>
32+
nlinarith
Lines changed: 294 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,294 @@
1+
"""Host-owned, sourced Strategy seeds for the canonical RH root.
2+
3+
The records in this module are plans and proof obligations, not proof claims.
4+
In particular, finite coefficient or polynomial checks never prove RH.
5+
"""
6+
from __future__ import annotations
7+
8+
import hashlib
9+
import json
10+
from dataclasses import asdict, dataclass
11+
from pathlib import Path
12+
13+
from autoresearch.prefill.strategy_tournament import (
14+
LemmaNode,
15+
PlanClass,
16+
PlanExecutionStatus,
17+
StrategyPlan,
18+
)
19+
from autoresearch.prefill.theorem_cards import pinned_environment_hash
20+
21+
22+
RH_ROOT_ID = "RH-C0-7024d428ede1"
23+
RH_ROOT_HASH = (
24+
"7024d428ede1c873b201a0801e42593ab9afd4e632c16c492678886797602547"
25+
)
26+
FINITE_WARNING = (
27+
"Finite computations, finite coefficient positivity, and finitely many "
28+
"hyperbolic Jensen polynomials do not prove the Riemann Hypothesis."
29+
)
30+
31+
32+
def _digest(value: object) -> str:
33+
return hashlib.sha256(json.dumps(
34+
value, ensure_ascii=False, sort_keys=True, separators=(",", ":"),
35+
).encode()).hexdigest()
36+
37+
38+
@dataclass(frozen=True)
39+
class RHStrategySpec:
40+
route_id: str
41+
title: str
42+
relation_to_rh: str
43+
relation_source: str
44+
relation_obligation: str
45+
definitions: tuple[str, ...]
46+
first_subgoal: str
47+
first_subgoal_theorem: str
48+
theorem_cards: tuple[str, ...]
49+
dependencies: tuple[str, ...]
50+
mathlib_support: tuple[str, ...]
51+
missing_interfaces: tuple[str, ...]
52+
success_criterion: str
53+
falsification_criterion: str
54+
abandonment_criterion: str
55+
execution_status: str
56+
finite_warning: str = FINITE_WARNING
57+
58+
@property
59+
def content_hash(self) -> str:
60+
return _digest(asdict(self))
61+
62+
63+
def rh_strategy_specs() -> tuple[RHStrategySpec, ...]:
64+
return (
65+
RHStrategySpec(
66+
route_id="JENSEN_LAGUERRE_POLYA",
67+
title="Jensen polynomials / Laguerre-Pólya approximation",
68+
relation_to_rh="EQUIVALENT_WITH_UNPROVED_FORMAL_BRIDGE",
69+
relation_source="doi:10.1073/pnas.1902572116",
70+
relation_obligation=(
71+
"Define the classical completed xi function and its centered "
72+
"Taylor coefficients; prove that their all-degree/all-shift "
73+
"Jensen hyperbolicity criterion is equivalent to pinned "
74+
"Mathlib RiemannHypothesis. Keep coefficient/Jensen "
75+
"approximation distinct from zero-product approximation."
76+
),
77+
definitions=(
78+
"jensenQuadratic", "Real.sqrt",
79+
"completedRiemannZeta", "completedRiemannZeta₀",
80+
),
81+
first_subgoal=(
82+
"For arbitrary real coefficients, validate the two explicit "
83+
"real roots of the degree-two Jensen polynomial under the "
84+
"nonnegative Turán discriminant condition."
85+
),
86+
first_subgoal_theorem="jensenQuadratic_has_two_real_roots",
87+
theorem_cards=("rh-jensen-quadratic-two-roots",),
88+
dependencies=("KakeyaLeanGate/RHJensen.lean",),
89+
mathlib_support=(
90+
"completedRiemannZeta", "completedRiemannZeta₀",
91+
"differentiable_completedZeta₀", "Real.sq_sqrt",
92+
"Polynomial.IsRoot", "Polynomial.discr",
93+
),
94+
missing_interfaces=(
95+
"RIEMANN_XI_NORMALIZATION",
96+
"XI_CENTERED_TAYLOR_COEFFICIENTS",
97+
"JENSEN_HYPERBOLIC_ALL_DEGREES_SHIFTS",
98+
"LAGUERRE_POLYA_CLASS_AND_LIMIT_BRIDGE",
99+
"JENSEN_CRITERION_IFF_MATHLIB_RH",
100+
),
101+
success_criterion=(
102+
"Lean accepts the generic quadratic root theorem; later work "
103+
"must separately discharge every xi/Jensen/RH bridge."
104+
),
105+
falsification_criterion=(
106+
"Lean rejects the coefficient convention or root formula, or "
107+
"a sourced xi normalization cannot be related to Mathlib."
108+
),
109+
abandonment_criterion=(
110+
"Abandon as an RH route if the all-degree/all-shift equivalence "
111+
"cannot be sourced and formalized non-circularly."
112+
),
113+
execution_status=PlanExecutionStatus.EXECUTABLE.value,
114+
),
115+
RHStrategySpec(
116+
route_id="LI_COEFFICIENT_POSITIVITY",
117+
title="Li coefficients positivity criterion",
118+
relation_to_rh="EQUIVALENT_SOURCE_ONLY",
119+
relation_source="doi:10.1006/jnth.1997.2137",
120+
relation_obligation=(
121+
"Define Li's lambda_n from a sourced xi normalization, prove "
122+
"well-defined derivatives/zero sums, and formalize positivity "
123+
"for every n iff pinned Mathlib RiemannHypothesis."
124+
),
125+
definitions=(
126+
"LI_COEFFICIENT", "RIEMANN_XI_NORMALIZATION",
127+
"ITERATED_COMPLEX_DERIVATIVE_AT_ONE",
128+
),
129+
first_subgoal=(
130+
"Elaborate a definition of lambda_n with the exact normalization "
131+
"from Li (1997), then prove the derivative expression is typed."
132+
),
133+
first_subgoal_theorem="",
134+
theorem_cards=("source-li-criterion-1997",),
135+
dependencies=("doi:10.1006/jnth.1997.2137",),
136+
mathlib_support=(
137+
"completedRiemannZeta", "completedRiemannZeta₀",
138+
"differentiable_completedZeta₀",
139+
),
140+
missing_interfaces=(
141+
"RIEMANN_XI_NORMALIZATION", "LI_COEFFICIENT",
142+
"LI_POSITIVITY_ALL_N_IFF_MATHLIB_RH",
143+
),
144+
success_criterion=(
145+
"A sourced lambda_n definition elaborates and the all-n "
146+
"equivalence obligation is represented without assuming RH."
147+
),
148+
falsification_criterion=(
149+
"Normalization or convergence hypotheses cannot be matched to "
150+
"Mathlib's completed zeta declarations."
151+
),
152+
abandonment_criterion=(
153+
"Remain planning-only until the xi and all-n equivalence "
154+
"interfaces are sourced and Lean-elaborated."
155+
),
156+
execution_status=PlanExecutionStatus.PLANNING_ONLY.value,
157+
),
158+
RHStrategySpec(
159+
route_id="WEIL_POSITIVE_QUADRATIC_FORM",
160+
title="Positive kernel / energy functional criterion",
161+
relation_to_rh="EQUIVALENT_SOURCE_ONLY",
162+
relation_source=(
163+
"A. Weil, Sur les formules explicites de la théorie des "
164+
"nombres premiers (1952)"
165+
),
166+
relation_obligation=(
167+
"Formalize Weil's exact explicit-formula quadratic functional "
168+
"Q_W(g)=W(g*g*) on the sourced admissible test-function domain, "
169+
"and prove positive semidefiniteness on that domain iff pinned "
170+
"Mathlib RiemannHypothesis."
171+
),
172+
definitions=(
173+
"WEIL_TEST_FUNCTION_DOMAIN", "MULTIPLICATIVE_CONVOLUTION",
174+
"TRANSPOSE_CONJUGATE", "WEIL_EXPLICIT_FORMULA_FUNCTIONAL",
175+
),
176+
first_subgoal=(
177+
"Define the exact test-function domain and involution/convolution "
178+
"interfaces, then type the Hermitian quadratic form Q_W."
179+
),
180+
first_subgoal_theorem="",
181+
theorem_cards=("source-weil-positivity-1952",),
182+
dependencies=(
183+
"Weil-1952-explicit-formula",
184+
"Guinand-Weil-explicit-formula",
185+
),
186+
mathlib_support=(
187+
"ContinuousMap", "MeasureTheory.Integral",
188+
"Convolution", "starRingEnd",
189+
),
190+
missing_interfaces=(
191+
"WEIL_TEST_FUNCTION_DOMAIN",
192+
"WEIL_EXPLICIT_FORMULA_FUNCTIONAL",
193+
"WEIL_POSITIVITY_IFF_MATHLIB_RH",
194+
),
195+
success_criterion=(
196+
"The sourced domain and exact Q_W elaborate, with the RH "
197+
"implication/equivalence retained as an explicit obligation."
198+
),
199+
falsification_criterion=(
200+
"Any proposed kernel lacks the sourced explicit-formula identity "
201+
"or changes the admissible positivity domain."
202+
),
203+
abandonment_criterion=(
204+
"Reject generic positivity searches; remain planning-only until "
205+
"one exact sourced kernel/form/domain is formalized."
206+
),
207+
execution_status=PlanExecutionStatus.PLANNING_ONLY.value,
208+
),
209+
)
210+
211+
212+
def build_rh_strategy_plans(project_root: Path) -> tuple[StrategyPlan, ...]:
213+
environment = pinned_environment_hash(project_root)
214+
plans = []
215+
for index, spec in enumerate(rh_strategy_specs(), 1):
216+
target_ref = (
217+
"lean:" + spec.first_subgoal_theorem
218+
if spec.execution_status == PlanExecutionStatus.EXECUTABLE.value
219+
else "planning:" + spec.route_id
220+
)
221+
unresolved = (
222+
() if spec.execution_status == PlanExecutionStatus.EXECUTABLE.value
223+
else spec.missing_interfaces
224+
)
225+
dependency_ids = spec.dependencies
226+
target_complexity = 20 + index
227+
definition_auditor_hash = hashlib.sha256(
228+
b"host-rh-strategy-seed-v1"
229+
).hexdigest()
230+
body = {
231+
"schema_version": 1,
232+
"seed_hash": spec.content_hash,
233+
"plan_class": PlanClass.REDUCTION_TO_KNOWN_RESULT.value,
234+
"target_ref": target_ref,
235+
"required_definition_ids": spec.definitions,
236+
"theorem_card_ids": spec.theorem_cards,
237+
"dependency_ids": dependency_ids,
238+
"falsification_test_id": "FALSIFY_" + spec.route_id,
239+
"success_criterion_id": "SUCCESS_" + spec.route_id,
240+
"abandonment_criterion_id": "ABANDON_" + spec.route_id,
241+
"parent_obligation_ref": RH_ROOT_ID,
242+
"parent_complexity": 100,
243+
"target_complexity": target_complexity,
244+
"source_move_id": "MOVE_REDUCE_" + spec.route_id,
245+
"environment_hash": environment,
246+
"evidence_refs": (
247+
spec.relation_source, "mathlib:" + environment,
248+
"seed:" + spec.content_hash,
249+
),
250+
"unresolved_definition_ids": unresolved,
251+
"definition_gap_ids": tuple("gap:" + item for item in unresolved),
252+
"definition_auditor_hash": definition_auditor_hash,
253+
"execution_status": spec.execution_status,
254+
"restriction_ids": ("FINITE_COMPUTATION_DOES_NOT_PROVE_RH",),
255+
}
256+
content_hash = _digest(body)
257+
plans.append(StrategyPlan(
258+
plan_id="RHSP-" + content_hash[:20],
259+
plan_class=PlanClass.REDUCTION_TO_KNOWN_RESULT.value,
260+
target_ref=target_ref,
261+
required_definition_ids=spec.definitions,
262+
theorem_card_ids=spec.theorem_cards,
263+
dependency_ids=dependency_ids,
264+
lemma_graph=(LemmaNode(
265+
lemma_id="RHL-" + content_hash[:16],
266+
dependency_ids=dependency_ids,
267+
target_ref=target_ref,
268+
complexity=target_complexity,
269+
),),
270+
falsification_test_id="FALSIFY_" + spec.route_id,
271+
success_criterion_id="SUCCESS_" + spec.route_id,
272+
abandonment_criterion_id="ABANDON_" + spec.route_id,
273+
expected_information_gain=6 - index,
274+
assumption_ids=(),
275+
restriction_ids=("FINITE_COMPUTATION_DOES_NOT_PROVE_RH",),
276+
parent_obligation_ref=RH_ROOT_ID,
277+
parent_complexity=100,
278+
target_complexity=target_complexity,
279+
risk=index,
280+
source_move_id="MOVE_REDUCE_" + spec.route_id,
281+
environment_hash=environment,
282+
evidence_refs=(
283+
spec.relation_source, "mathlib:" + environment,
284+
"seed:" + spec.content_hash,
285+
),
286+
unresolved_definition_ids=unresolved,
287+
definition_gap_ids=tuple("gap:" + item for item in unresolved),
288+
definition_auditor_hash=definition_auditor_hash,
289+
proposition_transformation_ref="",
290+
case_partition_ids=(),
291+
execution_status=spec.execution_status,
292+
content_hash=content_hash,
293+
))
294+
return tuple(plans)

0 commit comments

Comments
 (0)