Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 951bf1d

Browse files
refactor(data/set/basic): Remove _eq lemmas (#16572)
This PR removes `_eq` lemmas from `data.set.basic` which asset a `rfl` propositional equality, in favour of the `iff` versions, and makes the latter `simp` lemmas if they weren't already. Co-authored-by: Wrenna Robson <34025592+linesthatinterlace@users.noreply.github.com>
1 parent 3dc8592 commit 951bf1d

File tree

91 files changed

+206
-217
lines changed

Some content is hidden

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

91 files changed

+206
-217
lines changed

archive/100-theorems-list/30_ballot_problem.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ lemma first_vote_pos :
320320
(nonempty_image_iff.2 (counted_sequence_nonempty _ _))],
321321
{ have : list.cons (-1) '' counted_sequence (p + 1) q ∩ {l : list ℤ | l.head = 1} = ∅,
322322
{ ext,
323-
simp only [mem_inter_eq, mem_image, mem_set_of_eq, mem_empty_eq, iff_false, not_and,
323+
simp only [mem_inter_iff, mem_image, mem_set_of_eq, mem_empty_iff_false, iff_false, not_and,
324324
forall_exists_index, and_imp],
325325
rintro l _ rfl,
326326
norm_num },
@@ -392,7 +392,7 @@ begin
392392
rw [counted_succ_succ, union_inter_distrib_right,
393393
(_ : list.cons (-1) '' counted_sequence (p + 1) q ∩ {l | l.head = 1} = ∅), union_empty];
394394
{ ext,
395-
simp only [mem_inter_eq, mem_image, mem_set_of_eq, and_iff_left_iff_imp, mem_empty_eq,
395+
simp only [mem_inter_iff, mem_image, mem_set_of_eq, and_iff_left_iff_imp, mem_empty_iff_false,
396396
iff_false, not_and, forall_exists_index, and_imp],
397397
rintro y hy rfl,
398398
norm_num }
@@ -410,7 +410,7 @@ begin
410410
have : (counted_sequence p (q + 1)).image (list.cons 1) ∩ stays_positive =
411411
(counted_sequence p (q + 1) ∩ stays_positive).image (list.cons 1),
412412
{ ext t,
413-
simp only [mem_inter_eq, mem_image],
413+
simp only [mem_inter_iff, mem_image],
414414
split,
415415
{ simp only [and_imp, exists_imp_distrib],
416416
rintro l hl rfl t,
@@ -433,7 +433,7 @@ begin
433433
rw [counted_succ_succ, union_inter_distrib_right,
434434
(_ : list.cons 1 '' counted_sequence p (q + 1) ∩ {l : list ℤ | l.head = 1}ᶜ = ∅), empty_union];
435435
{ ext,
436-
simp only [mem_inter_eq, mem_image, mem_set_of_eq, and_iff_left_iff_imp, mem_empty_eq,
436+
simp only [mem_inter_iff, mem_image, mem_set_of_eq, and_iff_left_iff_imp, mem_empty_iff_false,
437437
iff_false, not_and, forall_exists_index, and_imp],
438438
rintro y hy rfl,
439439
norm_num }
@@ -451,7 +451,7 @@ begin
451451
have : (counted_sequence (p + 1) q).image (list.cons (-1)) ∩ stays_positive =
452452
((counted_sequence (p + 1) q) ∩ stays_positive).image (list.cons (-1)),
453453
{ ext t,
454-
simp only [mem_inter_eq, mem_image],
454+
simp only [mem_inter_iff, mem_image],
455455
split,
456456
{ simp only [and_imp, exists_imp_distrib],
457457
rintro l hl rfl t,

counterexamples/phillips.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ begin
546546
apply ae_restrict_of_ae,
547547
refine measure_mono_null _ ((countable_ne Hcont φ).measure_zero _),
548548
assume x,
549-
simp only [imp_self, mem_set_of_eq, mem_compl_eq],
549+
simp only [imp_self, mem_set_of_eq, mem_compl_iff],
550550
end
551551

552552
lemma integrable_comp (Hcont : #ℝ = aleph 1) (φ : (discrete_copy ℝ →ᵇ ℝ) →L[ℝ] ℝ) :

src/algebra/indicator_function.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ mul_indicator_eq_one
9696

9797
@[to_additive] lemma mul_indicator_apply_ne_one {a : α} :
9898
s.mul_indicator f a ≠ 1 ↔ a ∈ s ∩ mul_support f :=
99-
by simp only [ne.def, mul_indicator_apply_eq_one, not_imp, mem_inter_eq, mem_mul_support]
99+
by simp only [ne.def, mul_indicator_apply_eq_one, not_imp, mem_inter_iff, mem_mul_support]
100100

101101
@[simp, to_additive] lemma mul_support_mul_indicator :
102102
function.mul_support (s.mul_indicator f) = s ∩ function.mul_support f :=
@@ -413,7 +413,7 @@ begin
413413
rw [finset.prod_insert haI, finset.set_bUnion_insert, mul_indicator_union_of_not_mem_inter, ih _],
414414
{ assume i hi j hj hij,
415415
exact hI i (finset.mem_insert_of_mem hi) j (finset.mem_insert_of_mem hj) hij },
416-
simp only [not_exists, exists_prop, mem_Union, mem_inter_eq, not_and],
416+
simp only [not_exists, exists_prop, mem_Union, mem_inter_iff, not_and],
417417
assume hx a' ha',
418418
refine disjoint_left.1 (hI a (finset.mem_insert_self _ _) a' (finset.mem_insert_of_mem ha') _) hx,
419419
exact (ne_of_mem_of_not_mem ha' haI).symm

src/algebra/order/floor.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ end
596596
lemma preimage_fract (s : set α) : fract ⁻¹' s = ⋃ m : ℤ, (λ x, x - m) ⁻¹' (s ∩ Ico (0 : α) 1) :=
597597
begin
598598
ext x,
599-
simp only [mem_preimage, mem_Union, mem_inter_eq],
599+
simp only [mem_preimage, mem_Union, mem_inter_iff],
600600
refine ⟨λ h, ⟨⌊x⌋, h, fract_nonneg x, fract_lt_one x⟩, _⟩,
601601
rintro ⟨m, hms, hm0, hm1⟩,
602602
obtain rfl : ⌊x⌋ = m, from floor_eq_iff.2 ⟨sub_nonneg.1 hm0, sub_lt_iff_lt_add'.1 hm1⟩,
@@ -606,7 +606,7 @@ end
606606
lemma image_fract (s : set α) : fract '' s = ⋃ m : ℤ, (λ x, x - m) '' s ∩ Ico 0 1 :=
607607
begin
608608
ext x,
609-
simp only [mem_image, mem_inter_eq, mem_Union], split,
609+
simp only [mem_image, mem_inter_iff, mem_Union], split,
610610
{ rintro ⟨y, hy, rfl⟩,
611611
exact ⟨⌊y⌋, ⟨y, hy, rfl⟩, fract_nonneg y, fract_lt_one y⟩ },
612612
{ rintro ⟨m, ⟨y, hys, rfl⟩, h0, h1⟩,

src/algebra/support.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ rfl
149149

150150
@[to_additive support_prod_mk] lemma mul_support_prod_mk (f : α → M) (g : α → N) :
151151
mul_support (λ x, (f x, g x)) = mul_support f ∪ mul_support g :=
152-
set.ext $ λ x, by simp only [mul_support, not_and_distrib, mem_union_eq, mem_set_of_eq,
152+
set.ext $ λ x, by simp only [mul_support, not_and_distrib, mem_union, mem_set_of_eq,
153153
prod.mk_eq_one, ne.def]
154154

155155
@[to_additive support_prod_mk'] lemma mul_support_prod_mk' (f : α → M × N) :
@@ -200,7 +200,7 @@ end division_monoid
200200

201201
@[simp] lemma support_mul [mul_zero_class R] [no_zero_divisors R] (f g : α → R) :
202202
support (λ x, f x * g x) = support f ∩ support g :=
203-
set.ext $ λ x, by simp only [mem_support, mul_ne_zero_iff, mem_inter_eq, not_or_distrib]
203+
set.ext $ λ x, by simp only [mem_support, mul_ne_zero_iff, mem_inter_iff, not_or_distrib]
204204

205205
@[simp] lemma support_mul_subset_left [mul_zero_class R] (f g : α → R) :
206206
support (λ x, f x * g x) ⊆ support f :=

src/algebraic_geometry/locally_ringed_space.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,9 @@ end
250250
X.to_RingedSpace.basic_open (0 : X.presheaf.obj $ op U) = ∅ :=
251251
begin
252252
ext,
253-
simp only [set.mem_empty_eq, topological_space.opens.empty_eq, topological_space.opens.mem_coe,
254-
opens.coe_bot, iff_false, RingedSpace.basic_open, is_unit_zero_iff, set.mem_set_of_eq,
255-
map_zero],
253+
simp only [set.mem_empty_iff_false, topological_space.opens.empty_eq,
254+
topological_space.opens.mem_coe, opens.coe_bot, iff_false, RingedSpace.basic_open,
255+
is_unit_zero_iff, set.mem_set_of_eq, map_zero],
256256
rintro ⟨⟨y, _⟩, h, e⟩,
257257
exact @zero_ne_one (X.presheaf.stalk y) _ _ h,
258258
end

src/algebraic_geometry/prime_spectrum/basic.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ end
332332

333333
lemma mem_compl_zero_locus_iff_not_mem {f : R} {I : prime_spectrum R} :
334334
I ∈ (zero_locus {f} : set (prime_spectrum R))ᶜ ↔ f ∉ I.as_ideal :=
335-
by rw [set.mem_compl_eq, mem_zero_locus, set.singleton_subset_iff]; refl
335+
by rw [set.mem_compl_iff, mem_zero_locus, set.singleton_subset_iff]; refl
336336

337337
/-- The Zariski topology on the prime spectrum of a commutative ring
338338
is defined via the closed sets of the topology:
@@ -659,7 +659,7 @@ lemma is_open_basic_open {a : R} : is_open ((basic_open a) : set (prime_spectrum
659659

660660
@[simp] lemma basic_open_eq_zero_locus_compl (r : R) :
661661
(basic_open r : set (prime_spectrum R)) = (zero_locus {r})ᶜ :=
662-
set.ext $ λ x, by simpa only [set.mem_compl_eq, mem_zero_locus, set.singleton_subset_iff]
662+
set.ext $ λ x, by simpa only [set.mem_compl_iff, mem_zero_locus, set.singleton_subset_iff]
663663

664664
@[simp] lemma basic_open_one : basic_open (1 : R) = ⊤ :=
665665
topological_space.opens.ext $ by simp
@@ -692,7 +692,7 @@ begin
692692
{ rintros _ ⟨r, rfl⟩,
693693
exact is_open_basic_open },
694694
{ rintros p U hp ⟨s, hs⟩,
695-
rw [← compl_compl U, set.mem_compl_eq, ← hs, mem_zero_locus, set.not_subset] at hp,
695+
rw [← compl_compl U, set.mem_compl_iff, ← hs, mem_zero_locus, set.not_subset] at hp,
696696
obtain ⟨f, hfs, hfp⟩ := hp,
697697
refine ⟨basic_open f, ⟨f, rfl⟩, hfp, _⟩,
698698
rw [← set.compl_subset_compl, ← hs, basic_open_eq_zero_locus_compl, compl_compl],
@@ -747,7 +747,7 @@ begin
747747
rw localization_comap_range S (submonoid.powers r),
748748
ext,
749749
simp only [mem_zero_locus, basic_open_eq_zero_locus_compl, set_like.mem_coe, set.mem_set_of_eq,
750-
set.singleton_subset_iff, set.mem_compl_eq],
750+
set.singleton_subset_iff, set.mem_compl_iff],
751751
split,
752752
{ intros h₁ h₂,
753753
exact h₁ ⟨submonoid.mem_powers r, h₂⟩ },

src/algebraic_geometry/prime_spectrum/is_open_comap_C.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ lemma image_of_Df_eq_comap_C_compl_zero_locus :
4949
image_of_Df f = prime_spectrum.comap (C : R →+* R[X]) '' (zero_locus {f})ᶜ :=
5050
begin
5151
refine ext (λ x, ⟨λ hx, ⟨⟨map C x.val, (is_prime_map_C_of_is_prime x.property)⟩, ⟨_, _⟩⟩, _⟩),
52-
{ rw [mem_compl_eq, mem_zero_locus, singleton_subset_iff],
52+
{ rw [mem_compl_iff, mem_zero_locus, singleton_subset_iff],
5353
cases hx with i hi,
5454
exact λ a, hi (mem_map_C_iff.mp a i) },
5555
{ refine subtype.ext (ext (λ x, ⟨λ h, _, λ h, subset_span (mem_image_of_mem C.1 h)⟩)),

src/algebraic_geometry/projective_spectrum/topology.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ end
287287

288288
lemma mem_compl_zero_locus_iff_not_mem {f : A} {I : projective_spectrum 𝒜} :
289289
I ∈ (zero_locus 𝒜 {f} : set (projective_spectrum 𝒜))ᶜ ↔ f ∉ I.as_homogeneous_ideal :=
290-
by rw [set.mem_compl_eq, mem_zero_locus, set.singleton_subset_iff]; refl
290+
by rw [set.mem_compl_iff, mem_zero_locus, set.singleton_subset_iff]; refl
291291

292292
/-- The Zariski topology on the prime spectrum of a commutative ring
293293
is defined via the closed sets of the topology:
@@ -364,7 +364,7 @@ lemma is_open_basic_open {a : A} : is_open ((basic_open 𝒜 a) :
364364

365365
@[simp] lemma basic_open_eq_zero_locus_compl (r : A) :
366366
(basic_open 𝒜 r : set (projective_spectrum 𝒜)) = (zero_locus 𝒜 {r})ᶜ :=
367-
set.ext $ λ x, by simpa only [set.mem_compl_eq, mem_zero_locus, set.singleton_subset_iff]
367+
set.ext $ λ x, by simpa only [set.mem_compl_iff, mem_zero_locus, set.singleton_subset_iff]
368368

369369
@[simp] lemma basic_open_one : basic_open 𝒜 (1 : A) = ⊤ :=
370370
topological_space.opens.ext $ by simp
@@ -408,7 +408,7 @@ begin
408408
{ rintros _ ⟨r, rfl⟩,
409409
exact is_open_basic_open 𝒜 },
410410
{ rintros p U hp ⟨s, hs⟩,
411-
rw [← compl_compl U, set.mem_compl_eq, ← hs, mem_zero_locus, set.not_subset] at hp,
411+
rw [← compl_compl U, set.mem_compl_iff, ← hs, mem_zero_locus, set.not_subset] at hp,
412412
obtain ⟨f, hfs, hfp⟩ := hp,
413413
refine ⟨basic_open 𝒜 f, ⟨f, rfl⟩, hfp, _⟩,
414414
rw [← set.compl_subset_compl, ← hs, basic_open_eq_zero_locus_compl, compl_compl],

src/analysis/box_integral/basic.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ begin
207207
(l.has_basis_to_filter_Union_top _).prod_self.tendsto_iff uniformity_basis_dist_le],
208208
refine forall₂_congr (λ ε ε0, exists_congr $ λ r, _),
209209
simp only [exists_prop, prod.forall, set.mem_Union, exists_imp_distrib,
210-
prod_mk_mem_set_prod_eq, and_imp, mem_inter_eq, mem_set_of_eq],
210+
prod_mk_mem_set_prod_eq, and_imp, mem_inter_iff, mem_set_of_eq],
211211
exact and_congr iff.rfl ⟨λ H c₁ c₂ π₁ π₂ h₁ hU₁ h₂ hU₂, H π₁ π₂ c₁ h₁ hU₁ c₂ h₂ hU₂,
212212
λ H π₁ π₂ c₁ h₁ hU₁ c₂ h₂ hU₂, H c₁ c₂ π₁ π₂ h₁ hU₁ h₂ hU₂⟩
213213
end
@@ -593,7 +593,7 @@ lemma tendsto_integral_sum_sum_integral (h : integrable I l f vol) (π₀ : prep
593593
begin
594594
refine ((l.has_basis_to_filter_Union I π₀).tendsto_iff nhds_basis_closed_ball).2 (λ ε ε0, _),
595595
refine ⟨h.convergence_r ε, h.convergence_r_cond ε, _⟩,
596-
simp only [mem_inter_eq, set.mem_Union, mem_set_of_eq],
596+
simp only [mem_inter_iff, set.mem_Union, mem_set_of_eq],
597597
rintro π ⟨c, hc, hU⟩,
598598
exact h.dist_integral_sum_sum_integral_le_of_mem_base_set_of_Union_eq ε0 hc hU
599599
end
@@ -707,7 +707,7 @@ begin
707707
rcases exists_pos_mul_lt ε0' (B I) with ⟨ε', ε'0, hεI⟩,
708708
set δ : ℝ≥0 → ℝⁿ → Ioi (0 : ℝ) := λ c x, if x ∈ s then δ₁ c x (εs x) else (δ₂ c) x ε',
709709
refine ⟨δ, λ c, l.r_cond_of_bRiemann_eq_ff hl, _⟩,
710-
simp only [set.mem_Union, mem_inter_eq, mem_set_of_eq],
710+
simp only [set.mem_Union, mem_inter_iff, mem_set_of_eq],
711711
rintro π ⟨c, hπδ, hπp⟩,
712712
/- Now we split the sum into two parts based on whether `π.tag J` belongs to `s` or not. -/
713713
rw [← g.sum_partition_boxes le_rfl hπp, mem_closed_ball, integral_sum,

0 commit comments

Comments
 (0)