Commit Graph

5 Commits

Author SHA1 Message Date
claude-bot 5aa048593c Note goodman-1.6 dataset now fully elaborates (test push)
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vbLFFJiHSZqGZHEkjvG5x
2026-09-18 17:03:07 +00:00
claude-bot 79c728567a Fix 10 failing goodman-1.6 statements based on Lean compiler diagnostics
All 21 statements in datasets/goodman-1.6.jsonl now elaborate cleanly
(verified locally via check_statements.py, 11/21 passing before this
change). Fixes applied, one per failing id:

- goodman-1-6-7: single-binder existential-unique over a pair (qr : ZxZ)
  instead of the invalid two-binder 'exists unique' form.
- goodman-1-6-10: rewrote set-builder notation to the explicit
  {v | exists a b, v = ...} form.
- goodman-1-6-11: replaced 'let d := ... in ...' with the required
  semicolon form 'let d := ...; ...', and added the missing Nat-to-Int
  casts on d.
- goodman-1-6-17: added explicit Nat-to-Int coercions on the three
  divisibility relations.
- goodman-1-6-18: changed p from Z to N (Nat.Prime requires N), added
  casts, and replaced the nonexistent Int.Coprime with IsCoprime.
- goodman-1-6-19: changed p from Z to N and added the matching casts.
- goodman-1-6-20: changed p from Z to N, added casts, and fixed the
  quantifier structure so the prime-divides-product hypothesis is not
  nested inside the per-element forall.
- goodman-1-6-23: replaced the Fin n literal comparison 'j = 0' (which
  needs a NeZero instance) with 'j.val = 0'.
- goodman-1-6-24: replaced the invalid bare '(*)' operator section with
  '(fun x y => x * y)'-equivalent '(. * .)', and replaced the
  nonexistent GCD.gcd with an explicit existential statement of the gcd
  property (divides every element; every common divisor divides it).
- goodman-1-6-26: replaced the nonexistent Int.Coprime with IsCoprime.

Also corrected the three parallel hallucinated Mathlib refs in
textbook/goodman-1.6.definitions.json (Int.Coprime, GCD.gcd,
Int.PairwiseCoprime -> IsCoprime, null with notes, and
List.Pairwise IsCoprime respectively), since the Lean compiler confirms
none of the original names exist.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vbLFFJiHSZqGZHEkjvG5x
2026-09-18 16:50:34 +00:00
claude-bot f98cb41f72 Run textbook pipeline pilot on section 1.6 (Divisibility in the Integers)
Generated with formalize.py against Qwen (qwen-max via DashScope), then hand-fixed
before pushing, since these classes of bug pass elaboration but are still wrong and
check_statements.py can't catch them without running Lean:

- goodman-1-6-2 split into 4 separate theorems (1-6-2-a..d): the model's single
  merged statement had an operator-precedence bug (missing parens around an
  implicit right-associated AND after OR) that silently scoped 3 of the book's 4
  independent claims inside the wrong disjunct.
- goodman-1-6-1: dropped two vacuous "x + y : Nat is a Nat" clauses that confused
  Lean's type membership with set membership (element-of Nat on already-Nat-typed
  variables) and are automatically true by typing anyway.
- goodman-1-6-9: swapped Mathlib's pointwise Set multiplication (x * I, which needs
  'open scoped Pointwise' and is easy to get subtly wrong) for the equivalent
  elementwise statement.
- goodman-1-6-13: replaced a misuse of min (a 2-argument function) applied to a Set
  with Mathlib's IsLeast predicate, matching what "least element" means in
  Int.gcd's characterization.
- goodman-1-6-23: fixed Matrix index types (Fin n, not a bare Nat) and replaced an
  illegal literal '...' row with Matrix.vecMul; verified against the book's raw
  text that the n-by-n unimodular-matrix formulation is faithful, not a model
  invention.

textbook/goodman-1.6.raw.jsonl keeps the unedited model output for reference. The
remaining 13 statements are unedited and still need a real Lean elaboration pass
(check_statements.py) plus a provability run (lean-bench) on a Mathlib-backed
project -- neither ran here since this sandbox has no Lean.
2026-09-17 17:11:40 +00:00
claude-bot caedf2e6f4 Add textbook formalization pipeline (extract -> LLM formalize -> elaboration check -> library assembly)
- extract_section.py: slice a book section out of a pdftotext -layout dump and
  list its labeled Theorem/Proposition/Lemma/Corollary/Definition items.
- formalize.py: LLM-formalize a section into Lean 4 candidate statements
  (preferring Mathlib vocabulary) plus a definitions manifest.
- check_statements.py: elaboration-only sanity check against a real
  Mathlib-backed Lean project (must run outside the Cowork sandbox, which has
  no Lean toolchain and can't run macOS binaries anyway).
- build_library.py: assemble solved lean-bench results into a reusable .lean
  file, reusing each winning proof verbatim.
- llm.py: standalone OpenAI-compatible chat client + .env loader, kept
  independent of lean_agent so this pipeline works without it installed.
- Source PDFs and raw/layout text dumps are gitignored (copyrighted material);
  only code and the final short Lean statement datasets are tracked.
2026-09-17 17:04:19 +00:00
codex-bot 99638be637 Implement provider-neutral Lean reasoning and evaluation foundation 2026-09-15 19:15:05 +08:00