Skip to content

Commit 4034bcf

Browse files
committed
chore: remove some Setoid.r (#16258)
1 parent 7817d20 commit 4034bcf

File tree

18 files changed

+42
-42
lines changed

18 files changed

+42
-42
lines changed

Counterexamples/CliffordAlgebraNotInjective.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def Q : QuadraticForm K L :=
208208
QuadraticMap.ofPolar
209209
(fun x =>
210210
Quotient.liftOn' x Q' fun a b h => by
211-
rw [Submodule.quotientRel_r_def] at h
211+
rw [Submodule.quotientRel_def] at h
212212
suffices Q' (a - b) = 0 by rwa [Q'_sub, sub_eq_zero] at this
213213
apply Q'_zero_under_ideal (a - b) h)
214214
(fun a x => by

Mathlib/Algebra/Lie/Quotient.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ instance lieQuotientHasBracket : Bracket (L ⧸ I) (L ⧸ I) :=
111111
apply Quotient.liftOn₂' x y fun x' y' => mk ⁅x', y'⁆
112112
intro x₁ x₂ y₁ y₂ h₁ h₂
113113
apply (Submodule.Quotient.eq I.toSubmodule).2
114-
rw [Submodule.quotientRel_r_def] at h₁ h₂
114+
rw [Submodule.quotientRel_def] at h₁ h₂
115115
have h : ⁅x₁, x₂⁆ - ⁅y₁, y₂⁆ = ⁅x₁, x₂ - y₂⁆ + ⁅x₁ - y₁, y₂⁆ := by
116116
simp [-lie_skew, sub_eq_add_neg, add_assoc]
117117
rw [h]

Mathlib/Computability/Reduce.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,6 @@ protected theorem liftOn₂_eq {φ} (p q : Set ℕ) (f : Set ℕ → Set ℕ →
345345
@[simp]
346346
theorem of_eq_of {p : α → Prop} {q : β → Prop} : of p = of q ↔ ManyOneEquiv p q := by
347347
rw [of, of, Quotient.eq'']
348-
unfold Setoid.r
349348
simp
350349

351350
instance instInhabited : Inhabited ManyOneDegree :=

Mathlib/Data/List/Rotate.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ variable [DecidableEq α]
610610
instance isRotatedDecidable (l l' : List α) : Decidable (l ~r l') :=
611611
decidable_of_iff' _ isRotated_iff_mem_map_range
612612

613-
instance {l l' : List α} : Decidable (@Setoid.r _ (IsRotated.setoid α) l l') :=
613+
instance {l l' : List α} : Decidable (IsRotated.setoid α l l') :=
614614
List.isRotatedDecidable _ _
615615

616616
end Decidable

Mathlib/Data/Quot.lean

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ theorem surjective_Quotient_mk'' : Function.Surjective (Quotient.mk'' : α → Q
562562
instance argument. -/
563563
-- Porting note: removed `@[elab_as_elim]` because it gave "unexpected eliminator resulting type"
564564
-- porting note (#11083): removed `@[reducible]` because it caused extremely slow `simp`
565-
protected def liftOn' (q : Quotient s₁) (f : α → φ) (h : ∀ a b, @Setoid.r α s₁ a b → f a = f b) :
565+
protected def liftOn' (q : Quotient s₁) (f : α → φ) (h : ∀ a b, s₁ a b → f a = f b) :
566566
φ :=
567567
Quotient.liftOn q f h
568568

@@ -580,7 +580,7 @@ instead of instance arguments. -/
580580
-- Porting note: removed `@[elab_as_elim]` because it gave "unexpected eliminator resulting type"
581581
-- porting note (#11083): removed `@[reducible]` because it caused extremely slow `simp`
582582
protected def liftOn₂' (q₁ : Quotient s₁) (q₂ : Quotient s₂) (f : α → β → γ)
583-
(h : ∀ a₁ a₂ b₁ b₂, @Setoid.r α s₁ a₁ b₁ → @Setoid.r β s₂ a₂ b₂ → f a₁ a₂ = f b₁ b₂) : γ :=
583+
(h : ∀ a₁ a₂ b₁ b₂, s₁ a₁ b₁ → s₂ a₂ b₂ → f a₁ a₂ = f b₁ b₂) : γ :=
584584
Quotient.liftOn₂ q₁ q₂ f h
585585

586586
@[simp]
@@ -692,19 +692,19 @@ theorem map₂'_mk'' (f : α → β → γ) (h) (x : α) :
692692
rfl
693693

694694
theorem exact' {a b : α} :
695-
(Quotient.mk'' a : Quotient s₁) = Quotient.mk'' b → @Setoid.r _ s₁ a b :=
695+
(Quotient.mk'' a : Quotient s₁) = Quotient.mk'' b → s₁ a b :=
696696
Quotient.exact
697697

698-
theorem sound' {a b : α} : @Setoid.r _ s₁ a b → @Quotient.mk'' α s₁ a = Quotient.mk'' b :=
698+
theorem sound' {a b : α} : s₁ a b → @Quotient.mk'' α s₁ a = Quotient.mk'' b :=
699699
Quotient.sound
700700

701701
@[simp]
702702
protected theorem eq' {s₁ : Setoid α} {a b : α} :
703-
@Quotient.mk' α s₁ a = @Quotient.mk' α s₁ b ↔ @Setoid.r _ s₁ a b :=
703+
@Quotient.mk' α s₁ a = @Quotient.mk' α s₁ b ↔ s₁ a b :=
704704
Quotient.eq
705705

706706
@[simp]
707-
protected theorem eq'' {a b : α} : @Quotient.mk'' α s₁ a = Quotient.mk'' b ↔ @Setoid.r _ s₁ a b :=
707+
protected theorem eq'' {a b : α} : @Quotient.mk'' α s₁ a = Quotient.mk'' b ↔ s₁ a b :=
708708
Quotient.eq
709709

710710
/-- A version of `Quotient.out` taking `{s₁ : Setoid α}` as an implicit argument instead of an
@@ -716,7 +716,7 @@ noncomputable def out' (a : Quotient s₁) : α :=
716716
theorem out_eq' (q : Quotient s₁) : Quotient.mk'' q.out' = q :=
717717
q.out_eq
718718

719-
theorem mk_out' (a : α) : @Setoid.r α s₁ (Quotient.mk'' a : Quotient s₁).out' a :=
719+
theorem mk_out' (a : α) : s₁ (Quotient.mk'' a : Quotient s₁).out' a :=
720720
Quotient.exact (Quotient.out_eq _)
721721

722722
section
@@ -742,13 +742,13 @@ theorem map'_mk {t : Setoid β} (f : α → β) (h) (x : α) :
742742

743743
end
744744

745-
instance (q : Quotient s₁) (f : α → Prop) (h : ∀ a b, @Setoid.r α s₁ a b → f a = f b)
745+
instance (q : Quotient s₁) (f : α → Prop) (h : ∀ a b, s₁ a b → f a = f b)
746746
[DecidablePred f] :
747747
Decidable (Quotient.liftOn' q f h) :=
748748
Quotient.lift.decidablePred _ _ q
749749

750750
instance (q₁ : Quotient s₁) (q₂ : Quotient s₂) (f : α → β → Prop)
751-
(h : ∀ a₁ b₁ a₂ b₂, @Setoid.r α s₁ a₁ a₂ → @Setoid.r β s₂ b₁ b₂ → f a₁ b₁ = f a₂ b₂)
751+
(h : ∀ a₁ b₁ a₂ b₂, s₁ a₁ a₂ → s₂ b₁ b₂ → f a₁ b₁ = f a₂ b₂)
752752
[∀ a, DecidablePred (f a)] :
753753
Decidable (Quotient.liftOn₂' q₁ q₂ f h) :=
754754
Quotient.lift₂.decidablePred _ h _ _

Mathlib/Data/Setoid/Partition.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ theorem sUnion_classes (r : Setoid α) : ⋃₀ r.classes = Set.univ :=
156156
/-- The equivalence between the quotient by an equivalence relation and its
157157
type of equivalence classes. -/
158158
noncomputable def quotientEquivClasses (r : Setoid α) : Quotient r ≃ Setoid.classes r := by
159-
let f (a : α) : Setoid.classes r := ⟨{ x | Setoid.r x a }, Setoid.mem_classes r a⟩
160-
have f_respects_relation (a b : α) (a_rel_b : Setoid.r a b) : f a = f b := by
159+
let f (a : α) : Setoid.classes r := ⟨{ x | r x a }, Setoid.mem_classes r a⟩
160+
have f_respects_relation (a b : α) (a_rel_b : r a b) : f a = f b := by
161161
rw [Subtype.mk.injEq]
162162
exact Setoid.eq_of_mem_classes (Setoid.mem_classes r a) (Setoid.symm a_rel_b)
163163
(Setoid.mem_classes r b) (Setoid.refl b)
@@ -168,7 +168,7 @@ noncomputable def quotientEquivClasses (r : Setoid α) : Quotient r ≃ Setoid.c
168168
induction' q_b using Quotient.ind with b
169169
simp only [Subtype.ext_iff, Quotient.lift_mk, Subtype.ext_iff] at h_eq
170170
apply Quotient.sound
171-
show a ∈ { x | Setoid.r x b }
171+
show a ∈ { x | r x b }
172172
rw [← h_eq]
173173
exact Setoid.refl a
174174
· rw [Quot.surjective_lift]

Mathlib/GroupTheory/Coset/Basic.lean

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def leftRel : Setoid α :=
235235
variable {s}
236236

237237
@[to_additive]
238-
theorem leftRel_apply {x y : α} : @Setoid.r _ (leftRel s) x y ↔ x⁻¹ * y ∈ s :=
238+
theorem leftRel_apply {x y : α} : leftRel s x y ↔ x⁻¹ * y ∈ s :=
239239
calc
240240
(∃ a : s.op, y * MulOpposite.unop a = x) ↔ ∃ a : s, y * a = x :=
241241
s.equivOp.symm.exists_congr_left
@@ -246,13 +246,13 @@ theorem leftRel_apply {x y : α} : @Setoid.r _ (leftRel s) x y ↔ x⁻¹ * y
246246
variable (s)
247247

248248
@[to_additive]
249-
theorem leftRel_eq : @Setoid.r _ (leftRel s) = fun x y => x⁻¹ * y ∈ s :=
249+
theorem leftRel_eq : (leftRel s) = fun x y => x⁻¹ * y ∈ s :=
250250
funext₂ <| by
251251
simp only [eq_iff_iff]
252252
apply leftRel_apply
253253

254254
theorem leftRel_r_eq_leftCosetEquivalence :
255-
@Setoid.r _ (QuotientGroup.leftRel s) = LeftCosetEquivalence s := by
255+
(QuotientGroup.leftRel s) = LeftCosetEquivalence s := by
256256
ext
257257
rw [leftRel_eq]
258258
exact (leftCoset_eq_iff s).symm
@@ -279,7 +279,7 @@ def rightRel : Setoid α :=
279279
variable {s}
280280

281281
@[to_additive]
282-
theorem rightRel_apply {x y : α} : @Setoid.r _ (rightRel s) x y ↔ y * x⁻¹ ∈ s :=
282+
theorem rightRel_apply {x y : α} : rightRel s x y ↔ y * x⁻¹ ∈ s :=
283283
calc
284284
(∃ a : s, (a : α) * y = x) ↔ ∃ a : s, y * x⁻¹ = a⁻¹ := by
285285
simp only [mul_inv_eq_iff_eq_mul, Subgroup.coe_inv, eq_inv_mul_iff_mul_eq]
@@ -288,13 +288,13 @@ theorem rightRel_apply {x y : α} : @Setoid.r _ (rightRel s) x y ↔ y * x⁻¹
288288
variable (s)
289289

290290
@[to_additive]
291-
theorem rightRel_eq : @Setoid.r _ (rightRel s) = fun x y => y * x⁻¹ ∈ s :=
291+
theorem rightRel_eq : (rightRel s) = fun x y => y * x⁻¹ ∈ s :=
292292
funext₂ <| by
293293
simp only [eq_iff_iff]
294294
apply rightRel_apply
295295

296296
theorem rightRel_r_eq_rightCosetEquivalence :
297-
@Setoid.r _ (QuotientGroup.rightRel s) = RightCosetEquivalence s := by
297+
(QuotientGroup.rightRel s) = RightCosetEquivalence s := by
298298
ext
299299
rw [rightRel_eq]
300300
exact (rightCoset_eq_iff s).symm
@@ -391,7 +391,7 @@ instance (s : Subgroup α) : Inhabited (α ⧸ s) :=
391391
@[to_additive]
392392
protected theorem eq {a b : α} : (a : α ⧸ s) = b ↔ a⁻¹ * b ∈ s :=
393393
calc
394-
_ ↔ @Setoid.r _ (leftRel s) a b := Quotient.eq''
394+
_ ↔ leftRel s a b := Quotient.eq''
395395
_ ↔ _ := by rw [leftRel_apply]
396396

397397
@[to_additive (attr := deprecated (since := "2024-08-04"))] alias eq' := QuotientGroup.eq

Mathlib/GroupTheory/Index.lean

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,8 @@ noncomputable def relindex : ℕ :=
5656
@[to_additive]
5757
theorem index_comap_of_surjective {f : G' →* G} (hf : Function.Surjective f) :
5858
(H.comap f).index = H.index := by
59-
letI := QuotientGroup.leftRel H
60-
letI := QuotientGroup.leftRel (H.comap f)
61-
have key : ∀ x y : G', Setoid.r x y ↔ Setoid.r (f x) (f y) := by
59+
have key : ∀ x y : G',
60+
QuotientGroup.leftRel (H.comap f) x y ↔ QuotientGroup.leftRel H (f x) (f y) := by
6261
simp only [QuotientGroup.leftRel_apply]
6362
exact fun x y => iff_of_eq (congr_arg (· ∈ H) (by rw [f.map_mul, f.map_inv]))
6463
refine Cardinal.toNat_congr (Equiv.ofBijective (Quotient.map' f fun x y => (key x y).mp) ⟨?_, ?_⟩)

Mathlib/GroupTheory/QuotientGroup/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ noncomputable def quotientInfEquivProdNormalQuotient (H N : Subgroup G) [N.Norma
524524
(@leftRel ↑(H ⊔ N) (H ⊔ N : Subgroup G).toGroup (N.subgroupOf (H ⊔ N)))
525525
-- Porting note: Lean couldn't find this automatically
526526
refine Quotient.eq.mpr ?_
527-
change Setoid.r _ _
527+
change leftRel _ _ _
528528
rw [leftRel_apply]
529529
change h⁻¹ * (h * n) ∈ N
530530
rwa [← mul_assoc, inv_mul_cancel, one_mul]

Mathlib/LinearAlgebra/InvariantBasisNumber.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ private def induced_map (I : Ideal R) (e : (ι → R) →ₗ[R] ι' → R) :
282282
Quotient.liftOn' x (fun y => Ideal.Quotient.mk (I.pi ι') (e y))
283283
(by
284284
refine fun a b hab => Ideal.Quotient.eq.2 fun h => ?_
285-
rw [Submodule.quotientRel_r_def] at hab
285+
rw [Submodule.quotientRel_def] at hab
286286
rw [← LinearMap.map_sub]
287287
exact Ideal.map_pi _ _ hab e h)
288288

0 commit comments

Comments
 (0)