Skip to content

Commit 80666d2

Browse files
committed
merge master
2 parents 461e6ea + 9e508f5 commit 80666d2

File tree

204 files changed

+4366
-720
lines changed

Some content is hidden

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

204 files changed

+4366
-720
lines changed

Archive/Examples/Kuratowski.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ complements of the closed sets, and `s` and `sᶜ` which are neither closed nor
2222
This reduces `14*13/2 = 91` inequalities to check down to `6*5/2 = 15` inequalities.
2323
We'll further show that the 15 inequalities follow from a subset of 6 by algebra.
2424
25-
There are charaterizations and criteria for a set to be a 14-set in the paper
25+
There are characterizations and criteria for a set to be a 14-set in the paper
2626
"Characterization of Kuratowski 14-Sets" by Eric Langford which we do not formalize.
2727
2828
## Main definitions
@@ -63,7 +63,7 @@ theorem sum_map_theClosedSix_add_compl (s : Set X) :
6363
((theClosedSix s).map fun t ↦ {t} + {tᶜ}).sum = theClosedSix s + theOpenSix s :=
6464
Multiset.sum_map_add
6565

66-
/-- `theFourteen s` can be splitted into 3 subsets. -/
66+
/-- `theFourteen s` can be split into 3 subsets. -/
6767
theorem theFourteen_eq_pair_add_theClosedSix_add_theOpenSix (s : Set X) :
6868
theFourteen s = {s, sᶜ} + theClosedSix s + theOpenSix s := by
6969
rw [add_assoc, ← sum_map_theClosedSix_add_compl]; rfl

Archive/Wiedijk100Theorems/AbelRuffini.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ theorem real_roots_Phi_ge (hab : b < a) : 2 ≤ Fintype.card ((Φ ℚ a b).rootS
143143
Finset.card_insert_of_notMem (mt Finset.mem_singleton.mp hxy)]
144144

145145
theorem complex_roots_Phi (h : (Φ ℚ a b).Separable) : Fintype.card ((Φ ℚ a b).rootSet ℂ) = 5 :=
146-
(card_rootSet_eq_natDegree h (IsAlgClosed.splits_codomain _)).trans (natDegree_Phi a b)
146+
(card_rootSet_eq_natDegree h (IsAlgClosed.splits _)).trans (natDegree_Phi a b)
147147

148148
theorem gal_Phi (hab : b < a) (h_irred : Irreducible (Φ ℚ a b)) :
149149
Bijective (galActionHom (Φ ℚ a b) ℂ) := by

Archive/Wiedijk100Theorems/BallotProblem.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ theorem first_vote_pos :
218218
count_countedSequence, count_countedSequence, one_mul, zero_mul, add_zero,
219219
Nat.cast_add, Nat.cast_one, mul_comm, ← div_eq_mul_inv, ENNReal.div_eq_div_iff]
220220
· norm_cast
221-
rw [mul_comm _ (p + 1), ← Nat.succ_eq_add_one p, Nat.succ_add, Nat.succ_mul_choose_eq,
221+
rw [mul_comm _ (p + 1), add_right_comm, Nat.add_one_mul_choose_eq,
222222
mul_comm]
223223
all_goals simp [(Nat.choose_pos <| le_add_of_nonneg_right zero_le').ne']
224224
· simp

Mathlib.lean

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,7 @@ public import Mathlib.Algebra.Homology.BifunctorAssociator
533533
public import Mathlib.Algebra.Homology.BifunctorFlip
534534
public import Mathlib.Algebra.Homology.BifunctorHomotopy
535535
public import Mathlib.Algebra.Homology.BifunctorShift
536+
public import Mathlib.Algebra.Homology.CochainComplexOpposite
536537
public import Mathlib.Algebra.Homology.CommSq
537538
public import Mathlib.Algebra.Homology.ComplexShape
538539
public import Mathlib.Algebra.Homology.ComplexShapeSigns
@@ -1547,6 +1548,7 @@ public import Mathlib.Analysis.Calculus.ContDiff.FTaylorSeries
15471548
public import Mathlib.Analysis.Calculus.ContDiff.FaaDiBruno
15481549
public import Mathlib.Analysis.Calculus.ContDiff.FiniteDimension
15491550
public import Mathlib.Analysis.Calculus.ContDiff.Operations
1551+
public import Mathlib.Analysis.Calculus.ContDiff.Polynomial
15501552
public import Mathlib.Analysis.Calculus.ContDiff.RCLike
15511553
public import Mathlib.Analysis.Calculus.ContDiff.RestrictScalars
15521554
public import Mathlib.Analysis.Calculus.ContDiff.WithLp
@@ -1763,6 +1765,7 @@ public import Mathlib.Analysis.Convolution
17631765
public import Mathlib.Analysis.Distribution.AEEqOfIntegralContDiff
17641766
public import Mathlib.Analysis.Distribution.ContDiffMapSupportedIn
17651767
public import Mathlib.Analysis.Distribution.DerivNotation
1768+
public import Mathlib.Analysis.Distribution.Distribution
17661769
public import Mathlib.Analysis.Distribution.FourierSchwartz
17671770
public import Mathlib.Analysis.Distribution.SchwartzSpace
17681771
public import Mathlib.Analysis.Distribution.TemperateGrowth
@@ -2071,6 +2074,7 @@ public import Mathlib.Analysis.Real.Pi.Leibniz
20712074
public import Mathlib.Analysis.Real.Pi.Wallis
20722075
public import Mathlib.Analysis.Real.Spectrum
20732076
public import Mathlib.Analysis.Seminorm
2077+
public import Mathlib.Analysis.SpecialFunctions.Arcosh
20742078
public import Mathlib.Analysis.SpecialFunctions.Arsinh
20752079
public import Mathlib.Analysis.SpecialFunctions.Bernstein
20762080
public import Mathlib.Analysis.SpecialFunctions.BinaryEntropy
@@ -2470,6 +2474,7 @@ public import Mathlib.CategoryTheory.Generator.Preadditive
24702474
public import Mathlib.CategoryTheory.Generator.Presheaf
24712475
public import Mathlib.CategoryTheory.Generator.Sheaf
24722476
public import Mathlib.CategoryTheory.Generator.StrongGenerator
2477+
public import Mathlib.CategoryTheory.Generator.Type
24732478
public import Mathlib.CategoryTheory.GlueData
24742479
public import Mathlib.CategoryTheory.GradedObject
24752480
public import Mathlib.CategoryTheory.GradedObject.Associator
@@ -2938,6 +2943,7 @@ public import Mathlib.CategoryTheory.Presentable.IsCardinalFiltered
29382943
public import Mathlib.CategoryTheory.Presentable.Limits
29392944
public import Mathlib.CategoryTheory.Presentable.LocallyPresentable
29402945
public import Mathlib.CategoryTheory.Presentable.OrthogonalReflection
2946+
public import Mathlib.CategoryTheory.Presentable.Presheaf
29412947
public import Mathlib.CategoryTheory.Presentable.Retracts
29422948
public import Mathlib.CategoryTheory.Presentable.StrongGenerator
29432949
public import Mathlib.CategoryTheory.Presentable.Type
@@ -3096,6 +3102,7 @@ public import Mathlib.CategoryTheory.Triangulated.Opposite.Basic
30963102
public import Mathlib.CategoryTheory.Triangulated.Opposite.Functor
30973103
public import Mathlib.CategoryTheory.Triangulated.Opposite.Pretriangulated
30983104
public import Mathlib.CategoryTheory.Triangulated.Opposite.Triangle
3105+
public import Mathlib.CategoryTheory.Triangulated.Opposite.Triangulated
30993106
public import Mathlib.CategoryTheory.Triangulated.Orthogonal
31003107
public import Mathlib.CategoryTheory.Triangulated.Pretriangulated
31013108
public import Mathlib.CategoryTheory.Triangulated.Rotate
@@ -3164,6 +3171,7 @@ public import Mathlib.Combinatorics.HalesJewett
31643171
public import Mathlib.Combinatorics.Hall.Basic
31653172
public import Mathlib.Combinatorics.Hall.Finite
31663173
public import Mathlib.Combinatorics.Hindman
3174+
public import Mathlib.Combinatorics.KatonaCircle
31673175
public import Mathlib.Combinatorics.Matroid.Basic
31683176
public import Mathlib.Combinatorics.Matroid.Circuit
31693177
public import Mathlib.Combinatorics.Matroid.Closure
@@ -4153,6 +4161,7 @@ public import Mathlib.Geometry.Euclidean.MongePoint
41534161
public import Mathlib.Geometry.Euclidean.PerpBisector
41544162
public import Mathlib.Geometry.Euclidean.Projection
41554163
public import Mathlib.Geometry.Euclidean.SignedDist
4164+
public import Mathlib.Geometry.Euclidean.Similarity
41564165
public import Mathlib.Geometry.Euclidean.Simplex
41574166
public import Mathlib.Geometry.Euclidean.Sphere.Basic
41584167
public import Mathlib.Geometry.Euclidean.Sphere.OrthRadius
@@ -4653,8 +4662,10 @@ public import Mathlib.LinearAlgebra.PerfectPairing.Matrix
46534662
public import Mathlib.LinearAlgebra.PerfectPairing.Restrict
46544663
public import Mathlib.LinearAlgebra.Pi
46554664
public import Mathlib.LinearAlgebra.PiTensorProduct
4665+
public import Mathlib.LinearAlgebra.PiTensorProduct.Basis
46564666
public import Mathlib.LinearAlgebra.PiTensorProduct.DFinsupp
46574667
public import Mathlib.LinearAlgebra.PiTensorProduct.DirectSum
4668+
public import Mathlib.LinearAlgebra.PiTensorProduct.Dual
46584669
public import Mathlib.LinearAlgebra.PiTensorProduct.Finsupp
46594670
public import Mathlib.LinearAlgebra.Prod
46604671
public import Mathlib.LinearAlgebra.Projection
@@ -5206,6 +5217,7 @@ public import Mathlib.NumberTheory.LegendreSymbol.ZModChar
52065217
public import Mathlib.NumberTheory.LocalField.Basic
52075218
public import Mathlib.NumberTheory.LucasLehmer
52085219
public import Mathlib.NumberTheory.LucasPrimality
5220+
public import Mathlib.NumberTheory.MahlerMeasure
52095221
public import Mathlib.NumberTheory.MaricaSchoenheim
52105222
public import Mathlib.NumberTheory.Modular
52115223
public import Mathlib.NumberTheory.ModularForms.ArithmeticSubgroups
@@ -6257,6 +6269,7 @@ public import Mathlib.RingTheory.Smooth.Flat
62576269
public import Mathlib.RingTheory.Smooth.Kaehler
62586270
public import Mathlib.RingTheory.Smooth.Local
62596271
public import Mathlib.RingTheory.Smooth.Locus
6272+
public import Mathlib.RingTheory.Smooth.NoetherianDescent
62606273
public import Mathlib.RingTheory.Smooth.Pi
62616274
public import Mathlib.RingTheory.Smooth.StandardSmooth
62626275
public import Mathlib.RingTheory.Smooth.StandardSmoothCotangent
@@ -7049,7 +7062,7 @@ public import Mathlib.Topology.ContinuousMap.Weierstrass
70497062
public import Mathlib.Topology.ContinuousMap.ZeroAtInfty
70507063
public import Mathlib.Topology.ContinuousOn
70517064
public import Mathlib.Topology.Convenient.GeneratedBy
7052-
public import Mathlib.Topology.Covering
7065+
public import Mathlib.Topology.Covering.Basic
70537066
public import Mathlib.Topology.Defs.Basic
70547067
public import Mathlib.Topology.Defs.Filter
70557068
public import Mathlib.Topology.Defs.Induced

Mathlib/Algebra/Algebra/Bilinear.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,3 +305,7 @@ lemma comp_mul' (f : A →ₐ B) : f.toLinearMap ∘ₗ μ = μ[R] ∘ₗ (f.toL
305305
TensorProduct.ext' <| by simp
306306

307307
end AlgHom
308+
309+
lemma LinearMap.toSpanSingleton_one_eq_algebraLinearMap [CommSemiring R] [Semiring A]
310+
[Algebra R A] : toSpanSingleton R A 1 = Algebra.linearMap R A := by
311+
ext; simp

Mathlib/Algebra/BigOperators/Fin.lean

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,27 @@ theorem prod_trunc {a b : ℕ} (f : Fin (a + b) → M) (hf : ∀ j : Fin b, f (n
168168
(∏ i : Fin (a + b), f i) = ∏ i : Fin a, f (castAdd b i) := by
169169
rw [prod_univ_add, Fintype.prod_eq_one _ hf, mul_one]
170170

171+
@[to_additive]
172+
private lemma prod_insertNth_go :
173+
∀ n i (h : i < n + 1) x (p : Fin n → M), ∏ j, insertNth ⟨i, h⟩ x p j = x * ∏ j, p j
174+
| n, 0, h, x, p => by simp
175+
| 0, i, h, x, p => by simp [fin_one_eq_zero ⟨i, h⟩]
176+
| n + 1, i + 1, h, x, p => by
177+
obtain ⟨hd, tl, rfl⟩ := exists_cons p
178+
have i_lt := Nat.lt_of_succ_lt_succ h
179+
let i_fin : Fin (n + 1) := ⟨i, i_lt⟩
180+
rw [show ⟨i + 1, h⟩ = i_fin.succ from rfl]
181+
simp only [insertNth_succ_cons, prod_cons]
182+
rw [prod_insertNth_go n i i_lt x tl, mul_left_comm]
183+
184+
@[to_additive (attr := simp)]
185+
theorem prod_insertNth i x (p : Fin n → M) : ∏ j, insertNth i x p j = x * ∏ j, p j :=
186+
prod_insertNth_go n i.val i.isLt x p
187+
188+
@[to_additive (attr := simp)]
189+
theorem mul_prod_removeNth i (f : Fin (n + 1) → M) : f i * ∏ j, removeNth i f j = ∏ j, f j := by
190+
rw [← prod_insertNth, insertNth_self_removeNth]
191+
171192
/-!
172193
### Products over intervals: `Fin.cast`
173194
-/

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,37 @@ lemma prod_eq_pow_single [DecidableEq M] (a : M) (h : ∀ a', a' ≠ a → a'
198198
l.prod = a ^ l.count a :=
199199
_root_.trans (by rw [map_id]) (prod_map_eq_pow_single a id h)
200200

201+
@[to_additive (attr := simp)]
202+
theorem prod_insertIdx {i} (hlen : i ≤ l.length) (hcomm : ∀ a' ∈ l.take i, Commute a a') :
203+
(l.insertIdx i a).prod = a * l.prod := by
204+
induction i generalizing l
205+
case zero => rfl
206+
case succ i ih =>
207+
obtain ⟨hd, tl, rfl⟩ := exists_cons_of_length_pos (Nat.zero_lt_of_lt hlen)
208+
simp only [insertIdx_succ_cons, prod_cons,
209+
ih (Nat.le_of_lt_succ hlen) (fun a' a'_mem => hcomm a' (mem_of_mem_tail a'_mem))]
210+
exact Commute.left_comm (hcomm hd (mem_of_mem_head? rfl)).symm tl.prod
211+
212+
@[to_additive (attr := simp)]
213+
theorem mul_prod_eraseIdx {i} (hlen : i < l.length) (hcomm : ∀ a' ∈ l.take i, Commute l[i] a') :
214+
l[i] * (l.eraseIdx i).prod = l.prod := by
215+
rw [← prod_insertIdx (by grind : i ≤ (l.eraseIdx i).length) (fun a' a'_mem =>
216+
hcomm a' (by rwa [take_eraseIdx_eq_take_of_le l i i (Nat.le_refl i)] at a'_mem)),
217+
insertIdx_eraseIdx_getElem hlen]
218+
201219
end Monoid
202220

203221
section CommMonoid
204222
variable [CommMonoid M] {a : M} {l l₁ l₂ : List M}
205223

224+
@[to_additive (attr := simp)]
225+
theorem CommMonoid.prod_insertIdx {i} (h : i ≤ l.length) : (l.insertIdx i a).prod = a * l.prod :=
226+
List.prod_insertIdx h (fun a' _ ↦ Commute.all a a')
227+
228+
@[to_additive (attr := simp)]
229+
theorem CommMonoid.mul_prod_eraseIdx {i} (h : i < l.length) : l[i] * (l.eraseIdx i).prod = l.prod :=
230+
List.mul_prod_eraseIdx h (fun a' _ ↦ Commute.all l[i] a')
231+
206232
@[to_additive (attr := simp)]
207233
lemma prod_erase [DecidableEq M] (ha : a ∈ l) : a * (l.erase a).prod = l.prod :=
208234
prod_erase_of_comm ha fun x _ y _ ↦ mul_comm x y

Mathlib/Algebra/Category/ModuleCat/Monoidal/Basic.lean

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,22 +132,16 @@ theorem leftUnitor_naturality {M N : SemimoduleCat R} (f : M ⟶ N) :
132132
ext : 1
133133
-- Porting note (https://github.com/leanprover-community/mathlib4/issues/11041): broken ext
134134
apply TensorProduct.ext
135-
ext x
136-
dsimp
137-
erw [TensorProduct.lid_tmul, TensorProduct.lid_tmul]
138-
rw [map_smul]
139-
rfl
135+
ext
136+
simp [tensorHom, tensorObj, leftUnitor]
140137

141138
theorem rightUnitor_naturality {M N : SemimoduleCat R} (f : M ⟶ N) :
142139
tensorHom f (𝟙 (SemimoduleCat.of R R)) ≫ (rightUnitor N).hom = (rightUnitor M).hom ≫ f := by
143140
ext : 1
144141
-- Porting note (https://github.com/leanprover-community/mathlib4/issues/11041): broken ext
145142
apply TensorProduct.ext
146-
ext x
147-
dsimp
148-
erw [TensorProduct.rid_tmul, TensorProduct.rid_tmul]
149-
rw [map_smul]
150-
rfl
143+
ext
144+
simp [tensorHom, tensorObj, rightUnitor]
151145

152146
theorem triangle (M N : SemimoduleCat.{u} R) :
153147
(associator M (SemimoduleCat.of R R) N).hom ≫ tensorHom (𝟙 M) (leftUnitor N).hom =

Mathlib/Algebra/DirectSum/Module.lean

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -429,30 +429,8 @@ noncomputable def IsInternal.collectedBasis (h : IsInternal A) {α : ι → Type
429429
@[simp]
430430
theorem IsInternal.collectedBasis_coe (h : IsInternal A) {α : ι → Type*}
431431
(v : ∀ i, Basis (α i) R (A i)) : ⇑(h.collectedBasis v) = fun a : Σ i, α i ↦ ↑(v a.1 a.2) := by
432-
funext a
433-
-- Porting note: was
434-
-- simp only [IsInternal.collectedBasis, toModule, coeLinearMap, Basis.coe_ofRepr,
435-
-- Basis.repr_symm_apply, DFinsupp.lsum_apply_apply, DFinsupp.mapRange.linearEquiv_apply,
436-
-- DFinsupp.mapRange.linearEquiv_symm, DFinsupp.mapRange_single, linearCombination_single,
437-
-- LinearEquiv.ofBijective_apply, LinearEquiv.symm_symm, LinearEquiv.symm_trans_apply, one_smul,
438-
-- sigmaFinsuppAddEquivDFinsupp_apply, sigmaFinsuppEquivDFinsupp_single,
439-
-- sigmaFinsuppLequivDFinsupp_apply]
440-
-- convert DFinsupp.sumAddHom_single (fun i ↦ (A i).subtype.toAddMonoidHom) a.1 (v a.1 a.2)
441-
simp only [IsInternal.collectedBasis, coeLinearMap, Basis.coe_ofRepr, LinearEquiv.trans_symm,
442-
LinearEquiv.symm_symm, LinearEquiv.trans_apply, sigmaFinsuppLequivDFinsupp_apply,
443-
AddEquiv.toEquiv_eq_coe, Equiv.toFun_as_coe, EquivLike.coe_coe,
444-
sigmaFinsuppAddEquivDFinsupp_apply, sigmaFinsuppEquivDFinsupp_single,
445-
LinearEquiv.ofBijective_apply]
446-
rw [DFinsupp.mapRange.linearEquiv_symm]
447-
-- `DFunLike.coe (β := fun x ↦ ⨁ (i : ι), ↥(A i))`
448-
-- appears in the goal, but the lemma is expecting
449-
-- `DFunLike.coe (β := fun x ↦ Π₀ (i : ι), ↥(A i))`
450-
erw [DFinsupp.mapRange.linearEquiv_apply]
451-
simp only [DFinsupp.mapRange_single, Basis.repr_symm_apply, linearCombination_single, one_smul,
452-
toModule]
453-
-- Similarly here.
454-
erw [DFinsupp.lsum_single]
455-
simp only [Submodule.coe_subtype]
432+
simp [IsInternal.collectedBasis, coeLinearMap, DFinsupp.mapRange.linearEquiv,
433+
toModule, DFinsupp.lsum]
456434

457435
theorem IsInternal.collectedBasis_mem (h : IsInternal A) {α : ι → Type*}
458436
(v : ∀ i, Basis (α i) R (A i)) (a : Σ i, α i) : h.collectedBasis v a ∈ A a.1 := by simp

Mathlib/Algebra/Group/Int/Defs.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ instance instAddCommGroup : AddCommGroup ℤ where
5252
zsmul_neg' m n := by simp only [negSucc_eq, natCast_succ, Int.neg_mul]
5353
sub_eq_add_neg _ _ := Int.sub_eq_add_neg
5454

55-
-- Thise instance can also be found from the `LinearOrderedCommMonoidWithZero ℤ` instance by
55+
-- This instance can also be found from the `LinearOrderedCommMonoidWithZero ℤ` instance by
5656
-- typeclass search, but it is better practice to not rely on algebraic order theory to prove
5757
-- purely algebraic results on concrete types. Eg the results can be made available earlier.
5858

0 commit comments

Comments
 (0)