Skip to content

Commit 5cedfb5

Browse files
chore: tidy various files (#3358)
1 parent 9b53296 commit 5cedfb5

File tree

19 files changed

+191
-256
lines changed

19 files changed

+191
-256
lines changed

Mathlib/Algebra/Category/GroupCat/Basic.lean

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import Mathlib.Algebra.Category.MonCat.Basic
1212
import Mathlib.CategoryTheory.Endomorphism
1313

1414
/-!
15-
# Category instances for group, add_group, comm_group, and add_comm_group.
15+
# Category instances for Group, AddGroup, CommGroup, and AddCommGroup.
1616
1717
We introduce the bundled categories:
1818
* `GroupCat`
@@ -81,7 +81,7 @@ set_option linter.uppercaseLean3 false in
8181
set_option linter.uppercaseLean3 false in
8282
#align AddGroup.of_hom AddGroupCat.ofHom
8383

84-
/-- Typecheck a `add_monoid_hom` as a morphism in `AddGroup`. -/
84+
/-- Typecheck a `AddMonoidHom` as a morphism in `AddGroup`. -/
8585
add_decl_doc AddGroupCat.ofHom
8686

8787
-- porting note: this instance was not necessary in mathlib
@@ -373,9 +373,10 @@ lemma Hom.map_mul {X Y : CommGroupCat} (f : X ⟶ Y) (x y : X) : f (x * y) = f x
373373
lemma Hom.map_one {X Y : CommGroupCat} (f : X ⟶ Y) : f (1 : X) = 1 := by
374374
apply MonoidHom.map_one (show MonoidHom X Y from f)
375375

376+
-- Porting note: is this still relevant?
376377
-- This example verifies an improvement possible in Lean 3.8.
377-
-- Before that, to have `monoid_hom.map_map` usable by `simp` here,
378-
-- we had to mark all the concrete category `has_coe_to_sort` instances reducible.
378+
-- Before that, to have `MonoidHom.map_map` usable by `simp` here,
379+
-- we had to mark all the concrete category `CoeSort` instances reducible.
379380
-- Now, it just works.
380381
@[to_additive]
381382
example {R S : CommGroupCat} (i : R ⟶ S) (r : R) (h : r = 1) : i r = 1 := by simp [h]
@@ -386,7 +387,7 @@ namespace AddCommGroupCat
386387

387388
-- Note that because `ℤ : Type 0`, this forces `G : AddCommGroup.{0}`,
388389
-- so we write this explicitly to be clear.
389-
-- TODO generalize this, requiring a `ulift_instances.lean` file
390+
-- TODO generalize this, requiring a `ULiftInstances.lean` file
390391
/-- Any element of an abelian group gives a unique morphism from `ℤ` sending
391392
`1` to that element. -/
392393
def asHom {G : AddCommGroupCat.{0}} (g : G) : AddCommGroupCat.of ℤ ⟶ G :=
@@ -442,8 +443,7 @@ add_decl_doc AddEquiv.toAddGroupCatIso
442443
/-- Build an isomorphism in the category `CommGroupCat` from a `MulEquiv`
443444
between `CommGroup`s. -/
444445
@[to_additive (attr := simps)]
445-
def MulEquiv.toCommGroupCatIso {X Y : CommGroupCat} (e : X ≃* Y) : X ≅ Y
446-
where
446+
def MulEquiv.toCommGroupCatIso {X Y : CommGroupCat} (e : X ≃* Y) : X ≅ Y where
447447
hom := CommGroupCat.Hom.mk e.toMonoidHom
448448
inv := CommGroupCat.Hom.mk e.symm.toMonoidHom
449449
set_option linter.uppercaseLean3 false in
@@ -501,8 +501,7 @@ add_decl_doc addEquivIsoAddGroupIso
501501
/-- multiplicative equivalences between `comm_group`s are the same as (isomorphic to) isomorphisms
502502
in `CommGroup` -/
503503
@[to_additive]
504-
def mulEquivIsoCommGroupIso {X Y : CommGroupCat.{u}} : X ≃* Y ≅ X ≅ Y
505-
where
504+
def mulEquivIsoCommGroupIso {X Y : CommGroupCat.{u}} : X ≃* Y ≅ X ≅ Y where
506505
hom e := e.toCommGroupCatIso
507506
inv i := i.commGroupIsoToMulEquiv
508507
set_option linter.uppercaseLean3 false in

Mathlib/Algebra/GroupPower/Order.lean

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ theorem Right.pow_le_one_of_le (hx : x ≤ 1) : ∀ {n : ℕ}, x ^ n ≤ 1
156156

157157
end Right
158158

159-
section CovariantLtSwap
159+
section CovariantLTSwap
160160

161161
variable [Preorder β] [CovariantClass M M (· * ·) (· < ·)]
162162
[CovariantClass M M (swap (· * ·)) (· < ·)] {f : β → M}
@@ -178,9 +178,9 @@ theorem pow_strictMono_right' {n : ℕ} (hn : n ≠ 0) : StrictMono fun a : M =>
178178
#align pow_strict_mono_right' pow_strictMono_right'
179179
#align nsmul_strict_mono_left nsmul_strictMono_left
180180

181-
end CovariantLtSwap
181+
end CovariantLTSwap
182182

183-
section CovariantLeSwap
183+
section CovariantLESwap
184184

185185
variable [Preorder β] [CovariantClass M M (· * ·) (· ≤ ·)]
186186
[CovariantClass M M (swap (· * ·)) (· ≤ ·)]
@@ -200,7 +200,7 @@ theorem pow_mono_right (n : ℕ) : Monotone fun a : M => a ^ n :=
200200
#align pow_mono_right pow_mono_right
201201
#align nsmul_mono_left nsmul_mono_left
202202

203-
end CovariantLeSwap
203+
end CovariantLESwap
204204

205205
@[to_additive Left.pow_neg]
206206
theorem Left.pow_lt_one_of_lt [CovariantClass M M (· * ·) (· < ·)] {n : ℕ} {x : M} (hn : 0 < n)
@@ -230,7 +230,7 @@ section LinearOrder
230230

231231
variable [LinearOrder M]
232232

233-
section CovariantLe
233+
section CovariantLE
234234

235235
variable [CovariantClass M M (· * ·) (· ≤ ·)]
236236

@@ -280,9 +280,9 @@ theorem pow_lt_pow_iff' (ha : 1 < a) : a ^ m < a ^ n ↔ m < n :=
280280
#align pow_lt_pow_iff' pow_lt_pow_iff'
281281
#align nsmul_lt_nsmul_iff nsmul_lt_nsmul_iff
282282

283-
end CovariantLe
283+
end CovariantLE
284284

285-
section CovariantLeSwap
285+
section CovariantLESwap
286286

287287
variable [CovariantClass M M (· * ·) (· ≤ ·)] [CovariantClass M M (swap (· * ·)) (· ≤ ·)]
288288

@@ -314,9 +314,9 @@ theorem lt_max_of_sq_lt_mul {a b c : M} (h : a ^ 2 < b * c) : a < max b c := by
314314
#align lt_max_of_sq_lt_mul lt_max_of_sq_lt_mul
315315
#align lt_max_of_two_nsmul_lt_add lt_max_of_two_nsmul_lt_add
316316

317-
end CovariantLeSwap
317+
end CovariantLESwap
318318

319-
section CovariantLtSwap
319+
section CovariantLTSwap
320320

321321
variable [CovariantClass M M (· * ·) (· < ·)] [CovariantClass M M (swap (· * ·)) (· < ·)]
322322

@@ -338,7 +338,7 @@ theorem le_max_of_sq_le_mul {a b c : M} (h : a ^ 2 ≤ b * c) : a ≤ max b c :=
338338
#align le_max_of_sq_le_mul le_max_of_sq_le_mul
339339
#align le_max_of_two_nsmul_le_add le_max_of_two_nsmul_le_add
340340

341-
end CovariantLtSwap
341+
end CovariantLTSwap
342342

343343
@[to_additive Left.nsmul_neg_iff]
344344
theorem Left.pow_lt_one_iff' [CovariantClass M M (· * ·) (· < ·)] {n : ℕ} {x : M} (hn : 0 < n) :

Mathlib/CategoryTheory/Limits/Lattice.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ instance (priority := 100) [SemilatticeSup α] [OrderBot α] : HasBinaryCoproduc
140140
infer_instance
141141
apply hasBinaryCoproducts_of_hasColimit_pair
142142

143-
/-- The binary coproduct in the category of a `semilattice_sup` with `order_bot` is the same as the
143+
/-- The binary coproduct in the category of a `SemilatticeSup` with `OrderBot` is the same as the
144144
supremum.
145145
-/
146146
@[simp]
@@ -149,11 +149,11 @@ theorem coprod_eq_sup [SemilatticeSup α] [OrderBot α] (x y : α) : Limits.copr
149149
Limits.coprod x y = colimit (pair x y) := rfl
150150
_ = Finset.univ.sup (pair x y).obj := by rw [finite_colimit_eq_finset_univ_sup (pair x y)]
151151
_ = x ⊔ (y ⊔ ⊥) := rfl
152-
-- Note: finset.sup is realized as a fold, hence the definitional equality
152+
-- Note: Finset.sup is realized as a fold, hence the definitional equality
153153
_ = x ⊔ y := by rw [sup_bot_eq]
154154
#align category_theory.limits.complete_lattice.coprod_eq_sup CategoryTheory.Limits.CompleteLattice.coprod_eq_sup
155155

156-
/-- The pullback in the category of a `semilattice_inf` with `order_top` is the same as the infimum
156+
/-- The pullback in the category of a `SemilatticeInf` with `OrderTop` is the same as the infimum
157157
over the objects.
158158
-/
159159
@[simp]
@@ -168,7 +168,7 @@ theorem pullback_eq_inf [SemilatticeInf α] [OrderTop α] {x y z : α} (f : x
168168

169169
#align category_theory.limits.complete_lattice.pullback_eq_inf CategoryTheory.Limits.CompleteLattice.pullback_eq_inf
170170

171-
/-- The pushout in the category of a `semilattice_sup` with `order_bot` is the same as the supremum
171+
/-- The pushout in the category of a `SemilatticeSup` with `OrderBot` is the same as the supremum
172172
over the objects.
173173
-/
174174
@[simp]

Mathlib/CategoryTheory/Limits/Shapes/Multiequalizer.lean

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ noncomputable def ofPiFork (c : Fork I.fstPiMap I.sndPiMap) : Multifork I where
459459
rintro (_ | _) (_ | _) (_ | _ | _)
460460
· simp
461461
· simp
462-
· dsimp ; rw [c.condition_assoc] ; simp
462+
· dsimp; rw [c.condition_assoc]; simp
463463
· simp }
464464
#align category_theory.limits.multifork.of_pi_fork CategoryTheory.Limits.Multifork.ofPiFork
465465

@@ -525,14 +525,11 @@ noncomputable def multiforkEquivPiFork : Multifork I ≌ Fork I.fstPiMap I.sndPi
525525
(by
526526
rintro (_ | _) <;> dsimp <;>
527527
simp [← Fork.app_one_eq_ι_comp_left, -Fork.app_one_eq_ι_comp_left]))
528-
fun {K₁ K₂} f => by dsimp ; ext ; simp
528+
fun {K₁ K₂} f => by dsimp; ext; simp
529529
counitIso :=
530530
NatIso.ofComponents
531-
(fun K =>
532-
Fork.ext (Iso.refl _)
533-
(by dsimp ; ext ⟨j⟩ ; dsimp ; simp
534-
))
535-
fun {K₁ K₂} f => by dsimp ; ext ; simp
531+
(fun K => Fork.ext (Iso.refl _) (by dsimp; ext ⟨j⟩; dsimp; simp))
532+
fun {K₁ K₂} f => by dsimp; ext; simp
536533
#align category_theory.limits.multicospan_index.multifork_equiv_pi_fork CategoryTheory.Limits.MulticospanIndex.multiforkEquivPiFork
537534

538535
end MulticospanIndex
@@ -690,8 +687,8 @@ variable (I : MultispanIndex C) [HasCoproduct I.left] [HasCoproduct I.right]
690687
@[simps]
691688
noncomputable def toSigmaCoforkFunctor : Multicofork I ⥤ Cofork I.fstSigmaMap I.sndSigmaMap where
692689
obj := Multicofork.toSigmaCofork
693-
map {K₁ K₂} f := {
694-
Hom := f.Hom
690+
map {K₁ K₂} f :=
691+
{ Hom := f.Hom
695692
w := by
696693
rintro (_|_)
697694
all_goals {
@@ -729,9 +726,9 @@ noncomputable def multicoforkEquivSigmaCofork :
729726
unitIso :=
730727
NatIso.ofComponents (fun K => Cocones.ext (Iso.refl _) (by
731728
rintro (_ | _)
732-
{ dsimp; simp }
729+
· dsimp; simp
733730
-- porting note; `dsimp, simp` worked in mathlib3.
734-
{ dsimp [Multicofork.ofSigmaCofork]; simp } ))
731+
· dsimp [Multicofork.ofSigmaCofork]; simp ))
735732
fun {K₁ K₂} f => by
736733
-- porting note: in mathlib3 `ext` works and I don't
737734
-- really understand why it doesn't work here

Mathlib/CategoryTheory/Localization/Opposite.lean

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,15 @@ variable {C D : Type _} [Category C] [Category D] {L : C ⥤ D} {W : MorphismPro
3131
namespace Localization
3232

3333
/-- If `L : C ⥤ D` satisfies the universal property of the localisation
34-
for `W : morphism_property C`, then `L.op` also does. -/
34+
for `W : MorphismProperty C`, then `L.op` also does. -/
3535
def StrictUniversalPropertyFixedTarget.op {E : Type _} [Category E]
3636
(h : StrictUniversalPropertyFixedTarget L W Eᵒᵖ) :
37-
StrictUniversalPropertyFixedTarget L.op W.op E
38-
where
37+
StrictUniversalPropertyFixedTarget L.op W.op E where
3938
inverts := h.inverts.op
4039
lift F hF := (h.lift F.rightOp hF.rightOp).leftOp
4140
fac F hF := by
4241
convert congr_arg Functor.leftOp (h.fac F.rightOp hF.rightOp)
43-
uniq F₁ F₂ eq :=
44-
by
42+
uniq F₁ F₂ eq := by
4543
suffices F₁.rightOp = F₂.rightOp by
4644
rw [← F₁.rightOp_leftOp_eq, ← F₂.rightOp_leftOp_eq, this]
4745
have eq' := congr_arg Functor.rightOp eq

Mathlib/CategoryTheory/Shift/Basic.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -401,10 +401,10 @@ abbrev shiftZero : X⟦(0 : A)⟧ ≅ X :=
401401
(shiftFunctorZero C A).app _
402402
#align category_theory.shift_zero CategoryTheory.shiftZero
403403

404-
theorem shift_zero' : f⟦(0 : A)⟧' = (shiftZero A X).hom ≫ f ≫ (shiftZero A Y).inv := by
404+
theorem shiftZero' : f⟦(0 : A)⟧' = (shiftZero A X).hom ≫ f ≫ (shiftZero A Y).inv := by
405405
symm
406406
apply NatIso.naturality_2
407-
#align category_theory.shift_zero' CategoryTheory.shift_zero'
407+
#align category_theory.shift_zero' CategoryTheory.shiftZero'
408408

409409
variable (C) {A}
410410

@@ -603,17 +603,17 @@ theorem shiftComm_symm (i j : A) : (shiftComm X i j).symm = shiftComm X j i := b
603603
variable {X Y}
604604

605605
/-- When shifts are indexed by an additive commutative monoid, then shifts commute. -/
606-
theorem shift_comm' (i j : A) :
606+
theorem shiftComm' (i j : A) :
607607
f⟦i⟧'⟦j⟧' = (shiftComm _ _ _).hom ≫ f⟦j⟧'⟦i⟧' ≫ (shiftComm _ _ _).hom := by
608608
erw [← shiftComm_symm Y i j, ← ((shiftFunctorComm C i j).hom.naturality_assoc f)]
609609
dsimp
610610
simp only [Iso.hom_inv_id_app, Functor.comp_obj, Category.comp_id]
611-
#align category_theory.shift_comm' CategoryTheory.shift_comm'
611+
#align category_theory.shift_comm' CategoryTheory.shiftComm'
612612

613613
@[reassoc]
614614
theorem shiftComm_hom_comp (i j : A) :
615615
(shiftComm X i j).hom ≫ f⟦j⟧'⟦i⟧' = f⟦i⟧'⟦j⟧' ≫ (shiftComm Y i j).hom := by
616-
rw [shift_comm', ← shiftComm_symm, Iso.symm_hom, Iso.inv_hom_id_assoc]
616+
rw [shiftComm', ← shiftComm_symm, Iso.symm_hom, Iso.inv_hom_id_assoc]
617617
#align category_theory.shift_comm_hom_comp CategoryTheory.shiftComm_hom_comp
618618

619619
lemma shiftFunctorZero_hom_app_shift (n : A) :

Mathlib/CategoryTheory/Sites/Pretopology.lean

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ satisfying certain closure conditions.
2020
We show that a pretopology generates a genuine Grothendieck topology, and every topology has
2121
a maximal pretopology which generates it.
2222
23-
The pretopology associated to a topological space is defined in `spaces.lean`.
23+
The pretopology associated to a topological space is defined in `Spaces.lean`.
2424
2525
## Tags
2626
@@ -80,7 +80,8 @@ instance : CoeFun (Pretopology C) fun _ => ∀ X : C, Set (Presieve X) :=
8080

8181
variable {C}
8282

83-
instance LE : LE (Pretopology C) where le K₁ K₂ := (K₁ : ∀ X : C, Set (Presieve X)) ≤ K₂
83+
instance LE : LE (Pretopology C) where
84+
le K₁ K₂ := (K₁ : ∀ X : C, Set (Presieve X)) ≤ K₂
8485

8586
theorem le_def {K₁ K₂ : Pretopology C} : K₁ ≤ K₂ ↔ (K₁ : ∀ X : C, Set (Presieve X)) ≤ K₂ :=
8687
Iff.rfl

Mathlib/CategoryTheory/Sites/SheafOfTypes.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ theorem extend_agrees {x : FamilyOfElements P R} (t : x.Compatible) {f : Y ⟶ X
201201
have h := (le_generate R Y hf).choose_spec
202202
unfold FamilyOfElements.sieveExtend
203203
rw [t h.choose (𝟙 _) _ hf _]
204-
· simp;
204+
· simp
205205
· rw [id_comp]
206206
exact h.choose_spec.choose_spec.2
207207
#align category_theory.presieve.extend_agrees CategoryTheory.Presieve.extend_agrees
@@ -845,7 +845,7 @@ def forkMap : P.obj (op X) ⟶ FirstObj P R :=
845845

846846
/-!
847847
This section establishes the equivalence between the sheaf condition of Equation (3) [MM92] and
848-
the definition of `is_sheaf_for`.
848+
the definition of `IsSheafFor`.
849849
-/
850850

851851

@@ -1026,7 +1026,7 @@ structure SheafOfTypes (J : GrothendieckTopology C) : Type max u₁ v₁ (w + 1)
10261026
val : Cᵒᵖ ⥤ Type w
10271027
/-- the condition that the presheaf is a sheaf -/
10281028
cond : Presieve.IsSheaf J val
1029-
set_option linter.uppercaseLean3 false in
1029+
set_option linter.uppercaseLean3 false in
10301030
#align category_theory.SheafOfTypes CategoryTheory.SheafOfTypes
10311031

10321032
namespace SheafOfTypes
@@ -1038,7 +1038,7 @@ variable {J}
10381038
structure Hom (X Y : SheafOfTypes J) where
10391039
/-- a morphism between the underlying presheaves -/
10401040
val : X.val ⟶ Y.val
1041-
set_option linter.uppercaseLean3 false in
1041+
set_option linter.uppercaseLean3 false in
10421042
#align category_theory.SheafOfTypes.hom CategoryTheory.SheafOfTypes.Hom
10431043

10441044
@[simps]

Mathlib/Combinatorics/SimpleGraph/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ theorem infᵢ_adj_of_nonempty [Nonempty ι] {f : ι → SimpleGraph V} :
337337
rw [infᵢ, infₛ_adj_of_nonempty (Set.range_nonempty _), Set.forall_range_iff]
338338
#align simple_graph.infi_adj_of_nonempty SimpleGraph.infᵢ_adj_of_nonempty
339339

340-
/-- For graphs `G`, `H`, `G ≤ H` iff `∀ a b, G.adj a b → H.adj a b`. -/
340+
/-- For graphs `G`, `H`, `G ≤ H` iff `∀ a b, G.Adj a b → H.Adj a b`. -/
341341
instance distribLattice : DistribLattice (SimpleGraph V) :=
342342
{ show DistribLattice (SimpleGraph V) from
343343
adj_injective.distribLattice _ (fun _ _ => rfl) fun _ _ => rfl with

Mathlib/Data/List/Intervals.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import Mathlib.Data.Bool.Basic
1414
/-!
1515
# Intervals in ℕ
1616
17-
This file defines intervals of naturals. `list.Ico m n` is the list of integers greater than `m`
17+
This file defines intervals of naturals. `List.Ico m n` is the list of integers greater than `m`
1818
and strictly less than `n`.
1919
2020
## TODO

0 commit comments

Comments
 (0)