Skip to content

Commit 5449ee7

Browse files
committed
chore(Algebra): remove some set_option linter.flexible false (leanprover-community#36725)
1 parent e931833 commit 5449ee7

4 files changed

Lines changed: 4 additions & 13 deletions

File tree

Mathlib/Algebra/Group/Submonoid/Basic.lean

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,6 @@ example {p : M → Prop} (s : Set M) (closure : closure s = ⊤) (mem : ∀ x
215215
| one => exact one
216216
| mul _ _ h₁ h₂ => exact mul _ _ h₁ h₂
217217

218-
-- TODO: find a nice way to fix the linter
219-
-- simp_all is called on four goals, with only one remaining goal
220-
set_option linter.flexible false in
221218
/-- The `Submonoid.closure` of a set is the union of `{1}` and its `Subsemigroup.closure`. -/
222219
lemma closure_eq_one_union (s : Set M) :
223220
closure s = {(1 : M)} ∪ (Subsemigroup.closure s : Set M) := by
@@ -229,8 +226,7 @@ lemma closure_eq_one_union (s : Set M) :
229226
| mul x hx y hy hx hy =>
230227
push _ ∈ _ at hx hy
231228
obtain ⟨(rfl | hx), (rfl | hy)⟩ := And.intro hx hy
232-
all_goals simp_all
233-
exact Or.inr <| mul_mem hx hy
229+
all_goals simp_all [mul_mem]
234230
· rintro x (hx | hx)
235231
· exact (show x = 1 by simpa using hx) ▸ one_mem (closure s)
236232
· exact Subsemigroup.closure_le.mpr subset_closure hx

Mathlib/Algebra/LinearRecurrence.lean

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,12 @@ theorem eq_mk_of_is_sol_of_eq_init' {u : ℕ → R} {init : Fin E.order → R} (
112112
(heq : ∀ n : Fin E.order, u n = init n) : u = E.mkSol init :=
113113
funext (E.eq_mk_of_is_sol_of_eq_init h heq)
114114

115-
-- TODO: there's a non-terminal simp here
116-
set_option linter.flexible false in
117115
/-- The space of solutions of `E`, as a `Submodule` over `R` of the module `ℕ → R`. -/
118116
def solSpace : Submodule R (ℕ → R) where
119117
carrier := { u | E.IsSolution u }
120118
zero_mem' n := by simp
121119
add_mem' {u v} hu hv n := by simp [mul_add, sum_add_distrib, hu n, hv n]
122-
smul_mem' a u hu n := by simp [hu n, mul_sum]; congr; ext; ac_rfl
120+
smul_mem' a u hu n := by simp [hu n, mul_sum]; ac_rfl
123121

124122
/-- Defining property of the solution space : `u` is a solution
125123
iff it belongs to the solution space. -/

Mathlib/Algebra/Module/ZLattice/Summable.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ lemma sum_piFinset_Icc_rpow_le {ι : Type*} [Fintype ι] [DecidableEq ι]
158158

159159
variable (L)
160160

161-
set_option linter.flexible false in -- simp followed by positivity
162161
lemma exists_finsetSum_norm_rpow_le_tsum :
163162
∃ A > (0 : ℝ), ∀ r < (-Module.finrank ℤ L : ℝ), ∀ s : Finset L,
164163
∑ z ∈ s, ‖z‖ ^ r ≤ A ^ r * ∑' k : ℕ, (k : ℝ) ^ (Module.finrank ℤ L - 1 + r) := by
@@ -188,7 +187,7 @@ lemma exists_finsetSum_norm_rpow_le_tsum :
188187
obtain ⟨n, hn⟩ : ∃ n : ℕ, u ⊆ Fintype.piFinset fun _ : I ↦ Finset.Icc (-n : ℤ) n := by
189188
obtain ⟨r, hr, hr'⟩ := u.finite_toSet.isCompact.isBounded.subset_closedBall_lt 0 0
190189
refine ⟨⌊r⌋.toNat, fun x hx ↦ ?_⟩
191-
have hr'' : ⌊r⌋ ⊔ 0 = ⌊r⌋ := by simp; positivity
190+
have hr'' : ⌊r⌋ ⊔ 0 = ⌊r⌋ := by rw [sup_eq_left]; positivity
192191
have := hr' hx
193192
simp only [Metric.mem_closedBall, dist_zero_right, pi_norm_le_iff_of_nonneg hr.le,
194193
Int.norm_eq_abs, ← Int.cast_abs, ← Int.le_floor] at this

Mathlib/Algebra/Ring/Subring/Basic.lean

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -601,15 +601,13 @@ abbrev closureCommRingOfComm {s : Set R} (hcomm : ∀ x ∈ s, ∀ y ∈ s, x *
601601
have := closure_le_centralizer_centralizer s
602602
Subtype.ext <| Set.centralizer_centralizer_comm_of_comm hcomm _ (this h₁) _ (this h₂) }
603603

604-
-- TODO: find a good way to fix the non-terminal simp
605-
set_option linter.flexible false in
606604
theorem exists_list_of_mem_closure {s : Set R} {x : R} (hx : x ∈ closure s) :
607605
∃ L : List (List R), (∀ t ∈ L, ∀ y ∈ t, y ∈ s ∨ y = (-1 : R)) ∧ (L.map List.prod).sum = x := by
608606
rw [mem_closure_iff] at hx
609607
induction hx using AddSubgroup.closure_induction with
610608
| mem _ hx =>
611609
obtain ⟨l, hl, h⟩ := Submonoid.exists_list_of_mem_closure hx
612-
exact ⟨[l], by simp [h]; clear_aux_decl; tauto
610+
exact ⟨[l], by simp_all
613611
| zero => exact ⟨[], List.forall_mem_nil _, rfl⟩
614612
| add _ _ _ _ hL hM =>
615613
obtain ⟨⟨L, HL1, HL2⟩, ⟨M, HM1, HM2⟩⟩ := And.intro hL hM

0 commit comments

Comments
 (0)