Skip to content

Commit 5e9b46e

Browse files
sgouezeleric-wieser
andcommitted
style: cleanup by putting by on the same line as := (#8407)
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
1 parent 9b25884 commit 5e9b46e

Some content is hidden

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

68 files changed

+273
-247
lines changed

Archive/Imo/Imo2005Q3.lean

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ theorem key_insight (x y z : ℝ) (hx : x > 0) (hy : y > 0) (hz : z > 0) (h : x
3636
ring
3737
have h₅ :
3838
(x ^ 3 - 1) ^ 2 * x ^ 2 * (y ^ 2 + z ^ 2) /
39-
((x ^ 5 + y ^ 2 + z ^ 2) * (x ^ 3 * (x ^ 2 + y ^ 2 + z ^ 2))) ≥
40-
0 :=
41-
by positivity
39+
((x ^ 5 + y ^ 2 + z ^ 2) * (x ^ 3 * (x ^ 2 + y ^ 2 + z ^ 2))) ≥ 0 := by positivity
4240
calc
4341
(x ^ 5 - x ^ 2) / (x ^ 5 + y ^ 2 + z ^ 2)
4442
≥ (x ^ 5 - x ^ 2 * 1) / (x ^ 3 * (x ^ 2 + y ^ 2 + z ^ 2)) := by linarith only [key, h₅]

Archive/Wiedijk100Theorems/Partition.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -496,15 +496,15 @@ theorem same_gf [Field α] (m : ℕ) :
496496
calc
497497
(∏ i in range (m + 1), (1 - X ^ (2 * i + 1))⁻¹) *
498498
∏ i in range (m + 1), (1 - X ^ (m + 1 + i + 1)) =
499-
π₁ * (1 - X ^ (2 * m + 1))⁻¹ * (π₀ * (1 - X ^ (m + 1 + m + 1))) :=
500-
by rw [prod_range_succ _ m, ← hπ₁, prod_range_succ _ m, ← hπ₀]
499+
π₁ * (1 - X ^ (2 * m + 1))⁻¹ * (π₀ * (1 - X ^ (m + 1 + m + 1))) := by
500+
rw [prod_range_succ _ m, ← hπ₁, prod_range_succ _ m, ← hπ₀]
501501
_ = π₁ * (1 - X ^ (2 * m + 1))⁻¹ * (π₀ * ((1 + X ^ (m + 1)) * (1 - X ^ (m + 1)))) := by
502502
rw [← sq_sub_sq, one_pow, add_assoc _ m 1, ← two_mul (m + 1), pow_mul']
503503
_ = π₀ * (1 - X ^ (m + 1)) * (1 - X ^ (2 * m + 1))⁻¹ * (π₁ * (1 + X ^ (m + 1))) := by ring
504504
_ =
505505
(∏ i in range (m + 1), (1 - X ^ (m + 1 + i))) * (1 - X ^ (2 * m + 1))⁻¹ *
506-
(π₁ * (1 + X ^ (m + 1))) :=
507-
by rw [prod_range_succ', add_zero, hπ₀]; simp_rw [← add_assoc]
506+
(π₁ * (1 + X ^ (m + 1))) := by
507+
rw [prod_range_succ', add_zero, hπ₀]; simp_rw [← add_assoc]
508508
_ = π₂ * (1 - X ^ (m + 1 + m)) * (1 - X ^ (2 * m + 1))⁻¹ * (π₁ * (1 + X ^ (m + 1))) := by
509509
rw [add_right_comm, hπ₂, ← prod_range_succ]; simp_rw [add_right_comm]
510510
_ = π₂ * (1 - X ^ (2 * m + 1)) * (1 - X ^ (2 * m + 1))⁻¹ * (π₁ * (1 + X ^ (m + 1))) := by

Archive/Wiedijk100Theorems/SolutionOfCubic.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ theorem cubic_eq_zero_iff (ha : a ≠ 0) (hω : IsPrimitiveRoot ω 3)
105105
have hi3 : (3 : K) ≠ 0 := nonzero_of_invertible _
106106
have h9 : (9 : K) = 3 ^ 2 := by norm_num
107107
have h54 : (54 : K) = 2 * 3 ^ 3 := by norm_num
108-
have h₁ : a * x ^ 3 + b * x ^ 2 + c * x + d = a * (x ^ 3 + b / a * x ^ 2 + c / a * x + d / a) :=
109-
by field_simp; ring
108+
have h₁ : a * x ^ 3 + b * x ^ 2 + c * x + d
109+
= a * (x ^ 3 + b / a * x ^ 2 + c / a * x + d / a) := by field_simp; ring
110110
have h₂ : ∀ x, a * x = 0 ↔ x = 0 := by intro x; simp [ha]
111111
have hp' : p = (3 * (c / a) - (b / a) ^ 2) / 9 := by field_simp [hp, h9]; ring_nf
112112
have hq' : q = (9 * (b / a) * (c / a) - 2 * (b / a) ^ 3 - 27 * (d / a)) / 54 := by
@@ -136,8 +136,8 @@ theorem cubic_eq_zero_iff_of_p_eq_zero (ha : a ≠ 0) (hω : IsPrimitiveRoot ω
136136
have h₂ :=
137137
calc
138138
a * x ^ 3 + b * x ^ 2 + c * x + d =
139-
a * (x + b / (3 * a)) ^ 3 + (c - b ^ 2 / (3 * a)) * x + (d - b ^ 3 * a / (3 * a) ^ 3) :=
140-
by field_simp; ring
139+
a * (x + b / (3 * a)) ^ 3 + (c - b ^ 2 / (3 * a)) * x + (d - b ^ 3 * a / (3 * a) ^ 3) := by
140+
field_simp; ring
141141
_ = a * (x + b / (3 * a)) ^ 3 + (d - (9 * a * b * c - 2 * b ^ 3) * a / (3 * a) ^ 3) := by
142142
simp only [hb2, hb3]; field_simp; ring
143143
_ = a * ((x + b / (3 * a)) ^ 3 - s ^ 3) := by rw [hs3, hq]; field_simp [h54]; ring

Mathlib/Algebra/Algebra/Basic.lean

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,9 @@ theorem left_comm (x : A) (r : R) (y : A) :
368368
#align algebra.left_comm Algebra.left_comm
369369

370370
/-- `mul_right_comm` for `Algebra`s when one element is from the base ring. -/
371-
theorem right_comm (x : A) (r : R) (y : A) : x * algebraMap R A r * y = x * y * algebraMap R A r :=
372-
by rw [mul_assoc, commutes, ← mul_assoc]
371+
theorem right_comm (x : A) (r : R) (y : A) :
372+
x * algebraMap R A r * y = x * y * algebraMap R A r := by
373+
rw [mul_assoc, commutes, ← mul_assoc]
373374
#align algebra.right_comm Algebra.right_comm
374375

375376
instance _root_.IsScalarTower.right : IsScalarTower R A A :=

Mathlib/Algebra/Algebra/Operations.lean

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ theorem map_op_mul :
294294
theorem comap_unop_mul :
295295
comap (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ).symm : Aᵐᵒᵖ →ₗ[R] A) (M * N) =
296296
comap (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ).symm : Aᵐᵒᵖ →ₗ[R] A) N *
297-
comap (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ).symm : Aᵐᵒᵖ →ₗ[R] A) M :=
298-
by simp_rw [← map_equiv_eq_comap_symm, map_op_mul]
297+
comap (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ).symm : Aᵐᵒᵖ →ₗ[R] A) M := by
298+
simp_rw [← map_equiv_eq_comap_symm, map_op_mul]
299299
#align submodule.comap_unop_mul Submodule.comap_unop_mul
300300

301301
theorem map_unop_mul (M N : Submodule R Aᵐᵒᵖ) :
@@ -312,8 +312,8 @@ theorem map_unop_mul (M N : Submodule R Aᵐᵒᵖ) :
312312
theorem comap_op_mul (M N : Submodule R Aᵐᵒᵖ) :
313313
comap (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ) : A →ₗ[R] Aᵐᵒᵖ) (M * N) =
314314
comap (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ) : A →ₗ[R] Aᵐᵒᵖ) N *
315-
comap (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ) : A →ₗ[R] Aᵐᵒᵖ) M :=
316-
by simp_rw [comap_equiv_eq_map_symm, map_unop_mul]
315+
comap (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ) : A →ₗ[R] Aᵐᵒᵖ) M := by
316+
simp_rw [comap_equiv_eq_map_symm, map_unop_mul]
317317
#align submodule.comap_op_mul Submodule.comap_op_mul
318318

319319
section
@@ -534,14 +534,14 @@ theorem comap_op_pow (n : ℕ) (M : Submodule R Aᵐᵒᵖ) :
534534

535535
theorem map_op_pow (n : ℕ) :
536536
map (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ) : A →ₗ[R] Aᵐᵒᵖ) (M ^ n) =
537-
map (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ) : A →ₗ[R] Aᵐᵒᵖ) M ^ n :=
538-
by rw [map_equiv_eq_comap_symm, map_equiv_eq_comap_symm, comap_unop_pow]
537+
map (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ) : A →ₗ[R] Aᵐᵒᵖ) M ^ n := by
538+
rw [map_equiv_eq_comap_symm, map_equiv_eq_comap_symm, comap_unop_pow]
539539
#align submodule.map_op_pow Submodule.map_op_pow
540540

541541
theorem map_unop_pow (n : ℕ) (M : Submodule R Aᵐᵒᵖ) :
542542
map (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ).symm : Aᵐᵒᵖ →ₗ[R] A) (M ^ n) =
543-
map (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ).symm : Aᵐᵒᵖ →ₗ[R] A) M ^ n :=
544-
by rw [← comap_equiv_eq_map_symm, ← comap_equiv_eq_map_symm, comap_op_pow]
543+
map (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ).symm : Aᵐᵒᵖ →ₗ[R] A) M ^ n := by
544+
rw [← comap_equiv_eq_map_symm, ← comap_equiv_eq_map_symm, comap_op_pow]
545545
#align submodule.map_unop_pow Submodule.map_unop_pow
546546

547547
/-- `span` is a semiring homomorphism (recall multiplication is pointwise multiplication of subsets

Mathlib/Algebra/Algebra/Spectrum.lean

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,11 @@ theorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b)
230230
refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩
231231
calc
232232
(1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =
233-
1 - y * x + y * ((1 - x * y) * h.unit.inv) * x :=
234-
by noncomm_ring
233+
1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring
235234
_ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]
236235
calc
237236
(1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =
238-
1 - y * x + y * (h.unit.inv * (1 - x * y)) * x :=
239-
by noncomm_ring
237+
1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring
240238
_ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]
241239
have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))
242240
rw [mul_smul_comm r⁻¹ b a] at this

Mathlib/Algebra/Algebra/Tower.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ variable {R S A B}
157157

158158
@[simp]
159159
theorem _root_.AlgHom.map_algebraMap (f : A →ₐ[S] B) (r : R) :
160-
f (algebraMap R A r) = algebraMap R B r :=
161-
by rw [algebraMap_apply R S A r, f.commutes, ← algebraMap_apply R S B]
160+
f (algebraMap R A r) = algebraMap R B r := by
161+
rw [algebraMap_apply R S A r, f.commutes, ← algebraMap_apply R S B]
162162
#align alg_hom.map_algebra_map AlgHom.map_algebraMap
163163

164164
variable (R)

Mathlib/Algebra/Associated.lean

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -913,8 +913,8 @@ theorem isUnit_iff_eq_bot {a : Associates α} : IsUnit a ↔ a = ⊥ := by
913913

914914
theorem isUnit_mk {a : α} : IsUnit (Associates.mk a) ↔ IsUnit a :=
915915
calc
916-
IsUnit (Associates.mk a) ↔ a ~ᵤ 1 :=
917-
by rw [isUnit_iff_eq_one, one_eq_mk_one, mk_eq_mk_iff_associated]
916+
IsUnit (Associates.mk a) ↔ a ~ᵤ 1 := by
917+
rw [isUnit_iff_eq_one, one_eq_mk_one, mk_eq_mk_iff_associated]
918918
_ ↔ IsUnit a := associated_one_iff_isUnit
919919
#align associates.is_unit_mk Associates.isUnit_mk
920920

@@ -1123,8 +1123,7 @@ instance instCancelCommMonoidWithZero : CancelCommMonoidWithZero (Associates α)
11231123
have hu : a * (b * ↑u) = a * c := by rwa [← mul_assoc]
11241124
exact Quotient.sound' ⟨u, mul_left_cancel₀ (mk_ne_zero.1 ha) hu⟩ }
11251125

1126-
instance : NoZeroDivisors (Associates α) :=
1127-
by infer_instance
1126+
instance : NoZeroDivisors (Associates α) := by infer_instance
11281127

11291128
theorem le_of_mul_le_mul_left (a b c : Associates α) (ha : a ≠ 0) : a * b ≤ a * c → b ≤ c
11301129
| ⟨d, hd⟩ => ⟨d, mul_left_cancel₀ ha <| by rwa [← mul_assoc]⟩

Mathlib/Algebra/BigOperators/Intervals.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ section GaussSum
199199
/-- Gauss' summation formula -/
200200
theorem sum_range_id_mul_two (n : ℕ) : (∑ i in range n, i) * 2 = n * (n - 1) :=
201201
calc
202-
(∑ i in range n, i) * 2 = (∑ i in range n, i) + ∑ i in range n, (n - 1 - i) :=
203-
by rw [sum_range_reflect (fun i => i) n, mul_two]
202+
(∑ i in range n, i) * 2 = (∑ i in range n, i) + ∑ i in range n, (n - 1 - i) := by
203+
rw [sum_range_reflect (fun i => i) n, mul_two]
204204
_ = ∑ i in range n, (i + (n - 1 - i)) := sum_add_distrib.symm
205205
_ = ∑ i in range n, (n - 1) :=
206206
sum_congr rfl fun i hi => add_tsub_cancel_of_le <| Nat.le_sub_one_of_lt <| mem_range.1 hi

Mathlib/Algebra/BigOperators/NatAntidiagonal.lean

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ namespace Finset
2323
namespace Nat
2424

2525
theorem prod_antidiagonal_succ {n : ℕ} {f : ℕ × ℕ → M} :
26-
(∏ p in antidiagonal (n + 1), f p) = f (0, n + 1) * ∏ p in antidiagonal n, f (p.1 + 1, p.2) :=
27-
by rw [antidiagonal_succ, prod_cons, prod_map]; rfl
26+
(∏ p in antidiagonal (n + 1), f p)
27+
= f (0, n + 1) * ∏ p in antidiagonal n, f (p.1 + 1, p.2) := by
28+
rw [antidiagonal_succ, prod_cons, prod_map]; rfl
2829
#align finset.nat.prod_antidiagonal_succ Finset.Nat.prod_antidiagonal_succ
2930

3031
theorem sum_antidiagonal_succ {n : ℕ} {f : ℕ × ℕ → N} :

0 commit comments

Comments
 (0)