Skip to content

Commit 4a5208f

Browse files
committed
chore(*): remove some set_option linter.flexible false (leanprover-community#36742)
1 parent 61154fb commit 4a5208f

6 files changed

Lines changed: 12 additions & 25 deletions

File tree

Mathlib/AlgebraicGeometry/Cover/Directed.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ variable [P.IsStableUnderBaseChange] (𝒰 : X.Cover (precoverage P))
157157
instance : Category (𝒰.pullback₁ f).I₀ := inferInstanceAs <| Category 𝒰.I₀
158158

159159
set_option backward.isDefEq.respectTransparency false in
160-
set_option linter.flexible false in -- TODO: fix the non-terminal simp at the end
161160
instance locallyDirectedPullbackCover : Cover.LocallyDirected (𝒰.pullback₁ f) where
162161
trans {i j} hij := pullback.map f (𝒰.f i) f (𝒰.f j) (𝟙 _) (𝒰.trans hij) (𝟙 _)
163162
(by simp) (by simp)
@@ -188,7 +187,8 @@ instance locallyDirectedPullbackCover : Cover.LocallyDirected (𝒰.pullback₁
188187
let iso : pullback f (𝒰.f i) ≅ pullback (pullback.snd f (𝒰.f j)) (𝒰.trans hij) :=
189188
pullback.congrHom rfl (by simp) ≪≫ (pullbackLeftPullbackSndIso _ _ _).symm
190189
rw [← P.cancel_left_of_respectsIso iso.inv]
191-
simp [Iso.trans_inv, Iso.symm_inv, pullback.congrHom_inv,
190+
simp only [Precoverage.ZeroHypercover.pullback₁_toPreZeroHypercover,
191+
PreZeroHypercover.pullback₁_X, Iso.trans_inv, Iso.symm_inv, pullback.congrHom_inv,
192192
Category.assoc, iso]
193193
convert P.pullback_fst (pullback.snd f (𝒰.f j)) _ (𝒰.property_trans hij)
194194
apply pullback.hom_ext <;> simp [pullback.condition]

Mathlib/Logic/Equiv/List.lean

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,16 +153,13 @@ instance denumerableList : Denumerable (List α) :=
153153
@[simp]
154154
theorem list_ofNat_zero : ofNat (List α) 0 = [] := by rw [← @encode_list_nil α, ofNat_encode]
155155

156-
-- TODO: find a good way to fix the linter
157-
set_option linter.flexible false in
158156
@[simp]
159157
theorem list_ofNat_succ (v : ℕ) :
160158
ofNat (List α) (succ v) = ofNat α v.unpair.1 :: ofNat (List α) v.unpair.2 :=
161159
ofNat_of_decode <|
162160
show decodeList (succ v) = _ by
163161
rcases e : unpair v with ⟨v₁, v₂⟩
164-
simp [decodeList, e]
165-
rw [show decodeList v₂ = decode (α := List α) v₂ from rfl, decode_eq_ofNat, Option.seq_some]
162+
simp [decodeList, e, show decodeList v₂ = decode (α := List α) v₂ from rfl]
166163

167164
end List
168165

Mathlib/RingTheory/Polynomial/Cyclotomic/Eval.lean

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,6 @@ theorem eval_one_cyclotomic_not_prime_pow {R : Type*} [Ring R] {n : ℕ}
167167
exact Nat.pow_right_injective hp.two_le hxy
168168

169169
set_option backward.isDefEq.respectTransparency false in
170-
-- Fix the non-terminal simp!
171-
set_option linter.flexible false in
172170
theorem sub_one_pow_totient_lt_cyclotomic_eval {n : ℕ} {q : ℝ} (hn' : 2 ≤ n) (hq' : 1 < q) :
173171
(q - 1) ^ totient n < (cyclotomic n ℝ).eval q := by
174172
have hn : 0 < n := pos_of_gt hn'
@@ -196,9 +194,8 @@ theorem sub_one_pow_totient_lt_cyclotomic_eval {n : ℕ} {q : ℝ} (hn' : 2 ≤
196194
have : ¬eval (↑q) (cyclotomic n ℂ) = 0 := by simpa using (cyclotomic_pos' n hq').ne'
197195
suffices Units.mk0 (Real.toNNReal (q - 1)) (by simp [hq']) ^ totient n <
198196
Units.mk0 ‖(cyclotomic n ℂ).eval ↑q‖₊ (by simp_all) by
199-
simp [← Units.val_lt_val, Units.val_pow_eq_pow_val, Units.val_mk0, ← NNReal.coe_lt_coe,
200-
hq'.le, coe_nnnorm, NNReal.coe_pow,
201-
Real.coe_toNNReal', sub_nonneg] at this
197+
simp only [← Units.val_lt_val, Units.val_pow_eq_pow_val, Units.val_mk0, ← NNReal.coe_lt_coe,
198+
hq'.le, coe_nnnorm, NNReal.coe_pow, Real.coe_toNNReal', sub_nonneg, sup_of_le_left] at this
202199
convert this
203200
rw [eq_comm]
204201
simp [cyclotomic_nonneg n hq'.le]
@@ -223,8 +220,6 @@ theorem sub_one_pow_totient_le_cyclotomic_eval {q : ℝ} (hq' : 1 < q) :
223220
| _ + 2 => (sub_one_pow_totient_lt_cyclotomic_eval le_add_self hq').le
224221

225222
set_option backward.isDefEq.respectTransparency false in
226-
-- TODO: non-terminal simps followed by positivity
227-
set_option linter.flexible false in
228223
theorem cyclotomic_eval_lt_add_one_pow_totient {n : ℕ} {q : ℝ} (hn' : 3 ≤ n) (hq' : 1 < q) :
229224
(cyclotomic n ℝ).eval q < (q + 1) ^ totient n := by
230225
have hn : 0 < n := pos_of_gt hn'
@@ -275,7 +270,7 @@ theorem cyclotomic_eval_lt_add_one_pow_totient {n : ℕ} {q : ℝ} (hn' : 3 ≤
275270
simp only [cyclotomic_eq_prod_X_sub_primitiveRoots hζ, eval_prod, eval_C, eval_X, eval_sub,
276271
nnnorm_prod, Units.mk0_prod]
277272
convert Finset.prod_lt_prod' (M := NNRealˣ) _ _
278-
swap; · exact fun _ => Units.mk0 (Real.toNNReal (q + 1)) (by simp; positivity)
273+
swap; · exact fun _ => Units.mk0 (Real.toNNReal (q + 1)) (by positivity)
279274
· simp [Complex.card_primitiveRoots]
280275
· simp only [Finset.mem_attach, forall_true_left, Subtype.forall, ←
281276
Units.val_le_val, ← NNReal.coe_le_coe, Units.val_mk0,

Mathlib/RingTheory/Valuation/ValuativeRel/Basic.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,6 @@ lemma ValueGroupWithZero.mk_eq_div (r : R) (s : posSubmonoid R) :
666666
rw [eq_div_iff (valuation_posSubmonoid_ne_zero _)]
667667
simp [valuation, mk_eq_mk]
668668

669-
set_option linter.flexible false in -- simp followed by gcongr
670669
/-- Construct a valuative relation on a ring using a valuation. -/
671670
@[implicit_reducible]
672671
def ofValuation
@@ -677,7 +676,7 @@ def ofValuation
677676
vle_total x y := le_total (v x) (v y)
678677
vle_trans := le_trans
679678
vle_add hab hbc := (map_add_le_max v _ _).trans (sup_le hab hbc)
680-
mul_vle_mul_left _ h := by simp [map_mul]; gcongr
679+
mul_vle_mul_left _ h := by simp only [map_mul]; gcongr
681680
vle_mul_cancel h0 h := by
682681
rw [map_zero, le_zero_iff] at h0
683682
simp only [map_mul] at h

Mathlib/SetTheory/Ordinal/Notation.lean

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,6 @@ theorem repr_opow_aux₁ {e a} [Ne : NF e] [Na : NF a] {a' : Ordinal} (e0 : repr
789789

790790
section
791791

792-
set_option linter.flexible false in -- simp used on two different goals
793792
theorem repr_opow_aux₂ {a0 a'} [N0 : NF a0] [Na' : NF a'] (m : ℕ) (d : ω ∣ repr a')
794793
(e0 : repr a0 ≠ 0) (h : repr a' + m < (ω ^ repr a0)) (n : ℕ+) (k : ℕ) :
795794
let R := repr (opowAux 0 a0 (oadd a0 n a' * ofNat m) k m)
@@ -820,9 +819,9 @@ theorem repr_opow_aux₂ {a0 a'} [N0 : NF a0] [Na' : NF a'] (m : ℕ) (d : ω
820819
by_cases k0 : k = 0
821820
· simp only [k0, Nat.cast_zero, succ_eq_add_one, _root_.zero_add, mul_one, R]
822821
refine lt_of_lt_of_le ?_ (opow_le_opow_right omega0_pos (one_le_iff_ne_zero.2 e0))
823-
rcases m with - | m <;> simp [opowAux, omega0_pos]
824-
rw [← Nat.cast_add_one]
825-
apply natCast_lt_omega0
822+
rcases m with - | m
823+
· simp [opowAux, omega0_pos]
824+
· simpa [opowAux] using natCast_lt_omega0 (m + 1)
826825
· rw [opow_mul]
827826
exact IH.1 k0
828827
refine ⟨fun _ => ?_, ?_⟩

Mathlib/Tactic/NormNum/Irrational.lean

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ open Qq Lean Elab.Tactic Mathlib.Meta.NormNum
3838

3939
section lemmas
4040

41-
-- TODO: fix non-terminal simp (acting on three goals, with different simp sets)
42-
set_option linter.flexible false in
4341
private theorem irrational_rpow_rat_of_not_power {q : ℚ} {a b : ℕ}
4442
(h : ∀ p : ℚ, q ^ a ≠ p ^ b) (hb : 0 < b) (hq : 0 ≤ q) :
4543
Irrational (Real.rpow q (a / b : ℚ)) := by
@@ -48,9 +46,8 @@ private theorem irrational_rpow_rat_of_not_power {q : ℚ} {a b : ℕ}
4846
intro x hx
4947
absurd h x
5048
rify
51-
rw [hx, ← Real.rpow_mul_natCast, div_mul_cancel₀] <;> simp
52-
· lia
53-
· assumption
49+
rw [hx, ← Real.rpow_mul_natCast (by simpa), div_mul_cancel₀ _ (by simp; lia)]
50+
simp
5451

5552
private theorem not_power_nat_pow {n p q : ℕ}
5653
(h_coprime : p.Coprime q)

0 commit comments

Comments
 (0)