Skip to content

Commit c05a1ae

Browse files
chore: tidy various files (leanprover-community#33340)
1 parent a36c84a commit c05a1ae

29 files changed

Lines changed: 92 additions & 108 deletions

File tree

Counterexamples/NowhereDifferentiable.lean

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ theorem lt_seq {b : ℝ} (hb : 0 < b) (x : ℝ) (m : ℕ) : x < seq b x m := by
103103

104104
theorem le_seq {b : ℝ} (hb : 0 < b) (x : ℝ) (m : ℕ) : x ≤ seq b x m := (lt_seq hb x m).le
105105

106-
theorem seq_le {b : ℝ} (hb : 0 < b) (x : ℝ) (m : ℕ) : seq b x m ≤ x + (3 / 2) * b⁻¹ ^ m := by
106+
theorem seq_le {b : ℝ} (hb : 0 < b) (x : ℝ) (m : ℕ) : seq b x m ≤ x + (3 / 2) * b⁻¹ ^ m := by
107107
grw [seq, Int.floor_le]
108108
simp [field]
109109

@@ -235,13 +235,13 @@ theorem weierstrass_slope {a : ℝ} (ha : a ∈ Set.Ioo 0 1) {b : ℕ} (hb : Odd
235235
|seq b x m - x| * ((2 / 3 - π / (a * b - 1)) * (a * b) ^ m) ≤
236236
|weierstrass a b (seq b x m) - weierstrass a b x| := by
237237
simp_rw [weierstrass]
238-
obtain hsseq := summable_weierstrass ha b (seq b x m)
239-
obtain hsx := summable_weierstrass ha b x
240-
obtain hsum := hsseq.sub hsx
238+
have hsseq := summable_weierstrass ha b (seq b x m)
239+
have hsx := summable_weierstrass ha b x
240+
have hsum := hsseq.sub hsx
241241
rw [← hsseq.tsum_sub hsx]
242242
simp_rw [← mul_sub] at ⊢ hsum
243243
rw [← hsum.sum_add_tsum_nat_add m]
244-
obtain hsum_shift := (summable_nat_add_iff m).mpr hsum
244+
have hsum_shift := (summable_nat_add_iff m).mpr hsum
245245
rw [add_comm]
246246
refine le_trans ?_ (abs_sub_abs_le_abs_add _ _)
247247
rw [sub_mul (2 / 3), mul_sub |seq b x m - x|]
@@ -263,7 +263,7 @@ theorem not_differentiableAt_weierstrass
263263
atTop (𝓝 (f' 1)) := by
264264
convert (h.lim_real 1).comp (tendsto_seq_sub_inv hb1 x)
265265
simp
266-
obtain h := (continuous_abs.tendsto _).comp this
266+
have h := (continuous_abs.tendsto _).comp this
267267
contrapose! h
268268
apply not_tendsto_nhds_of_tendsto_atTop
269269
-- To show the absolute value of slope tends to ∞, it suffices to show its lower bound does.

Mathlib/Algebra/AffineMonoid/Basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ monoids.
1717
public section
1818

1919
/-- An affine monoid is a finitely generated cancellative torsion-free commutative monoid. -/
20-
class abbrev IsAffineAddMonoid(M : Type*)[AddCommMonoid M] : Prop :=
20+
class abbrev IsAffineAddMonoid (M : Type*) [AddCommMonoid M] : Prop :=
2121
IsCancelAdd M, AddMonoid.FG M, IsAddTorsionFree M
2222

2323
/-- An affine monoid is a finitely generated cancellative torsion-free commutative monoid. -/
2424
@[to_additive]
25-
class abbrev IsAffineMonoid(M : Type*)[CommMonoid M] : Prop :=
25+
class abbrev IsAffineMonoid (M : Type*) [CommMonoid M] : Prop :=
2626
IsCancelMul M, Monoid.FG M, IsMulTorsionFree M

Mathlib/Algebra/Algebra/Subalgebra/Pointwise.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ section Pointwise
2525
variable {R : Type*} {A : Type*} [CommSemiring R] [Semiring A] [Algebra R A]
2626

2727
theorem mul_toSubmodule_le (S T : Subalgebra R A) :
28-
(Subalgebra.toSubmodule S) * (Subalgebra.toSubmodule T) ≤ Subalgebra.toSubmodule (S ⊔ T) := by
28+
Subalgebra.toSubmodule S * Subalgebra.toSubmodule T ≤ Subalgebra.toSubmodule (S ⊔ T) := by
2929
rw [Submodule.mul_le]
3030
intro y hy z hz
31-
change y * z ∈ S ⊔ T
31+
simp only [mem_toSubmodule]
3232
exact mul_mem (Algebra.mem_sup_left hy) (Algebra.mem_sup_right hz)
3333

3434
/-- As submodules, subalgebras are idempotent. -/

Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -522,10 +522,8 @@ theorem prod_bij_ne_one {s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ
522522

523523
@[to_additive]
524524
theorem exists_ne_one_of_prod_ne_one (h : ∏ x ∈ s, f x ≠ 1) : ∃ a ∈ s, f a ≠ 1 := by
525-
classical
526-
rw [← prod_filter_ne_one] at h
527-
rcases nonempty_of_prod_ne_one h with ⟨x, hx⟩
528-
exact ⟨x, (mem_filter.1 hx).1, by simpa using (mem_filter.1 hx).2
525+
contrapose! h
526+
exact prod_eq_one h
529527

530528
@[to_additive]
531529
theorem prod_range_succ_comm (f : ℕ → M) (n : ℕ) :

Mathlib/Algebra/Module/LocalizedModule/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@ lemma map_mk' (h : M →ₗ[R] N) (x) (s : S) :
12031203
rfl
12041204

12051205
@[simp]
1206-
lemma map_id : map S f f (.id) = .id := by
1206+
lemma map_id : map S f f .id = .id := by
12071207
ext x
12081208
obtain ⟨⟨x, s⟩, rfl⟩ := IsLocalizedModule.mk'_surjective S f x
12091209
simp

Mathlib/Algebra/Order/Floor/Ring.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ variable {k : Type*} [Field k] [LinearOrder k] [IsStrictOrderedRing k] [FloorRin
286286
theorem floor_div_cast_of_nonneg {n : ℤ} (hn : 0 ≤ n) (a : k) : ⌊a / n⌋ = ⌊a⌋ / n := by
287287
obtain rfl | hn := hn.eq_or_lt
288288
· simp
289-
nth_rw 2 [<- div_mul_cancel₀ (a := a) (ne_of_gt (Int.cast_pos.mpr hn))]
289+
nth_rw 2 [ div_mul_cancel₀ (a := a) (ne_of_gt (Int.cast_pos.mpr hn))]
290290
rw [mul_cast_floor_div_cancel_of_pos hn]
291291

292292
theorem floor_div_natCast (a : k) (n : ℕ) : ⌊a / n⌋ = ⌊a⌋ / n := by

Mathlib/Algebra/Order/Floor/Semifield.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ variable [Semifield K] [LinearOrder K] [IsStrictOrderedRing K] [FloorSemiring K]
3636
theorem floor_div_natCast (a : K) (n : ℕ) : ⌊a / n⌋₊ = ⌊a⌋₊ / n := by
3737
obtain rfl | hn := n.eq_zero_or_pos
3838
· simp
39-
nth_rw 2 [<- div_mul_cancel₀ (a := a) (b := ↑n) (by positivity)]
39+
nth_rw 2 [ div_mul_cancel₀ (a := a) (b := ↑n) (by positivity)]
4040
rw [mul_cast_floor_div_cancel (Nat.ne_zero_of_lt hn)]
4141

4242
theorem floor_div_ofNat (a : K) (n : ℕ) [n.AtLeastTwo] :

Mathlib/Algebra/SkewMonoidAlgebra/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ theorem coeff_single_mul_aux (f : SkewMonoidAlgebra k G) {r : k} {x y z : G}
933933
classical
934934
have : (f.sum fun a b ↦ ite (x * a = y) (0 * x • b) 0) = 0 := by simp
935935
calc
936-
((single x r) * f).coeff y =
936+
(single x r * f).coeff y =
937937
sum f fun a b ↦ ite (x * a = y) (r * x • b) 0 :=
938938
(coeff_mul _ _ _).trans <| sum_single_index this
939939
_ = f.sum fun a b ↦ ite (a = z) (r * x • b) 0 := by simp [H]

Mathlib/Analysis/MeanInequalities.lean

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -343,22 +343,22 @@ version for real-valued nonnegative functions. -/
343343
theorem harm_mean_le_geom_mean_weighted (w z : ι → ℝ) (hs : s.Nonempty) (hw : ∀ i ∈ s, 0 < w i)
344344
(hw' : ∑ i ∈ s, w i = 1) (hz : ∀ i ∈ s, 0 < z i) :
345345
(∑ i ∈ s, w i / z i)⁻¹ ≤ ∏ i ∈ s, z i ^ w i := by
346-
have : ∏ i ∈ s, (1 / z) i ^ w i ≤ ∑ i ∈ s, w i * (1 / z) i :=
347-
geom_mean_le_arith_mean_weighted s w (1 / z) (fun i hi ↦ le_of_lt (hw i hi)) hw'
348-
(fun i hi ↦ one_div_nonneg.2 (le_of_lt (hz i hi)))
349-
have p_pos : 0 < ∏ i ∈ s, (z i)⁻¹ ^ w i :=
350-
prod_pos fun i hi => rpow_pos_of_pos (inv_pos.2 (hz i hi)) _
351-
have s_pos : 0 < ∑ i ∈ s, w i * (z i)⁻¹ :=
352-
sum_pos (fun i hi => mul_pos (hw i hi) (inv_pos.2 (hz i hi))) hs
353-
norm_num at this
354-
rw [← inv_le_inv₀ s_pos p_pos] at this
355-
apply le_trans this
356-
have p_pos₂ : 0 < (∏ i ∈ s, (z i) ^ w i)⁻¹ :=
357-
inv_pos.2 (prod_pos fun i hi => rpow_pos_of_pos ((hz i hi)) _)
358-
rw [← inv_inv (∏ i ∈ s, z i ^ w i), inv_le_inv₀ p_pos p_pos₂, ← Finset.prod_inv_distrib]
359-
gcongr
360-
· exact fun i hi ↦ inv_nonneg.mpr (Real.rpow_nonneg (le_of_lt (hz i hi)) _)
361-
· rw [Real.inv_rpow]; apply fun i hi ↦ le_of_lt (hz i hi); assumption
346+
have : ∏ i ∈ s, (1 / z) i ^ w i ≤ ∑ i ∈ s, w i * (1 / z) i :=
347+
geom_mean_le_arith_mean_weighted s w (1 / z) (fun i hi ↦ le_of_lt (hw i hi)) hw'
348+
(fun i hi ↦ one_div_nonneg.2 (le_of_lt (hz i hi)))
349+
have p_pos : 0 < ∏ i ∈ s, (z i)⁻¹ ^ w i :=
350+
prod_pos fun i hi => rpow_pos_of_pos (inv_pos.2 (hz i hi)) _
351+
have s_pos : 0 < ∑ i ∈ s, w i * (z i)⁻¹ :=
352+
sum_pos (fun i hi => mul_pos (hw i hi) (inv_pos.2 (hz i hi))) hs
353+
norm_num at this
354+
rw [← inv_le_inv₀ s_pos p_pos] at this
355+
apply le_trans this
356+
have p_pos₂ : 0 < (∏ i ∈ s, (z i) ^ w i)⁻¹ :=
357+
inv_pos.2 (prod_pos fun i hi => rpow_pos_of_pos ((hz i hi)) _)
358+
rw [← inv_inv (∏ i ∈ s, z i ^ w i), inv_le_inv₀ p_pos p_pos₂, ← Finset.prod_inv_distrib]
359+
gcongr
360+
· exact fun i hi ↦ inv_nonneg.mpr (Real.rpow_nonneg (le_of_lt (hz i hi)) _)
361+
· rw [Real.inv_rpow]; apply fun i hi ↦ le_of_lt (hz i hi); assumption
362362

363363

364364
/-- **HM-GM inequality**: The **harmonic mean is less than or equal to the geometric mean. -/

Mathlib/CategoryTheory/Functor/Derived/PointwiseLeftDerived.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ We show that if `F : C ⥤ H` inverts `W : MorphismProperty C`,
1919
then it has a pointwise left derived functor.
2020
2121
Note: this file was obtained by dualizing the definitions in the file
22-
`Functor.Derived.PointwiseRightDerived`. These two files should be
22+
`Mathlib/CategoryTheory/Functor/Derived/PointwiseRightDerived.lean`. These two files should be
2323
kept in sync.
2424
2525
-/

0 commit comments

Comments
 (0)