Skip to content

Commit ef3b156

Browse files
committed
fix
2 parents 614e0eb + d6340e9 commit ef3b156

315 files changed

Lines changed: 3521 additions & 978 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/get-mathlib-ci/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ inputs:
1010
# Default pinned commit used by workflows unless they explicitly override.
1111
# Update this ref as needed to pick up changes to mathlib-ci scripts
1212
# This is also updated automatically by .github/workflows/update_dependencies.yml
13-
default: 78f34ded6a5f5aa11ea5b7c3120fe5d8422db1da
13+
default: aafe3df227b81f681afa3978f9eab0e2bbcd0582
1414
path:
1515
description: Checkout destination path.
1616
required: false

.github/workflows/build_template.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -733,17 +733,36 @@ jobs:
733733
run: |
734734
lake exe graph
735735
736+
- name: Checkout local actions
737+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
738+
with:
739+
ref: ${{ github.workflow_sha }}
740+
fetch-depth: 1
741+
sparse-checkout: .github/actions
742+
path: workflow-actions
743+
744+
- name: Get mathlib-ci
745+
uses: ./workflow-actions/.github/actions/get-mathlib-ci
746+
747+
- name: dump declarations and transitive-import counts
748+
run: |
749+
lake env lean --run "${CI_SCRIPTS_DIR}/pr_summary/dumpReasonableDecls.lean" \
750+
--out decls.txt --imports-out imports.json Mathlib
751+
736752
- name: upload the import graph
737753
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
738754
with:
739755
name: import-graph
740-
path: import_graph.dot
741-
## the default is 90, but we build often, so unless there's a reason
742-
## to care about old copies in the future, just say 7 days for now
743-
retention-days: 7
756+
path: |
757+
import_graph.dot
758+
decls.txt
759+
imports.json
760+
## Master pushes: 90 days, so later PRs forked from these commits
761+
## can consume the dumps from the artifact. Other branches: 7 days.
762+
retention-days: ${{ github.ref == 'refs/heads/master' && '90' || '7' }}
744763

745764
- name: clean up the import graph file
746-
run: rm import_graph.dot
765+
run: rm -f import_graph.dot decls.txt imports.json
747766

748767
- name: check all scripts build successfully
749768
run: |

Mathlib.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,6 +1326,7 @@ public import Mathlib.AlgebraicGeometry.AffineSpace
13261326
public import Mathlib.AlgebraicGeometry.AffineTransitionLimit
13271327
public import Mathlib.AlgebraicGeometry.AlgClosed.Basic
13281328
public import Mathlib.AlgebraicGeometry.Artinian
1329+
public import Mathlib.AlgebraicGeometry.Birational.Dominant
13291330
public import Mathlib.AlgebraicGeometry.Birational.RationalMap
13301331
public import Mathlib.AlgebraicGeometry.ColimitsOver
13311332
public import Mathlib.AlgebraicGeometry.Cover.Directed
@@ -4862,6 +4863,7 @@ public import Mathlib.LinearAlgebra.AffineSpace.AffineEquiv
48624863
public import Mathlib.LinearAlgebra.AffineSpace.AffineMap
48634864
public import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace.Basic
48644865
public import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace.Defs
4866+
public import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace.Shift
48654867
public import Mathlib.LinearAlgebra.AffineSpace.Basis
48664868
public import Mathlib.LinearAlgebra.AffineSpace.Centroid
48674869
public import Mathlib.LinearAlgebra.AffineSpace.Ceva
@@ -5111,6 +5113,7 @@ public import Mathlib.LinearAlgebra.Projection
51115113
public import Mathlib.LinearAlgebra.Projectivization.Action
51125114
public import Mathlib.LinearAlgebra.Projectivization.Basic
51135115
public import Mathlib.LinearAlgebra.Projectivization.Cardinality
5116+
public import Mathlib.LinearAlgebra.Projectivization.Collinear
51145117
public import Mathlib.LinearAlgebra.Projectivization.Constructions
51155118
public import Mathlib.LinearAlgebra.Projectivization.Independence
51165119
public import Mathlib.LinearAlgebra.Projectivization.Subspace
@@ -5346,6 +5349,7 @@ public import Mathlib.MeasureTheory.Function.LpSeminorm.TriangleInequality
53465349
public import Mathlib.MeasureTheory.Function.LpSeminorm.Trim
53475350
public import Mathlib.MeasureTheory.Function.LpSpace.Basic
53485351
public import Mathlib.MeasureTheory.Function.LpSpace.Complete
5352+
public import Mathlib.MeasureTheory.Function.LpSpace.CompleteOfCompleteLp
53495353
public import Mathlib.MeasureTheory.Function.LpSpace.ContinuousCompMeasurePreserving
53505354
public import Mathlib.MeasureTheory.Function.LpSpace.ContinuousFunctions
53515355
public import Mathlib.MeasureTheory.Function.LpSpace.DomAct.Basic
@@ -5522,6 +5526,7 @@ public import Mathlib.MeasureTheory.Measure.QuasiMeasurePreserving
55225526
public import Mathlib.MeasureTheory.Measure.Real
55235527
public import Mathlib.MeasureTheory.Measure.Regular
55245528
public import Mathlib.MeasureTheory.Measure.RegularityCompacts
5529+
public import Mathlib.MeasureTheory.Measure.ResolventTransform
55255530
public import Mathlib.MeasureTheory.Measure.Restrict
55265531
public import Mathlib.MeasureTheory.Measure.SeparableMeasure
55275532
public import Mathlib.MeasureTheory.Measure.Stieltjes
@@ -5690,6 +5695,7 @@ public import Mathlib.NumberTheory.LSeries.ZMod
56905695
public import Mathlib.NumberTheory.LSeries.ZetaZeros
56915696
public import Mathlib.NumberTheory.LegendreSymbol.AddCharacter
56925697
public import Mathlib.NumberTheory.LegendreSymbol.Basic
5698+
public import Mathlib.NumberTheory.LegendreSymbol.Complex
56935699
public import Mathlib.NumberTheory.LegendreSymbol.GaussEisensteinLemmas
56945700
public import Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol
56955701
public import Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic
@@ -7236,6 +7242,7 @@ public import Mathlib.Tactic.Linter.Lint
72367242
public import Mathlib.Tactic.Linter.MinImports
72377243
public import Mathlib.Tactic.Linter.Multigoal
72387244
public import Mathlib.Tactic.Linter.OldObtain
7245+
public import Mathlib.Tactic.Linter.OverlappingInstances
72397246
public import Mathlib.Tactic.Linter.PPRoundtrip
72407247
public import Mathlib.Tactic.Linter.PrivateModule
72417248
public import Mathlib.Tactic.Linter.Style
@@ -7982,6 +7989,7 @@ public import Mathlib.Topology.Sheaves.Abelian
79827989
public import Mathlib.Topology.Sheaves.AddCommGrpCat
79837990
public import Mathlib.Topology.Sheaves.Alexandrov
79847991
public import Mathlib.Topology.Sheaves.CommRingCat
7992+
public import Mathlib.Topology.Sheaves.EtaleSpace
79857993
public import Mathlib.Topology.Sheaves.Flasque
79867994
public import Mathlib.Topology.Sheaves.Forget
79877995
public import Mathlib.Topology.Sheaves.Functors

Mathlib/Algebra/Algebra/Spectrum/Basic.lean

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@ local notation "↑ₐ" => algebraMap R A
101101
theorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=
102102
Iff.rfl
103103

104+
@[simp]
105+
theorem resolvent_zero_of_mem_spectrum {r : R} {a : A} (hr : r ∈ σ a) :
106+
resolvent a r = 0 := Ring.inverse_non_unit _ (mem_iff.mp hr)
107+
108+
theorem mem_spectrum_iff_resolvent_zero [Nontrivial A] {r : R} {a : A} :
109+
r ∈ σ a ↔ resolvent a r = 0 := by
110+
refine ⟨resolvent_zero_of_mem_spectrum, fun hr ↦ ?_⟩
111+
simpa [mem_iff, Ring.not_isUnit_iff_inverse_eq_zero]
112+
104113
theorem notMem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by
105114
simp [mem_iff]
106115

Mathlib/Algebra/Algebra/Subalgebra/Lattice.lean

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,34 @@ theorem subset_adjoin : s ⊆ adjoin R s :=
517517
@[aesop 80% (rule_sets := [SetLike])]
518518
theorem mem_adjoin_of_mem {s : Set A} {x : A} (hx : x ∈ s) : x ∈ adjoin R s := subset_adjoin hx
519519

520+
/-
521+
The following set-up allows one to write `xₖ : R[x₁, ..., xₙ]` instead of
522+
`(⟨xₖ, "membership proof"⟩ : R[x₁, ..., xₙ])`.
523+
524+
The idea is to recurse through the list of `x₁, ..., xₙ` until we find the appropriate `xₖ`.
525+
By design, it only triggers if the set is of the form `insert x₁ (insert x₂ (...(s)))` or
526+
`{x₁, ..., xₙ}`.
527+
-/
528+
529+
variable {α : Type*}
530+
531+
/-- Supporting class for coercions `xₖ : R[x₁, ..., xₙ]`. -/
532+
class CoeAdjoinAux (x : α) (s : Set α) : Prop where mem : x ∈ s
533+
534+
scoped instance (x : α) : CoeAdjoinAux x {x} := ⟨Set.mem_singleton x⟩
535+
536+
scoped instance (x : α) (s : Set α) : CoeAdjoinAux x (insert x s) := ⟨Set.mem_insert x s⟩
537+
538+
scoped instance (x y : α) (s : Set α) [CoeAdjoinAux x s] : CoeAdjoinAux x (insert y s) :=
539+
⟨Set.mem_insert_of_mem y CoeAdjoinAux.mem⟩
540+
541+
/-- Enables notation `xₖ : R[x₁, ..., xₙ]` instead of
542+
`(⟨xₖ, "membership proof"⟩ : R[x₁, ..., xₙ])`. -/
543+
scoped instance {A B : Type*} [CommSemiring A] [Semiring B] [Algebra A B]
544+
(s : Set B) (x : B) [CoeAdjoinAux x s] :
545+
CoeDep B x (adjoin A s) where
546+
coe := ⟨x, mem_adjoin_of_mem CoeAdjoinAux.mem⟩
547+
520548
theorem adjoin_le {S : Subalgebra R A} (H : s ⊆ S) : adjoin R s ≤ S :=
521549
Algebra.gc.l_le H
522550

Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ lemma prod_filter_not_mul_prod_filter (s : Finset ι) (p : ι → Prop) [Decidab
153153
(∏ x ∈ s with ¬p x, f x) * ∏ x ∈ s with p x, f x = ∏ x ∈ s, f x := by
154154
rw [mul_comm, prod_filter_mul_prod_filter_not]
155155

156+
set_option backward.isDefEq.respectTransparency false in
156157
@[to_additive]
157158
theorem prod_filter_xor (p q : ι → Prop) [DecidablePred p] [DecidablePred q] :
158159
(∏ x ∈ s with (Xor (p x) (q x)), f x) =

Mathlib/Algebra/Category/Ring/FilteredColimits.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ protected lemma nontrivial {F : J ⥤ CommRingCat.{v}} [IsFilteredOrEmpty J]
376376
(Types.FilteredColimit.isColimit_eq_iff' (isColimitOfPreserves (forget _) hc) _ _).mp h
377377
exact zero_ne_one (((F.map f).hom.map_zero.symm.trans e).trans (F.map f).hom.map_one)
378378

379+
set_option linter.overlappingInstances false in
379380
omit [IsFiltered J] in
380381
instance {F : J ⥤ CommRingCat.{v}} [IsFilteredOrEmpty J]
381382
[HasColimit F] [∀ i, Nontrivial (F.obj i)] : Nontrivial ↑(Limits.colimit F) :=

Mathlib/Algebra/Colimit/DirectLimit.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,8 +833,8 @@ end NonUnitalStarRing
833833
namespace Algebra
834834

835835
variable [CommSemiring R]
836-
variable [∀ i, Semiring (G i)] [∀ i j h, RingHomClass (T h) (G i) (G j)]
837-
variable [∀ i, Algebra R (G i)] [∀ i j h, AlgHomClass (T h) R (G i) (G j)]
836+
variable [∀ i, Semiring (G i)] [∀ i, Algebra R (G i)]
837+
variable [∀ i j h, AlgHomClass (T h) R (G i) (G j)]
838838
variable [Nonempty ι]
839839

840840
variable (G f) in

Mathlib/Algebra/Group/Action/Defs.lean

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,8 +614,8 @@ end CompatibleScalar
614614
/-- Typeclass for multiplicative actions on multiplicative structures.
615615
616616
The key axiom here is `smul_mul : g • (x * y) = (g • x) * (g • y)`.
617-
If `G` is a group (with group law multiplication) and `Γ` is its automorphism
618-
group then there is a natural instance of `MulDistribMulAction Γ G`.
617+
If `G` is a multiplicative group with automorphism group `Γ`, then there is a natural instance of
618+
`MulDistribMulAction Γ G`.
619619
620620
The axiom is also satisfied by a Galois group $Gal(L/K)$ acting on the field `L`,
621621
but here you can use the even stronger class `MulSemiringAction`, which captures
@@ -627,11 +627,27 @@ class MulDistribMulAction (M N : Type*) [Monoid M] [Monoid N] extends MulAction
627627
/-- Distributivity of `•` across `*` -/
628628
smul_mul : ∀ (r : M) (x y : N), r • (x * y) = r • x * r • y
629629

630+
/-- Typeclass for additive actions on additive structures.
631+
632+
The key axiom here is `vadd_add : g +ᵥ (x + y) = (g +ᵥ x) + (g +ᵥ y)`.
633+
If `G` is an additive group with additive automorphism group `Γ`, then there is a natural instance
634+
of `AddDistribAddAction Γ G`. -/
635+
@[ext]
636+
class AddDistribAddAction (M N : Type*) [AddMonoid M] [AddMonoid N] extends AddAction M N where
637+
/-- Acting on `0` by a scalar gives `0` -/
638+
vadd_zero : ∀ r : M, r +ᵥ (0 : N) = 0
639+
/-- Distributivity of `+ᵥ` across `+` -/
640+
vadd_add : ∀ (r : M) (x y : N), r +ᵥ (x + y) = (r +ᵥ x) + (r +ᵥ y)
641+
630642
export MulDistribMulAction (smul_one)
643+
export AddDistribAddAction (vadd_zero)
644+
645+
attribute [to_additive existing] MulDistribMulAction
631646

632647
section MulDistribMulAction
633648
variable [Monoid M] [Monoid N] [MulDistribMulAction M N]
634649

650+
@[to_additive]
635651
lemma smul_mul' (a : M) (b₁ b₂ : N) : a • (b₁ * b₂) = a • b₁ * a • b₂ :=
636652
MulDistribMulAction.smul_mul ..
637653

Mathlib/Algebra/Group/Action/End.lean

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ namespace MulAut
108108
variable [Monoid M]
109109

110110
/-- The tautological action by `MulAut M` on `M`. -/
111+
@[to_additive /-- The tautological action by `AddAut M` on `M`. -/]
111112
instance applyMulAction : MulAction (MulAut M) M where
112113
smul := (· <| ·)
113114
one_smul _ := rfl
@@ -116,16 +117,15 @@ instance applyMulAction : MulAction (MulAut M) M where
116117
/-- The tautological action by `MulAut M` on `M`.
117118
118119
This generalizes `Function.End.applyMulAction`. -/
120+
@[to_additive /-- The tautological action by `AddAut M` on `M`. -/]
119121
instance applyMulDistribMulAction : MulDistribMulAction (MulAut M) M where
120-
smul := (· <| ·)
121-
one_smul _ := rfl
122-
mul_smul _ _ _ := rfl
123122
smul_one := map_one
124123
smul_mul := map_mul
125124

126-
@[simp] protected lemma smul_def (f : MulAut M) (a : M) : f • a = f a := rfl
125+
@[to_additive (attr := simp)] protected lemma smul_def (f : MulAut M) (a : M) : f • a = f a := rfl
127126

128127
/-- `MulAut.applyDistribMulAction` is faithful. -/
128+
@[to_additive /-- `AddAut.applyAddDistribAddAction` is faithful. -/]
129129
instance apply_faithfulSMul : FaithfulSMul (MulAut M) M where eq_of_smul_eq_smul := MulEquiv.ext
130130

131131
end MulAut
@@ -135,16 +135,8 @@ end MulAut
135135
namespace AddAut
136136
variable [AddMonoid M]
137137

138-
/-- The tautological action by `AddAut M` on `M`. -/
139-
instance applyMulAction : MulAction (AddAut M) M where
140-
smul := (· <| ·)
141-
one_smul _ := rfl
142-
mul_smul _ _ _ := rfl
143-
144-
@[simp] protected lemma smul_def (f : AddAut M) (a : M) : f • a = f a := rfl
145-
146-
/-- `AddAut.applyDistribMulAction` is faithful. -/
147-
instance apply_faithfulSMul : FaithfulSMul (AddAut M) M where eq_of_smul_eq_smul := AddEquiv.ext
138+
@[deprecated (since := "2026-05-26")] alias smul_def := AddAut.vadd_def
139+
@[deprecated (since := "2026-05-26")] alias apply_faithfulSMul := apply_faithfulVAdd
148140

149141
end AddAut
150142

0 commit comments

Comments
 (0)