Skip to content

Commit 773c912

Browse files
Merge master into nightly-testing
2 parents 644a822 + 4438e0a commit 773c912

82 files changed

Lines changed: 1870 additions & 367 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.

Mathlib.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2469,6 +2469,7 @@ public import Mathlib.CategoryTheory.Adjunction.Limits
24692469
public import Mathlib.CategoryTheory.Adjunction.Mates
24702470
public import Mathlib.CategoryTheory.Adjunction.Opposites
24712471
public import Mathlib.CategoryTheory.Adjunction.Parametrized
2472+
public import Mathlib.CategoryTheory.Adjunction.ParametrizedLimits
24722473
public import Mathlib.CategoryTheory.Adjunction.PartialAdjoint
24732474
public import Mathlib.CategoryTheory.Adjunction.Quadruple
24742475
public import Mathlib.CategoryTheory.Adjunction.Reflective
@@ -2567,6 +2568,7 @@ public import Mathlib.CategoryTheory.CommSq
25672568
public import Mathlib.CategoryTheory.Comma.Arrow
25682569
public import Mathlib.CategoryTheory.Comma.Basic
25692570
public import Mathlib.CategoryTheory.Comma.CardinalArrow
2571+
public import Mathlib.CategoryTheory.Comma.CatCommSq
25702572
public import Mathlib.CategoryTheory.Comma.Final
25712573
public import Mathlib.CategoryTheory.Comma.LocallySmall
25722574
public import Mathlib.CategoryTheory.Comma.Over.Basic
@@ -4509,6 +4511,7 @@ public import Mathlib.Geometry.Convex.Cone.Simplicial
45094511
public import Mathlib.Geometry.Convex.Cone.TensorProduct
45104512
public import Mathlib.Geometry.Convex.ConvexSpace.AffineSpace
45114513
public import Mathlib.Geometry.Convex.ConvexSpace.Defs
4514+
public import Mathlib.Geometry.Convex.ConvexSpace.Prod
45124515
public import Mathlib.Geometry.Diffeology.Basic
45134516
public import Mathlib.Geometry.Euclidean.Altitude
45144517
public import Mathlib.Geometry.Euclidean.Angle.Bisector
@@ -6609,6 +6612,7 @@ public import Mathlib.RingTheory.LocalProperties.Semilocal
66096612
public import Mathlib.RingTheory.LocalProperties.Submodule
66106613
public import Mathlib.RingTheory.LocalRing.Basic
66116614
public import Mathlib.RingTheory.LocalRing.Defs
6615+
public import Mathlib.RingTheory.LocalRing.Etale
66126616
public import Mathlib.RingTheory.LocalRing.Length
66136617
public import Mathlib.RingTheory.LocalRing.LocalSubring
66146618
public import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,11 @@ theorem mul_prod_eraseIdx {i} (hlen : i < l.length) (hcomm : ∀ a' ∈ l.take i
216216
hcomm a' (by rwa [take_eraseIdx_eq_take_of_le l i i (Nat.le_refl i)] at a'_mem)),
217217
insertIdx_eraseIdx_getElem hlen]
218218

219+
@[to_additive (attr := simp)]
220+
theorem prod_filter_bne_one [BEq M] [LawfulBEq M] (l : List M) :
221+
(l.filter (· != 1)).prod = l.prod := by
222+
classical induction l <;> grind
223+
219224
end Monoid
220225

221226
section CommMonoid

Mathlib/Algebra/Category/Grp/LeftExactFunctor.lean

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,21 @@ noncomputable def unitIsoAux (F : C ⥤ AddCommGrpCat.{v}) [PreservesFiniteLimit
8585
letI : (F ⋙ forget AddCommGrpCat).Braided := .ofChosenFiniteProducts _
8686
letI : F.Monoidal := .ofChosenFiniteProducts _
8787
refine CommGrp.mkIso Multiplicative.toAdd.toIso (by
88-
erw [Functor.mapCommGrp_obj_grp_one]
88+
rw [Functor.obj.η_def X (F := F ⋙ forget AddCommGrpCat)]
8989
cat_disch) ?_
9090
dsimp [-Functor.comp_map, -ConcreteCategory.forget_map_eq_ofHom]
9191
have : F.Additive := Functor.additive_of_preserves_binary_products _
9292
simp only [Category.id_comp]
93-
erw [Functor.mapCommGrp_obj_grp_mul]
94-
erw [Functor.comp_map, F.map_add, Functor.Monoidal.μ_comp F (forget AddCommGrpCat) X X,
93+
rw [Functor.obj.μ_def X (F := F ⋙ forget AddCommGrpCat), Preadditive.mul_def X,
94+
Functor.comp_map, F.map_add,
95+
Functor.Monoidal.μ_comp F (forget AddCommGrpCat) X X,
9596
Category.assoc, ← Functor.map_comp, Preadditive.comp_add, Functor.Monoidal.μ_fst,
9697
Functor.Monoidal.μ_snd]
9798
ext
98-
simp only [TypeCat.Fun.toFun_apply, CategoryTheory.comp_apply, Equiv.toIso_hom_hom_apply,
99-
Preadditive.commGrpEquivalence_functor_obj_X, Functor.comp_obj, types_tensorObj_def, hom_add,
100-
tensor_apply, TypeCat.hom_ofHom, TypeCat.Fun.coe_mk, AddMonoidHom.add_apply]
99+
-- `simp [types_tensorObj_def]` says
100+
simp only [types_tensorObj_def, TypeCat.Fun.toFun_apply, CategoryTheory.comp_apply,
101+
Equiv.toIso_hom_hom_apply, Functor.comp_obj, hom_add, tensor_apply, TypeCat.hom_ofHom,
102+
TypeCat.Fun.coe_mk, AddMonoidHom.add_apply]
101103
rw [dsimp% [types_tensorObj_def, types_tensorUnit_def] μ_forget_apply]
102104
rfl
103105

Mathlib/Algebra/Category/ModuleCat/Presheaf/Sheafification.lean

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,9 @@ noncomputable def sheafificationAdjunction :
127127
{ homEquiv := fun _ _ ↦ sheafificationHomEquiv α
128128
homEquiv_naturality_left_symm := fun {P₀ Q₀ N} f g ↦ by
129129
apply (SheafOfModules.toSheaf _).map_injective
130-
rw [Functor.map_comp]
131-
erw [toSheaf_map_sheafificationHomEquiv_symm,
132-
toSheaf_map_sheafificationHomEquiv_symm α g]
133-
rw [Functor.map_comp]
130+
simp only [Functor.comp_obj, Functor.map_comp]
131+
rw [toSheaf_map_sheafificationHomEquiv_symm α (f ≫ g),
132+
toSheaf_map_sheafificationHomEquiv_symm α g, Functor.map_comp]
134133
apply (CategoryTheory.sheafificationAdjunction J
135134
AddCommGrpCat.{v}).homEquiv_naturality_left_symm
136135
homEquiv_naturality_right := fun {P₀ M N} f g ↦ by

Mathlib/Algebra/Homology/ShortComplex/ModuleCat.lean

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,4 +240,44 @@ lemma ModuleCat.shortComplex_shortExact (S : ShortComplex (ModuleCat.{v} R))
240240
mono_f := (ModuleCat.mono_iff_injective _).mpr inj
241241
epi_g := (ModuleCat.epi_iff_surjective _).mpr surj
242242

243+
variable {M' N' L' : Type*} [AddCommGroup M'] [AddCommGroup N'] [AddCommGroup L']
244+
[Module R M'] [Module R N'] [Module R L']
245+
246+
variable (eM : M ≃ₗ[R] M') (eN : N ≃ₗ[R] N') (eL : L ≃ₗ[R] L') (f : M' →ₗ[R] N') (g : N' →ₗ[R] L')
247+
248+
/--
249+
Suppose that `f` and `g` are linear maps that compose to zero, and that `eM`, `eN`, and `eL`
250+
indicated in the diagram below are linear equivalences to modules that all belong to the same
251+
universe. Then this is the short complex in `ModuleCat` given by the bottom row in the diagram.
252+
M --f--> N --g--> L
253+
| | |
254+
eM eN eL
255+
| | |
256+
v v v
257+
M'-----> N'-----> L'
258+
This complex is exact when we have `Function.Exact f g`, see
259+
`ModuleCat.shortComplexOfConj_exact`.
260+
-/
261+
abbrev ModuleCat.shortComplexOfConj (eq0 : g ∘ₗ f = 0) :
262+
ShortComplex (ModuleCat.{v} R) :=
263+
ModuleCat.shortComplexOfCompEqZero ((eN.symm.comp f).comp eM.toLinearMap)
264+
(eL.symm.comp (g.comp eN.toLinearMap)) (by
265+
ext x
266+
simpa using LinearMap.congr_fun eq0 (eM x))
267+
268+
private lemma exact_conj_of_exact (exact : Function.Exact f g) : Function.Exact
269+
((eN.symm.comp f).comp eM.toLinearMap) (eL.symm.comp (g.comp eN.toLinearMap)) := by
270+
rwa [LinearEquiv.precomp_exact_iff_exact, LinearEquiv.postcomp_exact_iff_exact,
271+
LinearEquiv.conj_symm_exact_iff_exact]
272+
273+
lemma ModuleCat.shortComplexOfConj_exact (exact : Function.Exact f g) :
274+
(ModuleCat.shortComplexOfConj eM eN eL f g exact.linearMap_comp_eq_zero).Exact :=
275+
ModuleCat.shortComplex_exact _ (exact_conj_of_exact eM eN eL f g exact)
276+
277+
lemma ModuleCat.shortComplexOfConj_shortExact (exact : Function.Exact f g)
278+
(inj : Function.Injective f) (surj : Function.Surjective g) :
279+
(ModuleCat.shortComplexOfConj eM eN eL f g exact.linearMap_comp_eq_zero).ShortExact := by
280+
refine ModuleCat.shortComplex_shortExact _ (exact_conj_of_exact eM eN eL f g exact) ?_ ?_
281+
all_goals simpa
282+
243283
end

Mathlib/Algebra/Lie/Submodule.lean

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ instance : Zero (LieSubmodule R L M) :=
7373
instance : Inhabited (LieSubmodule R L M) :=
7474
0
7575

76-
instance (priority := high) coeSort : CoeSort (LieSubmodule R L M) (Type w) where
77-
coe N := { x : M // x ∈ N }
78-
7976
instance (priority := mid) coeSubmodule : CoeOut (LieSubmodule R L M) (Submodule R M) :=
8077
⟨toSubmodule⟩
8178

Mathlib/Algebra/Module/StablyFree/Basic.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ public import Mathlib.RingTheory.Finiteness.Small
1313
# Stably free modules
1414
1515
## Main definition
16-
* `IsStablyFree`: A module `M` over a commutative ring `R` is called stably free if there exists a
17-
finite free module `N` over `R` such that `M ⊕ N` is free.
16+
* `IsStablyFree`: A module `M` over a ring `R` is called stably free if there exists a finite free
17+
`R`-module `N` such that `M ⊕ N` is free.
1818
-/
1919

2020
public section
@@ -23,8 +23,8 @@ universe u v w
2323

2424
namespace Module
2525

26-
/-- A module `M` over a commutative ring `R` is called stably free if there exists a
27-
finite free module `N` over `R` such that `M ⊕ N` is free.
26+
/-- A module `M` over a ring `R` is called stably free if there exists a finite free `R`-module `N`
27+
such that `M ⊕ N` is free.
2828
2929
The underlying constructor is marked as private. The intended constructor of `IsStablyFree` is
3030
`IsStablyFree.of_free_prod`, and use `IsStablyFree.exist_free_prod` to extract the property from

Mathlib/Algebra/MvPolynomial/Equiv.lean

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,25 @@ theorem uniqueAlgEquiv_symm_monomial [Unique σ] {d : σ →₀ ℕ} {r : R} :
9999
= MvPolynomial.monomial d r := by
100100
simp [MvPolynomial.monomial_eq]
101101

102+
/-- The coefficient of `X ^ n` in `uniqueAlgEquiv R σ P` is the coefficient of the unique
103+
monomial of degree `n` in `P`. -/
104+
theorem coeff_uniqueAlgEquiv [Unique σ] (P : MvPolynomial σ R) (n : ℕ) :
105+
(MvPolynomial.uniqueAlgEquiv R σ P : Polynomial R).coeff n =
106+
coeff (Finsupp.single default n) P := by
107+
induction P using induction_on' with
108+
| monomial d r =>
109+
rw [uniqueAlgEquiv_monomial, Finsupp.unique_single d]
110+
simp [Polynomial.coeff_monomial, MvPolynomial.coeff_monomial]
111+
| add P Q hP hQ =>
112+
simpa using congrArg₂ (· + ·) hP hQ
113+
114+
/-- The coefficient of a monomial in `(uniqueAlgEquiv R σ).symm P` is the coefficient of the
115+
corresponding univariate monomial in `P`. -/
116+
theorem coeff_uniqueAlgEquiv_symm [Unique σ] (P : Polynomial R) (d : σ →₀ ℕ) :
117+
coeff d ((MvPolynomial.uniqueAlgEquiv R σ).symm P) = P.coeff (d default) := by
118+
rw [Finsupp.unique_single d, ← coeff_uniqueAlgEquiv R, AlgEquiv.apply_symm_apply,
119+
Finsupp.single_eq_same]
120+
102121
/-- The algebra isomorphism between multivariable polynomials in a single variable and
103122
polynomials over the ground ring. -/
104123
@[deprecated uniqueAlgEquiv (since := "2026-04-15")]

Mathlib/AlgebraicGeometry/ProjectiveSpectrum/StructureSheaf.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def homogeneousLocalizationToStalk (x : ProjectiveSpectrum.top 𝒜) (y : at x)
313313

314314
lemma homogeneousLocalizationToStalk_stalkToFiberRingHom (x z) :
315315
homogeneousLocalizationToStalk 𝒜 x (stalkToFiberRingHom 𝒜 x z) = z := by
316-
obtain ⟨U, hxU, s, rfl⟩ := (Proj.structureSheaf 𝒜).presheaf.germ_exist x z
316+
obtain ⟨U, hxU, s, rfl⟩ := (Proj.structureSheaf 𝒜).presheaf.exists_germ_eq z
317317
change homogeneousLocalizationToStalk 𝒜 x ((stalkToFiberRingHom 𝒜 x).hom
318318
(((Proj.structureSheaf 𝒜).presheaf.germ U x hxU) s)) =
319319
((Proj.structureSheaf 𝒜).presheaf.germ U x hxU) s

Mathlib/AlgebraicGeometry/Properties.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ instance isReduced_stalk_of_isReduced [IsReduced X] (x : X) :
8585
_root_.IsReduced (X.presheaf.stalk x) := by
8686
constructor
8787
rintro g ⟨n, e⟩
88-
obtain ⟨U, hxU, s, (rfl : (X.presheaf.germ U x hxU) s = g)⟩ := X.presheaf.germ_exist x g
88+
obtain ⟨U, hxU, s, (rfl : (X.presheaf.germ U x hxU) s = g)⟩ := X.presheaf.exists_germ_eq g
8989
rw [← map_pow, ← map_zero (X.presheaf.germ _ x hxU).hom] at e
9090
obtain ⟨V, hxV, iU, iV, (e' : (X.presheaf.map iU.op) (s ^ n) = (X.presheaf.map iV.op) 0)⟩ :=
9191
X.presheaf.germ_eq x hxU hxU _ 0 e

0 commit comments

Comments
 (0)