Skip to content

perf(RingTheory/LaurentSeries): add some instances#39186

Open
kbuzzard wants to merge 1 commit into
leanprover-community:masterfrom
kbuzzard:kbuzzard-laurent-series-typeclass-speedup
Open

perf(RingTheory/LaurentSeries): add some instances#39186
kbuzzard wants to merge 1 commit into
leanprover-community:masterfrom
kbuzzard:kbuzzard-laurent-series-typeclass-speedup

Conversation

@kbuzzard
Copy link
Copy Markdown
Member

@kbuzzard kbuzzard commented May 11, 2026

Typeclass inference was expensively failing at some point in LaurentSeries.valuation_compare without these instances.


Open in Gitpod

Discovered by getting Claude Code to edit Lean's typeclass inference algorithm and then compile lean and mathlib and see what breaks. Found out that typeclass inference is going down a big hole in this file; this fixes the hole.

@github-actions
Copy link
Copy Markdown

PR summary 48f66c0814

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ instance : Field (ratfuncAdicComplPkg (K := K).space)
+ instance : Valued (ratfuncAdicComplPkg (K := K).space) (WithZero (Multiplicative ℤ))

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.


No changes to strong technical debt.
No changes to weak technical debt.

@github-actions github-actions Bot added the t-ring-theory Ring theory label May 11, 2026
@kbuzzard
Copy link
Copy Markdown
Member Author

!radar

@leanprover-radar
Copy link
Copy Markdown

leanprover-radar commented May 11, 2026

Benchmark results for 2c0b10f against 48f66c0 are in. No significant results found. @kbuzzard

  • build//instructions: -46.7G (-0.03%)

Medium changes (1✅)

  • build/module/Mathlib.RingTheory.LaurentSeries//instructions: -31.5G (-12.44%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-ring-theory Ring theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants