chore: test fast_instance% everywhere#39780
Conversation
riccardobrasca
commented
May 24, 2026
PR summary 3eb8c21d31
|
| File | Base Count | Head Count | Change |
|---|---|---|---|
| Mathlib.Logic.Equiv.Defs | 117 | 118 | +1 (+0.85%) |
| Mathlib.Algebra.Group.ULift | 134 | 135 | +1 (+0.75%) |
| Mathlib.Algebra.GroupWithZero.ULift | 141 | 142 | +1 (+0.71%) |
| Mathlib.Data.ULift | 145 | 146 | +1 (+0.69%) |
| Mathlib.Logic.Embedding.Basic | 149 | 150 | +1 (+0.67%) |
| Mathlib.SetTheory.Cardinal.Defs | 149 | 150 | +1 (+0.67%) |
| Mathlib.Control.ULiftable | 295 | 296 | +1 (+0.34%) |
Import changes for all files
| Files | Import difference |
|---|---|
145 filesMathlib.Algebra.AddTorsor.Defs Mathlib.Algebra.Divisibility.Prod Mathlib.Algebra.Field.Equiv Mathlib.Algebra.FreeMonoid.Basic Mathlib.Algebra.FreeMonoid.Count Mathlib.Algebra.Free Mathlib.Algebra.Group.Action.Basic Mathlib.Algebra.Group.Action.Defs Mathlib.Algebra.Group.Action.Faithful Mathlib.Algebra.Group.Action.Hom Mathlib.Algebra.Group.Action.Opposite Mathlib.Algebra.Group.Action.Option Mathlib.Algebra.Group.Action.Pretransitive Mathlib.Algebra.Group.Action.Prod Mathlib.Algebra.Group.Action.Sigma Mathlib.Algebra.Group.Action.Sum Mathlib.Algebra.Group.Action.TypeTags Mathlib.Algebra.Group.Action.Units Mathlib.Algebra.Group.Embedding Mathlib.Algebra.Group.Equiv.Basic Mathlib.Algebra.Group.Equiv.Defs Mathlib.Algebra.Group.Equiv.Opposite Mathlib.Algebra.Group.Equiv.TypeTags Mathlib.Algebra.Group.Even Mathlib.Algebra.Group.Int.Even Mathlib.Algebra.Group.Int.TypeTags Mathlib.Algebra.Group.Invertible.Basic Mathlib.Algebra.Group.Irreducible.Lemmas Mathlib.Algebra.Group.Nat.Even Mathlib.Algebra.Group.Nat.Hom Mathlib.Algebra.Group.Nat.TypeTags Mathlib.Algebra.Group.Opposite Mathlib.Algebra.Group.Pi.Units Mathlib.Algebra.Group.Prod Mathlib.Algebra.Group.TypeTags.Basic Mathlib.Algebra.Group.TypeTags.Hom Mathlib.Algebra.Group.ULift Mathlib.Algebra.Group.Units.Equiv Mathlib.Algebra.Group.Units.Hom Mathlib.Algebra.Group.Units.Opposite Mathlib.Algebra.Group.WithOne.Basic Mathlib.Algebra.GroupWithZero.Action.Defs Mathlib.Algebra.GroupWithZero.Action.End Mathlib.Algebra.GroupWithZero.Action.Faithful Mathlib.Algebra.GroupWithZero.Action.Opposite Mathlib.Algebra.GroupWithZero.Action.Prod Mathlib.Algebra.GroupWithZero.Action.Units Mathlib.Algebra.GroupWithZero.Equiv Mathlib.Algebra.GroupWithZero.Invertible Mathlib.Algebra.GroupWithZero.Opposite Mathlib.Algebra.GroupWithZero.ProdHom Mathlib.Algebra.GroupWithZero.Prod Mathlib.Algebra.GroupWithZero.ULift Mathlib.Algebra.GroupWithZero.Units.Equiv Mathlib.Algebra.GroupWithZero.Units.Lemmas Mathlib.Algebra.GroupWithZero.WithZero Mathlib.Algebra.Module.Defs Mathlib.Algebra.Module.MinimalAxioms Mathlib.Algebra.Module.Prod Mathlib.Algebra.Opposites Mathlib.Algebra.Regular.Opposite Mathlib.Algebra.Regular.Pi Mathlib.Algebra.Regular.Prod Mathlib.Algebra.Regular.SMul Mathlib.Algebra.Regular.ULift Mathlib.Algebra.Ring.Action.Rat Mathlib.Algebra.Ring.Divisibility.Basic Mathlib.Algebra.Ring.InjSurj Mathlib.Algebra.Ring.Invertible Mathlib.Algebra.Ring.WithZero Mathlib.CategoryTheory.Bicategory.Adjunction.Basic Mathlib.CategoryTheory.Bicategory.Adjunction.Mate Mathlib.CategoryTheory.Bicategory.Basic Mathlib.CategoryTheory.Category.Basic Mathlib.CategoryTheory.Category.KleisliCat Mathlib.CategoryTheory.Functor.Basic Mathlib.CategoryTheory.Functor.Category Mathlib.CategoryTheory.Functor.FullyFaithful Mathlib.CategoryTheory.Functor.Functorial Mathlib.CategoryTheory.Functor.ReflectsIso.Basic Mathlib.CategoryTheory.Functor.Trifunctor Mathlib.CategoryTheory.HomCongr Mathlib.CategoryTheory.InducedCategory Mathlib.CategoryTheory.Iso Mathlib.CategoryTheory.NatIso Mathlib.CategoryTheory.NatTrans Mathlib.CategoryTheory.Sigma.Basic Mathlib.CategoryTheory.Thin Mathlib.CategoryTheory.Whiskering Mathlib.Combinatorics.Quiver.Basic Mathlib.Combinatorics.Quiver.Cast Mathlib.Combinatorics.Quiver.ConnectedComponent Mathlib.Combinatorics.Quiver.Covering Mathlib.Combinatorics.Quiver.Path Mathlib.Combinatorics.Quiver.Prefunctor Mathlib.Combinatorics.Quiver.Push Mathlib.Combinatorics.Quiver.Schreier Mathlib.Combinatorics.Quiver.SingleObj Mathlib.Combinatorics.Quiver.Subquiver Mathlib.Combinatorics.Quiver.Symmetric Mathlib.Control.EquivFunctor Mathlib.Control.Monad.Basic Mathlib.Control.Monad.Cont Mathlib.Control.Monad.Writer Mathlib.Control.Traversable.Equiv Mathlib.Control.ULiftable Mathlib.Data.Countable.Defs Mathlib.Data.Erased Mathlib.Data.Finite.Defs Mathlib.Data.Int.Cast.Prod Mathlib.Data.Nat.Cast.Prod Mathlib.Data.Opposite Mathlib.Data.Set.Opposite Mathlib.Data.ULift Mathlib.GroupTheory.GroupAction.IterateAct Mathlib.GroupTheory.GroupAction.Ring Mathlib.LinearAlgebra.AffineSpace.Defs Mathlib.Logic.Embedding.Basic Mathlib.Logic.Equiv.Basic Mathlib.Logic.Equiv.Bool Mathlib.Logic.Equiv.Defs Mathlib.Logic.Equiv.Functor Mathlib.Logic.Equiv.Option Mathlib.Logic.Equiv.Prod Mathlib.Logic.Equiv.Sum Mathlib.Logic.Small.Defs Mathlib.Logic.UnivLE Mathlib.SetTheory.Cardinal.Defs Mathlib.Tactic.CategoryTheory.BicategoricalComp Mathlib.Tactic.CategoryTheory.Bicategory.Basic Mathlib.Tactic.CategoryTheory.Bicategory.Datatypes Mathlib.Tactic.CategoryTheory.Bicategory.Normalize Mathlib.Tactic.CategoryTheory.Bicategory.PureCoherence Mathlib.Tactic.CategoryTheory.CancelIso Mathlib.Tactic.CategoryTheory.CheckCompositions Mathlib.Tactic.CategoryTheory.Coherence.Basic Mathlib.Tactic.CategoryTheory.IsoReassoc Mathlib.Tactic.CategoryTheory.Reassoc Mathlib.Tactic.DeriveFintype Mathlib.Tactic.NormNum.Core Mathlib.Tactic.NormNum.Parity Mathlib.Tactic.NormNum.Result Mathlib.Tactic.ProdAssoc Mathlib.Tactic.ProxyType Mathlib.Tactic.Widget.CommDiag |
1 |
Declarations diff
+ _find_body(text:
+ _skip_comment(text:
+ _worker(args):
+ add_fast_instance_import(text:
+ apply_edits(text:
+ build(file:
+ candidate_edits(text:
+ edit_ok(file:
+ find_files(roots:
+ instance : Algebra R (FiniteAdeleRing R K) := fast_instance% Algebra.compHom _ (algebraMap R K)
+ instance : Bornology α := fast_instance% Bornology.induced (f : α → β)
+ instance : Inhabited (ValueGroup A K) := fast_instance% ⟨Quotient.mk'' 0⟩
+ instance : MulAction (α ≃o α) (Flag α) := fast_instance% SetLike.coe_injective.mulAction _ coe_smul
+ instance : MulAction Mᵈᵐᵃ (A →* B) := fast_instance%
+ instance : One (ValueGroup A K) := fast_instance% ⟨Quotient.mk'' 1⟩
+ instance : PartialOrder (DiffeologicalSpace X) := fast_instance%
+ instance : PartialOrder (IdealSheafData X) := fast_instance%
+ instance : Preorder X.N := fast_instance% Preorder.lift toS
+ instance : Preorder X.S := fast_instance% Preorder.lift subcomplex
+ instance : PseudoEMetricSpace (ULift α) := fast_instance% PseudoEMetricSpace.induced ULift.down ‹_›
+ instance : Zero (ValueGroup A K) := fast_instance% ⟨Quotient.mk'' 0⟩
+ instance [Bornology E] : Bornology C⋆ᵐᵒᵈ(A, E) := fast_instance% Bornology.induced <| equiv A E
+ main():
+ sweep(file:
- instance : Algebra R (FiniteAdeleRing R K) := Algebra.compHom _ (algebraMap R K)
- instance : Bornology α := Bornology.induced (f : α → β)
- instance : Inhabited (ValueGroup A K) := ⟨Quotient.mk'' 0⟩
- instance : MulAction (α ≃o α) (Flag α) := SetLike.coe_injective.mulAction _ coe_smul
- instance : MulAction Mᵈᵐᵃ (A →* B) := DFunLike.coe_injective.mulAction (⇑) fun _ _ ↦ rfl
- instance : One (ValueGroup A K) := ⟨Quotient.mk'' 1⟩
- instance : PartialOrder (DiffeologicalSpace X) := PartialOrder.lift _ injective_toPlots
- instance : PartialOrder (IdealSheafData X) := PartialOrder.lift ideal fun _ _ ↦ IdealSheafData.ext
- instance : Preorder X.N := Preorder.lift toS
- instance : Preorder X.S := Preorder.lift subcomplex
- instance : PseudoEMetricSpace (ULift α) := PseudoEMetricSpace.induced ULift.down ‹_›
- instance : Zero (ValueGroup A K) := ⟨Quotient.mk'' 0⟩
- instance [Bornology E] : Bornology C⋆ᵐᵒᵈ(A, E) := Bornology.induced <| equiv A E
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.
⚠️ Scripts folder reminder
This PR adds files under scripts/.
Please consider whether each added script belongs in this repository or in leanprover-community/mathlib-ci.
A script belongs in mathlib-ci if it is a CI automation script that interacts with GitHub (e.g. managing labels, posting comments, triggering bots), runs from a trusted external checkout in CI, or requires access to secrets.
A script belongs in this repository (scripts/) if it is a developer or maintainer tool to be run locally, a code maintenance or analysis utility, a style linting tool, or a data file used by the library's own linters.
See the mathlib-ci README for more details.
Added scripts files:
scripts/sweep_fast_instance.py
✅ PR Title Formatted CorrectlyThe title of this PR has been updated to match our commit style conventions. |
|
|
||
| instance monoidalCategory : MonoidalCategory (ModuleCat.{u} R) := | ||
| Monoidal.induced equivalenceSemimoduleCat.functor | ||
| fast_instance% Monoidal.induced equivalenceSemimoduleCat.functor |
There was a problem hiding this comment.
If you revert this then the error in Mathlib.Algebra.Category.ModuleCat.Monoidal.Symmetric goes away (and in fact mathlib builds)
There was a problem hiding this comment.
Oh -- I can push to this fork for some reason! Fixes coming up.
There was a problem hiding this comment.
Maintainers can push to all forks by default (users can change this on their github, but if they just fork mathlib this is the status quo).
|
!radar |
|
Benchmark results for cac073f against 383a355 are in. No significant results found. @kbuzzard
Medium changes (2✅, 1🟥)
Small changes (3✅, 3🟥)
|
| Wraps `instance` bodies whose RHS uses a known smart constructor with `fast_instance%`, | ||
| then rebuilds the file and reverts the edit if it breaks the build or triggers the | ||
| `linter.fast_instance_existing` warning. Supports parallel sweeps over a subtree. | ||
| Usage: `python3 scripts/sweep_fast_instance.py [-j N] [--dry-run] <path>` |
There was a problem hiding this comment.
(this is just for the linter, I am unclear about whether the plan is to PR the script but I'm just worried about linter failures making radar fail)
There was a problem hiding this comment.
I just wanted to test it, I didn't realize I staged also the script. Anyway thanks for fixing the linter!
…nstance # Conflicts: # Mathlib/Algebra/Ring/Subsemiring/Basic.lean
|
!radar |
|
Benchmark results for dd22ac0 against 383a355 are in. There are significant results. @riccardobrasca
No significant changes detected. |
|
!radar |
|
Benchmark results for a11dfb5 against 383a355 are in. There are significant results. @kbuzzard
No significant changes detected. |
|
!radar |
|
Benchmark results for 9849b61 against 383a355 are in. There are significant results. @riccardobrasca
No significant changes detected. |
|
!radar |
|
Benchmark results for 13c8ec5 against 383a355 are in. There are significant results. @riccardobrasca
No significant changes detected. |
|
!radar |
|
Benchmark results for dde7887 against 383a355 are in. There are significant results. @riccardobrasca
Large changes (1✅)
Medium changes (4✅, 2🟥)
Small changes (7✅, 8🟥)
|
|
!radar |
|
Benchmark results for 3eb8c21 against 84c838c are in. There are significant results. @riccardobrasca
Large changes (1✅)
Medium changes (3✅, 2🟥)
Small changes (5✅, 9🟥)
|