Skip to content

Commit 08f062a

Browse files
chore: tidy various files (#14968)
1 parent 7fd56cf commit 08f062a

File tree

41 files changed

+90
-111
lines changed

Some content is hidden

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

41 files changed

+90
-111
lines changed

Mathlib/Algebra/Category/Ring/Colimits.lean

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@ variable {J : Type v} [SmallCategory J] (F : J ⥤ RingCat.{v})
3838
/-- An inductive type representing all ring expressions (without Relations)
3939
on a collection of types indexed by the objects of `J`.
4040
-/
41-
inductive Prequotient -- There's always `of`
42-
| of : ∀ (j : J) (_ : F.obj j), Prequotient -- Then one generator for each operation
41+
inductive Prequotient
42+
-- There's always `of`
43+
| of : ∀ (j : J) (_ : F.obj j), Prequotient
44+
45+
-- Then one generator for each operation
4346
| zero : Prequotient
4447
| one : Prequotient
4548
| neg : Prequotient → Prequotient

Mathlib/Algebra/GeomSum.lean

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,14 @@ theorem geom_sum₂_with_one (x : α) (n : ℕ) :
9292
protected theorem Commute.geom_sum₂_mul_add {x y : α} (h : Commute x y) (n : ℕ) :
9393
(∑ i ∈ range n, (x + y) ^ i * y ^ (n - 1 - i)) * x + y ^ n = (x + y) ^ n := by
9494
let f : ℕ → ℕ → α := fun m i : ℕ => (x + y) ^ i * y ^ (m - 1 - i)
95-
-- Porting note: adding `hf` here, because below in two places `dsimp [f]` didn't work
96-
have hf : ∀ m i : ℕ, f m i = (x + y) ^ i * y ^ (m - 1 - i) := by
97-
simp only [tsub_le_iff_right, forall_const]
9895
change (∑ i ∈ range n, (f n) i) * x + y ^ n = (x + y) ^ n
9996
induction' n with n ih
10097
· rw [range_zero, sum_empty, zero_mul, zero_add, pow_zero, pow_zero]
10198
· have f_last : f (n + 1) n = (x + y) ^ n := by
102-
rw [hf, ← tsub_add_eq_tsub_tsub, Nat.add_comm, tsub_self, pow_zero, mul_one]
99+
dsimp only [f]
100+
rw [← tsub_add_eq_tsub_tsub, Nat.add_comm, tsub_self, pow_zero, mul_one]
103101
have f_succ : ∀ i, i ∈ range n → f (n + 1) i = y * f n i := fun i hi => by
104-
rw [hf]
102+
dsimp only [f]
105103
have : Commute y ((x + y) ^ i) := (h.symm.add_right (Commute.refl y)).pow_right i
106104
rw [← mul_assoc, this.eq, mul_assoc, ← pow_succ' y (n - 1 - i)]
107105
congr 2

Mathlib/Algebra/Group/Action/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Mathlib.GroupTheory.Perm.Basic
1111
# More lemmas about group actions
1212
1313
This file contains lemmas about group actions that require more imports than
14-
`Algebra.Group.Action.Defs` offers.
14+
`Mathlib.Algebra.Group.Action.Defs` offers.
1515
-/
1616

1717
assert_not_exists MonoidWithZero

Mathlib/Algebra/Lie/Weights/Cartan.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,9 @@ lemma mem_corootSpace' {x : H} :
283283
suffices H.subtype '' s = {⁅y, z⁆ | (y ∈ rootSpace H α) (z ∈ rootSpace H (-α))} by
284284
obtain ⟨x, hx⟩ := x
285285
erw [← (H : Submodule R L).injective_subtype.mem_set_image (s := Submodule.span R s)]
286-
change _ ↔ x ∈ (Submodule.span R s).map H.subtype
287-
rw [Submodule.map_span, mem_corootSpace, ← this]
288-
rfl
286+
rw [mem_image]
287+
simp_rw [SetLike.mem_coe]
288+
rw [← Submodule.mem_map, Submodule.coeSubtype, Submodule.map_span, mem_corootSpace, ← this]
289289
ext u
290290
simp only [Submodule.coeSubtype, mem_image, Subtype.exists, LieSubalgebra.mem_coe_submodule,
291291
exists_and_right, exists_eq_right, mem_setOf_eq, s]

Mathlib/Algebra/Module/Submodule/Localization.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ lemma LinearMap.localized'_ker_eq_ker_localizedMap (g : M →ₗ[R] P) :
144144
lemma LinearMap.ker_localizedMap_eq_localized'_ker (g : M →ₗ[R] P) :
145145
LinearMap.ker (IsLocalizedModule.map p f f' g) =
146146
((LinearMap.ker g).localized' S p f).restrictScalars _ := by
147-
rw [localized'_ker_eq_ker_localizedMap S p f f']
148-
rfl
147+
ext
148+
simp [localized'_ker_eq_ker_localizedMap S p f f']
149149

150150
/--
151151
The canonical map from the kernel of `g` to the kernel of `g` localized at a submonoid.

Mathlib/Algebra/Star/NonUnitalSubsemiring.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Useful to fix definitional equalities. -/
6868
protected def copy (S : NonUnitalStarSubsemiring R) (s : Set R) (hs : s = ↑S) :
6969
NonUnitalStarSubsemiring R :=
7070
{ S.toNonUnitalSubsemiring.copy s hs with
71-
star_mem' := @fun x (hx : x ∈ s) => by
71+
star_mem' := fun {x} (hx : x ∈ s) => by
7272
show star x ∈ s
7373
rw [hs] at hx ⊢
7474
exact S.star_mem' hx }

Mathlib/Algebra/Tropical/BigOperators.lean

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,12 @@ theorem Multiset.untrop_sum [LinearOrder R] [OrderTop R] (s : Multiset (Tropical
9999
untrop s.sum = Multiset.inf (s.map untrop) := by
100100
induction' s using Multiset.induction with s x IH
101101
· simp
102-
· simp only [sum_cons, untrop_add, untrop_le_iff, map_cons, inf_cons, ← IH]
103-
rfl
102+
· simp only [sum_cons, untrop_add, untrop_le_iff, map_cons, inf_cons, ← IH, inf_eq_min]
104103

105104
theorem Finset.untrop_sum' [LinearOrder R] [OrderTop R] (s : Finset S) (f : S → Tropical R) :
106105
untrop (∑ i ∈ s, f i) = s.inf (untrop ∘ f) := by
107106
convert Multiset.untrop_sum (s.val.map f)
108-
simp only [Multiset.map_map, Function.comp_apply]
109-
rfl
107+
simp only [Multiset.map_map, Function.comp_apply, inf_def]
110108

111109
theorem untrop_sum_eq_sInf_image [ConditionallyCompleteLinearOrder R] (s : Finset S)
112110
(f : S → Tropical (WithTop R)) : untrop (∑ i ∈ s, f i) = sInf (untrop ∘ f '' s) := by
@@ -116,8 +114,7 @@ theorem untrop_sum_eq_sInf_image [ConditionallyCompleteLinearOrder R] (s : Finse
116114

117115
theorem untrop_sum [ConditionallyCompleteLinearOrder R] [Fintype S] (f : S → Tropical (WithTop R)) :
118116
untrop (∑ i : S, f i) = ⨅ i : S, untrop (f i) := by
119-
rw [iInf,← Set.image_univ,← coe_univ, untrop_sum_eq_sInf_image]
120-
rfl
117+
rw [iInf, ← Set.image_univ, ← coe_univ, untrop_sum_eq_sInf_image, Function.comp_def]
121118

122119
/-- Note we cannot use `i ∈ s` instead of `i : s` here
123120
as it is simply not true on conditionally complete lattices! -/

Mathlib/Algebra/Vertex/HVertexOperator.lean

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ def coeff (A : HVertexOperator Γ R V W) (n : Γ) : V →ₗ[R] W where
5959
toFun v := ((of R).symm (A v)).coeff n
6060
map_add' _ _ := by simp
6161
map_smul' _ _ := by
62-
simp only [map_smul, RingHom.id_apply]
63-
exact rfl
62+
simp only [map_smul, RingHom.id_apply, of_symm_smul, HahnSeries.smul_coeff]
6463

6564
@[deprecated (since := "2024-06-18")] alias _root_.VertexAlg.coeff := coeff
6665

@@ -85,12 +84,8 @@ condition, we produce a heterogeneous vertex operator. -/
8584
def of_coeff (f : Γ → V →ₗ[R] W)
8685
(hf : ∀(x : V), (Function.support (f · x)).IsPWO) : HVertexOperator Γ R V W where
8786
toFun x := (of R) { coeff := fun g => f g x, isPWO_support' := hf x }
88-
map_add' _ _ := by
89-
ext
90-
simp
91-
map_smul' _ _ := by
92-
simp only [map_smul, RingHom.id_apply]
93-
exact rfl
87+
map_add' _ _ := by ext; simp
88+
map_smul' _ _ := by ext; simp
9489

9590
@[deprecated (since := "2024-06-18")] alias _root_.VertexAlg.HetVertexOperator.of_coeff := of_coeff
9691

@@ -122,14 +117,14 @@ theorem compHahnSeries_add (u v : U) :
122117
compHahnSeries A B (u + v) = compHahnSeries A B u + compHahnSeries A B v := by
123118
ext
124119
simp only [compHahnSeries_coeff, map_add, coeff_apply, HahnSeries.add_coeff', Pi.add_apply]
125-
rw [← @HahnSeries.add_coeff]
120+
rw [← HahnSeries.add_coeff]
126121

127122
@[simp]
128123
theorem compHahnSeries_smul (r : R) (u : U) :
129124
compHahnSeries A B (r • u) = r • compHahnSeries A B u := by
130125
ext
131126
simp only [compHahnSeries_coeff, LinearMapClass.map_smul, coeff_apply, HahnSeries.smul_coeff]
132-
exact rfl
127+
rw [← HahnSeries.smul_coeff]
133128

134129
/-- The composite of two heterogeneous vertex operators, as a heterogeneous vertex operator. -/
135130
@[simps]
@@ -143,9 +138,8 @@ def comp : HVertexOperator (Γ' ×ₗ Γ) R U W where
143138
map_smul' := by
144139
intro r x
145140
ext g
146-
simp only [HahnSeries.ofIterate, compHahnSeries_smul, Equiv.symm_apply_apply, RingHom.id_apply,
147-
HahnSeries.smul_coeff, compHahnSeries_coeff, coeff_apply]
148-
exact rfl
141+
simp only [HahnSeries.ofIterate, compHahnSeries_smul, HahnSeries.smul_coeff,
142+
compHahnSeries_coeff, coeff_apply, Equiv.symm_apply_apply, RingHom.id_apply, of_symm_smul]
149143

150144
@[simp]
151145
theorem comp_coeff (g : Γ' ×ₗ Γ) :

Mathlib/CategoryTheory/Bicategory/Coherence.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ See `inclusion`.
7777
def preinclusion (B : Type u) [Quiver.{v + 1} B] :
7878
PrelaxFunctor (LocallyDiscrete (Paths B)) (FreeBicategory B) where
7979
obj a := a.as
80-
map := @fun a b f => (@inclusionPath B _ a.as b.as).obj f
80+
map {a b} f := (@inclusionPath B _ a.as b.as).obj f
8181
map₂ η := (inclusionPath _ _).map η
8282

8383
@[simp]

Mathlib/CategoryTheory/Bicategory/LocallyDiscrete.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ instance [Inhabited C] : Inhabited (LocallyDiscrete C) :=
5959
⟨⟨default⟩⟩
6060

6161
instance categoryStruct [CategoryStruct.{v} C] : CategoryStruct (LocallyDiscrete C) where
62-
Hom := fun a b => Discrete (a.as ⟶ b.as)
63-
id := fun a => ⟨𝟙 a.as⟩
62+
Hom a b := Discrete (a.as ⟶ b.as)
63+
id a := ⟨𝟙 a.as⟩
6464
comp f g := ⟨f.as ≫ g.as⟩
6565

6666
variable [CategoryStruct.{v} C]

0 commit comments

Comments
 (0)