Skip to content

Commit 8ff09d9

Browse files
JovanGerbbryangingechen
authored andcommitted
chore: remove using clause from convert (leanprover-community#40738)
The new `convert` is less aggressive so in many cases, the `using` clause is not needed anymore. In this PR I manually removed some of these. There are many more left to remove, ideally using some automation.
1 parent b8dedbf commit 8ff09d9

84 files changed

Lines changed: 142 additions & 143 deletions

File tree

Some content is hidden

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

Archive/Imo/Imo1959Q2.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ theorem sqrt_two_mul_sub_one_le_one : sqrt (2 * x - 1) ≤ 1 ↔ x ≤ 1 := by
6060
theorem isGood_iff_eq_sqrt_two (hx : x ∈ Icc (1 / 2) 1) : IsGood x A ↔ A = sqrt 2 := by
6161
have : sqrt (2 * x - 1) ≤ 1 := sqrt_two_mul_sub_one_le_one.2 hx.2
6262
simp only [isGood_iff, hx.1, abs_sub_comm _ (1 : ℝ), abs_of_nonneg (sub_nonneg.2 this), and_true]
63-
suffices 2 = A * sqrt 2 ↔ A = sqrt 2 by convert! this using 2; ring
63+
suffices 2 = A * sqrt 2 ↔ A = sqrt 2 by convert this; ring
6464
rw [← div_eq_iff, div_sqrt, eq_comm]
6565
positivity
6666

Archive/Imo/Imo2024Q3.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ lemma exists_a_apply_add_eq : ∃ b c, 0 < c ∧ ∀ n, b < n →
938938
have := hc.p_pos (N' a N + 2 * (b + 2))
939939
rcases hc.even_p (by lia) (hs (b + 2)) with ⟨_, _⟩
940940
lia
941-
· convert! hc.apply_add_p_eq (by lia) (hs n) using 3
941+
· convert hc.apply_add_p_eq (by lia) (hs n)
942942
rcases hc.even_p (by lia) (hs n) with ⟨_, ht⟩
943943
simp [ht, ← two_mul]
944944

@@ -949,8 +949,8 @@ theorem result {a : ℕ → ℕ} {N : ℕ} (h : Condition a N) :
949949
obtain ⟨b, c, hc, hbc⟩ := h.exists_a_apply_add_eq a N
950950
obtain ⟨t, _⟩ | ⟨t, _⟩ := Nat.even_or_odd (Condition.N' a N)
951951
· refine .inl ⟨c, Condition.N' a N / 2 + b + 1, hc, fun m hm ↦ ?_⟩
952-
convert! hbc (m - t) (by lia) using 1 <;> dsimp only <;> congr <;> lia
952+
convert hbc (m - t) (by lia) <;> lia
953953
· refine .inr ⟨c, Condition.N' a N / 2 + b + 1, hc, fun m hm ↦ ?_⟩
954-
convert! hbc (m - t) (by lia) using 1 <;> dsimp only <;> congr 1 <;> lia
954+
convert hbc (m - t) (by lia) using 2 <;> lia
955955

956956
end Imo2024Q3

Archive/Imo/Imo2024Q6.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ lemma Aquaesulian.injective : Function.Injective f := by
5757

5858
lemma Aquaesulian.apply_zero : f 0 = 0 := by
5959
refine h.injective ?_
60-
convert! h.apply_apply_add 0 using 1 <;> simp
60+
convert h.apply_apply_add 0 <;> simp
6161

6262
@[simp]
6363
lemma Aquaesulian.apply_neg_apply_add (x : G) : f (-(f x)) + x = 0 := by
@@ -80,7 +80,7 @@ lemma Aquaesulian.apply_neg_of_apply_eq {x₁ x₂ : G} (hx : f x₁ = x₂) : f
8080

8181
lemma Aquaesulian.apply_neg_eq_neg_iff {x₁ x₂ : G} : f (-x₂) = -x₁ ↔ f x₁ = x₂ := by
8282
refine ⟨fun hn ↦ ?_, h.apply_neg_of_apply_eq⟩
83-
convert! h.apply_neg_of_apply_eq hn <;> rw [neg_neg]
83+
convert h.apply_neg_of_apply_eq hn <;> rw [neg_neg]
8484

8585
lemma Aquaesulian.pair_lemma {x u v : G} (huv : u ≠ v) (hx : f x = u ∨ f u = x)
8686
(hy : f x = v ∨ f v = x) : f x = v ∨ f x = u := by

Archive/MinimalSheffer.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ lemma sup_le (h₁ : a ≤ c) (h₂ : b ≤ c) : aᶜ | bᶜ ≤ c := by
121121
rw [h₂]
122122
have l1 := (abba (aᶜ | (b | c)) (b | c | c)).symm
123123
rw [comm _ (aᶜ | _), ← le_def] at l1
124-
convert! l1 using 1
124+
convert l1
125125
have l2 := veroff (b | c) c a
126126
rw [comm _ a, ← h₁, comm, comm _ aᶜ] at l2
127127
nth_rw 1 [l2, comm (b | c) c, comm b, veroff]

Archive/MiuLanguage/DecisionSuf.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ theorem der_replicate_I_of_mod3 (c : ℕ) (h : c % 3 = 1 ∨ c % 3 = 2) :
194194
replicate ((2 ^ m - c) / 3) U ++ replicate ((2 ^ m - c) / 3 % 2) U) := by
195195
apply
196196
der_cons_replicate_I_replicate_U_append_of_der_cons_replicate_I_append c ((2 ^ m - c) / 3) h
197-
convert! hw₂ using 4
197+
convert hw₂
198198
-- now we must show `c + 3 * ((2 ^ m - c) / 3) = 2 ^ m`
199199
rw [Nat.mul_div_cancel']
200200
· exact add_tsub_cancel_of_le hm.1
@@ -220,7 +220,7 @@ example (c : ℕ) (h : c % 3 = 1 ∨ c % 3 = 2) : Derivable (M :: replicate c I)
220220
replicate ((2 ^ m - c) / 3) U ++ replicate ((2 ^ m - c) / 3 % 2) U) := by
221221
apply
222222
der_cons_replicate_I_replicate_U_append_of_der_cons_replicate_I_append c ((2 ^ m - c) / 3) h
223-
convert! hw₂ using 4
223+
convert hw₂
224224
-- now we must show `c + 3 * ((2 ^ m - c) / 3) = 2 ^ m`
225225
rw [Nat.mul_div_cancel']
226226
· exact add_tsub_cancel_of_le hm.1

Archive/Wiedijk100Theorems/AscendingDescendingSequences.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private lemma maxIncSequencesTo_lt {i j : α} (hij : i < j) (hfij : f i < f j) :
9191
exact (hti.2 hx).trans_lt hij
9292
refine ⟨insert j t, ?_, ?_, ?_⟩
9393
next =>
94-
convert! hti.insert j using 1
94+
convert hti.insert j
9595
next => simp
9696
next => rw [max_eq_left hij.le]
9797
next =>

Counterexamples/CliffordAlgebraNotInjective.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ theorem quot_obv : α • x' - β • y' - γ • z' = 0 := by
234234
dsimp only [gen]
235235
simp_rw [← map_smul, ← map_sub, ← Submodule.Quotient.mk_smul _ (_ : K),
236236
← Submodule.Quotient.mk_sub]
237-
convert! LinearMap.map_zero _ using 2
237+
convert LinearMap.map_zero _
238238
rw [Submodule.Quotient.mk_eq_zero]
239239
simp +decide [sub_zero]
240240

Counterexamples/Phillips.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ theorem discretePart_apply (f : BoundedAdditiveMeasure α) (s : Set α) :
360360
theorem continuousPart_apply_eq_zero_of_countable (f : BoundedAdditiveMeasure α) (s : Set α)
361361
(hs : s.Countable) : f.continuousPart s = 0 := by
362362
simp only [continuousPart, restrict_apply]
363-
convert! f.apply_countable s hs using 2
363+
convert f.apply_countable s hs
364364
ext x
365365
simp [and_comm]
366366

Counterexamples/ZeroDivisorsInAddMonoidAlgebras.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ theorem zero_divisors_of_torsion {R A} [Nontrivial R] [Ring R] [AddMonoid A] (a
9797
(nsmul_ne_zero_of_lt_addOrderOf one_ne_zero (Nat.succ_le_iff.mp o2))
9898
simp only [a0, single_eq_of_ne', Ne, not_false_iff]
9999
· simpa only [single_eq_same] using zero_ne_one
100-
· convert! Commute.geom_sum₂_mul (R := AddMonoidAlgebra R A) _ (addOrderOf a) using 3
100+
· convert Commute.geom_sum₂_mul (R := AddMonoidAlgebra R A) _ (addOrderOf a)
101101
· rw [single_zero_one, one_pow, mul_one]
102102
· rw [single_pow, one_pow, addOrderOf_nsmul_eq_zero, single_zero_one, one_pow, sub_self]
103103
· simp only [single_zero_one, Commute.one_right]

Mathlib/Algebra/Algebra/Spectrum/Quasispectrum.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,13 @@ def unitsFstOne_mulEquiv_quasiregular : unitsFstOne R A ≃* (PreQuasiregular A)
156156
{ val := 1 + PreQuasiregular.equiv.symm x.val
157157
inv := 1 + PreQuasiregular.equiv.symm x⁻¹.val
158158
val_inv := by
159-
convert! congr((1 + $(inv_add_add_mul_eq_zero x) : Unitization R A)) using 1
159+
convert congr((1 + $(inv_add_add_mul_eq_zero x) : Unitization R A))
160160
· simp only [mul_one, PreQuasiregular.equiv_symm_apply, one_mul, mul_add,
161161
add_mul, inr_add, inr_mul]
162162
abel
163163
· simp only [inr_zero, add_zero]
164164
inv_val := by
165-
convert! congr((1 + $(add_inv_add_mul_eq_zero x) : Unitization R A)) using 1
165+
convert congr((1 + $(add_inv_add_mul_eq_zero x) : Unitization R A))
166166
· simp only [mul_one, PreQuasiregular.equiv_symm_apply, one_mul, mul_add,
167167
add_mul, inr_add, inr_mul]
168168
abel
@@ -216,8 +216,8 @@ lemma IsQuasiregular.isUnit_one_add {R : Type*} [Semiring R] {x : R} (hx : IsQua
216216
IsUnit (1 + x) := by
217217
obtain ⟨y, hy₁, hy₂⟩ := isQuasiregular_iff.mp hx
218218
refine ⟨⟨1 + x, 1 + y, ?_, ?_⟩, rfl⟩
219-
· convert! congr(1 + $(hy₁)) using 1 <;> [noncomm_ring; simp]
220-
· convert! congr(1 + $(hy₂)) using 1 <;> [noncomm_ring; simp]
219+
· convert congr(1 + $(hy₁)) <;> [noncomm_ring; simp]
220+
· convert congr(1 + $(hy₂)) <;> [noncomm_ring; simp]
221221

222222
lemma isQuasiregular_iff_isUnit {R : Type*} [Ring R] {x : R} :
223223
IsQuasiregular x ↔ IsUnit (1 + x) := by
@@ -229,7 +229,7 @@ lemma isQuasiregular_iff_isUnit {R : Type*} [Ring R] {x : R} :
229229
case' h.right => have := congr($(hx.val_inv_mul) - 1)
230230
all_goals
231231
rw [← sub_add_cancel (↑hx.unit⁻¹ : R) 1, sub_self] at this
232-
convert! this using 1
232+
convert this
233233
noncomm_ring
234234

235235
-- interestingly, this holds even in the semiring case.

0 commit comments

Comments
 (0)