Skip to content

Commit 3afb029

Browse files
chore: tidy various files (#22894)
1 parent 8b48c43 commit 3afb029

File tree

24 files changed

+88
-112
lines changed

24 files changed

+88
-112
lines changed

Mathlib/Algebra/DirectSum/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ variable {ι : Type*} {α : ι → Type*} {β : ι → Type*} [∀ i, AddCommMon
398398
variable [∀ i, AddCommMonoid (β i)] (f : ∀ (i : ι), α i →+ β i)
399399

400400
/-- create a homomorphism from `⨁ i, α i` to `⨁ i, β i` by giving the component-wise map `f`. -/
401-
def map : (⨁ i, α i) →+ ⨁ i, β i := DFinsupp.mapRange.addMonoidHom f
401+
def map : (⨁ i, α i) →+ ⨁ i, β i := DFinsupp.mapRange.addMonoidHom f
402402

403403
@[simp] lemma map_of [DecidableEq ι] (i : ι) (x : α i) : map f (of α i x) = of β i (f i x) :=
404404
DFinsupp.mapRange_single (hf := fun _ => map_zero _)

Mathlib/Analysis/Normed/Group/Basic.lean

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ lemma ContinuousWithinAt.enorm {s : Set X} {a : X} (h : ContinuousWithinAt f s a
908908

909909
@[fun_prop]
910910
lemma ContinuousOn.enorm (h : ContinuousOn f s) : ContinuousOn (‖f ·‖ₑ) s :=
911-
(ContinuousENorm.continuous_enorm.continuousOn).comp (t := Set.univ) h fun _ _ ↦ trivial
911+
(ContinuousENorm.continuous_enorm.continuousOn).comp (t := Set.univ) h <| Set.mapsTo_univ _ _
912912

913913
end ContinuousENorm
914914

@@ -920,16 +920,16 @@ variable {E : Type*} [TopologicalSpace E] [ENormedMonoid E]
920920
lemma enorm_mul_le' (a b : E) : ‖a * b‖ₑ ≤ ‖a‖ₑ + ‖b‖ₑ := ENormedMonoid.enorm_mul_le a b
921921

922922
@[to_additive (attr := simp) enorm_eq_zero]
923-
lemma enorm_eq_zero' {a : E} :
924-
‖a‖ₑ = 0 ↔ a = 1 := by simp [enorm, ENormedMonoid.enorm_eq_zero]
923+
lemma enorm_eq_zero' {a : E} : ‖a‖ₑ = 0 ↔ a = 1 := by
924+
simp [enorm, ENormedMonoid.enorm_eq_zero]
925925

926926
@[to_additive enorm_ne_zero]
927-
lemma enorm_ne_zero' {a : E} :
928-
‖a‖ₑ ≠ 0 ↔ a ≠ 1 := enorm_eq_zero'.ne
927+
lemma enorm_ne_zero' {a : E} : ‖a‖ₑ ≠ 0 ↔ a ≠ 1 :=
928+
enorm_eq_zero'.ne
929929

930930
@[to_additive (attr := simp) enorm_pos]
931-
lemma enorm_pos' {a : E} :
932-
0 < ‖a‖ₑ ↔ a ≠ 1 := pos_iff_ne_zero.trans enorm_ne_zero'
931+
lemma enorm_pos' {a : E} : 0 < ‖a‖ₑ ↔ a ≠ 1 :=
932+
pos_iff_ne_zero.trans enorm_ne_zero'
933933

934934
end ENormedMonoid
935935

Mathlib/Analysis/Normed/Group/Continuity.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ instance SeminormedGroup.toContinuousENorm [SeminormedGroup E] : ContinuousENorm
9898
@[to_additive]
9999
instance NormedGroup.toENormedMonoid {F : Type*} [NormedGroup F] : ENormedMonoid F where
100100
enorm_eq_zero := by simp [enorm_eq_nnnorm]
101-
enorm_mul_le := by simp [enorm_eq_nnnorm, ← coe_add, nnnorm_mul_le']
101+
enorm_mul_le := by simp [enorm_eq_nnnorm, ← coe_add, nnnorm_mul_le']
102102

103103
@[to_additive]
104104
instance NormedCommGroup.toENormedCommMonoid [NormedCommGroup E] : ENormedCommMonoid E where

Mathlib/Analysis/SpecialFunctions/Integrals.lean

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -382,17 +382,15 @@ theorem integral_rpow {r : ℝ} (h : -1 < r ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [[a,
382382
(∫ x in a..b, (x : ℂ) ^ (r : ℂ)) = ((b : ℂ) ^ (r + 1 : ℂ) - (a : ℂ) ^ (r + 1 : ℂ)) / (r + 1) :=
383383
integral_cpow h'
384384
apply_fun Complex.re at this; convert this
385-
· simp_rw [intervalIntegral_eq_integral_uIoc, Complex.real_smul, Complex.re_ofReal_mul]
386-
have : Complex.re = RCLike.re := rfl
387-
rw [this, ← integral_re]
388-
· rfl
385+
· simp_rw [intervalIntegral_eq_integral_uIoc, Complex.real_smul, Complex.re_ofReal_mul, rpow_def,
386+
← RCLike.re_eq_complex_re, smul_eq_mul]
387+
rw [integral_re]
389388
refine intervalIntegrable_iff.mp ?_
390389
rcases h' with h' | h'
391390
· exact intervalIntegrable_cpow' h'
392391
· exact intervalIntegrable_cpow (Or.inr h'.2)
393392
· rw [(by push_cast; rfl : (r : ℂ) + 1 = ((r + 1 : ℝ) : ℂ))]
394-
simp_rw [div_eq_inv_mul, ← Complex.ofReal_inv, Complex.re_ofReal_mul, Complex.sub_re]
395-
rfl
393+
simp_rw [div_eq_inv_mul, ← Complex.ofReal_inv, Complex.re_ofReal_mul, Complex.sub_re, rpow_def]
396394

397395
theorem integral_zpow {n : ℤ} (h : 0 ≤ n ∨ n ≠ -1 ∧ (0 : ℝ) ∉ [[a, b]]) :
398396
∫ x in a..b, x ^ n = (b ^ (n + 1) - a ^ (n + 1)) / (n + 1) := by

Mathlib/CategoryTheory/Limits/Preserves/Shapes/BinaryProducts.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ lemma preservesBinaryProducts_of_isIso_prodComparison
112112
PreservesLimitsOfShape (Discrete WalkingPair) G where
113113
preservesLimit := by
114114
intro K
115-
have : PreservesLimit (pair (K.obj ⟨WalkingPair.left⟩) (K.obj ⟨WalkingPair.right⟩)) G := by
116-
apply PreservesLimitPair.of_iso_prod_comparison
115+
have : PreservesLimit (pair (K.obj ⟨WalkingPair.left⟩) (K.obj ⟨WalkingPair.right⟩)) G :=
116+
PreservesLimitPair.of_iso_prod_comparison ..
117117
apply preservesLimit_of_iso_diagram G (diagramIsoPair K).symm
118118

119119
end
@@ -193,8 +193,8 @@ lemma preservesBinaryCoproducts_of_isIso_coprodComparison
193193
PreservesColimitsOfShape (Discrete WalkingPair) G where
194194
preservesColimit := by
195195
intro K
196-
have : PreservesColimit (pair (K.obj ⟨WalkingPair.left⟩) (K.obj ⟨WalkingPair.right⟩)) G := by
197-
apply PreservesColimitPair.of_iso_coprod_comparison
196+
have : PreservesColimit (pair (K.obj ⟨WalkingPair.left⟩) (K.obj ⟨WalkingPair.right⟩)) G :=
197+
PreservesColimitPair.of_iso_coprod_comparison ..
198198
apply preservesColimit_of_iso_diagram G (diagramIsoPair K).symm
199199

200200
end

Mathlib/CategoryTheory/Monoidal/Yoneda.lean

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,10 @@ lemma IsCommMon.ofRepresentableBy (F : Cᵒᵖ ⥤ CommMonCat)
210210
IsCommMon X := by
211211
letI : Mon_Class X := Mon_Class.ofRepresentableBy X (F ⋙ forget₂ CommMonCat MonCat) α
212212
have : μ = α.homEquiv.symm (α.homEquiv (fst X X) * α.homEquiv (snd X X)) := rfl
213-
exact ⟨by simp_rw [this, ←α.homEquiv.apply_eq_iff_eq, α.homEquiv_comp, Functor.comp_map,
213+
constructor
214+
simp_rw [this, ← α.homEquiv.apply_eq_iff_eq, α.homEquiv_comp, Functor.comp_map,
214215
ConcreteCategory.forget_map_eq_coe, Equiv.apply_symm_apply, map_mul,
215-
←ConcreteCategory.forget_map_eq_coe, ←Functor.comp_map, ← α.homEquiv_comp, op_tensorObj,
216-
Functor.comp_obj, braiding_hom_fst, braiding_hom_snd, _root_.mul_comm]
216+
ConcreteCategory.forget_map_eq_coe, ← Functor.comp_map, ← α.homEquiv_comp, op_tensorObj,
217+
Functor.comp_obj, braiding_hom_fst, braiding_hom_snd, _root_.mul_comm]
217218

218219
end CommMon_

Mathlib/CategoryTheory/WithTerminal.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ instance : Limits.HasTerminal (WithTerminal C) := Limits.hasTerminal_of_unique s
280280
/-- The isomorphism between star and an abstract terminal object of `WithTerminal C` -/
281281
@[simps!]
282282
noncomputable def starIsoTerminal : star ≅ ⊤_ (WithTerminal C) :=
283-
starTerminal.uniqueUpToIso (Limits.terminalIsTerminal)
283+
starTerminal.uniqueUpToIso (Limits.terminalIsTerminal)
284284

285285
/-- Lift a functor `F : C ⥤ D` to `WithTerminal C ⥤ D`. -/
286286
@[simps]
@@ -663,7 +663,7 @@ instance : Limits.HasInitial (WithInitial C) := Limits.hasInitial_of_unique star
663663
/-- The isomorphism between star and an abstract initial object of `WithInitial C` -/
664664
@[simps!]
665665
noncomputable def starIsoInitial : star ≅ ⊥_ (WithInitial C) :=
666-
starInitial.uniqueUpToIso (Limits.initialIsInitial)
666+
starInitial.uniqueUpToIso (Limits.initialIsInitial)
667667

668668
/-- Lift a functor `F : C ⥤ D` to `WithInitial C ⥤ D`. -/
669669
@[simps]

Mathlib/Combinatorics/SimpleGraph/Bipartite.lean

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,7 @@ theorem isBipartiteWith_neighborFinset (h : G.IsBipartiteWith s t) (hv : v ∈ s
144144
"above" `v` according to the adjacency relation of `G`. -/
145145
theorem isBipartiteWith_bipartiteAbove (h : G.IsBipartiteWith s t) (hv : v ∈ s) :
146146
G.neighborFinset v = bipartiteAbove G.Adj t v := by
147-
rw [isBipartiteWith_neighborFinset h hv]
148-
rfl
147+
rw [isBipartiteWith_neighborFinset h hv, bipartiteAbove]
149148

150149
/-- If `G.IsBipartiteWith s t` and `v ∈ s`, then the neighbor finset of `v` is a subset of `s`. -/
151150
theorem isBipartiteWith_neighborFinset_subset (h : G.IsBipartiteWith s t) (hv : v ∈ s) :
@@ -177,8 +176,7 @@ theorem isBipartiteWith_neighborFinset' (h : G.IsBipartiteWith s t) (hw : w ∈
177176
"below" `w` according to the adjacency relation of `G`. -/
178177
theorem isBipartiteWith_bipartiteBelow (h : G.IsBipartiteWith s t) (hw : w ∈ t) :
179178
G.neighborFinset w = bipartiteBelow G.Adj s w := by
180-
rw [isBipartiteWith_neighborFinset' h hw]
181-
rfl
179+
rw [isBipartiteWith_neighborFinset' h hw, bipartiteBelow]
182180

183181
/-- If `G.IsBipartiteWith s t` and `w ∈ t`, then the neighbor finset of `w` is a subset of `s`. -/
184182
theorem isBipartiteWith_neighborFinset_subset' (h : G.IsBipartiteWith s t) (hw : w ∈ t) :

Mathlib/Data/List/Chain.lean

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,9 @@ theorem chain'_iff_forall_rel_of_append_cons_cons {l : List α} :
203203
match tail with
204204
| nil => exact fun _ ↦ chain'_singleton head
205205
| cons head' tail =>
206-
refine fun h ↦ chain'_cons.mpr ⟨h (nil_append _).symm, ih @(fun a b l₁ l₂ eq => ?_)⟩
207-
simpa [eq] using @h (l₁ := head :: l₁) (l₂ := l₂)
206+
refine fun h ↦ chain'_cons.mpr ⟨h (nil_append _).symm, ih fun ⦃a b l₁ l₂⦄ eq => ?_⟩
207+
apply h
208+
rw [eq, cons_append]
208209

209210
theorem chain'_map (f : β → α) {l : List β} :
210211
Chain' R (map f l) ↔ Chain' (fun a b : β => R (f a) (f b)) l := by

Mathlib/Data/Seq/Computation.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ theorem liftRel_congr {R : α → β → Prop} {ca ca' : Computation α} {cb cb'
10071007
theorem liftRel_map {δ} (R : α → β → Prop) (S : γ → δ → Prop) {s1 : Computation α}
10081008
{s2 : Computation β} {f1 : α → γ} {f2 : β → δ} (h1 : LiftRel R s1 s2)
10091009
(h2 : ∀ {a b}, R a b → S (f1 a) (f2 b)) : LiftRel S (map f1 s1) (map f2 s2) := by
1010-
rw [← bind_pure, ← bind_pure]; apply liftRel_bind _ _ h1; simp; exact @h2
1010+
rw [← bind_pure, ← bind_pure]; apply liftRel_bind _ _ h1; simpa
10111011

10121012
theorem map_congr {s1 s2 : Computation α} {f : α → β}
10131013
(h1 : s1 ~ s2) : map f s1 ~ map f s2 := by

0 commit comments

Comments
 (0)