Skip to content

Commit 41c335d

Browse files
author
mathlib4-bot
committed
Merge remote-tracking branch 'upstream/master' into bump/v4.31.0
2 parents 2ecee66 + aa7b3ad commit 41c335d

31 files changed

Lines changed: 211 additions & 192 deletions

File tree

Mathlib/Analysis/Complex/CoveringMap.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ theorem isCoveringMapOn_zpow (n : ℤ) (hn : (n : 𝕜) ≠ 0) :
8989
refine .of_isCoveringMap_restrictPreimage _ (by simp) ?_ ?_
9090
· convert isClosed_singleton (x := (0 : 𝕜)).isOpen_compl using 1
9191
ext; simp [this]
92-
· convert (isCoveringMap_zpow n hn).comp_homeomorph (.setCongr _) using 1
92+
· convert (isCoveringMap_zpow n hn).comp_homeomorph (.ofEqSubtypes _) using 1
9393
ext; simpa using (this _).not
9494

9595
attribute [-instance] Units.mulAction'
@@ -103,9 +103,9 @@ theorem isQuotientCoveringMap_npow (n : ℕ) (hn : (n : 𝕜) ≠ 0)
103103
(by fun_prop) (.restrictPreimage _ surj)
104104
have : IsQuotientMap fun x : 𝕜ˣ ↦ x ^ n := by
105105
let e := unitsHomeomorphNeZero (G₀ := 𝕜)
106-
convert (e.symm.isQuotientMap.comp this).comp (e.trans (.setCongr _)).isQuotientMap
106+
convert (e.symm.isQuotientMap.comp this).comp (e.trans (.ofEqSubtypes _)).isQuotientMap
107107
· exact (e.left_inv _).symm
108-
· ext; simp [NeZero.ne]; rfl
108+
· ext; simp [NeZero.ne]
109109
refine this.isQuotientCoveringMap_of_subgroup _
110110
(Set.Finite.isDiscrete <| inferInstanceAs (Finite (rootsOfUnity ..))) ?_
111111
simp [mul_pow, mul_inv_eq_one, eq_comm]

Mathlib/Analysis/Normed/Group/FunctionSeries.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ theorem tendstoUniformlyOn_tsum_of_cofinite_eventually {ι : Type*} {f : ι →
7474
apply lt_of_le_of_lt _ (ht n (Finset.union_subset_right hn))
7575
apply (norm_tsum_le_tsum_norm (A.subtype _)).trans
7676
apply (A.subtype _).tsum_le_tsum _ (hu.subtype _)
77-
simp only [comp_apply, Subtype.forall, imp_false]
77+
simp only [comp_apply, Subtype.forall]
7878
apply fun i hi => HN i ?_ x hx
7979
have : i ∉ hN.toFinset := fun hg ↦ hi (Finset.union_subset_left hn hg)
8080
simp_all

Mathlib/Data/DFinsupp/Interval.lean

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,20 +182,19 @@ lemma card_uIcc : #(uIcc f g) = ∏ i ∈ f.support ∪ g.support, #(uIcc (f i)
182182

183183
end Lattice
184184

185-
section CanonicallyOrdered
185+
section IsBotZeroClass
186186

187187
variable [DecidableEq ι] [∀ i, DecidableEq (α i)]
188-
variable [∀ i, AddCommMonoid (α i)] [∀ i, PartialOrder (α i)] [∀ i, CanonicallyOrderedAdd (α i)]
188+
variable [∀ i, AddCommMonoid (α i)] [∀ i, PartialOrder (α i)] [∀ i, IsBotZeroClass (α i)]
189189
[∀ i, OrderBot (α i)] [∀ i, LocallyFiniteOrder (α i)]
190190
variable (f : Π₀ i, α i)
191191

192192
lemma card_Iic : #(Iic f) = ∏ i ∈ f.support, #(Iic (f i)) := by
193-
simp_rw [Iic_eq_Icc, card_Icc, DFinsupp.bot_eq_zero, support_zero, empty_union, zero_apply,
194-
bot_eq_zero]
193+
simp [Iic_eq_Icc, card_Icc, bot_eq_zero]
195194

196195
lemma card_Iio : #(Iio f) = (∏ i ∈ f.support, #(Iic (f i))) - 1 := by
197196
rw [card_Iio_eq_card_Iic_sub_one, card_Iic]
198197

199-
end CanonicallyOrdered
198+
end IsBotZeroClass
200199

201200
end DFinsupp

Mathlib/Data/DFinsupp/Lex.lean

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,17 +261,27 @@ section OrderedAddMonoid
261261
variable [LinearOrder ι]
262262

263263
instance Lex.orderBot [∀ i, AddCommMonoid (α i)] [∀ i, PartialOrder (α i)]
264-
[∀ i, CanonicallyOrderedAdd (α i)] :
264+
[∀ i, IsBotZeroClass (α i)] :
265265
OrderBot (Lex (Π₀ i, α i)) where
266266
bot := 0
267267
bot_le _ := DFinsupp.toLex_monotone bot_le
268268

269+
instance Lex.isBotZeroClass [∀ i, AddCommMonoid (α i)] [∀ i, PartialOrder (α i)]
270+
[∀ i, IsBotZeroClass (α i)] :
271+
IsBotZeroClass (Lex (Π₀ i, α i)) where
272+
isBot_zero := isBot_bot
273+
269274
instance Colex.orderBot [∀ i, AddCommMonoid (α i)] [∀ i, PartialOrder (α i)]
270-
[∀ i, CanonicallyOrderedAdd (α i)] :
275+
[∀ i, IsBotZeroClass (α i)] :
271276
OrderBot (Colex (Π₀ i, α i)) where
272277
bot := 0
273278
bot_le _ := DFinsupp.toColex_monotone bot_le
274279

280+
instance Colex.isBotZeroClass [∀ i, AddCommMonoid (α i)] [∀ i, PartialOrder (α i)]
281+
[∀ i, IsBotZeroClass (α i)] :
282+
IsBotZeroClass (Colex (Π₀ i, α i)) where
283+
isBot_zero := isBot_bot
284+
275285
instance Lex.isOrderedCancelAddMonoid [∀ i, AddCommMonoid (α i)] [∀ i, PartialOrder (α i)]
276286
[∀ i, IsOrderedCancelAddMonoid (α i)] :
277287
IsOrderedCancelAddMonoid (Lex (Π₀ i, α i)) where

Mathlib/Data/DFinsupp/Order.lean

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -189,17 +189,23 @@ end Module
189189

190190
section PartialOrder
191191

192-
variable (α) [∀ i, AddCommMonoid (α i)] [∀ i, PartialOrder (α i)] [∀ i, CanonicallyOrderedAdd (α i)]
192+
variable (α) [∀ i, AddCommMonoid (α i)] [∀ i, PartialOrder (α i)]
193193

194-
instance : OrderBot (Π₀ i, α i) where
194+
instance [∀ i, IsBotZeroClass (α i)] : OrderBot (Π₀ i, α i) where
195195
bot := 0
196-
bot_le := by simp only [le_def, coe_zero, Pi.zero_apply, imp_true_iff, zero_le]
196+
bot_le := by simp [le_def]
197+
198+
instance [∀ i, IsBotZeroClass (α i)] : IsBotZeroClass (Π₀ i, α i) where
199+
isBot_zero := isBot_bot
197200

198201
variable {α}
199202

200-
protected theorem bot_eq_zero : (⊥ : Π₀ i, α i) = 0 :=
203+
@[deprecated _root_.bot_eq_zero (since := "2026-05-07")]
204+
protected theorem bot_eq_zero [∀ i, IsBotZeroClass (α i)] : (⊥ : Π₀ i, α i) = 0 :=
201205
rfl
202206

207+
variable [∀ i, CanonicallyOrderedAdd (α i)]
208+
203209
@[simp]
204210
theorem add_eq_zero_iff (f g : Π₀ i, α i) : f + g = 0 ↔ f = 0 ∧ g = 0 := by
205211
simp [DFunLike.ext_iff, forall_and]
@@ -289,25 +295,21 @@ theorem subset_support_tsub : f.support \ g.support ⊆ (f - g).support := by
289295
end PartialOrder
290296

291297
section LinearOrder
292-
variable [∀ i, AddCommMonoid (α i)] [∀ i, LinearOrder (α i)] [∀ i, CanonicallyOrderedAdd (α i)]
298+
variable [∀ i, AddCommMonoid (α i)] [∀ i, LinearOrder (α i)] [∀ i, IsBotZeroClass (α i)]
293299
[DecidableEq ι] {f g : Π₀ i, α i}
294300

295301
@[simp]
296302
theorem support_inf : (f ⊓ g).support = f.support ∩ g.support := by
297303
ext
298-
simp only [inf_apply, mem_support_iff, Ne, Finset.mem_inter]
299-
simp only [← nonpos_iff_eq_zero, min_le_iff, not_or]
304+
simp
300305

301306
@[simp]
302307
theorem support_sup : (f ⊔ g).support = f.support ∪ g.support := by
303308
ext
304-
simp only [Finset.mem_union, mem_support_iff, sup_apply, Ne, ← nonpos_iff_eq_zero, sup_le_iff,
305-
Classical.not_and_iff_not_or_not]
309+
simp [imp_iff_not_or]
306310

307311
nonrec theorem disjoint_iff : Disjoint f g ↔ Disjoint f.support g.support := by
308-
rw [disjoint_iff, disjoint_iff, DFinsupp.bot_eq_zero, ← DFinsupp.support_eq_empty,
309-
DFinsupp.support_inf]
310-
rfl
312+
simp [disjoint_iff, bot_eq_zero, ← DFinsupp.support_eq_empty]
311313

312314
end LinearOrder
313315

Mathlib/Data/DFinsupp/WellFounded.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,13 @@ theorem Lex.wellFounded' (hbot : ∀ ⦃i a⦄, ¬s i a 0) (hs : ∀ i, WellFoun
167167
end Zero
168168

169169
instance Lex.wellFoundedLT [LT ι] [@Std.Trichotomous ι (· < ·)] [hι : WellFoundedGT ι]
170-
[∀ i, AddMonoid (α i)] [∀ i, PartialOrder (α i)] [∀ i, CanonicallyOrderedAdd (α i)]
170+
[∀ i, AddMonoid (α i)] [∀ i, PartialOrder (α i)] [∀ i, IsBotZeroClass (α i)]
171171
[hα : ∀ i, WellFoundedLT (α i)] :
172172
WellFoundedLT (Lex (Π₀ i, α i)) :=
173173
⟨Lex.wellFounded' (fun _ _ => not_lt_zero) (fun i => (hα i).wf) hι.wf⟩
174174

175175
instance Colex.wellFoundedLT [LT ι] [@Std.Trichotomous ι (· < ·)] [WellFoundedLT ι]
176-
[∀ i, AddMonoid (α i)] [∀ i, PartialOrder (α i)] [∀ i, CanonicallyOrderedAdd (α i)]
176+
[∀ i, AddMonoid (α i)] [∀ i, PartialOrder (α i)] [∀ i, IsBotZeroClass (α i)]
177177
[∀ i, WellFoundedLT (α i)] :
178178
WellFoundedLT (Colex (Π₀ i, α i)) :=
179179
Lex.wellFoundedLT (ι := ιᵒᵈ)
@@ -236,7 +236,7 @@ protected theorem DFinsupp.wellFoundedLT [∀ i, Zero (α i)] [∀ i, Preorder (
236236
exact ⟨i, fun j hj ↦ Quot.sound (he j hj), hl⟩⟩
237237

238238
instance DFinsupp.wellFoundedLT'
239-
[∀ i, AddMonoid (α i)] [∀ i, PartialOrder (α i)] [∀ i, CanonicallyOrderedAdd (α i)]
239+
[∀ i, AddMonoid (α i)] [∀ i, PartialOrder (α i)] [∀ i, IsBotZeroClass (α i)]
240240
[∀ i, WellFoundedLT (α i)] : WellFoundedLT (Π₀ i, α i) :=
241241
DFinsupp.wellFoundedLT fun _ _ => not_lt_zero
242242

Mathlib/Data/Finsupp/Interval.lean

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,19 +119,18 @@ theorem card_uIcc :
119119

120120
end Lattice
121121

122-
section CanonicallyOrdered
122+
section IsBotZeroClass
123123

124-
variable [AddCommMonoid α] [PartialOrder α] [CanonicallyOrderedAdd α]
124+
variable [AddCommMonoid α] [PartialOrder α] [IsBotZeroClass α]
125125
[OrderBot α] [LocallyFiniteOrder α]
126126
variable [DecidableEq ι] [DecidableEq α] (f : ι →₀ α)
127127

128128
theorem card_Iic : #(Iic f) = ∏ i ∈ f.support, #(Iic (f i)) := by
129-
classical simp_rw [Iic_eq_Icc, card_Icc, Finsupp.bot_eq_zero, support_zero, empty_union,
130-
zero_apply, bot_eq_zero]
129+
classical simp [Iic_eq_Icc, card_Icc, bot_eq_zero]
131130

132131
theorem card_Iio : #(Iio f) = ∏ i ∈ f.support, #(Iic (f i)) - 1 := by
133132
rw [card_Iio_eq_card_Iic_sub_one, card_Iic]
134133

135-
end CanonicallyOrdered
134+
end IsBotZeroClass
136135

137136
end Finsupp

Mathlib/Data/Finsupp/Lex.lean

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,16 +226,24 @@ section OrderedAddMonoid
226226

227227
variable [LinearOrder α]
228228

229-
instance Lex.orderBot [AddCommMonoid N] [PartialOrder N] [CanonicallyOrderedAdd N] :
229+
instance Lex.orderBot [AddCommMonoid N] [PartialOrder N] [IsBotZeroClass N] :
230230
OrderBot (Lex (α →₀ N)) where
231231
bot := 0
232232
bot_le _ := Finsupp.toLex_monotone bot_le
233233

234-
instance Colex.orderBot [AddCommMonoid N] [PartialOrder N] [CanonicallyOrderedAdd N] :
234+
instance Lex.isBotZeroClass [AddCommMonoid N] [PartialOrder N] [IsBotZeroClass N] :
235+
IsBotZeroClass (Lex (α →₀ N)) where
236+
isBot_zero := isBot_bot
237+
238+
instance Colex.orderBot [AddCommMonoid N] [PartialOrder N] [IsBotZeroClass N] :
235239
OrderBot (Colex (α →₀ N)) where
236240
bot := 0
237241
bot_le _ := Finsupp.toColex_monotone bot_le
238242

243+
instance Colex.isBotZeroClass [AddCommMonoid N] [PartialOrder N] [IsBotZeroClass N] :
244+
IsBotZeroClass (Colex (α →₀ N)) where
245+
isBot_zero := isBot_bot
246+
239247
instance Lex.isOrderedCancelAddMonoid
240248
[AddCommMonoid N] [PartialOrder N] [IsOrderedCancelAddMonoid N] :
241249
IsOrderedCancelAddMonoid (Lex (α →₀ N)) where

Mathlib/Data/Finsupp/Order.lean

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,21 @@ end SMulWithZero
209209

210210
section PartialOrder
211211

212-
variable [AddCommMonoid α] [PartialOrder α] [CanonicallyOrderedAdd α] {f g : ι →₀ α}
212+
variable [AddCommMonoid α] [PartialOrder α] {f g : ι →₀ α}
213213

214-
instance orderBot : OrderBot (ι →₀ α) where
214+
instance orderBot [IsBotZeroClass α] : OrderBot (ι →₀ α) where
215215
bot := 0
216-
bot_le := by simp only [le_def, coe_zero, Pi.zero_apply, imp_true_iff, zero_le]
216+
bot_le := by simp [le_def]
217217

218-
protected theorem bot_eq_zero : (⊥ : ι →₀ α) = 0 :=
218+
instance [IsBotZeroClass α] : IsBotZeroClass (ι →₀ α) where
219+
isBot_zero := isBot_bot
220+
221+
@[deprecated _root_.bot_eq_zero (since := "2026-05-07")]
222+
protected theorem bot_eq_zero [IsBotZeroClass α] : (⊥ : ι →₀ α) = 0 :=
219223
rfl
220224

225+
variable [CanonicallyOrderedAdd α]
226+
221227
@[simp]
222228
theorem add_eq_zero_iff (f g : ι →₀ α) : f + g = 0 ↔ f = 0 ∧ g = 0 := by
223229
simp [DFunLike.ext_iff, forall_and]
@@ -298,32 +304,26 @@ end PartialOrder
298304

299305
section LinearOrder
300306

301-
variable [AddCommMonoid α] [LinearOrder α] [CanonicallyOrderedAdd α]
307+
variable [AddCommMonoid α] [LinearOrder α] [IsBotZeroClass α]
302308

303309
@[simp]
304310
theorem support_inf [DecidableEq ι] (f g : ι →₀ α) : (f ⊓ g).support = f.support ∩ g.support := by
305311
ext
306-
simp only [inf_apply, mem_support_iff, Ne,
307-
Finset.mem_inter]
308-
simp only [← nonpos_iff_eq_zero, min_le_iff, not_or]
312+
simp
309313

310314
@[simp]
311315
theorem support_sup [DecidableEq ι] (f g : ι →₀ α) : (f ⊔ g).support = f.support ∪ g.support := by
312316
ext
313-
simp only [mem_support_iff, Ne, sup_apply, ← nonpos_iff_eq_zero, sup_le_iff, mem_union,
314-
not_and_or]
317+
simp [imp_iff_not_or]
315318

316319
nonrec theorem disjoint_iff {f g : ι →₀ α} : Disjoint f g ↔ Disjoint f.support g.support := by
317320
classical
318-
rw [disjoint_iff, disjoint_iff, Finsupp.bot_eq_zero, ← Finsupp.support_eq_empty,
319-
Finsupp.support_inf]
320-
rfl
321+
simp [disjoint_iff, bot_eq_zero, ← Finsupp.support_eq_empty]
321322

322323
end LinearOrder
323324

324325
/-! ### Some lemmas about `ℕ` -/
325326

326-
327327
section Nat
328328

329329
theorem sub_single_one_add {a : ι} {u u' : ι →₀ ℕ} (h : u a ≠ 0) :

Mathlib/Data/Finsupp/WellFounded.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ theorem Lex.wellFounded' (hbot : ∀ ⦃n⦄, ¬s n 0) (hs : WellFounded s)
5353
InvImage.wf _ (DFinsupp.Lex.wellFounded' (fun _ => hbot) (fun _ => hs) hr)
5454

5555
instance Lex.wellFoundedLT {α N} [LT α] [@Std.Trichotomous α (· < ·)] [hα : WellFoundedGT α]
56-
[AddMonoid N] [PartialOrder N] [CanonicallyOrderedAdd N]
56+
[AddMonoid N] [PartialOrder N] [IsBotZeroClass N]
5757
[hN : WellFoundedLT N] : WellFoundedLT (Lex (α →₀ N)) :=
5858
⟨Lex.wellFounded' (fun _ => not_lt_zero) hN.wf hα.wf⟩
5959

6060
instance Colex.wellFoundedLT {α N} [LT α] [@Std.Trichotomous α (· < ·)] [WellFoundedLT α]
61-
[AddMonoid N] [PartialOrder N] [CanonicallyOrderedAdd N]
61+
[AddMonoid N] [PartialOrder N] [IsBotZeroClass N]
6262
[WellFoundedLT N] : WellFoundedLT (Colex (α →₀ N)) :=
6363
Lex.wellFoundedLT (α := αᵒᵈ)
6464

@@ -81,7 +81,7 @@ protected theorem wellFoundedLT [Preorder N] [WellFoundedLT N] (hbot : ∀ n : N
8181
⟨InvImage.wf toDFinsupp (DFinsupp.wellFoundedLT fun _ a => hbot a).wf⟩
8282

8383
instance wellFoundedLT' {N}
84-
[AddMonoid N] [PartialOrder N] [CanonicallyOrderedAdd N] [WellFoundedLT N] :
84+
[AddMonoid N] [PartialOrder N] [IsBotZeroClass N] [WellFoundedLT N] :
8585
WellFoundedLT (α →₀ N) :=
8686
Finsupp.wellFoundedLT fun _ => not_lt_zero
8787

0 commit comments

Comments
 (0)