Skip to content

Commit d99d52c

Browse files
committed
chore(Data): rename setOf to Set.ofPred (#41507)
This is in prevision of making `Set` a one-field structure. `ofPred` will then be the constructor. Generated by Claude Opus then reviewed line-by-line by myself. Assisted-by: Claude Opus 4.8
1 parent 2eb08ab commit d99d52c

845 files changed

Lines changed: 3555 additions & 2522 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/Imo1987Q1.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fixed points. -/
5656
def fiber (k : ℕ) : Set (Perm α) :=
5757
{σ : Perm α | card (fixedPoints σ) = k}
5858

59-
instance {k : ℕ} : Fintype (fiber α k) := inferInstanceAs <| Fintype (setOf _)
59+
instance {k : ℕ} : Fintype (fiber α k) := inferInstanceAs <| Fintype (Set.ofPred _)
6060

6161
@[simp]
6262
theorem mem_fiber {σ : Perm α} {k : ℕ} : σ ∈ fiber α k ↔ card (fixedPoints σ) = k :=

Archive/Imo/Imo1988Q6.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ theorem constant_descent_vieta_jumping (x y : ℕ) {claim : Prop} {H : ℕ →
9292
-- Our assumptions ensure that we can then prove the claim.
9393
suffices exc : exceptional.Nonempty by
9494
-- Suppose that there exists an element in the exceptional locus.
95-
simp only [Set.Nonempty, Prod.exists, Set.mem_setOf_eq, exceptional] at exc
95+
simp only [Set.Nonempty, Prod.exists, Set.mem_ofPred_eq, exceptional] at exc
9696
-- Let (a,b) be such an element, and consider all the possible cases.
9797
rcases exc with ⟨a, b, hH, hb⟩
9898
rcases hb with (_ | rfl | rfl | hB | hB)
@@ -138,7 +138,7 @@ theorem constant_descent_vieta_jumping (x y : ℕ) {claim : Prop} {H : ℕ →
138138
-- This means that m_y = m,
139139
-- and the conditions H(m_x, m_y) and m_x < m_y are satisfied.
140140
simp only at mx_lt_my hHm m_eq
141-
simp only [exceptional, hHm, Set.mem_setOf_eq, true_and] at h_base
141+
simp only [exceptional, hHm, Set.mem_ofPred_eq, true_and] at h_base
142142
push Not at h_base
143143
-- Finally, it also means that (m_x, m_y) does not lie in the base locus,
144144
-- that m_x ≠ 0, m_x ≠ m_y, B(m_x) ≠ m_y, and B(m_x) ≠ m_x + m_y.

Archive/Imo/Imo2008Q2.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ theorem imo2008_q2b : Set.Infinite rationalSolutions := by
6565
have hW_sub_S : W ⊆ rationalSolutions := by
6666
intro s hs_in_W
6767
rw [rationalSolutions]
68-
simp only [Set.mem_setOf_eq] at hs_in_W ⊢
68+
simp only [Set.mem_ofPred_eq] at hs_in_W ⊢
6969
rcases hs_in_W with ⟨x, y, z, h₁, t, ht_gt_zero, hx_t, hy_t, hz_t⟩
7070
use x, y, z
7171
have key_gt_zero : 0 < t ^ 2 + t + 1 := by linarith [pow_pos ht_gt_zero 2, ht_gt_zero]
@@ -99,7 +99,7 @@ theorem imo2008_q2b : Set.Infinite rationalSolutions := by
9999
set z : ℚ := -t * (t + 1) with hz_def
100100
simp only [t, W, K, g, Set.mem_image, Prod.exists]
101101
use x, y, z; constructor
102-
· simp only [Set.mem_setOf_eq]
102+
· simp only [Set.mem_ofPred_eq]
103103
use x, y, z; constructor
104104
· rfl
105105
· use t; constructor

Archive/Imo/Imo2024Q3.lean

Lines changed: 95 additions & 51 deletions
Large diffs are not rendered by default.

Archive/Imo/Imo2024Q5.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ def answer : ℕ := 3
10421042

10431043
/-- The final result, combining upper and lower bounds. -/
10441044
theorem result : IsLeast {k | ∃ s : Strategy 2022, s.ForcesWinIn k} answer := by
1045-
simp_rw [IsLeast, mem_lowerBounds, Set.mem_setOf, forall_exists_index]
1045+
simp_rw [IsLeast, mem_lowerBounds, Set.mem_ofPred, forall_exists_index]
10461046
exact ⟨⟨winningStrategy (by simp), winningStrategy_forcesWinIn_three (by simp)⟩,
10471047
fun k s h ↦ h.three_le (by simp)⟩
10481048

Archive/Sensitivity.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ theorem adj_iff_proj_adj {p q : Q n.succ} (h₀ : p 0 = q 0) :
140140

141141
@[symm]
142142
theorem adjacent.symm {p q : Q n} : q ∈ p.adjacent ↔ p ∈ q.adjacent := by
143-
simp only [adjacent, ne_comm, Set.mem_setOf_eq]
143+
simp only [adjacent, ne_comm, Set.mem_ofPred_eq]
144144

145145
end Q
146146

Archive/Wiedijk100Theorems/AreaOfACircle.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ theorem disc_eq_regionBetween :
6565
regionBetween
6666
(fun x => -sqrt (r ^ 2 - x ^ 2)) (fun x => sqrt (r ^ 2 - x ^ 2)) (Ioc (-r) r) := by
6767
ext p
68-
simp only [disc, regionBetween, mem_setOf_eq, mem_Ioo, mem_Ioc]
68+
simp only [disc, regionBetween, mem_ofPred_eq, mem_Ioo, mem_Ioc]
6969
constructor <;> intro h
7070
· cases abs_lt_of_sq_lt_sq' (lt_of_add_lt_of_nonneg_left h (sq_nonneg p.2)) r.2 with
7171
| intro left right =>

Archive/Wiedijk100Theorems/BallotProblem.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ open scoped List in
7474
theorem mem_countedSequence_iff_perm {p q l} :
7575
l ∈ countedSequence p q ↔ l ~ List.replicate p (1 : ℤ) ++ List.replicate q (-1) := by
7676
rw [List.perm_replicate_append_replicate]
77-
· simp only [countedSequence, List.subset_def, mem_setOf_eq, List.mem_cons (b := (1 : ℤ)),
77+
· simp only [countedSequence, List.subset_def, mem_ofPred_eq, List.mem_cons (b := (1 : ℤ)),
7878
List.mem_singleton]
7979
· norm_num1
8080

@@ -200,7 +200,7 @@ theorem first_vote_pos :
200200
((countedSequence_nonempty _ _).image _)]
201201
· have : List.cons (-1) '' countedSequence (p + 1) q ∩ {l : List ℤ | l.headI = 1} = ∅ := by
202202
ext
203-
simp only [mem_inter_iff, mem_image, mem_setOf_eq, mem_empty_iff_false, iff_false,
203+
simp only [mem_inter_iff, mem_image, mem_ofPred_eq, mem_empty_iff_false, iff_false,
204204
not_and, forall_exists_index, and_imp]
205205
rintro l _ rfl
206206
norm_num
@@ -255,7 +255,7 @@ theorem countedSequence_int_pos_counted_succ_succ (p q : ℕ) :
255255
rw [counted_succ_succ, union_inter_distrib_right,
256256
(_ : List.cons (-1) '' countedSequence (p + 1) q ∩ {l | l.headI = 1} = ∅), union_empty] <;>
257257
· ext
258-
simp only [mem_inter_iff, mem_image, mem_setOf_eq, and_iff_left_iff_imp, mem_empty_iff_false,
258+
simp only [mem_inter_iff, mem_image, mem_ofPred_eq, and_iff_left_iff_imp, mem_empty_iff_false,
259259
iff_false, not_and, forall_exists_index, and_imp]
260260
rintro y _ rfl
261261
norm_num

Archive/Wiedijk100Theorems/BirthdayProblem.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ theorem birthday_measure :
5050
trans ‖Fin 23 ↪ Fin 365
5151
· rw [← Fintype.card_coe]
5252
apply Fintype.card_congr
53-
rw [Set.Finite.coeSort_toFinset, Set.coe_setOf]
53+
rw [Set.Finite.coeSort_toFinset, Set.coe_ofPred]
5454
exact Equiv.subtypeInjectiveEquivEmbedding _ _
5555
· rw [Fintype.card_embedding_eq, Fintype.card_fin, Fintype.card_fin]
5656
rfl

Archive/Wiedijk100Theorems/CubingACube.lean

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ theorem shiftUp_bottom_subset_bottoms (hc : (cs i).xm ≠ 1) :
183183
(cs i).shiftUp.bottom ⊆ ⋃ i : ι, (cs i).bottom := by
184184
intro p hp; obtain ⟨hp0, hps⟩ := hp; rw [tail_shiftUp] at hps
185185
have : p ∈ (unitCube : Cube (n + 1)).toSet := by
186-
simp only [toSet, forall_iff_succ, hp0, side_unitCube, mem_setOf_eq, mem_Ico, head_shiftUp]
186+
simp only [toSet, forall_iff_succ, hp0, side_unitCube, mem_ofPred_eq, mem_Ico, head_shiftUp]
187187
refine ⟨⟨?_, ?_⟩, ?_⟩
188188
· rw [← zero_add (0 : ℝ)]; apply add_le_add
189189
· apply zero_le_b h
@@ -223,10 +223,10 @@ variable {c : Cube (n + 1)} (h : Correct cs) (v : Valley cs c)
223223
theorem valley_unitCube [Nontrivial ι] (h : Correct cs) : Valley cs unitCube := by
224224
refine ⟨?_, ?_, ?_⟩
225225
· intro v
226-
simp only [bottom, and_imp, mem_iUnion, mem_setOf_eq]
226+
simp only [bottom, and_imp, mem_iUnion, mem_ofPred_eq]
227227
intro h0 hv
228228
have : v ∈ (unitCube : Cube (n + 1)).toSet := by
229-
dsimp only [toSet, unitCube, mem_setOf_eq]
229+
dsimp only [toSet, unitCube, mem_ofPred_eq]
230230
rw [forall_iff_succ, h0]; constructor
231231
· norm_num [side, unitCube]
232232
· exact hv
@@ -410,7 +410,7 @@ theorem mi_not_onBoundary (j : Fin n) : ¬OnBoundary (mi_mem_bcubes : mi h v ∈
410410
have i'_i'' : i' ≠ i'' := by
411411
rintro ⟨⟩
412412
have : (cs i).b ∈ (cs i').toSet := by
413-
simp only [toSet, forall_iff_succ, hi.1, bottom_mem_side h2i', true_and, mem_setOf_eq]
413+
simp only [toSet, forall_iff_succ, hi.1, bottom_mem_side h2i', true_and, mem_ofPred_eq]
414414
intro j₂; by_cases hj₂ : j₂ = j
415415
· simpa [p', side_tail, hj'.symm, hj₂] using hi''.2 j
416416
· simpa [p, hj₂] using! hi'.2 j₂
@@ -456,7 +456,7 @@ theorem valley_mi : Valley cs (cs (mi h v)).shiftUp := by
456456
simp only [not_subset, tail_shiftUp] at h2i'
457457
rcases h2i' with ⟨p1, hp1, h2p1⟩
458458
have : ∃ p3, p3 ∈ (cs i').tail.toSet ∧ p3 ∉ (cs i).tail.toSet ∧ p3 ∈ c.tail.toSet := by
459-
simp only [toSet, not_forall, mem_setOf_eq] at h2p1; obtain ⟨j, hj⟩ := h2p1
459+
simp only [toSet, not_forall, mem_ofPred_eq] at h2p1; obtain ⟨j, hj⟩ := h2p1
460460
rcases Ico_lemma (mi_not_onBoundary' j).1 (by simp [hw]) (mi_not_onBoundary' j).2
461461
(le_trans (hp2 j).1 <| le_of_lt (h2p2 j).2) (le_trans (h2p2 j).1 <| le_of_lt (hp2 j).2)
462462
⟨hj, hp1 j⟩ with
@@ -465,7 +465,7 @@ theorem valley_mi : Valley cs (cs (mi h v)).shiftUp := by
465465
· intro j'; by_cases h : j' = j
466466
· simp only [if_pos h]; exact h ▸ h3w
467467
· simp only [if_neg h]; exact hp2 j'
468-
· simp only [toSet, not_forall, mem_setOf_eq]; use j; rw [if_pos rfl]; convert! h2w
468+
· simp only [toSet, not_forall, mem_ofPred_eq]; use j; rw [if_pos rfl]; convert! h2w
469469
· intro j'; by_cases h : j' = j
470470
· simp only [if_pos h, side_tail]; exact h ▸ hw
471471
· simp only [if_neg h]; apply hi.2; apply h2p2
@@ -483,7 +483,7 @@ theorem valley_mi : Valley cs (cs (mi h v)).shiftUp := by
483483
let p' := @cons n (fun _ => ℝ) (cs i).xm p3
484484
have hp' : p' ∈ (cs i').toSet := by simpa [i, p', toSet, forall_iff_succ, hi'.symm] using! h1p3
485485
have h2p' : p' ∈ (cs i'').toSet := by
486-
simp only [p', toSet, forall_iff_succ, cons_succ, cons_zero, mem_setOf_eq]
486+
simp only [p', toSet, forall_iff_succ, cons_succ, cons_zero, mem_ofPred_eq]
487487
refine ⟨?_, by simpa [toSet] using! hi''.2
488488
have : (cs i).b 0 = (cs i'').b 0 := by rw [hi.1, h2i''.1]
489489
simp [side, hw', xm, this, h3i'']

0 commit comments

Comments
 (0)