Skip to content

Commit 32cac55

Browse files
chore: tidy various files (leanprover-community#13860)
1 parent a1210a9 commit 32cac55

File tree

37 files changed

+103
-114
lines changed

37 files changed

+103
-114
lines changed

Archive/Wiedijk100Theorems/BallotProblem.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ theorem first_vote_pos :
241241
· norm_cast
242242
rw [mul_comm _ (p + 1), ← Nat.succ_eq_add_one p, Nat.succ_add, Nat.succ_mul_choose_eq,
243243
mul_comm]
244-
all_goals simp [(Nat.choose_pos <| (le_add_iff_nonneg_right _).2 zero_le').ne.symm]
244+
all_goals simp [(Nat.choose_pos <| le_add_of_nonneg_right zero_le').ne']
245245
· simp
246246
#align ballot.first_vote_pos Ballot.first_vote_pos
247247

Mathlib/Algebra/Associated.lean

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,19 +1180,19 @@ section CancelCommMonoidWithZero
11801180
variable [CancelCommMonoidWithZero α]
11811181

11821182
instance instPartialOrder : PartialOrder (Associates α) where
1183-
le_antisymm := mk_surjective.forall₂.2 fun _a _b hab hba => mk_eq_mk_iff_associated.2 <|
1184-
associated_of_dvd_dvd (dvd_of_mk_le_mk hab) (dvd_of_mk_le_mk hba)
1183+
le_antisymm := mk_surjective.forall₂.2 fun _a _b hab hba => mk_eq_mk_iff_associated.2 <|
1184+
associated_of_dvd_dvd (dvd_of_mk_le_mk hab) (dvd_of_mk_le_mk hba)
11851185

11861186
instance instOrderedCommMonoid : OrderedCommMonoid (Associates α) where
1187-
mul_le_mul_left := fun a _ ⟨d, hd⟩ c => hd.symm ▸ mul_assoc c a d ▸ le_mul_right
1187+
mul_le_mul_left := fun a _ ⟨d, hd⟩ c => hd.symm ▸ mul_assoc c a d ▸ le_mul_right
11881188

11891189
instance instCancelCommMonoidWithZero : CancelCommMonoidWithZero (Associates α) :=
1190-
{ (by infer_instance : CommMonoidWithZero (Associates α)) with
1191-
mul_left_cancel_of_ne_zero := by
1192-
rintro ⟨a⟩ ⟨b⟩ ⟨c⟩ ha h
1193-
rcases Quotient.exact' h with ⟨u, hu⟩
1194-
have hu : a * (b * ↑u) = a * c := by rwa [← mul_assoc]
1195-
exact Quotient.sound' ⟨u, mul_left_cancel₀ (mk_ne_zero.1 ha) hu⟩ }
1190+
{ (by infer_instance : CommMonoidWithZero (Associates α)) with
1191+
mul_left_cancel_of_ne_zero := by
1192+
rintro ⟨a⟩ ⟨b⟩ ⟨c⟩ ha h
1193+
rcases Quotient.exact' h with ⟨u, hu⟩
1194+
have hu : a * (b * ↑u) = a * c := by rwa [← mul_assoc]
1195+
exact Quotient.sound' ⟨u, mul_left_cancel₀ (mk_ne_zero.1 ha) hu⟩ }
11961196

11971197
theorem _root_.associates_irreducible_iff_prime [DecompositionMonoid α] {p : Associates α} :
11981198
Irreducible p ↔ Prime p := irreducible_iff_prime
@@ -1212,9 +1212,9 @@ theorem one_or_eq_of_le_of_prime {p m : Associates α} (hp : Prime p) (hle : m
12121212
#align associates.one_or_eq_of_le_of_prime Associates.one_or_eq_of_le_of_prime
12131213

12141214
instance : CanonicallyOrderedCommMonoid (Associates α) where
1215-
exists_mul_of_le := fun h => h
1216-
le_self_mul := fun _ b => ⟨b, rfl⟩
1217-
bot_le := fun _ => one_le
1215+
exists_mul_of_le h := h
1216+
le_self_mul _ b := ⟨b, rfl⟩
1217+
bot_le _ := one_le
12181218

12191219
theorem dvdNotUnit_iff_lt {a b : Associates α} : DvdNotUnit a b ↔ a < b :=
12201220
dvd_and_not_dvd_iff.symm

Mathlib/Algebra/Category/ModuleCat/Presheaf/Sheafify.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,11 +320,11 @@ def toSheafify : M₀ ⟶ (restrictScalars α).obj (sheafify α φ).val where
320320
simpa using (Sheafify.map_smul_eq α φ (α.app _ r₀) (φ.app _ m₀) (𝟙 _)
321321
r₀ (by aesop) m₀ (by simp)).symm
322322

323-
instance : Presheaf.IsLocallyInjective J (toSheafify α φ).hom :=
324-
by dsimp; infer_instance
323+
instance : Presheaf.IsLocallyInjective J (toSheafify α φ).hom := by
324+
dsimp; infer_instance
325325

326-
instance : Presheaf.IsLocallySurjective J (toSheafify α φ).hom :=
327-
by dsimp; infer_instance
326+
instance : Presheaf.IsLocallySurjective J (toSheafify α φ).hom := by
327+
dsimp; infer_instance
328328

329329
variable [J.WEqualsLocallyBijective AddCommGroupCat.{v}]
330330

Mathlib/Algebra/GeomSum.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ theorem geom_sum_alternating_of_le_neg_one [StrictOrderedRing α] (hx : x + 1
497497

498498
theorem geom_sum_alternating_of_lt_neg_one [StrictOrderedRing α] (hx : x + 1 < 0) (hn : 1 < n) :
499499
if Even n then (∑ i ∈ range n, x ^ i) < 0 else 1 < ∑ i ∈ range n, x ^ i := by
500-
have hx0 : x < 0 := ((le_add_iff_nonneg_right _).2 zero_le_one).trans_lt hx
500+
have hx0 : x < 0 := (le_add_of_nonneg_right zero_le_one).trans_lt hx
501501
refine Nat.le_induction ?_ ?_ n (show 2 ≤ n from hn)
502502
· simp only [geom_sum_two, lt_add_iff_pos_left, ite_true, gt_iff_lt, hx, even_two]
503503
clear hn

Mathlib/Algebra/Lie/Semisimple/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ open CompleteLattice IsCompactlyGenerated
116116
variable {R L}
117117
variable [IsSemisimple R L]
118118

119-
lemma isSimple_of_isAtom (I : LieIdeal R L) (hI : IsAtom I) : IsSimple R I where
119+
lemma isSimple_of_isAtom (I : LieIdeal R L) (hI : IsAtom I) : IsSimple R I where
120120
non_abelian := IsSemisimple.non_abelian_of_isAtom I hI
121121
eq_bot_or_eq_top := by
122122
-- Suppose that `J` is an ideal of `I`.

Mathlib/Algebra/Lie/Weights/Cartan.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ theorem lie_mem_weightSpace_of_mem_weightSpace {χ₁ χ₂ : H → R} {x : L} {
7272
lemma toEnd_pow_apply_mem {χ₁ χ₂ : H → R} {x : L} {m : M}
7373
(hx : x ∈ rootSpace H χ₁) (hm : m ∈ weightSpace M χ₂) (n) :
7474
(toEnd R L M x ^ n : Module.End R M) m ∈ weightSpace M (n • χ₁ + χ₂) := by
75-
induction n
76-
· simpa using hm
77-
· next n IH =>
75+
induction n with
76+
| zero => simpa using hm
77+
| succ n IH =>
7878
simp only [pow_succ', LinearMap.mul_apply, toEnd_apply_apply,
7979
Nat.cast_add, Nat.cast_one, rootSpace]
8080
convert lie_mem_weightSpace_of_mem_weightSpace hx IH using 2

Mathlib/Algebra/Lie/Weights/Killing.lean

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -260,13 +260,14 @@ lemma isSemisimple_ad_of_mem_isCartanSubalgebra {x : L} (hx : x ∈ H) :
260260
replace h_der (y z : L) : S ⁅y, z⁆ = ⁅S y, z⁆ + ⁅y, S z⁆ := by
261261
have hy : y ∈ ⨆ α : H → K, rootSpace H α := by simp [iSup_weightSpace_eq_top]
262262
have hz : z ∈ ⨆ α : H → K, rootSpace H α := by simp [iSup_weightSpace_eq_top]
263-
induction hy using LieSubmodule.iSup_induction'
264-
· induction hz using LieSubmodule.iSup_induction'
265-
· next α y hy β z hz => exact h_der y z α β hy hz
266-
· simp
267-
· next h h' => simp only [lie_add, map_add, h, h']; abel
268-
· simp
269-
· next h h' => simp only [add_lie, map_add, h, h']; abel
263+
induction hy using LieSubmodule.iSup_induction' with
264+
| hN α y hy =>
265+
induction hz using LieSubmodule.iSup_induction' with
266+
| hN β z hz => exact h_der y z α β hy hz
267+
| h0 => simp
268+
| hadd _ _ _ _ h h' => simp only [lie_add, map_add, h, h']; abel
269+
| h0 => simp
270+
| hadd _ _ _ _ h h' => simp only [add_lie, map_add, h, h']; abel
270271
/- An equivalent form of the derivation axiom used in `LieDerivation`. -/
271272
replace h_der : ∀ y z : L, S ⁅y, z⁆ = ⁅y, S z⁆ - ⁅z, S y⁆ := by
272273
simp_rw [← lie_skew (S _) _, add_comm, ← sub_eq_add_neg] at h_der; assumption
@@ -419,16 +420,16 @@ lemma traceForm_eq_zero_of_mem_ker_of_mem_span_coroot {α : Weight K H L} {x y :
419420
(hx : x ∈ α.ker) (hy : y ∈ K ∙ coroot α) :
420421
traceForm K H L x y = 0 := by
421422
rw [← coe_corootSpace_eq_span_singleton, LieSubmodule.mem_coeSubmodule, mem_corootSpace'] at hy
422-
induction hy using Submodule.span_induction'
423-
· next z hz =>
423+
induction hy using Submodule.span_induction' with
424+
| mem z hz =>
424425
obtain ⟨u, hu, v, -, huv⟩ := hz
425426
change killingForm K L (x : L) (z : L) = 0
426427
replace hx : α x = 0 := by simpa using hx
427428
rw [← huv, ← traceForm_apply_lie_apply, ← LieSubalgebra.coe_bracket_of_module,
428429
lie_eq_smul_of_mem_rootSpace hu, hx, zero_smul, map_zero, LinearMap.zero_apply]
429-
· simp
430-
· next hx hy => simp [hx, hy]
431-
· next hz => simp [hz]
430+
| zero => simp
431+
| add _ _ _ _ hx hy => simp [hx, hy]
432+
| smul _ _ _ hz => simp [hz]
432433

433434
@[simp] lemma orthogonal_span_coroot_eq_ker (α : Weight K H L) :
434435
(traceForm K H L).orthogonal (K ∙ coroot α) = α.ker := by

Mathlib/Algebra/Polynomial/Derivative.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ theorem iterate_derivative_X_pow_eq_natCast_mul (n k : ℕ) :
488488
induction' k with k ih
489489
· erw [Function.iterate_zero_apply, tsub_zero, Nat.descFactorial_zero, Nat.cast_one, one_mul]
490490
· rw [Function.iterate_succ_apply', ih, derivative_natCast_mul, derivative_X_pow, C_eq_natCast,
491-
Nat.descFactorial_succ, Nat.sub_sub, Nat.cast_mul];
491+
Nat.descFactorial_succ, Nat.sub_sub, Nat.cast_mul]
492492
simp [mul_comm, mul_assoc, mul_left_comm]
493493
set_option linter.uppercaseLean3 false in
494494
#align polynomial.iterate_derivative_X_pow_eq_nat_cast_mul Polynomial.iterate_derivative_X_pow_eq_natCast_mul

Mathlib/Analysis/Complex/UpperHalfPlane/Basic.lean

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,7 @@ theorem SLOnGLPos_smul_apply (s : SL(2, ℤ)) (g : GL(2, ℝ)⁺) (z : ℍ) :
333333
#align upper_half_plane.SL_on_GL_pos_smul_apply UpperHalfPlane.ModularGroup.SLOnGLPos_smul_apply
334334

335335
instance SL_to_GL_tower : IsScalarTower SL(2, ℤ) GL(2, ℝ)⁺ ℍ where
336-
smul_assoc := by
337-
intro s g z
336+
smul_assoc s g z := by
338337
simp only [SLOnGLPos_smul_apply]
339338
apply mul_smul'
340339
#align upper_half_plane.SL_to_GL_tower UpperHalfPlane.ModularGroup.SL_to_GL_tower
@@ -349,8 +348,7 @@ theorem subgroup_on_glpos_smul_apply (s : Γ) (g : GL(2, ℝ)⁺) (z : ℍ) :
349348
#align upper_half_plane.subgroup_on_GL_pos_smul_apply UpperHalfPlane.ModularGroup.subgroup_on_glpos_smul_apply
350349

351350
instance subgroup_on_glpos : IsScalarTower Γ GL(2, ℝ)⁺ ℍ where
352-
smul_assoc := by
353-
intro s g z
351+
smul_assoc s g z := by
354352
simp only [subgroup_on_glpos_smul_apply]
355353
apply mul_smul'
356354
#align upper_half_plane.subgroup_on_GL_pos UpperHalfPlane.ModularGroup.subgroup_on_glpos

Mathlib/Analysis/Convex/Body.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ theorem iInter_smul_eq_self [T2Space V] {u : ℕ → ℝ≥0} (K : ConvexBody V)
234234
refine lt_of_le_of_lt ?_ hn
235235
exact mul_le_mul_of_nonneg_left (hC_bdd _ hyK) (abs_nonneg _)
236236
· refine Set.mem_iInter.mpr (fun n => Convex.mem_smul_of_zero_mem K.convex h_zero h ?_)
237-
exact (le_add_iff_nonneg_right _).mpr (by positivity)
237+
exact le_add_of_nonneg_right (by positivity)
238238

239239
end SeminormedAddCommGroup
240240

0 commit comments

Comments
 (0)