Skip to content

Commit 8164b50

Browse files
chore: tidy various files (#21475)
1 parent 67a9de9 commit 8164b50

File tree

25 files changed

+92
-115
lines changed

25 files changed

+92
-115
lines changed

Mathlib/Algebra/BigOperators/Fin.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,10 +392,10 @@ def finSigmaFinEquiv {m : ℕ} {n : Fin m → ℕ} : (i : Fin m) × Fin (n i)
392392
@[simp]
393393
theorem finSigmaFinEquiv_apply {m : ℕ} {n : Fin m → ℕ} (k : (i : Fin m) × Fin (n i)) :
394394
(finSigmaFinEquiv k : ℕ) = ∑ i : Fin k.1, n (Fin.castLE k.1.2.le i) + k.2 := by
395-
induction m
396-
· exact k.fst.elim0
397-
rename_i m ih
398-
rcases k with ⟨⟨iv,hi⟩,j⟩
395+
induction m with
396+
| zero => exact k.fst.elim0
397+
| succ m ih =>
398+
rcases k with ⟨⟨iv, hi⟩, j⟩
399399
rw [finSigmaFinEquiv]
400400
unfold finSumFinEquiv
401401
simp only [Equiv.coe_fn_mk, Equiv.sigmaCongrLeft, Equiv.coe_fn_symm_mk, Equiv.instTrans_trans,

Mathlib/Algebra/FreeMonoid/Basic.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,9 @@ isomorphic"]
434434
def freeMonoidCongr (e : α ≃ β) : FreeMonoid α ≃* FreeMonoid β where
435435
toFun := FreeMonoid.map ⇑e
436436
invFun := FreeMonoid.map ⇑e.symm
437-
left_inv := fun _ => map_symm_apply_map_eq e
438-
right_inv := fun _ => map_apply_map_symm_eq e
439-
map_mul' := (by simp [map_mul])
437+
left_inv _ := map_symm_apply_map_eq e
438+
right_inv _ := map_apply_map_symm_eq e
439+
map_mul' := by simp [map_mul]
440440

441441
@[to_additive (attr := simp)]
442442
theorem freeMonoidCongr_of (e : α ≃ β) (a : α) : freeMonoidCongr e (of a) = of (e a) := rfl

Mathlib/Algebra/Homology/Embedding/Basic.lean

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,7 @@ lemma not_mem_range_embeddingUpIntLE_iff (n : ℤ) :
219219
constructor
220220
· intro h
221221
by_contra!
222-
simp only [Int.not_lt] at this
223-
obtain ⟨k, rfl⟩ := Int.le.dest this
224-
exact (h k) (by simp)
222+
exact h (p - n).natAbs (by simp; omega)
225223
· intros
226224
dsimp
227225
omega
@@ -231,9 +229,7 @@ lemma not_mem_range_embeddingUpIntGE_iff (n : ℤ) :
231229
constructor
232230
· intro h
233231
by_contra!
234-
simp only [Int.not_lt] at this
235-
obtain ⟨k, rfl⟩ := Int.le.dest this
236-
exact (h k) (by simp)
232+
exact h (n - p).natAbs (by simp; omega)
237233
· intros
238234
dsimp
239235
omega

Mathlib/Algebra/Homology/QuasiIso.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def quasiIso [CategoryWithHomology C] :
294294
variable {C c} [CategoryWithHomology C]
295295

296296
@[simp]
297-
lemma mem_quasiIso_iff (f : K ⟶ L) : quasiIso C c f ↔ QuasiIso f := by rfl
297+
lemma mem_quasiIso_iff (f : K ⟶ L) : quasiIso C c f ↔ QuasiIso f := by rfl
298298

299299
instance : (quasiIso C c).IsMultiplicative where
300300
id_mem _ := by

Mathlib/Algebra/MonoidAlgebra/Division.lean

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ theorem zero_divOf (g : G) : (0 : k[G]) /ᵒᶠ g = 0 :=
6969

7070
@[simp]
7171
theorem divOf_zero (x : k[G]) : x /ᵒᶠ 0 = x := by
72-
refine Finsupp.ext fun _ => ?_ -- Porting note (https://github.com/leanprover-community/mathlib4/issues/11041): `ext` doesn't work
72+
ext
7373
simp only [AddMonoidAlgebra.divOf_apply, zero_add]
7474

7575
theorem add_divOf (x y : k[G]) (g : G) : (x + y) /ᵒᶠ g = x /ᵒᶠ g + y /ᵒᶠ g :=
7676
map_add (Finsupp.comapDomain.addMonoidHom _) _ _
7777

7878
theorem divOf_add (x : k[G]) (a b : G) : x /ᵒᶠ (a + b) = x /ᵒᶠ a /ᵒᶠ b := by
79-
refine Finsupp.ext fun _ => ?_ -- Porting note (https://github.com/leanprover-community/mathlib4/issues/11041): `ext` doesn't work
79+
ext
8080
simp only [AddMonoidAlgebra.divOf_apply, add_assoc]
8181

8282
/-- A bundled version of `AddMonoidAlgebra.divOf`. -/
@@ -93,13 +93,13 @@ noncomputable def divOfHom : Multiplicative G →* AddMonoid.End k[G] where
9393
(divOf_add _ _ _)
9494

9595
theorem of'_mul_divOf (a : G) (x : k[G]) : of' k G a * x /ᵒᶠ a = x := by
96-
refine Finsupp.ext fun _ => ?_ -- Porting note (https://github.com/leanprover-community/mathlib4/issues/11041): `ext` doesn't work
96+
ext
9797
rw [AddMonoidAlgebra.divOf_apply, of'_apply, single_mul_apply_aux, one_mul]
9898
intro c hc
9999
exact add_right_inj _
100100

101101
theorem mul_of'_divOf (x : k[G]) (a : G) : x * of' k G a /ᵒᶠ a = x := by
102-
refine Finsupp.ext fun _ => ?_ -- Porting note (https://github.com/leanprover-community/mathlib4/issues/11041): `ext` doesn't work
102+
ext
103103
rw [AddMonoidAlgebra.divOf_apply, of'_apply, mul_single_apply_aux, mul_one]
104104
intro c hc
105105
rw [add_comm]
@@ -133,14 +133,14 @@ theorem modOf_apply_self_add (x : k[G]) (g : G) (d : G) : (x %ᵒᶠ g) (g + d)
133133
modOf_apply_of_exists_add _ _ _ ⟨_, rfl⟩
134134

135135
theorem of'_mul_modOf (g : G) (x : k[G]) : of' k G g * x %ᵒᶠ g = 0 := by
136-
refine Finsupp.ext fun g' => ?_ -- Porting note (https://github.com/leanprover-community/mathlib4/issues/11041): `ext g'` doesn't work
136+
ext g'
137137
rw [Finsupp.zero_apply]
138138
obtain ⟨d, rfl⟩ | h := em (∃ d, g' = g + d)
139139
· rw [modOf_apply_self_add]
140140
· rw [modOf_apply_of_not_exists_add _ _ _ h, of'_apply, single_mul_apply_of_not_exists_add _ _ h]
141141

142142
theorem mul_of'_modOf (x : k[G]) (g : G) : x * of' k G g %ᵒᶠ g = 0 := by
143-
refine Finsupp.ext fun g' => ?_ -- Porting note (https://github.com/leanprover-community/mathlib4/issues/11041): `ext g'` doesn't work
143+
ext g'
144144
rw [Finsupp.zero_apply]
145145
obtain ⟨d, rfl⟩ | h := em (∃ d, g' = g + d)
146146
· rw [modOf_apply_self_add]
@@ -152,7 +152,7 @@ theorem of'_modOf (g : G) : of' k G g %ᵒᶠ g = 0 := by
152152

153153
theorem divOf_add_modOf (x : k[G]) (g : G) :
154154
of' k G g * (x /ᵒᶠ g) + x %ᵒᶠ g = x := by
155-
refine Finsupp.ext fun g' => ?_ -- Porting note (https://github.com/leanprover-community/mathlib4/issues/11041): `ext` doesn't work
155+
ext g'
156156
rw [Finsupp.add_apply] -- Porting note: changed from `simp_rw` which can't see through the type
157157
obtain ⟨d, rfl⟩ | h := em (∃ d, g' = g + d)
158158
swap

Mathlib/AlgebraicGeometry/AffineScheme.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ lemma isoSpec_hom : hU.isoSpec.hom = U.toSpecΓ := rfl
321321
lemma toSpecΓ_isoSpec_inv : U.toSpecΓ ≫ hU.isoSpec.inv = 𝟙 _ := hU.isoSpec.hom_inv_id
322322

323323
@[reassoc (attr := simp)]
324-
lemma isoSpec_inv_toSpecΓ : hU.isoSpec.inv ≫ U.toSpecΓ = 𝟙 _ := hU.isoSpec.inv_hom_id
324+
lemma isoSpec_inv_toSpecΓ : hU.isoSpec.inv ≫ U.toSpecΓ = 𝟙 _ := hU.isoSpec.inv_hom_id
325325

326326
open IsLocalRing in
327327
lemma isoSpec_hom_base_apply (x : U) :

Mathlib/Analysis/Analytic/Basic.lean

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,10 @@ theorem radius_le_smul {p : FormalMultilinearSeries 𝕜 E F} {c : 𝕜} : p.rad
335335
gcongr
336336
exact h n
337337

338-
theorem radius_smul_eq (p : FormalMultilinearSeries 𝕜 E F) {c : 𝕜}
339-
(hc : c ≠ 0) : (c • p).radius = p.radius := by
338+
theorem radius_smul_eq (p : FormalMultilinearSeries 𝕜 E F) {c : 𝕜} (hc : c ≠ 0) :
339+
(c • p).radius = p.radius := by
340340
apply eq_of_le_of_le _ radius_le_smul
341-
conv => rhs; rw [show p = c⁻¹ • (c • p) by simp [smul_smul, inv_mul_cancel₀ hc]]
342-
apply radius_le_smul
341+
exact radius_le_smul.trans_eq (congr_arg _ <| inv_smul_smul₀ hc p)
343342

344343
@[simp]
345344
theorem radius_shift (p : FormalMultilinearSeries 𝕜 E F) : p.shift.radius = p.radius := by

Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Basic.lean

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -392,11 +392,7 @@ lemma CStarAlgebra.spectralOrderedRing : @StarOrderedRing A _ (CStarAlgebra.spec
392392
refine ⟨s * s, ?_, by rwa [eq_sub_iff_add_eq', eq_comm] at hs₂⟩
393393
exact AddSubmonoid.subset_closure ⟨s, by simp [hs₁.star_eq, sq]⟩
394394
· rintro ⟨p, hp, rfl⟩
395-
show IsSelfAdjoint (x + p - x) ∧
396-
QuasispectrumRestricts (x + p - x) ContinuousMap.realToNNReal
397-
simp only [add_sub_cancel_left]
398-
--suffices IsSelfAdjoint p ∧ SpectrumRestricts p ContinuousMap.realToNNReal from
399-
--⟨by simpa using this.1, by simpa using this.2⟩
395+
simp only [spectralOrder, add_sub_cancel_left]
400396
induction hp using AddSubmonoid.closure_induction with
401397
| mem x hx =>
402398
obtain ⟨s, rfl⟩ := hx

Mathlib/Data/Finset/Filter.lean

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,8 @@ lemma _root_.Set.pairwiseDisjoint_filter [DecidableEq β] (f : α → β) (s : S
212212
theorem disjoint_filter_and_not_filter :
213213
Disjoint (s.filter (fun x ↦ p x ∧ ¬q x)) (s.filter (fun x ↦ q x ∧ ¬p x)) := by
214214
intro _ htp htq
215-
simp [bot_eq_empty, le_eq_subset, subset_empty]
216-
by_contra hn
217-
rw [← not_nonempty_iff_eq_empty, not_not] at hn
218-
obtain ⟨_, hx⟩ := hn
215+
simp only [bot_eq_empty, le_eq_subset, subset_empty, ← not_nonempty_iff_eq_empty]
216+
rintro ⟨_, hx⟩
219217
exact (mem_filter.mp (htq hx)).2.2 (mem_filter.mp (htp hx)).2.1
220218

221219
variable {p q}

Mathlib/Data/Finset/Lattice/Fold.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -650,9 +650,9 @@ theorem sup_mem_of_nonempty (hs : s.Nonempty) : s.sup f ∈ f '' s := by
650650
| empty => exfalso; simp only [Finset.not_nonempty_empty] at hs
651651
| @insert a s _ h =>
652652
rw [Finset.sup_insert (b := a) (s := s) (f := f)]
653-
by_cases hs : s = ∅
654-
· simp [hs]
655-
· rw [← ne_eq, ← Finset.nonempty_iff_ne_empty] at hs
653+
cases s.eq_empty_or_nonempty with
654+
| inl hs => simp [hs]
655+
| inr hs =>
656656
simp only [Finset.coe_insert]
657657
rcases le_total (f a) (s.sup f) with (ha | ha)
658658
· rw [sup_eq_right.mpr ha]

0 commit comments

Comments
 (0)