Command run, without --lean:
./venv/bin/python -m mathdoc_agent.pipeline \
results/homogeneous.md \
--id homogeneous \
-o results/homogeneous.jsonThe command used the live OpenAI agent path with OPENAI_API_KEY present in the
environment. No fake agents were used. I did not run Lean or the pipeline
--lean path.
Generated file:
results/homogeneous.json
The generated JSON is syntactically valid. Top-level structural counts in the output:
definition: 8theorem: 49, including nested local theorem nodesproof: 57assert_statement: 192let_statement: 37assume_statement: 15construction_proof: 8existence_proof: 1induction_proof: 1bi-implication_cases_proof: 1- objects still containing
deduced_from_claim: 83 specializesteps inserted by the final rewrite pass: 0- opaque proof nodes: 1
-
Initial run hung in a live calculation-agent call.
The first real run stalled for several minutes at:
homogeneous.root.lemma-2.proof.root.base-n-0The Python runner had no per-agent timeout, so one slow or stuck live API call could block the whole pipeline indefinitely.
Fix applied:
mathdoc_agent/mathagents/runner.pynow wraps live agent calls inasyncio.wait_for, with default timeout180seconds and optional override byMATHDOC_AGENT_AGENT_TIMEOUT_SECONDS. The proof orchestrator already catches handler exceptions and marks only the failed proof node opaque, so the pipeline can continue. -
Rerun completed, with one timeout converted to an opaque subproof.
The rerun completed and wrote
results/homogeneous.json. One calculation subproof timed out after the new 180 second bound:homogeneous.root.lemma13.proof.root.real_scalar_multiplication.independenceIn the JSON this appears as one
status: "opaque"node at:/document/body/29/proof/verification/proof_steps/4/verification/proof_steps/4This is now a controlled Python-side degradation instead of a pipeline hang.
-
The
deduced_from_claimrewrite pass ran but left many dependencies.The final
Deduced-from-claim rewriteragent ran successfully, followed by the claim auditor. However, 83 objects still containdeduced_from_claim. These are mostly local algebraic dependencies such as:z = y * x * y^{-1} l(x^n) = n * l(x) f(r,s)=l(x^r c^s)PaperCodes does not consume
deduced_from_claimdirectly, so these remaining fields are metadata rather than proof instructions. This is not a Python exception, but it is a codegen risk: if those dependencies are actually needed to prove an assertion, they should become explicit priorassert_statement,specialize, or localtheoremsteps.
-
Definitions are still natural-language commands.
The output now has Lean-style definition names such as
PseudoLength,IsHomogeneousPseudoLength,commutator,commutatorSubgroup,abelianization, andtorsionSubgroup. This is better than the earlier prose names.The
definitionstrings are still prose, for example:Let G be a group ... A function l : G -> R is a pseudo-length function ...LeanAideCore/LeanAideCore/PaperCodes.leanhandlesdefinitionby sending the string totranslateDefCmdM?, and on failure tries a propositionThere exists {name} such that ...usingtranslateToPropStrict. Both paths may fail or generate noncanonical Lean declarations for these mathematical structure definitions. -
Most theorem and assertion claims still rely on translation from prose.
assert_statementinLeanAideCore/LeanAideCore/PaperCodes.leanignoresdeduced_from_claimanddeduced_from_theorem; it only translates theclaimfield and then calls automation. This affects 192 generatedassert_statementobjects.Examples likely to be difficult:
f(0,n) <= the expectation of f(M_{2n}, K_{2n}) E(S2n^2) = 2n E[f(S_{2n},-S_{2n}/2)] <= E(|S_{2n}|)(l(x)+l(c)/2)The probability/random-variable part remains the highest-risk section.
-
deduced_from_theorem/lean_nameis not used byassert_statement.The generated JSON contains many
deduced_from_theoremobjects withlean_name, but PaperCodes has a separateresults_usedmechanism viagetResultUsed?, expectingtarget_identifier,mathlib_identifier, orstatement.Unless another layer maps
deduced_from_theoremtoresults_used, the Lean codegen path will not directly use the LeanSearch names. -
construction_prooffields are more identifier-like, but constructions are still prose.The generated construction variable names are now Lean-style identifiers; no bad construction variable names were found by a simple identifier check.
The construction strings are still not Lean terms:
normQ(a/n) := p(a)/n for a in A and n a positive integer completionB := the metric completion of W=VQ/N, where N={v in VQ | normQ(v)=0} scalarMul(alpha, b) := lim_i q_i w_i, where ... iota := the canonical composite VQ -> VQ/N -> BLeanAide/PaperCodes.leanrequiresconstruction_proofto translatefull_claim, then synthesize an existence proof fromvariable_name,construction, andverification. Long prose constructions are likely to fail or produce brittle generated terms. -
The new
specializecodegen hook is available but unused in this output.LeanAideCore/LeanAideCore/PaperCodes.leannow has aspecializehandler that emits a non-destructivehave name := lean_termform. The JSON from this run contains nospecializesteps, so none of the remainingdeduced_from_claimdependencies were converted into explicit instantiations. -
One opaque subproof will not provide proof content.
The timed-out node under the real scalar multiplication construction is exported as
opaque. Any Lean-side codegen path that expects a proof for that nested verification will either need to tolerate opacity or fail when trying to use that verification.
/document/body/19and/document/body/20: probabilistic lemmas with Rademacher variables, expectations, andS_{2n}notation./document/body/21: proof of commutator vanishing depends on probabilistic estimates and expectation bounds./document/body/28: construction ofnormQonA tensor_Z Q; fraction representation and quotient-style notation are encoded as prose./document/body/29: construction of the Banach space completion and real scalar multiplication; contains the one opaque timed-out subproof./document/body/31and/document/body/33: representation theorem and converse construction still use norm notation such as||phi(g)||_Band tensor-space prose.
After fixing the Python timeout issue, these checks passed:
./venv/bin/python -m py_compile mathdoc_agent/mathagents/runner.py
./venv/bin/python -m unittest \
mathdoc_agent.tests.test_leansearch \
mathdoc_agent.tests.test_handlers_and_orchestration
./venv/bin/python -m unittest mathdoc_agent.tests.test_pipelineThe final pipeline rerun completed successfully without Lean.