Skip to content

Commit 04d36cb

Browse files
[auto-sync] Merge upstream mathlib4 into master (PR #76)
Auto-merged by sync_finalize after CI success.
2 parents 7ce2148 + 28c28d7 commit 04d36cb

101 files changed

Lines changed: 1721 additions & 813 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: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2253,6 +2253,7 @@ public import Mathlib.Analysis.Normed.Operator.LinearIsometry
22532253
public import Mathlib.Analysis.Normed.Operator.Mul
22542254
public import Mathlib.Analysis.Normed.Operator.NNNorm
22552255
public import Mathlib.Analysis.Normed.Operator.NormedSpace
2256+
public import Mathlib.Analysis.Normed.Operator.Perturbation.StrictByFinite
22562257
public import Mathlib.Analysis.Normed.Operator.Prod
22572258
public import Mathlib.Analysis.Normed.Order.Basic
22582259
public import Mathlib.Analysis.Normed.Order.Hom.Basic
@@ -3869,6 +3870,7 @@ public import Mathlib.Data.Fin.Basic
38693870
public import Mathlib.Data.Fin.Embedding
38703871
public import Mathlib.Data.Fin.Fin2
38713872
public import Mathlib.Data.Fin.FlagRange
3873+
public import Mathlib.Data.Fin.Init
38723874
public import Mathlib.Data.Fin.Parity
38733875
public import Mathlib.Data.Fin.Pigeonhole
38743876
public import Mathlib.Data.Fin.Rev
@@ -4053,7 +4055,8 @@ public import Mathlib.Data.Int.Sqrt
40534055
public import Mathlib.Data.Int.Star
40544056
public import Mathlib.Data.Int.SuccPred
40554057
public import Mathlib.Data.Int.WithZero
4056-
public import Mathlib.Data.LawfulXor
4058+
public import Mathlib.Data.LawfulXor.Basic
4059+
public import Mathlib.Data.LawfulXor.Equiv
40574060
public import Mathlib.Data.List.AList
40584061
public import Mathlib.Data.List.Basic
40594062
public import Mathlib.Data.List.Chain
@@ -5664,6 +5667,7 @@ public import Mathlib.MeasureTheory.VectorMeasure.SetIntegral
56645667
public import Mathlib.MeasureTheory.VectorMeasure.Variation.Basic
56655668
public import Mathlib.MeasureTheory.VectorMeasure.Variation.Defs
56665669
public import Mathlib.MeasureTheory.VectorMeasure.Variation.Semivariation
5670+
public import Mathlib.MeasureTheory.VectorMeasure.Variation.SignedMeasure
56675671
public import Mathlib.MeasureTheory.VectorMeasure.WithDensity
56685672
public import Mathlib.MeasureTheory.VectorMeasure.WithDensityVec
56695673
public import Mathlib.ModelTheory.Algebra.Field.Basic
@@ -6829,6 +6833,7 @@ public import Mathlib.RingTheory.MvPolynomial.Symmetric.NewtonIdentities
68296833
public import Mathlib.RingTheory.MvPolynomial.Tower
68306834
public import Mathlib.RingTheory.MvPolynomial.WeightedHomogeneous
68316835
public import Mathlib.RingTheory.MvPowerSeries.Basic
6836+
public import Mathlib.RingTheory.MvPowerSeries.Derivative
68326837
public import Mathlib.RingTheory.MvPowerSeries.Equiv
68336838
public import Mathlib.RingTheory.MvPowerSeries.Evaluation
68346839
public import Mathlib.RingTheory.MvPowerSeries.Expand

β€ŽMathlib/Algebra/DirectSum/Basic.leanβ€Ž

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ Note: `open DirectSum` will enable the notation `⨁ i, β i` for `DirectSum ι
3838
@[implicit_reducible]
3939
def DirectSum [βˆ€ i, AddCommMonoid (Ξ² i)] : Type _ :=
4040
Ξ β‚€ i, Ξ² i
41-
deriving AddCommMonoid, Inhabited, DFunLike
4241

4342
set_option backward.inferInstanceAs.wrap.data false in
4443
deriving instance CoeFun for DirectSum
@@ -58,14 +57,21 @@ scoped[DirectSum] notation3 "⨁ "(...)", "r:(scoped f => DirectSum _ f) => r
5857
-- | `(⨁ ($x:ident) ($y:ident), $p) => `(DirectSum _ (fun $x ↦ fun $y ↦ $p))
5958
-- end
6059

60+
namespace DirectSum
61+
62+
variable {ΞΉ Ξ²}
63+
64+
-- This instance exists to avoid nsmul and zsmul diamonds.
65+
instance {R : Type u} [Semiring R] [βˆ€ i, AddCommMonoid (Ξ² i)] [βˆ€ i, Module R (Ξ² i)] :
66+
SMul R (⨁ i, Ξ² i) := inferInstanceAs <| SMul R (Ξ β‚€ (i : ΞΉ), Ξ² i)
67+
68+
deriving instance AddCommMonoid, Inhabited, DFunLike for DirectSum
69+
6170
instance [DecidableEq ΞΉ] [βˆ€ i, AddCommMonoid (Ξ² i)] [βˆ€ i, DecidableEq (Ξ² i)] :
6271
DecidableEq (DirectSum ΞΉ Ξ²) :=
6372
inferInstanceAs <| DecidableEq (Ξ β‚€ i, Ξ² i)
6473

65-
namespace DirectSum
66-
67-
variable {ΞΉ}
68-
74+
variable (Ξ²) in
6975
/-- Coercion from a `DirectSum` to a pi type is an `AddMonoidHom`. -/
7076
def coeFnAddMonoidHom [βˆ€ i, AddCommMonoid (Ξ² i)] : (⨁ i, Ξ² i) β†’+ (Ξ  i, Ξ² i) where
7177
toFun x := x
@@ -83,8 +89,6 @@ variable [βˆ€ i, AddCommGroup (Ξ² i)]
8389
instance : AddCommGroup (DirectSum ΞΉ Ξ²) :=
8490
inferInstanceAs (AddCommGroup (Ξ β‚€ i, Ξ² i))
8591

86-
variable {Ξ²}
87-
8892
@[simp]
8993
theorem sub_apply (g₁ gβ‚‚ : ⨁ i, Ξ² i) (i : ΞΉ) : (g₁ - gβ‚‚) i = g₁ i - gβ‚‚ i :=
9094
rfl
@@ -100,8 +104,6 @@ variable [βˆ€ i, AddCommMonoid (Ξ² i)]
100104
theorem zero_apply (i : ι) : (0 : ⨁ i, β i) i = 0 :=
101105
rfl
102106

103-
variable {Ξ²}
104-
105107
@[simp]
106108
theorem add_apply (g₁ gβ‚‚ : ⨁ i, Ξ² i) (i : ΞΉ) : (g₁ + gβ‚‚) i = g₁ i + gβ‚‚ i :=
107109
rfl

β€ŽMathlib/Algebra/Homology/HomotopyCategory/HomComplex.leanβ€Ž

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,12 @@ variable (F G)
6666
of a family of morphisms `F.X p ⟢ G.X q` whenever `p + n = q`, i.e. for all
6767
triplets in `HomComplex.Triplet n`. -/
6868
def Cochain := βˆ€ (T : Triplet n), F.X T.p ⟢ G.X T.q
69-
deriving AddCommGroup
70-
71-
instance : Module R (Cochain F G n) :=
72-
inferInstanceAs <| Module R (βˆ€ _, _)
7369

7470
namespace Cochain
7571

72+
-- The `SMul` instance exists to avoid a zsmul diamond.
73+
deriving instance SMul R, AddCommGroup, Module R for Cochain F G n
74+
7675
variable {F G n}
7776

7877
/-- A practical constructor for cochains. -/
@@ -579,10 +578,6 @@ def cocycle : AddSubgroup (Cochain F G n) :=
579578
/-- The type of `n`-cocycles, as a subtype of `Cochain F G n`. -/
580579
def Cocycle : Type v := cocycle F G n
581580

582-
instance : AddCommGroup (Cocycle F G n) := by
583-
dsimp only [Cocycle]
584-
infer_instance
585-
586581
namespace Cocycle
587582

588583
variable {F G}
@@ -607,6 +602,9 @@ instance : SMul R (Cocycle F G n) where
607602

608603
variable (F G n)
609604

605+
instance : AddCommGroup (Cocycle F G n) :=
606+
inferInstanceAs <| AddCommGroup (cocycle F G n)
607+
610608
@[simp]
611609
lemma coe_zero : (↑(0 : Cocycle F G n) : Cochain F G n) = 0 := by rfl
612610

β€ŽMathlib/Algebra/MonoidAlgebra/Defs.leanβ€Ž

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,12 @@ instance one : One R[M] where one := single 1 1
468468
@[to_additive (dont_translate := R) one_def]
469469
lemma one_def : (1 : R[M]) = single 1 1 := rfl
470470

471-
@[to_additive (attr := simp) (dont_translate := R)]
471+
@[to_additive (attr := simp) (dont_translate := R) coeff_one_zero]
472472
lemma coeff_one_one : (1 : R[M]).coeff 1 = 1 := by simp [one_def]
473473

474+
@[deprecated (since := "2026-07-15")]
475+
alias _root_.AddMonoidAlgebra.coeff_zero_zero := AddMonoidAlgebra.coeff_one_zero
476+
474477
end One
475478

476479
section Mul

β€ŽMathlib/Algebra/Polynomial/Degree/Defs.leanβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public import Mathlib.Order.SuccPred.WithBot
2020
* `Polynomial.degree`: the degree of a polynomial, where `0` has degree `βŠ₯`
2121
* `Polynomial.natDegree`: the degree of a polynomial, where `0` has degree `0`
2222
* `Polynomial.leadingCoeff`: the leading coefficient of a polynomial
23-
* `Polynomial.Monic`: a polynomial is monic if its leading coefficient is 0
23+
* `Polynomial.Monic`: a polynomial is monic if its leading coefficient is 1
2424
* `Polynomial.nextCoeff`: the next coefficient after the leading coefficient
2525
2626
## Main results

β€ŽMathlib/AlgebraicGeometry/Sites/AffineEtale.leanβ€Ž

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ Authors: Christian Merten, JoΓ«l Riou
55
-/
66
module
77

8-
public import Mathlib.Algebra.Category.ModuleCat.AB
9-
public import Mathlib.Algebra.Category.ModuleCat.FilteredColimits
8+
-- these `ModuleCat` instances are only used by the `example` below, which `shake` cannot see
9+
public import Mathlib.Algebra.Category.ModuleCat.AB -- shake: keep
10+
public import Mathlib.Algebra.Category.ModuleCat.FilteredColimits -- shake: keep
1011
public import Mathlib.AlgebraicGeometry.Sites.Affine
1112
public import Mathlib.AlgebraicGeometry.Sites.Etale
1213
public import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Sheaf

β€ŽMathlib/Analysis/Calculus/FormalMultilinearSeries.leanβ€Ž

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,18 @@ def FormalMultilinearSeries (π•œ : Type*) (E : Type*) (F : Type*) [Semiring
5252
βˆ€ n : β„•, E [Γ—n]β†’L[π•œ] F
5353
deriving Inhabited
5454

55+
-- This instance exists to avoid an nsmul diamond.
56+
instance (π•œ') [Semiring π•œ'] [Module π•œ' F] [ContinuousConstSMul π•œ' F] [SMulCommClass π•œ π•œ' F] :
57+
SMul π•œ' (FormalMultilinearSeries π•œ E F) where
58+
smul k x n := k β€’ x n
59+
5560
section AddCommMonoid
5661

5762
/-- Copy `Pi.addCommMonoid`, ensuring the pointwise operations hold by defeq. -/
58-
instance : AddCommMonoid (FormalMultilinearSeries π•œ E F) where
63+
instance : AddCommMonoid (FormalMultilinearSeries π•œ E F) := fast_instance% {
5964
__ := Pi.addCommMonoid
6065
zero _ := 0
61-
add x y n := x n + y n
62-
nsmul k x n := k β€’ x n
66+
add x y n := x n + y n }
6367

6468
end AddCommMonoid
6569

β€ŽMathlib/Analysis/Normed/Lp/lpSpace.leanβ€Ž

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,13 @@ the same ambient group, which permits lemma statements like `lp.monotone` (below
343343
@[nolint unusedArguments]
344344
def PreLp (E : Ξ± β†’ Type*) [βˆ€ i, NormedAddCommGroup (E i)] : Type _ :=
345345
βˆ€ i, E i
346-
deriving AddCommGroup
347346

348347
namespace PreLp
349348

349+
-- The `SMul` instance exists to avoid a zsmul diamond.
350+
variable [NormedRing π•œ] [βˆ€ i, Module π•œ (E i)] in
351+
deriving instance SMul π•œ, AddCommGroup for PreLp E
352+
350353
@[simp] lemma add_apply {x y : PreLp E} {i : Ξ±} : (x + y) i = x i + y i := rfl
351354
@[simp] lemma zero_apply {i : Ξ±} : (0 : PreLp E) i = 0 := rfl
352355
@[simp] lemma sub_apply {x y : PreLp E} {i : Ξ±} : (x - y) i = x i - y i := rfl

0 commit comments

Comments
Β (0)