Skip to content

docs(fields): update KoalaBear replay notes for Lean 4.36 - #423

Merged
alexanderlhicks merged 1 commit into
mainfrom
docs/rabin-replay-lean-4-36
Nov 20, 2026
Merged

alexanderlhicks merged 1 commit into
mainfrom
docs/rabin-replay-lean-4-36

Conversation

@alexanderlhicks

Copy link
Copy Markdown
Collaborator

Follow-up to #396. The original KoalaBear quintic and sextic proofs hit the kernel's recursion limit during full dependency replay on Lean and Mathlib 4.34. On Lean and Mathlib 4.36, both the original and explicit proofs passed replay into an empty kernel environment.

The wiki records the 4.34 behavior and the removal of Polynomial.instAdd in Mathlib 4.36. The theorem docstrings point to that history. The agent guide and extension recipe drop the blanket requirement to spell out the carrier and instances.

Validation

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

🤖 PR Summary

Documentation Updates (PR #397)

This PR updates documentation and docstrings to reflect changes in Lean/Mathlib 4.36, specifically regarding kernel replay behavior for KoalaBear field irreducibility proofs. No definitions, theorems, instances, or structures are added, removed, or changed; no sorry or admit placeholders are introduced.

Mathematical Formalization

  • KoalaBear quintic and sextic irreducibility proofs (CompPoly/Fields/KoalaBear/Ext5/QuinticIrreducible.lean, CompPoly/Fields/KoalaBear/Ext6/SexticIrreducible.lean): Docstrings for quinticPoly_irreducible and sexticPoly_irreducible are updated to reference docs/wiki/field-extensions.md for replay history, replacing previous detailed explanations of kernel recursion limit workarounds needed on Lean/Mathlib 4.34. Both proof forms (original and explicit) now pass replay on Lean/Mathlib 4.36.

Documentation

  • docs/wiki/field-extensions.md (docs/wiki/field-extensions.md): Substantially revised to:

    • Replace detailed discussion of Fintype.card F-only variant with a concise description of the Eq.mpr transport kernel recursion issue.
    • Emphasize that numeral parameters allow concrete callers to pass certificates directly.
    • Add new section "KoalaBear replay history" documenting that:
    • Update degree-six irreducibility proof guidance: no longer warns against refine or named-argument respelling for KoalaBear.Field abbreviation (both build and pass replay). Instruction simplified to reference KoalaBear examples.
  • CompPoly/Data/Polynomial/Rabin.lean (CompPoly/Data/Polynomial/Rabin.lean): Design-justification comment for factPrimeRingChar lemma's numeral parameter is shortened. Removes discussion of why compiling the defining module did not expose the problem; explicitly names documentation (docs/wiki/field-extensions.md) and helper file (CompPoly/Data/Polynomial/RabinCertificate.lean) for history and concrete tests.

  • AGENTS.md (AGENTS.md): Removes guidance (approximately three sentences) that instructed contributors to apply Rabin criterion at carrier-and-instances used by certificate lemmas, with a warning about lake build unreliability inside module due to opaque Mathlib bodies. Deletion streamlines agent workflow documentation by removing deployment-specific caveat no longer considered necessary.

Infrastructure / CI


Statistics

Metric Count
📝 Files Changed 5
✅ Lines Added 33
❌ Lines Removed 45

Lean Declarations

  • No declarations were added, removed, or affected.

sorry Tracking

  • No sorrys were added, removed, or affected.

📋 **Additional Analysis**

No findings.


📄 **Per-File Summaries**
  • AGENTS.md: The diff removes a block of guidance (roughly three sentences) from AGENTS.md that instructed contributors to apply a Rabin criterion at exactly the carrier and instances used by its certificate lemmas, and warned that lake build inside a module is unreliable because unexposed Mathlib bodies like Polynomial.instAdd become opaque, so a mismatch might only surface during full-closure replay. The deletion streamlines the agent workflow documentation by eliminating a deployment-specific caveat that is no longer considered necessary for orientation-level advice.
  • CompPoly/Data/Polynomial/Rabin.lean: The diff replaces a lengthy design-justification comment for the factPrimeRingChar lemma's numeral parameter with a shorter one. The new comment still warns that stating the field-size condition at Fintype.card F would force concrete callers to rewrite it with hcard, leaving an Eq.mpr transport around a certificate whose large exponent could cause the kernel to unfold npowRec step by step until the recursion limit. It removes the discussion of why compiling the defining module did not expose the problem, and instead explicitly names the document (docs/wiki/field-extensions.md) and the helper file (CompPoly/Data/Polynomial/RabinCertificate.lean) that record the history and package the concrete tests. No definitions, theorems, instances, or structures were added, removed, or changed; no sorry or admit appears in the diff.
  • CompPoly/Fields/KoalaBear/Ext5/QuinticIrreducible.lean: The docstring of quinticPoly_irreducible was updated: the previous explanation referencing sexticPoly_irreducible was replaced with a pointer to docs/wiki/field-extensions.md for KoalaBear replay history. No code or theorem signature was changed.
  • CompPoly/Fields/KoalaBear/Ext6/SexticIrreducible.lean: The docstring for sexticPoly_irreducible was rewritten: it removes the detailed explanation of why explicit @ application was previously necessary for kernel exposure at recursion limits, and now states that both proof forms pass with Lean and Mathlib 4.36, referencing docs/wiki/field-extensions.md for the replay history.
  • docs/wiki/field-extensions.md: The diff updates the 'field-extensions.md' documentation to reflect recent kernel replay findings and changes in Mathlib 4.36. It replaces a detailed explanation of why a Fintype.card F-only variant is avoided with a shorter description focusing on the practical issue (the Eq.mpr transport causing kernel recursion), and emphasizes that the numeral parameter allows concrete callers to pass certificates directly. A new subsection 'KoalaBear replay history' is added, recounting that on Lean/Mathlib 4.34, the original proofs hit the kernel recursion limit during full dependency replay due to Polynomial.instAdd body exposure, which was resolved by PR fix(fields): make the KoalaBear Rabin certificates replay-safe #396, and that on Mathlib 4.36, where Polynomial became an abbreviation for AddMonoidAlgebra ℕ, the proofs pass replay cleanly. The guidance for assembling degree-six irreducibility proofs is updated: it no longer warns against using refine or respelling with named arguments for the KoalaBear.Field abbreviation (since both build and pass replay), and is trimmed to a simpler instruction referring to the KoalaBear examples.

Last updated: 2026-11-20 00:10 UTC.

@github-actions

Copy link
Copy Markdown
Contributor

Build Timing Report

  • Commit: 7395473
  • Message: Merge 8be9d29 into 728227c
  • Ref: docs/rabin-replay-lean-4-36
  • Comparison baseline: 728227c from merge-base on main.
  • Measured on ubuntu-latest with /usr/bin/time -p.
  • Commands: library build (warm) lake build; test path lake test.
  • Clean build was skipped (warm/incremental CI; no toolchain or lake-manifest change). Runs automatically when lean-toolchain or lake-manifest.json changes, or via Actions → Lean Action CI → Run workflow with clean_build.
Measurement Baseline (s) Current (s) Delta (s) Status
Library build (warm) 1.96 4.34 +2.38 ok
Test path 1.90 1.21 -0.69 ok

Incremental Rebuild Signal

  • Warm-only run: default CI reuses cached oleans and rebuilds dirty modules only. No same-job clean:warm ratio.

Slowest Current Build Files (warm library build)

Showing 3 slowest of 3 repo targets parsed from the current warm library build log.

Wall (s) Path
2.30 CompPoly/Fields/KoalaBear/Ext5/QuinticIrreducible.lean
1.10 CompPoly/Fields/KoalaBear/Ext6/SexticIrreducible.lean
0.95 CompPoly/Data/Polynomial/Rabin.lean

@alexanderlhicks
alexanderlhicks merged commit 88d85f0 into main Nov 20, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant