Skip to content

Commit ee6d0f1

Browse files
chore: tidy various files (leanprover-community#33687)
1 parent 96439b3 commit ee6d0f1

31 files changed

Lines changed: 91 additions & 109 deletions

File tree

Mathlib/Algebra/Lie/Submodule.lean

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -528,12 +528,11 @@ instance [Nontrivial M] : Nontrivial (LieSubmodule R L M) :=
528528
(nontrivial_iff R L M).mpr ‹_›
529529

530530
theorem nontrivial_iff_ne_bot {N : LieSubmodule R L M} : Nontrivial N ↔ N ≠ ⊥ := by
531-
constructor <;> contrapose!
532-
· rintro rfl
533-
by_contra!
534-
⟨⟨m₁, h₁ : m₁ ∈ (⊥ : LieSubmodule R L M)⟩, ⟨m₂, h₂ : m₂ ∈ (⊥ : LieSubmodule R L M)⟩, h₁₂⟩
531+
constructor
532+
· rintro ⟨⟨m₁, h₁⟩, ⟨m₂, h₂⟩, h₁₂⟩ rfl
535533
simp [(LieSubmodule.mem_bot _).mp h₁, (LieSubmodule.mem_bot _).mp h₂] at h₁₂
536-
· rw [LieSubmodule.eq_bot_iff]
534+
· contrapose!
535+
rw [LieSubmodule.eq_bot_iff]
537536
rintro ⟨h⟩ m hm
538537
simpa using h ⟨m, hm⟩ ⟨_, N.zero_mem⟩
539538

Mathlib/Algebra/Module/LocalizedModule/Basic.lean

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,11 @@ lemma oreEqv_eq_r : (OreLocalization.oreEqv S M).r = r S M := by
6363
· rintro ⟨u, v, h₁, h₂⟩
6464
use u
6565
simp only [Submonoid.smul_def, smul_smul, h₂]
66-
rw [mul_comm, mul_smul, ← h₁, mul_comm, mul_smul]
67-
rfl
66+
rw [mul_comm, mul_smul, ← h₁, mul_comm, mul_smul, Submonoid.smul_def]
6867
· rintro ⟨u, hu⟩
6968
use u * a.2, u * b.2
7069
rw [mul_smul, ← hu, mul_smul, Submonoid.coe_mul, mul_assoc, mul_assoc, mul_comm (a.2 : R)]
71-
exact ⟨rfl, rfl⟩
70+
simp [Submonoid.smul_def]
7271

7372
theorem r.isEquiv : IsEquiv _ (r S M) :=
7473
{ refl := fun ⟨m, s⟩ => ⟨1, by rw [one_smul]⟩
@@ -371,8 +370,7 @@ theorem mk_cancel_common_right (s s' : S) (m : M) : mk (s' • m) (s * s') = mk
371370

372371
theorem smul'_mk (r : R) (s : S) (m : M) : r • mk m s = mk (r • m) s := by
373372
refine (OreLocalization.smul_oreDiv _ _ _).trans ?_
374-
change (r • 1 : R) • m /ₒ s = _
375-
rw [smul_assoc, one_smul]
373+
simp
376374

377375
lemma smul_eq_iff_of_mem
378376
(r : R) (hr : r ∈ S) (x y : LocalizedModule S M) :
@@ -448,11 +446,13 @@ noncomputable instance (priority := 900) algebra' {A : Type*} [Semiring A] [Alge
448446
algebraMap := numeratorRingHom.comp (algebraMap R A)
449447
commutes' r x := by
450448
induction x using induction_on with | _ a s => _
451-
change mk _ _ * mk _ _ = mk _ _ * mk _ _
449+
simp only [RingHom.coe_comp, RingHom.coe_mk, MonoidHom.coe_mk, OneHom.coe_mk,
450+
Function.comp_apply]
452451
rw [mk_mul_mk, mk_mul_mk, mul_comm, Algebra.commutes]
453452
smul_def' r x := by
454453
induction x using induction_on with | _ a s => _
455-
change _ • mk _ _ = mk _ _ * mk _ _
454+
simp only [RingHom.coe_comp, RingHom.coe_mk, MonoidHom.coe_mk, OneHom.coe_mk,
455+
Function.comp_apply]
456456
rw [mk_mul_mk, smul'_mk, Algebra.smul_def, one_mul]
457457

458458
private lemma example_oreLocalizationInstAlgebra_eq_localizedModuleAlgebra' :

Mathlib/Algebra/Ring/Parity.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,12 +243,12 @@ lemma odd_sub_one : Odd (a - 1) ↔ Even a :=
243243
⟨(by convert ·.add_odd odd_one; rw [sub_add_cancel]), (·.sub_odd odd_one)⟩
244244

245245
@[simp]
246-
lemma odd_add_two : Odd (a + 2) ↔ Odd a :=
247-
by rw [← one_add_one_eq_two, ← add_assoc, odd_add_one, even_add_one]
246+
lemma odd_add_two : Odd (a + 2) ↔ Odd a := by
247+
rw [← one_add_one_eq_two, ← add_assoc, odd_add_one, even_add_one]
248248

249249
@[simp]
250-
lemma odd_sub_two : Odd (a - 2) ↔ Odd a :=
251-
by rw [← odd_add_two (a := a - 2), add_comm_sub, sub_self, add_zero]
250+
lemma odd_sub_two : Odd (a - 2) ↔ Odd a := by
251+
rw [← odd_add_two (a := a - 2), add_comm_sub, sub_self, add_zero]
252252

253253
end Ring
254254

Mathlib/AlgebraicGeometry/Modules/Tilde.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ lemma sections_smul_localizations_def
103103
{U : (Opens (PrimeSpectrum.Top R))ᵒᵖ} (x : U.unop)
104104
(r : (Spec.structureSheaf R).val.obj U)
105105
(m : Localizations M ↑x) :
106-
r • m = (by exact r.1 x : Localization.AtPrime x.1.asIdeal) • m := rfl
106+
r • m = (by exact r.1 x : Localization.AtPrime x.1.asIdeal) • m :=
107+
rfl
107108

108109
/--
109110
For any `R`-module `M` and any open subset `U ⊆ Spec R`, `M^~(U)` is an `𝒪_{Spec R}(U)`-submodule

Mathlib/AlgebraicGeometry/Normalization.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ def normalizationDiagram : Y.Opensᵒᵖ ⥤ CommRingCat where
6363

6464
/-- The inclusion from the structure presheaf of `Y` to the integral closure of `Y` in `X`. -/
6565
def normalizationDiagramMap : Y.presheaf ⟶ f.normalizationDiagram where
66-
app U :=
67-
letI := (f.app U.unop).hom.toAlgebra
68-
CommRingCat.ofHom (algebraMap Γ(Y, U.unop) (integralClosure Γ(Y, U.unop) Γ(X, f ⁻¹ᵁ U.unop)))
69-
naturality {U V} i := by ext x; exact Subtype.ext congr($(f.naturality i) x)
66+
app U :=
67+
letI := (f.app U.unop).hom.toAlgebra
68+
CommRingCat.ofHom (algebraMap Γ(Y, U.unop) (integralClosure Γ(Y, U.unop) Γ(X, f ⁻¹ᵁ U.unop)))
69+
naturality {U V} i := by ext x; exact Subtype.ext congr($(f.naturality i) x)
7070

7171
variable [QuasiCompact f] [QuasiSeparated f]
7272

Mathlib/AlgebraicTopology/ModelCategory/Bifibrant.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ that are both cofibrant and fibrant.
153153
`BifibrantObject`. Otherwise, the typeclasses `IsCofibrant` and
154154
`IsFibrant` are preferred.) -/
155155
def bifibrantObjects : ObjectProperty C :=
156-
cofibrantObjects C ⊓ fibrantObjects C
156+
cofibrantObjects C ⊓ fibrantObjects C
157157

158158
variable (C) in
159159
lemma bifibrantObjects_le_cofibrantObject :

Mathlib/Analysis/Calculus/FDeriv/Norm.lean

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,12 @@ theorem ContDiffAt.contDiffAt_norm_of_smul (h : ContDiffAt ℝ n (‖·‖) (t
8080
· apply contDiffAt_zero.2
8181
exact ⟨univ, univ_mem, continuous_norm.continuousOn⟩
8282
obtain rfl | ht := eq_or_ne t 0
83-
· by_cases! hE : Nontrivial E
84-
· rw [zero_smul] at h
85-
exact (mt (ContDiffAt.differentiableAt · hn)) (not_differentiableAt_norm_zero E) h |>.elim
86-
· rw [eq_const_of_subsingleton (‖·‖) 0]
83+
· suffices Subsingleton E by
84+
rw [eq_const_of_subsingleton (‖·‖) 0]
8785
exact contDiffAt_const
86+
rw [zero_smul] at h
87+
by_contra!
88+
exact not_differentiableAt_norm_zero E <| h.differentiableAt hn
8889
· exact contDiffAt_norm_smul_iff ht |>.2 h
8990

9091
theorem HasStrictFDerivAt.hasStrictFDerivAt_norm_smul
@@ -146,10 +147,10 @@ theorem differentiableAt_norm_smul (ht : t ≠ 0) :
146147
theorem DifferentiableAt.differentiableAt_norm_of_smul (h : DifferentiableAt ℝ (‖·‖) (t • x)) :
147148
DifferentiableAt ℝ (‖·‖) x := by
148149
obtain rfl | ht := eq_or_ne t 0
149-
· by_cases! hE : Nontrivial E
150-
· rw [zero_smul] at h
151-
exact not_differentiableAt_norm_zero E h |>.elim
152-
· exact (hasFDerivAt_of_subsingleton _ _).differentiableAt
150+
· suffices Subsingleton E from (hasFDerivAt_of_subsingleton _ _).differentiableAt
151+
rw [zero_smul] at h
152+
by_contra!
153+
exact not_differentiableAt_norm_zero E h
153154
· exact differentiableAt_norm_smul ht |>.2 h
154155

155156
theorem DifferentiableAt.fderiv_norm_self {x : E} (h : DifferentiableAt ℝ (‖·‖) x) :

Mathlib/Analysis/Complex/UpperHalfPlane/Topology.lean

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ instance : LocPathConnectedSpace ℍ := isOpenEmbedding_coe.locPathConnectedSpac
6464
instance : NoncompactSpace ℍ := by
6565
refine ⟨fun h => ?_⟩
6666
have : IsCompact (Complex.im ⁻¹' Ioi 0) := isCompact_iff_isCompact_univ.2 h
67-
replace := this.isClosed.closure_eq
68-
rw [closure_preimage_im, closure_Ioi, Set.ext_iff] at this
69-
exact absurd ((this 0).1 (@self_mem_Ici ℝ _ 0)) (@lt_irrefl ℝ _ 0)
67+
simpa [closure_preimage_im] using congr(0 ∈ $this.isClosed.closure_eq)
7068

7169
instance : LocallyCompactSpace ℍ :=
7270
isOpenEmbedding_coe.locallyCompactSpace

Mathlib/Analysis/Distribution/TemperedDistribution.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ set_option backward.privateInPublic true in
9494
/-- A function of temperate growth `f` defines a tempered distribution via integration, namely
9595
`g ↦ ∫ (x : E), g x • f x ∂μ`. -/
9696
def toTemperedDistribution {f : E → F} (hf : f.HasTemperateGrowth) : 𝓢'(E, F) :=
97-
toPointwiseConvergenceCLM _ _ _ _ ((integralCLM ℂ μ) ∘L (bilinLeftCLM (lsmul ℂ ℂ) hf))
97+
toPointwiseConvergenceCLM _ _ _ _ ((integralCLM ℂ μ) ∘L (bilinLeftCLM (lsmul ℂ ℂ) hf))
9898

9999
set_option backward.privateInPublic true in
100100
@[simp]

Mathlib/Analysis/Normed/Module/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ lemma Metric.diam_closedBall_eq (x : E) {r : ℝ} (hr : 0 ≤ r) : diam (closedB
131131
diam_sphere_eq x hr |>.symm.le.trans <| diam_mono sphere_subset_closedBall isBounded_closedBall
132132

133133
lemma Metric.diam_ball_eq (x : E) {r : ℝ} (hr : 0 ≤ r) : diam (ball x r) = 2 * r := by
134-
/- This proof could be simplified with `Metric.diam_closure` and `closure_ball`,
134+
/- This proof could be simplified with `Metric.diam_closure` and `closure_ball`,
135135
but we opt for this proof to minimize dependencies. -/
136136
refine le_antisymm (diam_ball hr) <|
137137
mul_le_of_forall_lt_of_nonneg (by positivity) diam_nonneg fun a ha ha' r' hr' hr'' ↦ ?_

0 commit comments

Comments
 (0)