diff --git a/Counterexamples/CliffordAlgebraNotInjective.lean b/Counterexamples/CliffordAlgebraNotInjective.lean index 38955c69d5249..1aceaff9f3cfe 100644 --- a/Counterexamples/CliffordAlgebraNotInjective.lean +++ b/Counterexamples/CliffordAlgebraNotInjective.lean @@ -127,7 +127,7 @@ theorem X_sq (i : Fin 3) : K.gen i * K.gen i = (0 : K) := by /-- If an element multiplied by `αβγ` is zero then it squares to zero. -/ theorem sq_zero_of_αβγ_mul {x : K} : α * β * γ * x = 0 → x * x = 0 := by - induction x using Quotient.inductionOn' + induction x using Quotient.inductionOn change Ideal.Quotient.mk _ _ = 0 → Ideal.Quotient.mk _ _ = 0 rw [Ideal.Quotient.eq_zero_iff_mem, Ideal.Quotient.eq_zero_iff_mem] exact mul_self_mem_kIdeal_of_X0_X1_X2_mul_mem @@ -207,8 +207,8 @@ theorem Q'_zero_under_ideal (v : Fin 3 → K) (hv : v ∈ LinearMap.ker lFunc) : def Q : QuadraticForm K L := QuadraticMap.ofPolar (fun x => - Quotient.liftOn' x Q' fun a b h => by - rw [Submodule.quotientRel_r_def] at h + Quotient.liftOn x Q' fun a b h => by + rw [Setoid.equiv_iff_apply, Submodule.quotientRel_r_def] at h suffices Q' (a - b) = 0 by rwa [Q'_sub, sub_eq_zero] at this apply Q'_zero_under_ideal (a - b) h) (fun a x => by @@ -231,7 +231,7 @@ local notation "z'" => gen 2 theorem gen_mul_gen (i) : gen i * gen i = 1 := by dsimp only [gen] simp_rw [CliffordAlgebra.ι_sq_scalar, Q_apply, ← Submodule.Quotient.mk''_eq_mk, - Quotient.liftOn'_mk'', Q'_apply_single, mul_one, map_one] + Quotient.liftOn_mk, Q'_apply_single, mul_one, map_one] /-- By virtue of the quotient, terms of this form are zero -/ theorem quot_obv : α • x' - β • y' - γ • z' = 0 := by diff --git a/Mathlib/Algebra/Associated/Basic.lean b/Mathlib/Algebra/Associated/Basic.lean index 70a806de2380a..59e32ae467586 100644 --- a/Mathlib/Algebra/Associated/Basic.lean +++ b/Mathlib/Algebra/Associated/Basic.lean @@ -964,7 +964,7 @@ instance [Nontrivial α] : Nontrivial (Associates α) := ⟨⟨1, 0, mk_ne_zero.2 one_ne_zero⟩⟩ theorem exists_non_zero_rep {a : Associates α} : a ≠ 0 → ∃ a0 : α, a0 ≠ 0 ∧ Associates.mk a0 = a := - Quotient.inductionOn a fun b nz => ⟨b, mt (congr_arg Quotient.mk'') nz, rfl⟩ + Quotient.inductionOn a fun b nz => ⟨b, mt (congr_arg (Quotient.mk _)) nz, rfl⟩ end MonoidWithZero diff --git a/Mathlib/Algebra/BigOperators/Group/Finset.lean b/Mathlib/Algebra/BigOperators/Group/Finset.lean index 84b2a9a1ee80b..11ba273277c1a 100644 --- a/Mathlib/Algebra/BigOperators/Group/Finset.lean +++ b/Mathlib/Algebra/BigOperators/Group/Finset.lean @@ -1598,14 +1598,14 @@ theorem dvd_prod_of_mem (f : α → β) {a : α} {s : Finset α} (ha : a ∈ s) /-- A product can be partitioned into a product of products, each equivalent under a setoid. -/ @[to_additive "A sum can be partitioned into a sum of sums, each equivalent under a setoid."] theorem prod_partition (R : Setoid α) [DecidableRel R.r] : - ∏ x ∈ s, f x = ∏ xbar ∈ s.image Quotient.mk'', ∏ y ∈ s.filter (⟦·⟧ = xbar), f y := by + ∏ x ∈ s, f x = ∏ xbar ∈ s.image (Quotient.mk _), ∏ y ∈ s.filter (⟦·⟧ = xbar), f y := by refine (Finset.prod_image' f fun x _hx => ?_).symm rfl /-- If we can partition a product into subsets that cancel out, then the whole product cancels. -/ @[to_additive "If we can partition a sum into subsets that cancel out, then the whole sum cancels."] theorem prod_cancels_of_partition_cancels (R : Setoid α) [DecidableRel R.r] - (h : ∀ x ∈ s, ∏ a ∈ s.filter fun y => y ≈ x, f a = 1) : ∏ x ∈ s, f x = 1 := by + (h : ∀ x ∈ s, ∏ a ∈ s.filter fun y => R y x, f a = 1) : ∏ x ∈ s, f x = 1 := by rw [prod_partition R, ← Finset.prod_eq_one] intro xbar xbar_in_s obtain ⟨x, x_in_s, rfl⟩ := mem_image.mp xbar_in_s diff --git a/Mathlib/Algebra/CharZero/Quotient.lean b/Mathlib/Algebra/CharZero/Quotient.lean index 8a44865763c7e..79b566ed37ce1 100644 --- a/Mathlib/Algebra/CharZero/Quotient.lean +++ b/Mathlib/Algebra/CharZero/Quotient.lean @@ -51,11 +51,11 @@ namespace QuotientAddGroup theorem zmultiples_zsmul_eq_zsmul_iff {ψ θ : R ⧸ AddSubgroup.zmultiples p} {z : ℤ} (hz : z ≠ 0) : z • ψ = z • θ ↔ ∃ k : Fin z.natAbs, ψ = θ + ((k : ℕ) • (p / z) : R) := by - induction ψ using Quotient.inductionOn' - induction θ using Quotient.inductionOn' + induction ψ using Quotient.inductionOn + induction θ using Quotient.inductionOn -- Porting note: Introduced Zp notation to shorten lines let Zp := AddSubgroup.zmultiples p - have : (Quotient.mk'' : R → R ⧸ Zp) = ((↑) : R → R ⧸ Zp) := rfl + have : (Quotient.mk _ : R → R ⧸ Zp) = ((↑) : R → R ⧸ Zp) := rfl simp only [this] simp_rw [← QuotientAddGroup.mk_zsmul, ← QuotientAddGroup.mk_add, QuotientAddGroup.eq_iff_sub_mem, ← smul_sub, ← sub_sub] diff --git a/Mathlib/Algebra/DirectLimit.lean b/Mathlib/Algebra/DirectLimit.lean index f1aa6c7623464..2d8277f4f9291 100644 --- a/Mathlib/Algebra/DirectLimit.lean +++ b/Mathlib/Algebra/DirectLimit.lean @@ -123,7 +123,7 @@ some component of the directed system. -/ theorem exists_of [Nonempty ι] [IsDirected ι (· ≤ ·)] (z : DirectLimit G f) : ∃ i x, of R ι G f i x = z := Nonempty.elim (by infer_instance) fun ind : ι => - Quotient.inductionOn' z fun z => + Quotient.inductionOn z fun z => DirectSum.induction_on z ⟨ind, 0, LinearMap.map_zero _⟩ (fun i x => ⟨i, x, rfl⟩) fun p q ⟨i, x, ihx⟩ ⟨j, y, ihy⟩ => let ⟨k, hik, hjk⟩ := exists_ge_ge i j @@ -574,7 +574,7 @@ some component of the directed system. -/ theorem exists_of [Nonempty ι] [IsDirected ι (· ≤ ·)] (z : DirectLimit G f) : ∃ i x, of G f i x = z := Nonempty.elim (by infer_instance) fun ind : ι => - Quotient.inductionOn' z fun x => + Quotient.inductionOn z fun x => FreeAbelianGroup.induction_on x ⟨ind, 0, (of _ _ ind).map_zero⟩ (fun s => Multiset.induction_on s ⟨ind, 1, (of _ _ ind).map_one⟩ fun a s ih => @@ -585,7 +585,7 @@ theorem exists_of [Nonempty ι] [IsDirected ι (· ≤ ·)] (z : DirectLimit G f rw [(of G f k).map_mul, of_f, of_f, hs] /- porting note: In Lean3, from here, this was `by refl`. I have added the lemma `FreeCommRing.of_cons` to fix this proof. -/ - apply congr_arg Quotient.mk'' + apply congr_arg (Quotient.mk _) symm apply FreeCommRing.of_cons⟩) (fun s ⟨i, x, ih⟩ => ⟨i, -x, by diff --git a/Mathlib/Algebra/GCDMonoid/Basic.lean b/Mathlib/Algebra/GCDMonoid/Basic.lean index e7ff47b1fe976..ffeea43378558 100644 --- a/Mathlib/Algebra/GCDMonoid/Basic.lean +++ b/Mathlib/Algebra/GCDMonoid/Basic.lean @@ -1326,8 +1326,8 @@ namespace Associates variable [CancelCommMonoidWithZero α] [GCDMonoid α] instance instGCDMonoid : GCDMonoid (Associates α) where - gcd := Quotient.map₂' gcd fun a₁ a₂ (ha : Associated _ _) b₁ b₂ (hb : Associated _ _) => ha.gcd hb - lcm := Quotient.map₂' lcm fun a₁ a₂ (ha : Associated _ _) b₁ b₂ (hb : Associated _ _) => ha.lcm hb + gcd := Quotient.map₂ gcd fun a₁ a₂ (ha : Associated _ _) b₁ b₂ (hb : Associated _ _) => ha.gcd hb + lcm := Quotient.map₂ lcm fun a₁ a₂ (ha : Associated _ _) b₁ b₂ (hb : Associated _ _) => ha.lcm hb gcd_dvd_left := by rintro ⟨a⟩ ⟨b⟩; exact mk_le_mk_of_dvd (gcd_dvd_left _ _) gcd_dvd_right := by rintro ⟨a⟩ ⟨b⟩; exact mk_le_mk_of_dvd (gcd_dvd_right _ _) dvd_gcd := by diff --git a/Mathlib/Algebra/Lie/Free.lean b/Mathlib/Algebra/Lie/Free.lean index 89f782ebaeb0d..90bec26bf9bcf 100644 --- a/Mathlib/Algebra/Lie/Free.lean +++ b/Mathlib/Algebra/Lie/Free.lean @@ -126,11 +126,11 @@ instance : Sub (FreeLieAlgebra R X) where sub := Quot.map₂ Sub.sub (fun _ _ _ => Rel.subLeft _) fun _ _ _ => Rel.subRight _ instance : AddGroup (FreeLieAlgebra R X) := - Function.Surjective.addGroup (Quot.mk _) (surjective_quot_mk _) rfl (fun _ _ => rfl) + Function.Surjective.addGroup (Quot.mk _) Quot.surjective_mk rfl (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) fun _ _ => rfl instance : AddCommSemigroup (FreeLieAlgebra R X) := - Function.Surjective.addCommSemigroup (Quot.mk _) (surjective_quot_mk _) fun _ _ => rfl + Function.Surjective.addCommSemigroup (Quot.mk _) Quot.surjective_mk fun _ _ => rfl instance : AddCommGroup (FreeLieAlgebra R X) := { (inferInstance : AddGroup (FreeLieAlgebra R X)), @@ -139,7 +139,7 @@ instance : AddCommGroup (FreeLieAlgebra R X) := instance {S : Type*} [Semiring S] [Module S R] [IsScalarTower S R R] : Module S (FreeLieAlgebra R X) := Function.Surjective.module S ⟨⟨Quot.mk (Rel R X), rfl⟩, fun _ _ => rfl⟩ - (surjective_quot_mk _) (fun _ _ => rfl) + Quot.surjective_mk (fun _ _ => rfl) /-- Note that here we turn the `Mul` coming from the `NonUnitalNonAssocSemiring` structure on `lib R X` into a `Bracket` on `FreeLieAlgebra`. -/ diff --git a/Mathlib/Algebra/Lie/Quotient.lean b/Mathlib/Algebra/Lie/Quotient.lean index cefd7b350bb49..b54ecfe19c4d4 100644 --- a/Mathlib/Algebra/Lie/Quotient.lean +++ b/Mathlib/Algebra/Lie/Quotient.lean @@ -73,7 +73,7 @@ abbrev mk : M → M ⧸ N := theorem mk_eq_zero' {m : M} : mk (N := N) m = 0 ↔ m ∈ N := Submodule.Quotient.mk_eq_zero N.toSubmodule -theorem is_quotient_mk (m : M) : Quotient.mk'' m = (mk m : M ⧸ N) := +theorem is_quotient_mk (m : M) : ⟦m⟧ = (mk m : M ⧸ N) := rfl variable [LieAlgebra R L] [LieModule R L M] (I J : LieIdeal R L) @@ -108,10 +108,10 @@ instance lieQuotientLieModule : LieModule R L (M ⧸ N) := instance lieQuotientHasBracket : Bracket (L ⧸ I) (L ⧸ I) := ⟨by intro x y - apply Quotient.liftOn₂' x y fun x' y' => mk ⁅x', y'⁆ + apply Quotient.liftOn₂ x y fun x' y' => mk ⁅x', y'⁆ intro x₁ x₂ y₁ y₂ h₁ h₂ apply (Submodule.Quotient.eq I.toSubmodule).2 - rw [Submodule.quotientRel_r_def] at h₁ h₂ + rw [Setoid.equiv_iff_apply, Submodule.quotientRel_r_def] at h₁ h₂ have h : ⁅x₁, x₂⁆ - ⁅y₁, y₂⁆ = ⁅x₁, x₂ - y₂⁆ + ⁅x₁ - y₁, y₂⁆ := by simp [-lie_skew, sub_eq_add_neg, add_assoc] rw [h] @@ -125,7 +125,7 @@ theorem mk_bracket (x y : L) : mk ⁅x, y⁆ = ⁅(mk x : L ⧸ I), (mk y : L instance lieQuotientLieRing : LieRing (L ⧸ I) where add_lie := by - intro x' y' z'; refine Quotient.inductionOn₃' x' y' z' ?_; intro x y z + intro x' y' z'; refine Quotient.inductionOn₃ x' y' z' ?_; intro x y z repeat' first | rw [is_quotient_mk] @@ -133,7 +133,7 @@ instance lieQuotientLieRing : LieRing (L ⧸ I) where | rw [← Submodule.Quotient.mk_add (R := R) (M := L)] apply congr_arg; apply add_lie lie_add := by - intro x' y' z'; refine Quotient.inductionOn₃' x' y' z' ?_; intro x y z + intro x' y' z'; refine Quotient.inductionOn₃ x' y' z' ?_; intro x y z repeat' first | rw [is_quotient_mk] @@ -141,11 +141,11 @@ instance lieQuotientLieRing : LieRing (L ⧸ I) where | rw [← Submodule.Quotient.mk_add (R := R) (M := L)] apply congr_arg; apply lie_add lie_self := by - intro x'; refine Quotient.inductionOn' x' ?_; intro x + intro x'; refine Quotient.inductionOn x' ?_; intro x rw [is_quotient_mk, ← mk_bracket] apply congr_arg; apply lie_self leibniz_lie := by - intro x' y' z'; refine Quotient.inductionOn₃' x' y' z' ?_; intro x y z + intro x' y' z'; refine Quotient.inductionOn₃ x' y' z' ?_; intro x y z repeat' first | rw [is_quotient_mk] @@ -155,7 +155,7 @@ instance lieQuotientLieRing : LieRing (L ⧸ I) where instance lieQuotientLieAlgebra : LieAlgebra R (L ⧸ I) where lie_smul := by - intro t x' y'; refine Quotient.inductionOn₂' x' y' ?_; intro x y + intro t x' y'; refine Quotient.inductionOn₂ x' y' ?_; intro x y repeat' first | rw [is_quotient_mk] @@ -171,7 +171,7 @@ def mk' : M →ₗ⁅R,L⁆ M ⧸ N := map_lie' := fun {_ _} => rfl } @[simp] -theorem surjective_mk' : Function.Surjective (mk' N) := surjective_quot_mk _ +theorem surjective_mk' : Function.Surjective (mk' N) := Quot.surjective_mk @[simp] theorem range_mk' : LieModuleHom.range (mk' N) = ⊤ := by simp [LieModuleHom.range_eq_top] @@ -196,7 +196,7 @@ theorem map_mk'_eq_bot_le : map (mk' N) N' = ⊥ ↔ N' ≤ N := by See note [partially-applied ext lemmas]. -/ @[ext] theorem lieModuleHom_ext ⦃f g : M ⧸ N →ₗ⁅R,L⁆ M⦄ (h : f.comp (mk' N) = g.comp (mk' N)) : f = g := - LieModuleHom.ext fun x => Quotient.inductionOn' x <| LieModuleHom.congr_fun h + LieModuleHom.ext fun x => Quotient.inductionOn x <| LieModuleHom.congr_fun h lemma toEnd_comp_mk' (x : L) : LieModule.toEnd R L (M ⧸ N) x ∘ₗ mk' N = mk' N ∘ₗ LieModule.toEnd R L M x := diff --git a/Mathlib/Algebra/Module/Torsion.lean b/Mathlib/Algebra/Module/Torsion.lean index 492b9633c7d35..a477d061c01ff 100644 --- a/Mathlib/Algebra/Module/Torsion.lean +++ b/Mathlib/Algebra/Module/Torsion.lean @@ -499,7 +499,7 @@ instance IsTorsionBySet.isScalarTower (hM : IsTorsionBySet R M I) @IsScalarTower S (R ⧸ I) M _ (IsTorsionBySet.module hM).toSMul _ := -- Porting note: still needed to be fed the Module R / I M instance @IsScalarTower.mk S (R ⧸ I) M _ (IsTorsionBySet.module hM).toSMul _ - (fun b d x => Quotient.inductionOn' d fun c => (smul_assoc b c x : _)) + (fun b d x => Quotient.inductionOn d fun c => (smul_assoc b c x : _)) /-- An `(R ⧸ Ideal.span {r})`-module is an `R`-module for which `IsTorsionBy R M r`. -/ abbrev IsTorsionBy.module (hM : IsTorsionBy R M r) : Module (R ⧸ Ideal.span {r}) M := @@ -746,7 +746,7 @@ variable [CommRing R] [AddCommGroup M] [Module R M] @[simp] theorem torsion_eq_bot : torsion R (M ⧸ torsion R M) = ⊥ := eq_bot_iff.mpr fun z => - Quotient.inductionOn' z fun x ⟨a, hax⟩ => by + Quotient.inductionOn z fun x ⟨a, hax⟩ => by rw [Quotient.mk''_eq_mk, ← Quotient.mk_smul, Quotient.mk_eq_zero] at hax rw [mem_bot, Quotient.mk''_eq_mk, Quotient.mk_eq_zero] cases' hax with b h diff --git a/Mathlib/Algebra/Module/Zlattice/Basic.lean b/Mathlib/Algebra/Module/Zlattice/Basic.lean index c3614a576ee4a..acebcb96ce9c8 100644 --- a/Mathlib/Algebra/Module/Zlattice/Basic.lean +++ b/Mathlib/Algebra/Module/Zlattice/Basic.lean @@ -247,7 +247,7 @@ def quotientEquiv [Fintype ι] : apply Quotient.sound' rwa [QuotientAddGroup.leftRel_apply, mem_toAddSubgroup, ← fract_eq_fract] · obtain ⟨a, rfl⟩ := fractRestrict_surjective b x - exact ⟨Quotient.mk'' a, rfl⟩ + exact ⟨⟦a⟧, rfl⟩ @[simp] theorem quotientEquiv_apply_mk [Fintype ι] (x : E) : diff --git a/Mathlib/Algebra/Order/CauSeq/Completion.lean b/Mathlib/Algebra/Order/CauSeq/Completion.lean index 1cf2efa956c83..1e2f15e6448b5 100644 --- a/Mathlib/Algebra/Order/CauSeq/Completion.lean +++ b/Mathlib/Algebra/Order/CauSeq/Completion.lean @@ -32,7 +32,7 @@ variable {abv} /-- The map from Cauchy sequences into the Cauchy completion. -/ def mk : CauSeq _ abv → Cauchy abv := - Quotient.mk'' + Quotient.mk _ @[simp] theorem mk_eq_mk (f : CauSeq _ abv) : @Eq (Cauchy abv) ⟦f⟧ (mk f) := @@ -140,7 +140,7 @@ private theorem one_def : 1 = mk (abv := abv) 1 := rfl instance Cauchy.ring : Ring (Cauchy abv) := - Function.Surjective.ring mk (surjective_quotient_mk' _) zero_def.symm one_def.symm + Function.Surjective.ring mk Quotient.surjective_mk' zero_def.symm one_def.symm (fun _ _ => (mk_add _ _).symm) (fun _ _ => (mk_mul _ _).symm) (fun _ => (mk_neg _).symm) (fun _ _ => (mk_sub _ _).symm) (fun _ _ => (mk_smul _ _).symm) (fun _ _ => (mk_smul _ _).symm) (fun _ _ => (mk_pow _ _).symm) (fun _ => rfl) fun _ => rfl @@ -165,7 +165,7 @@ variable {α : Type*} [LinearOrderedField α] variable {β : Type*} [CommRing β] {abv : β → α} [IsAbsoluteValue abv] instance Cauchy.commRing : CommRing (Cauchy abv) := - Function.Surjective.commRing mk (surjective_quotient_mk' _) zero_def.symm one_def.symm + Function.Surjective.commRing mk Quotient.surjective_mk' zero_def.symm one_def.symm (fun _ _ => (mk_add _ _).symm) (fun _ _ => (mk_mul _ _).symm) (fun _ => (mk_neg _).symm) (fun _ _ => (mk_sub _ _).symm) (fun _ _ => (mk_smul _ _).symm) (fun _ _ => (mk_smul _ _).symm) (fun _ _ => (mk_pow _ _).symm) (fun _ => rfl) fun _ => rfl diff --git a/Mathlib/Algebra/Periodic.lean b/Mathlib/Algebra/Periodic.lean index 995e7e734029d..36e3c69f33ce7 100644 --- a/Mathlib/Algebra/Periodic.lean +++ b/Mathlib/Algebra/Periodic.lean @@ -275,8 +275,8 @@ theorem Periodic.map_vadd_multiples [AddCommMonoid α] (hf : Periodic f c) /-- Lift a periodic function to a function from the quotient group. -/ def Periodic.lift [AddGroup α] (h : Periodic f c) (x : α ⧸ AddSubgroup.zmultiples c) : β := - Quotient.liftOn' x f fun a b h' => by - rw [QuotientAddGroup.leftRel_apply] at h' + Quotient.liftOn x f fun a b h' => by + rw [Setoid.equiv_iff_apply, QuotientAddGroup.leftRel_apply] at h' obtain ⟨k, hk⟩ := h' exact (h.zsmul k _).symm.trans (congr_arg f (add_eq_of_eq_neg_add hk)) diff --git a/Mathlib/Algebra/RingQuot.lean b/Mathlib/Algebra/RingQuot.lean index f0e0f3bcd667b..89dc384fae515 100644 --- a/Mathlib/Algebra/RingQuot.lean +++ b/Mathlib/Algebra/RingQuot.lean @@ -35,8 +35,8 @@ namespace RingCon instance (c : RingCon A) : Algebra S c.Quotient where smul := (· • ·) toRingHom := c.mk'.comp (algebraMap S A) - commutes' _ := Quotient.ind' fun _ ↦ congr_arg Quotient.mk'' <| Algebra.commutes _ _ - smul_def' _ := Quotient.ind' fun _ ↦ congr_arg Quotient.mk'' <| Algebra.smul_def _ _ + commutes' _ := Quotient.ind fun _ ↦ congr_arg (Quotient.mk _) <| Algebra.commutes _ _ + smul_def' _ := Quotient.ind fun _ ↦ congr_arg (Quotient.mk _) <| Algebra.smul_def _ _ @[simp, norm_cast] theorem coe_algebraMap (c : RingCon A) (s : S) : diff --git a/Mathlib/AlgebraicGeometry/EllipticCurve/Jacobian.lean b/Mathlib/AlgebraicGeometry/EllipticCurve/Jacobian.lean index b3f2eea5ac125..a3cc54fb1e607 100644 --- a/Mathlib/AlgebraicGeometry/EllipticCurve/Jacobian.lean +++ b/Mathlib/AlgebraicGeometry/EllipticCurve/Jacobian.lean @@ -1168,7 +1168,8 @@ lemma add_of_equiv {P Q : Fin 3 → R} (h : P ≈ Q) : W'.add P Q = W'.dblXYZ P lemma add_smul_of_equiv {P Q : Fin 3 → R} (h : P ≈ Q) {u v : R} (hu : IsUnit u) (hv : IsUnit v) : W'.add (u • P) (v • Q) = u ^ 4 • W'.add P Q := by have smul : P ≈ Q ↔ u • P ≈ v • Q := by - erw [← Quotient.eq, ← Quotient.eq, smul_eq P hu, smul_eq Q hv] + rw [Setoid.equiv_iff_apply, Setoid.equiv_iff_apply, ← Quotient.eq, ← Quotient.eq] + erw [smul_eq P hu, smul_eq Q hv] rfl rw [add_of_equiv <| smul.mp h, dblXYZ_smul, add_of_equiv h] @@ -1184,7 +1185,8 @@ lemma add_of_not_equiv {P Q : Fin 3 → R} (h : ¬P ≈ Q) : W'.add P Q = W'.add lemma add_smul_of_not_equiv {P Q : Fin 3 → R} (h : ¬P ≈ Q) {u v : R} (hu : IsUnit u) (hv : IsUnit v) : W'.add (u • P) (v • Q) = (u * v) ^ 2 • W'.add P Q := by have smul : P ≈ Q ↔ u • P ≈ v • Q := by - erw [← Quotient.eq, ← Quotient.eq, smul_eq P hu, smul_eq Q hv] + rw [Setoid.equiv_iff_apply, Setoid.equiv_iff_apply, ← Quotient.eq, ← Quotient.eq] + erw [smul_eq P hu, smul_eq Q hv] rfl rw [add_of_not_equiv <| h.comp smul.mpr, addXYZ_smul, add_of_not_equiv h] diff --git a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean index 79096073211a1..a3ab4fb52584f 100644 --- a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean +++ b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean @@ -217,7 +217,7 @@ def toSpec (f : A) : (Proj.T| pbo f) ⟶ Spec.T A⁰_ f where continuous_toFun := by rw [PrimeSpectrum.isTopologicalBasis_basic_opens.continuous_iff] rintro _ ⟨x, rfl⟩ - obtain ⟨x, rfl⟩ := Quotient.surjective_Quotient_mk'' x + obtain ⟨x, rfl⟩ := Quotient.surjective_mk x rw [ToSpec.preimage_basicOpen] exact (pbo x.num).2.preimage continuous_subtype_val diff --git a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/StructureSheaf.lean b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/StructureSheaf.lean index 747ed8efb6ca5..d1ff2993471d8 100644 --- a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/StructureSheaf.lean +++ b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/StructureSheaf.lean @@ -299,7 +299,7 @@ open HomogeneousLocalization in stalk at `x` obtained by `sectionInBasicOpen`. This is the inverse of `stalkToFiberRingHom`. -/ def homogeneousLocalizationToStalk (x : ProjectiveSpectrum.top 𝒜) (y : at x) : - (Proj.structureSheaf 𝒜).presheaf.stalk x := Quotient.liftOn' y (fun f => + (Proj.structureSheaf 𝒜).presheaf.stalk x := Quotient.liftOn y (fun f => (Proj.structureSheaf 𝒜).presheaf.germ ⟨x, mem_basicOpen_den _ x f⟩ (sectionInBasicOpen _ x f)) fun f g (e : f.embedding = g.embedding) ↦ by simp only [HomogeneousLocalization.NumDenSameDeg.embedding, Localization.mk_eq_mk', @@ -325,7 +325,7 @@ lemma homogeneousLocalizationToStalk_stalkToFiberRingHom (x z) : obtain ⟨U, hxU, s, rfl⟩ := (Proj.structureSheaf 𝒜).presheaf.germ_exist x z obtain ⟨V, hxV, i, n, a, b, h, e⟩ := s.2 ⟨x, hxU⟩ simp only at e - rw [stalkToFiberRingHom_germ', homogeneousLocalizationToStalk, e ⟨x, hxV⟩, Quotient.liftOn'_mk''] + rw [stalkToFiberRingHom_germ', homogeneousLocalizationToStalk, e ⟨x, hxV⟩, Quotient.liftOn_mk] refine Presheaf.germ_ext _ V hxV (by exact homOfLE <| fun _ h' ↦ h ⟨_, h'⟩) i ?_ apply Subtype.ext ext ⟨t, ht⟩ @@ -335,8 +335,8 @@ lemma homogeneousLocalizationToStalk_stalkToFiberRingHom (x z) : lemma stalkToFiberRingHom_homogeneousLocalizationToStalk (x z) : stalkToFiberRingHom 𝒜 x (homogeneousLocalizationToStalk 𝒜 x z) = z := by - obtain ⟨z, rfl⟩ := Quotient.surjective_Quotient_mk'' z - rw [homogeneousLocalizationToStalk, Quotient.liftOn'_mk'', + obtain ⟨z, rfl⟩ := Quotient.surjective_mk z + rw [homogeneousLocalizationToStalk, Quotient.liftOn_mk, stalkToFiberRingHom_germ', sectionInBasicOpen] /-- Using `homogeneousLocalizationToStalk`, we construct a ring isomorphism between stalk at `x` diff --git a/Mathlib/Analysis/Normed/Group/Quotient.lean b/Mathlib/Analysis/Normed/Group/Quotient.lean index 085dab581687e..6da1684f7534c 100644 --- a/Mathlib/Analysis/Normed/Group/Quotient.lean +++ b/Mathlib/Analysis/Normed/Group/Quotient.lean @@ -265,7 +265,7 @@ theorem normedMk.apply (S : AddSubgroup M) (m : M) : normedMk S m = QuotientAddG /-- `S.normedMk` is surjective. -/ theorem surjective_normedMk (S : AddSubgroup M) : Function.Surjective (normedMk S) := - surjective_quot_mk _ + Quot.surjective_mk /-- The kernel of `S.normedMk` is `S`. -/ theorem ker_normedMk (S : AddSubgroup M) : S.normedMk.ker = S := diff --git a/Mathlib/Analysis/Normed/Group/SemiNormedGrp/Kernels.lean b/Mathlib/Analysis/Normed/Group/SemiNormedGrp/Kernels.lean index 1f32d6b23b009..cfcab776ed67c 100644 --- a/Mathlib/Analysis/Normed/Group/SemiNormedGrp/Kernels.lean +++ b/Mathlib/Analysis/Normed/Group/SemiNormedGrp/Kernels.lean @@ -212,7 +212,7 @@ def explicitCokernelπ {X Y : SemiNormedGrp.{u}} (f : X ⟶ Y) : Y ⟶ explicitC theorem explicitCokernelπ_surjective {X Y : SemiNormedGrp.{u}} {f : X ⟶ Y} : Function.Surjective (explicitCokernelπ f) := - surjective_quot_mk _ + Quot.surjective_mk @[simp, reassoc] theorem comp_explicitCokernelπ {X Y : SemiNormedGrp.{u}} (f : X ⟶ Y) : diff --git a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Angle.lean b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Angle.lean index 806f844aeaaeb..eb3aca6ac1afb 100644 --- a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Angle.lean +++ b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Angle.lean @@ -66,7 +66,7 @@ theorem coe_coeHom : (coeHom : ℝ → Angle) = ((↑) : ℝ → Angle) := `induction θ using Real.Angle.induction_on`. -/ @[elab_as_elim] protected theorem induction_on {p : Angle → Prop} (θ : Angle) (h : ∀ x : ℝ, p x) : p θ := - Quotient.inductionOn' θ h + Quotient.inductionOn θ h @[simp] theorem coe_zero : ↑(0 : ℝ) = (0 : Angle) := diff --git a/Mathlib/CategoryTheory/ConnectedComponents.lean b/Mathlib/CategoryTheory/ConnectedComponents.lean index 8a2d534554def..f456093706d52 100644 --- a/Mathlib/CategoryTheory/ConnectedComponents.lean +++ b/Mathlib/CategoryTheory/ConnectedComponents.lean @@ -47,7 +47,7 @@ lemma Functor.mapConnectedComponents_mk {K : Type u₂} [Category.{v₂} K] (F : F.mapConnectedComponents (Quotient.mk _ j) = Quotient.mk _ (F.obj j) := rfl instance [Inhabited J] : Inhabited (ConnectedComponents J) := - ⟨Quotient.mk'' default⟩ + ⟨⟦default⟧⟩ /-- Every function from connected components of a category gives a functor to discrete category -/ def ConnectedComponents.functorToDiscrete (X : Type*) @@ -77,7 +77,7 @@ def ConnectedComponents.typeToCatHomEquiv (J) [Category J] (X : Type*) : /-- Given an index for a connected component, produce the actual component as a full subcategory. -/ def Component (j : ConnectedComponents J) : Type u₁ := - FullSubcategory fun k => Quotient.mk'' k = j + FullSubcategory fun k => ⟦k⟧ = j instance {j : ConnectedComponents J} : Category (Component j) := FullSubcategory.category _ @@ -96,7 +96,7 @@ instance {j : ConnectedComponents J} : Functor.Faithful (Component.ι j) := /-- Each connected component of the category is nonempty. -/ instance (j : ConnectedComponents J) : Nonempty (Component j) := by - induction j using Quotient.inductionOn' + induction j using Quotient.inductionOn exact ⟨⟨_, rfl⟩⟩ instance (j : ConnectedComponents J) : Inhabited (Component j) := @@ -112,7 +112,7 @@ instance (j : ConnectedComponents J) : IsConnected (Component j) := by -- Get an explicit zigzag as a list rcases List.exists_chain_of_relationReflTransGen h₁₂ with ⟨l, hl₁, hl₂⟩ -- Everything which has a zigzag to j₂ can be lifted to the same component as `j₂`. - let f : ∀ x, Zigzag x j₂ → Component (Quotient.mk'' j₂) := fun x h => ⟨x, Quotient.sound' h⟩ + let f : ∀ x, Zigzag x j₂ → Component ⟦j₂⟧ := fun x h => ⟨x, Quotient.sound' h⟩ -- Everything in our chosen zigzag from `j₁` to `j₂` has a zigzag to `j₂`. have hf : ∀ a : J, a ∈ l → Zigzag a j₂ := by intro i hi @@ -158,7 +158,7 @@ instance : (decomposedTo J).Full where rintro ⟨j', X, hX⟩ ⟨k', Y, hY⟩ f dsimp at f have : j' = k' := by - rw [← hX, ← hY, Quotient.eq''] + rw [← hX, ← hY, Quotient.eq] exact Relation.ReflTransGen.single (Or.inl ⟨f⟩) subst this exact ⟨Sigma.SigmaHom.mk f, rfl⟩ diff --git a/Mathlib/CategoryTheory/Limits/Shapes/SingleObj.lean b/Mathlib/CategoryTheory/Limits/Shapes/SingleObj.lean index e501871d0f757..a4e8274b8176e 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/SingleObj.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/SingleObj.lean @@ -75,7 +75,7 @@ variable {G : Type v} [Group G] (J : SingleObj G ⥤ Type u) equivalent to the `MulAction.orbitRel` equivalence relation on `J.obj (SingleObj.star G)`. -/ lemma Types.Quot.Rel.iff_orbitRel (x y : J.obj (SingleObj.star G)) : Types.Quot.Rel J ⟨SingleObj.star G, x⟩ ⟨SingleObj.star G, y⟩ - ↔ Setoid.Rel (MulAction.orbitRel G (J.obj (SingleObj.star G))) x y := by + ↔ MulAction.orbitRel G (J.obj (SingleObj.star G)) x y := by have h (g : G) : y = g • x ↔ g • x = y := ⟨symm, symm⟩ conv => rhs; rw [Setoid.comm'] show (∃ g : G, y = g • x) ↔ (∃ g : G, g • x = y) diff --git a/Mathlib/CategoryTheory/Limits/Types.lean b/Mathlib/CategoryTheory/Limits/Types.lean index 1b69256ba80da..0bb2cae4396ed 100644 --- a/Mathlib/CategoryTheory/Limits/Types.lean +++ b/Mathlib/CategoryTheory/Limits/Types.lean @@ -330,7 +330,7 @@ def Quot (F : J ⥤ Type u) : Type (max v u) := _root_.Quot (Quot.Rel F) instance [Small.{u} J] (F : J ⥤ Type u) : Small.{u} (Quot F) := - small_of_surjective (surjective_quot_mk _) + small_of_surjective Quot.surjective_mk /-- Inclusion into the quotient type implementing the colimit. -/ def Quot.ι (F : J ⥤ Type u) (j : J) : F.obj j → Quot F := diff --git a/Mathlib/CategoryTheory/Skeletal.lean b/Mathlib/CategoryTheory/Skeletal.lean index 3260b8eb2fa9b..160ad31563050 100644 --- a/Mathlib/CategoryTheory/Skeletal.lean +++ b/Mathlib/CategoryTheory/Skeletal.lean @@ -67,7 +67,7 @@ variable (C D) /-- Construct the skeleton category as the induced category on the isomorphism classes, and derive its category structure. -/ -def Skeleton : Type u₁ := InducedCategory C Quotient.out +def Skeleton : Type u₁ := InducedCategory (C := Quotient (isIsomorphicSetoid C)) C Quotient.out instance [Inhabited C] : Inhabited (Skeleton C) := ⟨⟦default⟧⟩ diff --git a/Mathlib/CategoryTheory/Subobject/Basic.lean b/Mathlib/CategoryTheory/Subobject/Basic.lean index 076606a7a3d8f..81fbb77e0c191 100644 --- a/Mathlib/CategoryTheory/Subobject/Basic.lean +++ b/Mathlib/CategoryTheory/Subobject/Basic.lean @@ -113,7 +113,7 @@ attribute [local ext] CategoryTheory.Comma protected theorem ind {X : C} (p : Subobject X → Prop) (h : ∀ ⦃A : C⦄ (f : A ⟶ X) [Mono f], p (Subobject.mk f)) (P : Subobject X) : p P := by - apply Quotient.inductionOn' + apply Quotient.inductionOn intro a exact h a.arrow @@ -121,7 +121,7 @@ protected theorem ind₂ {X : C} (p : Subobject X → Subobject X → Prop) (h : ∀ ⦃A B : C⦄ (f : A ⟶ X) (g : B ⟶ X) [Mono f] [Mono g], p (Subobject.mk f) (Subobject.mk g)) (P Q : Subobject X) : p P Q := by - apply Quotient.inductionOn₂' + apply Quotient.inductionOn₂ intro a b exact h a.arrow b.arrow @@ -134,7 +134,7 @@ protected def lift {α : Sort*} {X : C} (F : ∀ ⦃A : C⦄ (f : A ⟶ X) [Mono ∀ ⦃A B : C⦄ (f : A ⟶ X) (g : B ⟶ X) [Mono f] [Mono g] (i : A ≅ B), i.hom ≫ g = f → F f = F g) : Subobject X → α := fun P => - Quotient.liftOn' P (fun m => F m.arrow) fun m n ⟨i⟩ => + Quotient.liftOn P (fun m => F m.arrow) fun m n ⟨i⟩ => h m.arrow n.arrow ((MonoOver.forget X ⋙ Over.forget X).mapIso i) (Over.w i.hom) @[simp] @@ -232,8 +232,8 @@ theorem mk_le_mk_of_comm {B A₁ A₂ : C} {f₁ : A₁ ⟶ B} {f₂ : A₂ ⟶ @[simp] theorem mk_arrow (P : Subobject X) : mk P.arrow = P := - Quotient.inductionOn' P fun Q => by - obtain ⟨e⟩ := @Quotient.mk_out' _ (isIsomorphicSetoid _) Q + Quotient.inductionOn P fun Q => by + obtain ⟨e⟩ := @Quotient.mk_out _ (isIsomorphicSetoid _) Q exact Quotient.sound' ⟨MonoOver.isoMk (Iso.refl _) ≪≫ e⟩ theorem le_of_comm {B : C} {X Y : Subobject B} (f : (X : C) ⟶ (Y : C)) (w : f ≫ Y.arrow = X.arrow) : @@ -492,12 +492,12 @@ def pullback (f : X ⟶ Y) : Subobject Y ⥤ Subobject X := lower (MonoOver.pullback f) theorem pullback_id (x : Subobject X) : (pullback (𝟙 X)).obj x = x := by - induction' x using Quotient.inductionOn' with f + induction' x using Quotient.inductionOn with f exact Quotient.sound ⟨MonoOver.pullbackId.app f⟩ theorem pullback_comp (f : X ⟶ Y) (g : Y ⟶ Z) (x : Subobject Z) : (pullback (f ≫ g)).obj x = (pullback f).obj ((pullback g).obj x) := by - induction' x using Quotient.inductionOn' with t + induction' x using Quotient.inductionOn with t exact Quotient.sound ⟨(MonoOver.pullbackComp _ _).app t⟩ instance (f : X ⟶ Y) : (pullback f).Faithful where @@ -513,12 +513,12 @@ def map (f : X ⟶ Y) [Mono f] : Subobject X ⥤ Subobject Y := lower (MonoOver.map f) theorem map_id (x : Subobject X) : (map (𝟙 X)).obj x = x := by - induction' x using Quotient.inductionOn' with f + induction' x using Quotient.inductionOn with f exact Quotient.sound ⟨(MonoOver.mapId _).app f⟩ theorem map_comp (f : X ⟶ Y) (g : Y ⟶ Z) [Mono f] [Mono g] (x : Subobject X) : (map (f ≫ g)).obj x = (map g).obj ((map f).obj x) := by - induction' x using Quotient.inductionOn' with t + induction' x using Quotient.inductionOn with t exact Quotient.sound ⟨(MonoOver.mapComp _ _).app t⟩ /-- Isomorphic objects have equivalent subobject lattices. -/ @@ -572,7 +572,7 @@ theorem map_pullback [HasPullbacks C] {X Y Z W : C} {f : X ⟶ Y} {g : X ⟶ Z} [Mono h] [Mono g] (comm : f ≫ h = g ≫ k) (t : IsLimit (PullbackCone.mk f g comm)) (p : Subobject Y) : (map g).obj ((pullback f).obj p) = (pullback k).obj ((map h).obj p) := by revert p - apply Quotient.ind' + apply Quotient.ind intro a apply Quotient.sound apply ThinSkeleton.equiv_of_both_ways diff --git a/Mathlib/CategoryTheory/Subobject/FactorThru.lean b/Mathlib/CategoryTheory/Subobject/FactorThru.lean index 5ad249474de0f..875851beed17e 100644 --- a/Mathlib/CategoryTheory/Subobject/FactorThru.lean +++ b/Mathlib/CategoryTheory/Subobject/FactorThru.lean @@ -54,7 +54,7 @@ namespace Subobject Given `h : P.Factors f`, you can recover the morphism as `P.factorThru f h`. -/ def Factors {X Y : C} (P : Subobject Y) (f : X ⟶ Y) : Prop := - Quotient.liftOn' P (fun P => P.Factors f) + Quotient.liftOn P (fun P => P.Factors f) (by rintro P Q ⟨h⟩ apply propext @@ -84,7 +84,7 @@ theorem factors_comp_arrow {X Y : C} {P : Subobject Y} (f : X ⟶ P) : P.Factors theorem factors_of_factors_right {X Y Z : C} {P : Subobject Z} (f : X ⟶ Y) {g : Y ⟶ Z} (h : P.Factors g) : P.Factors (f ≫ g) := by - induction' P using Quotient.ind' with P + induction' P using Quotient.ind with P obtain ⟨g, rfl⟩ := h exact ⟨f ≫ g, by simp⟩ diff --git a/Mathlib/CategoryTheory/Subobject/Lattice.lean b/Mathlib/CategoryTheory/Subobject/Lattice.lean index ac8612b0e93bd..aba907b0c3638 100644 --- a/Mathlib/CategoryTheory/Subobject/Lattice.lean +++ b/Mathlib/CategoryTheory/Subobject/Lattice.lean @@ -194,9 +194,9 @@ namespace Subobject section OrderTop instance orderTop {X : C} : OrderTop (Subobject X) where - top := Quotient.mk'' ⊤ + top := ⟦⊤⟧ le_top := by - refine Quotient.ind' fun f => ?_ + refine Quotient.ind fun f => ?_ exact ⟨MonoOver.leTop f⟩ instance {X : C} : Inhabited (Subobject X) := @@ -260,9 +260,9 @@ section OrderBot variable [HasInitial C] [InitialMonoClass C] instance orderBot {X : C} : OrderBot (Subobject X) where - bot := Quotient.mk'' ⊥ + bot := ⟦⊥⟧ bot_le := by - refine Quotient.ind' fun f => ?_ + refine Quotient.ind fun f => ?_ exact ⟨MonoOver.botLE f⟩ theorem bot_eq_initial_to {B : C} : (⊥ : Subobject B) = Subobject.mk (initial.to B) := @@ -335,13 +335,13 @@ def inf {A : C} : Subobject A ⥤ Subobject A ⥤ Subobject A := ThinSkeleton.map₂ MonoOver.inf theorem inf_le_left {A : C} (f g : Subobject A) : (inf.obj f).obj g ≤ f := - Quotient.inductionOn₂' f g fun _ _ => ⟨MonoOver.infLELeft _ _⟩ + Quotient.inductionOn₂ f g fun _ _ => ⟨MonoOver.infLELeft _ _⟩ theorem inf_le_right {A : C} (f g : Subobject A) : (inf.obj f).obj g ≤ g := - Quotient.inductionOn₂' f g fun _ _ => ⟨MonoOver.infLERight _ _⟩ + Quotient.inductionOn₂ f g fun _ _ => ⟨MonoOver.infLERight _ _⟩ theorem le_inf {A : C} (h f g : Subobject A) : h ≤ f → h ≤ g → h ≤ (inf.obj f).obj g := - Quotient.inductionOn₃' h f g + Quotient.inductionOn₃ h f g (by rintro f g h ⟨k⟩ ⟨l⟩ exact ⟨MonoOver.leInf _ _ _ k l⟩) @@ -365,7 +365,7 @@ theorem inf_factors {A B : C} {X Y : Subobject B} (f : A ⟶ B) : (X ⊓ Y).Factors f ↔ X.Factors f ∧ Y.Factors f := ⟨fun h => ⟨factors_left_of_inf_factors h, factors_right_of_inf_factors h⟩, by revert X Y - apply Quotient.ind₂' + apply Quotient.ind₂ rintro X Y ⟨⟨g₁, rfl⟩, ⟨g₂, hg₂⟩⟩ exact ⟨_, pullback.lift_snd_assoc _ _ hg₂ _⟩⟩ @@ -401,13 +401,13 @@ theorem finset_inf_arrow_factors {I : Type*} {B : C} (s : Finset I) (P : I → S exact ih _ m theorem inf_eq_map_pullback' {A : C} (f₁ : MonoOver A) (f₂ : Subobject A) : - (Subobject.inf.obj (Quotient.mk'' f₁)).obj f₂ = + (Subobject.inf.obj ⟦f₁⟧).obj f₂ = (Subobject.map f₁.arrow).obj ((Subobject.pullback f₁.arrow).obj f₂) := by - induction' f₂ using Quotient.inductionOn' with f₂ + induction' f₂ using Quotient.inductionOn with f₂ rfl theorem inf_eq_map_pullback {A : C} (f₁ : MonoOver A) (f₂ : Subobject A) : - (Quotient.mk'' f₁ ⊓ f₂ : Subobject A) = (map f₁.arrow).obj ((pullback f₁.arrow).obj f₂) := + (⟦f₁⟧ ⊓ f₂ : Subobject A) = (map f₁.arrow).obj ((pullback f₁.arrow).obj f₂) := inf_eq_map_pullback' f₁ f₂ theorem prod_eq_inf {A : C} {f₁ f₂ : Subobject A} [HasBinaryProduct f₁ f₂] : @@ -424,7 +424,7 @@ theorem inf_def {B : C} (m m' : Subobject B) : m ⊓ m' = (inf.obj m).obj m' := theorem inf_pullback {X Y : C} (g : X ⟶ Y) (f₁ f₂) : (pullback g).obj (f₁ ⊓ f₂) = (pullback g).obj f₁ ⊓ (pullback g).obj f₂ := by revert f₁ - apply Quotient.ind' + apply Quotient.ind intro f₁ erw [inf_def, inf_def, inf_eq_map_pullback', inf_eq_map_pullback', ← pullback_comp, ← map_pullback pullback.condition (pullbackIsPullback f₁.arrow g), ← pullback_comp, @@ -435,7 +435,7 @@ theorem inf_pullback {X Y : C} (g : X ⟶ Y) (f₁ f₂) : theorem inf_map {X Y : C} (g : Y ⟶ X) [Mono g] (f₁ f₂) : (map g).obj (f₁ ⊓ f₂) = (map g).obj f₁ ⊓ (map g).obj f₂ := by revert f₁ - apply Quotient.ind' + apply Quotient.ind intro f₁ erw [inf_def, inf_def, inf_eq_map_pullback', inf_eq_map_pullback', ← map_comp] dsimp @@ -453,10 +453,10 @@ def sup {A : C} : Subobject A ⥤ Subobject A ⥤ Subobject A := instance semilatticeSup {B : C} : SemilatticeSup (Subobject B) where sup := fun m n => (sup.obj m).obj n - le_sup_left := fun m n => Quotient.inductionOn₂' m n fun _ _ => ⟨MonoOver.leSupLeft _ _⟩ - le_sup_right := fun m n => Quotient.inductionOn₂' m n fun _ _ => ⟨MonoOver.leSupRight _ _⟩ + le_sup_left := fun m n => Quotient.inductionOn₂ m n fun _ _ => ⟨MonoOver.leSupLeft _ _⟩ + le_sup_right := fun m n => Quotient.inductionOn₂ m n fun _ _ => ⟨MonoOver.leSupRight _ _⟩ sup_le := fun m n k => - Quotient.inductionOn₃' m n k fun _ _ _ ⟨i⟩ ⟨j⟩ => ⟨MonoOver.supLe _ _ _ i j⟩ + Quotient.inductionOn₃ m n k fun _ _ _ ⟨i⟩ ⟨j⟩ => ⟨MonoOver.supLe _ _ _ i j⟩ theorem sup_factors_of_factors_left {A B : C} {X Y : Subobject B} {f : A ⟶ B} (P : X.Factors f) : (X ⊔ Y).Factors f := diff --git a/Mathlib/Combinatorics/Quiver/ConnectedComponent.lean b/Mathlib/Combinatorics/Quiver/ConnectedComponent.lean index bbfd91a3bc4bf..3c1507b518a33 100644 --- a/Mathlib/Combinatorics/Quiver/ConnectedComponent.lean +++ b/Mathlib/Combinatorics/Quiver/ConnectedComponent.lean @@ -51,7 +51,7 @@ instance [Inhabited V] : Inhabited (WeaklyConnectedComponent V) := protected theorem eq (a b : V) : (a : WeaklyConnectedComponent V) = b ↔ Nonempty (@Path (Symmetrify V) _ a b) := - Quotient.eq'' + Quotient.eq end WeaklyConnectedComponent diff --git a/Mathlib/Combinatorics/SimpleGraph/Path.lean b/Mathlib/Combinatorics/SimpleGraph/Path.lean index 92eb6a099cf29..d48e0ee06eb93 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Path.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Path.lean @@ -844,11 +844,11 @@ protected theorem lift_mk {β : Sort*} {f : V → β} protected theorem «exists» {p : G.ConnectedComponent → Prop} : (∃ c : G.ConnectedComponent, p c) ↔ ∃ v, p (G.connectedComponentMk v) := - (surjective_quot_mk G.Reachable).exists + Quot.surjective_mk.exists protected theorem «forall» {p : G.ConnectedComponent → Prop} : (∀ c : G.ConnectedComponent, p c) ↔ ∀ v, p (G.connectedComponentMk v) := - (surjective_quot_mk G.Reachable).forall + Quot.surjective_mk.forall theorem _root_.SimpleGraph.Preconnected.subsingleton_connectedComponent (h : G.Preconnected) : Subsingleton G.ConnectedComponent := diff --git a/Mathlib/Computability/Reduce.lean b/Mathlib/Computability/Reduce.lean index 32ee465296600..a570e9f546228 100644 --- a/Mathlib/Computability/Reduce.lean +++ b/Mathlib/Computability/Reduce.lean @@ -304,19 +304,19 @@ namespace ManyOneDegree /-- The many-one degree of a set on a primcodable type. -/ def of (p : α → Prop) : ManyOneDegree := - Quotient.mk'' (toNat p) + ⟦toNat p⟧ @[elab_as_elim] protected theorem ind_on {C : ManyOneDegree → Prop} (d : ManyOneDegree) (h : ∀ p : Set ℕ, C (of p)) : C d := - Quotient.inductionOn' d h + Quotient.inductionOn d h /-- Lifts a function on sets of natural numbers to many-one degrees. -/ -- @[elab_as_elim] -- Porting note: unexpected eliminator resulting type protected abbrev liftOn {φ} (d : ManyOneDegree) (f : Set ℕ → φ) (h : ∀ p q, ManyOneEquiv p q → f p = f q) : φ := - Quotient.liftOn' d f h + Quotient.liftOn d f h @[simp] protected theorem liftOn_eq {φ} (p : Set ℕ) (f : Set ℕ → φ) @@ -344,7 +344,7 @@ protected theorem liftOn₂_eq {φ} (p q : Set ℕ) (f : Set ℕ → Set ℕ → @[simp] theorem of_eq_of {p : α → Prop} {q : β → Prop} : of p = of q ↔ ManyOneEquiv p q := by - rw [of, of, Quotient.eq''] + rw [of, of, Quotient.eq] unfold Setoid.r simp diff --git a/Mathlib/Computability/TuringMachine.lean b/Mathlib/Computability/TuringMachine.lean index 1846c5cbefbf9..ef0226a9c4b5c 100644 --- a/Mathlib/Computability/TuringMachine.lean +++ b/Mathlib/Computability/TuringMachine.lean @@ -176,7 +176,7 @@ instance ListBlank.inhabited {Γ} [Inhabited Γ] : Inhabited (ListBlank Γ) := instance ListBlank.hasEmptyc {Γ} [Inhabited Γ] : EmptyCollection (ListBlank Γ) := ⟨Quotient.mk'' []⟩ -/-- A modified version of `Quotient.liftOn'` specialized for `ListBlank`, with the stronger +/-- A modified version of `Quotient.liftOn` specialized for `ListBlank`, with the stronger precondition `BlankExtends` instead of `BlankRel`. -/ -- Porting note: Removed `@[elab_as_elim]` protected abbrev ListBlank.liftOn {Γ} [Inhabited Γ] {α} (l : ListBlank Γ) (f : List Γ → α) @@ -190,7 +190,7 @@ def ListBlank.mk {Γ} [Inhabited Γ] : List Γ → ListBlank Γ := @[elab_as_elim] protected theorem ListBlank.induction_on {Γ} [Inhabited Γ] {p : ListBlank Γ → Prop} (q : ListBlank Γ) (h : ∀ a, p (ListBlank.mk a)) : p q := - Quotient.inductionOn' q h + Quotient.inductionOn q h /-- The head of a `ListBlank` is well defined. -/ def ListBlank.head {Γ} [Inhabited Γ] (l : ListBlank Γ) : Γ := by @@ -232,17 +232,17 @@ theorem ListBlank.cons_mk {Γ} [Inhabited Γ] (a : Γ) (l : List Γ) : @[simp] theorem ListBlank.head_cons {Γ} [Inhabited Γ] (a : Γ) : ∀ l : ListBlank Γ, (l.cons a).head = a := - Quotient.ind' fun _ ↦ rfl + Quotient.ind fun _ ↦ rfl @[simp] theorem ListBlank.tail_cons {Γ} [Inhabited Γ] (a : Γ) : ∀ l : ListBlank Γ, (l.cons a).tail = l := - Quotient.ind' fun _ ↦ rfl + Quotient.ind fun _ ↦ rfl /-- The `cons` and `head`/`tail` functions are mutually inverse, unlike in the case of `List` where this only holds for nonempty lists. -/ @[simp] theorem ListBlank.cons_head_tail {Γ} [Inhabited Γ] : ∀ l : ListBlank Γ, l.tail.cons l.head = l := by - apply Quotient.ind' + apply Quotient.ind refine fun l ↦ Quotient.sound' (Or.inr ?_) cases l · exact ⟨1, rfl⟩ @@ -274,13 +274,13 @@ theorem ListBlank.nth_mk {Γ} [Inhabited Γ] (l : List Γ) (n : ℕ) : @[simp] theorem ListBlank.nth_zero {Γ} [Inhabited Γ] (l : ListBlank Γ) : l.nth 0 = l.head := by conv => lhs; rw [← ListBlank.cons_head_tail l] - exact Quotient.inductionOn' l.tail fun l ↦ rfl + exact Quotient.inductionOn l.tail fun l ↦ rfl @[simp] theorem ListBlank.nth_succ {Γ} [Inhabited Γ] (l : ListBlank Γ) (n : ℕ) : l.nth (n + 1) = l.tail.nth n := by conv => lhs; rw [← ListBlank.cons_head_tail l] - exact Quotient.inductionOn' l.tail fun l ↦ rfl + exact Quotient.inductionOn l.tail fun l ↦ rfl @[ext] theorem ListBlank.ext {Γ} [i : Inhabited Γ] {L₁ L₂ : ListBlank Γ} : @@ -361,13 +361,13 @@ theorem ListBlank.map_mk {Γ Γ'} [Inhabited Γ] [Inhabited Γ'] (f : PointedMap theorem ListBlank.head_map {Γ Γ'} [Inhabited Γ] [Inhabited Γ'] (f : PointedMap Γ Γ') (l : ListBlank Γ) : (l.map f).head = f l.head := by conv => lhs; rw [← ListBlank.cons_head_tail l] - exact Quotient.inductionOn' l fun a ↦ rfl + exact Quotient.inductionOn l fun a ↦ rfl @[simp] theorem ListBlank.tail_map {Γ Γ'} [Inhabited Γ] [Inhabited Γ'] (f : PointedMap Γ Γ') (l : ListBlank Γ) : (l.map f).tail = l.tail.map f := by conv => lhs; rw [← ListBlank.cons_head_tail l] - exact Quotient.inductionOn' l fun a ↦ rfl + exact Quotient.inductionOn l fun a ↦ rfl @[simp] theorem ListBlank.map_cons {Γ Γ'} [Inhabited Γ] [Inhabited Γ'] (f : PointedMap Γ Γ') diff --git a/Mathlib/Data/Countable/Defs.lean b/Mathlib/Data/Countable/Defs.lean index 0a88d9a4a535f..26512526f4c16 100644 --- a/Mathlib/Data/Countable/Defs.lean +++ b/Mathlib/Data/Countable/Defs.lean @@ -106,7 +106,7 @@ instance Prop.countable' : Countable Prop := instance (priority := 500) Quotient.countable [Countable α] {r : α → α → Prop} : Countable (Quot r) := - (surjective_quot_mk r).countable + Quot.surjective_mk.countable instance (priority := 500) [Countable α] {s : Setoid α} : Countable (Quotient s) := (inferInstance : Countable (@Quot α _)) diff --git a/Mathlib/Data/FinEnum.lean b/Mathlib/Data/FinEnum.lean index 82688911d453d..d1d0db0de9277 100644 --- a/Mathlib/Data/FinEnum.lean +++ b/Mathlib/Data/FinEnum.lean @@ -100,7 +100,7 @@ instance fin {n} : FinEnum (Fin n) := instance Quotient.enum [FinEnum α] (s : Setoid α) [DecidableRel ((· ≈ ·) : α → α → Prop)] : FinEnum (Quotient s) := - FinEnum.ofSurjective Quotient.mk'' fun x => Quotient.inductionOn x fun x => ⟨x, rfl⟩ + FinEnum.ofSurjective (Quotient.mk _) fun x => Quotient.inductionOn x fun x => ⟨x, rfl⟩ /-- enumerate all finite sets of a given type -/ def Finset.enum [DecidableEq α] : List α → List (Finset α) diff --git a/Mathlib/Data/Finite/Basic.lean b/Mathlib/Data/Finite/Basic.lean index fdc0bab1f42de..146fedfa36b81 100644 --- a/Mathlib/Data/Finite/Basic.lean +++ b/Mathlib/Data/Finite/Basic.lean @@ -111,7 +111,7 @@ instance Vector.finite {α : Type*} [Finite α] {n : ℕ} : Finite (Vector α n) infer_instance instance Quot.finite {α : Sort*} [Finite α] (r : α → α → Prop) : Finite (Quot r) := - Finite.of_surjective _ (surjective_quot_mk r) + Finite.of_surjective _ Quot.surjective_mk instance Quotient.finite {α : Sort*} [Finite α] (s : Setoid α) : Finite (Quotient s) := Quot.finite _ diff --git a/Mathlib/Data/Fintype/Basic.lean b/Mathlib/Data/Fintype/Basic.lean index 8461081c88f2c..fa16f55b7d5a4 100644 --- a/Mathlib/Data/Fintype/Basic.lean +++ b/Mathlib/Data/Fintype/Basic.lean @@ -987,7 +987,7 @@ end Fintype instance Quotient.fintype [Fintype α] (s : Setoid α) [DecidableRel ((· ≈ ·) : α → α → Prop)] : Fintype (Quotient s) := - Fintype.ofSurjective Quotient.mk'' Quotient.surjective_Quotient_mk'' + Fintype.ofSurjective (Quotient.mk _) Quotient.surjective_mk instance PSigma.fintypePropLeft {α : Prop} {β : α → Type*} [Decidable α] [∀ a, Fintype (β a)] : Fintype (Σ'a, β a) := diff --git a/Mathlib/Data/Fintype/Card.lean b/Mathlib/Data/Fintype/Card.lean index c2ac99212e5f5..d15b4384221f4 100644 --- a/Mathlib/Data/Fintype/Card.lean +++ b/Mathlib/Data/Fintype/Card.lean @@ -788,11 +788,11 @@ theorem Fintype.card_compl_eq_card_compl [Finite α] (p q : α → Prop) [Fintyp theorem Fintype.card_quotient_le [Fintype α] (s : Setoid α) [DecidableRel ((· ≈ ·) : α → α → Prop)] : Fintype.card (Quotient s) ≤ Fintype.card α := - Fintype.card_le_of_surjective _ (surjective_quotient_mk' _) + Fintype.card_le_of_surjective _ Quotient.surjective_mk' theorem Fintype.card_quotient_lt [Fintype α] {s : Setoid α} [DecidableRel ((· ≈ ·) : α → α → Prop)] {x y : α} (h1 : x ≠ y) (h2 : x ≈ y) : Fintype.card (Quotient s) < Fintype.card α := - Fintype.card_lt_of_surjective_not_injective _ (surjective_quotient_mk' _) fun w => + Fintype.card_lt_of_surjective_not_injective _ Quotient.surjective_mk' fun w => h1 (w <| Quotient.eq.mpr h2) theorem univ_eq_singleton_of_card_one {α} [Fintype α] (x : α) (h : Fintype.card α = 1) : @@ -935,7 +935,7 @@ instance [Nonempty α] : Infinite (Multiset α) := Infinite.of_injective (fun n => Multiset.replicate n x) (Multiset.replicate_left_injective _) instance [Nonempty α] : Infinite (List α) := - Infinite.of_surjective ((↑) : List α → Multiset α) (surjective_quot_mk _) + Infinite.of_surjective ((↑) : List α → Multiset α) Quot.surjective_mk instance String.infinite : Infinite String := Infinite.of_injective (String.mk) <| by diff --git a/Mathlib/Data/Fintype/Quotient.lean b/Mathlib/Data/Fintype/Quotient.lean index 83851ba7b8a46..552249d8657b4 100644 --- a/Mathlib/Data/Fintype/Quotient.lean +++ b/Mathlib/Data/Fintype/Quotient.lean @@ -82,7 +82,7 @@ theorem Quotient.finChoice_eq {ι : Type*} [DecidableEq ι] [Fintype ι] {α : truncation type, then there is corresponding term in the truncation of the product. -/ def Trunc.finChoice {ι : Type*} [DecidableEq ι] [Fintype ι] {α : ι → Type*} (f : ∀ i, Trunc (α i)) : Trunc (∀ i, α i) := - Quotient.map' id (fun _ _ _ => trivial) + Quotient.map id (fun _ _ _ => trivial) (Quotient.finChoice f (S := fun _ => trueSetoid)) theorem Trunc.finChoice_eq {ι : Type*} [DecidableEq ι] [Fintype ι] {α : ι → Type*} diff --git a/Mathlib/Data/List/Cycle.lean b/Mathlib/Data/List/Cycle.lean index d24bebc4562cc..595f3bb7a708d 100644 --- a/Mathlib/Data/List/Cycle.lean +++ b/Mathlib/Data/List/Cycle.lean @@ -413,13 +413,15 @@ theorem coe_eq_coe {l₁ l₂ : List α} : (l₁ : Cycle α) = (l₂ : Cycle α) @Quotient.eq _ (IsRotated.setoid _) _ _ @[simp] -theorem mk_eq_coe (l : List α) : Quot.mk _ l = (l : Cycle α) := +theorem quotMk_eq_coe (l : List α) : Quot.mk _ l = (l : Cycle α) := rfl @[simp] -theorem mk''_eq_coe (l : List α) : Quotient.mk'' l = (l : Cycle α) := +theorem mk_eq_coe (l : List α) : ⟦l⟧ = (l : Cycle α) := rfl +@[deprecated (since := "2024-08-28")] alias mk''_eq_coe := mk_eq_coe + theorem coe_cons_eq_coe_append (l : List α) (a : α) : (↑(a :: l) : Cycle α) = (↑(l ++ [a]) : Cycle α) := Quot.sound ⟨1, by rw [rotate_cons_succ, rotate_zero]⟩ @@ -451,8 +453,8 @@ instance : Inhabited (Cycle α) := @[elab_as_elim, induction_eliminator] theorem induction_on {C : Cycle α → Prop} (s : Cycle α) (H0 : C nil) (HI : ∀ (a) (l : List α), C ↑l → C ↑(a :: l)) : C s := - Quotient.inductionOn' s fun l => by - refine List.recOn l ?_ ?_ <;> simp only [mk''_eq_coe, coe_nil] + Quotient.inductionOn s fun l => by + refine List.recOn l ?_ ?_ <;> simp only [mk_eq_coe, coe_nil] assumption' /-- For `x : α`, `s : Cycle α`, `x ∈ s` indicates that `x` occurs at least once in `s`. -/ @@ -471,10 +473,10 @@ theorem not_mem_nil : ∀ a, a ∉ @nil α := List.not_mem_nil instance [DecidableEq α] : DecidableEq (Cycle α) := fun s₁ s₂ => - Quotient.recOnSubsingleton₂' s₁ s₂ fun _ _ => decidable_of_iff' _ Quotient.eq'' + Quotient.recOnSubsingleton₂ s₁ s₂ fun _ _ => decidable_of_iff' _ Quotient.eq instance [DecidableEq α] (x : α) (s : Cycle α) : Decidable (x ∈ s) := - Quotient.recOnSubsingleton' s fun l => show Decidable (x ∈ l) from inferInstance + Quotient.recOnSubsingleton s fun l => show Decidable (x ∈ l) from inferInstance /-- Reverse a `s : Cycle α` by reversing the underlying `List`. -/ nonrec def reverse (s : Cycle α) : Cycle α := @@ -527,7 +529,7 @@ theorem subsingleton_reverse_iff {s : Cycle α} : s.reverse.Subsingleton ↔ s.S theorem Subsingleton.congr {s : Cycle α} (h : Subsingleton s) : ∀ ⦃x⦄ (_hx : x ∈ s) ⦃y⦄ (_hy : y ∈ s), x = y := by - induction' s using Quot.inductionOn with l + induction' s using Quotient.inductionOn with l simp only [length_subsingleton_iff, length_coe, mk_eq_coe, le_iff_lt_or_eq, Nat.lt_add_one_iff, length_eq_zero, length_eq_one, Nat.not_lt_zero, false_or_iff] at h rcases h with (rfl | ⟨z, rfl⟩) <;> simp @@ -555,7 +557,7 @@ theorem nontrivial_reverse_iff {s : Cycle α} : s.reverse.Nontrivial ↔ s.Nontr theorem length_nontrivial {s : Cycle α} (h : Nontrivial s) : 2 ≤ length s := by obtain ⟨x, y, hxy, hx, hy⟩ := h - induction' s using Quot.inductionOn with l + induction' s using Quotient.inductionOn with l rcases l with (_ | ⟨hd, _ | ⟨hd', tl⟩⟩) · simp at hx · simp only [mem_coe_iff, mk_eq_coe, mem_singleton] at hx hy @@ -587,14 +589,14 @@ theorem Subsingleton.nodup {s : Cycle α} (h : Subsingleton s) : Nodup s := by theorem Nodup.nontrivial_iff {s : Cycle α} (h : Nodup s) : Nontrivial s ↔ ¬Subsingleton s := by rw [length_subsingleton_iff] - induction s using Quotient.inductionOn' - simp only [mk''_eq_coe, nodup_coe_iff] at h + induction s using Quotient.inductionOn + simp only [mk_eq_coe, nodup_coe_iff] at h simp [h, Nat.succ_le_iff] /-- The `s : Cycle α` as a `Multiset α`. -/ def toMultiset (s : Cycle α) : Multiset α := - Quotient.liftOn' s (↑) fun _ _ h => Multiset.coe_eq_coe.mpr h.perm + Quotient.liftOn s (↑) fun _ _ h => Multiset.coe_eq_coe.mpr h.perm @[simp] theorem coe_toMultiset (l : List α) : (l : Cycle α).toMultiset = l := @@ -606,15 +608,15 @@ theorem nil_toMultiset : nil.toMultiset = (0 : Multiset α) := @[simp] theorem card_toMultiset (s : Cycle α) : Multiset.card s.toMultiset = s.length := - Quotient.inductionOn' s (by simp) + Quotient.inductionOn s (by simp) @[simp] theorem toMultiset_eq_nil {s : Cycle α} : s.toMultiset = 0 ↔ s = Cycle.nil := - Quotient.inductionOn' s (by simp) + Quotient.inductionOn s (by simp) /-- The lift of `list.map`. -/ def map {β : Type*} (f : α → β) : Cycle α → Cycle β := - Quotient.map' (List.map f) fun _ _ h => h.map _ + Quotient.map (List.map f) fun _ _ h => h.map _ @[simp] theorem map_nil {β : Type*} (f : α → β) : map f nil = nil := @@ -626,16 +628,16 @@ theorem map_coe {β : Type*} (f : α → β) (l : List α) : map f ↑l = List.m @[simp] theorem map_eq_nil {β : Type*} (f : α → β) (s : Cycle α) : map f s = nil ↔ s = nil := - Quotient.inductionOn' s (by simp) + Quotient.inductionOn s (by simp) @[simp] theorem mem_map {β : Type*} {f : α → β} {b : β} {s : Cycle α} : b ∈ s.map f ↔ ∃ a, a ∈ s ∧ f a = b := - Quotient.inductionOn' s (by simp) + Quotient.inductionOn s (by simp) /-- The `Multiset` of lists that can make the cycle. -/ def lists (s : Cycle α) : Multiset (List α) := - Quotient.liftOn' s (fun l => (l.cyclicPermutations : Multiset (List α))) fun l₁ l₂ h => by + Quotient.liftOn s (fun l => (l.cyclicPermutations : Multiset (List α))) fun l₁ l₂ h => by simpa using h.cyclicPermutations.perm @[simp] @@ -644,8 +646,8 @@ theorem lists_coe (l : List α) : lists (l : Cycle α) = ↑l.cyclicPermutations @[simp] theorem mem_lists_iff_coe_eq {s : Cycle α} {l : List α} : l ∈ s.lists ↔ (l : Cycle α) = s := - Quotient.inductionOn' s fun l => by - rw [lists, Quotient.liftOn'_mk''] + Quotient.inductionOn s fun l => by + rw [lists, Quotient.liftOn_mk] simp @[simp] @@ -676,7 +678,7 @@ instance {s : Cycle α} : Decidable (Nodup s) := instance fintypeNodupCycle [Fintype α] : Fintype { s : Cycle α // s.Nodup } := Fintype.ofSurjective (fun l : { l : List α // l.Nodup } => ⟨l.val, by simpa using l.prop⟩) fun ⟨s, hs⟩ => by - induction' s using Quotient.inductionOn' with s hs + induction' s using Quotient.inductionOn with s hs exact ⟨⟨s, hs⟩, by simp⟩ instance fintypeNodupNontrivialCycle [Fintype α] : @@ -704,7 +706,7 @@ theorem nil_toFinset : (@nil α).toFinset = ∅ := @[simp] theorem toFinset_eq_nil {s : Cycle α} : s.toFinset = ∅ ↔ s = Cycle.nil := - Quotient.inductionOn' s (by simp) + Quotient.inductionOn s (by simp) /-- Given a `s : Cycle α` such that `Nodup s`, retrieve the next element after `x ∈ s`. -/ nonrec def next : ∀ (s : Cycle α) (_hs : Nodup s) (x : α) (_hx : x ∈ s), α := fun s => @@ -729,7 +731,7 @@ nonrec def prev : ∀ (s : Cycle α) (_hs : Nodup s) (x : α) (_hx : x ∈ s), -- Porting note: removed `simp` and added `prev_reverse_eq_next'` with `simp` attribute nonrec theorem prev_reverse_eq_next (s : Cycle α) : ∀ (hs : Nodup s) (x : α) (hx : x ∈ s), s.reverse.prev (nodup_reverse_iff.mpr hs) x (mem_reverse_iff.mpr hx) = s.next hs x hx := - Quotient.inductionOn' s prev_reverse_eq_next + Quotient.inductionOn s prev_reverse_eq_next @[simp] nonrec theorem prev_reverse_eq_next' (s : Cycle α) (hs : Nodup s.reverse) (x : α) @@ -759,12 +761,12 @@ theorem prev_mem (s : Cycle α) (hs : Nodup s) (x : α) (hx : x ∈ s) : s.prev @[simp] nonrec theorem prev_next (s : Cycle α) : ∀ (hs : Nodup s) (x : α) (hx : x ∈ s), s.prev hs (s.next hs x hx) (next_mem s hs x hx) = x := - Quotient.inductionOn' s prev_next + Quotient.inductionOn s prev_next @[simp] nonrec theorem next_prev (s : Cycle α) : ∀ (hs : Nodup s) (x : α) (hx : x ∈ s), s.next hs (s.prev hs x hx) (prev_mem s hs x hx) = x := - Quotient.inductionOn' s next_prev + Quotient.inductionOn s next_prev end Decidable @@ -780,7 +782,7 @@ unsafe instance [Repr α] : Repr (Cycle α) := `chain R ([a, b, c] : Cycle α) ↔ R a b ∧ R b c ∧ R c a` -/ nonrec def Chain (r : α → α → Prop) (c : Cycle α) : Prop := - Quotient.liftOn' c + Quotient.liftOn c (fun l => match l with | [] => True @@ -825,11 +827,11 @@ theorem chain_ne_nil (r : α → α → Prop) {l : List α} : theorem chain_map {β : Type*} {r : α → α → Prop} (f : β → α) {s : Cycle β} : Chain r (s.map f) ↔ Chain (fun a b => r (f a) (f b)) s := - Quotient.inductionOn' s fun l => by + Quotient.inductionOn s fun l => by cases' l with a l · rfl - dsimp only [Chain, ← mk''_eq_coe, Quotient.liftOn'_mk'', Cycle.map, Quotient.map', Quot.map, - Quotient.mk'', Quotient.liftOn', Quotient.liftOn, Quot.liftOn_mk, List.map] + dsimp only [Chain, ← mk_eq_coe, Quotient.liftOn_mk, Cycle.map, Quotient.map, Quot.map, + Quotient.mk, Quotient.liftOn, Quotient.liftOn, Quot.liftOn_mk, List.map] rw [← concat_eq_append, ← List.map_concat, List.chain_map f] simp diff --git a/Mathlib/Data/Multiset/Basic.lean b/Mathlib/Data/Multiset/Basic.lean index ed2e69a1ace4b..b0b0301a7230b 100644 --- a/Mathlib/Data/Multiset/Basic.lean +++ b/Mathlib/Data/Multiset/Basic.lean @@ -229,7 +229,7 @@ theorem mem_cons_self (a : α) (s : Multiset α) : a ∈ a ::ₘ s := theorem forall_mem_cons {p : α → Prop} {a : α} {s : Multiset α} : (∀ x ∈ a ::ₘ s, p x) ↔ p a ∧ ∀ x ∈ s, p x := - Quotient.inductionOn' s fun _ => List.forall_mem_cons + Quotient.inductionOn s fun _ => List.forall_mem_cons theorem exists_cons_of_mem {s : Multiset α} {a : α} : a ∈ s → ∃ t, s = a ::ₘ t := Quot.inductionOn s fun l (h : a ∈ l) => @@ -408,11 +408,11 @@ section ToList /-- Produces a list of the elements in the multiset using choice. -/ noncomputable def toList (s : Multiset α) := - s.out' + s.out @[simp, norm_cast] theorem coe_toList (s : Multiset α) : (s.toList : Multiset α) = s := - s.out_eq' + s.out_eq @[simp] theorem toList_eq_nil {s : Multiset α} : s.toList = [] ↔ s = 0 := by @@ -1018,7 +1018,7 @@ theorem map_hcongr {β' : Type v} {m : Multiset α} {f : α → β} {f' : α → theorem forall_mem_map_iff {f : α → β} {p : β → Prop} {s : Multiset α} : (∀ y ∈ s.map f, p y) ↔ ∀ x ∈ s, p (f x) := - Quotient.inductionOn' s fun _L => List.forall_mem_map + Quotient.inductionOn s fun _L => List.forall_mem_map @[simp, norm_cast] lemma map_coe (f : α → β) (l : List α) : map f l = l.map f := rfl diff --git a/Mathlib/Data/Quot.lean b/Mathlib/Data/Quot.lean index e17474cc74503..26792337346c8 100644 --- a/Mathlib/Data/Quot.lean +++ b/Mathlib/Data/Quot.lean @@ -1,7 +1,7 @@ /- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. -Authors: Johannes Hölzl +Authors: Johannes Hölzl, Yuyang Zhao -/ import Mathlib.Init.Data.Quot import Mathlib.Logic.Relator @@ -10,8 +10,11 @@ import Mathlib.Util.Notation3 /-! # Quotient types + This module extends the core library's treatment of quotient types (`Init.Core`). + ## Tags + quotient -/ @@ -19,8 +22,24 @@ variable {α : Sort*} {β : Sort*} namespace Setoid -theorem ext {α : Sort*} : ∀ {s t : Setoid α}, - (∀ a b, @Setoid.r α s a b ↔ @Setoid.r α t a b) → s = t +run_cmd Lean.Elab.Command.liftTermElabM do + Lean.Meta.registerCoercion ``Setoid.r + (some { numArgs := 2, coercee := 1, type := .coeFun }) + +instance : CoeFun (Setoid α) (fun _ ↦ α → α → Prop) where + coe := @Setoid.r _ + +lemma equiv_iff_apply {r : Setoid α} {a b : α} : a ≈ b ↔ r a b := + Iff.rfl + +instance decidableRel (r : Setoid α) [h : DecidableRel r.r] : DecidableRel r := + h + +instance [r : Setoid α] [h : DecidableRel (α := α) (· ≈ ·)] : DecidableRel r := + h + +@[ext] +theorem ext : ∀ {r s : Setoid α}, (∀ a b, r a b ↔ s a b) → r = s | ⟨r, _⟩, ⟨p, _⟩, Eq => by have : r = p := funext fun a ↦ funext fun b ↦ propext <| Eq a b subst this @@ -190,7 +209,7 @@ end Quot namespace Quotient -variable [sa : Setoid α] [sb : Setoid β] +variable {sa : Setoid α} {sb : Setoid β} variable {φ : Quotient sa → Quotient sb → Sort*} -- Porting note: in mathlib3 this notation took the Setoid as an instance-implicit argument, @@ -214,52 +233,57 @@ instance {α : Type*} [Setoid α] : IsEquiv α (· ≈ ·) where symm _ _ := Setoid.symm trans _ _ _ := Setoid.trans +instance {α : Type*} (s : Setoid α) : IsEquiv α s where + refl := Setoid.refl + symm _ _ := Setoid.symm + trans _ _ _ := Setoid.trans + /-- Induction on two `Quotient` arguments `a` and `b`, result type depends on `⟦a⟧` and `⟦b⟧`. -/ protected def hrecOn₂ (qa : Quotient sa) (qb : Quotient sb) (f : ∀ a b, φ ⟦a⟧ ⟦b⟧) - (c : ∀ a₁ b₁ a₂ b₂, a₁ ≈ a₂ → b₁ ≈ b₂ → HEq (f a₁ b₁) (f a₂ b₂)) : φ qa qb := + (c : ∀ a₁ b₁ a₂ b₂, sa a₁ a₂ → sb b₁ b₂ → HEq (f a₁ b₁) (f a₂ b₂)) : φ qa qb := Quot.hrecOn₂ qa qb f (fun p ↦ c _ _ _ _ p (Setoid.refl _)) fun p ↦ c _ _ _ _ (Setoid.refl _) p /-- Map a function `f : α → β` that sends equivalent elements to equivalent elements to a function `Quotient sa → Quotient sb`. Useful to define unary operations on quotients. -/ -protected def map (f : α → β) (h : ((· ≈ ·) ⇒ (· ≈ ·)) f f) : Quotient sa → Quotient sb := +protected def map (f : α → β) (h : (sa ⇒ sb) f f) : Quotient sa → Quotient sb := Quot.map f h @[simp] -theorem map_mk (f : α → β) (h : ((· ≈ ·) ⇒ (· ≈ ·)) f f) (x : α) : +theorem map_mk (f : α → β) (h : (sa ⇒ sb) f f) (x : α) : Quotient.map f h (⟦x⟧ : Quotient sa) = (⟦f x⟧ : Quotient sb) := rfl -variable {γ : Sort*} [sc : Setoid γ] +variable {γ : Sort*} {sc : Setoid γ} /-- Map a function `f : α → β → γ` that sends equivalent elements to equivalent elements to a function `f : Quotient sa → Quotient sb → Quotient sc`. Useful to define binary operations on quotients. -/ -protected def map₂ (f : α → β → γ) (h : ((· ≈ ·) ⇒ (· ≈ ·) ⇒ (· ≈ ·)) f f) : +protected def map₂ (f : α → β → γ) (h : (sa ⇒ sb ⇒ sc) f f) : Quotient sa → Quotient sb → Quotient sc := Quotient.lift₂ (fun x y ↦ ⟦f x y⟧) fun _ _ _ _ h₁ h₂ ↦ Quot.sound <| h h₁ h₂ @[simp] -theorem map₂_mk (f : α → β → γ) (h : ((· ≈ ·) ⇒ (· ≈ ·) ⇒ (· ≈ ·)) f f) (x : α) (y : β) : +theorem map₂_mk (f : α → β → γ) (h : (sa ⇒ sb ⇒ sc) f f) (x : α) (y : β) : Quotient.map₂ f h (⟦x⟧ : Quotient sa) (⟦y⟧ : Quotient sb) = (⟦f x y⟧ : Quotient sc) := rfl -instance lift.decidablePred (f : α → Prop) (h : ∀ a b, a ≈ b → f a = f b) [DecidablePred f] : +instance lift.decidablePred (f : α → Prop) (h : ∀ a b, sa a b → f a = f b) [DecidablePred f] : DecidablePred (Quotient.lift f h) := Quot.lift.decidablePred _ _ _ /-- Note that this provides `DecidableRel (Quotient.lift₂ f h)` when `α = β`. -/ instance lift₂.decidablePred (f : α → β → Prop) - (h : ∀ a₁ b₁ a₂ b₂, a₁ ≈ a₂ → b₁ ≈ b₂ → f a₁ b₁ = f a₂ b₂) + (h : ∀ a₁ b₁ a₂ b₂, sa a₁ a₂ → sb b₁ b₂ → f a₁ b₁ = f a₂ b₂) [hf : ∀ a, DecidablePred (f a)] (q₁ : Quotient sa) : DecidablePred (Quotient.lift₂ f h q₁) := fun q₂ ↦ Quotient.recOnSubsingleton₂ q₁ q₂ hf -instance (q : Quotient sa) (f : α → Prop) (h : ∀ a b, a ≈ b → f a = f b) [DecidablePred f] : +instance (q : Quotient sa) (f : α → Prop) (h : ∀ a b, sa a b → f a = f b) [DecidablePred f] : Decidable (Quotient.liftOn q f h) := Quotient.lift.decidablePred _ _ _ instance (q₁ : Quotient sa) (q₂ : Quotient sb) (f : α → β → Prop) - (h : ∀ a₁ b₁ a₂ b₂, a₁ ≈ a₂ → b₁ ≈ b₂ → f a₁ b₁ = f a₂ b₂) [∀ a, DecidablePred (f a)] : + (h : ∀ a₁ b₁ a₂ b₂, sa a₁ a₂ → sb b₁ b₂ → f a₁ b₁ = f a₂ b₂) [∀ a, DecidablePred (f a)] : Decidable (Quotient.liftOn₂ q₁ q₂ f h) := Quotient.lift₂.decidablePred _ _ _ _ @@ -270,7 +294,7 @@ theorem Quot.eq {α : Type*} {r : α → α → Prop} {x y : α} : ⟨Quot.eqvGen_exact r, Quot.eqvGen_sound⟩ @[simp] -theorem Quotient.eq [r : Setoid α] {x y : α} : Quotient.mk r x = ⟦y⟧ ↔ x ≈ y := +theorem Quotient.eq {r : Setoid α} {x y : α} : Quotient.mk r x = ⟦y⟧ ↔ r x y := ⟨Quotient.exact, Quotient.sound⟩ theorem Quotient.forall {α : Sort*} {s : Setoid α} {p : Quotient s → Prop} : @@ -282,47 +306,79 @@ theorem Quotient.exists {α : Sort*} {s : Setoid α} {p : Quotient s → Prop} : ⟨fun ⟨q, hq⟩ ↦ q.ind (motive := (p · → _)) .intro hq, fun ⟨a, ha⟩ ↦ ⟨⟦a⟧, ha⟩⟩ @[simp] -theorem Quotient.lift_mk [s : Setoid α] (f : α → β) (h : ∀ a b : α, a ≈ b → f a = f b) (x : α) : - Quotient.lift f h (Quotient.mk s x) = f x := +theorem Quotient.lift_mk {s : Setoid α} (f : α → β) (h : ∀ a b : α, s a b → f a = f b) (x : α) : + Quotient.lift f h ⟦x⟧ = f x := rfl @[simp] -theorem Quotient.lift_comp_mk [Setoid α] (f : α → β) (h : ∀ a b : α, a ≈ b → f a = f b) : +theorem Quotient.lift_comp_mk {s : Setoid α} (f : α → β) (h : ∀ a b : α, s a b → f a = f b) : Quotient.lift f h ∘ Quotient.mk _ = f := rfl @[simp] -theorem Quotient.lift₂_mk {α : Sort*} {β : Sort*} {γ : Sort*} [Setoid α] [Setoid β] +theorem Quotient.lift₂_mk {α : Sort*} {β : Sort*} {γ : Sort*} {sa : Setoid α} {sb : Setoid β} (f : α → β → γ) - (h : ∀ (a₁ : α) (a₂ : β) (b₁ : α) (b₂ : β), a₁ ≈ b₁ → a₂ ≈ b₂ → f a₁ a₂ = f b₁ b₂) + (h : ∀ (a₁ : α) (a₂ : β) (b₁ : α) (b₂ : β), sa a₁ b₁ → sb a₂ b₂ → f a₁ a₂ = f b₁ b₂) (a : α) (b : β) : - Quotient.lift₂ f h (Quotient.mk _ a) (Quotient.mk _ b) = f a b := + Quotient.lift₂ f h ⟦a⟧ ⟦b⟧ = f a b := + rfl + +theorem Quotient.liftOn_mk {s : Setoid α} (f : α → β) (h : ∀ a b : α, s a b → f a = f b) (x : α) : + Quotient.liftOn ⟦x⟧ f h = f x := rfl -theorem Quotient.liftOn_mk [s : Setoid α] (f : α → β) (h : ∀ a b : α, a ≈ b → f a = f b) (x : α) : - Quotient.liftOn (Quotient.mk s x) f h = f x := +@[simp] +theorem Quotient.liftOn₂_mk {α : Sort*} {β : Sort*} {γ : Sort*} {sa : Setoid α} {sb : Setoid β} + (f : α → β → γ) + (h : ∀ a₁ a₂ b₁ b₂, sa a₁ b₁ → sb a₂ b₂ → f a₁ a₂ = f b₁ b₂) (x : α) (y : β) : + Quotient.liftOn₂ ⟦x⟧ ⟦y⟧ f h = f x y := rfl @[simp] -theorem Quotient.liftOn₂_mk {α : Sort*} {β : Sort*} [Setoid α] (f : α → α → β) - (h : ∀ a₁ a₂ b₁ b₂ : α, a₁ ≈ b₁ → a₂ ≈ b₂ → f a₁ a₂ = f b₁ b₂) (x y : α) : - Quotient.liftOn₂ (Quotient.mk _ x) (Quotient.mk _ y) f h = f x y := +theorem Quotient.hrecOn_mk {s : Setoid α} {φ : Quotient s → Sort*} (f : ∀ a, φ ⟦a⟧) + (c : ∀ a₁ a₂, s a₁ a₂ → HEq (f a₁) (f a₂)) + (x : α) : ⟦x⟧.hrecOn f c = f x := + rfl + +@[simp] +theorem Quotient.hrecOn₂_mk {sa : Setoid α} {sb : Setoid α} {φ : Quotient sa → Quotient sb → Sort*} + (f : ∀ a b, φ ⟦a⟧ ⟦b⟧) + (c : ∀ a₁ b₁ a₂ b₂, sa a₁ a₂ → sb b₁ b₂ → HEq (f a₁ b₁) (f a₂ b₂)) (x : α) + (qb : Quotient sb) : + ⟦x⟧.hrecOn₂ qb f c = qb.hrecOn (f x) fun _ _ ↦ c _ _ _ _ (sa.refl _) := rfl /-- `Quot.mk r` is a surjective function. -/ -theorem surjective_quot_mk (r : α → α → Prop) : Function.Surjective (Quot.mk r) := +theorem Quot.surjective_mk {r : α → α → Prop} : Function.Surjective (Quot.mk r) := Quot.exists_rep /-- `Quotient.mk` is a surjective function. -/ -theorem surjective_quotient_mk {α : Sort*} (s : Setoid α) : +theorem Quotient.surjective_mk {s : Setoid α} : Function.Surjective (Quotient.mk s) := Quot.exists_rep -/-- `Quotient.mk'` is a surjective function. -/ -theorem surjective_quotient_mk' (α : Sort*) [s : Setoid α] : +/-- `Quotient.mk` is a surjective function. -/ +theorem Quotient.surjective_mk' [s : Setoid α] : Function.Surjective (Quotient.mk' : α → Quotient s) := Quot.exists_rep +/-- `Quot.mk r` is a surjective function. -/ +@[deprecated Quot.surjective_mk (since := "2024-08-29")] +theorem surjective_quot_mk (r : α → α → Prop) : Function.Surjective (Quot.mk r) := + Quot.exists_rep + +/-- `Quotient.mk` is a surjective function. -/ +@[deprecated Quotient.surjective_mk (since := "2024-08-29")] +theorem surjective_quotient_mk {α : Sort*} (s : Setoid α) : + Function.Surjective (Quotient.mk s) := + Quot.exists_rep + +@[deprecated (since := "2024-08-29")] alias surjective_quotient_mk' := Quotient.surjective_mk' + +@[simp] lemma Quotient.surjective_liftOn {s : Setoid α} {f : α → β} (h) : + Function.Surjective (fun x : Quotient s ↦ x.liftOn f h) ↔ Function.Surjective f := + Quot.surjective_lift _ + /-- Choose an element of the equivalence class using the axiom of choice. Sound but noncomputable. -/ noncomputable def Quot.out {r : α → α → Prop} (q : Quot r) : α := @@ -339,28 +395,28 @@ theorem Quot.out_eq {r : α → α → Prop} (q : Quot r) : Quot.mk r q.out = q /-- Choose an element of the equivalence class using the axiom of choice. Sound but noncomputable. -/ -noncomputable def Quotient.out [s : Setoid α] : Quotient s → α := +noncomputable def Quotient.out {s : Setoid α} : Quotient s → α := Quot.out @[simp] -theorem Quotient.out_eq [s : Setoid α] (q : Quotient s) : ⟦q.out⟧ = q := +theorem Quotient.out_eq {s : Setoid α} (q : Quotient s) : ⟦q.out⟧ = q := Quot.out_eq q -theorem Quotient.mk_out [Setoid α] (a : α) : ⟦a⟧.out ≈ a := +theorem Quotient.mk_out {s : Setoid α} (a : α) : s (⟦a⟧ : Quotient s).out a := Quotient.exact (Quotient.out_eq _) -theorem Quotient.mk_eq_iff_out [s : Setoid α] {x : α} {y : Quotient s} : - ⟦x⟧ = y ↔ x ≈ Quotient.out y := by +theorem Quotient.mk_eq_iff_out {s : Setoid α} {x : α} {y : Quotient s} : + ⟦x⟧ = y ↔ s x y.out := by refine Iff.trans ?_ Quotient.eq rw [Quotient.out_eq y] -theorem Quotient.eq_mk_iff_out [s : Setoid α] {x : Quotient s} {y : α} : - x = ⟦y⟧ ↔ Quotient.out x ≈ y := by +theorem Quotient.eq_mk_iff_out {s : Setoid α} {x : Quotient s} {y : α} : + x = ⟦y⟧ ↔ s x.out y := by refine Iff.trans ?_ Quotient.eq rw [Quotient.out_eq x] @[simp] -theorem Quotient.out_equiv_out {s : Setoid α} {x y : Quotient s} : x.out ≈ y.out ↔ x = y := by +theorem Quotient.out_equiv_out {s : Setoid α} {x y : Quotient s} : s x.out y.out ↔ x = y := by rw [← Quotient.eq_mk_iff_out, Quotient.out_eq] theorem Quotient.out_injective {s : Setoid α} : Function.Injective (@Quotient.out α s) := @@ -380,18 +436,18 @@ instance piSetoid {ι : Sort*} {α : ι → Sort*} [∀ i, Setoid (α i)] : Seto /-- Given a function `f : Π i, Quotient (S i)`, returns the class of functions `Π i, α i` sending each `i` to an element of the class `f i`. -/ -noncomputable def Quotient.choice {ι : Type*} {α : ι → Type*} [S : ∀ i, Setoid (α i)] +noncomputable def Quotient.choice {ι : Type*} {α : ι → Type*} {S : ∀ i, Setoid (α i)} (f : ∀ i, Quotient (S i)) : @Quotient (∀ i, α i) (by infer_instance) := ⟦fun i ↦ (f i).out⟧ @[simp] -theorem Quotient.choice_eq {ι : Type*} {α : ι → Type*} [∀ i, Setoid (α i)] (f : ∀ i, α i) : - (Quotient.choice fun i ↦ ⟦f i⟧) = ⟦f⟧ := +theorem Quotient.choice_eq {ι : Type*} {α : ι → Type*} {S : ∀ i, Setoid (α i)} (f : ∀ i, α i) : + (Quotient.choice (S := S) fun i ↦ ⟦f i⟧) = ⟦f⟧ := Quotient.sound fun _ ↦ Quotient.mk_out _ @[elab_as_elim] -theorem Quotient.induction_on_pi {ι : Type*} {α : ι → Sort*} [s : ∀ i, Setoid (α i)] +theorem Quotient.induction_on_pi {ι : Type*} {α : ι → Sort*} {s : ∀ i, Setoid (α i)} {p : (∀ i, Quotient (s i)) → Prop} (f : ∀ i, Quotient (s i)) (h : ∀ a : ∀ i, α i, p fun i ↦ ⟦a i⟧) : p f := by rw [← (funext fun i ↦ Quotient.out_eq (f i) : (fun i ↦ ⟦(f i).out⟧) = f)] @@ -533,217 +589,66 @@ namespace Quotient variable {γ : Sort*} {φ : Sort*} {s₁ : Setoid α} {s₂ : Setoid β} {s₃ : Setoid γ} -/-! Versions of quotient definitions and lemmas ending in `'` use unification instead -of typeclass inference for inferring the `Setoid` argument. This is useful when there are -several different quotient relations on a type, for example quotient groups, rings and modules. -/ - --- TODO: this whole section can probably be replaced `Quotient.mk`, with explicit parameter - --- Porting note: Quotient.mk' is the equivalent of Lean 3's `Quotient.mk` /-- A version of `Quotient.mk` taking `{s : Setoid α}` as an implicit argument instead of an instance argument. -/ -protected def mk'' (a : α) : Quotient s₁ := - Quot.mk s₁.1 a - -/-- `Quotient.mk''` is a surjective function. -/ -theorem surjective_Quotient_mk'' : Function.Surjective (Quotient.mk'' : α → Quotient s₁) := - Quot.exists_rep - -/-- A version of `Quotient.liftOn` taking `{s : Setoid α}` as an implicit argument instead of an -instance argument. -/ --- Porting note: removed `@[elab_as_elim]` because it gave "unexpected eliminator resulting type" --- porting note (#11083): removed `@[reducible]` because it caused extremely slow `simp` -protected def liftOn' (q : Quotient s₁) (f : α → φ) (h : ∀ a b, @Setoid.r α s₁ a b → f a = f b) : - φ := - Quotient.liftOn q f h - -@[simp] -protected theorem liftOn'_mk'' (f : α → φ) (h) (x : α) : - Quotient.liftOn' (@Quotient.mk'' _ s₁ x) f h = f x := - rfl - -@[simp] lemma surjective_liftOn' {f : α → φ} (h) : - Function.Surjective (fun x : Quotient s₁ ↦ x.liftOn' f h) ↔ Function.Surjective f := - Quot.surjective_lift _ - -/-- A version of `Quotient.liftOn₂` taking `{s₁ : Setoid α} {s₂ : Setoid β}` as implicit arguments -instead of instance arguments. -/ --- Porting note: removed `@[elab_as_elim]` because it gave "unexpected eliminator resulting type" --- porting note (#11083): removed `@[reducible]` because it caused extremely slow `simp` -protected def liftOn₂' (q₁ : Quotient s₁) (q₂ : Quotient s₂) (f : α → β → γ) - (h : ∀ a₁ a₂ b₁ b₂, @Setoid.r α s₁ a₁ b₁ → @Setoid.r β s₂ a₂ b₂ → f a₁ a₂ = f b₁ b₂) : γ := - Quotient.liftOn₂ q₁ q₂ f h - -@[simp] -protected theorem liftOn₂'_mk'' (f : α → β → γ) (h) (a : α) (b : β) : - Quotient.liftOn₂' (@Quotient.mk'' _ s₁ a) (@Quotient.mk'' _ s₂ b) f h = f a b := - rfl - -/-- A version of `Quotient.ind` taking `{s : Setoid α}` as an implicit argument instead of an -instance argument. -/ -@[elab_as_elim] -protected theorem ind' {p : Quotient s₁ → Prop} (h : ∀ a, p (Quotient.mk'' a)) (q : Quotient s₁) : - p q := - Quotient.ind h q - -/-- A version of `Quotient.ind₂` taking `{s₁ : Setoid α} {s₂ : Setoid β}` as implicit arguments -instead of instance arguments. -/ -@[elab_as_elim] -protected theorem ind₂' {p : Quotient s₁ → Quotient s₂ → Prop} - (h : ∀ a₁ a₂, p (Quotient.mk'' a₁) (Quotient.mk'' a₂)) - (q₁ : Quotient s₁) (q₂ : Quotient s₂) : p q₁ q₂ := - Quotient.ind₂ h q₁ q₂ - -/-- A version of `Quotient.inductionOn` taking `{s : Setoid α}` as an implicit argument instead -of an instance argument. -/ -@[elab_as_elim] -protected theorem inductionOn' {p : Quotient s₁ → Prop} (q : Quotient s₁) - (h : ∀ a, p (Quotient.mk'' a)) : p q := - Quotient.inductionOn q h - -/-- A version of `Quotient.inductionOn₂` taking `{s₁ : Setoid α} {s₂ : Setoid β}` as implicit -arguments instead of instance arguments. -/ -@[elab_as_elim] -protected theorem inductionOn₂' {p : Quotient s₁ → Quotient s₂ → Prop} (q₁ : Quotient s₁) - (q₂ : Quotient s₂) - (h : ∀ a₁ a₂, p (Quotient.mk'' a₁) (Quotient.mk'' a₂)) : p q₁ q₂ := - Quotient.inductionOn₂ q₁ q₂ h - -/-- A version of `Quotient.inductionOn₃` taking `{s₁ : Setoid α} {s₂ : Setoid β} {s₃ : Setoid γ}` -as implicit arguments instead of instance arguments. -/ -@[elab_as_elim] -protected theorem inductionOn₃' {p : Quotient s₁ → Quotient s₂ → Quotient s₃ → Prop} - (q₁ : Quotient s₁) (q₂ : Quotient s₂) (q₃ : Quotient s₃) - (h : ∀ a₁ a₂ a₃, p (Quotient.mk'' a₁) (Quotient.mk'' a₂) (Quotient.mk'' a₃)) : - p q₁ q₂ q₃ := - Quotient.inductionOn₃ q₁ q₂ q₃ h - -/-- A version of `Quotient.recOnSubsingleton` taking `{s₁ : Setoid α}` as an implicit argument -instead of an instance argument. -/ -@[elab_as_elim] -protected def recOnSubsingleton' {φ : Quotient s₁ → Sort*} [∀ a, Subsingleton (φ ⟦a⟧)] - (q : Quotient s₁) - (f : ∀ a, φ (Quotient.mk'' a)) : φ q := - Quotient.recOnSubsingleton q f - -/-- A version of `Quotient.recOnSubsingleton₂` taking `{s₁ : Setoid α} {s₂ : Setoid α}` -as implicit arguments instead of instance arguments. -/ --- porting note (#11083): removed `@[reducible]` because it caused extremely slow `simp` -@[elab_as_elim] -protected def recOnSubsingleton₂' {φ : Quotient s₁ → Quotient s₂ → Sort*} - [∀ a b, Subsingleton (φ ⟦a⟧ ⟦b⟧)] - (q₁ : Quotient s₁) (q₂ : Quotient s₂) (f : ∀ a₁ a₂, φ (Quotient.mk'' a₁) (Quotient.mk'' a₂)) : - φ q₁ q₂ := - Quotient.recOnSubsingleton₂ q₁ q₂ f - -/-- Recursion on a `Quotient` argument `a`, result type depends on `⟦a⟧`. -/ -protected def hrecOn' {φ : Quotient s₁ → Sort*} (qa : Quotient s₁) (f : ∀ a, φ (Quotient.mk'' a)) - (c : ∀ a₁ a₂, a₁ ≈ a₂ → HEq (f a₁) (f a₂)) : φ qa := - Quot.hrecOn qa f c - -@[simp] -theorem hrecOn'_mk'' {φ : Quotient s₁ → Sort*} (f : ∀ a, φ (Quotient.mk'' a)) - (c : ∀ a₁ a₂, a₁ ≈ a₂ → HEq (f a₁) (f a₂)) - (x : α) : (Quotient.mk'' x).hrecOn' f c = f x := - rfl - -/-- Recursion on two `Quotient` arguments `a` and `b`, result type depends on `⟦a⟧` and `⟦b⟧`. -/ -protected def hrecOn₂' {φ : Quotient s₁ → Quotient s₂ → Sort*} (qa : Quotient s₁) - (qb : Quotient s₂) (f : ∀ a b, φ (Quotient.mk'' a) (Quotient.mk'' b)) - (c : ∀ a₁ b₁ a₂ b₂, a₁ ≈ a₂ → b₁ ≈ b₂ → HEq (f a₁ b₁) (f a₂ b₂)) : - φ qa qb := - Quotient.hrecOn₂ qa qb f c - -@[simp] -theorem hrecOn₂'_mk'' {φ : Quotient s₁ → Quotient s₂ → Sort*} - (f : ∀ a b, φ (Quotient.mk'' a) (Quotient.mk'' b)) - (c : ∀ a₁ b₁ a₂ b₂, a₁ ≈ a₂ → b₁ ≈ b₂ → HEq (f a₁ b₁) (f a₂ b₂)) (x : α) (qb : Quotient s₂) : - (Quotient.mk'' x).hrecOn₂' qb f c = qb.hrecOn' (f x) fun _ _ ↦ c _ _ _ _ (Setoid.refl _) := - rfl - -/-- Map a function `f : α → β` that sends equivalent elements to equivalent elements -to a function `Quotient sa → Quotient sb`. Useful to define unary operations on quotients. -/ -protected def map' (f : α → β) (h : (s₁.r ⇒ s₂.r) f f) : Quotient s₁ → Quotient s₂ := - Quot.map f h - -@[simp] -theorem map'_mk'' (f : α → β) (h) (x : α) : - (Quotient.mk'' x : Quotient s₁).map' f h = (Quotient.mk'' (f x) : Quotient s₂) := - rfl - -/-- A version of `Quotient.map₂` using curly braces and unification. -/ -protected def map₂' (f : α → β → γ) (h : (s₁.r ⇒ s₂.r ⇒ s₃.r) f f) : - Quotient s₁ → Quotient s₂ → Quotient s₃ := - Quotient.map₂ f h - -@[simp] -theorem map₂'_mk'' (f : α → β → γ) (h) (x : α) : - (Quotient.mk'' x : Quotient s₁).map₂' f h = - (Quotient.map' (f x) (h (Setoid.refl x)) : Quotient s₂ → Quotient s₃) := - rfl +@[deprecated Quotient.mk (since := "2024-08-09")] protected abbrev mk'' (a : α) : Quotient s₁ := + Quotient.mk s₁ a + +@[deprecated (since := "2024-08-09")] alias surjective_Quotient_mk'' := Quotient.surjective_mk +@[deprecated (since := "2024-08-09")] protected alias liftOn' := Quotient.liftOn +@[deprecated (since := "2024-08-09")] alias liftOn'_mk'' := liftOn_mk +@[deprecated (since := "2024-08-09")] alias surjective_liftOn' := surjective_liftOn +@[deprecated (since := "2024-08-09")] protected alias liftOn₂' := Quotient.liftOn₂ +@[deprecated (since := "2024-08-09")] alias liftOn₂'_mk'' := liftOn₂_mk +@[deprecated (since := "2024-08-09")] protected alias ind' := Quotient.ind +@[deprecated (since := "2024-08-09")] protected alias ind₂' := Quotient.ind₂ +@[deprecated (since := "2024-08-09")] protected alias inductionOn' := Quotient.inductionOn +@[deprecated (since := "2024-08-09")] protected alias inductionOn₂' := Quotient.inductionOn₂ +@[deprecated (since := "2024-08-09")] protected alias inductionOn₃' := Quotient.inductionOn₃ +@[deprecated (since := "2024-08-09")] protected alias recOnSubsingleton' := + Quotient.recOnSubsingleton +@[deprecated (since := "2024-08-09")] protected alias recOnSubsingleton₂' := + Quotient.recOnSubsingleton₂ +@[deprecated (since := "2024-08-09")] protected alias hrecOn' := Quotient.hrecOn +@[deprecated (since := "2024-08-09")] alias hrecOn'_mk'' := hrecOn_mk +@[deprecated (since := "2024-08-09")] alias hrecOn₂' := Quotient.hrecOn₂ +@[deprecated (since := "2024-08-09")] alias hrecOn₂'_mk'' := hrecOn₂_mk +@[deprecated (since := "2024-08-09")] protected alias map' := Quotient.map +@[deprecated (since := "2024-08-09")] alias map'_mk'' := Quotient.map_mk +@[deprecated (since := "2024-08-09")] protected alias map₂' := Quotient.map₂ +@[deprecated (since := "2024-08-09")] alias map₂'_mk'' := map₂_mk +@[deprecated (since := "2024-08-09")] alias eq'' := eq +@[deprecated (since := "2024-08-09")] alias out' := out +@[deprecated (since := "2024-08-09")] alias out_eq' := out_eq +@[deprecated (since := "2024-08-09")] alias mk_out' := mk_out theorem exact' {a b : α} : - (Quotient.mk'' a : Quotient s₁) = Quotient.mk'' b → @Setoid.r _ s₁ a b := + (⟦a⟧ : Quotient s₁) = ⟦b⟧ → s₁ a b := Quotient.exact -theorem sound' {a b : α} : @Setoid.r _ s₁ a b → @Quotient.mk'' α s₁ a = Quotient.mk'' b := +theorem sound' {a b : α} : s₁ a b → (⟦a⟧ : Quotient s₁) = ⟦b⟧ := Quotient.sound @[simp] -protected theorem eq' [s₁ : Setoid α] {a b : α} : - @Quotient.mk' α s₁ a = @Quotient.mk' α s₁ b ↔ @Setoid.r _ s₁ a b := +protected theorem eq' [Setoid α] {a b : α} : + Quotient.mk' a = Quotient.mk' b ↔ a ≈ b := Quotient.eq -@[simp] -protected theorem eq'' {a b : α} : @Quotient.mk'' α s₁ a = Quotient.mk'' b ↔ @Setoid.r _ s₁ a b := - Quotient.eq - -/-- A version of `Quotient.out` taking `{s₁ : Setoid α}` as an implicit argument instead of an -instance argument. -/ -noncomputable def out' (a : Quotient s₁) : α := - Quotient.out a - -@[simp] -theorem out_eq' (q : Quotient s₁) : Quotient.mk'' q.out' = q := - q.out_eq - -theorem mk_out' (a : α) : @Setoid.r α s₁ (Quotient.mk'' a : Quotient s₁).out' a := - Quotient.exact (Quotient.out_eq _) - section variable [s : Setoid α] -protected theorem mk''_eq_mk : Quotient.mk'' = Quotient.mk s := +set_option linter.deprecated false in +@[deprecated (since := "2024-08-09")] protected theorem mk''_eq_mk : + Quotient.mk'' = Quotient.mk s := rfl -@[simp] -protected theorem liftOn'_mk (x : α) (f : α → β) (h) : (Quotient.mk s x).liftOn' f h = f x := - rfl - -@[simp] -protected theorem liftOn₂'_mk [t : Setoid β] (f : α → β → γ) (h) (a : α) (b : β) : - Quotient.liftOn₂' (Quotient.mk s a) (Quotient.mk t b) f h = f a b := - Quotient.liftOn₂'_mk'' _ _ _ _ - -@[simp] -theorem map'_mk [t : Setoid β] (f : α → β) (h) (x : α) : - (Quotient.mk s x).map' f h = (Quotient.mk t (f x)) := - rfl +@[deprecated (since := "2024-08-09")] alias liftOn'_mk := liftOn_mk +@[deprecated (since := "2024-08-09")] alias liftOn₂'_mk := liftOn₂_mk +@[deprecated (since := "2024-08-09")] alias map'_mk := map_mk end -instance (q : Quotient s₁) (f : α → Prop) (h : ∀ a b, @Setoid.r α s₁ a b → f a = f b) - [DecidablePred f] : - Decidable (Quotient.liftOn' q f h) := - Quotient.lift.decidablePred _ _ q - -instance (q₁ : Quotient s₁) (q₂ : Quotient s₂) (f : α → β → Prop) - (h : ∀ a₁ b₁ a₂ b₂, @Setoid.r α s₁ a₁ a₂ → @Setoid.r β s₂ b₁ b₂ → f a₁ b₁ = f a₂ b₂) - [∀ a, DecidablePred (f a)] : - Decidable (Quotient.liftOn₂' q₁ q₂ f h) := - Quotient.lift₂.decidablePred _ h _ _ - end Quotient @[simp] diff --git a/Mathlib/Data/Set/Image.lean b/Mathlib/Data/Set/Image.lean index 09b79da91cf44..c58186f7dae35 100644 --- a/Mathlib/Data/Set/Image.lean +++ b/Mathlib/Data/Set/Image.lean @@ -502,7 +502,7 @@ theorem image_subset_image_iff {f : α → β} (hf : Injective f) : f '' s ⊆ f exact preimage_mono h theorem prod_quotient_preimage_eq_image [s : Setoid α] (g : Quotient s → β) {h : α → β} - (Hh : h = g ∘ Quotient.mk'') (r : Set (β × β)) : + (Hh : h = g ∘ Quotient.mk _) (r : Set (β × β)) : { x : Quotient s × Quotient s | (g x.1, g x.2) ∈ r } = (fun a : α × α => (⟦a.1⟧, ⟦a.2⟧)) '' ((fun a : α × α => (h a.1, h a.2)) ⁻¹' r) := Hh.symm ▸ @@ -810,20 +810,19 @@ theorem image_preimage_inl_union_image_preimage_inr (s : Set (α ⊕ β)) : @[simp] theorem range_quot_mk (r : α → α → Prop) : range (Quot.mk r) = univ := - (surjective_quot_mk r).range_eq + Quot.surjective_mk.range_eq @[simp] theorem range_quot_lift {r : ι → ι → Prop} (hf : ∀ x y, r x y → f x = f y) : range (Quot.lift f hf) = range f := - ext fun _ => (surjective_quot_mk _).exists + ext fun _ => Quot.surjective_mk.exists --- Porting note: the `Setoid α` instance is not being filled in @[simp] -theorem range_quotient_mk [sa : Setoid α] : (range (α := Quotient sa) fun x : α => ⟦x⟧) = univ := +theorem range_quotient_mk {s : Setoid α} : range (Quotient.mk s) = univ := range_quot_mk _ @[simp] -theorem range_quotient_lift [s : Setoid ι] (hf) : +theorem range_quotient_lift {s : Setoid ι} (hf) : range (Quotient.lift f hf : Quotient s → α) = range f := range_quot_lift _ @@ -831,14 +830,14 @@ theorem range_quotient_lift [s : Setoid ι] (hf) : theorem range_quotient_mk' {s : Setoid α} : range (Quotient.mk' : α → Quotient s) = univ := range_quot_mk _ -@[simp] lemma Quotient.range_mk'' {sa : Setoid α} : range (Quotient.mk'' (s₁ := sa)) = univ := - range_quotient_mk - @[simp] -theorem range_quotient_lift_on' {s : Setoid ι} (hf) : - (range fun x : Quotient s => Quotient.liftOn' x f hf) = range f := +theorem range_quotient_liftOn {s : Setoid ι} (hf) : + (range fun x : Quotient s => Quotient.liftOn x f hf) = range f := range_quot_lift _ +@[deprecated (since := "2024-08-29")] alias Quotient.range_mk'' := range_quotient_mk +@[deprecated (since := "2024-08-29")] alias range_quotient_lift_on' := range_quotient_liftOn + instance canLift (c) (p) [CanLift α β c p] : CanLift (Set α) (Set β) (c '' ·) fun s => ∀ x ∈ s, p x where prf _ hs := subset_range_iff_exists_image_eq.mp fun x hx => CanLift.prf _ (hs x hx) diff --git a/Mathlib/Data/Setoid/Basic.lean b/Mathlib/Data/Setoid/Basic.lean index 294f426f6d013..014eef57baf9a 100644 --- a/Mathlib/Data/Setoid/Basic.lean +++ b/Mathlib/Data/Setoid/Basic.lean @@ -39,47 +39,38 @@ attribute [trans] Setoid.trans variable {α : Type*} {β : Type*} /-- A version of `Setoid.r` that takes the equivalence relation as an explicit argument. -/ +@[deprecated (since := "2024-08-09")] def Setoid.Rel (r : Setoid α) : α → α → Prop := @Setoid.r _ r -instance Setoid.decidableRel (r : Setoid α) [h : DecidableRel r.r] : DecidableRel r.Rel := - h - -/-- A version of `Quotient.eq'` compatible with `Setoid.Rel`, to make rewriting possible. -/ -theorem Quotient.eq_rel {r : Setoid α} {x y} : - (Quotient.mk' x : Quotient r) = Quotient.mk' y ↔ r.Rel x y := - Quotient.eq +@[deprecated (since := "2024-08-09")] alias Quotient.eq_rel := Quotient.eq namespace Setoid -@[ext] -theorem ext' {r s : Setoid α} (H : ∀ a b, r.Rel a b ↔ s.Rel a b) : r = s := - ext H - -theorem ext_iff {r s : Setoid α} : r = s ↔ ∀ a b, r.Rel a b ↔ s.Rel a b := - ⟨fun h _ _ => h ▸ Iff.rfl, ext'⟩ +@[deprecated (since := "2024-08-09")] alias ext' := ext +@[deprecated (since := "2024-08-09")] alias ext'_iff := Setoid.ext_iff /-- Two equivalence relations are equal iff their underlying binary operations are equal. -/ -theorem eq_iff_rel_eq {r₁ r₂ : Setoid α} : r₁ = r₂ ↔ r₁.Rel = r₂.Rel := - ⟨fun h => h ▸ rfl, fun h => Setoid.ext' fun _ _ => h ▸ Iff.rfl⟩ +theorem eq_iff_rel_eq {r₁ r₂ : Setoid α} : r₁ = r₂ ↔ ⇑r₁ = ⇑r₂ := + ⟨fun h => h ▸ rfl, fun h => Setoid.ext fun _ _ => h ▸ Iff.rfl⟩ /-- Defining `≤` for equivalence relations. -/ instance : LE (Setoid α) := - ⟨fun r s => ∀ ⦃x y⦄, r.Rel x y → s.Rel x y⟩ + ⟨fun r s => ∀ ⦃x y⦄, r x y → s x y⟩ -theorem le_def {r s : Setoid α} : r ≤ s ↔ ∀ {x y}, r.Rel x y → s.Rel x y := +theorem le_def {r s : Setoid α} : r ≤ s ↔ ∀ {x y}, r x y → s x y := Iff.rfl @[refl] -theorem refl' (r : Setoid α) (x) : r.Rel x x := r.iseqv.refl x +theorem refl' (r : Setoid α) (x) : r x x := r.iseqv.refl x @[symm] -theorem symm' (r : Setoid α) : ∀ {x y}, r.Rel x y → r.Rel y x := r.iseqv.symm +theorem symm' (r : Setoid α) : ∀ {x y}, r x y → r y x := r.iseqv.symm @[trans] -theorem trans' (r : Setoid α) : ∀ {x y z}, r.Rel x y → r.Rel y z → r.Rel x z := r.iseqv.trans +theorem trans' (r : Setoid α) : ∀ {x y z}, r x y → r y z → r x z := r.iseqv.trans -theorem comm' (s : Setoid α) {x y} : s.Rel x y ↔ s.Rel y x := +theorem comm' (s : Setoid α) {x y} : s x y ↔ s y x := ⟨s.symm', s.symm'⟩ /-- The kernel of a function is an equivalence relation. -/ @@ -88,17 +79,15 @@ def ker (f : α → β) : Setoid α := /-- The kernel of the quotient map induced by an equivalence relation r equals r. -/ @[simp] -theorem ker_mk_eq (r : Setoid α) : ker (@Quotient.mk'' _ r) = r := - ext' fun _ _ => Quotient.eq +theorem ker_mk_eq (r : Setoid α) : ker (Quotient.mk r) = r := + ext fun _ _ => Quotient.eq -theorem ker_apply_mk_out {f : α → β} (a : α) : f (haveI := Setoid.ker f; ⟦a⟧.out) = f a := +theorem ker_apply_mk_out {f : α → β} (a : α) : f (Quotient.mk (.ker f) a).out = f a := @Quotient.mk_out _ (Setoid.ker f) a -theorem ker_apply_mk_out' {f : α → β} (a : α) : - f (Quotient.mk _ a : Quotient <| Setoid.ker f).out' = f a := - @Quotient.mk_out' _ (Setoid.ker f) a +@[deprecated (since := "2024-08-09")] alias ker_apply_mk_out' := ker_apply_mk_out -theorem ker_def {f : α → β} {x y : α} : (ker f).Rel x y ↔ f x = f y := +theorem ker_def {f : α → β} {x y : α} : (ker f) x y ↔ f x = f y := Iff.rfl /-- Given types `α`, `β`, the product of two equivalence relations `r` on `α` and `s` on `β`: @@ -106,7 +95,7 @@ theorem ker_def {f : α → β} {x y : α} : (ker f).Rel x y ↔ f x = f y := by `r` and `x₂` is related to `y₂` by `s`. -/ protected def prod (r : Setoid α) (s : Setoid β) : Setoid (α × β) where - r x y := r.Rel x.1 y.1 ∧ s.Rel x.2 y.2 + r x y := r x.1 y.1 ∧ s x.2 y.2 iseqv := ⟨fun x => ⟨r.refl' x.1, s.refl' x.2⟩, fun h => ⟨r.symm' h.1, s.symm' h.2⟩, fun h₁ h₂ => ⟨r.trans' h₁.1 h₂.1, s.trans' h₁.2 h₂.2⟩⟩ @@ -114,28 +103,28 @@ protected def prod (r : Setoid α) (s : Setoid β) : /-- The infimum of two equivalence relations. -/ instance : Inf (Setoid α) := ⟨fun r s => - ⟨fun x y => r.Rel x y ∧ s.Rel x y, + ⟨fun x y => r x y ∧ s x y, ⟨fun x => ⟨r.refl' x, s.refl' x⟩, fun h => ⟨r.symm' h.1, s.symm' h.2⟩, fun h1 h2 => ⟨r.trans' h1.1 h2.1, s.trans' h1.2 h2.2⟩⟩⟩⟩ /-- The infimum of 2 equivalence relations r and s is the same relation as the infimum of the underlying binary operations. -/ -theorem inf_def {r s : Setoid α} : (r ⊓ s).Rel = r.Rel ⊓ s.Rel := +theorem inf_def {r s : Setoid α} : ⇑(r ⊓ s) = ⇑r ⊓ ⇑s := rfl -theorem inf_iff_and {r s : Setoid α} {x y} : (r ⊓ s).Rel x y ↔ r.Rel x y ∧ s.Rel x y := +theorem inf_iff_and {r s : Setoid α} {x y} : (r ⊓ s) x y ↔ r x y ∧ s x y := Iff.rfl /-- The infimum of a set of equivalence relations. -/ instance : InfSet (Setoid α) := ⟨fun S => - { r := fun x y => ∀ r ∈ S, r.Rel x y + { r := fun x y => ∀ r ∈ S, r x y iseqv := ⟨fun x r _ => r.refl' x, fun h r hr => r.symm' <| h r hr, fun h1 h2 r hr => r.trans' (h1 r hr) <| h2 r hr⟩ }⟩ /-- The underlying binary operation of the infimum of a set of equivalence relations is the infimum of the set's image under the map to the underlying binary operation. -/ -theorem sInf_def {s : Set (Setoid α)} : (sInf s).Rel = sInf (Rel '' s) := by +theorem sInf_def {s : Set (Setoid α)} : sInf s = sInf ((⇑) '' s) := by ext simp only [sInf_image, iInf_apply, iInf_Prop_eq] rfl @@ -146,7 +135,7 @@ instance : PartialOrder (Setoid α) where le_refl _ _ _ := id le_trans _ _ _ hr hs _ _ h := hs <| hr h lt_iff_le_not_le _ _ := Iff.rfl - le_antisymm _ _ h1 h2 := Setoid.ext' fun _ _ => ⟨fun h => h1 h, fun h => h2 h⟩ + le_antisymm _ _ h1 h2 := Setoid.ext fun _ _ => ⟨fun h => h1 h, fun h => h2 h⟩ /-- The complete lattice of equivalence relations on a type, with bottom element `=` and top element the trivial equivalence relation. -/ @@ -163,28 +152,27 @@ instance completeLattice : CompleteLattice (Setoid α) := bot_le := fun r x _ h => h ▸ r.2.1 x } @[simp] -theorem top_def : (⊤ : Setoid α).Rel = ⊤ := +theorem top_def : ⇑(⊤ : Setoid α) = ⊤ := rfl @[simp] -theorem bot_def : (⊥ : Setoid α).Rel = (· = ·) := +theorem bot_def : ⇑(⊥ : Setoid α) = (· = ·) := rfl -theorem eq_top_iff {s : Setoid α} : s = (⊤ : Setoid α) ↔ ∀ x y : α, s.Rel x y := by +theorem eq_top_iff {s : Setoid α} : s = (⊤ : Setoid α) ↔ ∀ x y : α, s x y := by rw [_root_.eq_top_iff, Setoid.le_def, Setoid.top_def] simp only [Pi.top_apply, Prop.top_eq_true, forall_true_left] lemma sInf_equiv {S : Set (Setoid α)} {x y : α} : - letI := sInf S - x ≈ y ↔ ∀ s ∈ S, s.Rel x y := Iff.rfl + sInf S x y ↔ ∀ s ∈ S, s x y := Iff.rfl lemma quotient_mk_sInf_eq {S : Set (Setoid α)} {x y : α} : - Quotient.mk (sInf S) x = Quotient.mk (sInf S) y ↔ ∀ s ∈ S, s.Rel x y := by + Quotient.mk (sInf S) x = Quotient.mk (sInf S) y ↔ ∀ s ∈ S, s x y := by simp [sInf_equiv] /-- The map induced between quotients by a setoid inequality. -/ def map_of_le {s t : Setoid α} (h : s ≤ t) : Quotient s → Quotient t := - Quotient.map' id h + Quotient.map id h /-- The map from the quotient of the infimum of a set of setoids into the quotient by an element of this set. -/ @@ -195,7 +183,7 @@ def map_sInf {S : Set (Setoid α)} {s : Setoid α} (h : s ∈ S) : /-- The inductively defined equivalence closure of a binary relation r is the infimum of the set of all equivalence relations containing r. -/ theorem eqvGen_eq (r : α → α → Prop) : - EqvGen.Setoid r = sInf { s : Setoid α | ∀ ⦃x y⦄, r x y → s.Rel x y } := + EqvGen.Setoid r = sInf { s : Setoid α | ∀ ⦃x y⦄, r x y → s x y } := le_antisymm (fun _ _ H => EqvGen.rec (fun _ _ h _ hs => hs h) (refl' _) (fun _ _ _ => symm' _) @@ -205,20 +193,20 @@ theorem eqvGen_eq (r : α → α → Prop) : /-- The supremum of two equivalence relations r and s is the equivalence closure of the binary relation `x is related to y by r or s`. -/ theorem sup_eq_eqvGen (r s : Setoid α) : - r ⊔ s = EqvGen.Setoid fun x y => r.Rel x y ∨ s.Rel x y := by + r ⊔ s = EqvGen.Setoid fun x y => r x y ∨ s x y := by rw [eqvGen_eq] apply congr_arg sInf simp only [le_def, or_imp, ← forall_and] /-- The supremum of 2 equivalence relations r and s is the equivalence closure of the supremum of the underlying binary operations. -/ -theorem sup_def {r s : Setoid α} : r ⊔ s = EqvGen.Setoid (r.Rel ⊔ s.Rel) := by +theorem sup_def {r s : Setoid α} : r ⊔ s = EqvGen.Setoid (⇑r ⊔ ⇑s) := by rw [sup_eq_eqvGen]; rfl /-- The supremum of a set S of equivalence relations is the equivalence closure of the binary relation `there exists r ∈ S relating x and y`. -/ theorem sSup_eq_eqvGen (S : Set (Setoid α)) : - sSup S = EqvGen.Setoid fun x y => ∃ r : Setoid α, r ∈ S ∧ r.Rel x y := by + sSup S = EqvGen.Setoid fun x y => ∃ r : Setoid α, r ∈ S ∧ r x y := by rw [eqvGen_eq] apply congr_arg sInf simp only [upperBounds, le_def, and_imp, exists_imp] @@ -227,7 +215,7 @@ theorem sSup_eq_eqvGen (S : Set (Setoid α)) : /-- The supremum of a set of equivalence relations is the equivalence closure of the supremum of the set's image under the map to the underlying binary operation. -/ -theorem sSup_def {s : Set (Setoid α)} : sSup s = EqvGen.Setoid (sSup (Rel '' s)) := by +theorem sSup_def {s : Set (Setoid α)} : sSup s = EqvGen.Setoid (sSup ((⇑) '' s)) := by rw [sSup_eq_eqvGen, sSup_image] congr with (x y) simp only [iSup_apply, iSup_Prop_eq, exists_prop] @@ -238,13 +226,12 @@ theorem eqvGen_of_setoid (r : Setoid α) : EqvGen.Setoid r.r = r := le_antisymm (by rw [eqvGen_eq]; exact sInf_le fun _ _ => id) EqvGen.rel /-- Equivalence closure is idempotent. -/ -@[simp] -theorem eqvGen_idem (r : α → α → Prop) : EqvGen.Setoid (EqvGen.Setoid r).Rel = EqvGen.Setoid r := +theorem eqvGen_idem (r : α → α → Prop) : EqvGen.Setoid (EqvGen.Setoid r) = EqvGen.Setoid r := eqvGen_of_setoid _ /-- The equivalence closure of a binary relation r is contained in any equivalence relation containing r. -/ -theorem eqvGen_le {r : α → α → Prop} {s : Setoid α} (h : ∀ x y, r x y → s.Rel x y) : +theorem eqvGen_le {r : α → α → Prop} {s : Setoid α} (h : ∀ x y, r x y → s x y) : EqvGen.Setoid r ≤ s := by rw [eqvGen_eq]; exact sInf_le h /-- Equivalence closure of binary relations is monotone. -/ @@ -254,7 +241,7 @@ theorem eqvGen_mono {r s : α → α → Prop} (h : ∀ x y, r x y → s x y) : /-- There is a Galois insertion of equivalence relations on α into binary relations on α, with equivalence closure the lower adjoint. -/ -def gi : @GaloisInsertion (α → α → Prop) (Setoid α) _ _ EqvGen.Setoid Rel where +def gi : @GaloisInsertion (α → α → Prop) (Setoid α) _ _ EqvGen.Setoid (⇑) where choice r _ := EqvGen.Setoid r gc _ s := ⟨fun H _ _ h => H <| EqvGen.rel _ _ h, fun H => eqvGen_of_setoid s ▸ eqvGen_mono H⟩ le_l_u x := (eqvGen_of_setoid x).symm ▸ le_refl x @@ -268,20 +255,20 @@ theorem injective_iff_ker_bot (f : α → β) : Injective f ↔ ker f = ⊥ := (@eq_bot_iff (Setoid α) _ _ (ker f)).symm /-- The elements related to x ∈ α by the kernel of f are those in the preimage of f(x) under f. -/ -theorem ker_iff_mem_preimage {f : α → β} {x y} : (ker f).Rel x y ↔ x ∈ f ⁻¹' {f y} := +theorem ker_iff_mem_preimage {f : α → β} {x y} : ker f x y ↔ x ∈ f ⁻¹' {f y} := Iff.rfl /-- Equivalence between functions `α → β` such that `r x y → f x = f y` and functions `quotient r → β`. -/ def liftEquiv (r : Setoid α) : { f : α → β // r ≤ ker f } ≃ (Quotient r → β) where toFun f := Quotient.lift (f : α → β) f.2 - invFun f := ⟨f ∘ Quotient.mk'', fun x y h => by simp [ker_def, Quotient.sound' h]⟩ + invFun f := ⟨f ∘ Quotient.mk _, fun x y h => by simp [ker_def, Quotient.sound' h]⟩ left_inv := fun ⟨f, hf⟩ => Subtype.eq <| funext fun x => rfl - right_inv f := funext fun x => Quotient.inductionOn' x fun x => rfl + right_inv f := funext fun x => Quotient.inductionOn x fun x => rfl /-- The uniqueness part of the universal property for quotients of an arbitrary type. -/ theorem lift_unique {r : Setoid α} {f : α → β} (H : r ≤ ker f) (g : Quotient r → β) - (Hg : f = g ∘ Quotient.mk'') : Quotient.lift f H = g := by + (Hg : f = g ∘ Quotient.mk _) : Quotient.lift f H = g := by ext ⟨x⟩ erw [Quotient.lift_mk f H, Hg] rfl @@ -289,11 +276,11 @@ theorem lift_unique {r : Setoid α} {f : α → β} (H : r ≤ ker f) (g : Quoti /-- Given a map f from α to β, the natural map from the quotient of α by the kernel of f is injective. -/ theorem ker_lift_injective (f : α → β) : Injective (@Quotient.lift _ _ (ker f) f fun _ _ h => h) := - fun x y => Quotient.inductionOn₂' x y fun _ _ h => Quotient.sound' h + fun x y => Quotient.inductionOn₂ x y fun _ _ h => Quotient.sound h /-- Given a map f from α to β, the kernel of f is the unique equivalence relation on α whose induced map from the quotient of α to β is injective. -/ -theorem ker_eq_lift_of_injective {r : Setoid α} (f : α → β) (H : ∀ x y, r.Rel x y → f x = f y) +theorem ker_eq_lift_of_injective {r : Setoid α} (f : α → β) (H : ∀ x y, r x y → f x = f y) (h : Injective (Quotient.lift f H)) : ker f = r := le_antisymm (fun x y hk => @@ -310,16 +297,16 @@ noncomputable def quotientKerEquivRange : Quotient (ker f) ≃ Set.range f := Subtype.ext_val h) ⟨fun x y h => ker_lift_injective f <| by rcases x with ⟨⟩; rcases y with ⟨⟩; injections, fun ⟨w, z, hz⟩ => - ⟨@Quotient.mk'' _ (ker f) z, Subtype.ext_iff_val.2 hz⟩⟩ + ⟨⟦z⟧, Subtype.ext_iff_val.2 hz⟩⟩ /-- If `f` has a computable right-inverse, then the quotient by its kernel is equivalent to its domain. -/ @[simps] def quotientKerEquivOfRightInverse (g : β → α) (hf : Function.RightInverse g f) : Quotient (ker f) ≃ β where - toFun a := (Quotient.liftOn' a f) fun _ _ => id - invFun b := Quotient.mk'' (g b) - left_inv a := Quotient.inductionOn' a fun a => Quotient.sound' <| hf (f a) + toFun a := Quotient.liftOn a f fun _ _ => id + invFun b := ⟦g b⟧ + left_inv a := Quotient.inductionOn a fun a => Quotient.sound' <| hf (f a) right_inv := hf /-- The quotient of α by the kernel of a surjective function f bijects with f's codomain. @@ -335,13 +322,13 @@ variable {r f} closure of the relation on `f`'s image defined by '`x ≈ y` iff the elements of `f⁻¹(x)` are related to the elements of `f⁻¹(y)` by `r`.' -/ def map (r : Setoid α) (f : α → β) : Setoid β := - EqvGen.Setoid fun x y => ∃ a b, f a = x ∧ f b = y ∧ r.Rel a b + EqvGen.Setoid fun x y => ∃ a b, f a = x ∧ f b = y ∧ r a b /-- Given a surjective function f whose kernel is contained in an equivalence relation r, the equivalence relation on f's codomain defined by x ≈ y ↔ the elements of f⁻¹(x) are related to the elements of f⁻¹(y) by r. -/ def mapOfSurjective (r) (f : α → β) (h : ker f ≤ r) (hf : Surjective f) : Setoid β := - ⟨fun x y => ∃ a b, f a = x ∧ f b = y ∧ r.Rel a b, + ⟨fun x y => ∃ a b, f a = x ∧ f b = y ∧ r a b, ⟨fun x => let ⟨y, hy⟩ := hf x ⟨y, y, hy, hy, r.refl' y⟩, @@ -359,20 +346,21 @@ relation on `α` defined by '`x ≈ y` iff `f(x)` is related to `f(y)` by `r`'. See note [reducible non-instances]. -/ abbrev comap (f : α → β) (r : Setoid β) : Setoid α := - ⟨r.Rel on f, r.iseqv.comap _⟩ + ⟨r on f, r.iseqv.comap _⟩ -theorem comap_rel (f : α → β) (r : Setoid β) (x y : α) : (comap f r).Rel x y ↔ r.Rel (f x) (f y) := +theorem comap_rel (f : α → β) (r : Setoid β) (x y : α) : comap f r x y ↔ r (f x) (f y) := Iff.rfl /-- Given a map `f : N → M` and an equivalence relation `r` on `β`, the equivalence relation induced on `α` by `f` equals the kernel of `r`'s quotient map composed with `f`. -/ -theorem comap_eq {f : α → β} {r : Setoid β} : comap f r = ker (@Quotient.mk'' _ r ∘ f) := +theorem comap_eq {f : α → β} {r : Setoid β} : comap f r = ker (Quotient.mk r ∘ f) := ext fun x y => show _ ↔ ⟦_⟧ = ⟦_⟧ by rw [Quotient.eq]; rfl /-- The second isomorphism theorem for sets. -/ noncomputable def comapQuotientEquiv (f : α → β) (r : Setoid β) : - Quotient (comap f r) ≃ Set.range (@Quotient.mk'' _ r ∘ f) := - (Quotient.congrRight <| ext_iff.1 comap_eq).trans <| quotientKerEquivRange <| Quotient.mk'' ∘ f + Quotient (comap f r) ≃ Set.range (Quotient.mk r ∘ f) := + (Quotient.congrRight <| Setoid.ext_iff.1 comap_eq).trans <| quotientKerEquivRange <| + Quotient.mk _ ∘ f variable (r f) @@ -380,15 +368,15 @@ variable (r f) def quotientQuotientEquivQuotient (s : Setoid α) (h : r ≤ s) : Quotient (ker (Quot.mapRight h)) ≃ Quotient s where toFun x := - (Quotient.liftOn' x fun w => - (Quotient.liftOn' w (@Quotient.mk'' _ s)) fun x y H => Quotient.sound <| h H) - fun x y => Quotient.inductionOn₂' x y fun w z H => show @Quot.mk _ _ _ = @Quot.mk _ _ _ from H + (Quotient.liftOn x fun w => + (Quotient.liftOn w (@Quotient.mk _ s)) fun x y H => Quotient.sound <| h H) + fun x y => Quotient.inductionOn₂ x y fun w z H => show @Quot.mk _ _ _ = @Quot.mk _ _ _ from H invFun x := - (Quotient.liftOn' x fun w => @Quotient.mk'' _ (ker <| Quot.mapRight h) <| @Quotient.mk'' _ r w) + (Quotient.liftOn x fun w => @Quotient.mk _ (ker <| Quot.mapRight h) <| @Quotient.mk _ r w) fun x y H => Quotient.sound' <| show @Quot.mk _ _ _ = @Quot.mk _ _ _ from Quotient.sound H left_inv x := - Quotient.inductionOn' x fun y => Quotient.inductionOn' y fun w => by show ⟦_⟧ = _; rfl - right_inv x := Quotient.inductionOn' x fun y => by show ⟦_⟧ = _; rfl + Quotient.inductionOn x fun y => Quotient.inductionOn y fun w => by show ⟦_⟧ = _; rfl + right_inv x := Quotient.inductionOn x fun y => by show ⟦_⟧ = _; rfl variable {r f} @@ -402,7 +390,7 @@ def correspondence (r : Setoid α) : { s // r ≤ s } ≃o Setoid (Quotient r) w (fun h ↦ s.1.trans' (s.1.trans' (s.2 h₁) h) (s.1.symm' (s.2 h₂))), ⟨Quotient.ind s.1.2.1, @fun x y ↦ Quotient.inductionOn₂ x y fun _ _ ↦ s.1.2.2, @fun x y z ↦ Quotient.inductionOn₃ x y z fun _ _ _ ↦ s.1.2.3⟩⟩ - invFun s := ⟨comap Quotient.mk' s, fun x y h => by rw [comap_rel, eq_rel.2 h]⟩ + invFun s := ⟨comap (Quotient.mk _) s, fun x y h => by rw [comap_rel, Quotient.eq.2 h]⟩ left_inv s := rfl right_inv s := ext fun x y ↦ Quotient.inductionOn₂ x y fun _ _ ↦ Iff.rfl map_rel_iff' := @@ -423,14 +411,14 @@ end Setoid theorem Quotient.subsingleton_iff {s : Setoid α} : Subsingleton (Quotient s) ↔ s = ⊤ := by simp only [_root_.subsingleton_iff, eq_top_iff, Setoid.le_def, Setoid.top_def, Pi.top_apply, forall_const] - refine (surjective_quotient_mk' _).forall.trans (forall_congr' fun a => ?_) - refine (surjective_quotient_mk' _).forall.trans (forall_congr' fun b => ?_) + refine Quotient.surjective_mk'.forall.trans (forall_congr' fun a => ?_) + refine Quotient.surjective_mk'.forall.trans (forall_congr' fun b => ?_) simp_rw [Prop.top_eq_true, true_implies, Quotient.eq'] rfl theorem Quot.subsingleton_iff (r : α → α → Prop) : Subsingleton (Quot r) ↔ EqvGen r = ⊤ := by simp only [_root_.subsingleton_iff, _root_.eq_top_iff, Pi.le_def, Pi.top_apply, forall_const] - refine (surjective_quot_mk _).forall.trans (forall_congr' fun a => ?_) - refine (surjective_quot_mk _).forall.trans (forall_congr' fun b => ?_) + refine Quot.surjective_mk.forall.trans (forall_congr' fun a => ?_) + refine Quot.surjective_mk.forall.trans (forall_congr' fun b => ?_) rw [Quot.eq] simp only [forall_const, le_Prop_eq, Pi.top_apply, Prop.top_eq_true, true_implies] diff --git a/Mathlib/Data/Setoid/Partition.lean b/Mathlib/Data/Setoid/Partition.lean index 1cc028237c179..10fdf21eb3f3a 100644 --- a/Mathlib/Data/Setoid/Partition.lean +++ b/Mathlib/Data/Setoid/Partition.lean @@ -53,9 +53,9 @@ def mkClasses (c : Set (Set α)) (H : ∀ a, ∃! b ∈ c, a ∈ b) : Setoid α /-- Makes the equivalence classes of an equivalence relation. -/ def classes (r : Setoid α) : Set (Set α) := - { s | ∃ y, s = { x | r.Rel x y } } + { s | ∃ y, s = { x | r x y } } -theorem mem_classes (r : Setoid α) (y) : { x | r.Rel x y } ∈ r.classes := +theorem mem_classes (r : Setoid α) (y) : { x | r x y } ∈ r.classes := ⟨y, rfl⟩ theorem classes_ker_subset_fiber_set {β : Type*} (f : α → β) : @@ -74,17 +74,17 @@ theorem card_classes_ker_le {α β : Type*} [Fintype β] (f : α → β) /-- Two equivalence relations are equal iff all their equivalence classes are equal. -/ theorem eq_iff_classes_eq {r₁ r₂ : Setoid α} : - r₁ = r₂ ↔ ∀ x, { y | r₁.Rel x y } = { y | r₂.Rel x y } := - ⟨fun h _x => h ▸ rfl, fun h => ext' fun x => Set.ext_iff.1 <| h x⟩ + r₁ = r₂ ↔ ∀ x, { y | r₁ x y } = { y | r₂ x y } := + ⟨fun h _x => h ▸ rfl, fun h => ext fun x => Set.ext_iff.1 <| h x⟩ -theorem rel_iff_exists_classes (r : Setoid α) {x y} : r.Rel x y ↔ ∃ c ∈ r.classes, x ∈ c ∧ y ∈ c := +theorem rel_iff_exists_classes (r : Setoid α) {x y} : r x y ↔ ∃ c ∈ r.classes, x ∈ c ∧ y ∈ c := ⟨fun h => ⟨_, r.mem_classes y, h, r.refl' y⟩, fun ⟨c, ⟨z, hz⟩, hx, hy⟩ => by subst c exact r.trans' hx (r.symm' hy)⟩ /-- Two equivalence relations are equal iff their equivalence classes are equal. -/ theorem classes_inj {r₁ r₂ : Setoid α} : r₁ = r₂ ↔ r₁.classes = r₂.classes := - ⟨fun h => h ▸ rfl, fun h => ext' fun a b => by simp only [rel_iff_exists_classes, exists_prop, h]⟩ + ⟨fun h => h ▸ rfl, fun h => ext fun a b => by simp only [rel_iff_exists_classes, exists_prop, h]⟩ /-- The empty set is not an equivalence class. -/ theorem empty_not_mem_classes {r : Setoid α} : ∅ ∉ r.classes := fun ⟨y, hy⟩ => @@ -92,7 +92,7 @@ theorem empty_not_mem_classes {r : Setoid α} : ∅ ∉ r.classes := fun ⟨y, h /-- Equivalence classes partition the type. -/ theorem classes_eqv_classes {r : Setoid α} (a) : ∃! b ∈ r.classes, a ∈ b := - ExistsUnique.intro { x | r.Rel x a } ⟨r.mem_classes a, r.refl' _⟩ <| by + ExistsUnique.intro { x | r x a } ⟨r.mem_classes a, r.refl' _⟩ <| by rintro y ⟨⟨_, rfl⟩, ha⟩ ext x exact ⟨fun hx => r.trans' hx (r.symm' ha), fun hx => r.trans' hx ha⟩ @@ -105,7 +105,7 @@ theorem eq_of_mem_classes {r : Setoid α} {x b} (hc : b ∈ r.classes) (hb : x /-- The elements of a set of sets partitioning α are the equivalence classes of the equivalence relation defined by the set of sets. -/ theorem eq_eqv_class_of_mem {c : Set (Set α)} (H : ∀ a, ∃! b ∈ c, a ∈ b) {s y} - (hs : s ∈ c) (hy : y ∈ s) : s = { x | (mkClasses c H).Rel x y } := by + (hs : s ∈ c) (hy : y ∈ s) : s = { x | mkClasses c H x y } := by ext x constructor · intro hx _s' hs' hx' @@ -117,11 +117,11 @@ theorem eq_eqv_class_of_mem {c : Set (Set α)} (H : ∀ a, ∃! b ∈ c, a ∈ b /-- The equivalence classes of the equivalence relation defined by a set of sets partitioning α are elements of the set of sets. -/ theorem eqv_class_mem {c : Set (Set α)} (H : ∀ a, ∃! b ∈ c, a ∈ b) {y} : - { x | (mkClasses c H).Rel x y } ∈ c := + { x | mkClasses c H x y } ∈ c := (H y).elim fun _ hc _ => eq_eqv_class_of_mem H hc.1 hc.2 ▸ hc.1 theorem eqv_class_mem' {c : Set (Set α)} (H : ∀ a, ∃! b ∈ c, a ∈ b) {x} : - { y : α | (mkClasses c H).Rel x y } ∈ c := by + { y : α | mkClasses c H x y } ∈ c := by convert @Setoid.eqv_class_mem _ _ H x using 3 rw [Setoid.comm'] @@ -145,13 +145,13 @@ def setoidOfDisjointUnion {c : Set (Set α)} (hu : Set.sUnion c = @Set.univ α) /-- The equivalence relation made from the equivalence classes of an equivalence relation r equals r. -/ theorem mkClasses_classes (r : Setoid α) : mkClasses r.classes classes_eqv_classes = r := - ext' fun x _y => - ⟨fun h => r.symm' (h { z | r.Rel z x } (r.mem_classes x) <| r.refl' x), fun h _b hb hx => + ext fun x _y => + ⟨fun h => r.symm' (h { z | r z x } (r.mem_classes x) <| r.refl' x), fun h _b hb hx => eq_of_mem_classes (r.mem_classes x) (r.refl' x) hb hx ▸ r.symm' h⟩ @[simp] theorem sUnion_classes (r : Setoid α) : ⋃₀ r.classes = Set.univ := - Set.eq_univ_of_forall fun x => Set.mem_sUnion.2 ⟨{ y | r.Rel y x }, ⟨x, rfl⟩, Setoid.refl _⟩ + Set.eq_univ_of_forall fun x => Set.mem_sUnion.2 ⟨{ y | r y x }, ⟨x, rfl⟩, Setoid.refl _⟩ /-- The equivalence between the quotient by an equivalence relation and its type of equivalence classes. -/ @@ -177,8 +177,8 @@ noncomputable def quotientEquivClasses (r : Setoid α) : Quotient r ≃ Setoid.c @[simp] lemma quotientEquivClasses_mk_eq (r : Setoid α) (a : α) : - (quotientEquivClasses r (Quotient.mk r a) : Set α) = { x | r.Rel x a } := - (@Subtype.ext_iff_val _ _ _ ⟨{ x | r.Rel x a }, Setoid.mem_classes r a⟩).mp rfl + (quotientEquivClasses r (Quotient.mk r a) : Set α) = { x | r x a } := + (@Subtype.ext_iff_val _ _ _ ⟨{ x | r x a }, Setoid.mem_classes r a⟩).mp rfl section Partition @@ -217,7 +217,7 @@ theorem IsPartition.sUnion_eq_univ {c : Set (Set α)} (hc : IsPartition c) : ⋃ /-- All elements of a partition of α are the equivalence class of some y ∈ α. -/ theorem exists_of_mem_partition {c : Set (Set α)} (hc : IsPartition c) {s} (hs : s ∈ c) : - ∃ y, s = { x | (mkClasses c hc.2).Rel x y } := + ∃ y, s = { x | mkClasses c hc.2 x y } := let ⟨y, hy⟩ := nonempty_of_mem_partition hc hs ⟨y, eq_eqv_class_of_mem hc.2 hs hy⟩ @@ -367,7 +367,7 @@ protected abbrev setoid (hs : IndexedPartition s) : Setoid α := theorem index_some (i : ι) : hs.index (hs.some i) = i := (mem_iff_index_eq _).1 <| hs.some_mem i -theorem some_index (x : α) : hs.setoid.Rel (hs.some (hs.index x)) x := +theorem some_index (x : α) : hs.setoid (hs.some (hs.index x)) x := hs.index_some (hs.index x) /-- The quotient associated to an indexed partition. -/ @@ -376,17 +376,17 @@ protected def Quotient := /-- The projection onto the quotient associated to an indexed partition. -/ def proj : α → hs.Quotient := - Quotient.mk'' + Quotient.mk _ instance [Inhabited α] : Inhabited hs.Quotient := ⟨hs.proj default⟩ theorem proj_eq_iff {x y : α} : hs.proj x = hs.proj y ↔ hs.index x = hs.index y := - Quotient.eq_rel + Quotient.eq @[simp] theorem proj_some_index (x : α) : hs.proj (hs.some (hs.index x)) = hs.proj x := - Quotient.eq''.2 (hs.some_index x) + Quotient.eq.2 (hs.some_index x) /-- The obvious equivalence between the quotient associated to an indexed partition and the indexing type. -/ @@ -405,7 +405,7 @@ theorem equivQuotient_index : hs.equivQuotient ∘ hs.index = hs.proj := funext hs.equivQuotient_index_apply /-- A map choosing a representative for each element of the quotient associated to an indexed -partition. This is a computable version of `Quotient.out'` using `IndexedPartition.some`. -/ +partition. This is a computable version of `Quotient.out` using `IndexedPartition.some`. -/ def out : hs.Quotient ↪ α := hs.equivQuotient.symm.toEmbedding.trans ⟨hs.some, Function.LeftInverse.injective hs.index_some⟩ @@ -414,23 +414,23 @@ def out : hs.Quotient ↪ α := theorem out_proj (x : α) : hs.out (hs.proj x) = hs.some (hs.index x) := rfl -/-- The indices of `Quotient.out'` and `IndexedPartition.out` are equal. -/ -theorem index_out' (x : hs.Quotient) : hs.index x.out' = hs.index (hs.out x) := - Quotient.inductionOn' x fun x => (Setoid.ker_apply_mk_out' x).trans (hs.index_some _).symm +/-- The indices of `Quotient.out` and `IndexedPartition.out` are equal. -/ +theorem index_out' (x : hs.Quotient) : hs.index x.out = hs.index (hs.out x) := + Quotient.inductionOn x fun x => (Setoid.ker_apply_mk_out x).trans (hs.index_some _).symm -/-- This lemma is analogous to `Quotient.out_eq'`. -/ +/-- This lemma is analogous to `Quotient.out_eq`. -/ @[simp] theorem proj_out (x : hs.Quotient) : hs.proj (hs.out x) = x := - Quotient.inductionOn' x fun x => Quotient.sound' <| hs.some_index x + Quotient.inductionOn x fun x => Quotient.sound' <| hs.some_index x -theorem class_of {x : α} : setOf (hs.setoid.Rel x) = s (hs.index x) := +theorem class_of {x : α} : setOf (hs.setoid x) = s (hs.index x) := Set.ext fun _y => eq_comm.trans hs.mem_iff_index_eq.symm theorem proj_fiber (x : hs.Quotient) : hs.proj ⁻¹' {x} = s (hs.equivQuotient.symm x) := - Quotient.inductionOn' x fun x => by + Quotient.inductionOn x fun x => by ext y simp only [Set.mem_preimage, Set.mem_singleton_iff, hs.mem_iff_index_eq] - exact Quotient.eq'' + exact Quotient.eq /-- Combine functions with disjoint domains into a new function. You can use the regular expression `def.*piecewise` to search for diff --git a/Mathlib/Data/Sym/Sym2.lean b/Mathlib/Data/Sym/Sym2.lean index 4e94151a85335..d2b863d1b81ee 100644 --- a/Mathlib/Data/Sym/Sym2.lean +++ b/Mathlib/Data/Sym/Sym2.lean @@ -112,7 +112,7 @@ protected theorem exact {p p' : α × α} (h : Sym2.mk p = Sym2.mk p') : Sym2.Re @[simp] protected theorem eq {p p' : α × α} : Sym2.mk p = Sym2.mk p' ↔ Sym2.Rel α p p' := - Quotient.eq' (s₁ := Sym2.Rel.setoid α) + Quotient.eq (r := Sym2.Rel.setoid α) @[elab_as_elim, cases_eliminator, induction_eliminator] protected theorem ind {f : Sym2 α → Prop} (h : ∀ x y, f s(x, y)) : ∀ i, f i := @@ -147,11 +147,11 @@ protected abbrev recOnSubsingleton {motive : Sym2 α → Sort*} protected theorem «exists» {α : Sort _} {f : Sym2 α → Prop} : (∃ x : Sym2 α, f x) ↔ ∃ x y, f s(x, y) := - (surjective_quot_mk _).exists.trans Prod.exists + Quot.surjective_mk.exists.trans Prod.exists protected theorem «forall» {α : Sort _} {f : Sym2 α → Prop} : (∀ x : Sym2 α, f x) ↔ ∀ x y, f s(x, y) := - (surjective_quot_mk _).forall.trans Prod.forall + Quot.surjective_mk.forall.trans Prod.forall theorem eq_swap {a b : α} : s(a, b) = s(b, a) := Quot.sound (Rel.swap _ _) diff --git a/Mathlib/FieldTheory/IsAlgClosed/AlgebraicClosure.lean b/Mathlib/FieldTheory/IsAlgClosed/AlgebraicClosure.lean index 27b94d1b6a535..011f8df93c8f5 100644 --- a/Mathlib/FieldTheory/IsAlgClosed/AlgebraicClosure.lean +++ b/Mathlib/FieldTheory/IsAlgClosed/AlgebraicClosure.lean @@ -392,9 +392,9 @@ instance instField : Field (AlgebraicClosure k) where nnratCast_def q := by change algebraMap k _ _ = _; simp_rw [NNRat.cast_def, map_div₀, map_natCast] ratCast_def q := by change algebraMap k _ _ = _; rw [Rat.cast_def, map_div₀, map_intCast, map_natCast] - nnqsmul_def q x := Quotient.inductionOn x fun p ↦ congr_arg Quotient.mk'' <| by + nnqsmul_def q x := Quotient.inductionOn x fun p ↦ congr_arg (Quotient.mk _) <| by ext; simp [MvPolynomial.algebraMap_eq, NNRat.smul_def] - qsmul_def q x := Quotient.inductionOn x fun p ↦ congr_arg Quotient.mk'' <| by + qsmul_def q x := Quotient.inductionOn x fun p ↦ congr_arg (Quotient.mk _) <| by ext; simp [MvPolynomial.algebraMap_eq, Rat.smul_def] instance isAlgClosed : IsAlgClosed (AlgebraicClosure k) := diff --git a/Mathlib/FieldTheory/PerfectClosure.lean b/Mathlib/FieldTheory/PerfectClosure.lean index b88e876167509..1afc246fd0698 100644 --- a/Mathlib/FieldTheory/PerfectClosure.lean +++ b/Mathlib/FieldTheory/PerfectClosure.lean @@ -80,7 +80,7 @@ viewed as `x ^ (p ^ -n)`. Every element of `PerfectClosure K p` is of this form def mk (x : ℕ × K) : PerfectClosure K p := Quot.mk (R K p) x -theorem mk_surjective : Function.Surjective (mk K p) := surjective_quot_mk _ +theorem mk_surjective : Function.Surjective (mk K p) := Quot.surjective_mk @[simp] theorem mk_succ_pow (m : ℕ) (x : K) : mk K p ⟨m + 1, x ^ p⟩ = mk K p ⟨m, x⟩ := Eq.symm <| Quot.sound (R.intro m x) diff --git a/Mathlib/FieldTheory/SplittingField/Construction.lean b/Mathlib/FieldTheory/SplittingField/Construction.lean index fb0572b56c8b9..f17d0d1a711af 100644 --- a/Mathlib/FieldTheory/SplittingField/Construction.lean +++ b/Mathlib/FieldTheory/SplittingField/Construction.lean @@ -258,9 +258,9 @@ instance instField : Field (SplittingField f) where nnratCast_def q := by change algebraMap K _ _ = _; simp_rw [NNRat.cast_def, map_div₀, map_natCast] ratCast_def q := by change algebraMap K _ _ = _; rw [Rat.cast_def, map_div₀, map_intCast, map_natCast] - nnqsmul_def q x := Quotient.inductionOn x fun p ↦ congr_arg Quotient.mk'' <| by + nnqsmul_def q x := Quotient.inductionOn x fun p ↦ congr_arg (Quotient.mk _) <| by ext; simp [MvPolynomial.algebraMap_eq, NNRat.smul_def] - qsmul_def q x := Quotient.inductionOn x fun p ↦ congr_arg Quotient.mk'' <| by + qsmul_def q x := Quotient.inductionOn x fun p ↦ congr_arg (Quotient.mk _) <| by ext; simp [MvPolynomial.algebraMap_eq, Rat.smul_def] instance instCharZero [CharZero K] : CharZero (SplittingField f) := diff --git a/Mathlib/GroupTheory/Abelianization.lean b/Mathlib/GroupTheory/Abelianization.lean index 51b0cfca00034..a5e1c6bc8f423 100644 --- a/Mathlib/GroupTheory/Abelianization.lean +++ b/Mathlib/GroupTheory/Abelianization.lean @@ -81,7 +81,7 @@ attribute [local instance] QuotientGroup.leftRel instance commGroup : CommGroup (Abelianization G) := { QuotientGroup.Quotient.group _ with mul_comm := fun x y => - Quotient.inductionOn₂' x y fun a b => + Quotient.inductionOn₂ x y fun a b => Quotient.sound' <| QuotientGroup.leftRel_apply.mpr <| Subgroup.subset_closure diff --git a/Mathlib/GroupTheory/Commensurable.lean b/Mathlib/GroupTheory/Commensurable.lean index b084767be576a..61f0b45b95157 100644 --- a/Mathlib/GroupTheory/Commensurable.lean +++ b/Mathlib/GroupTheory/Commensurable.lean @@ -56,7 +56,7 @@ def quotConjEquiv (H K : Subgroup G) (g : ConjAct G) : K ⧸ H.subgroupOf K ≃ (g • K).1 ⧸ (g • H).subgroupOf (g • K) := Quotient.congr (K.equivSMul g).toEquiv fun a b => by dsimp - rw [← Quotient.eq'', ← Quotient.eq'', QuotientGroup.eq, QuotientGroup.eq, + rw [← Quotient.eq, ← Quotient.eq, QuotientGroup.eq, QuotientGroup.eq, Subgroup.mem_subgroupOf, Subgroup.mem_subgroupOf, ← map_inv, ← map_mul, Subgroup.equivSMul_apply_coe] exact Subgroup.smul_mem_pointwise_smul_iff.symm diff --git a/Mathlib/GroupTheory/CommutingProbability.lean b/Mathlib/GroupTheory/CommutingProbability.lean index 50ea33f499459..a9562e4c63fba 100644 --- a/Mathlib/GroupTheory/CommutingProbability.lean +++ b/Mathlib/GroupTheory/CommutingProbability.lean @@ -111,7 +111,7 @@ theorem Subgroup.commProb_quotient_le [H.Normal] : commProb (G ⧸ H) ≤ commPr H.card_mul_index, div_mul_cancel₀, Nat.cast_le] · apply Finite.card_le_of_surjective show Function.Surjective (ConjClasses.map (QuotientGroup.mk' H)) - exact ConjClasses.map_surjective Quotient.surjective_Quotient_mk'' + exact ConjClasses.map_surjective Quotient.surjective_mk · exact Nat.cast_ne_zero.mpr Finite.card_pos.ne' · exact Nat.cast_pos.mpr Finite.card_pos diff --git a/Mathlib/GroupTheory/Complement.lean b/Mathlib/GroupTheory/Complement.lean index b0b6b1c0ae21e..ddd68ebebab16 100644 --- a/Mathlib/GroupTheory/Complement.lean +++ b/Mathlib/GroupTheory/Complement.lean @@ -199,32 +199,32 @@ theorem mem_rightTransversals_iff_existsUnique_mul_inv_mem : @[to_additive] theorem mem_leftTransversals_iff_existsUnique_quotient_mk''_eq : S ∈ leftTransversals (H : Set G) ↔ - ∀ q : Quotient (QuotientGroup.leftRel H), ∃! s : S, Quotient.mk'' s.1 = q := by + ∀ q : Quotient (QuotientGroup.leftRel H), ∃! s : S, ⟦s.1⟧ = q := by simp_rw [mem_leftTransversals_iff_existsUnique_inv_mul_mem, SetLike.mem_coe, ← QuotientGroup.eq] - exact ⟨fun h q => Quotient.inductionOn' q h, fun h g => h (Quotient.mk'' g)⟩ + exact ⟨fun h q => Quotient.inductionOn q h, fun h g => h ⟦g⟧⟩ @[to_additive] theorem mem_rightTransversals_iff_existsUnique_quotient_mk''_eq : S ∈ rightTransversals (H : Set G) ↔ - ∀ q : Quotient (QuotientGroup.rightRel H), ∃! s : S, Quotient.mk'' s.1 = q := by + ∀ q : Quotient (QuotientGroup.rightRel H), ∃! s : S, ⟦s.1⟧ = q := by simp_rw [mem_rightTransversals_iff_existsUnique_mul_inv_mem, SetLike.mem_coe, ← - QuotientGroup.rightRel_apply, ← Quotient.eq''] - exact ⟨fun h q => Quotient.inductionOn' q h, fun h g => h (Quotient.mk'' g)⟩ + QuotientGroup.rightRel_apply, ← Quotient.eq] + exact ⟨fun h q => Quotient.inductionOn q h, fun h g => h ⟦g⟧⟩ @[to_additive] theorem mem_leftTransversals_iff_bijective : S ∈ leftTransversals (H : Set G) ↔ - Function.Bijective (S.restrict (Quotient.mk'' : G → Quotient (QuotientGroup.leftRel H))) := + Function.Bijective (S.restrict (Quotient.mk _ : G → Quotient (QuotientGroup.leftRel H))) := mem_leftTransversals_iff_existsUnique_quotient_mk''_eq.trans - (Function.bijective_iff_existsUnique (S.restrict Quotient.mk'')).symm + (Function.bijective_iff_existsUnique (S.restrict (Quotient.mk _))).symm @[to_additive] theorem mem_rightTransversals_iff_bijective : S ∈ rightTransversals (H : Set G) ↔ - Function.Bijective (S.restrict (Quotient.mk'' : G → Quotient (QuotientGroup.rightRel H))) := + Function.Bijective (S.restrict (Quotient.mk _ : G → Quotient (QuotientGroup.rightRel H))) := mem_rightTransversals_iff_existsUnique_quotient_mk''_eq.trans - (Function.bijective_iff_existsUnique (S.restrict Quotient.mk'')).symm + (Function.bijective_iff_existsUnique (S.restrict (Quotient.mk _))).symm @[to_additive] theorem card_left_transversal (h : S ∈ leftTransversals (H : Set G)) : Nat.card S = H.index := @@ -246,7 +246,7 @@ theorem range_mem_leftTransversals {f : G ⧸ H → G} (hf : ∀ q, ↑(f q) = q @[to_additive] theorem range_mem_rightTransversals {f : Quotient (QuotientGroup.rightRel H) → G} - (hf : ∀ q, Quotient.mk'' (f q) = q) : Set.range f ∈ rightTransversals (H : Set G) := + (hf : ∀ q, ⟦f q⟧ = q) : Set.range f ∈ rightTransversals (H : Set G) := mem_rightTransversals_iff_bijective.mpr ⟨by rintro ⟨-, q₁, rfl⟩ ⟨-, q₂, rfl⟩ h exact Subtype.ext <| congr_arg f <| ((hf q₁).symm.trans h).trans (hf q₂), @@ -257,11 +257,11 @@ lemma exists_left_transversal (H : Subgroup G) (g : G) : ∃ S ∈ leftTransversals (H : Set G), g ∈ S := by classical refine - ⟨Set.range (Function.update Quotient.out' _ g), range_mem_leftTransversals fun q => ?_, - Quotient.mk'' g, Function.update_same (Quotient.mk'' g) g Quotient.out'⟩ - by_cases hq : q = Quotient.mk'' g - · exact hq.symm ▸ congr_arg _ (Function.update_same (Quotient.mk'' g) g Quotient.out') - · refine (Function.update_noteq ?_ g Quotient.out') ▸ q.out_eq' + ⟨Set.range (Function.update Quotient.out _ g), range_mem_leftTransversals fun q => ?_, + ⟦g⟧, Function.update_same ⟦g⟧ g Quotient.out⟩ + by_cases hq : q = ⟦g⟧ + · exact hq.symm ▸ congr_arg _ (Function.update_same ⟦g⟧ g Quotient.out) + · refine (Function.update_noteq ?_ g Quotient.out) ▸ q.out_eq exact hq @[to_additive] @@ -269,11 +269,11 @@ lemma exists_right_transversal (H : Subgroup G) (g : G) : ∃ S ∈ rightTransversals (H : Set G), g ∈ S := by classical refine - ⟨Set.range (Function.update Quotient.out' _ g), range_mem_rightTransversals fun q => ?_, - Quotient.mk'' g, Function.update_same (Quotient.mk'' g) g Quotient.out'⟩ - by_cases hq : q = Quotient.mk'' g - · exact hq.symm ▸ congr_arg _ (Function.update_same (Quotient.mk'' g) g Quotient.out') - · exact Eq.trans (congr_arg _ (Function.update_noteq hq g Quotient.out')) q.out_eq' + ⟨Set.range (Function.update Quotient.out _ g), range_mem_rightTransversals fun q => ?_, + ⟦g⟧, Function.update_same ⟦g⟧ g Quotient.out⟩ + by_cases hq : q = ⟦g⟧ + · exact hq.symm ▸ congr_arg _ (Function.update_same ⟦g⟧ g Quotient.out) + · exact Eq.trans (congr_arg _ (Function.update_noteq hq g Quotient.out)) q.out_eq /-- Given two subgroups `H' ⊆ H`, there exists a left transversal to `H'` inside `H`. -/ @[to_additive "Given two subgroups `H' ⊆ H`, there exists a transversal to `H'` inside `H`"] @@ -469,7 +469,7 @@ theorem finite_iff @[to_additive] theorem mk''_toEquiv (hS : S ∈ Subgroup.leftTransversals (H : Set G)) (q : G ⧸ H) : - Quotient.mk'' (toEquiv hS q : G) = q := + ⟦(toEquiv hS q : G)⟧ = q := (toEquiv hS).symm_apply_apply q @[to_additive] @@ -483,7 +483,7 @@ theorem toEquiv_apply {f : G ⧸ H → G} (hf : ∀ q, (f q : G ⧸ H) = q) (q : @[to_additive "A left transversal can be viewed as a function mapping each element of the group to the chosen representative from that left coset."] noncomputable def toFun (hS : S ∈ Subgroup.leftTransversals (H : Set G)) : G → S := - toEquiv hS ∘ Quotient.mk'' + toEquiv hS ∘ Quotient.mk _ @[to_additive] theorem inv_toFun_mul_mem (hS : S ∈ Subgroup.leftTransversals (H : Set G)) (g : G) : @@ -515,12 +515,12 @@ theorem finite_iff @[to_additive] theorem mk''_toEquiv (hS : S ∈ Subgroup.rightTransversals (H : Set G)) - (q : Quotient (QuotientGroup.rightRel H)) : Quotient.mk'' (toEquiv hS q : G) = q := + (q : Quotient (QuotientGroup.rightRel H)) : ⟦(toEquiv hS q : G)⟧ = q := (toEquiv hS).symm_apply_apply q @[to_additive] theorem toEquiv_apply {f : Quotient (QuotientGroup.rightRel H) → G} - (hf : ∀ q, Quotient.mk'' (f q) = q) (q : Quotient (QuotientGroup.rightRel H)) : + (hf : ∀ q, ⟦f q⟧ = q) (q : Quotient (QuotientGroup.rightRel H)) : (toEquiv (range_mem_rightTransversals hf) q : G) = f q := by refine (Subtype.ext_iff.mp ?_).trans (Subtype.coe_mk (f q) ⟨q, rfl⟩) exact (toEquiv (range_mem_rightTransversals hf)).apply_eq_iff_eq_symm_apply.mpr (hf q).symm @@ -530,7 +530,7 @@ theorem toEquiv_apply {f : Quotient (QuotientGroup.rightRel H) → G} @[to_additive "A right transversal can be viewed as a function mapping each element of the group to the chosen representative from that right coset."] noncomputable def toFun (hS : S ∈ Subgroup.rightTransversals (H : Set G)) : G → S := - toEquiv hS ∘ Quotient.mk'' + toEquiv hS ∘ Quotient.mk _ @[to_additive] theorem mul_inv_toFun_mem (hS : S ∈ Subgroup.rightTransversals (H : Set G)) (g : G) : @@ -576,7 +576,7 @@ theorem smul_toFun (f : F) (T : leftTransversals (H : Set G)) (g : G) : @[to_additive] theorem smul_toEquiv (f : F) (T : leftTransversals (H : Set G)) (q : G ⧸ H) : f • (toEquiv T.2 q : G) = toEquiv (f • T).2 (f • q) := - Quotient.inductionOn' q fun g => smul_toFun f T g + Quotient.inductionOn q fun g => smul_toFun f T g @[to_additive] theorem smul_apply_eq_smul_apply_inv_smul (f : F) (T : leftTransversals (H : Set G)) (q : G ⧸ H) : @@ -587,11 +587,11 @@ end Action @[to_additive] instance : Inhabited (leftTransversals (H : Set G)) := - ⟨⟨Set.range Quotient.out', range_mem_leftTransversals Quotient.out_eq'⟩⟩ + ⟨⟨Set.range Quotient.out, range_mem_leftTransversals Quotient.out_eq⟩⟩ @[to_additive] instance : Inhabited (rightTransversals (H : Set G)) := - ⟨⟨Set.range Quotient.out', range_mem_rightTransversals Quotient.out_eq'⟩⟩ + ⟨⟨Set.range Quotient.out, range_mem_rightTransversals Quotient.out_eq⟩⟩ theorem IsComplement'.isCompl (h : IsComplement' H K) : IsCompl H K := by refine @@ -666,17 +666,17 @@ variable {G : Type u} [Group G] (H : Subgroup G) (g : G) /-- Partition `G ⧸ H` into orbits of the action of `g : G`. -/ noncomputable def quotientEquivSigmaZMod : - G ⧸ H ≃ Σq : orbitRel.Quotient (zpowers g) (G ⧸ H), ZMod (minimalPeriod (g • ·) q.out') := + G ⧸ H ≃ Σq : orbitRel.Quotient (zpowers g) (G ⧸ H), ZMod (minimalPeriod (g • ·) q.out) := (selfEquivSigmaOrbits (zpowers g) (G ⧸ H)).trans - (sigmaCongrRight fun q => orbitZPowersEquiv g q.out') + (sigmaCongrRight fun q => orbitZPowersEquiv g q.out) theorem quotientEquivSigmaZMod_symm_apply (q : orbitRel.Quotient (zpowers g) (G ⧸ H)) - (k : ZMod (minimalPeriod (g • ·) q.out')) : - (quotientEquivSigmaZMod H g).symm ⟨q, k⟩ = g ^ (cast k : ℤ) • q.out' := + (k : ZMod (minimalPeriod (g • ·) q.out)) : + (quotientEquivSigmaZMod H g).symm ⟨q, k⟩ = g ^ (cast k : ℤ) • q.out := rfl theorem quotientEquivSigmaZMod_apply (q : orbitRel.Quotient (zpowers g) (G ⧸ H)) (k : ℤ) : - quotientEquivSigmaZMod H g (g ^ k • q.out') = ⟨q, k⟩ := by + quotientEquivSigmaZMod H g (g ^ k • q.out) = ⟨q, k⟩ := by rw [apply_eq_iff_eq_symm_apply, quotientEquivSigmaZMod_symm_apply, ZMod.coe_intCast, zpow_smul_mod_minimalPeriod] @@ -684,16 +684,16 @@ theorem quotientEquivSigmaZMod_apply (q : orbitRel.Quotient (zpowers g) (G ⧸ H in `G ⧸ H`, an element `g ^ k • q₀` is mapped to `g ^ k • g₀` for a fixed choice of representative `g₀` of `q₀`. -/ noncomputable def transferFunction : G ⧸ H → G := fun q => - g ^ (cast (quotientEquivSigmaZMod H g q).2 : ℤ) * (quotientEquivSigmaZMod H g q).1.out'.out' + g ^ (cast (quotientEquivSigmaZMod H g q).2 : ℤ) * (quotientEquivSigmaZMod H g q).1.out.out theorem transferFunction_apply (q : G ⧸ H) : transferFunction H g q = g ^ (cast (quotientEquivSigmaZMod H g q).2 : ℤ) * - (quotientEquivSigmaZMod H g q).1.out'.out' := + (quotientEquivSigmaZMod H g q).1.out.out := rfl theorem coe_transferFunction (q : G ⧸ H) : ↑(transferFunction H g q) = q := by - rw [transferFunction_apply, ← smul_eq_mul, Quotient.coe_smul_out', + rw [transferFunction_apply, ← smul_eq_mul, Quotient.coe_smul_out, ← quotientEquivSigmaZMod_symm_apply, Sigma.eta, symm_apply_apply] /-- The transfer transversal as a set. Contains elements of the form `g ^ k • g₀` for fixed choices @@ -714,17 +714,17 @@ theorem transferTransversal_apply (q : G ⧸ H) : toEquiv_apply (coe_transferFunction H g) q theorem transferTransversal_apply' (q : orbitRel.Quotient (zpowers g) (G ⧸ H)) - (k : ZMod (minimalPeriod (g • ·) q.out')) : - ↑(toEquiv (transferTransversal H g).2 (g ^ (cast k : ℤ) • q.out')) = - g ^ (cast k : ℤ) * q.out'.out' := by + (k : ZMod (minimalPeriod (g • ·) q.out)) : + ↑(toEquiv (transferTransversal H g).2 (g ^ (cast k : ℤ) • q.out)) = + g ^ (cast k : ℤ) * q.out.out := by rw [transferTransversal_apply, transferFunction_apply, ← quotientEquivSigmaZMod_symm_apply, apply_symm_apply] theorem transferTransversal_apply'' (q : orbitRel.Quotient (zpowers g) (G ⧸ H)) - (k : ZMod (minimalPeriod (g • ·) q.out')) : - ↑(toEquiv (g • transferTransversal H g).2 (g ^ (cast k : ℤ) • q.out')) = - if k = 0 then g ^ minimalPeriod (g • ·) q.out' * q.out'.out' - else g ^ (cast k : ℤ) * q.out'.out' := by + (k : ZMod (minimalPeriod (g • ·) q.out)) : + ↑(toEquiv (g • transferTransversal H g).2 (g ^ (cast k : ℤ) • q.out)) = + if k = 0 then g ^ minimalPeriod (g • ·) q.out * q.out.out + else g ^ (cast k : ℤ) * q.out.out := by rw [smul_apply_eq_smul_apply_inv_smul, transferTransversal_apply, transferFunction_apply, ← mul_smul, ← zpow_neg_one, ← zpow_add, quotientEquivSigmaZMod_apply, smul_eq_mul, ← mul_assoc, ← zpow_one_add, Int.cast_add, Int.cast_neg, Int.cast_one, intCast_cast, cast_id', id, ← diff --git a/Mathlib/GroupTheory/Congruence/Basic.lean b/Mathlib/GroupTheory/Congruence/Basic.lean index f9137be6f7410..39a923ff0f169 100644 --- a/Mathlib/GroupTheory/Congruence/Basic.lean +++ b/Mathlib/GroupTheory/Congruence/Basic.lean @@ -169,7 +169,7 @@ theorem ext {c d : Con M} (H : ∀ x y, c x y ↔ d x y) : c = d := @[to_additive "The map sending an additive congruence relation to its underlying equivalence relation is injective."] theorem toSetoid_inj {c d : Con M} (H : c.toSetoid = d.toSetoid) : c = d := - ext <| ext_iff.1 H + ext <| Setoid.ext_iff.1 H /-- Two congruence relations are equal iff their underlying binary relations are equal. -/ @[to_additive "Two additive congruence relations are equal iff their underlying binary relations @@ -215,7 +215,7 @@ variable {c} /-- The morphism into the quotient by a congruence relation -/ @[to_additive (attr := coe) "The morphism into the quotient by an additive congruence relation"] def toQuotient : M → c.Quotient := - Quotient.mk'' + Quotient.mk _ variable (c) @@ -245,7 +245,7 @@ theorem quot_mk_eq_coe {M : Type*} [Mul M] (c : Con M) (x : M) : Quot.mk c x = ( induced by a function that is constant on `c`'s equivalence classes."] protected def liftOn {β} {c : Con M} (q : c.Quotient) (f : M → β) (h : ∀ a b, c a b → f a = f b) : β := - Quotient.liftOn' q f h + Quotient.liftOn q f h -- Porting note (#11215): TODO: restore `elab_as_elim` /-- The binary function on the quotient by a congruence relation `c` induced by a binary function @@ -254,14 +254,14 @@ protected def liftOn {β} {c : Con M} (q : c.Quotient) (f : M → β) (h : ∀ a induced by a binary function that is constant on `c`'s equivalence classes."] protected def liftOn₂ {β} {c : Con M} (q r : c.Quotient) (f : M → M → β) (h : ∀ a₁ a₂ b₁ b₂, c a₁ b₁ → c a₂ b₂ → f a₁ a₂ = f b₁ b₂) : β := - Quotient.liftOn₂' q r f h + Quotient.liftOn₂ q r f h /-- A version of `Quotient.hrecOn₂'` for quotients by `Con`. -/ @[to_additive "A version of `Quotient.hrecOn₂'` for quotients by `AddCon`."] protected def hrecOn₂ {cM : Con M} {cN : Con N} {φ : cM.Quotient → cN.Quotient → Sort*} (a : cM.Quotient) (b : cN.Quotient) (f : ∀ (x : M) (y : N), φ x y) (h : ∀ x y x' y', cM x x' → cN y y' → HEq (f x y) (f x' y')) : φ a b := - Quotient.hrecOn₂' a b f h + Quotient.hrecOn₂ a b f h @[to_additive (attr := simp)] theorem hrec_on₂_coe {cM : Con M} {cN : Con N} {φ : cM.Quotient → cN.Quotient → Sort*} (a : M) @@ -277,14 +277,14 @@ variable {c} @[to_additive (attr := elab_as_elim) "The inductive principle used to prove propositions about the elements of a quotient by an additive congruence relation."] protected theorem induction_on {C : c.Quotient → Prop} (q : c.Quotient) (H : ∀ x : M, C x) : C q := - Quotient.inductionOn' q H + Quotient.inductionOn q H /-- A version of `Con.induction_on` for predicates which take two arguments. -/ @[to_additive (attr := elab_as_elim) "A version of `AddCon.induction_on` for predicates which take two arguments."] protected theorem induction_on₂ {d : Con N} {C : c.Quotient → d.Quotient → Prop} (p : c.Quotient) (q : d.Quotient) (H : ∀ (x : M) (y : N), C x y) : C p q := - Quotient.inductionOn₂' p q H + Quotient.inductionOn₂ p q H variable (c) @@ -293,20 +293,20 @@ variable (c) @[to_additive (attr := simp) "Two elements are related by an additive congruence relation `c` iff they are represented by the same element of the quotient by `c`."] protected theorem eq {a b : M} : (a : c.Quotient) = (b : c.Quotient) ↔ c a b := - Quotient.eq'' + Quotient.eq /-- The multiplication induced on the quotient by a congruence relation on a type with a multiplication. -/ @[to_additive "The addition induced on the quotient by an additive congruence relation on a type with an addition."] instance hasMul : Mul c.Quotient := - ⟨Quotient.map₂' (· * ·) fun _ _ h1 _ _ h2 => c.mul h1 h2⟩ + ⟨Quotient.map₂ (· * ·) fun _ _ h1 _ _ h2 => c.mul h1 h2⟩ /-- The kernel of the quotient map induced by a congruence relation `c` equals `c`. -/ @[to_additive (attr := simp) "The kernel of the quotient map induced by an additive congruence relation `c` equals `c`."] theorem mul_ker_mk_eq : (mulKer ((↑) : M → c.Quotient) fun _ _ => rfl) = c := - ext fun _ _ => Quotient.eq'' + ext fun _ _ => Quotient.eq variable {c} @@ -361,7 +361,7 @@ instance : InfSet (Con M) where @[to_additive "The infimum of a set of additive congruence relations is the same as the infimum of the set's image under the map to the underlying equivalence relation."] theorem sInf_toSetoid (S : Set (Con M)) : (sInf S).toSetoid = sInf (toSetoid '' S) := - Setoid.ext' fun x y => + Setoid.ext fun x y => ⟨fun h r ⟨c, hS, hr⟩ => by rw [← hr]; exact h c hS, fun h c hS => h c.toSetoid ⟨c, hS, rfl⟩⟩ /-- The infimum of a set of congruence relations is the same as the infimum of the set's image @@ -599,8 +599,8 @@ def correspondence : { d // c ≤ d } ≃o Con c.Quotient where constructor · intros h x y hs rcases h ⟨x, y, rfl, rfl, hs⟩ with ⟨a, b, hx, hy, ht⟩ - exact t.1.trans (t.1.symm <| t.2 <| Quotient.eq_rel.1 hx) - (t.1.trans ht (t.2 <| Quotient.eq_rel.1 hy)) + exact t.1.trans (t.1.symm <| t.2 <| Quotient.eq.1 hx) + (t.1.trans ht (t.2 <| Quotient.eq.1 hy)) · intros h _ _ hs rcases hs with ⟨a, b, hx, hy, Hs⟩ exact ⟨a, b, hx, hy, h Hs⟩ @@ -618,8 +618,8 @@ variable [MulOneClass M] [MulOneClass N] [MulOneClass P] (c : Con M) an `AddMonoid`."] instance mulOneClass : MulOneClass c.Quotient where one := ((1 : M) : c.Quotient) - mul_one x := Quotient.inductionOn' x fun _ => congr_arg ((↑) : M → c.Quotient) <| mul_one _ - one_mul x := Quotient.inductionOn' x fun _ => congr_arg ((↑) : M → c.Quotient) <| one_mul _ + mul_one x := Quotient.inductionOn x fun _ => congr_arg ((↑) : M → c.Quotient) <| mul_one _ + one_mul x := Quotient.inductionOn x fun _ => congr_arg ((↑) : M → c.Quotient) <| one_mul _ variable {c} @@ -715,7 +715,7 @@ variable {c} @[to_additive "The natural homomorphism from an `AddMonoid` to its quotient by a congruence relation is surjective."] theorem mk'_surjective : Surjective c.mk' := - Quotient.surjective_Quotient_mk'' + Quotient.surjective_mk @[to_additive (attr := simp)] theorem coe_mk' : (c.mk' : M → c.Quotient) = ((↑) : M → c.Quotient) := @@ -854,7 +854,7 @@ theorem kerLift_range_eq : MonoidHom.mrange (kerLift f) = MonoidHom.mrange f := @[to_additive "An `AddMonoid` homomorphism `f` induces an injective homomorphism on the quotient by `f`'s kernel."] theorem kerLift_injective (f : M →* P) : Injective (kerLift f) := fun x y => - Quotient.inductionOn₂' x y fun _ _ => (ker f).eq.2 + Quotient.inductionOn₂ x y fun _ _ => (ker f).eq.2 /-- Given congruence relations `c, d` on a monoid such that `d` contains `c`, `d`'s quotient map induces a homomorphism from the quotient by `c` to the quotient by `d`. -/ @@ -944,11 +944,11 @@ protected theorem pow {M : Type*} [Monoid M] (c : Con M) : @[to_additive] instance one [MulOneClass M] (c : Con M) : One c.Quotient where - -- Using Quotient.mk'' here instead of c.toQuotient + -- Using Quotient.mk here instead of c.toQuotient -- since c.toQuotient is not reducible. -- This would lead to non-defeq diamonds since this instance ends up in -- quotients modulo ideals. - one := Quotient.mk'' (1 : M) + one := ⟦1⟧ -- one := ((1 : M) : c.Quotient) @[to_additive] @@ -958,17 +958,17 @@ theorem smul {α M : Type*} [MulOneClass M] [SMul α M] [IsScalarTower α M M] ( instance _root_.AddCon.Quotient.nsmul {M : Type*} [AddMonoid M] (c : AddCon M) : SMul ℕ c.Quotient where - smul n := (Quotient.map' (n • ·)) fun _ _ => c.nsmul n + smul n := (Quotient.map (n • ·)) fun _ _ => c.nsmul n @[to_additive existing AddCon.Quotient.nsmul] instance {M : Type*} [Monoid M] (c : Con M) : Pow c.Quotient ℕ where - pow x n := Quotient.map' (fun x => x ^ n) (fun _ _ => c.pow n) x + pow x n := Quotient.map (fun x => x ^ n) (fun _ _ => c.pow n) x /-- The quotient of a semigroup by a congruence relation is a semigroup. -/ @[to_additive "The quotient of an `AddSemigroup` by an additive congruence relation is an `AddSemigroup`."] instance semigroup {M : Type*} [Semigroup M] (c : Con M) : Semigroup c.Quotient := - { (Function.Surjective.semigroup _ Quotient.surjective_Quotient_mk'' fun _ _ => rfl : + { (Function.Surjective.semigroup _ Quotient.surjective_mk fun _ _ => rfl : Semigroup c.Quotient) with /- The `toMul` field is given explicitly for performance reasons. This avoids any need to unfold `Function.Surjective.semigroup` when the type checker is checking @@ -979,7 +979,7 @@ instance semigroup {M : Type*} [Semigroup M] (c : Con M) : Semigroup c.Quotient @[to_additive "The quotient of an `AddCommSemigroup` by an additive congruence relation is an `AddCommSemigroup`."] instance commSemigroup {M : Type*} [CommSemigroup M] (c : Con M) : CommSemigroup c.Quotient := - { (Function.Surjective.commSemigroup _ Quotient.surjective_Quotient_mk'' fun _ _ => rfl : + { (Function.Surjective.commSemigroup _ Quotient.surjective_mk fun _ _ => rfl : CommSemigroup c.Quotient) with /- The `toSemigroup` field is given explicitly for performance reasons. This avoids any need to unfold `Function.Surjective.commSemigroup` when the type checker is @@ -990,7 +990,7 @@ instance commSemigroup {M : Type*} [CommSemigroup M] (c : Con M) : CommSemigroup @[to_additive "The quotient of an `AddMonoid` by an additive congruence relation is an `AddMonoid`."] instance monoid {M : Type*} [Monoid M] (c : Con M) : Monoid c.Quotient := - { (Function.Surjective.monoid _ Quotient.surjective_Quotient_mk'' rfl + { (Function.Surjective.monoid _ Quotient.surjective_mk rfl (fun _ _ => rfl) fun _ _ => rfl : Monoid c.Quotient) with /- The `toSemigroup` and `toOne` fields are given explicitly for performance reasons. This avoids any need to unfold `Function.Surjective.monoid` when the type checker is @@ -1002,7 +1002,7 @@ instance monoid {M : Type*} [Monoid M] (c : Con M) : Monoid c.Quotient := @[to_additive "The quotient of an `AddCommMonoid` by an additive congruence relation is an `AddCommMonoid`."] instance commMonoid {M : Type*} [CommMonoid M] (c : Con M) : CommMonoid c.Quotient := - { (Function.Surjective.commMonoid _ Quotient.surjective_Quotient_mk'' rfl + { (Function.Surjective.commMonoid _ Quotient.surjective_mk rfl (fun _ _ => rfl) fun _ _ => rfl : CommMonoid c.Quotient) with /- The `toMonoid` field is given explicitly for performance reasons. This avoids any need to unfold `Function.Surjective.commMonoid` when the type checker is @@ -1058,33 +1058,33 @@ protected theorem zpow : ∀ (n : ℤ) {w x}, c w x → c (w ^ n) (x ^ n) @[to_additive "The negation induced on the quotient by an additive congruence relation on a type with a negation."] instance hasInv : Inv c.Quotient := - ⟨(Quotient.map' Inv.inv) fun _ _ => c.inv⟩ + ⟨(Quotient.map Inv.inv) fun _ _ => c.inv⟩ /-- The division induced on the quotient by a congruence relation on a type with a division. -/ @[to_additive "The subtraction induced on the quotient by an additive congruence relation on a type with a subtraction."] instance hasDiv : Div c.Quotient := - ⟨(Quotient.map₂' (· / ·)) fun _ _ h₁ _ _ h₂ => c.div h₁ h₂⟩ + ⟨(Quotient.map₂ (· / ·)) fun _ _ h₁ _ _ h₂ => c.div h₁ h₂⟩ /-- The integer scaling induced on the quotient by a congruence relation on a type with a subtraction. -/ instance _root_.AddCon.Quotient.zsmul {M : Type*} [AddGroup M] (c : AddCon M) : SMul ℤ c.Quotient := - ⟨fun z => (Quotient.map' (z • ·)) fun _ _ => c.zsmul z⟩ + ⟨fun z => (Quotient.map (z • ·)) fun _ _ => c.zsmul z⟩ /-- The integer power induced on the quotient by a congruence relation on a type with a division. -/ @[to_additive existing AddCon.Quotient.zsmul] instance zpowinst : Pow c.Quotient ℤ := - ⟨fun x z => Quotient.map' (fun x => x ^ z) (fun _ _ h => c.zpow z h) x⟩ + ⟨fun x z => Quotient.map (fun x => x ^ z) (fun _ _ h => c.zpow z h) x⟩ /-- The quotient of a group by a congruence relation is a group. -/ @[to_additive "The quotient of an `AddGroup` by an additive congruence relation is an `AddGroup`."] instance group : Group c.Quotient := - { (Function.Surjective.group Quotient.mk'' - Quotient.surjective_Quotient_mk'' rfl (fun _ _ => rfl) (fun _ => rfl) + { (Function.Surjective.group (Quotient.mk _) + Quotient.surjective_mk rfl (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) fun _ _ => rfl : Group c.Quotient) with toMonoid := Con.monoid _ toInv := Con.hasInv _ @@ -1145,7 +1145,7 @@ section Actions @[to_additive] instance instSMul {α M : Type*} [MulOneClass M] [SMul α M] [IsScalarTower α M M] (c : Con M) : SMul α c.Quotient where - smul a := (Quotient.map' (a • ·)) fun _ _ => c.smul a + smul a := (Quotient.map (a • ·)) fun _ _ => c.smul a @[to_additive] theorem coe_smul {α M : Type*} [MulOneClass M] [SMul α M] [IsScalarTower α M M] (c : Con M) @@ -1155,13 +1155,13 @@ theorem coe_smul {α M : Type*} [MulOneClass M] [SMul α M] [IsScalarTower α M @[to_additive] instance mulAction {α M : Type*} [Monoid α] [MulOneClass M] [MulAction α M] [IsScalarTower α M M] (c : Con M) : MulAction α c.Quotient where - one_smul := Quotient.ind' fun _ => congr_arg Quotient.mk'' <| one_smul _ _ - mul_smul _ _ := Quotient.ind' fun _ => congr_arg Quotient.mk'' <| mul_smul _ _ _ + one_smul := Quotient.ind fun _ => congr_arg (Quotient.mk _) <| one_smul _ _ + mul_smul _ _ := Quotient.ind fun _ => congr_arg (Quotient.mk _) <| mul_smul _ _ _ instance mulDistribMulAction {α M : Type*} [Monoid α] [Monoid M] [MulDistribMulAction α M] [IsScalarTower α M M] (c : Con M) : MulDistribMulAction α c.Quotient := - { smul_one := fun _ => congr_arg Quotient.mk'' <| smul_one _ - smul_mul := fun _ => Quotient.ind₂' fun _ _ => congr_arg Quotient.mk'' <| smul_mul' _ _ _ } + { smul_one := fun _ => congr_arg (Quotient.mk _) <| smul_one _ + smul_mul := fun _ => Quotient.ind₂ fun _ _ => congr_arg (Quotient.mk _) <| smul_mul' _ _ _ } end Actions diff --git a/Mathlib/GroupTheory/Coprod/Basic.lean b/Mathlib/GroupTheory/Coprod/Basic.lean index 2349d4a1dad9b..30beba3c75b81 100644 --- a/Mathlib/GroupTheory/Coprod/Basic.lean +++ b/Mathlib/GroupTheory/Coprod/Basic.lean @@ -157,7 +157,7 @@ def mk : FreeMonoid (M ⊕ N) →* M ∗ N := Con.mk' _ theorem con_ker_mk : Con.ker mk = coprodCon M N := Con.mk'_ker _ @[to_additive] -theorem mk_surjective : Surjective (@mk M N _ _) := surjective_quot_mk _ +theorem mk_surjective : Surjective (@mk M N _ _) := Quot.surjective_mk @[to_additive (attr := simp)] theorem mrange_mk : MonoidHom.mrange (@mk M N _ _) = ⊤ := Con.mrange_mk' @@ -581,7 +581,7 @@ theorem con_inv_mul_cancel (x : FreeMonoid (G ⊕ H)) : @[to_additive] instance : Inv (G ∗ H) where - inv := Quotient.map' (fun w => ofList (w.toList.map (Sum.map Inv.inv Inv.inv)).reverse) fun _ _ ↦ + inv := Quotient.map (fun w => ofList (w.toList.map (Sum.map Inv.inv Inv.inv)).reverse) fun _ _ ↦ (coprodCon G H).map_of_mul_left_rel_one _ con_inv_mul_cancel @[to_additive] diff --git a/Mathlib/GroupTheory/Coset/Basic.lean b/Mathlib/GroupTheory/Coset/Basic.lean index b25a17f71817f..c5477be1fe67e 100644 --- a/Mathlib/GroupTheory/Coset/Basic.lean +++ b/Mathlib/GroupTheory/Coset/Basic.lean @@ -236,7 +236,7 @@ def leftRel : Setoid α := variable {s} @[to_additive] -theorem leftRel_apply {x y : α} : @Setoid.r _ (leftRel s) x y ↔ x⁻¹ * y ∈ s := +theorem leftRel_apply {x y : α} : leftRel s x y ↔ x⁻¹ * y ∈ s := calc (∃ a : s.op, y * MulOpposite.unop a = x) ↔ ∃ a : s, y * a = x := s.equivOp.symm.exists_congr_left @@ -247,19 +247,19 @@ theorem leftRel_apply {x y : α} : @Setoid.r _ (leftRel s) x y ↔ x⁻¹ * y variable (s) @[to_additive] -theorem leftRel_eq : @Setoid.r _ (leftRel s) = fun x y => x⁻¹ * y ∈ s := +theorem leftRel_eq : ⇑(leftRel s) = fun x y => x⁻¹ * y ∈ s := funext₂ <| by simp only [eq_iff_iff] apply leftRel_apply theorem leftRel_r_eq_leftCosetEquivalence : - @Setoid.r _ (QuotientGroup.leftRel s) = LeftCosetEquivalence s := by + ⇑(QuotientGroup.leftRel s) = LeftCosetEquivalence s := by ext rw [leftRel_eq] exact (leftCoset_eq_iff s).symm @[to_additive] -instance leftRelDecidable [DecidablePred (· ∈ s)] : DecidableRel (leftRel s).r := fun x y => by +instance leftRelDecidable [DecidablePred (· ∈ s)] : DecidableRel (leftRel s) := fun x y => by rw [leftRel_eq] exact ‹DecidablePred (· ∈ s)› _ @@ -280,7 +280,7 @@ def rightRel : Setoid α := variable {s} @[to_additive] -theorem rightRel_apply {x y : α} : @Setoid.r _ (rightRel s) x y ↔ y * x⁻¹ ∈ s := +theorem rightRel_apply {x y : α} : rightRel s x y ↔ y * x⁻¹ ∈ s := calc (∃ a : s, (a : α) * y = x) ↔ ∃ a : s, y * x⁻¹ = a⁻¹ := by simp only [mul_inv_eq_iff_eq_mul, Subgroup.coe_inv, eq_inv_mul_iff_mul_eq] @@ -289,19 +289,19 @@ theorem rightRel_apply {x y : α} : @Setoid.r _ (rightRel s) x y ↔ y * x⁻¹ variable (s) @[to_additive] -theorem rightRel_eq : @Setoid.r _ (rightRel s) = fun x y => y * x⁻¹ ∈ s := +theorem rightRel_eq : ⇑(rightRel s) = fun x y => y * x⁻¹ ∈ s := funext₂ <| by simp only [eq_iff_iff] apply rightRel_apply theorem rightRel_r_eq_rightCosetEquivalence : - @Setoid.r _ (QuotientGroup.rightRel s) = RightCosetEquivalence s := by + ⇑(QuotientGroup.rightRel s) = RightCosetEquivalence s := by ext rw [rightRel_eq] exact (rightCoset_eq_iff s).symm @[to_additive] -instance rightRelDecidable [DecidablePred (· ∈ s)] : DecidableRel (rightRel s).r := fun x y => by +instance rightRelDecidable [DecidablePred (· ∈ s)] : DecidableRel (rightRel s) := fun x y => by rw [rightRel_eq] exact ‹DecidablePred (· ∈ s)› _ @@ -309,23 +309,23 @@ instance rightRelDecidable [DecidablePred (· ∈ s)] : DecidableRel (rightRel s @[to_additive "Right cosets are in bijection with left cosets."] def quotientRightRelEquivQuotientLeftRel : Quotient (QuotientGroup.rightRel s) ≃ α ⧸ s where toFun := - Quotient.map' (fun g => g⁻¹) fun a b => by + Quotient.map (fun g => g⁻¹) fun a b => by rw [leftRel_apply, rightRel_apply] exact fun h => (congr_arg (· ∈ s) (by simp [mul_assoc])).mp (s.inv_mem h) -- Porting note: replace with `by group` invFun := - Quotient.map' (fun g => g⁻¹) fun a b => by + Quotient.map (fun g => g⁻¹) fun a b => by rw [leftRel_apply, rightRel_apply] exact fun h => (congr_arg (· ∈ s) (by simp [mul_assoc])).mp (s.inv_mem h) -- Porting note: replace with `by group` left_inv g := - Quotient.inductionOn' g fun g => + Quotient.inductionOn g fun g => Quotient.sound' (by simp only [inv_inv] exact Quotient.exact' rfl) right_inv g := - Quotient.inductionOn' g fun g => + Quotient.inductionOn g fun g => Quotient.sound' (by simp only [inv_inv] @@ -354,18 +354,18 @@ instance fintype [Fintype α] (s : Subgroup α) [DecidableRel (leftRel s).r] : F /-- The canonical map from a group `α` to the quotient `α ⧸ s`. -/ @[to_additive (attr := coe) "The canonical map from an `AddGroup` `α` to the quotient `α ⧸ s`."] abbrev mk (a : α) : α ⧸ s := - Quotient.mk'' a + ⟦a⟧ @[to_additive] theorem mk_surjective : Function.Surjective <| @mk _ _ s := - Quotient.surjective_Quotient_mk'' + Quotient.surjective_mk @[to_additive (attr := simp)] lemma range_mk : range (QuotientGroup.mk (s := s)) = univ := range_iff_surjective.mpr mk_surjective @[to_additive (attr := elab_as_elim)] theorem induction_on {C : α ⧸ s → Prop} (x : α ⧸ s) (H : ∀ z, C (QuotientGroup.mk z)) : C x := - Quotient.inductionOn' x H + Quotient.inductionOn x H @[to_additive] instance : Coe α (α ⧸ s) := @@ -374,7 +374,7 @@ instance : Coe α (α ⧸ s) := @[to_additive (attr := deprecated (since := "2024-08-04"))] alias induction_on' := induction_on @[to_additive (attr := simp)] -theorem quotient_liftOn_mk {β} (f : α → β) (h) (x : α) : Quotient.liftOn' (x : α ⧸ s) f h = f x := +theorem quotient_liftOn_mk {β} (f : α → β) (h) (x : α) : Quotient.liftOn (x : α ⧸ s) f h = f x := rfl @[to_additive] @@ -392,23 +392,23 @@ instance (s : Subgroup α) : Inhabited (α ⧸ s) := @[to_additive] protected theorem eq {a b : α} : (a : α ⧸ s) = b ↔ a⁻¹ * b ∈ s := calc - _ ↔ @Setoid.r _ (leftRel s) a b := Quotient.eq'' + _ ↔ leftRel s a b := Quotient.eq _ ↔ _ := by rw [leftRel_apply] @[to_additive (attr := deprecated (since := "2024-08-04"))] alias eq' := QuotientGroup.eq @[to_additive] -- Porting note (#10618): `simp` can prove this. -theorem out_eq' (a : α ⧸ s) : mk a.out' = a := - Quotient.out_eq' a +theorem out_eq (a : α ⧸ s) : mk a.out = a := + Quotient.out_eq a variable (s) /- It can be useful to write `obtain ⟨h, H⟩ := mk_out'_eq_mul ...`, and then `rw [H]` or `simp_rw [H]` or `simp only [H]`. In order for `simp_rw` and `simp only` to work, this lemma is - stated in terms of an arbitrary `h : s`, rather than the specific `h = g⁻¹ * (mk g).out'`. -/ + stated in terms of an arbitrary `h : s`, rather than the specific `h = g⁻¹ * (mk g).out`. -/ @[to_additive QuotientAddGroup.mk_out'_eq_mul] -theorem mk_out'_eq_mul (g : α) : ∃ h : s, (mk g : α ⧸ s).out' = g * h := - ⟨⟨g⁻¹ * (mk g).out', QuotientGroup.eq.mp (mk g).out_eq'.symm⟩, by rw [mul_inv_cancel_left]⟩ +theorem mk_out'_eq_mul (g : α) : ∃ h : s, (mk g : α ⧸ s).out = g * h := + ⟨⟨g⁻¹ * (mk g).out, QuotientGroup.eq.mp (mk g).out_eq.symm⟩, by rw [mul_inv_cancel_left]⟩ variable {s} {a b : α} @@ -464,13 +464,13 @@ def rightCosetEquivSubgroup (g : α) : (op g • s : Set α) ≃ s := noncomputable def groupEquivQuotientProdSubgroup : α ≃ (α ⧸ s) × s := calc α ≃ ΣL : α ⧸ s, { x : α // (x : α ⧸ s) = L } := (Equiv.sigmaFiberEquiv QuotientGroup.mk).symm - _ ≃ ΣL : α ⧸ s, (Quotient.out' L • s : Set α) := + _ ≃ ΣL : α ⧸ s, (Quotient.out L • s : Set α) := Equiv.sigmaCongrRight fun L => by rw [← eq_class_eq_leftCoset] show - (_root_.Subtype fun x : α => Quotient.mk'' x = L) ≃ - _root_.Subtype fun x : α => Quotient.mk'' x = Quotient.mk'' _ - simp [-Quotient.eq''] + (_root_.Subtype fun x : α => ⟦x⟧ = L) ≃ + _root_.Subtype fun x : α => ⟦x⟧ = Quotient.mk _ _ + simp rfl _ ≃ Σ _L : α ⧸ s, s := Equiv.sigmaCongrRight fun L => leftCosetEquivSubgroup _ _ ≃ (α ⧸ s) × s := Equiv.sigmaEquivProd _ _ @@ -480,8 +480,8 @@ variable {t : Subgroup α} /-- If two subgroups `M` and `N` of `G` are equal, their quotients are in bijection. -/ @[to_additive "If two subgroups `M` and `N` of `G` are equal, their quotients are in bijection."] def quotientEquivOfEq (h : s = t) : α ⧸ s ≃ α ⧸ t where - toFun := Quotient.map' id fun _a _b h' => h ▸ h' - invFun := Quotient.map' id fun _a _b h' => h.symm ▸ h' + toFun := Quotient.map id fun _a _b h' => h ▸ h' + invFun := Quotient.map id fun _a _b h' => h.symm ▸ h' left_inv q := induction_on q fun _g => rfl right_inv q := induction_on q fun _g => rfl @@ -497,8 +497,8 @@ of the quotient map `G → G/K`. The classical version is `Subgroup.quotientEqui def quotientEquivProdOfLE' (h_le : s ≤ t) (f : α ⧸ t → α) (hf : Function.RightInverse f QuotientGroup.mk) : α ⧸ s ≃ (α ⧸ t) × t ⧸ s.subgroupOf t where toFun a := - ⟨a.map' id fun b c h => leftRel_apply.mpr (h_le (leftRel_apply.mp h)), - a.map' (fun g : α => ⟨(f (Quotient.mk'' g))⁻¹ * g, leftRel_apply.mp (Quotient.exact' (hf g))⟩) + ⟨a.map id fun b c h => leftRel_apply.mpr (h_le (leftRel_apply.mp h)), + a.map (fun g : α => ⟨(f ⟦g⟧)⁻¹ * g, leftRel_apply.mp (Quotient.exact' (hf g))⟩) fun b c h => by rw [leftRel_apply] change ((f b)⁻¹ * b)⁻¹ * ((f c)⁻¹ * c) ∈ s @@ -506,27 +506,27 @@ def quotientEquivProdOfLE' (h_le : s ≤ t) (f : α ⧸ t → α) congr_arg f (Quotient.sound' (leftRel_apply.mpr (h_le (leftRel_apply.mp h)))) rwa [key, mul_inv_rev, inv_inv, mul_assoc, mul_inv_cancel_left, ← leftRel_apply]⟩ invFun a := by - refine a.2.map' (fun (b : { x // x ∈ t}) => f a.1 * b) fun b c h => by + refine a.2.map (fun (b : { x // x ∈ t}) => f a.1 * b) fun b c h => by rw [leftRel_apply] at h ⊢ change (f a.1 * b)⁻¹ * (f a.1 * c) ∈ s rwa [mul_inv_rev, mul_assoc, inv_mul_cancel_left] left_inv := by - refine Quotient.ind' fun a => ?_ - simp_rw [Quotient.map'_mk'', id, mul_inv_cancel_left] + refine Quotient.ind fun a => ?_ + simp_rw [Quotient.map_mk, id, mul_inv_cancel_left] right_inv := by refine Prod.rec ?_ - refine Quotient.ind' fun a => ?_ - refine Quotient.ind' fun b => ?_ - have key : Quotient.mk'' (f (Quotient.mk'' a) * b) = Quotient.mk'' a := + refine Quotient.ind fun a => ?_ + refine Quotient.ind fun b => ?_ + have key : ⟦f ⟦a⟧ * b⟧ = ⟦a⟧ := (QuotientGroup.mk_mul_of_mem (f a) b.2).trans (hf a) - simp_rw [Quotient.map'_mk'', id, key, inv_mul_cancel_left] + simp_rw [Quotient.map_mk, id, key, inv_mul_cancel_left] /-- If `H ≤ K`, then `G/H ≃ G/K × K/H` nonconstructively. The constructive version is `quotientEquivProdOfLE'`. -/ @[to_additive (attr := simps!) "If `H ≤ K`, then `G/H ≃ G/K × K/H` nonconstructively. The constructive version is `quotientEquivProdOfLE'`."] noncomputable def quotientEquivProdOfLE (h_le : s ≤ t) : α ⧸ s ≃ (α ⧸ t) × t ⧸ s.subgroupOf t := - quotientEquivProdOfLE' h_le Quotient.out' Quotient.out_eq' + quotientEquivProdOfLE' h_le Quotient.out Quotient.out_eq /-- If `s ≤ t`, then there is an embedding `s ⧸ H.subgroupOf s ↪ t ⧸ H.subgroupOf t`. -/ @[to_additive "If `s ≤ t`, then there is an embedding @@ -534,13 +534,13 @@ noncomputable def quotientEquivProdOfLE (h_le : s ≤ t) : α ⧸ s ≃ (α ⧸ def quotientSubgroupOfEmbeddingOfLE (H : Subgroup α) (h : s ≤ t) : s ⧸ H.subgroupOf s ↪ t ⧸ H.subgroupOf t where toFun := - Quotient.map' (inclusion h) fun a b => by + Quotient.map (inclusion h) fun a b => by simp_rw [leftRel_eq] exact id inj' := - Quotient.ind₂' <| by + Quotient.ind₂ <| by intro a b h - simpa only [Quotient.map'_mk'', QuotientGroup.eq] using h + simpa only [Quotient.map_mk, QuotientGroup.eq] using h -- Porting note: I had to add the type ascription to the right-hand side or else Lean times out. @[to_additive (attr := simp)] @@ -553,7 +553,7 @@ theorem quotientSubgroupOfEmbeddingOfLE_apply_mk (H : Subgroup α) (h : s ≤ t) @[to_additive "If `s ≤ t`, then there is a map `H ⧸ s.addSubgroupOf H → H ⧸ t.addSubgroupOf H`."] def quotientSubgroupOfMapOfLE (H : Subgroup α) (h : s ≤ t) : H ⧸ s.subgroupOf H → H ⧸ t.subgroupOf H := - Quotient.map' id fun a b => by + Quotient.map id fun a b => by simp_rw [leftRel_eq] apply h @@ -567,7 +567,7 @@ theorem quotientSubgroupOfMapOfLE_apply_mk (H : Subgroup α) (h : s ≤ t) (g : /-- If `s ≤ t`, then there is a map `α ⧸ s → α ⧸ t`. -/ @[to_additive "If `s ≤ t`, then there is a map `α ⧸ s → α ⧸ t`."] def quotientMapOfLE (h : s ≤ t) : α ⧸ s → α ⧸ t := - Quotient.map' id fun a b => by + Quotient.map id fun a b => by simp_rw [leftRel_eq] apply h @@ -583,7 +583,7 @@ def quotientiInfSubgroupOfEmbedding {ι : Type*} (f : ι → Subgroup α) (H : S H ⧸ (⨅ i, f i).subgroupOf H ↪ ∀ i, H ⧸ (f i).subgroupOf H where toFun q i := quotientSubgroupOfMapOfLE H (iInf_le f i) q inj' := - Quotient.ind₂' <| by + Quotient.ind₂ <| by simp_rw [funext_iff, quotientSubgroupOfMapOfLE_apply_mk, QuotientGroup.eq, mem_subgroupOf, mem_iInf, imp_self, forall_const] @@ -600,7 +600,7 @@ theorem quotientiInfSubgroupOfEmbedding_apply_mk {ι : Type*} (f : ι → Subgro def quotientiInfEmbedding {ι : Type*} (f : ι → Subgroup α) : (α ⧸ ⨅ i, f i) ↪ ∀ i, α ⧸ f i where toFun q i := quotientMapOfLE (iInf_le f i) q inj' := - Quotient.ind₂' <| by + Quotient.ind₂ <| by simp_rw [funext_iff, quotientMapOfLE_apply_mk, QuotientGroup.eq, mem_iInf, imp_self, forall_const] @@ -675,13 +675,13 @@ variable [Group α] noncomputable def preimageMkEquivSubgroupProdSet (s : Subgroup α) (t : Set (α ⧸ s)) : QuotientGroup.mk ⁻¹' t ≃ s × t where toFun a := - ⟨⟨((Quotient.out' (QuotientGroup.mk a)) : α)⁻¹ * a, - leftRel_apply.mp (@Quotient.exact' _ (leftRel s) _ _ <| Quotient.out_eq' _)⟩, + ⟨⟨((Quotient.out (QuotientGroup.mk a)) : α)⁻¹ * a, + leftRel_apply.mp (@Quotient.exact' _ (leftRel s) _ _ <| Quotient.out_eq _)⟩, ⟨QuotientGroup.mk a, a.2⟩⟩ invFun a := - ⟨Quotient.out' a.2.1 * a.1.1, + ⟨Quotient.out a.2.1 * a.1.1, show QuotientGroup.mk _ ∈ t by - rw [mk_mul_of_mem _ a.1.2, out_eq'] + rw [mk_mul_of_mem _ a.1.2, out_eq] exact a.2.2⟩ left_inv := fun ⟨a, ha⟩ => Subtype.eq <| show _ * _ = a by simp right_inv := fun ⟨⟨a, ha⟩, ⟨x, hx⟩⟩ => by ext <;> simp [ha] diff --git a/Mathlib/GroupTheory/DoubleCoset.lean b/Mathlib/GroupTheory/DoubleCoset.lean index 1d710162e3e55..4b79faeccb1b8 100644 --- a/Mathlib/GroupTheory/DoubleCoset.lean +++ b/Mathlib/GroupTheory/DoubleCoset.lean @@ -72,15 +72,15 @@ def Quotient (H K : Set G) : Type _ := _root_.Quotient (setoid H K) theorem rel_iff {H K : Subgroup G} {x y : G} : - (setoid ↑H ↑K).Rel x y ↔ ∃ a ∈ H, ∃ b ∈ K, y = a * x * b := + setoid ↑H ↑K x y ↔ ∃ a ∈ H, ∃ b ∈ K, y = a * x * b := Iff.trans ⟨fun hxy => (congr_arg _ hxy).mpr (mem_doset_self H K y), fun hxy => (doset_eq_of_mem hxy).symm⟩ mem_doset theorem bot_rel_eq_leftRel (H : Subgroup G) : - (setoid ↑(⊥ : Subgroup G) ↑H).Rel = (QuotientGroup.leftRel H).Rel := by + ⇑(setoid ↑(⊥ : Subgroup G) ↑H) = ⇑(QuotientGroup.leftRel H) := by ext a b - rw [rel_iff, Setoid.Rel, QuotientGroup.leftRel_apply] + rw [rel_iff, QuotientGroup.leftRel_apply] constructor · rintro ⟨a, rfl : a = 1, b, hb, rfl⟩ change a⁻¹ * (1 * a * b) ∈ H @@ -89,9 +89,9 @@ theorem bot_rel_eq_leftRel (H : Subgroup G) : exact ⟨1, rfl, a⁻¹ * b, h, by rw [one_mul, mul_inv_cancel_left]⟩ theorem rel_bot_eq_right_group_rel (H : Subgroup G) : - (setoid ↑H ↑(⊥ : Subgroup G)).Rel = (QuotientGroup.rightRel H).Rel := by + ⇑(setoid ↑H ↑(⊥ : Subgroup G)) = ⇑(QuotientGroup.rightRel H) := by ext a b - rw [rel_iff, Setoid.Rel, QuotientGroup.rightRel_apply] + rw [rel_iff, QuotientGroup.rightRel_apply] constructor · rintro ⟨b, hb, a, rfl : a = 1, rfl⟩ change b * a * 1 * a⁻¹ ∈ H @@ -101,27 +101,27 @@ theorem rel_bot_eq_right_group_rel (H : Subgroup G) : /-- Create a doset out of an element of `H \ G / K`-/ def quotToDoset (H K : Subgroup G) (q : Quotient (H : Set G) K) : Set G := - doset q.out' H K + doset q.out H K /-- Map from `G` to `H \ G / K`-/ abbrev mk (H K : Subgroup G) (a : G) : Quotient (H : Set G) K := - Quotient.mk'' a + ⟦a⟧ instance (H K : Subgroup G) : Inhabited (Quotient (H : Set G) K) := ⟨mk H K (1 : G)⟩ theorem eq (H K : Subgroup G) (a b : G) : mk H K a = mk H K b ↔ ∃ h ∈ H, ∃ k ∈ K, b = h * a * k := by - rw [Quotient.eq''] + rw [Quotient.eq] apply rel_iff -theorem out_eq' (H K : Subgroup G) (q : Quotient ↑H ↑K) : mk H K q.out' = q := - Quotient.out_eq' q +theorem out_eq (H K : Subgroup G) (q : Quotient ↑H ↑K) : mk H K q.out = q := + Quotient.out_eq q theorem mk_out'_eq_mul (H K : Subgroup G) (g : G) : - ∃ h k : G, h ∈ H ∧ k ∈ K ∧ (mk H K g : Quotient ↑H ↑K).out' = h * g * k := by - have := eq H K (mk H K g : Quotient ↑H ↑K).out' g - rw [out_eq'] at this + ∃ h k : G, h ∈ H ∧ k ∈ K ∧ (mk H K g : Quotient ↑H ↑K).out = h * g * k := by + have := eq H K (mk H K g : Quotient ↑H ↑K).out g + rw [out_eq] at this obtain ⟨h, h_h, k, hk, T⟩ := this.1 rfl refine ⟨h⁻¹, k⁻¹, H.inv_mem h_h, K.inv_mem hk, eq_mul_inv_of_mul_eq (eq_inv_mul_of_mul_eq ?_)⟩ rw [← mul_assoc, ← T] @@ -132,10 +132,10 @@ theorem mk_eq_of_doset_eq {H K : Subgroup G} {a b : G} (h : doset a H K = doset exact mem_doset.mp (h.symm ▸ mem_doset_self H K b) theorem disjoint_out' {H K : Subgroup G} {a b : Quotient H.1 K} : - a ≠ b → Disjoint (doset a.out' H K) (doset b.out' (H : Set G) K) := by + a ≠ b → Disjoint (doset a.out H K) (doset b.out (H : Set G) K) := by contrapose! intro h - simpa [out_eq'] using mk_eq_of_doset_eq (eq_of_not_disjoint h) + simpa [out_eq] using mk_eq_of_doset_eq (eq_of_not_disjoint h) theorem union_quotToDoset (H K : Subgroup G) : ⋃ q, quotToDoset H K q = Set.univ := by ext x @@ -177,7 +177,6 @@ theorem left_bot_eq_left_quot (H : Subgroup G) : congr ext simp_rw [← bot_rel_eq_leftRel H] - rfl theorem right_bot_eq_right_quot (H : Subgroup G) : Quotient (H.1 : Set G) (⊥ : Subgroup G) = _root_.Quotient (QuotientGroup.rightRel H) := by @@ -185,6 +184,5 @@ theorem right_bot_eq_right_quot (H : Subgroup G) : congr ext simp_rw [← rel_bot_eq_right_group_rel H] - rfl end Doset diff --git a/Mathlib/GroupTheory/FreeAbelianGroup.lean b/Mathlib/GroupTheory/FreeAbelianGroup.lean index 2fc7ca86f0f66..230e029d9c1b9 100644 --- a/Mathlib/GroupTheory/FreeAbelianGroup.lean +++ b/Mathlib/GroupTheory/FreeAbelianGroup.lean @@ -146,7 +146,7 @@ attribute [local instance] QuotientGroup.leftRel protected theorem induction_on {C : FreeAbelianGroup α → Prop} (z : FreeAbelianGroup α) (C0 : C 0) (C1 : ∀ x, C <| of x) (Cn : ∀ x, C (of x) → C (-of x)) (Cp : ∀ x y, C x → C y → C (x + y)) : C z := - Quotient.inductionOn' z fun x ↦ + Quotient.inductionOn z fun x ↦ Quot.inductionOn x fun L ↦ List.recOn L C0 fun ⟨x, b⟩ _ ih ↦ Bool.recOn b (Cp _ _ (Cn _ (C1 x)) ih) (Cp _ _ (C1 x) ih) diff --git a/Mathlib/GroupTheory/GroupAction/Basic.lean b/Mathlib/GroupTheory/GroupAction/Basic.lean index d7f65f24f03ac..c476c086f3e4e 100644 --- a/Mathlib/GroupTheory/GroupAction/Basic.lean +++ b/Mathlib/GroupTheory/GroupAction/Basic.lean @@ -366,12 +366,10 @@ def orbitRel : Setoid α where variable {G α} @[to_additive] -theorem orbitRel_apply {a b : α} : (orbitRel G α).Rel a b ↔ a ∈ orbit G b := +theorem orbitRel_apply {a b : α} : orbitRel G α a b ↔ a ∈ orbit G b := Iff.rfl -@[to_additive] -lemma orbitRel_r_apply {a b : α} : (orbitRel G _).r a b ↔ a ∈ orbit G b := - Iff.rfl +@[to_additive (attr := deprecated (since := "2024-08-28"))] alias orbitRel_r_apply := orbitRel_apply @[to_additive] lemma orbitRel_subgroup_le (H : Subgroup G) : orbitRel H α ≤ orbitRel G α := @@ -461,7 +459,7 @@ theorem pretransitive_iff_subsingleton_quotient : · refine Quot.inductionOn a (fun x ↦ ?_) exact Quot.inductionOn b (fun y ↦ Quot.sound <| exists_smul_eq G y x) · have h : Quotient.mk (orbitRel G α) b = ⟦a⟧ := Subsingleton.elim _ _ - exact Quotient.eq_rel.mp h + exact Quotient.eq.mp h /-- If `α` is non-empty, an action is pretransitive if and only if the quotient has exactly one element. -/ @@ -477,22 +475,22 @@ variable {G α} /-- The orbit corresponding to an element of the quotient by `MulAction.orbitRel` -/ @[to_additive "The orbit corresponding to an element of the quotient by `AddAction.orbitRel`"] nonrec def orbitRel.Quotient.orbit (x : orbitRel.Quotient G α) : Set α := - Quotient.liftOn' x (orbit G) fun _ _ => MulAction.orbit_eq_iff.2 + Quotient.liftOn x (orbit G) fun _ _ => MulAction.orbit_eq_iff.2 @[to_additive (attr := simp)] theorem orbitRel.Quotient.orbit_mk (a : α) : - orbitRel.Quotient.orbit (Quotient.mk'' a : orbitRel.Quotient G α) = MulAction.orbit G a := + orbitRel.Quotient.orbit (⟦a⟧ : orbitRel.Quotient G α) = MulAction.orbit G a := rfl @[to_additive] theorem orbitRel.Quotient.mem_orbit {a : α} {x : orbitRel.Quotient G α} : - a ∈ x.orbit ↔ Quotient.mk'' a = x := by - induction x using Quotient.inductionOn' - rw [Quotient.eq''] + a ∈ x.orbit ↔ Quotient.mk _ a = x := by + induction x using Quotient.inductionOn + rw [Quotient.eq] rfl -/-- Note that `hφ = Quotient.out_eq'` is a useful choice here. -/ -@[to_additive "Note that `hφ = Quotient.out_eq'` is a useful choice here."] +/-- Note that `hφ = Quotient.out_eq` is a useful choice here. -/ +@[to_additive "Note that `hφ = Quotient.out_eq` is a useful choice here."] theorem orbitRel.Quotient.orbit_eq_orbit_out (x : orbitRel.Quotient G α) {φ : orbitRel.Quotient G α → α} (hφ : letI := orbitRel G α; RightInverse φ Quotient.mk') : orbitRel.Quotient.orbit x = MulAction.orbit G (φ x) := by @@ -503,9 +501,9 @@ theorem orbitRel.Quotient.orbit_eq_orbit_out (x : orbitRel.Quotient G α) lemma orbitRel.Quotient.orbit_injective : Injective (orbitRel.Quotient.orbit : orbitRel.Quotient G α → Set α) := by intro x y h - simp_rw [orbitRel.Quotient.orbit_eq_orbit_out _ Quotient.out_eq', orbit_eq_iff, - ← orbitRel_r_apply] at h - simpa [← Quotient.eq''] using h + simp_rw [orbitRel.Quotient.orbit_eq_orbit_out _ Quotient.out_eq, orbit_eq_iff, + ← orbitRel_apply] at h + simpa [← Quotient.eq] using h @[to_additive (attr := simp)] lemma orbitRel.Quotient.orbit_inj {x y : orbitRel.Quotient G α} : x.orbit = y.orbit ↔ x = y := @@ -519,21 +517,21 @@ lemma orbitRel.quotient_eq_of_quotient_subgroup_eq {H : Subgroup G} {a b : α} @[to_additive] lemma orbitRel.quotient_eq_of_quotient_subgroup_eq' {H : Subgroup G} {a b : α} - (h : (Quotient.mk'' a : orbitRel.Quotient H α) = Quotient.mk'' b) : - (Quotient.mk'' a : orbitRel.Quotient G α) = Quotient.mk'' b := + (h : (⟦a⟧ : orbitRel.Quotient H α) = ⟦b⟧) : + (⟦a⟧ : orbitRel.Quotient G α) = ⟦b⟧ := orbitRel.quotient_eq_of_quotient_subgroup_eq h @[to_additive] nonrec lemma orbitRel.Quotient.orbit_nonempty (x : orbitRel.Quotient G α) : Set.Nonempty x.orbit := by - rw [orbitRel.Quotient.orbit_eq_orbit_out x Quotient.out_eq'] + rw [orbitRel.Quotient.orbit_eq_orbit_out x Quotient.out_eq] exact orbit_nonempty _ @[to_additive] nonrec lemma orbitRel.Quotient.mapsTo_smul_orbit (g : G) (x : orbitRel.Quotient G α) : Set.MapsTo (g • ·) x.orbit x.orbit := by - rw [orbitRel.Quotient.orbit_eq_orbit_out x Quotient.out_eq'] - exact mapsTo_smul_orbit g x.out' + rw [orbitRel.Quotient.orbit_eq_orbit_out x Quotient.out_eq] + exact mapsTo_smul_orbit g x.out @[to_additive] instance (x : orbitRel.Quotient G α) : MulAction G x.orbit where @@ -549,9 +547,9 @@ lemma orbitRel.Quotient.orbit.coe_smul {g : G} {x : orbitRel.Quotient G α} {a : @[to_additive] instance (x : orbitRel.Quotient G α) : IsPretransitive G x.orbit where exists_smul_eq := by - induction x using Quotient.inductionOn' + induction x using Quotient.inductionOn rintro ⟨y, yh⟩ ⟨z, zh⟩ - rw [orbitRel.Quotient.mem_orbit, Quotient.eq''] at yh zh + rw [orbitRel.Quotient.mem_orbit, Quotient.eq] at yh zh rcases yh with ⟨g, rfl⟩ rcases zh with ⟨h, rfl⟩ refine ⟨h * g⁻¹, ?_⟩ @@ -575,7 +573,7 @@ lemma orbitRel.Quotient.mem_subgroup_orbit_iff {H : Subgroup G} {x : orbitRel.Qu lemma orbitRel.Quotient.subgroup_quotient_eq_iff {H : Subgroup G} {x : orbitRel.Quotient G α} {a b : x.orbit} : (⟦a⟧ : orbitRel.Quotient H x.orbit) = ⟦b⟧ ↔ (⟦↑a⟧ : orbitRel.Quotient H α) = ⟦↑b⟧ := by - simp_rw [← @Quotient.mk''_eq_mk, Quotient.eq''] + simp_rw [Quotient.eq] exact orbitRel.Quotient.mem_subgroup_orbit_iff.symm @[to_additive] @@ -586,12 +584,12 @@ lemma orbitRel.Quotient.mem_subgroup_orbit_iff' {H : Subgroup G} {x : orbitRel.Q convert Iff.rfl using 2 rw [orbit_eq_iff] suffices hb : ↑b ∈ orbitRel.Quotient.orbit (⟦a⟧ : orbitRel.Quotient H x.orbit) by - rw [orbitRel.Quotient.orbit_eq_orbit_out (⟦a⟧ : orbitRel.Quotient H x.orbit) Quotient.out_eq'] + rw [orbitRel.Quotient.orbit_eq_orbit_out (⟦a⟧ : orbitRel.Quotient H x.orbit) Quotient.out_eq] at hb rw [orbitRel.Quotient.mem_subgroup_orbit_iff] convert hb using 1 - rw [orbit_eq_iff, ← orbitRel_r_apply, ← Quotient.eq'', Quotient.out_eq', @Quotient.mk''_eq_mk] - rw [orbitRel.Quotient.mem_orbit, h, @Quotient.mk''_eq_mk] + rw [orbit_eq_iff, ← orbitRel_apply, ← Quotient.eq, Quotient.out_eq] + rw [orbitRel.Quotient.mem_orbit, h] variable (G) (α) @@ -600,12 +598,12 @@ local notation "Ω" => orbitRel.Quotient G α /-- Decomposition of a type `X` as a disjoint union of its orbits under a group action. This version is expressed in terms of `MulAction.orbitRel.Quotient.orbit` instead of -`MulAction.orbit`, to avoid mentioning `Quotient.out'`. -/ +`MulAction.orbit`, to avoid mentioning `Quotient.out`. -/ @[to_additive "Decomposition of a type `X` as a disjoint union of its orbits under an additive group action. This version is expressed in terms of `AddAction.orbitRel.Quotient.orbit` instead of - `AddAction.orbit`, to avoid mentioning `Quotient.out'`. "] + `AddAction.orbit`, to avoid mentioning `Quotient.out`. "] def selfEquivSigmaOrbits' : α ≃ Σω : Ω, ω.orbit := letI := orbitRel G α calc @@ -618,10 +616,10 @@ def selfEquivSigmaOrbits' : α ≃ Σω : Ω, ω.orbit := @[to_additive "Decomposition of a type `X` as a disjoint union of its orbits under an additive group action."] -def selfEquivSigmaOrbits : α ≃ Σω : Ω, orbit G ω.out' := +def selfEquivSigmaOrbits : α ≃ Σω : Ω, orbit G ω.out := (selfEquivSigmaOrbits' G α).trans <| Equiv.sigmaCongrRight fun _ => - Equiv.Set.ofEq <| orbitRel.Quotient.orbit_eq_orbit_out _ Quotient.out_eq' + Equiv.Set.ofEq <| orbitRel.Quotient.orbit_eq_orbit_out _ Quotient.out_eq variable (β) @@ -700,7 +698,7 @@ theorem stabilizer_smul_eq_stabilizer_map_conj (g : G) (a : α) : inv_mul_cancel, one_smul, ← mem_stabilizer_iff, Subgroup.mem_map_equiv, MulAut.conj_symm_apply] /-- A bijection between the stabilizers of two elements in the same orbit. -/ -noncomputable def stabilizerEquivStabilizerOfOrbitRel {a b : α} (h : (orbitRel G α).Rel a b) : +noncomputable def stabilizerEquivStabilizerOfOrbitRel {a b : α} (h : orbitRel G α a b) : stabilizer G a ≃* stabilizer G b := let g : G := Classical.choose h have hg : g • b = a := Classical.choose_spec h @@ -724,7 +722,7 @@ theorem stabilizer_vadd_eq_stabilizer_map_conj (g : G) (a : α) : AddAut.conj_symm_apply] /-- A bijection between the stabilizers of two elements in the same orbit. -/ -noncomputable def stabilizerEquivStabilizerOfOrbitRel {a b : α} (h : (orbitRel G α).Rel a b) : +noncomputable def stabilizerEquivStabilizerOfOrbitRel {a b : α} (h : orbitRel G α a b) : stabilizer G a ≃+ stabilizer G b := let g : G := Classical.choose h have hg : g +ᵥ b = a := Classical.choose_spec h diff --git a/Mathlib/GroupTheory/GroupAction/ConjAct.lean b/Mathlib/GroupTheory/GroupAction/ConjAct.lean index b16c6ce0f2902..8b7d397bdecf8 100644 --- a/Mathlib/GroupTheory/GroupAction/ConjAct.lean +++ b/Mathlib/GroupTheory/GroupAction/ConjAct.lean @@ -276,7 +276,7 @@ theorem fixedPoints_eq_center : fixedPoints (ConjAct G) G = center G := by theorem mem_orbit_conjAct {g h : G} : g ∈ orbit (ConjAct G) h ↔ IsConj g h := by rw [isConj_comm, isConj_iff, mem_orbit_iff]; rfl -theorem orbitRel_conjAct : (orbitRel (ConjAct G) G).Rel = IsConj := +theorem orbitRel_conjAct : ⇑(orbitRel (ConjAct G) G) = IsConj := funext₂ fun g h => by rw [orbitRel_apply, mem_orbit_conjAct] theorem orbit_eq_carrier_conjClasses (g : G) : diff --git a/Mathlib/GroupTheory/GroupAction/Quotient.lean b/Mathlib/GroupTheory/GroupAction/Quotient.lean index 8a484cbcfe58d..1b7e5953bf824 100644 --- a/Mathlib/GroupTheory/GroupAction/Quotient.lean +++ b/Mathlib/GroupTheory/GroupAction/Quotient.lean @@ -69,10 +69,10 @@ instance right_quotientAction' [hH : H.Normal] : QuotientAction αᵐᵒᵖ H := @[to_additive] instance quotient [QuotientAction β H] : MulAction β (α ⧸ H) where smul b := - Quotient.map' (b • ·) fun _ _ h => + Quotient.map (b • ·) fun _ _ h => leftRel_apply.mpr <| QuotientAction.inv_mul_mem b <| leftRel_apply.mp h - one_smul q := Quotient.inductionOn' q fun a => congr_arg Quotient.mk'' (one_smul β a) - mul_smul b b' q := Quotient.inductionOn' q fun a => congr_arg Quotient.mk'' (mul_smul b b' a) + one_smul q := Quotient.inductionOn q fun a => congr_arg (Quotient.mk _) (one_smul β a) + mul_smul b b' q := Quotient.inductionOn q fun a => congr_arg (Quotient.mk _) (mul_smul b b' a) variable {β} @@ -87,19 +87,28 @@ theorem Quotient.smul_coe [QuotientAction β H] (b : β) (a : α) : rfl @[to_additive (attr := simp)] -theorem Quotient.mk_smul_out' [QuotientAction β H] (b : β) (q : α ⧸ H) : - QuotientGroup.mk (b • q.out') = b • q := by rw [← Quotient.smul_mk, QuotientGroup.out_eq'] +theorem Quotient.mk_smul_out [QuotientAction β H] (b : β) (q : α ⧸ H) : + QuotientGroup.mk (b • q.out) = b • q := by rw [← Quotient.smul_mk, QuotientGroup.out_eq] + +@[to_additive (attr := deprecated (since := "2024-08-29"))] +alias Quotient.mk_smul_out' := Quotient.mk_smul_out -- Porting note: removed simp attribute, simp can prove this @[to_additive] -theorem Quotient.coe_smul_out' [QuotientAction β H] (b : β) (q : α ⧸ H) : ↑(b • q.out') = b • q := - Quotient.mk_smul_out' H b q +theorem Quotient.coe_smul_out [QuotientAction β H] (b : β) (q : α ⧸ H) : ↑(b • q.out) = b • q := + Quotient.mk_smul_out H b q + +@[to_additive (attr := deprecated (since := "2024-08-29"))] +alias Quotient.coe_smul_out' := Quotient.coe_smul_out -theorem _root_.QuotientGroup.out'_conj_pow_minimalPeriod_mem (a : α) (q : α ⧸ H) : - q.out'⁻¹ * a ^ Function.minimalPeriod (a • ·) q * q.out' ∈ H := by - rw [mul_assoc, ← QuotientGroup.eq, QuotientGroup.out_eq', ← smul_eq_mul, Quotient.mk_smul_out', +theorem _root_.QuotientGroup.out_conj_pow_minimalPeriod_mem (a : α) (q : α ⧸ H) : + q.out⁻¹ * a ^ Function.minimalPeriod (a • ·) q * q.out ∈ H := by + rw [mul_assoc, ← QuotientGroup.eq, QuotientGroup.out_eq, ← smul_eq_mul, Quotient.mk_smul_out, eq_comm, pow_smul_eq_iff_minimalPeriod_dvd] +@[deprecated (since := "2024-08-29")] +alias _root_.QuotientGroup.out'_conj_pow_minimalPeriod_mem := out_conj_pow_minimalPeriod_mem + end QuotientAction open QuotientGroup @@ -123,7 +132,7 @@ variable [MulAction α β] (x : β) /-- The canonical map from the quotient of the stabilizer to the set. -/ @[to_additive "The canonical map from the quotient of the stabilizer to the set. "] def ofQuotientStabilizer (g : α ⧸ MulAction.stabilizer α x) : β := - Quotient.liftOn' g (· • x) fun g1 g2 H => + Quotient.liftOn g (· • x) fun g1 g2 H => calc g1 • x = g1 • (g1⁻¹ * g2) • x := congr_arg _ (leftRel_apply.mp H).symm _ = g2 • x := by rw [smul_smul, mul_inv_cancel_left] @@ -134,17 +143,17 @@ theorem ofQuotientStabilizer_mk (g : α) : ofQuotientStabilizer α x (QuotientGr @[to_additive] theorem ofQuotientStabilizer_mem_orbit (g) : ofQuotientStabilizer α x g ∈ orbit α x := - Quotient.inductionOn' g fun g => ⟨g, rfl⟩ + Quotient.inductionOn g fun g => ⟨g, rfl⟩ @[to_additive] theorem ofQuotientStabilizer_smul (g : α) (g' : α ⧸ MulAction.stabilizer α x) : ofQuotientStabilizer α x (g • g') = g • ofQuotientStabilizer α x g' := - Quotient.inductionOn' g' fun _ => mul_smul _ _ _ + Quotient.inductionOn g' fun _ => mul_smul _ _ _ @[to_additive] theorem injective_ofQuotientStabilizer : Function.Injective (ofQuotientStabilizer α x) := fun y₁ y₂ => - Quotient.inductionOn₂' y₁ y₂ fun g₁ g₂ (H : g₁ • x = g₂ • x) => + Quotient.inductionOn₂ y₁ y₂ fun g₁ g₂ (H : g₁ • x = g₂ • x) => Quotient.sound' <| by rw [leftRel_apply] show (g₁⁻¹ * g₂) • x = x @@ -189,17 +198,17 @@ local notation "Ω" => Quotient <| orbitRel α β /-- **Class formula** : given `G` a group acting on `X` and `φ` a function mapping each orbit of `X` under this action (that is, each element of the quotient of `X` by the relation `orbitRel G X`) to an element in this orbit, this gives a (noncomputable) bijection between `X` and the disjoint union -of `G/Stab(φ(ω))` over all orbits `ω`. In most cases you'll want `φ` to be `Quotient.out'`, so we +of `G/Stab(φ(ω))` over all orbits `ω`. In most cases you'll want `φ` to be `Quotient.out`, so we provide `MulAction.selfEquivSigmaOrbitsQuotientStabilizer'` as a special case. -/ @[to_additive "**Class formula** : given `G` an additive group acting on `X` and `φ` a function mapping each orbit of `X` under this action (that is, each element of the quotient of `X` by the relation `orbit_rel G X`) to an element in this orbit, this gives a (noncomputable) bijection between `X` and the disjoint union of `G/Stab(φ(ω))` over all orbits `ω`. In most - cases you'll want `φ` to be `Quotient.out'`, so we provide + cases you'll want `φ` to be `Quotient.out`, so we provide `AddAction.selfEquivSigmaOrbitsQuotientStabilizer'` as a special case. "] noncomputable def selfEquivSigmaOrbitsQuotientStabilizer' {φ : Ω → β} - (hφ : LeftInverse Quotient.mk'' φ) : β ≃ Σω : Ω, α ⧸ stabilizer α (φ ω) := + (hφ : LeftInverse (Quotient.mk _) φ) : β ≃ Σω : Ω, α ⧸ stabilizer α (φ ω) := calc β ≃ Σω : Ω, orbitRel.Quotient.orbit ω := selfEquivSigmaOrbits' α β _ ≃ Σω : Ω, α ⧸ stabilizer α (φ ω) := @@ -209,13 +218,13 @@ noncomputable def selfEquivSigmaOrbitsQuotientStabilizer' {φ : Ω → β} /-- **Class formula** for a finite group acting on a finite type. See `MulAction.card_eq_sum_card_group_div_card_stabilizer` for a specialized version using -`Quotient.out'`. -/ +`Quotient.out`. -/ @[to_additive "**Class formula** for a finite group acting on a finite type. See `AddAction.card_eq_sum_card_addGroup_div_card_stabilizer` for a specialized version using - `Quotient.out'`."] + `Quotient.out`."] theorem card_eq_sum_card_group_div_card_stabilizer' [Fintype α] [Fintype β] [Fintype Ω] - [∀ b : β, Fintype <| stabilizer α b] {φ : Ω → β} (hφ : LeftInverse Quotient.mk'' φ) : + [∀ b : β, Fintype <| stabilizer α b] {φ : Ω → β} (hφ : LeftInverse (Quotient.mk _) φ) : Fintype.card β = ∑ ω : Ω, Fintype.card α / Fintype.card (stabilizer α (φ ω)) := by classical have : ∀ ω : Ω, Fintype.card α / Fintype.card (stabilizer α (φ ω)) = @@ -228,19 +237,19 @@ theorem card_eq_sum_card_group_div_card_stabilizer' [Fintype α] [Fintype β] [F Fintype.card_congr (selfEquivSigmaOrbitsQuotientStabilizer' α β hφ)] /-- **Class formula**. This is a special case of -`MulAction.self_equiv_sigma_orbits_quotient_stabilizer'` with `φ = Quotient.out'`. -/ +`MulAction.self_equiv_sigma_orbits_quotient_stabilizer'` with `φ = Quotient.out`. -/ @[to_additive "**Class formula**. This is a special case of - `AddAction.self_equiv_sigma_orbits_quotient_stabilizer'` with `φ = Quotient.out'`. "] -noncomputable def selfEquivSigmaOrbitsQuotientStabilizer : β ≃ Σω : Ω, α ⧸ stabilizer α ω.out' := - selfEquivSigmaOrbitsQuotientStabilizer' α β Quotient.out_eq' + `AddAction.self_equiv_sigma_orbits_quotient_stabilizer'` with `φ = Quotient.out`. "] +noncomputable def selfEquivSigmaOrbitsQuotientStabilizer : β ≃ Σω : Ω, α ⧸ stabilizer α ω.out := + selfEquivSigmaOrbitsQuotientStabilizer' α β Quotient.out_eq /-- **Class formula** for a finite group acting on a finite type. -/ @[to_additive "**Class formula** for a finite group acting on a finite type."] theorem card_eq_sum_card_group_div_card_stabilizer [Fintype α] [Fintype β] [Fintype Ω] [∀ b : β, Fintype <| stabilizer α b] : - Fintype.card β = ∑ ω : Ω, Fintype.card α / Fintype.card (stabilizer α ω.out') := - card_eq_sum_card_group_div_card_stabilizer' α β Quotient.out_eq' + Fintype.card β = ∑ ω : Ω, Fintype.card α / Fintype.card (stabilizer α ω.out) := + card_eq_sum_card_group_div_card_stabilizer' α β Quotient.out_eq /-- **Burnside's lemma** : a (noncomputable) bijection between the disjoint union of all `{x ∈ X | g • x = x}` for `g ∈ G` and the product `G × X/G`, where `G` is a group acting on `X` and @@ -256,16 +265,16 @@ noncomputable def sigmaFixedByEquivOrbitsProdGroup : (Σa : α, fixedBy β a) _ ≃ { ba : β × α // ba.2 • ba.1 = ba.1 } := (Equiv.prodComm α β).subtypeEquiv fun _ => Iff.rfl _ ≃ Σb : β, stabilizer α b := Equiv.subtypeProdEquivSigmaSubtype fun (b : β) a => a ∈ stabilizer α b - _ ≃ Σωb : Σω : Ω, orbit α ω.out', stabilizer α (ωb.2 : β) := + _ ≃ Σωb : Σω : Ω, orbit α ω.out, stabilizer α (ωb.2 : β) := (selfEquivSigmaOrbits α β).sigmaCongrLeft' - _ ≃ Σω : Ω, Σb : orbit α ω.out', stabilizer α (b : β) := - Equiv.sigmaAssoc fun (ω : Ω) (b : orbit α ω.out') => stabilizer α (b : β) - _ ≃ Σω : Ω, Σ _ : orbit α ω.out', stabilizer α ω.out' := + _ ≃ Σω : Ω, Σb : orbit α ω.out, stabilizer α (b : β) := + Equiv.sigmaAssoc fun (ω : Ω) (b : orbit α ω.out) => stabilizer α (b : β) + _ ≃ Σω : Ω, Σ _ : orbit α ω.out, stabilizer α ω.out := Equiv.sigmaCongrRight fun _ => Equiv.sigmaCongrRight fun ⟨_, hb⟩ => (stabilizerEquivStabilizerOfOrbitRel hb).toEquiv - _ ≃ Σω : Ω, orbit α ω.out' × stabilizer α ω.out' := + _ ≃ Σω : Ω, orbit α ω.out × stabilizer α ω.out := Equiv.sigmaCongrRight fun _ => Equiv.sigmaEquivProd _ _ - _ ≃ Σ _ : Ω, α := Equiv.sigmaCongrRight fun ω => orbitProdStabilizerEquivGroup α ω.out' + _ ≃ Σ _ : Ω, α := Equiv.sigmaCongrRight fun ω => orbitProdStabilizerEquivGroup α ω.out _ ≃ Ω × α := Equiv.sigmaEquivProd Ω α /-- **Burnside's lemma** : given a finite group `G` acting on a set `X`, the average number of @@ -295,16 +304,15 @@ instance finite_quotient_of_pretransitive_of_finite_quotient [IsPretransitive α · have h' : Finite (Quotient (rightRel H)) := Finite.of_equiv _ (quotientRightRelEquivQuotientLeftRel _).symm let f : Quotient (rightRel H) → orbitRel.Quotient H β := - fun a ↦ Quotient.liftOn' a (fun g ↦ ⟦g • b⟧) fun g₁ g₂ r ↦ by + fun a ↦ Quotient.liftOn a (fun g ↦ ⟦g • b⟧) fun g₁ g₂ r ↦ by replace r := Setoid.symm' _ r - change (rightRel H).r _ _ at r rw [rightRel_eq] at r simp only [Quotient.eq] change g₁ • b ∈ orbit H (g₂ • b) rw [mem_orbit_iff] exact ⟨⟨g₁ * g₂⁻¹, r⟩, by simp [mul_smul]⟩ - exact Finite.of_surjective f ((Quotient.surjective_liftOn' _).2 - (Quotient.surjective_Quotient_mk''.comp (MulAction.surjective_smul _ _))) + exact Finite.of_surjective f ((Quotient.surjective_liftOn _).2 + (Quotient.surjective_mk.comp (MulAction.surjective_smul _ _))) variable {β} @@ -315,31 +323,30 @@ orbit, and a corresponding quotient expressed in terms of `Setoid.comap Subtype. noncomputable def equivSubgroupOrbitsSetoidComap (H : Subgroup α) (ω : Ω) : orbitRel.Quotient H (orbitRel.Quotient.orbit ω) ≃ Quotient ((orbitRel H β).comap (Subtype.val : Quotient.mk (orbitRel α β) ⁻¹' {ω} → β)) where - toFun := fun q ↦ q.liftOn' (fun x ↦ ⟦⟨↑x, by + toFun := fun q ↦ q.liftOn (fun x ↦ ⟦⟨↑x, by simp only [Set.mem_preimage, Set.mem_singleton_iff] have hx := x.property - rwa [orbitRel.Quotient.mem_orbit, @Quotient.mk''_eq_mk] at hx⟩⟧) fun a b h ↦ by - simp only [← Quotient.eq'', Quotient.mk''_eq_mk, + rwa [orbitRel.Quotient.mem_orbit] at hx⟩⟧) fun a b h ↦ by + simp only [← Quotient.eq, Setoid.equiv_iff_apply, orbitRel.Quotient.subgroup_quotient_eq_iff] at h - simp only [← Quotient.mk''_eq_mk, Quotient.eq''] at h ⊢ + simp only [Quotient.eq] at h ⊢ exact h - invFun := fun q ↦ q.liftOn' (fun x ↦ ⟦⟨↑x, by + invFun := fun q ↦ q.liftOn (fun x ↦ ⟦⟨↑x, by have hx := x.property simp only [Set.mem_preimage, Set.mem_singleton_iff] at hx - rwa [orbitRel.Quotient.mem_orbit, @Quotient.mk''_eq_mk]⟩⟧) fun a b h ↦ by - change Setoid.Rel _ _ _ at h - rw [Setoid.comap_rel, Setoid.Rel, ← Quotient.eq'', @Quotient.mk''_eq_mk] at h + rwa [orbitRel.Quotient.mem_orbit]⟩⟧) fun a b h ↦ by + rw [Setoid.equiv_iff_apply, Setoid.comap_rel, ← Quotient.eq] at h simp only [orbitRel.Quotient.subgroup_quotient_eq_iff] exact h left_inv := by simp only [LeftInverse] intro q - induction q using Quotient.inductionOn' + induction q using Quotient.inductionOn rfl right_inv := by simp only [Function.RightInverse, LeftInverse] intro q - induction q using Quotient.inductionOn' + induction q using Quotient.inductionOn rfl variable (β) diff --git a/Mathlib/GroupTheory/Index.lean b/Mathlib/GroupTheory/Index.lean index 0fc048268ebf6..ca5fd026ff5f8 100644 --- a/Mathlib/GroupTheory/Index.lean +++ b/Mathlib/GroupTheory/Index.lean @@ -61,14 +61,14 @@ theorem index_comap_of_surjective {f : G' →* G} (hf : Function.Surjective f) : have key : ∀ x y : G', Setoid.r x y ↔ Setoid.r (f x) (f y) := by simp only [QuotientGroup.leftRel_apply] exact fun x y => iff_of_eq (congr_arg (· ∈ H) (by rw [f.map_mul, f.map_inv])) - refine Cardinal.toNat_congr (Equiv.ofBijective (Quotient.map' f fun x y => (key x y).mp) ⟨?_, ?_⟩) - · simp_rw [← Quotient.eq''] at key - refine Quotient.ind' fun x => ?_ - refine Quotient.ind' fun y => ?_ + refine Cardinal.toNat_congr (Equiv.ofBijective (Quotient.map f fun x y => (key x y).mp) ⟨?_, ?_⟩) + · simp_rw [← Quotient.eq] at key + refine Quotient.ind fun x => ?_ + refine Quotient.ind fun y => ?_ exact (key x y).mpr - · refine Quotient.ind' fun x => ?_ + · refine Quotient.ind fun x => ?_ obtain ⟨y, hy⟩ := hf x - exact ⟨y, (Quotient.map'_mk'' f _ y).trans (congr_arg Quotient.mk'' hy)⟩ + exact ⟨y, (Quotient.map_mk f _ y).trans (congr_arg (Quotient.mk _) hy)⟩ @[to_additive] theorem index_comap (f : G' →* G) : diff --git a/Mathlib/GroupTheory/MonoidLocalization/Basic.lean b/Mathlib/GroupTheory/MonoidLocalization/Basic.lean index 988928ee6d456..5515b2dfb642e 100644 --- a/Mathlib/GroupTheory/MonoidLocalization/Basic.lean +++ b/Mathlib/GroupTheory/MonoidLocalization/Basic.lean @@ -245,7 +245,7 @@ def rec {p : Localization S → Sort u} (f : ∀ (a : M) (b : S), p (mk a b)) def recOnSubsingleton₂ {r : Localization S → Localization S → Sort u} [h : ∀ (a c : M) (b d : S), Subsingleton (r (mk a b) (mk c d))] (x y : Localization S) (f : ∀ (a c : M) (b d : S), r (mk a b) (mk c d)) : r x y := - @Quotient.recOnSubsingleton₂' _ _ _ _ r (Prod.rec fun _ _ => Prod.rec fun _ _ => h _ _ _ _) x y + @Quotient.recOnSubsingleton₂ _ _ _ _ r (Prod.rec fun _ _ => Prod.rec fun _ _ => h _ _ _ _) x y (Prod.rec fun _ _ => Prod.rec fun _ _ => f _ _ _ _) @[to_additive] diff --git a/Mathlib/GroupTheory/Nilpotent.lean b/Mathlib/GroupTheory/Nilpotent.lean index a4b435fb7cba6..571e9f64dd7c9 100644 --- a/Mathlib/GroupTheory/Nilpotent.lean +++ b/Mathlib/GroupTheory/Nilpotent.lean @@ -565,7 +565,7 @@ theorem nilpotencyClass_quotient_center [hH : IsNilpotent G] : · suffices Group.nilpotencyClass (G ⧸ center G) = n by simpa apply le_antisymm · apply upperCentralSeries_eq_top_iff_nilpotencyClass_le.mp - apply comap_injective (f := (mk' (center G))) (surjective_quot_mk _) + apply comap_injective (f := (mk' (center G))) Quot.surjective_mk rw [comap_upperCentralSeries_quotient_center, comap_top, Nat.succ_eq_add_one, ← hn] exact upperCentralSeries_nilpotencyClass · apply le_of_add_le_add_right @@ -750,7 +750,7 @@ theorem normalizerCondition_of_isNilpotent [h : IsNilpotent G] : NormalizerCondi · intro G _ _ ih H hH have hch : center G ≤ H := Subgroup.center_le_normalizer.trans (le_of_eq hH) have hkh : (mk' (center G)).ker ≤ H := by simpa using hch - have hsur : Function.Surjective (mk' (center G)) := surjective_quot_mk _ + have hsur : Function.Surjective (mk' (center G)) := Quot.surjective_mk let H' := H.map (mk' (center G)) have hH' : H'.normalizer = H' := by apply comap_injective hsur diff --git a/Mathlib/GroupTheory/PGroup.lean b/Mathlib/GroupTheory/PGroup.lean index ea820704dd164..bb833c50be23d 100644 --- a/Mathlib/GroupTheory/PGroup.lean +++ b/Mathlib/GroupTheory/PGroup.lean @@ -73,7 +73,7 @@ theorem of_surjective {H : Type*} [Group H] (ϕ : G →* H) (hϕ : Function.Surj rw [← hg, ← ϕ.map_pow, hk, ϕ.map_one] theorem to_quotient (H : Subgroup G) [H.Normal] : IsPGroup p (G ⧸ H) := - hG.of_surjective (QuotientGroup.mk' H) Quotient.surjective_Quotient_mk'' + hG.of_surjective (QuotientGroup.mk' H) Quotient.surjective_mk theorem of_equiv {H : Type*} [Group H] (ϕ : G ≃* H) : IsPGroup p H := hG.of_surjective ϕ.toMonoidHom ϕ.surjective @@ -157,29 +157,29 @@ theorem card_modEq_card_fixedPoints : Nat.card α ≡ Nat.card (fixedPoints G α rw [Nat.card_eq_fintype_card, Nat.card_eq_fintype_card] classical calc - card α = card (Σy : Quotient (orbitRel G α), { x // Quotient.mk'' x = y }) := - card_congr (Equiv.sigmaFiberEquiv (@Quotient.mk'' _ (orbitRel G α))).symm - _ = ∑ a : Quotient (orbitRel G α), card { x // Quotient.mk'' x = a } := card_sigma + card α = card (Σy : Quotient (orbitRel G α), { x // ⟦x⟧ = y }) := + card_congr (Equiv.sigmaFiberEquiv (Quotient.mk (orbitRel G α))).symm + _ = ∑ a : Quotient (orbitRel G α), card { x // ⟦x⟧ = a } := card_sigma _ ≡ ∑ _a : fixedPoints G α, 1 [MOD p] := ?_ _ = _ := by simp rw [← ZMod.eq_iff_modEq_nat p, Nat.cast_sum, Nat.cast_sum] have key : ∀ x, - card { y // (Quotient.mk'' y : Quotient (orbitRel G α)) = Quotient.mk'' x } = + card { y // (Quotient.mk (orbitRel G α) y) = ⟦x⟧ } = card (orbit G x) := - fun x => by simp only [Quotient.eq'']; congr + fun x => by simp only [Quotient.eq]; congr refine Eq.symm - (Finset.sum_bij_ne_zero (fun a _ _ => Quotient.mk'' a.1) (fun _ _ _ => Finset.mem_univ _) + (Finset.sum_bij_ne_zero (fun a _ _ => ⟦a.1⟧) (fun _ _ _ => Finset.mem_univ _) (fun a₁ _ _ a₂ _ _ h => Subtype.eq (mem_fixedPoints'.mp a₂.2 a₁.1 (Quotient.exact' h))) - (fun b => Quotient.inductionOn' b fun b _ hb => ?_) fun a ha _ => by + (fun b => Quotient.inductionOn b fun b _ hb => ?_) fun a ha _ => by rw [key, mem_fixedPoints_iff_card_orbit_eq_one.mp a.2]) obtain ⟨k, hk⟩ := hG.card_orbit b rw [Nat.card_eq_fintype_card] at hk have : k = 0 := by contrapose! hb - simp [-Quotient.eq'', key, hk, hb] + simp [-Quotient.eq, key, hk, hb] exact ⟨⟨b, mem_fixedPoints_iff_card_orbit_eq_one.2 <| by rw [hk, this, pow_zero]⟩, Finset.mem_univ _, ne_of_eq_of_ne Nat.cast_one one_ne_zero, rfl⟩ diff --git a/Mathlib/GroupTheory/Perm/Cycle/Concrete.lean b/Mathlib/GroupTheory/Perm/Cycle/Concrete.lean index 57afc2d245faf..66e795f5c22d9 100644 --- a/Mathlib/GroupTheory/Perm/Cycle/Concrete.lean +++ b/Mathlib/GroupTheory/Perm/Cycle/Concrete.lean @@ -136,7 +136,7 @@ theorem formPerm_coe (l : List α) (hl : l.Nodup) : formPerm (l : Cycle α) hl = rfl theorem formPerm_subsingleton (s : Cycle α) (h : Subsingleton s) : formPerm s h.nodup = 1 := by - induction' s using Quot.inductionOn with s + induction' s using Quotient.inductionOn with s simp only [formPerm_coe, mk_eq_coe] simp only [length_subsingleton_iff, length_coe, mk_eq_coe] at h cases' s with hd tl @@ -177,7 +177,7 @@ nonrec theorem formPerm_eq_formPerm_iff {α : Type*} [DecidableEq α] {s s' : Cy rw [Cycle.length_subsingleton_iff, Cycle.length_subsingleton_iff] revert s s' intro s s' - apply @Quotient.inductionOn₂' _ _ _ _ _ s s' + apply @Quotient.inductionOn₂ _ _ _ _ _ s s' intro l l' hl hl' simpa using formPerm_eq_formPerm_iff hl hl' @@ -412,7 +412,8 @@ theorem IsCycle.existsUnique_cycle {f : Perm α} (hf : IsCycle f) : obtain ⟨x, hx, hy⟩ := id hf refine ⟨f.toList x, ⟨nodup_toList f x, ?_⟩, ?_⟩ · simp [formPerm_toList, hf.cycleOf_eq hx] - · rintro ⟨l⟩ ⟨hn, rfl⟩ + · rintro l ⟨hn, rfl⟩ + induction l using Quotient.ind with | _ l => ?_ simp only [Cycle.mk_eq_coe, Cycle.coe_eq_coe, Subtype.coe_mk, Cycle.formPerm_coe] refine (toList_formPerm_isRotated_self _ ?_ hn _ ?_).symm · contrapose! hx diff --git a/Mathlib/GroupTheory/QuotientGroup/Basic.lean b/Mathlib/GroupTheory/QuotientGroup/Basic.lean index 769d08f8f5c5d..dc72e647e0d40 100644 --- a/Mathlib/GroupTheory/QuotientGroup/Basic.lean +++ b/Mathlib/GroupTheory/QuotientGroup/Basic.lean @@ -132,7 +132,7 @@ theorem eq_iff_div_mem {N : Subgroup G} [nN : N.Normal] {x y : G} : @[to_additive] instance Quotient.commGroup {G : Type*} [CommGroup G] (N : Subgroup G) : CommGroup (G ⧸ N) := { toGroup := have := N.normal_of_comm; QuotientGroup.Quotient.group N - mul_comm := fun a b => Quotient.inductionOn₂' a b fun a b => congr_arg mk (mul_comm a b) } + mul_comm := fun a b => Quotient.inductionOn₂ a b fun a b => congr_arg mk (mul_comm a b) } local notation " Q " => G ⧸ N @@ -332,7 +332,7 @@ theorem kerLift_mk' (g : G) : (kerLift φ) (mk g) = φ g := @[to_additive] theorem kerLift_injective : Injective (kerLift φ) := fun a b => - Quotient.inductionOn₂' a b fun a b (h : φ a = φ b) => + Quotient.inductionOn₂ a b fun a b (h : φ a = φ b) => Quotient.sound' <| by rw [leftRel_apply, mem_ker, φ.map_mul, ← h, φ.map_inv, inv_mul_cancel] -- Note that `ker φ` isn't definitionally `ker (φ.rangeRestrict)` @@ -344,7 +344,7 @@ def rangeKerLift : G ⧸ ker φ →* φ.range := @[to_additive] theorem rangeKerLift_injective : Injective (rangeKerLift φ) := fun a b => - Quotient.inductionOn₂' a b fun a b (h : φ.rangeRestrict a = φ.rangeRestrict b) => + Quotient.inductionOn₂ a b fun a b (h : φ.rangeRestrict a = φ.rangeRestrict b) => Quotient.sound' <| by rw [leftRel_apply, ← ker_rangeRestrict, mem_ker, φ.rangeRestrict.map_mul, ← h, φ.rangeRestrict.map_inv, inv_mul_cancel] @@ -393,7 +393,7 @@ isomorphic. -/ isomorphic."] def quotientMulEquivOfEq {M N : Subgroup G} [M.Normal] [N.Normal] (h : M = N) : G ⧸ M ≃* G ⧸ N := { Subgroup.quotientEquivOfEq h with - map_mul' := fun q r => Quotient.inductionOn₂' q r fun _g _h => rfl } + map_mul' := fun q r => Quotient.inductionOn₂ q r fun _g _h => rfl } @[to_additive (attr := simp)] theorem quotientMulEquivOfEq_mk {M N : Subgroup G} [M.Normal] [N.Normal] (h : M = N) (x : G) : @@ -475,7 +475,7 @@ theorem equivQuotientZPowOfEquiv_refl : MulEquiv.refl (A ⧸ (zpowGroupHom n : A →* A).range) = equivQuotientZPowOfEquiv (MulEquiv.refl A) n := by ext x - rw [← Quotient.out_eq' x] + rw [← Quotient.out_eq x] rfl @[to_additive (attr := simp)] @@ -488,7 +488,7 @@ theorem equivQuotientZPowOfEquiv_trans : (equivQuotientZPowOfEquiv e n).trans (equivQuotientZPowOfEquiv d n) = equivQuotientZPowOfEquiv (e.trans d) n := by ext x - rw [← Quotient.out_eq' x] + rw [← Quotient.out_eq x] rfl end ZPow @@ -509,7 +509,7 @@ noncomputable def quotientInfEquivProdNormalQuotient (H N : Subgroup G) [N.Norma _ ⧸ N.subgroupOf (H ⊔ N) := (mk' <| N.subgroupOf (H ⊔ N)).comp (inclusion le_sup_left) have φ_surjective : Surjective φ := fun x => - x.inductionOn' <| by + x.inductionOn <| by rintro ⟨y, hy : y ∈ (H ⊔ N)⟩ rw [← SetLike.mem_coe] at hy rw [mul_normal H N] at hy diff --git a/Mathlib/GroupTheory/SchurZassenhaus.lean b/Mathlib/GroupTheory/SchurZassenhaus.lean index 1cb524d82f333..6fec7ff998eed 100644 --- a/Mathlib/GroupTheory/SchurZassenhaus.lean +++ b/Mathlib/GroupTheory/SchurZassenhaus.lean @@ -62,17 +62,17 @@ variable [Normal H] noncomputable instance : MulAction G H.QuotientDiff where smul g := - Quotient.map' (fun α => op g⁻¹ • α) fun α β h => + Quotient.map (fun α => op g⁻¹ • α) fun α β h => Subtype.ext (by rwa [smul_diff_smul', coe_mk, coe_one, mul_eq_one_iff_eq_inv, mul_right_eq_self, ← coe_one, ← Subtype.ext_iff]) mul_smul g₁ g₂ q := - Quotient.inductionOn' q fun T => - congr_arg Quotient.mk'' (by rw [mul_inv_rev]; exact mul_smul (op g₁⁻¹) (op g₂⁻¹) T) + Quotient.inductionOn q fun T => + congr_arg (Quotient.mk _) (by rw [mul_inv_rev]; exact mul_smul (op g₁⁻¹) (op g₂⁻¹) T) one_smul q := - Quotient.inductionOn' q fun T => - congr_arg Quotient.mk'' (by rw [inv_one]; apply one_smul Gᵐᵒᵖ T) + Quotient.inductionOn q fun T => + congr_arg (Quotient.mk _) (by rw [inv_one]; apply one_smul Gᵐᵒᵖ T) theorem smul_diff' (h : H) : diff (MonoidHom.id H) α (op (h : G) • β) = diff (MonoidHom.id H) α β * h ^ H.index := by @@ -87,7 +87,7 @@ theorem smul_diff' (h : H) : theorem eq_one_of_smul_eq_one (hH : Nat.Coprime (Nat.card H) H.index) (α : H.QuotientDiff) (h : H) : h • α = α → h = 1 := - Quotient.inductionOn' α fun α hα => + Quotient.inductionOn α fun α hα => (powCoprime hH).injective <| calc h ^ H.index = diff (MonoidHom.id H) (op ((h⁻¹ : H) : G) • α) α := by @@ -96,8 +96,8 @@ theorem eq_one_of_smul_eq_one (hH : Nat.Coprime (Nat.card H) H.index) (α : H.Qu theorem exists_smul_eq (hH : Nat.Coprime (Nat.card H) H.index) (α β : H.QuotientDiff) : ∃ h : H, h • α = β := - Quotient.inductionOn' α - (Quotient.inductionOn' β fun β α => + Quotient.inductionOn α + (Quotient.inductionOn β fun β α => Exists.imp (fun n => Quotient.sound') ⟨(powCoprime hH).symm (diff (MonoidHom.id H) β α), (diff_inv _ _ _).symm.trans @@ -184,7 +184,7 @@ private theorem step1 (K : Subgroup G) (hK : K ⊔ N = ⊤) : K = ⊤ := by include h2 in /-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/ private theorem step2 (K : Subgroup G) [K.Normal] (hK : K ≤ N) : K = ⊥ ∨ K = N := by - have : Function.Surjective (QuotientGroup.mk' K) := Quotient.surjective_Quotient_mk'' + have : Function.Surjective (QuotientGroup.mk' K) := Quotient.surjective_mk have h4 := step1 h1 h2 h3 contrapose! h4 have h5 : Nat.card (G ⧸ K) < Nat.card G := by diff --git a/Mathlib/GroupTheory/Sylow.lean b/Mathlib/GroupTheory/Sylow.lean index e01444b54457b..83509eb83acd4 100644 --- a/Mathlib/GroupTheory/Sylow.lean +++ b/Mathlib/GroupTheory/Sylow.lean @@ -435,7 +435,7 @@ theorem mem_fixedPoints_mul_left_cosets_iff_mem_normalizer {H : Subgroup G} [Fin rw [inv_inv]), fun hx : ∀ n : G, n ∈ H ↔ x * n * x⁻¹ ∈ H => mem_fixedPoints'.2 fun y => - Quotient.inductionOn' y fun y hy => + Quotient.inductionOn y fun y hy => QuotientGroup.eq.2 (let ⟨⟨b, hb₁⟩, hb₂⟩ := hy have hb₂ : (b * x)⁻¹ * y ∈ H := QuotientGroup.eq.1 hb₂ diff --git a/Mathlib/GroupTheory/Transfer.lean b/Mathlib/GroupTheory/Transfer.lean index 2ade7550cbcff..69e3ea4a4ba9e 100644 --- a/Mathlib/GroupTheory/Transfer.lean +++ b/Mathlib/GroupTheory/Transfer.lean @@ -103,8 +103,8 @@ theorem transfer_eq_prod_quotient_orbitRel_zpowers_quot [FiniteIndex H] (g : G) transfer ϕ g = ∏ q : Quotient (orbitRel (zpowers g) (G ⧸ H)), ϕ - ⟨q.out'.out'⁻¹ * g ^ Function.minimalPeriod (g • ·) q.out' * q.out'.out', - QuotientGroup.out'_conj_pow_minimalPeriod_mem H g q.out'⟩ := by + ⟨q.out.out⁻¹ * g ^ Function.minimalPeriod (g • ·) q.out * q.out.out, + QuotientGroup.out_conj_pow_minimalPeriod_mem H g q.out⟩ := by classical letI := H.fintypeQuotientOfFiniteIndex calc @@ -115,7 +115,7 @@ theorem transfer_eq_prod_quotient_orbitRel_zpowers_quot [FiniteIndex H] (g : G) refine Fintype.prod_congr _ _ (fun q => ?_) simp only [quotientEquivSigmaZMod_symm_apply, transferTransversal_apply', transferTransversal_apply''] - rw [Fintype.prod_eq_single (0 : ZMod (Function.minimalPeriod (g • ·) q.out')) _] + rw [Fintype.prod_eq_single (0 : ZMod (Function.minimalPeriod (g • ·) q.out)) _] · simp only [if_pos, ZMod.cast_zero, zpow_zero, one_mul, mul_assoc] · intro k hk simp only [if_neg hk, inv_mul_cancel] @@ -133,11 +133,11 @@ theorem transfer_eq_pow_aux (g : G) replace key : ∀ (k : ℕ) (g₀ : G), g₀⁻¹ * g ^ k * g₀ ∈ H → g ^ k ∈ H := fun k g₀ hk => (congr_arg (· ∈ H) (key k g₀ hk)).mp hk replace key : ∀ q : G ⧸ H, g ^ Function.minimalPeriod (g • ·) q ∈ H := fun q => - key (Function.minimalPeriod (g • ·) q) q.out' - (QuotientGroup.out'_conj_pow_minimalPeriod_mem H g q) + key (Function.minimalPeriod (g • ·) q) q.out + (QuotientGroup.out_conj_pow_minimalPeriod_mem H g q) let f : Quotient (orbitRel (zpowers g) (G ⧸ H)) → zpowers g := fun q => - (⟨g, mem_zpowers g⟩ : zpowers g) ^ Function.minimalPeriod (g • ·) q.out' - have hf : ∀ q, f q ∈ H.subgroupOf (zpowers g) := fun q => key q.out' + (⟨g, mem_zpowers g⟩ : zpowers g) ^ Function.minimalPeriod (g • ·) q.out + have hf : ∀ q, f q ∈ H.subgroupOf (zpowers g) := fun q => key q.out replace key := Subgroup.prod_mem (H.subgroupOf (zpowers g)) fun q (_ : q ∈ Finset.univ) => hf q simpa only [f, minimalPeriod_eq_card, Finset.prod_pow_eq_pow_sum, Fintype.card_sigma, diff --git a/Mathlib/LinearAlgebra/Alternating/DomCoprod.lean b/Mathlib/LinearAlgebra/Alternating/DomCoprod.lean index ce50529aa2ab6..5a31e6cac0594 100644 --- a/Mathlib/LinearAlgebra/Alternating/DomCoprod.lean +++ b/Mathlib/LinearAlgebra/Alternating/DomCoprod.lean @@ -40,12 +40,12 @@ variable [DecidableEq ιa] [DecidableEq ιb] /-- summand used in `AlternatingMap.domCoprod` -/ def domCoprod.summand (a : Mᵢ [⋀^ιa]→ₗ[R'] N₁) (b : Mᵢ [⋀^ιb]→ₗ[R'] N₂) (σ : Perm.ModSumCongr ιa ιb) : MultilinearMap R' (fun _ : ιa ⊕ ιb => Mᵢ) (N₁ ⊗[R'] N₂) := - Quotient.liftOn' σ + Quotient.liftOn σ (fun σ => Equiv.Perm.sign σ • (MultilinearMap.domCoprod ↑a ↑b : MultilinearMap R' (fun _ => Mᵢ) (N₁ ⊗ N₂)).domDomCongr σ) fun σ₁ σ₂ H => by - rw [QuotientGroup.leftRel_apply] at H + rw [Setoid.equiv_iff_apply, QuotientGroup.leftRel_apply] at H obtain ⟨⟨sl, sr⟩, h⟩ := H ext v simp only [MultilinearMap.domDomCongr_apply, MultilinearMap.domCoprod_apply, @@ -62,7 +62,7 @@ def domCoprod.summand (a : Mᵢ [⋀^ιa]→ₗ[R'] N₁) (b : Mᵢ [⋀^ιb]→ theorem domCoprod.summand_mk'' (a : Mᵢ [⋀^ιa]→ₗ[R'] N₁) (b : Mᵢ [⋀^ιb]→ₗ[R'] N₂) (σ : Equiv.Perm (ιa ⊕ ιb)) : - domCoprod.summand a b (Quotient.mk'' σ) = + domCoprod.summand a b ⟦σ⟧ = Equiv.Perm.sign σ • (MultilinearMap.domCoprod ↑a ↑b : MultilinearMap R' (fun _ => Mᵢ) (N₁ ⊗ N₂)).domDomCongr σ := @@ -73,8 +73,8 @@ theorem domCoprod.summand_add_swap_smul_eq_zero (a : Mᵢ [⋀^ιa]→ₗ[R'] N (b : Mᵢ [⋀^ιb]→ₗ[R'] N₂) (σ : Perm.ModSumCongr ιa ιb) {v : ιa ⊕ ιb → Mᵢ} {i j : ιa ⊕ ιb} (hv : v i = v j) (hij : i ≠ j) : domCoprod.summand a b σ v + domCoprod.summand a b (swap i j • σ) v = 0 := by - refine Quotient.inductionOn' σ fun σ => ?_ - dsimp only [Quotient.liftOn'_mk'', Quotient.map'_mk'', MulAction.Quotient.smul_mk, + refine Quotient.inductionOn σ fun σ => ?_ + dsimp only [Quotient.liftOn_mk, Quotient.map_mk, MulAction.Quotient.smul_mk, domCoprod.summand] rw [smul_eq_mul, Perm.sign_mul, Perm.sign_swap hij] simp only [one_mul, neg_mul, Function.comp_apply, Units.neg_smul, Perm.coe_mul, Units.val_neg, @@ -90,8 +90,8 @@ theorem domCoprod.summand_eq_zero_of_smul_invariant (a : Mᵢ [⋀^ιa]→ₗ[R' (b : Mᵢ [⋀^ιb]→ₗ[R'] N₂) (σ : Perm.ModSumCongr ιa ιb) {v : ιa ⊕ ιb → Mᵢ} {i j : ιa ⊕ ιb} (hv : v i = v j) (hij : i ≠ j) : swap i j • σ = σ → domCoprod.summand a b σ v = 0 := by - refine Quotient.inductionOn' σ fun σ => ?_ - dsimp only [Quotient.liftOn'_mk'', Quotient.map'_mk'', MultilinearMap.smul_apply, + refine Quotient.inductionOn σ fun σ => ?_ + dsimp only [Quotient.liftOn_mk, Quotient.map_mk, MultilinearMap.smul_apply, MultilinearMap.domDomCongr_apply, MultilinearMap.domCoprod_apply, domCoprod.summand] intro hσ cases' hi : σ⁻¹ i with val val <;> cases' hj : σ⁻¹ j with val_1 val_1 <;> @@ -178,8 +178,8 @@ def domCoprod' : Finset.smul_sum, MultilinearMap.sum_apply, domCoprod.summand] congr ext σ - refine Quotient.inductionOn' σ fun σ => ?_ - simp only [Quotient.liftOn'_mk'', coe_add, coe_smul, MultilinearMap.smul_apply, + refine Quotient.inductionOn σ fun σ => ?_ + simp only [Quotient.liftOn_mk, coe_add, coe_smul, MultilinearMap.smul_apply, ← MultilinearMap.domCoprod'_apply] simp only [TensorProduct.add_tmul, ← TensorProduct.smul_tmul', TensorProduct.tmul_add, TensorProduct.tmul_smul, LinearMap.map_add, LinearMap.map_smul] @@ -222,14 +222,14 @@ theorem MultilinearMap.domCoprod_alternization [DecidableEq ιa] [DecidableEq ι Finset.sum_partition (QuotientGroup.leftRel (Perm.sumCongrHom ιa ιb).range)] congr 1 ext1 σ - refine Quotient.inductionOn' σ fun σ => ?_ + refine Quotient.inductionOn σ fun σ => ?_ -- unfold the quotient mess left by `Finset.sum_partition` -- Porting note: Was `conv in .. => ..`. erw [@Finset.filter_congr _ _ (fun a => @Quotient.decidableEq _ _ (QuotientGroup.leftRelDecidable (MonoidHom.range (Perm.sumCongrHom ιa ιb))) (Quotient.mk (QuotientGroup.leftRel (MonoidHom.range (Perm.sumCongrHom ιa ιb))) a) - (Quotient.mk'' σ)) _ (s := Finset.univ) + ⟦σ⟧) _ (s := Finset.univ) fun x _ => QuotientGroup.eq (s := MonoidHom.range (Perm.sumCongrHom ιa ιb)) (a := x) (b := σ)] -- eliminate a multiplication rw [← Finset.map_univ_equiv (Equiv.mulLeft σ), Finset.filter_map, Finset.sum_map] diff --git a/Mathlib/LinearAlgebra/Dimension/Constructions.lean b/Mathlib/LinearAlgebra/Dimension/Constructions.lean index 675a819bd384b..7b21342afeba3 100644 --- a/Mathlib/LinearAlgebra/Dimension/Constructions.lean +++ b/Mathlib/LinearAlgebra/Dimension/Constructions.lean @@ -73,7 +73,7 @@ theorem rank_quotient_add_rank_le [Nontrivial R] (M' : Submodule R M) : (by simpa [Function.comp, hf] using hs)).cardinal_le_rank theorem rank_quotient_le (p : Submodule R M) : Module.rank R (M ⧸ p) ≤ Module.rank R M := - (mkQ p).rank_le_of_surjective (surjective_quot_mk _) + (mkQ p).rank_le_of_surjective Quot.surjective_mk theorem rank_quotient_eq_of_le_torsion {R M} [CommRing R] [AddCommGroup M] [Module R M] {M' : Submodule R M} (hN : M' ≤ torsion R M) : Module.rank R (M ⧸ M') = Module.rank R M := @@ -377,7 +377,7 @@ theorem Submodule.finrank_le [Module.Finite R M] (s : Submodule R M) : /-- The dimension of a quotient is bounded by the dimension of the ambient space. -/ theorem Submodule.finrank_quotient_le [Module.Finite R M] (s : Submodule R M) : finrank R (M ⧸ s) ≤ finrank R M := - toNat_le_toNat ((Submodule.mkQ s).rank_le_of_surjective (surjective_quot_mk _)) + toNat_le_toNat ((Submodule.mkQ s).rank_le_of_surjective Quot.surjective_mk) (rank_lt_aleph0 _ _) /-- Pushforwards of finite submodules have a smaller finrank. -/ diff --git a/Mathlib/LinearAlgebra/InvariantBasisNumber.lean b/Mathlib/LinearAlgebra/InvariantBasisNumber.lean index 2e8c75c44c9d9..0ee3976fb6f02 100644 --- a/Mathlib/LinearAlgebra/InvariantBasisNumber.lean +++ b/Mathlib/LinearAlgebra/InvariantBasisNumber.lean @@ -279,10 +279,10 @@ variable {R : Type u} [CommRing R] (I : Ideal R) {ι : Type v} [Fintype ι] {ι' /-- An `R`-linear map `R^n → R^m` induces a function `R^n/I^n → R^m/I^m`. -/ private def induced_map (I : Ideal R) (e : (ι → R) →ₗ[R] ι' → R) : (ι → R) ⧸ I.pi ι → (ι' → R) ⧸ I.pi ι' := fun x => - Quotient.liftOn' x (fun y => Ideal.Quotient.mk (I.pi ι') (e y)) + Quotient.liftOn x (fun y => Ideal.Quotient.mk (I.pi ι') (e y)) (by refine fun a b hab => Ideal.Quotient.eq.2 fun h => ?_ - rw [Submodule.quotientRel_r_def] at hab + rw [Setoid.equiv_iff_apply, Submodule.quotientRel_r_def] at hab rw [← LinearMap.map_sub] exact Ideal.map_pi _ _ hab e h) diff --git a/Mathlib/LinearAlgebra/Isomorphisms.lean b/Mathlib/LinearAlgebra/Isomorphisms.lean index 7a9bb31cd43fa..60e3df401fa97 100644 --- a/Mathlib/LinearAlgebra/Isomorphisms.lean +++ b/Mathlib/LinearAlgebra/Isomorphisms.lean @@ -161,9 +161,9 @@ def quotientQuotientEquivQuotient : ((M ⧸ S) ⧸ T.map S.mkQ) ≃ₗ[R] M ⧸ { quotientQuotientEquivQuotientAux S T h with toFun := quotientQuotientEquivQuotientAux S T h invFun := mapQ _ _ (mkQ S) (le_comap_map _ _) - left_inv := fun x => Quotient.inductionOn' x fun x => Quotient.inductionOn' x fun x => + left_inv := fun x => Quotient.inductionOn x fun x => Quotient.inductionOn x fun x => by simp [Quotient.mk''_eq_mk] - right_inv := fun x => Quotient.inductionOn' x fun x => by simp [Quotient.mk''_eq_mk] } + right_inv := fun x => Quotient.inductionOn x fun x => by simp [Quotient.mk''_eq_mk] } /-- Essentially the same equivalence as in the third isomorphism theorem, except restated in terms of suprema/addition of submodules instead of `≤`. -/ diff --git a/Mathlib/LinearAlgebra/Projectivization/Basic.lean b/Mathlib/LinearAlgebra/Projectivization/Basic.lean index fd5d3d6aa6db7..765be74a58c0e 100644 --- a/Mathlib/LinearAlgebra/Projectivization/Basic.lean +++ b/Mathlib/LinearAlgebra/Projectivization/Basic.lean @@ -53,11 +53,11 @@ variable {V} /-- Construct an element of the projectivization from a nonzero vector. -/ def mk (v : V) (hv : v ≠ 0) : ℙ K V := - Quotient.mk'' ⟨v, hv⟩ + ⟦⟨v, hv⟩⟧ /-- A variant of `Projectivization.mk` in terms of a subtype. `mk` is preferred. -/ def mk' (v : { v : V // v ≠ 0 }) : ℙ K V := - Quotient.mk'' v + ⟦v⟧ @[simp] theorem mk'_eq_mk (v : { v : V // v ≠ 0 }) : mk' K v = mk K ↑v v.2 := rfl @@ -70,19 +70,19 @@ variable {K} /-- Choose a representative of `v : Projectivization K V` in `V`. -/ protected noncomputable def rep (v : ℙ K V) : V := - v.out' + v.out theorem rep_nonzero (v : ℙ K V) : v.rep ≠ 0 := - v.out'.2 + v.out.2 @[simp] -theorem mk_rep (v : ℙ K V) : mk K v.rep v.rep_nonzero = v := Quotient.out_eq' _ +theorem mk_rep (v : ℙ K V) : mk K v.rep v.rep_nonzero = v := Quotient.out_eq _ open FiniteDimensional /-- Consider an element of the projectivization as a submodule of `V`. -/ protected def submodule (v : ℙ K V) : Submodule K V := - (Quotient.liftOn' v fun v => K ∙ (v : V)) <| by + (Quotient.liftOn v fun v => K ∙ (v : V)) <| by rintro ⟨a, ha⟩ ⟨b, hb⟩ ⟨x, rfl : x • b = a⟩ exact Submodule.span_singleton_group_smul_eq _ x _ @@ -90,7 +90,7 @@ variable (K) theorem mk_eq_mk_iff (v w : V) (hv : v ≠ 0) (hw : w ≠ 0) : mk K v hv = mk K w hw ↔ ∃ a : Kˣ, a • w = v := - Quotient.eq'' + Quotient.eq /-- Two nonzero vectors go to the same point in projective space if and only if one is a scalar multiple of the other. -/ @@ -112,7 +112,7 @@ variable {K} /-- An induction principle for `Projectivization`. Use as `induction v`. -/ @[elab_as_elim, cases_eliminator, induction_eliminator] theorem ind {P : ℙ K V → Prop} (h : ∀ (v : V) (h : v ≠ 0), P (mk K v h)) : ∀ p, P p := - Quotient.ind' <| Subtype.rec <| h + Quotient.ind <| Subtype.rec <| h @[simp] theorem submodule_mk (v : V) (hv : v ≠ 0) : (mk K v hv).submodule = K ∙ v := @@ -172,7 +172,7 @@ variable {L W : Type*} [DivisionRing L] [AddCommGroup W] [Module L W] /-- An injective semilinear map of vector spaces induces a map on projective spaces. -/ def map {σ : K →+* L} (f : V →ₛₗ[σ] W) (hf : Function.Injective f) : ℙ K V → ℙ L W := - Quotient.map' (fun v => ⟨f v, fun c => v.2 (hf (by simp [c]))⟩) + Quotient.map (fun v => ⟨f v, fun c => v.2 (hf (by simp [c]))⟩) (by rintro ⟨u, hu⟩ ⟨v, hv⟩ ⟨a, ha⟩ use Units.map σ.toMonoidHom a diff --git a/Mathlib/LinearAlgebra/Quotient.lean b/Mathlib/LinearAlgebra/Quotient.lean index 61d6fd9576a2a..7c97bb80cd49b 100644 --- a/Mathlib/LinearAlgebra/Quotient.lean +++ b/Mathlib/LinearAlgebra/Quotient.lean @@ -49,7 +49,7 @@ namespace Quotient /-- Map associating to an element of `M` the corresponding element of `M/p`, when `p` is a submodule of `M`. -/ def mk {p : Submodule R M} : M → M ⧸ p := - Quotient.mk'' + _root_.Quotient.mk _ /- porting note: here and throughout elaboration is sped up *tremendously* (in some cases even avoiding timeouts) by providing type ascriptions to `mk` (or `mk x`) and its variants. Lean 3 @@ -58,7 +58,7 @@ theorem mk'_eq_mk' {p : Submodule R M} (x : M) : @Quotient.mk' _ (quotientRel p) x = (mk : M → M ⧸ p) x := rfl -theorem mk''_eq_mk {p : Submodule R M} (x : M) : (Quotient.mk'' x : M ⧸ p) = (mk : M → M ⧸ p) x := +theorem mk''_eq_mk {p : Submodule R M} (x : M) : (⟦x⟧ : M ⧸ p) = (mk : M → M ⧸ p) x := rfl theorem quot_mk_eq_mk {p : Submodule R M} (x : M) : (Quot.mk _ x : M ⧸ p) = (mk : M → M ⧸ p) x := @@ -74,7 +74,7 @@ instance : Zero (M ⧸ p) where -- Use Quotient.mk'' instead of mk here because mk is not reducible. -- This would lead to non-defeq diamonds. -- See also the same comment at the One instance for Con. - zero := Quotient.mk'' 0 + zero := ⟦0⟧ instance : Inhabited (M ⧸ p) := ⟨0⟩ @@ -107,7 +107,7 @@ variable {S : Type*} [SMul S R] [SMul S M] [IsScalarTower S R M] (P : Submodule instance instSMul' : SMul S (M ⧸ P) := ⟨fun a => - Quotient.map' (a • ·) fun x y h => + Quotient.map (a • ·) fun x y h => leftRel_apply.mpr <| by simpa using Submodule.smul_mem P (a • (1 : R)) (leftRel_apply.mp h)⟩ -- Porting note: should this be marked as a `@[default_instance]`? @@ -121,15 +121,15 @@ theorem mk_smul (r : S) (x : M) : (mk (r • x) : M ⧸ p) = r • mk x := instance smulCommClass (T : Type*) [SMul T R] [SMul T M] [IsScalarTower T R M] [SMulCommClass S T M] : SMulCommClass S T (M ⧸ P) where - smul_comm _x _y := Quotient.ind' fun _z => congr_arg mk (smul_comm _ _ _) + smul_comm _x _y := Quotient.ind fun _z => congr_arg mk (smul_comm _ _ _) instance isScalarTower (T : Type*) [SMul T R] [SMul T M] [IsScalarTower T R M] [SMul S T] [IsScalarTower S T M] : IsScalarTower S T (M ⧸ P) where - smul_assoc _x _y := Quotient.ind' fun _z => congr_arg mk (smul_assoc _ _ _) + smul_assoc _x _y := Quotient.ind fun _z => congr_arg mk (smul_assoc _ _ _) instance isCentralScalar [SMul Sᵐᵒᵖ R] [SMul Sᵐᵒᵖ M] [IsScalarTower Sᵐᵒᵖ R M] [IsCentralScalar S M] : IsCentralScalar S (M ⧸ P) where - op_smul_eq_smul _x := Quotient.ind' fun _z => congr_arg mk <| op_smul_eq_smul _ _ + op_smul_eq_smul _x := Quotient.ind fun _z => congr_arg mk <| op_smul_eq_smul _ _ end SMul @@ -141,7 +141,7 @@ variable {S : Type*} -- TODO: leanprover-community/mathlib4#7432 instance mulAction' [Monoid S] [SMul S R] [MulAction S M] [IsScalarTower S R M] (P : Submodule R M) : MulAction S (M ⧸ P) := - { Function.Surjective.mulAction mk (surjective_quot_mk _) <| Submodule.Quotient.mk_smul P with + { Function.Surjective.mulAction mk Quot.surjective_mk <| Submodule.Quotient.mk_smul P with toSMul := instSMul' _ } -- Porting note: should this be marked as a `@[default_instance]`? @@ -161,7 +161,7 @@ instance smulZeroClass (P : Submodule R M) : SMulZeroClass R (M ⧸ P) := instance distribSMul' [SMul S R] [DistribSMul S M] [IsScalarTower S R M] (P : Submodule R M) : DistribSMul S (M ⧸ P) := { Function.Surjective.distribSMul {toFun := mk, map_zero' := rfl, map_add' := fun _ _ => rfl} - (surjective_quot_mk _) (Submodule.Quotient.mk_smul P) with + Quot.surjective_mk (Submodule.Quotient.mk_smul P) with toSMulZeroClass := smulZeroClass' _ } -- Porting note: should this be marked as a `@[default_instance]`? @@ -173,7 +173,7 @@ instance distribSMul (P : Submodule R M) : DistribSMul R (M ⧸ P) := instance distribMulAction' [Monoid S] [SMul S R] [DistribMulAction S M] [IsScalarTower S R M] (P : Submodule R M) : DistribMulAction S (M ⧸ P) := { Function.Surjective.distribMulAction {toFun := mk, map_zero' := rfl, map_add' := fun _ _ => rfl} - (surjective_quot_mk _) (Submodule.Quotient.mk_smul P) with + Quot.surjective_mk (Submodule.Quotient.mk_smul P) with toMulAction := mulAction' _ } -- Porting note: should this be marked as a `@[default_instance]`? @@ -185,7 +185,7 @@ instance distribMulAction (P : Submodule R M) : DistribMulAction R (M ⧸ P) := instance module' [Semiring S] [SMul S R] [Module S M] [IsScalarTower S R M] (P : Submodule R M) : Module S (M ⧸ P) := { Function.Surjective.module _ {toFun := mk, map_zero' := by rfl, map_add' := fun _ _ => by rfl} - (surjective_quot_mk _) (Submodule.Quotient.mk_smul P) with + Quot.surjective_mk (Submodule.Quotient.mk_smul P) with toDistribMulAction := distribMulAction' _ } -- Porting note: should this be marked as a `@[default_instance]`? @@ -200,8 +200,8 @@ where `P : Submodule R M`. def restrictScalarsEquiv [Ring S] [SMul S R] [Module S M] [IsScalarTower S R M] (P : Submodule R M) : (M ⧸ P.restrictScalars S) ≃ₗ[S] M ⧸ P := { Quotient.congrRight fun _ _ => Iff.rfl with - map_add' := fun x y => Quotient.inductionOn₂' x y fun _x' _y' => rfl - map_smul' := fun _c x => Quotient.inductionOn' x fun _x' => rfl } + map_add' := fun x y => Quotient.inductionOn₂ x y fun _x' _y' => rfl + map_smul' := fun _c x => Quotient.inductionOn x fun _x' => rfl } @[simp] theorem restrictScalarsEquiv_mk [Ring S] [SMul S R] [Module S M] [IsScalarTower S R M] @@ -234,7 +234,7 @@ instance QuotientBot.infinite [Infinite M] : Infinite (M ⧸ (⊥ : Submodule R instance QuotientTop.unique : Unique (M ⧸ (⊤ : Submodule R M)) where default := 0 - uniq x := Quotient.inductionOn' x fun _x => (Submodule.Quotient.eq ⊤).mpr Submodule.mem_top + uniq x := Quotient.inductionOn x fun _x => (Submodule.Quotient.eq ⊤).mpr Submodule.mem_top instance QuotientTop.fintype : Fintype (M ⧸ (⊤ : Submodule R M)) := Fintype.ofSubsingleton 0 @@ -270,7 +270,7 @@ variable {M₂ : Type*} [AddCommGroup M₂] [Module R M₂] theorem quot_hom_ext (f g : (M ⧸ p) →ₗ[R] M₂) (h : ∀ x : M, f (Quotient.mk x) = g (Quotient.mk x)) : f = g := - LinearMap.ext fun x => Quotient.inductionOn' x h + LinearMap.ext fun x => Quotient.inductionOn x h /-- The map from a module `M` to the quotient of `M` by a submodule `p` as a linear map. -/ def mkQ : M →ₗ[R] M ⧸ p where @@ -295,7 +295,7 @@ variable {R₂ M₂ : Type*} [Ring R₂] [AddCommGroup M₂] [Module R₂ M₂] See note [partially-applied ext lemmas]. -/ @[ext 1100] -- Porting note: increase priority so this applies before `LinearMap.ext` theorem linearMap_qext ⦃f g : M ⧸ p →ₛₗ[τ₁₂] M₂⦄ (h : f.comp p.mkQ = g.comp p.mkQ) : f = g := - LinearMap.ext fun x => Quotient.inductionOn' x <| (LinearMap.congr_fun h : _) + LinearMap.ext fun x => Quotient.inductionOn x <| (LinearMap.congr_fun h : _) /-- The map from the quotient of `M` by a submodule `p` to `M₂` induced by a linear map `f : M → M₂` vanishing on `p`, as a linear map. -/ @@ -461,8 +461,8 @@ def Quotient.equiv {N : Type*} [AddCommGroup N] [Module R N] (P : Submodule R M) rw [← hf, Submodule.mem_map] at hx obtain ⟨y, hy, rfl⟩ := hx simpa - left_inv := fun x => Quotient.inductionOn' x (by simp [mk''_eq_mk]) - right_inv := fun x => Quotient.inductionOn' x (by simp [mk''_eq_mk]) } + left_inv := fun x => Quotient.inductionOn x (by simp [mk''_eq_mk]) + right_inv := fun x => Quotient.inductionOn x (by simp [mk''_eq_mk]) } @[simp] theorem Quotient.equiv_symm {R M N : Type*} [CommRing R] [AddCommGroup M] [Module R M] diff --git a/Mathlib/LinearAlgebra/QuotientPi.lean b/Mathlib/LinearAlgebra/QuotientPi.lean index e4771d9be3c91..6510541a913c7 100644 --- a/Mathlib/LinearAlgebra/QuotientPi.lean +++ b/Mathlib/LinearAlgebra/QuotientPi.lean @@ -93,7 +93,7 @@ def invFun : (∀ i, Ms i ⧸ p i) → (∀ i, Ms i) ⧸ pi Set.univ p := piQuotientLift p (pi Set.univ p) _ fun _ => le_comap_single_pi p theorem left_inv : Function.LeftInverse (invFun p) (toFun p) := fun x => - Quotient.inductionOn' x fun x' => by + Quotient.inductionOn x fun x' => by rw [Quotient.mk''_eq_mk x'] dsimp only [toFun, invFun] rw [quotientPiLift_mk p, funext fun i => (mkQ_apply (p i) (x' i)), piQuotientLift_mk p, @@ -102,7 +102,7 @@ theorem left_inv : Function.LeftInverse (invFun p) (toFun p) := fun x => theorem right_inv : Function.RightInverse (invFun p) (toFun p) := by dsimp only [toFun, invFun] rw [Function.rightInverse_iff_comp, ← coe_comp, ← @id_coe R] - refine congr_arg _ (pi_ext fun i x => Quotient.inductionOn' x fun x' => funext fun j => ?_) + refine congr_arg _ (pi_ext fun i x => Quotient.inductionOn x fun x' => funext fun j => ?_) rw [comp_apply, piQuotientLift_single, Quotient.mk''_eq_mk, mapQ_apply, quotientPiLift_mk, id_apply] by_cases hij : i = j <;> simp only [mkQ_apply, coe_single] diff --git a/Mathlib/Logic/Encodable/Basic.lean b/Mathlib/Logic/Encodable/Basic.lean index 60412ec201292..1df0a6e75bd9e 100644 --- a/Mathlib/Logic/Encodable/Basic.lean +++ b/Mathlib/Logic/Encodable/Basic.lean @@ -604,7 +604,7 @@ theorem Quotient.rep_spec (q : Quotient s) : ⟦q.rep⟧ = q := /-- The quotient of an encodable space by a decidable equivalence relation is encodable. -/ def encodableQuotient : Encodable (Quotient s) := - ⟨fun q => encode q.rep, fun n => Quotient.mk'' <$> decode n, by + ⟨fun q => encode q.rep, fun n => (Quotient.mk _) <$> decode n, by rintro ⟨l⟩; dsimp; rw [encodek]; exact congr_arg some ⟦l⟧.rep_spec⟩ end Quotient diff --git a/Mathlib/MeasureTheory/Constructions/Polish/Basic.lean b/Mathlib/MeasureTheory/Constructions/Polish/Basic.lean index f1677d8c92db5..21e322d5d763b 100644 --- a/Mathlib/MeasureTheory/Constructions/Polish/Basic.lean +++ b/Mathlib/MeasureTheory/Constructions/Polish/Basic.lean @@ -604,7 +604,7 @@ theorem Continuous.map_borel_eq {X Y : Type*} [TopologicalSpace X] [PolishSpace instance Quotient.borelSpace {X : Type*} [TopologicalSpace X] [PolishSpace X] [MeasurableSpace X] [BorelSpace X] {s : Setoid X} [T0Space (Quotient s)] [SecondCountableTopology (Quotient s)] : BorelSpace (Quotient s) := - ⟨continuous_quotient_mk'.map_eq_borel (surjective_quotient_mk' _)⟩ + ⟨continuous_quotient_mk'.map_eq_borel Quotient.surjective_mk'⟩ /-- When the subgroup `N < G` is not necessarily `Normal`, we have a `CosetSpace` as opposed to `QuotientGroup` (the next `instance`). diff --git a/Mathlib/MeasureTheory/Function/AEEqFun.lean b/Mathlib/MeasureTheory/Function/AEEqFun.lean index c0d68d263e2f8..835033d5208dd 100644 --- a/Mathlib/MeasureTheory/Function/AEEqFun.lean +++ b/Mathlib/MeasureTheory/Function/AEEqFun.lean @@ -114,7 +114,7 @@ variable [TopologicalSpace β] /-- Construct the equivalence class `[f]` of an almost everywhere measurable function `f`, based on the equivalence relation of being almost everywhere equal. -/ def mk {β : Type*} [TopologicalSpace β] (f : α → β) (hf : AEStronglyMeasurable f μ) : α →ₘ[μ] β := - Quotient.mk'' ⟨f, hf⟩ + ⟦⟨f, hf⟩⟧ open scoped Classical in /-- Coercion from a space of equivalence classes of almost everywhere strongly measurable @@ -124,7 +124,7 @@ then we choose that one. -/ def cast (f : α →ₘ[μ] β) : α → β := if h : ∃ (b : β), f = mk (const α b) aestronglyMeasurable_const then const α <| Classical.choose h else - AEStronglyMeasurable.mk _ (Quotient.out' f : { f : α → β // AEStronglyMeasurable f μ }).2 + AEStronglyMeasurable.mk _ (Quotient.out f : { f : α → β // AEStronglyMeasurable f μ }).2 /-- A measurable representative of an `AEEqFun` [f] -/ instance instCoeFun : CoeFun (α →ₘ[μ] β) fun _ => α → β := ⟨cast⟩ @@ -153,14 +153,14 @@ theorem quot_mk_eq_mk (f : α → β) (hf) : @[simp] theorem mk_eq_mk {f g : α → β} {hf hg} : (mk f hf : α →ₘ[μ] β) = mk g hg ↔ f =ᵐ[μ] g := - Quotient.eq'' + Quotient.eq @[simp] theorem mk_coeFn (f : α →ₘ[μ] β) : mk f f.aestronglyMeasurable = f := by conv_lhs => simp only [cast] split_ifs with h · exact Classical.choose_spec h |>.symm - conv_rhs => rw [← Quotient.out_eq' f] + conv_rhs => rw [← Quotient.out_eq f] rw [← mk, mk_eq_mk] exact (AEStronglyMeasurable.ae_eq_mk _).symm @@ -173,7 +173,7 @@ theorem coeFn_mk (f : α → β) (hf) : (mk f hf : α →ₘ[μ] β) =ᵐ[μ] f @[elab_as_elim] theorem induction_on (f : α →ₘ[μ] β) {p : (α →ₘ[μ] β) → Prop} (H : ∀ f hf, p (mk f hf)) : p f := - Quotient.inductionOn' f <| Subtype.forall.2 H + Quotient.inductionOn f <| Subtype.forall.2 H @[elab_as_elim] theorem induction_on₂ {α' β' : Type*} [MeasurableSpace α'] [TopologicalSpace β'] {μ' : Measure α'} @@ -206,7 +206,7 @@ open MeasureTheory.Measure (QuasiMeasurePreserving) See also `AEEqFun.compMeasurePreserving`. -/ def compQuasiMeasurePreserving (g : β →ₘ[ν] γ) (f : α → β) (hf : QuasiMeasurePreserving f μ ν) : α →ₘ[μ] γ := - Quotient.liftOn' g (fun g ↦ mk (g ∘ f) <| g.2.comp_quasiMeasurePreserving hf) fun _ _ h ↦ + Quotient.liftOn g (fun g ↦ mk (g ∘ f) <| g.2.comp_quasiMeasurePreserving hf) fun _ _ h ↦ mk_eq_mk.2 <| h.comp_tendsto hf.tendsto_ae @[simp] @@ -262,7 +262,7 @@ variable [TopologicalSpace β] [TopologicalSpace γ] return the equivalence class of `g ∘ f`, i.e., the almost everywhere equal function `[g ∘ f] : α →ₘ γ`. -/ def comp (g : β → γ) (hg : Continuous g) (f : α →ₘ[μ] β) : α →ₘ[μ] γ := - Quotient.liftOn' f (fun f => mk (g ∘ (f : α → β)) (hg.comp_aestronglyMeasurable f.2)) + Quotient.liftOn f (fun f => mk (g ∘ (f : α → β)) (hg.comp_aestronglyMeasurable f.2)) fun _ _ H => mk_eq_mk.2 <| H.fun_comp g @[simp] @@ -294,7 +294,7 @@ variable [MeasurableSpace β] [PseudoMetrizableSpace β] [BorelSpace β] [Measur return the equivalence class of `g ∘ f`, i.e., the almost everywhere equal function `[g ∘ f] : α →ₘ γ`. This requires that `γ` has a second countable topology. -/ def compMeasurable (g : β → γ) (hg : Measurable g) (f : α →ₘ[μ] β) : α →ₘ[μ] γ := - Quotient.liftOn' f + Quotient.liftOn f (fun f' => mk (g ∘ (f' : α → β)) (hg.comp_aemeasurable f'.2.aemeasurable).aestronglyMeasurable) fun _ _ H => mk_eq_mk.2 <| H.fun_comp g @@ -319,7 +319,7 @@ end CompMeasurable /-- The class of `x ↦ (f x, g x)`. -/ def pair (f : α →ₘ[μ] β) (g : α →ₘ[μ] γ) : α →ₘ[μ] β × γ := - Quotient.liftOn₂' f g (fun f g => mk (fun x => (f.1 x, g.1 x)) (f.2.prod_mk g.2)) + Quotient.liftOn₂ f g (fun f g => mk (fun x => (f.1 x, g.1 x)) (f.2.prod_mk g.2)) fun _f _g _f' _g' Hf Hg => mk_eq_mk.2 <| Hf.prod_mk Hg @[simp] @@ -408,7 +408,7 @@ end /-- Interpret `f : α →ₘ[μ] β` as a germ at `ae μ` forgetting that `f` is almost everywhere strongly measurable. -/ def toGerm (f : α →ₘ[μ] β) : Germ (ae μ) β := - Quotient.liftOn' f (fun f => ((f : α → β) : Germ (ae μ) β)) fun _ _ H => Germ.coe_eq.2 H + Quotient.liftOn f (fun f => ((f : α → β) : Germ (ae μ) β)) fun _ _ H => Germ.coe_eq.2 H @[simp] theorem mk_toGerm (f : α → β) (hf) : (mk f hf : α →ₘ[μ] β).toGerm = f := @@ -810,7 +810,7 @@ open ENNReal /-- For `f : α → ℝ≥0∞`, define `∫ [f]` to be `∫ f` -/ def lintegral (f : α →ₘ[μ] ℝ≥0∞) : ℝ≥0∞ := - Quotient.liftOn' f (fun f => ∫⁻ a, (f : α → ℝ≥0∞) a ∂μ) fun _ _ => lintegral_congr_ae + Quotient.liftOn f (fun f => ∫⁻ a, (f : α → ℝ≥0∞) a ∂μ) fun _ _ => lintegral_congr_ae @[simp] theorem lintegral_mk (f : α → ℝ≥0∞) (hf) : (mk f hf : α →ₘ[μ] ℝ≥0∞).lintegral = ∫⁻ a, f a ∂μ := diff --git a/Mathlib/MeasureTheory/Group/FundamentalDomain.lean b/Mathlib/MeasureTheory/Group/FundamentalDomain.lean index 561111dd29111..03f22740ddfb3 100644 --- a/Mathlib/MeasureTheory/Group/FundamentalDomain.lean +++ b/Mathlib/MeasureTheory/Group/FundamentalDomain.lean @@ -849,7 +849,7 @@ lemma QuotientMeasureEqMeasurePreimage.sigmaFiniteQuotient have : π ⁻¹' (π '' (A n)) = _ := MulAction.quotient_preimage_image_eq_union_mul (A n) (G := G) have measπAn : MeasurableSet (π '' A n) := by let _ : Setoid α := α_mod_G - rw [measurableSet_quotient, Quotient.mk''_eq_mk, this] + rw [measurableSet_quotient, this] apply MeasurableSet.iUnion exact fun g ↦ MeasurableSet.const_smul (hA_meas n) g rw [fund_dom_s.projection_respects_measure_apply (μ := μ) measπAn, this, iUnion_inter] @@ -857,7 +857,7 @@ lemma QuotientMeasureEqMeasurePreimage.sigmaFiniteQuotient rw [fund_dom_s.measure_eq_tsum (A n)] exact measure_iUnion_le _ · rw [← image_iUnion, hA'] - refine image_univ_of_surjective (by convert surjective_quotient_mk' α) + refine image_univ_of_surjective Quotient.surjective_mk /-- A measure `μ` on `α ⧸ G` satisfying `QuotientMeasureEqMeasurePreimage` and having finite covolume is a finite measure. -/ diff --git a/Mathlib/MeasureTheory/MeasurableSpace/Basic.lean b/Mathlib/MeasureTheory/MeasurableSpace/Basic.lean index f2827cef05cdd..27e70bbabfb46 100644 --- a/Mathlib/MeasureTheory/MeasurableSpace/Basic.lean +++ b/Mathlib/MeasureTheory/MeasurableSpace/Basic.lean @@ -426,7 +426,7 @@ instance Quot.instMeasurableSpace {α} {r : α → α → Prop} [m : MeasurableS instance Quotient.instMeasurableSpace {α} {s : Setoid α} [m : MeasurableSpace α] : MeasurableSpace (Quotient s) := - m.map Quotient.mk'' + m.map (Quotient.mk _) @[to_additive] instance QuotientGroup.measurableSpace {G} [Group G] [MeasurableSpace G] (S : Subgroup G) : @@ -434,28 +434,30 @@ instance QuotientGroup.measurableSpace {G} [Group G] [MeasurableSpace G] (S : Su Quotient.instMeasurableSpace theorem measurableSet_quotient {s : Setoid α} {t : Set (Quotient s)} : - MeasurableSet t ↔ MeasurableSet (Quotient.mk'' ⁻¹' t) := + MeasurableSet t ↔ MeasurableSet (Quotient.mk _ ⁻¹' t) := Iff.rfl theorem measurable_from_quotient {s : Setoid α} {f : Quotient s → β} : - Measurable f ↔ Measurable (f ∘ Quotient.mk'') := + Measurable f ↔ Measurable (f ∘ Quotient.mk _) := Iff.rfl @[measurability] -theorem measurable_quotient_mk' [s : Setoid α] : Measurable (Quotient.mk' : α → Quotient s) := +theorem measurable_quotient_mk {s : Setoid α} : Measurable (Quotient.mk _ : α → Quotient s) := fun _ => id @[measurability] -theorem measurable_quotient_mk'' {s : Setoid α} : Measurable (Quotient.mk'' : α → Quotient s) := +theorem measurable_quotient_mk' [s : Setoid α] : Measurable (Quotient.mk' : α → Quotient s) := fun _ => id +@[deprecated (since := "2024-08-28")] alias measurable_quotient_mk'' := measurable_quotient_mk + @[measurability] theorem measurable_quot_mk {r : α → α → Prop} : Measurable (Quot.mk r) := fun _ => id @[to_additive (attr := measurability)] theorem QuotientGroup.measurable_coe {G} [Group G] [MeasurableSpace G] {S : Subgroup G} : Measurable ((↑) : G → G ⧸ S) := - measurable_quotient_mk'' + measurable_quotient_mk @[to_additive] nonrec theorem QuotientGroup.measurable_from_quotient {G} [Group G] [MeasurableSpace G] diff --git a/Mathlib/MeasureTheory/Measure/Haar/Quotient.lean b/Mathlib/MeasureTheory/Measure/Haar/Quotient.lean index 4882bfa945404..908f93bd4c906 100644 --- a/Mathlib/MeasureTheory/Measure/Haar/Quotient.lean +++ b/Mathlib/MeasureTheory/Measure/Haar/Quotient.lean @@ -134,7 +134,7 @@ lemma MeasureTheory.QuotientMeasureEqMeasurePreimage.mulInvariantMeasure_quotien obtain ⟨x₁, h⟩ := @Quotient.exists_rep _ (QuotientGroup.leftRel Γ) x convert measure_preimage_smul μ x₁ A using 1 · rw [← h, Measure.map_apply (measurable_const_mul _) hA] - simp [← MulAction.Quotient.coe_smul_out', ← Quotient.mk''_eq_mk] + simp [← MulAction.Quotient.coe_smul_out] exact smulInvariantMeasure_quotient ν variable [Countable Γ] [IsMulRightInvariant ν] [SigmaFinite ν] diff --git a/Mathlib/ModelTheory/DirectLimit.lean b/Mathlib/ModelTheory/DirectLimit.lean index a9c1fe39191e1..85979f467a0d1 100644 --- a/Mathlib/ModelTheory/DirectLimit.lean +++ b/Mathlib/ModelTheory/DirectLimit.lean @@ -262,6 +262,7 @@ theorem exists_quotient_mk'_sigma_mk'_eq {α : Type*} [Finite α] (x : α → Di ext a rw [Quotient.eq_mk_iff_out, unify] generalize_proofs r + rw [← Setoid.equiv_iff_apply] change _ ≈ .mk f i (f (Quotient.out (x a)).fst i r (Quotient.out (x a)).snd) have : (.mk f i (f (Quotient.out (x a)).fst i r (Quotient.out (x a)).snd) : Σˣ f).fst ≤ i := le_rfl @@ -348,7 +349,8 @@ def lift (g : ∀ i, G i ↪[L] P) (Hg : ∀ i j hij x, g j (f i j hij x) = g i rw [← Quotient.out_eq x, ← Quotient.out_eq y, Quotient.lift_mk, Quotient.lift_mk] at xy obtain ⟨i, hx, hy⟩ := directed_of (· ≤ ·) x.out.1 y.out.1 rw [← Hg x.out.1 i hx, ← Hg y.out.1 i hy] at xy - rw [← Quotient.out_eq x, ← Quotient.out_eq y, Quotient.eq, equiv_iff G f hx hy] + rw [← Quotient.out_eq x, ← Quotient.out_eq y, Quotient.eq, + ← Setoid.equiv_iff_apply, equiv_iff G f hx hy] exact (g i).injective xy map_fun' F x := by obtain ⟨i, y, rfl⟩ := exists_quotient_mk'_sigma_mk'_eq G f x diff --git a/Mathlib/ModelTheory/Fraisse.lean b/Mathlib/ModelTheory/Fraisse.lean index 1318d2970ceb0..da5878681979a 100644 --- a/Mathlib/ModelTheory/Fraisse.lean +++ b/Mathlib/ModelTheory/Fraisse.lean @@ -209,6 +209,7 @@ theorem age_directLimit {ι : Type w} [Preorder ι] [IsDirected ι (· ≤ ·)] intro x hx refine ⟨f (out x).1 i (hi (out x).1 (Finset.mem_image_of_mem _ hx)) (out x).2, ?_⟩ rw [Embedding.coe_toHom, DirectLimit.of_apply, @Quotient.mk_eq_iff_out _ (_), + ← Setoid.equiv_iff_apply, DirectLimit.equiv_iff G f _ (hi (out x).1 (Finset.mem_image_of_mem _ hx)), DirectedSystem.map_self] rfl diff --git a/Mathlib/ModelTheory/Ultraproducts.lean b/Mathlib/ModelTheory/Ultraproducts.lean index efe11fdadc8cd..55900ea29aa9c 100644 --- a/Mathlib/ModelTheory/Ultraproducts.lean +++ b/Mathlib/ModelTheory/Ultraproducts.lean @@ -101,7 +101,7 @@ theorem boundedFormula_realize_cast {β : Type*} {n : ℕ} (φ : L.BoundedFormul simp only [BoundedFormula.Realize, h2, term_realize_cast] erw [(Sum.comp_elim ((↑) : (∀ a, M a) → (u : Filter α).Product M) x v).symm, term_realize_cast, term_realize_cast] - exact Quotient.eq'' + exact Quotient.eq · have h2 : ∀ a : α, (Sum.elim (fun i : β => x i a) fun i => v i a) = fun i => Sum.elim x v i a := fun a => funext fun i => Sum.casesOn i (fun i => rfl) fun i => rfl simp only [BoundedFormula.Realize, h2] diff --git a/Mathlib/NumberTheory/NumberField/Embeddings.lean b/Mathlib/NumberTheory/NumberField/Embeddings.lean index d2421c79c769e..218787bc9dfa7 100644 --- a/Mathlib/NumberTheory/NumberField/Embeddings.lean +++ b/Mathlib/NumberTheory/NumberField/Embeddings.lean @@ -721,7 +721,7 @@ def orbitRelEquiv [IsGalois k K] : exact ⟨⟦w'⟧, hw⟩ lemma orbitRelEquiv_apply_mk'' [IsGalois k K] (w : InfinitePlace K) : - orbitRelEquiv (Quotient.mk'' w) = comap w (algebraMap k K) := rfl + orbitRelEquiv ⟦w⟧ = comap w (algebraMap k K) := rfl variable (k w) diff --git a/Mathlib/NumberTheory/NumberField/Units/DirichletTheorem.lean b/Mathlib/NumberTheory/NumberField/Units/DirichletTheorem.lean index 33f35ed619614..9349badfada5c 100644 --- a/Mathlib/NumberTheory/NumberField/Units/DirichletTheorem.lean +++ b/Mathlib/NumberTheory/NumberField/Units/DirichletTheorem.lean @@ -469,12 +469,12 @@ def basisModTorsion : Basis (Fin (rank K)) ℤ (Additive ((𝓞 K)ˣ ⧸ (torsio units in `basisModTorsion`. -/ def fundSystem : Fin (rank K) → (𝓞 K)ˣ := -- `:)` prevents the `⧸` decaying to a quotient by `leftRel` when we unfold this later - fun i => Quotient.out' (Additive.toMul (basisModTorsion K i):) + fun i => Quotient.out (Additive.toMul (basisModTorsion K i):) theorem fundSystem_mk (i : Fin (rank K)) : Additive.ofMul ⟦fundSystem K i⟧ = (basisModTorsion K i) := by rw [fundSystem, Equiv.apply_eq_iff_eq_symm_apply, @Quotient.mk_eq_iff_out, - Quotient.out', Quotient.out_equiv_out] + Quotient.out_equiv_out] rfl /-- The exponents that appear in the unique decomposition of a unit as the product of @@ -491,7 +491,7 @@ theorem fun_eq_repr {x ζ : (𝓞 K)ˣ} {f : Fin (rank K) → ℤ} (hζ : ζ ∈ rw [h, QuotientGroup.mk_mul, (QuotientGroup.eq_one_iff _).mpr hζ, one_mul, QuotientGroup.mk_prod, ofMul_prod]; rfl _ = ∑ i, (f i) • (basisModTorsion K i) := by - simp_rw [fundSystem, QuotientGroup.out_eq', ofMul_toMul] + simp_rw [fundSystem, QuotientGroup.out_eq, ofMul_toMul] /-- **Dirichlet Unit Theorem**. Any unit `x` of `𝓞 K` can be written uniquely as the product of a root of unity and powers of the units of the fundamental system `fundSystem`. -/ @@ -501,7 +501,7 @@ theorem exist_unique_eq_mul_prod (x : (𝓞 K)ˣ) : ∃! ζe : torsion K × (Fin have h_tors : ζ ∈ torsion K := by rw [← QuotientGroup.eq_one_iff, QuotientGroup.mk_mul, QuotientGroup.mk_inv, ← ofMul_eq_zero, ofMul_mul, ofMul_inv, QuotientGroup.mk_prod, ofMul_prod] - simp_rw [QuotientGroup.mk_zpow, ofMul_zpow, fundSystem, QuotientGroup.out_eq'] + simp_rw [QuotientGroup.mk_zpow, ofMul_zpow, fundSystem, QuotientGroup.out_eq] rw [add_eq_zero_iff_eq_neg, neg_neg] exact ((basisModTorsion K).sum_repr (Additive.ofMul ↑x)).symm refine ⟨⟨⟨ζ, h_tors⟩, ((basisModTorsion K).repr (Additive.ofMul ↑x) : Fin (rank K) → ℤ)⟩, ?_, ?_⟩ diff --git a/Mathlib/NumberTheory/Padics/PadicNumbers.lean b/Mathlib/NumberTheory/Padics/PadicNumbers.lean index 58bc95a1f23b1..d01c0a993fd84 100644 --- a/Mathlib/NumberTheory/Padics/PadicNumbers.lean +++ b/Mathlib/NumberTheory/Padics/PadicNumbers.lean @@ -958,7 +958,7 @@ theorem valuation_one : valuation (1 : ℚ_[p]) = 0 := by simp theorem norm_eq_pow_val {x : ℚ_[p]} : x ≠ 0 → ‖x‖ = (p : ℝ) ^ (-x.valuation) := by - refine Quotient.inductionOn' x fun f hf => ?_ + refine Quotient.inductionOn x fun f hf => ?_ change (PadicSeq.norm _ : ℝ) = (p : ℝ) ^ (-PadicSeq.valuation _) rw [PadicSeq.norm_eq_pow_val] · change ↑((p : ℚ) ^ (-PadicSeq.valuation f)) = (p : ℝ) ^ (-PadicSeq.valuation f) diff --git a/Mathlib/NumberTheory/RamificationInertia.lean b/Mathlib/NumberTheory/RamificationInertia.lean index c059ce200afdd..52c19f2674149 100644 --- a/Mathlib/NumberTheory/RamificationInertia.lean +++ b/Mathlib/NumberTheory/RamificationInertia.lean @@ -197,7 +197,7 @@ theorem inertiaDeg_algebraMap [Algebra R S] [Algebra (R ⧸ p) (S ⧸ P)] have := comap_eq_of_scalar_tower_quotient (algebraMap (R ⧸ p) (S ⧸ P)).injective rw [inertiaDeg, dif_pos this] congr - refine Algebra.algebra_ext _ _ fun x' => Quotient.inductionOn' x' fun x => ?_ + refine Algebra.algebra_ext _ _ fun x' => Quotient.inductionOn x' fun x => ?_ change Ideal.Quotient.lift p _ _ (Ideal.Quotient.mk p x) = algebraMap _ _ (Ideal.Quotient.mk p x) rw [Ideal.Quotient.lift_mk, ← Ideal.Quotient.algebraMap_eq P, ← IsScalarTower.algebraMap_eq, ← Ideal.Quotient.algebraMap_eq, ← IsScalarTower.algebraMap_apply] @@ -474,7 +474,7 @@ and `quotientRangePowQuotSuccInclusionEquiv` for this as a linear equivalence. noncomputable def quotientToQuotientRangePowQuotSuccAux {i : ℕ} {a : S} (a_mem : a ∈ P ^ i) : S ⧸ P → (P ^ i).map (Ideal.Quotient.mk (P ^ e)) ⧸ LinearMap.range (powQuotSuccInclusion f p P i) := - Quotient.map' (fun x : S => ⟨_, Ideal.mem_map_of_mem _ (Ideal.mul_mem_right x _ a_mem)⟩) + Quotient.map (fun x : S => ⟨_, Ideal.mem_map_of_mem _ (Ideal.mul_mem_right x _ a_mem)⟩) fun x y h => by rw [Submodule.quotientRel_r_def] at h ⊢ simp only [_root_.map_mul, LinearMap.mem_range] @@ -486,7 +486,7 @@ noncomputable def quotientToQuotientRangePowQuotSuccAux {i : ℕ} {a : S} (a_mem theorem quotientToQuotientRangePowQuotSuccAux_mk {i : ℕ} {a : S} (a_mem : a ∈ P ^ i) (x : S) : quotientToQuotientRangePowQuotSuccAux f p P a_mem (Submodule.Quotient.mk x) = Submodule.Quotient.mk ⟨_, Ideal.mem_map_of_mem _ (Ideal.mul_mem_right x _ a_mem)⟩ := by - apply Quotient.map'_mk'' + apply Quotient.map_mk section variable [hfp : NeZero (ramificationIdx f p P)] @@ -497,12 +497,12 @@ noncomputable def quotientToQuotientRangePowQuotSucc {i : ℕ} {a : S} (a_mem : (P ^ i).map (Ideal.Quotient.mk (P ^ e)) ⧸ LinearMap.range (powQuotSuccInclusion f p P i) where toFun := quotientToQuotientRangePowQuotSuccAux f p P a_mem map_add' := by - intro x y; refine Quotient.inductionOn' x fun x => Quotient.inductionOn' y fun y => ?_ + intro x y; refine Quotient.inductionOn x fun x => Quotient.inductionOn y fun y => ?_ simp only [Submodule.Quotient.mk''_eq_mk, ← Submodule.Quotient.mk_add, quotientToQuotientRangePowQuotSuccAux_mk, mul_add] exact congr_arg Submodule.Quotient.mk rfl map_smul' := by - intro x y; refine Quotient.inductionOn' x fun x => Quotient.inductionOn' y fun y => ?_ + intro x y; refine Quotient.inductionOn x fun x => Quotient.inductionOn y fun y => ?_ simp only [Submodule.Quotient.mk''_eq_mk, RingHom.id_apply, quotientToQuotientRangePowQuotSuccAux_mk] refine congr_arg Submodule.Quotient.mk ?_ @@ -519,8 +519,8 @@ theorem quotientToQuotientRangePowQuotSucc_mk {i : ℕ} {a : S} (a_mem : a ∈ P theorem quotientToQuotientRangePowQuotSucc_injective [IsDedekindDomain S] [P.IsPrime] {i : ℕ} (hi : i < e) {a : S} (a_mem : a ∈ P ^ i) (a_not_mem : a ∉ P ^ (i + 1)) : Function.Injective (quotientToQuotientRangePowQuotSucc f p P a_mem) := fun x => - Quotient.inductionOn' x fun x y => - Quotient.inductionOn' y fun y h => by + Quotient.inductionOn x fun x y => + Quotient.inductionOn y fun y h => by have Pe_le_Pi1 : P ^ e ≤ P ^ (i + 1) := Ideal.pow_le_pow_right hi simp only [Submodule.Quotient.mk''_eq_mk, quotientToQuotientRangePowQuotSucc_mk, Submodule.Quotient.eq, LinearMap.mem_range, Subtype.ext_iff, Subtype.coe_mk, diff --git a/Mathlib/Order/Antisymmetrization.lean b/Mathlib/Order/Antisymmetrization.lean index e5205df7dc3be..c94be117ee637 100644 --- a/Mathlib/Order/Antisymmetrization.lean +++ b/Mathlib/Order/Antisymmetrization.lean @@ -88,7 +88,7 @@ def toAntisymmetrization : α → Antisymmetrization α r := /-- Get a representative from the antisymmetrization. -/ noncomputable def ofAntisymmetrization : Antisymmetrization α r → α := - Quotient.out' + Quotient.out instance [Inhabited α] : Inhabited (Antisymmetrization α r) := by unfold Antisymmetrization; infer_instance @@ -101,12 +101,12 @@ protected theorem Antisymmetrization.ind {p : Antisymmetrization α r → Prop} @[elab_as_elim] protected theorem Antisymmetrization.induction_on {p : Antisymmetrization α r → Prop} (a : Antisymmetrization α r) (h : ∀ a, p <| toAntisymmetrization r a) : p a := - Quotient.inductionOn' a h + Quotient.inductionOn a h @[simp] theorem toAntisymmetrization_ofAntisymmetrization (a : Antisymmetrization α r) : toAntisymmetrization r (ofAntisymmetrization r a) = a := - Quotient.out_eq' _ + Quotient.out_eq _ end IsPreorder @@ -119,17 +119,17 @@ theorem AntisymmRel.image {a b : α} (h : AntisymmRel (· ≤ ·) a b) {f : α ⟨hf h.1, hf h.2⟩ instance instPartialOrderAntisymmetrization : PartialOrder (Antisymmetrization α (· ≤ ·)) where - le a b := - (Quotient.liftOn₂' a b (· ≤ ·)) fun (_ _ _ _ : α) h₁ h₂ => - propext ⟨fun h => h₁.2.trans <| h.trans h₂.1, fun h => h₁.1.trans <| h.trans h₂.2⟩ - lt a b := - (Quotient.liftOn₂' a b (· < ·)) fun (_ _ _ _ : α) h₁ h₂ => + le := + Quotient.lift₂ (· ≤ ·) (fun (_ _ _ _ : α) h₁ h₂ => + propext ⟨fun h => h₁.2.trans <| h.trans h₂.1, fun h => h₁.1.trans <| h.trans h₂.2⟩) + lt := + Quotient.lift₂ (· < ·) fun (_ _ _ _ : α) h₁ h₂ => propext ⟨fun h => h₁.2.trans_lt <| h.trans_le h₂.1, fun h => h₁.1.trans_lt <| h.trans_le h₂.2⟩ - le_refl a := Quotient.inductionOn' a <| le_refl - le_trans a b c := Quotient.inductionOn₃' a b c fun _ _ _ => le_trans - lt_iff_le_not_le a b := Quotient.inductionOn₂' a b fun _ _ => lt_iff_le_not_le - le_antisymm a b := Quotient.inductionOn₂' a b fun _ _ hab hba => Quotient.sound' ⟨hab, hba⟩ + le_refl a := Quotient.inductionOn a <| le_refl + le_trans a b c := Quotient.inductionOn₃ a b c fun _ _ _ => le_trans + lt_iff_le_not_le a b := Quotient.inductionOn₂ a b fun _ _ => lt_iff_le_not_le + le_antisymm a b := Quotient.inductionOn₂ a b fun _ _ hab hba => Quotient.sound' ⟨hab, hba⟩ theorem antisymmetrization_fibration : Relation.Fibration (· < ·) (· < ·) (@toAntisymmetrization α (· ≤ ·) _) := by @@ -138,7 +138,7 @@ theorem antisymmetrization_fibration : theorem acc_antisymmetrization_iff : Acc (· < ·) (@toAntisymmetrization α (· ≤ ·) _ a) ↔ Acc (· < ·) a := - acc_liftOn₂'_iff + acc_liftOn₂_iff theorem wellFounded_antisymmetrization_iff : WellFounded (@LT.lt (Antisymmetrization α (· ≤ ·)) _) ↔ WellFounded (@LT.lt α _) := @@ -150,9 +150,9 @@ instance [WellFoundedLT α] : WellFoundedLT (Antisymmetrization α (· ≤ ·)) instance [@DecidableRel α (· ≤ ·)] [@DecidableRel α (· < ·)] [IsTotal α (· ≤ ·)] : LinearOrder (Antisymmetrization α (· ≤ ·)) := { instPartialOrderAntisymmetrization with - le_total := fun a b => Quotient.inductionOn₂' a b <| total_of (· ≤ ·), - decidableLE := fun _ _ => show Decidable (Quotient.liftOn₂' _ _ _ _) from inferInstance, - decidableLT := fun _ _ => show Decidable (Quotient.liftOn₂' _ _ _ _) from inferInstance } + le_total := Quotient.ind₂ <| total_of (· ≤ ·), + decidableLE := fun _ _ => show Decidable (Quotient.lift₂ _ _ _ _) from inferInstance, + decidableLT := fun _ _ => show Decidable (Quotient.lift₂ _ _ _ _) from inferInstance } @[simp] theorem toAntisymmetrization_le_toAntisymmetrization_iff : @@ -167,12 +167,12 @@ theorem toAntisymmetrization_lt_toAntisymmetrization_iff : @[simp] theorem ofAntisymmetrization_le_ofAntisymmetrization_iff {a b : Antisymmetrization α (· ≤ ·)} : ofAntisymmetrization (· ≤ ·) a ≤ ofAntisymmetrization (· ≤ ·) b ↔ a ≤ b := - (Quotient.out'RelEmbedding _).map_rel_iff + (Quotient.outRelEmbedding _).map_rel_iff @[simp] theorem ofAntisymmetrization_lt_ofAntisymmetrization_iff {a b : Antisymmetrization α (· ≤ ·)} : ofAntisymmetrization (· ≤ ·) a < ofAntisymmetrization (· ≤ ·) b ↔ a < b := - (Quotient.out'RelEmbedding _).map_rel_iff + (Quotient.outRelEmbedding _).map_rel_iff @[mono] theorem toAntisymmetrization_mono : Monotone (@toAntisymmetrization α (· ≤ ·) _) := fun _ _ => id @@ -186,39 +186,39 @@ private theorem liftFun_antisymmRel (f : α →o β) : -/ protected def OrderHom.antisymmetrization (f : α →o β) : Antisymmetrization α (· ≤ ·) →o Antisymmetrization β (· ≤ ·) := - ⟨Quotient.map' f <| liftFun_antisymmRel f, fun a b => Quotient.inductionOn₂' a b <| f.mono⟩ + ⟨Quotient.map f <| liftFun_antisymmRel f, fun a b => Quotient.inductionOn₂ a b <| f.mono⟩ @[simp] theorem OrderHom.coe_antisymmetrization (f : α →o β) : - ⇑f.antisymmetrization = Quotient.map' f (liftFun_antisymmRel f) := + ⇑f.antisymmetrization = Quotient.map f (liftFun_antisymmRel f) := rfl /- Porting note: Removed @[simp] attribute. With this `simp` lemma the LHS of `OrderHom.antisymmetrization_apply_mk` is not in normal-form -/ theorem OrderHom.antisymmetrization_apply (f : α →o β) (a : Antisymmetrization α (· ≤ ·)) : - f.antisymmetrization a = Quotient.map' f (liftFun_antisymmRel f) a := + f.antisymmetrization a = Quotient.map f (liftFun_antisymmRel f) a := rfl @[simp] theorem OrderHom.antisymmetrization_apply_mk (f : α →o β) (a : α) : f.antisymmetrization (toAntisymmetrization _ a) = toAntisymmetrization _ (f a) := - @Quotient.map_mk _ _ (_root_.id _) (_root_.id _) f (liftFun_antisymmRel f) _ + Quotient.map_mk f (liftFun_antisymmRel f) _ variable (α) /-- `ofAntisymmetrization` as an order embedding. -/ @[simps] noncomputable def OrderEmbedding.ofAntisymmetrization : Antisymmetrization α (· ≤ ·) ↪o α := - { Quotient.out'RelEmbedding _ with toFun := _root_.ofAntisymmetrization _ } + { Quotient.outRelEmbedding _ with toFun := _root_.ofAntisymmetrization _ } /-- `Antisymmetrization` and `orderDual` commute. -/ def OrderIso.dualAntisymmetrization : (Antisymmetrization α (· ≤ ·))ᵒᵈ ≃o Antisymmetrization αᵒᵈ (· ≤ ·) where - toFun := (Quotient.map' id) fun _ _ => And.symm - invFun := (Quotient.map' id) fun _ _ => And.symm - left_inv a := Quotient.inductionOn' a fun a => by simp_rw [Quotient.map'_mk'', id] - right_inv a := Quotient.inductionOn' a fun a => by simp_rw [Quotient.map'_mk'', id] - map_rel_iff' := @fun a b => Quotient.inductionOn₂' a b fun a b => Iff.rfl + toFun := Quotient.map id fun _ _ => And.symm + invFun := Quotient.map id fun _ _ => And.symm + left_inv a := Quotient.inductionOn a fun a => by simp_rw [Quotient.map_mk, id] + right_inv a := Quotient.inductionOn a fun a => by simp_rw [Quotient.map_mk, id] + map_rel_iff' := @fun a b => Quotient.inductionOn₂ a b fun a b => Iff.rfl @[simp] theorem OrderIso.dualAntisymmetrization_apply (a : α) : diff --git a/Mathlib/Order/Category/PartOrd.lean b/Mathlib/Order/Category/PartOrd.lean index c4c0020df00b2..7a9ca0d83cc19 100644 --- a/Mathlib/Order/Category/PartOrd.lean +++ b/Mathlib/Order/Category/PartOrd.lean @@ -92,10 +92,10 @@ def preordToPartOrd : Preord.{u} ⥤ PartOrd where map f := f.antisymmetrization map_id X := by ext x - exact Quotient.inductionOn' x fun x => Quotient.map'_mk'' _ (fun a b => id) _ + exact Quotient.inductionOn x fun x => Quotient.map_mk _ (fun a b => id) _ map_comp f g := by ext x - exact Quotient.inductionOn' x fun x => OrderHom.antisymmetrization_apply_mk _ _ + exact Quotient.inductionOn x fun x => OrderHom.antisymmetrization_apply_mk _ _ /-- `preordToPartOrd` is left adjoint to the forgetful functor, meaning it is the free functor from `Preord` to `PartOrd`. -/ @@ -106,13 +106,13 @@ def preordToPartOrdForgetAdjunction : { toFun := fun f => ⟨f.toFun ∘ toAntisymmetrization (· ≤ ·), f.mono.comp toAntisymmetrization_mono⟩ invFun := fun f => - ⟨fun a => Quotient.liftOn' a f.toFun (fun _ _ h => (AntisymmRel.image h f.mono).eq), - fun a b => Quotient.inductionOn₂' a b fun _ _ h => f.mono h⟩ + ⟨fun a => Quotient.liftOn a f.toFun (fun _ _ h => (AntisymmRel.image h f.mono).eq), + fun a b => Quotient.inductionOn₂ a b fun _ _ h => f.mono h⟩ left_inv := fun _ => - OrderHom.ext _ _ <| funext fun x => Quotient.inductionOn' x fun _ => rfl + OrderHom.ext _ _ <| funext fun x => Quotient.inductionOn x fun _ => rfl right_inv := fun _ => OrderHom.ext _ _ <| funext fun _ => rfl } homEquiv_naturality_left_symm := fun _ _ => - OrderHom.ext _ _ <| funext fun x => Quotient.inductionOn' x fun _ => rfl + OrderHom.ext _ _ <| funext fun x => Quotient.inductionOn x fun _ => rfl homEquiv_naturality_right := fun _ _ => OrderHom.ext _ _ <| funext fun _ => rfl } -- The `simpNF` linter would complain as `Functor.comp_obj`, `Preord.dual_obj` both apply to LHS @@ -122,7 +122,7 @@ def preordToPartOrdForgetAdjunction : def preordToPartOrdCompToDualIsoToDualCompPreordToPartOrd : preordToPartOrd.{u} ⋙ PartOrd.dual ≅ Preord.dual ⋙ preordToPartOrd := NatIso.ofComponents (fun _ => PartOrd.Iso.mk <| OrderIso.dualAntisymmetrization _) - (fun _ => OrderHom.ext _ _ <| funext fun x => Quotient.inductionOn' x fun _ => rfl) + (fun _ => OrderHom.ext _ _ <| funext fun x => Quotient.inductionOn x fun _ => rfl) -- This lemma was always bad, but the linter only noticed after lean4#2644 attribute [nolint simpNF] preordToPartOrdCompToDualIsoToDualCompPreordToPartOrd_inv_app_coe diff --git a/Mathlib/Order/Filter/Germ/Basic.lean b/Mathlib/Order/Filter/Germ/Basic.lean index dd4039e19d250..86e5687dff9db 100644 --- a/Mathlib/Order/Filter/Germ/Basic.lean +++ b/Mathlib/Order/Filter/Germ/Basic.lean @@ -141,30 +141,30 @@ theorem mk'_eq_coe (l : Filter α) (f : α → β) : @[elab_as_elim] theorem inductionOn (f : Germ l β) {p : Germ l β → Prop} (h : ∀ f : α → β, p f) : p f := - Quotient.inductionOn' f h + Quotient.inductionOn f h @[elab_as_elim] theorem inductionOn₂ (f : Germ l β) (g : Germ l γ) {p : Germ l β → Germ l γ → Prop} (h : ∀ (f : α → β) (g : α → γ), p f g) : p f g := - Quotient.inductionOn₂' f g h + Quotient.inductionOn₂ f g h @[elab_as_elim] theorem inductionOn₃ (f : Germ l β) (g : Germ l γ) (h : Germ l δ) {p : Germ l β → Germ l γ → Germ l δ → Prop} (H : ∀ (f : α → β) (g : α → γ) (h : α → δ), p f g h) : p f g h := - Quotient.inductionOn₃' f g h H + Quotient.inductionOn₃ f g h H /-- Given a map `F : (α → β) → (γ → δ)` that sends functions eventually equal at `l` to functions eventually equal at `lc`, returns a map from `Germ l β` to `Germ lc δ`. -/ def map' {lc : Filter γ} (F : (α → β) → γ → δ) (hF : (l.EventuallyEq ⇒ lc.EventuallyEq) F F) : Germ l β → Germ lc δ := - Quotient.map' F hF + Quotient.map F hF /-- Given a germ `f : Germ l β` and a function `F : (α → β) → γ` sending eventually equal functions to the same value, returns the value `F` takes on functions having germ `f` at `l`. -/ def liftOn {γ : Sort*} (f : Germ l β) (F : (α → β) → γ) (hF : (l.EventuallyEq ⇒ (· = ·)) F F) : γ := - Quotient.liftOn' f F hF + Quotient.liftOn f F hF @[simp] theorem map'_coe {lc : Filter γ} (F : (α → β) → γ → δ) (hF : (l.EventuallyEq ⇒ lc.EventuallyEq) F F) @@ -173,7 +173,7 @@ theorem map'_coe {lc : Filter γ} (F : (α → β) → γ → δ) (hF : (l.Event @[simp, norm_cast] theorem coe_eq : (f : Germ l β) = g ↔ f =ᶠ[l] g := - Quotient.eq'' + Quotient.eq alias ⟨_, _root_.Filter.EventuallyEq.germ_eq⟩ := coe_eq @@ -196,7 +196,7 @@ theorem map_map (op₁ : γ → δ) (op₂ : β → γ) (f : Germ l β) : /-- Lift a binary function `β → γ → δ` to a function `Germ l β → Germ l γ → Germ l δ`. -/ def map₂ (op : β → γ → δ) : Germ l β → Germ l γ → Germ l δ := - Quotient.map₂' (fun f g x => op (f x) (g x)) fun f f' Hf g g' Hg => + Quotient.map₂ (fun f g x => op (f x) (g x)) fun f f' Hf g g' Hg => Hg.mp <| Hf.mono fun x Hf Hg => by simp only [Hf, Hg] @[simp] @@ -299,7 +299,7 @@ theorem liftPred_const_iff [NeBot l] {p : β → Prop} {x : β} : LiftPred p ( /-- Lift a relation `r : β → γ → Prop` to `Germ l β → Germ l γ → Prop`. -/ def LiftRel (r : β → γ → Prop) (f : Germ l β) (g : Germ l γ) : Prop := - Quotient.liftOn₂' f g (fun f g => ∀ᶠ x in l, r (f x) (g x)) fun _f _g _f' _g' Hf Hg => + Quotient.liftOn₂ f g (fun f g => ∀ᶠ x in l, r (f x) (g x)) fun _f _g _f' _g' Hf Hg => propext <| eventually_congr <| Hg.mp <| Hf.mono fun _x hf hg => hf ▸ hg ▸ Iff.rfl @[simp] @@ -336,12 +336,12 @@ theorem coe_one [One M] : ↑(1 : α → M) = (1 : Germ l M) := @[to_additive] instance instSemigroup [Semigroup M] : Semigroup (Germ l M) := - { mul_assoc := fun a b c => Quotient.inductionOn₃' a b c + { mul_assoc := fun a b c => Quotient.inductionOn₃ a b c fun _ _ _ => congrArg ofFun <| mul_assoc .. } @[to_additive] instance instCommSemigroup [CommSemigroup M] : CommSemigroup (Germ l M) := - { mul_comm := Quotient.ind₂' fun _ _ => congrArg ofFun <| mul_comm .. } + { mul_comm := Quotient.ind₂ fun _ _ => congrArg ofFun <| mul_comm .. } @[to_additive] instance instIsLeftCancelMul [Mul M] [IsLeftCancelMul M] : IsLeftCancelMul (Germ l M) where @@ -368,8 +368,8 @@ instance instRightCancelSemigroup [RightCancelSemigroup M] : RightCancelSemigrou @[to_additive] instance instMulOneClass [MulOneClass M] : MulOneClass (Germ l M) := - { one_mul := Quotient.ind' fun _ => congrArg ofFun <| one_mul _ - mul_one := Quotient.ind' fun _ => congrArg ofFun <| mul_one _ } + { one_mul := Quotient.ind fun _ => congrArg ofFun <| one_mul _ + mul_one := Quotient.ind fun _ => congrArg ofFun <| mul_one _ } @[to_additive] instance instSMul [SMul M G] : SMul M (Germ l G) where smul n := map (n • ·) @@ -396,7 +396,7 @@ theorem const_pow [Pow G M] (a : G) (n : M) : (↑(a ^ n) : Germ l G) = (↑a : -- TODO: #7432 @[to_additive] instance instMonoid [Monoid M] : Monoid (Germ l M) := - { Function.Surjective.monoid ofFun (surjective_quot_mk _) (by rfl) + { Function.Surjective.monoid ofFun Quot.surjective_mk (by rfl) (fun _ _ => by rfl) fun _ _ => by rfl with toSemigroup := instSemigroup toOne := instOne @@ -472,11 +472,11 @@ theorem const_div [Div M] (a b : M) : (↑(a / b) : Germ l M) = ↑a / ↑b := @[to_additive] instance instInvolutiveInv [InvolutiveInv G] : InvolutiveInv (Germ l G) := - { inv_inv := Quotient.ind' fun _ => congrArg ofFun<| inv_inv _ } + { inv_inv := Quotient.ind fun _ => congrArg ofFun<| inv_inv _ } instance instHasDistribNeg [Mul G] [HasDistribNeg G] : HasDistribNeg (Germ l G) := - { neg_mul := Quotient.ind₂' fun _ _ => congrArg ofFun <| neg_mul .. - mul_neg := Quotient.ind₂' fun _ _ => congrArg ofFun <| mul_neg .. } + { neg_mul := Quotient.ind₂ fun _ _ => congrArg ofFun <| neg_mul .. + mul_neg := Quotient.ind₂ fun _ _ => congrArg ofFun <| mul_neg .. } @[to_additive] instance instInvOneClass [InvOneClass G] : InvOneClass (Germ l G) := @@ -485,13 +485,13 @@ instance instInvOneClass [InvOneClass G] : InvOneClass (Germ l G) := @[to_additive subNegMonoid] instance instDivInvMonoid [DivInvMonoid G] : DivInvMonoid (Germ l G) where zpow z f := f ^ z - zpow_zero' := Quotient.ind' fun _ => congrArg ofFun <| + zpow_zero' := Quotient.ind fun _ => congrArg ofFun <| funext fun _ => DivInvMonoid.zpow_zero' _ - zpow_succ' _ := Quotient.ind' fun _ => congrArg ofFun <| + zpow_succ' _ := Quotient.ind fun _ => congrArg ofFun <| funext fun _ => DivInvMonoid.zpow_succ' .. - zpow_neg' _ := Quotient.ind' fun _ => congrArg ofFun <| + zpow_neg' _ := Quotient.ind fun _ => congrArg ofFun <| funext fun _ => DivInvMonoid.zpow_neg' .. - div_eq_mul_inv := Quotient.ind₂' fun _ _ ↦ congrArg ofFun <| div_eq_mul_inv .. + div_eq_mul_inv := Quotient.ind₂ fun _ _ ↦ congrArg ofFun <| div_eq_mul_inv .. @[to_additive] instance instDivisionMonoid [DivisionMonoid G] : DivisionMonoid (Germ l G) where @@ -502,7 +502,7 @@ instance instDivisionMonoid [DivisionMonoid G] : DivisionMonoid (Germ l G) where @[to_additive] instance instGroup [Group G] : Group (Germ l G) := - { inv_mul_cancel := Quotient.ind' fun _ => congrArg ofFun <| inv_mul_cancel _ } + { inv_mul_cancel := Quotient.ind fun _ => congrArg ofFun <| inv_mul_cancel _ } @[to_additive] instance instCommGroup [CommGroup G] : CommGroup (Germ l G) := @@ -525,8 +525,8 @@ instance instNontrivial [Nontrivial R] [NeBot l] : Nontrivial (Germ l R) := ⟨⟨↑x, ↑y, mt const_inj.1 h⟩⟩ instance instMulZeroClass [MulZeroClass R] : MulZeroClass (Germ l R) := - { zero_mul := Quotient.ind' fun _ => congrArg ofFun <| zero_mul _ - mul_zero := Quotient.ind' fun _ => congrArg ofFun <| mul_zero _ } + { zero_mul := Quotient.ind fun _ => congrArg ofFun <| zero_mul _ + mul_zero := Quotient.ind fun _ => congrArg ofFun <| mul_zero _ } instance instMulZeroOneClass [MulZeroOneClass R] : MulZeroOneClass (Germ l R) where __ := instMulZeroClass @@ -537,8 +537,8 @@ instance instMonoidWithZero [MonoidWithZero R] : MonoidWithZero (Germ l R) where __ := instMulZeroClass instance instDistrib [Distrib R] : Distrib (Germ l R) where - left_distrib a b c := Quotient.inductionOn₃' a b c fun _ _ _ ↦ congrArg ofFun <| left_distrib .. - right_distrib a b c := Quotient.inductionOn₃' a b c fun _ _ _ ↦ congrArg ofFun <| right_distrib .. + left_distrib a b c := Quotient.inductionOn₃ a b c fun _ _ _ ↦ congrArg ofFun <| left_distrib .. + right_distrib a b c := Quotient.inductionOn₃ a b c fun _ _ _ ↦ congrArg ofFun <| right_distrib .. instance instNonUnitalNonAssocSemiring [NonUnitalNonAssocSemiring R] : NonUnitalNonAssocSemiring (Germ l R) where diff --git a/Mathlib/Order/Partition/Finpartition.lean b/Mathlib/Order/Partition/Finpartition.lean index ac05d45f31ebb..8274624591a09 100644 --- a/Mathlib/Order/Partition/Finpartition.lean +++ b/Mathlib/Order/Partition/Finpartition.lean @@ -569,12 +569,12 @@ def ofSetoid (s : Setoid α) [DecidableRel s.r] : Finpartition (univ : Finset α sup_parts := by ext a simp only [sup_image, Function.id_comp, mem_univ, mem_sup, mem_filter, true_and, iff_true] - use a; exact s.refl a + use a not_bot_mem := by rw [bot_eq_empty, mem_image, not_exists] intro a simp only [filter_eq_empty_iff, not_forall, mem_univ, forall_true_left, true_and, not_not] - use a; exact s.refl a + use a theorem mem_part_ofSetoid_iff_rel {s : Setoid α} [DecidableRel s.r] {b : α} : b ∈ (ofSetoid s).part a ↔ s.r a b := by diff --git a/Mathlib/Order/RelIso/Basic.lean b/Mathlib/Order/RelIso/Basic.lean index bfbc41e545f91..08065f9729897 100644 --- a/Mathlib/Order/RelIso/Basic.lean +++ b/Mathlib/Order/RelIso/Basic.lean @@ -350,30 +350,25 @@ instance Subtype.wellFoundedGT [LT α] [WellFoundedGT α] (p : α → Prop) : WellFoundedGT (Subtype p) := (Subtype.relEmbedding (· > ·) p).isWellFounded -/-- `Quotient.mk'` as a relation homomorphism between the relation and the lift of a relation. -/ +/-- `Quotient.mk` as a relation homomorphism between the relation and the lift of a relation. -/ @[simps] -def Quotient.mkRelHom [Setoid α] {r : α → α → Prop} - (H : ∀ (a₁ b₁ a₂ b₂ : α), a₁ ≈ a₂ → b₁ ≈ b₂ → r a₁ b₁ = r a₂ b₂) : r →r Quotient.lift₂ r H := - ⟨@Quotient.mk' α _, id⟩ +def Quotient.mkRelHom {s : Setoid α} {r : α → α → Prop} + (H : ∀ (a₁ b₁ a₂ b₂ : α), s a₁ a₂ → s b₁ b₂ → r a₁ b₁ = r a₂ b₂) : r →r Quotient.lift₂ r H := + ⟨Quotient.mk _, id⟩ /-- `Quotient.out` as a relation embedding between the lift of a relation and the relation. -/ @[simps!] -noncomputable def Quotient.outRelEmbedding [Setoid α] {r : α → α → Prop} - (H : ∀ (a₁ b₁ a₂ b₂ : α), a₁ ≈ a₂ → b₁ ≈ b₂ → r a₁ b₁ = r a₂ b₂) : Quotient.lift₂ r H ↪r r := +noncomputable def Quotient.outRelEmbedding {s : Setoid α} {r : α → α → Prop} + (H : ∀ (a₁ b₁ a₂ b₂ : α), s a₁ a₂ → s b₁ b₂ → r a₁ b₁ = r a₂ b₂) : Quotient.lift₂ r H ↪r r := ⟨Embedding.quotientOut α, by refine @fun x y => Quotient.inductionOn₂ x y fun a b => ?_ apply iff_iff_eq.2 (H _ _ _ _ _ _) <;> apply Quotient.mk_out⟩ -/-- `Quotient.out'` as a relation embedding between the lift of a relation and the relation. -/ -@[simps] -noncomputable def Quotient.out'RelEmbedding {_ : Setoid α} {r : α → α → Prop} - (H : ∀ (a₁ b₁ a₂ b₂ : α), a₁ ≈ a₂ → b₁ ≈ b₂ → r a₁ b₁ = r a₂ b₂) : - (fun a b => Quotient.liftOn₂' a b r H) ↪r r := - { Quotient.outRelEmbedding H with toFun := Quotient.out' } +@[deprecated (since := "2024-08-28")] alias Quotient.out'RelEmbedding := Quotient.outRelEmbedding @[simp] -theorem acc_lift₂_iff [Setoid α] {r : α → α → Prop} - {H : ∀ (a₁ b₁ a₂ b₂ : α), a₁ ≈ a₂ → b₁ ≈ b₂ → r a₁ b₁ = r a₂ b₂} {a} : +theorem acc_lift₂_iff {s : Setoid α} {r : α → α → Prop} + {H : ∀ (a₁ b₁ a₂ b₂ : α), s a₁ a₂ → s b₁ b₂ → r a₁ b₁ = r a₂ b₂} {a} : Acc (Quotient.lift₂ r H) ⟦a⟧ ↔ Acc r a := by constructor · exact RelHomClass.acc (Quotient.mkRelHom H) a @@ -383,15 +378,16 @@ theorem acc_lift₂_iff [Setoid α] {r : α → α → Prop} obtain ⟨a', rfl⟩ := q.exists_rep exact IH a' h -@[simp] -theorem acc_liftOn₂'_iff {s : Setoid α} {r : α → α → Prop} {H} {a} : - Acc (fun x y => Quotient.liftOn₂' x y r H) (Quotient.mk'' a : Quotient s) ↔ Acc r a := +theorem acc_liftOn₂_iff {s : Setoid α} {r : α → α → Prop} {H} {a} : + Acc (fun x y => Quotient.liftOn₂ x y r H) (Quotient.mk s a) ↔ Acc r a := acc_lift₂_iff (H := H) +@[deprecated (since := "2024-08-28")] alias acc_liftOn₂'_iff := acc_liftOn₂_iff + /-- A relation is well founded iff its lift to a quotient is. -/ @[simp] -theorem wellFounded_lift₂_iff [Setoid α] {r : α → α → Prop} - {H : ∀ (a₁ b₁ a₂ b₂ : α), a₁ ≈ a₂ → b₁ ≈ b₂ → r a₁ b₁ = r a₂ b₂} : +theorem wellFounded_lift₂_iff {s : Setoid α} {r : α → α → Prop} + {H : ∀ (a₁ b₁ a₂ b₂ : α), s a₁ a₂ → s b₁ b₂ → r a₁ b₁ = r a₂ b₂} : WellFounded (Quotient.lift₂ r H) ↔ WellFounded r := by constructor · exact RelHomClass.wellFounded (Quotient.mkRelHom H) @@ -401,9 +397,8 @@ theorem wellFounded_lift₂_iff [Setoid α] {r : α → α → Prop} alias ⟨WellFounded.of_quotient_lift₂, WellFounded.quotient_lift₂⟩ := wellFounded_lift₂_iff -@[simp] theorem wellFounded_liftOn₂'_iff {s : Setoid α} {r : α → α → Prop} {H} : - (WellFounded fun x y : Quotient s => Quotient.liftOn₂' x y r H) ↔ WellFounded r := + (WellFounded fun x y : Quotient s => Quotient.liftOn₂ x y r H) ↔ WellFounded r := wellFounded_lift₂_iff (H := H) alias ⟨WellFounded.of_quotient_liftOn₂', WellFounded.quotient_liftOn₂'⟩ := wellFounded_liftOn₂'_iff diff --git a/Mathlib/RepresentationTheory/GroupCohomology/Hilbert90.lean b/Mathlib/RepresentationTheory/GroupCohomology/Hilbert90.lean index b666cf6409176..4014fa0db30ef 100644 --- a/Mathlib/RepresentationTheory/GroupCohomology/Hilbert90.lean +++ b/Mathlib/RepresentationTheory/GroupCohomology/Hilbert90.lean @@ -102,7 +102,7 @@ variable (K L : Type) [Field K] [Field L] [Algebra K L] [FiniteDimensional K L] first group cohomology `H¹(Aut_K(L), Lˣ)` is trivial. -/ noncomputable instance H1ofAutOnUnitsUnique : Unique (H1 (Rep.ofAlgebraAutOnUnits K L)) where default := 0 - uniq := fun a => Quotient.inductionOn' a fun x => (Submodule.Quotient.mk_eq_zero _).2 <| by + uniq := fun a => Quotient.inductionOn a fun x => (Submodule.Quotient.mk_eq_zero _).2 <| by refine (oneCoboundariesOfIsMulOneCoboundary ?_).2 rcases isMulOneCoboundary_of_isMulOneCocycle_of_aut_to_units x.1 (isMulOneCocycle_of_oneCocycles x) with ⟨β, hβ⟩ diff --git a/Mathlib/RingTheory/AdicCompletion/Algebra.lean b/Mathlib/RingTheory/AdicCompletion/Algebra.lean index 4a2de3765231a..a9b61094c0425 100644 --- a/Mathlib/RingTheory/AdicCompletion/Algebra.lean +++ b/Mathlib/RingTheory/AdicCompletion/Algebra.lean @@ -45,12 +45,12 @@ theorem transitionMap_map_one {m n : ℕ} (hmn : m ≤ n) : transitionMap I R hm @[local simp] theorem transitionMap_map_mul {m n : ℕ} (hmn : m ≤ n) (x y : R ⧸ (I ^ n • ⊤ : Ideal R)) : transitionMap I R hmn (x * y) = transitionMap I R hmn x * transitionMap I R hmn y := - Quotient.inductionOn₂' x y (fun _ _ ↦ rfl) + Quotient.inductionOn₂ x y (fun _ _ ↦ rfl) @[local simp] theorem transitionMap_map_pow {m n a : ℕ} (hmn : m ≤ n) (x : R ⧸ (I ^ n • ⊤ : Ideal R)) : transitionMap I R hmn (x ^ a) = transitionMap I R hmn x ^ a := - Quotient.inductionOn' x (fun _ ↦ rfl) + Quotient.inductionOn x (fun _ ↦ rfl) /-- `AdicCompletion.transitionMap` as an algebra homomorphism. -/ def transitionMapₐ {m n : ℕ} (hmn : m ≤ n) : @@ -197,8 +197,8 @@ theorem smul_mk {m n : ℕ} (hmn : m ≤ n) (r : AdicCauchySequence I R) good definitional behaviour for the module instance on adic completions -/ instance : SMul (R ⧸ (I • ⊤ : Ideal R)) (M ⧸ (I • ⊤ : Submodule R M)) where smul r x := - Quotient.liftOn r (· • x) fun b₁ b₂ (h : Setoid.Rel _ b₁ b₂) ↦ by - refine Quotient.inductionOn' x (fun x ↦ ?_) + Quotient.liftOn r (· • x) fun b₁ b₂ h ↦ by + refine Quotient.inductionOn x (fun x ↦ ?_) have h : b₁ - b₂ ∈ (I : Submodule R R) := by rwa [show I = I • ⊤ by simp, ← Submodule.quotientRel_r_def] rw [← sub_eq_zero, ← sub_smul, Submodule.Quotient.mk''_eq_mk, @@ -214,7 +214,7 @@ theorem mk_smul_mk (r : R) (x : M) : theorem val_smul_eq_evalₐ_smul (n : ℕ) (r : AdicCompletion I R) (x : M ⧸ (I ^ n • ⊤ : Submodule R M)) : r.val n • x = evalₐ I n r • x := by apply induction_on I R r (fun r ↦ ?_) - exact Quotient.inductionOn' x (fun x ↦ rfl) + exact Quotient.inductionOn x (fun x ↦ rfl) instance : Module (R ⧸ (I • ⊤ : Ideal R)) (M ⧸ (I • ⊤ : Submodule R M)) := Function.Surjective.moduleLeft (Ideal.Quotient.mk (I • ⊤ : Ideal R)) @@ -222,8 +222,8 @@ instance : Module (R ⧸ (I • ⊤ : Ideal R)) (M ⧸ (I • ⊤ : Submodule R instance : IsScalarTower R (R ⧸ (I • ⊤ : Ideal R)) (M ⧸ (I • ⊤ : Submodule R M)) where smul_assoc r s x := by - refine Quotient.inductionOn' s (fun s ↦ ?_) - refine Quotient.inductionOn' x (fun x ↦ ?_) + refine Quotient.inductionOn s (fun s ↦ ?_) + refine Quotient.inductionOn x (fun x ↦ ?_) simp only [Submodule.Quotient.mk''_eq_mk] rw [← Submodule.Quotient.mk_smul, Ideal.Quotient.mk_eq_mk, mk_smul_mk, smul_assoc] rfl diff --git a/Mathlib/RingTheory/AdicCompletion/Basic.lean b/Mathlib/RingTheory/AdicCompletion/Basic.lean index b1a5ab9bf4f6c..1b1e66da27073 100644 --- a/Mathlib/RingTheory/AdicCompletion/Basic.lean +++ b/Mathlib/RingTheory/AdicCompletion/Basic.lean @@ -123,12 +123,12 @@ variable {I M} @[elab_as_elim] theorem induction_on {C : Hausdorffification I M → Prop} (x : Hausdorffification I M) (ih : ∀ x, C (of I M x)) : C x := - Quotient.inductionOn' x ih + Quotient.inductionOn x ih variable (I M) instance : IsHausdorff I (Hausdorffification I M) := - ⟨fun x => Quotient.inductionOn' x fun x hx => + ⟨fun x => Quotient.inductionOn x fun x hx => (Quotient.mk_eq_zero _).2 <| (mem_iInf _).2 fun n => by have := comap_map_mkQ (⨅ n : ℕ, I ^ n • ⊤ : Submodule R M) (I ^ n • ⊤) simp only [sup_of_le_right (iInf_le (fun n => (I ^ n • ⊤ : Submodule R M)) n)] at this @@ -260,7 +260,7 @@ theorem eval_comp_of (n : ℕ) : (eval I M n).comp (of I M) = mkQ _ := rfl theorem eval_surjective (n : ℕ) : Function.Surjective (eval I M n) := fun x ↦ - Quotient.inductionOn' x fun x ↦ ⟨of I M x, rfl⟩ + Quotient.inductionOn x fun x ↦ ⟨of I M x, rfl⟩ @[simp] theorem range_eval (n : ℕ) : LinearMap.range (eval I M n) = ⊤ := @@ -300,7 +300,7 @@ instance : IsHausdorff I (AdicCompletion I M) where haus' x h := ext fun n ↦ by refine smul_induction_on (SModEq.zero.1 <| h n) (fun r hr x _ ↦ ?_) (fun x y hx hy ↦ ?_) · simp only [val_smul, val_zero] - exact Quotient.inductionOn' (x.val n) + exact Quotient.inductionOn (x.val n) (fun a ↦ SModEq.zero.2 <| smul_mem_smul hr mem_top) · simp only [val_add, hx, val_zero, hy, add_zero] diff --git a/Mathlib/RingTheory/AdicCompletion/Functoriality.lean b/Mathlib/RingTheory/AdicCompletion/Functoriality.lean index 671d719a25adf..cefce7e63eb8d 100644 --- a/Mathlib/RingTheory/AdicCompletion/Functoriality.lean +++ b/Mathlib/RingTheory/AdicCompletion/Functoriality.lean @@ -55,8 +55,8 @@ def reduceModIdeal (f : M →ₗ[R] N) : toFun := f.reduceModIdealAux I map_add' := by simp map_smul' r x := by - refine Quotient.inductionOn' r (fun r ↦ ?_) - refine Quotient.inductionOn' x (fun x ↦ ?_) + refine Quotient.inductionOn r (fun r ↦ ?_) + refine Quotient.inductionOn x (fun x ↦ ?_) simp only [Submodule.Quotient.mk''_eq_mk, Ideal.Quotient.mk_eq_mk, Module.Quotient.mk_smul_mk, Submodule.Quotient.mk_smul, LinearMapClass.map_smul, reduceModIdealAux_apply, RingHomCompTriple.comp_apply] diff --git a/Mathlib/RingTheory/AdjoinRoot.lean b/Mathlib/RingTheory/AdjoinRoot.lean index 7532a1f66cbdf..a7afb4d6fdcad 100644 --- a/Mathlib/RingTheory/AdjoinRoot.lean +++ b/Mathlib/RingTheory/AdjoinRoot.lean @@ -92,7 +92,7 @@ def mk : R[X] →+* AdjoinRoot f := @[elab_as_elim] theorem induction_on {C : AdjoinRoot f → Prop} (x : AdjoinRoot f) (ih : ∀ p : R[X], C (mk f p)) : C x := - Quotient.inductionOn' x ih + Quotient.inductionOn x ih /-- Embedding of the original ring `R` into `AdjoinRoot f`. -/ def of : R →+* AdjoinRoot f := diff --git a/Mathlib/RingTheory/Congruence/Basic.lean b/Mathlib/RingTheory/Congruence/Basic.lean index 30337d5e5beaf..231dc03d13b83 100644 --- a/Mathlib/RingTheory/Congruence/Basic.lean +++ b/Mathlib/RingTheory/Congruence/Basic.lean @@ -75,7 +75,7 @@ instance : FunLike (RingCon R) R (R → Prop) := rcases x with ⟨⟨x, _⟩, _⟩ rcases y with ⟨⟨y, _⟩, _⟩ congr! - rw [Setoid.ext_iff,(show x.Rel = y.Rel from h)] + rw [Setoid.ext_iff, (show ⇑x = ⇑y from h)] simp} theorem rel_eq_coe : c.r = c := @@ -142,7 +142,7 @@ variable {c} /-- The morphism into the quotient by a congruence relation -/ @[coe] def toQuotient (r : R) : c.Quotient := - @Quotient.mk'' _ c.toSetoid r + ⟦r⟧ variable (c) @@ -165,7 +165,7 @@ theorem quot_mk_eq_coe (x : R) : Quot.mk c x = (x : c.Quotient) := element of the quotient by `c`. -/ @[simp] protected theorem eq {a b : R} : (a : c.Quotient) = (b : c.Quotient) ↔ c a b := - Quotient.eq'' + Quotient.eq end Basic @@ -325,55 +325,55 @@ The operations above on the quotient by `c : RingCon R` preserve the algebraic s section Algebraic instance [NonUnitalNonAssocSemiring R] (c : RingCon R) : NonUnitalNonAssocSemiring c.Quotient := - Function.Surjective.nonUnitalNonAssocSemiring _ Quotient.surjective_Quotient_mk'' rfl + Function.Surjective.nonUnitalNonAssocSemiring _ Quotient.surjective_mk rfl (fun _ _ => rfl) (fun _ _ => rfl) fun _ _ => rfl instance [NonAssocSemiring R] (c : RingCon R) : NonAssocSemiring c.Quotient := - Function.Surjective.nonAssocSemiring _ Quotient.surjective_Quotient_mk'' rfl rfl (fun _ _ => rfl) + Function.Surjective.nonAssocSemiring _ Quotient.surjective_mk rfl rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) fun _ => rfl instance [NonUnitalSemiring R] (c : RingCon R) : NonUnitalSemiring c.Quotient := - Function.Surjective.nonUnitalSemiring _ Quotient.surjective_Quotient_mk'' rfl (fun _ _ => rfl) + Function.Surjective.nonUnitalSemiring _ Quotient.surjective_mk rfl (fun _ _ => rfl) (fun _ _ => rfl) fun _ _ => rfl instance [Semiring R] (c : RingCon R) : Semiring c.Quotient := - Function.Surjective.semiring _ Quotient.surjective_Quotient_mk'' rfl rfl (fun _ _ => rfl) + Function.Surjective.semiring _ Quotient.surjective_mk rfl rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) fun _ => rfl instance [CommSemiring R] (c : RingCon R) : CommSemiring c.Quotient := - Function.Surjective.commSemiring _ Quotient.surjective_Quotient_mk'' rfl rfl (fun _ _ => rfl) + Function.Surjective.commSemiring _ Quotient.surjective_mk rfl rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) fun _ => rfl instance [NonUnitalNonAssocRing R] (c : RingCon R) : NonUnitalNonAssocRing c.Quotient := - Function.Surjective.nonUnitalNonAssocRing _ Quotient.surjective_Quotient_mk'' rfl (fun _ _ => rfl) + Function.Surjective.nonUnitalNonAssocRing _ Quotient.surjective_mk rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) fun _ _ => rfl instance [NonAssocRing R] (c : RingCon R) : NonAssocRing c.Quotient := - Function.Surjective.nonAssocRing _ Quotient.surjective_Quotient_mk'' rfl rfl (fun _ _ => rfl) + Function.Surjective.nonAssocRing _ Quotient.surjective_mk rfl rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) fun _ => rfl instance [NonUnitalRing R] (c : RingCon R) : NonUnitalRing c.Quotient := - Function.Surjective.nonUnitalRing _ Quotient.surjective_Quotient_mk'' rfl (fun _ _ => rfl) + Function.Surjective.nonUnitalRing _ Quotient.surjective_mk rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) fun _ _ => rfl instance [Ring R] (c : RingCon R) : Ring c.Quotient := - Function.Surjective.ring _ Quotient.surjective_Quotient_mk'' rfl rfl (fun _ _ => rfl) + Function.Surjective.ring _ Quotient.surjective_mk rfl rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) fun _ => rfl instance [CommRing R] (c : RingCon R) : CommRing c.Quotient := - Function.Surjective.commRing _ Quotient.surjective_Quotient_mk'' rfl rfl (fun _ _ => rfl) + Function.Surjective.commRing _ Quotient.surjective_mk rfl rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) fun _ => rfl instance isScalarTower_right [Add R] [MulOneClass R] [SMul α R] [IsScalarTower α R R] (c : RingCon R) : IsScalarTower α c.Quotient c.Quotient where - smul_assoc _ := Quotient.ind₂' fun _ _ => congr_arg Quotient.mk'' <| smul_mul_assoc _ _ _ + smul_assoc _ := Quotient.ind₂ fun _ _ => congr_arg (Quotient.mk _) <| smul_mul_assoc _ _ _ instance smulCommClass [Add R] [MulOneClass R] [SMul α R] [IsScalarTower α R R] [SMulCommClass α R R] (c : RingCon R) : SMulCommClass α c.Quotient c.Quotient where - smul_comm _ := Quotient.ind₂' fun _ _ => congr_arg Quotient.mk'' <| (mul_smul_comm _ _ _).symm + smul_comm _ := Quotient.ind₂ fun _ _ => congr_arg (Quotient.mk _) <| (mul_smul_comm _ _ _).symm instance smulCommClass' [Add R] [MulOneClass R] [SMul α R] [IsScalarTower α R R] [SMulCommClass R α R] (c : RingCon R) : SMulCommClass c.Quotient α c.Quotient := @@ -384,12 +384,12 @@ instance [Monoid α] [NonAssocSemiring R] [DistribMulAction α R] [IsScalarTower (c : RingCon R) : DistribMulAction α c.Quotient := { c.toCon.mulAction with smul_zero := fun _ => congr_arg toQuotient <| smul_zero _ - smul_add := fun _ => Quotient.ind₂' fun _ _ => congr_arg toQuotient <| smul_add _ _ _ } + smul_add := fun _ => Quotient.ind₂ fun _ _ => congr_arg toQuotient <| smul_add _ _ _ } instance [Monoid α] [Semiring R] [MulSemiringAction α R] [IsScalarTower α R R] (c : RingCon R) : MulSemiringAction α c.Quotient := { smul_one := fun _ => congr_arg toQuotient <| smul_one _ - smul_mul := fun _ => Quotient.ind₂' fun _ _ => congr_arg toQuotient <| + smul_mul := fun _ => Quotient.ind₂ fun _ _ => congr_arg toQuotient <| MulSemiringAction.smul_mul _ _ _ } end Algebraic @@ -437,7 +437,7 @@ instance : InfSet (RingCon R) where /-- The infimum of a set of congruence relations is the same as the infimum of the set's image under the map to the underlying equivalence relation. -/ theorem sInf_toSetoid (S : Set (RingCon R)) : (sInf S).toSetoid = sInf ((·.toSetoid) '' S) := - Setoid.ext' fun x y => + Setoid.ext fun x y => ⟨fun h r ⟨c, hS, hr⟩ => by rw [← hr]; exact h c hS, fun h c hS => h c.toSetoid ⟨c, hS, rfl⟩⟩ /-- The infimum of a set of congruence relations is the same as the infimum of the set's image diff --git a/Mathlib/RingTheory/Flat/Basic.lean b/Mathlib/RingTheory/Flat/Basic.lean index 7592d42a7c793..be814dc073bd5 100644 --- a/Mathlib/RingTheory/Flat/Basic.lean +++ b/Mathlib/RingTheory/Flat/Basic.lean @@ -288,7 +288,7 @@ lemma lTensor_exact [Small.{v} R] [flat : Flat R M] ⦃N N' N'' : Type v⦄ simpa [ι] using Subtype.val_injective) (h0 := map_zero _) - exact _root_.lTensor_exact _ (fun x => by simp [π]) Quotient.surjective_Quotient_mk'' + exact _root_.lTensor_exact _ (fun x => by simp [π]) Quotient.surjective_mk variable (M) in lemma rTensor_exact [Small.{v} R] [flat : Flat R M] ⦃N N' N'' : Type v⦄ @@ -308,7 +308,7 @@ lemma rTensor_exact [Small.{v} R] [flat : Flat R M] ⦃N N' N'' : Type v⦄ simpa [ι] using Subtype.val_injective) (h0 := map_zero _) - exact _root_.rTensor_exact _ (fun x => by simp [π]) Quotient.surjective_Quotient_mk'' + exact _root_.rTensor_exact _ (fun x => by simp [π]) Quotient.surjective_mk /-- M is flat if and only if `M ⊗ -` is a left exact functor. diff --git a/Mathlib/RingTheory/GradedAlgebra/HomogeneousLocalization.lean b/Mathlib/RingTheory/GradedAlgebra/HomogeneousLocalization.lean index c3721f85c4ec5..b976914981e8d 100644 --- a/Mathlib/RingTheory/GradedAlgebra/HomogeneousLocalization.lean +++ b/Mathlib/RingTheory/GradedAlgebra/HomogeneousLocalization.lean @@ -282,16 +282,16 @@ variable {𝒜} {x} /-- Construct an element of `HomogeneousLocalization 𝒜 x` from a homogeneous fraction. -/ abbrev mk (y : HomogeneousLocalization.NumDenSameDeg 𝒜 x) : HomogeneousLocalization 𝒜 x := - Quotient.mk'' y + ⟦y⟧ lemma mk_surjective : Function.Surjective (mk (𝒜 := 𝒜) (x := x)) := - Quotient.surjective_Quotient_mk'' + Quotient.surjective_mk /-- View an element of `HomogeneousLocalization 𝒜 x` as an element of `Aₓ` by forgetting that the numerator and denominator are of the same grading. -/ def val (y : HomogeneousLocalization 𝒜 x) : at x := - Quotient.liftOn' y (NumDenSameDeg.embedding 𝒜 x) fun _ _ => id + Quotient.liftOn y (NumDenSameDeg.embedding 𝒜 x) fun _ _ => id @[simp] theorem val_mk (i : NumDenSameDeg 𝒜 x) : @@ -302,7 +302,7 @@ variable (x) @[ext] theorem val_injective : Function.Injective (HomogeneousLocalization.val (𝒜 := 𝒜) (x := x)) := - fun a b => Quotient.recOnSubsingleton₂' a b fun _ _ h => Quotient.sound' h + fun a b => Quotient.recOnSubsingleton₂ a b fun _ _ h => Quotient.sound' h variable (𝒜) {x} in lemma subsingleton (hx : 0 ∈ x) : Subsingleton (HomogeneousLocalization 𝒜 x) := @@ -315,7 +315,7 @@ variable {α : Type*} [SMul α R] [SMul α A] [IsScalarTower α R A] variable [IsScalarTower α A A] instance : SMul α (HomogeneousLocalization 𝒜 x) where - smul m := Quotient.map' (m • ·) fun c1 c2 (h : Localization.mk _ _ = Localization.mk _ _) => by + smul m := Quotient.map (m • ·) fun c1 c2 (h : Localization.mk _ _ = Localization.mk _ _) => by change Localization.mk _ _ = Localization.mk _ _ simp only [num_smul, den_smul] convert congr_arg (fun z : at x => m • z) h <;> rw [Localization.smul_mk] @@ -324,7 +324,7 @@ instance : SMul α (HomogeneousLocalization 𝒜 x) where @[simp] theorem val_smul (n : α) : ∀ y : HomogeneousLocalization 𝒜 x, (n • y).val = n • y.val := - Quotient.ind' fun _ ↦ by rw [← mk_smul, val_mk, val_mk, Localization.smul_mk]; rfl + Quotient.ind fun _ ↦ by rw [← mk_smul, val_mk, val_mk, Localization.smul_mk]; rfl theorem val_nsmul (n : ℕ) (y : HomogeneousLocalization 𝒜 x) : (n • y).val = n • y.val := by rw [val_smul, OreLocalization.nsmul_eq_nsmul] @@ -335,7 +335,7 @@ theorem val_zsmul (n : ℤ) (y : HomogeneousLocalization 𝒜 x) : (n • y).val end SMul instance : Neg (HomogeneousLocalization 𝒜 x) where - neg := Quotient.map' Neg.neg fun c1 c2 (h : Localization.mk _ _ = Localization.mk _ _) => by + neg := Quotient.map Neg.neg fun c1 c2 (h : Localization.mk _ _ = Localization.mk _ _) => by change Localization.mk _ _ = Localization.mk _ _ simp only [num_neg, den_neg, ← Localization.neg_mk] exact congr_arg Neg.neg h @@ -344,13 +344,13 @@ instance : Neg (HomogeneousLocalization 𝒜 x) where @[simp] theorem val_neg {x} : ∀ y : HomogeneousLocalization 𝒜 x, (-y).val = -y.val := - Quotient.ind' fun y ↦ by rw [← mk_neg, val_mk, val_mk, Localization.neg_mk]; rfl + Quotient.ind fun y ↦ by rw [← mk_neg, val_mk, val_mk, Localization.neg_mk]; rfl variable [AddCommMonoid ι] [DecidableEq ι] [GradedAlgebra 𝒜] instance hasPow : Pow (HomogeneousLocalization 𝒜 x) ℕ where pow z n := - (Quotient.map' (· ^ n) fun c1 c2 (h : Localization.mk _ _ = Localization.mk _ _) => by + (Quotient.map (· ^ n) fun c1 c2 (h : Localization.mk _ _ = Localization.mk _ _) => by change Localization.mk _ _ = Localization.mk _ _ simp only [num_pow, den_pow] convert congr_arg (fun z : at x => z ^ n) h <;> erw [Localization.mk_pow] <;> rfl : @@ -361,7 +361,7 @@ instance hasPow : Pow (HomogeneousLocalization 𝒜 x) ℕ where instance : Add (HomogeneousLocalization 𝒜 x) where add := - Quotient.map₂' (· + ·) + Quotient.map₂ (· + ·) fun c1 c2 (h : Localization.mk _ _ = Localization.mk _ _) c3 c4 (h' : Localization.mk _ _ = Localization.mk _ _) => by change Localization.mk _ _ = Localization.mk _ _ @@ -374,7 +374,7 @@ instance : Sub (HomogeneousLocalization 𝒜 x) where sub z1 z2 := z1 + -z2 instance : Mul (HomogeneousLocalization 𝒜 x) where mul := - Quotient.map₂' (· * ·) + Quotient.map₂ (· * ·) fun c1 c2 (h : Localization.mk _ _ = Localization.mk _ _) c3 c4 (h' : Localization.mk _ _ = Localization.mk _ _) => by change Localization.mk _ _ = Localization.mk _ _ @@ -383,18 +383,18 @@ instance : Mul (HomogeneousLocalization 𝒜 x) where @[simp] lemma mk_mul (i j : NumDenSameDeg 𝒜 x) : mk (i * j) = mk i * mk j := rfl -instance : One (HomogeneousLocalization 𝒜 x) where one := Quotient.mk'' 1 +instance : One (HomogeneousLocalization 𝒜 x) where one := ⟦1⟧ @[simp] lemma mk_one : mk (1 : NumDenSameDeg 𝒜 x) = 1 := rfl -instance : Zero (HomogeneousLocalization 𝒜 x) where zero := Quotient.mk'' 0 +instance : Zero (HomogeneousLocalization 𝒜 x) where zero := ⟦0⟧ @[simp] lemma mk_zero : mk (0 : NumDenSameDeg 𝒜 x) = 0 := rfl -theorem zero_eq : (0 : HomogeneousLocalization 𝒜 x) = Quotient.mk'' 0 := +theorem zero_eq : (0 : HomogeneousLocalization 𝒜 x) = ⟦0⟧ := rfl -theorem one_eq : (1 : HomogeneousLocalization 𝒜 x) = Quotient.mk'' 1 := +theorem one_eq : (1 : HomogeneousLocalization 𝒜 x) = ⟦1⟧ := rfl variable {x} @@ -409,11 +409,11 @@ theorem val_one : (1 : HomogeneousLocalization 𝒜 x).val = 1 := @[simp] theorem val_add : ∀ y1 y2 : HomogeneousLocalization 𝒜 x, (y1 + y2).val = y1.val + y2.val := - Quotient.ind₂' fun y1 y2 ↦ by rw [← mk_add, val_mk, val_mk, val_mk, Localization.add_mk]; rfl + Quotient.ind₂ fun y1 y2 ↦ by rw [← mk_add, val_mk, val_mk, val_mk, Localization.add_mk]; rfl @[simp] theorem val_mul : ∀ y1 y2 : HomogeneousLocalization 𝒜 x, (y1 * y2).val = y1.val * y2.val := - Quotient.ind₂' fun y1 y2 ↦ by rw [← mk_mul, val_mk, val_mk, val_mk, Localization.mk_mul]; rfl + Quotient.ind₂ fun y1 y2 ↦ by rw [← mk_mul, val_mk, val_mk, val_mk, Localization.mk_mul]; rfl @[simp] theorem val_sub (y1 y2 : HomogeneousLocalization 𝒜 x) : (y1 - y2).val = y1.val - y2.val := by @@ -421,7 +421,7 @@ theorem val_sub (y1 y2 : HomogeneousLocalization 𝒜 x) : (y1 - y2).val = y1.va @[simp] theorem val_pow : ∀ (y : HomogeneousLocalization 𝒜 x) (n : ℕ), (y ^ n).val = y.val ^ n := - Quotient.ind' fun y n ↦ by rw [← mk_pow, val_mk, val_mk, Localization.mk_pow]; rfl + Quotient.ind fun y n ↦ by rw [← mk_pow, val_mk, val_mk, Localization.mk_pow]; rfl instance : NatCast (HomogeneousLocalization 𝒜 x) := ⟨Nat.unaryCast⟩ @@ -473,29 +473,29 @@ variable {𝒜} {x} /-- Numerator of an element in `HomogeneousLocalization x`. -/ def num (f : HomogeneousLocalization 𝒜 x) : A := - (Quotient.out' f).num + (Quotient.out f).num /-- Denominator of an element in `HomogeneousLocalization x`. -/ def den (f : HomogeneousLocalization 𝒜 x) : A := - (Quotient.out' f).den + (Quotient.out f).den /-- For an element in `HomogeneousLocalization x`, degree is the natural number `i` such that `𝒜 i` contains both numerator and denominator. -/ def deg (f : HomogeneousLocalization 𝒜 x) : ι := - (Quotient.out' f).deg + (Quotient.out f).deg theorem den_mem (f : HomogeneousLocalization 𝒜 x) : f.den ∈ x := - (Quotient.out' f).den_mem + (Quotient.out f).den_mem theorem num_mem_deg (f : HomogeneousLocalization 𝒜 x) : f.num ∈ 𝒜 f.deg := - (Quotient.out' f).num.2 + (Quotient.out f).num.2 theorem den_mem_deg (f : HomogeneousLocalization 𝒜 x) : f.den ∈ 𝒜 f.deg := - (Quotient.out' f).den.2 + (Quotient.out f).den.2 theorem eq_num_div_den (f : HomogeneousLocalization 𝒜 x) : f.val = Localization.mk f.num ⟨f.den, f.den_mem⟩ := - congr_arg HomogeneousLocalization.val (Quotient.out_eq' f).symm + congr_arg HomogeneousLocalization.val (Quotient.out_eq f).symm theorem den_smul_val (f : HomogeneousLocalization 𝒜 x) : f.den • f.val = algebraMap _ _ f.num := by @@ -526,7 +526,7 @@ theorem isUnit_iff_isUnit_val (f : HomogeneousLocalization.AtPrime 𝒜 𝔭) : have : f.num.1 ∉ 𝔭 := by exact fun h ↦ mul_mem c.2 (mul_mem f.den_mem s.2) (hc ▸ Ideal.mul_mem_left _ c.1 (Ideal.mul_mem_right b _ h)) - refine isUnit_of_mul_eq_one _ (Quotient.mk'' ⟨f.1, f.3, f.2, this⟩) ?_ + refine isUnit_of_mul_eq_one _ ⟦⟨f.1, f.3, f.2, this⟩⟧ ?_ rw [← mk_mul, ext_iff_val, val_mk] simp [mul_comm f.den.1] @@ -585,20 +585,20 @@ localizations `B⁰_Q`. def map (g : A →+* B) (comap_le : P ≤ Q.comap g) (hg : ∀ i, ∀ a ∈ 𝒜 i, g a ∈ ℬ i) : HomogeneousLocalization 𝒜 P →+* HomogeneousLocalization ℬ Q where - toFun := Quotient.map' + toFun := Quotient.map (fun x ↦ ⟨x.1, ⟨_, hg _ _ x.2.2⟩, ⟨_, hg _ _ x.3.2⟩, comap_le x.4⟩) fun x y (e : x.embedding = y.embedding) ↦ by apply_fun IsLocalization.map (Localization Q) g comap_le at e simp_rw [HomogeneousLocalization.NumDenSameDeg.embedding, Localization.mk_eq_mk', IsLocalization.map_mk', ← Localization.mk_eq_mk'] at e exact e - map_add' := Quotient.ind₂' fun x y ↦ by - simp only [← mk_add, Quotient.map'_mk'', num_add, map_add, map_mul, den_add]; rfl - map_mul' := Quotient.ind₂' fun x y ↦ by - simp only [← mk_mul, Quotient.map'_mk'', num_mul, map_mul, den_mul]; rfl - map_zero' := by simp only [← mk_zero (𝒜 := 𝒜), Quotient.map'_mk'', deg_zero, + map_add' := Quotient.ind₂ fun x y ↦ by + simp only [← mk_add, Quotient.map_mk, num_add, map_add, map_mul, den_add]; rfl + map_mul' := Quotient.ind₂ fun x y ↦ by + simp only [← mk_mul, Quotient.map_mk, num_mul, map_mul, den_mul]; rfl + map_zero' := by simp only [← mk_zero (𝒜 := 𝒜), Quotient.map_mk, deg_zero, num_zero, ZeroMemClass.coe_zero, map_zero, den_zero, map_one]; rfl - map_one' := by simp only [← mk_one (𝒜 := 𝒜), Quotient.map'_mk'', deg_zero, + map_one' := by simp only [← mk_one (𝒜 := 𝒜), Quotient.map_mk, deg_zero, num_one, ZeroMemClass.coe_zero, map_zero, den_one, map_one]; rfl /-- diff --git a/Mathlib/RingTheory/Ideal/Cotangent.lean b/Mathlib/RingTheory/Ideal/Cotangent.lean index 3156cab853769..d1f57216d7e91 100644 --- a/Mathlib/RingTheory/Ideal/Cotangent.lean +++ b/Mathlib/RingTheory/Ideal/Cotangent.lean @@ -80,7 +80,7 @@ theorem cotangent_subsingleton_iff : Subsingleton I.Cotangent ↔ IsIdempotentEl exact fun x hx => (I.toCotangent_eq_zero ⟨x, hx⟩).mp (Subsingleton.elim _ _) · exact fun e => ⟨fun x y => - Quotient.inductionOn₂' x y fun x y => + Quotient.inductionOn₂ x y fun x y => I.toCotangent_eq.mpr <| ((pow_two I).trans e).symm ▸ I.sub_mem x.prop y.prop⟩ /-- The inclusion map `I ⧸ I ^ 2` to `R ⧸ I ^ 2`. -/ diff --git a/Mathlib/RingTheory/Ideal/Norm.lean b/Mathlib/RingTheory/Ideal/Norm.lean index b30d0820ffb94..0e7bd7b7ed99e 100644 --- a/Mathlib/RingTheory/Ideal/Norm.lean +++ b/Mathlib/RingTheory/Ideal/Norm.lean @@ -168,7 +168,7 @@ theorem cardQuot_pow_of_prime [IsDedekindDomain S] (hP : P ≠ ⊥) {i : ℕ} : Ideal.exists_mul_add_mem_pow_succ hP a c a_mem a_not_mem hc choose k hk_mem hk_eq using fun c' (hc' : c' ∈ map (mkQ (P ^ i.succ)) (P ^ i)) => Submodule.mem_map.mp hc' - refine Equiv.ofBijective (fun c' => Quotient.mk'' (f (k c' c'.prop) (hk_mem c' c'.prop))) ⟨?_, ?_⟩ + refine Equiv.ofBijective (fun c' => ⟦f (k c' c'.prop) (hk_mem c' c'.prop)⟧) ⟨?_, ?_⟩ · rintro ⟨c₁', hc₁'⟩ ⟨c₂', hc₂'⟩ h rw [Subtype.mk_eq_mk, ← hk_eq _ hc₁', ← hk_eq _ hc₂', mkQ_apply, mkQ_apply, Submodule.Quotient.eq, ← hf _ (hk_mem _ hc₁'), ← hf _ (hk_mem _ hc₂')] @@ -176,7 +176,7 @@ theorem cardQuot_pow_of_prime [IsDedekindDomain S] (hP : P ≠ ⊥) {i : ℕ} : simpa only [Submodule.Quotient.mk''_eq_mk, Submodule.Quotient.mk''_eq_mk, Submodule.Quotient.eq] using h · intro d' - refine Quotient.inductionOn' d' fun d => ?_ + refine Quotient.inductionOn d' fun d => ?_ have hd' := (mem_map (f := mkQ (P ^ i.succ))).mpr ⟨a * d, Ideal.mul_mem_right d _ a_mem, rfl⟩ refine ⟨⟨_, hd'⟩, ?_⟩ simp only [Submodule.Quotient.mk''_eq_mk, Ideal.Quotient.mk_eq_mk, Ideal.Quotient.eq, diff --git a/Mathlib/RingTheory/Ideal/Quotient.lean b/Mathlib/RingTheory/Ideal/Quotient.lean index a8a6b587bf0f9..f45488da5224f 100644 --- a/Mathlib/RingTheory/Ideal/Quotient.lean +++ b/Mathlib/RingTheory/Ideal/Quotient.lean @@ -98,7 +98,7 @@ See note [partially-applied ext lemmas]. -/ @[ext 1100] theorem ringHom_ext [NonAssocSemiring S] ⦃f g : R ⧸ I →+* S⦄ (h : f.comp (mk I) = g.comp (mk I)) : f = g := - RingHom.ext fun x => Quotient.inductionOn' x <| (RingHom.congr_fun h : _) + RingHom.ext fun x => Quotient.inductionOn x <| (RingHom.congr_fun h : _) instance inhabited : Inhabited (R ⧸ I) := ⟨mk I 37⟩ @@ -139,7 +139,7 @@ instance : Unique (R ⧸ (⊤ : Ideal R)) := ⟨⟨0⟩, by rintro ⟨x⟩; exact Quotient.eq_zero_iff_mem.mpr Submodule.mem_top⟩ theorem mk_surjective : Function.Surjective (mk I) := fun y => - Quotient.inductionOn' y fun x => Exists.intro x rfl + Quotient.inductionOn y fun x => Exists.intro x rfl instance : RingHomSurjective (mk I) := ⟨mk_surjective⟩ @@ -155,7 +155,7 @@ theorem quotient_ring_saturate (I : Ideal R) (s : Set R) : ⟨a, ha, by rw [← Eq, sub_add_eq_sub_sub_swap, sub_self, zero_sub]; exact I.neg_mem hi⟩⟩ instance noZeroDivisors (I : Ideal R) [hI : I.IsPrime] : NoZeroDivisors (R ⧸ I) where - eq_zero_or_eq_zero_of_mul_eq_zero {a b} := Quotient.inductionOn₂' a b fun {_ _} hab => + eq_zero_or_eq_zero_of_mul_eq_zero {a b} := Quotient.inductionOn₂ a b fun {_ _} hab => (hI.mem_or_mem (eq_zero_iff_mem.1 hab)).elim (Or.inl ∘ eq_zero_iff_mem.2) (Or.inr ∘ eq_zero_iff_mem.2) @@ -231,7 +231,7 @@ lift it to the quotient by this ideal. -/ def lift (I : Ideal R) (f : R →+* S) (H : ∀ a : R, a ∈ I → f a = 0) : R ⧸ I →+* S := { QuotientAddGroup.lift I.toAddSubgroup f.toAddMonoidHom H with map_one' := f.map_one - map_mul' := fun a₁ a₂ => Quotient.inductionOn₂' a₁ a₂ f.map_mul } + map_mul' := fun a₁ a₂ => Quotient.inductionOn₂ a₁ a₂ f.map_mul } @[simp] theorem lift_mk (I : Ideal R) (f : R →+* S) (H : ∀ a : R, a ∈ I → f a = 0) : @@ -288,10 +288,10 @@ variable (ι : Type v) /-- `R^n/I^n` is a `R/I`-module. -/ instance modulePi : Module (R ⧸ I) ((ι → R) ⧸ I.pi ι) where smul c m := - Quotient.liftOn₂' c m (fun r m => Submodule.Quotient.mk <| r • m) <| by + Quotient.liftOn₂ c m (fun r m => Submodule.Quotient.mk <| r • m) <| by intro c₁ m₁ c₂ m₂ hc hm apply Ideal.Quotient.eq.2 - rw [Submodule.quotientRel_r_def] at hc hm + rw [Setoid.equiv_iff_apply, Submodule.quotientRel_r_def] at hc hm intro i exact I.mul_sub_mul_mem hc (hm i) one_smul := by @@ -322,19 +322,19 @@ instance modulePi : Module (R ⧸ I) ((ι → R) ⧸ I.pi ι) where /-- `R^n/I^n` is isomorphic to `(R/I)^n` as an `R/I`-module. -/ noncomputable def piQuotEquiv : ((ι → R) ⧸ I.pi ι) ≃ₗ[R ⧸ I] ι → (R ⧸ I) where toFun := fun x ↦ - Quotient.liftOn' x (fun f i => Ideal.Quotient.mk I (f i)) fun a b hab => + Quotient.liftOn x (fun f i => Ideal.Quotient.mk I (f i)) fun a b hab => funext fun i => (Submodule.Quotient.eq' _).2 (QuotientAddGroup.leftRel_apply.mp hab i) map_add' := by rintro ⟨_⟩ ⟨_⟩; rfl map_smul' := by rintro ⟨_⟩ ⟨_⟩; rfl - invFun := fun x ↦ Ideal.Quotient.mk (I.pi ι) fun i ↦ Quotient.out' (x i) + invFun := fun x ↦ Ideal.Quotient.mk (I.pi ι) fun i ↦ Quotient.out (x i) left_inv := by rintro ⟨x⟩ - exact Ideal.Quotient.eq.2 fun i => Ideal.Quotient.eq.1 (Quotient.out_eq' _) + exact Ideal.Quotient.eq.2 fun i => Ideal.Quotient.eq.1 (Quotient.out_eq _) right_inv := by intro x ext i obtain ⟨_, _⟩ := @Quot.exists_rep _ _ (x i) - convert Quotient.out_eq' (x i) + convert Quotient.out_eq (x i) /-- If `f : R^n → R^m` is an `R`-linear map and `I ⊆ R` is an ideal, then the image of `I^n` is contained in `I^m`. -/ diff --git a/Mathlib/RingTheory/Ideal/QuotientOperations.lean b/Mathlib/RingTheory/Ideal/QuotientOperations.lean index 7abf1424f8ab5..505b9d51cc3a0 100644 --- a/Mathlib/RingTheory/Ideal/QuotientOperations.lean +++ b/Mathlib/RingTheory/Ideal/QuotientOperations.lean @@ -327,7 +327,7 @@ variable [Algebra R₁ A] [Algebra R₂ A] instance Quotient.algebra {I : Ideal A} : Algebra R₁ (A ⧸ I) := { toRingHom := (Ideal.Quotient.mk I).comp (algebraMap R₁ A) smul_def' := fun _ x => - Quotient.inductionOn' x fun _ => + Quotient.inductionOn x fun _ => ((Quotient.mk I).congr_arg <| Algebra.smul_def _ _).trans (RingHom.map_mul _ _ _) commutes' := fun _ _ => mul_comm _ _ } @@ -344,7 +344,7 @@ def Quotient.mkₐ (I : Ideal A) : A →ₐ[R₁] A ⧸ I := theorem Quotient.algHom_ext {I : Ideal A} {S} [Semiring S] [Algebra R₁ S] ⦃f g : A ⧸ I →ₐ[R₁] S⦄ (h : f.comp (Quotient.mkₐ R₁ I) = g.comp (Quotient.mkₐ R₁ I)) : f = g := - AlgHom.ext fun x => Quotient.inductionOn' x <| AlgHom.congr_fun h + AlgHom.ext fun x => Quotient.inductionOn x <| AlgHom.congr_fun h theorem Quotient.alg_map_eq (I : Ideal A) : algebraMap R₁ (A ⧸ I) = (algebraMap A (A ⧸ I)).comp (algebraMap R₁ A) := @@ -374,7 +374,7 @@ theorem Quotient.mk_algebraMap (I : Ideal A) (x : R₁) : /-- The canonical morphism `A →ₐ[R₁] I.quotient` is surjective. -/ theorem Quotient.mkₐ_surjective (I : Ideal A) : Function.Surjective (Quotient.mkₐ R₁ I) := - surjective_quot_mk _ + Quot.surjective_mk /-- The kernel of `A →ₐ[R₁] I.quotient` is `I`. -/ @[simp] diff --git a/Mathlib/RingTheory/OreLocalization/Basic.lean b/Mathlib/RingTheory/OreLocalization/Basic.lean index 04732f2a57a29..be858411b717a 100644 --- a/Mathlib/RingTheory/OreLocalization/Basic.lean +++ b/Mathlib/RingTheory/OreLocalization/Basic.lean @@ -109,7 +109,7 @@ protected theorem ind {β : X[S⁻¹] → Prop} @[to_additive] theorem oreDiv_eq_iff {r₁ r₂ : X} {s₁ s₂ : S} : r₁ /ₒ s₁ = r₂ /ₒ s₂ ↔ ∃ (u : S) (v : R), u • r₂ = v • r₁ ∧ u * s₂ = v * s₁ := - Quotient.eq'' + Quotient.eq /-- A fraction `r /ₒ s` is equal to its expansion by an arbitrary factor `t` if `t * s ∈ S`. -/ @[to_additive "A difference `r -ₒ s` is equal to its expansion by an diff --git a/Mathlib/RingTheory/Perfection.lean b/Mathlib/RingTheory/Perfection.lean index 341d08d64c115..68de8d2ab7574 100644 --- a/Mathlib/RingTheory/Perfection.lean +++ b/Mathlib/RingTheory/Perfection.lean @@ -351,14 +351,14 @@ attribute [local instance] Classical.dec /-- For a field `K` with valuation `v : K → ℝ≥0` and ring of integers `O`, a function `O/(p) → ℝ≥0` that sends `0` to `0` and `x + (p)` to `v(x)` as long as `x ∉ (p)`. -/ noncomputable def preVal (x : ModP K v O hv p) : ℝ≥0 := - if x = 0 then 0 else v (algebraMap O K x.out') + if x = 0 then 0 else v (algebraMap O K x.out) variable {K v O hv p} theorem preVal_mk {x : O} (hx : (Ideal.Quotient.mk _ x : ModP K v O hv p) ≠ 0) : preVal K v O hv p (Ideal.Quotient.mk _ x) = v (algebraMap O K x) := by - obtain ⟨r, hr⟩ : ∃ (a : O), a * (p : O) = (Quotient.mk'' x).out' - x := - Ideal.mem_span_singleton'.1 <| Ideal.Quotient.eq.1 <| Quotient.sound' <| Quotient.mk_out' _ + obtain ⟨r, hr⟩ : ∃ (a : O), a * (p : O) = ⟦x⟧.out - x := + Ideal.mem_span_singleton'.1 <| Ideal.Quotient.eq.1 <| Quotient.sound' <| Quotient.mk_out _ refine (if_neg hx).trans (v.map_eq_of_sub_lt <| lt_of_not_le ?_) erw [← RingHom.map_sub, ← hr, hv.le_iff_dvd] exact fun hprx => diff --git a/Mathlib/RingTheory/Valuation/Quotient.lean b/Mathlib/RingTheory/Valuation/Quotient.lean index c246dfce6f64c..ada6539c35d3c 100644 --- a/Mathlib/RingTheory/Valuation/Quotient.lean +++ b/Mathlib/RingTheory/Valuation/Quotient.lean @@ -24,7 +24,7 @@ variable (v : Valuation R Γ₀) /-- If `hJ : J ⊆ supp v` then `onQuotVal hJ` is the induced function on `R / J` as a function. Note: it's just the function; the valuation is `onQuot hJ`. -/ def onQuotVal {J : Ideal R} (hJ : J ≤ supp v) : R ⧸ J → Γ₀ := fun q => - Quotient.liftOn' q v fun a b h => + Quotient.liftOn q v fun a b h => calc v a = v (b + -(-a + b)) := by simp _ = v b := @@ -35,8 +35,8 @@ def onQuot {J : Ideal R} (hJ : J ≤ supp v) : Valuation (R ⧸ J) Γ₀ where toFun := v.onQuotVal hJ map_zero' := v.map_zero map_one' := v.map_one - map_mul' xbar ybar := Quotient.ind₂' v.map_mul xbar ybar - map_add_le_max' xbar ybar := Quotient.ind₂' v.map_add xbar ybar + map_mul' xbar ybar := Quotient.ind₂ v.map_mul xbar ybar + map_add_le_max' xbar ybar := Quotient.ind₂ v.map_add xbar ybar @[simp] theorem onQuot_comap_eq {J : Ideal R} (hJ : J ≤ supp v) : diff --git a/Mathlib/RingTheory/Valuation/ValuationRing.lean b/Mathlib/RingTheory/Valuation/ValuationRing.lean index ed5c3bf093421..e36c2169d53e5 100644 --- a/Mathlib/RingTheory/Valuation/ValuationRing.lean +++ b/Mathlib/RingTheory/Valuation/ValuationRing.lean @@ -55,11 +55,11 @@ variable (K : Type v) [Field K] [Algebra A K] /-- The value group of the valuation ring `A`. Note: this is actually a group with zero. -/ def ValueGroup : Type v := Quotient (MulAction.orbitRel Aˣ K) -instance : Inhabited (ValueGroup A K) := ⟨Quotient.mk'' 0⟩ +instance : Inhabited (ValueGroup A K) := ⟨⟦0⟧⟩ instance : LE (ValueGroup A K) := LE.mk fun x y => - Quotient.liftOn₂' x y (fun a b => ∃ c : A, c • b = a) + Quotient.liftOn₂ x y (fun a b => ∃ c : A, c • b = a) (by rintro _ _ a b ⟨c, rfl⟩ ⟨d, rfl⟩; ext constructor @@ -71,13 +71,13 @@ instance : LE (ValueGroup A K) := simp_rw [Units.smul_def, ← he, mul_smul] rw [← mul_smul _ _ b, Units.inv_mul, one_smul]) -instance : Zero (ValueGroup A K) := ⟨Quotient.mk'' 0⟩ +instance : Zero (ValueGroup A K) := ⟨⟦0⟧⟩ -instance : One (ValueGroup A K) := ⟨Quotient.mk'' 1⟩ +instance : One (ValueGroup A K) := ⟨⟦1⟧⟩ instance : Mul (ValueGroup A K) := Mul.mk fun x y => - Quotient.liftOn₂' x y (fun a b => Quotient.mk'' <| a * b) + Quotient.liftOn₂ x y (fun a b => ⟦a * b⟧) (by rintro _ _ a b ⟨c, rfl⟩ ⟨d, rfl⟩ apply Quotient.sound' @@ -88,7 +88,7 @@ instance : Mul (ValueGroup A K) := instance : Inv (ValueGroup A K) := Inv.mk fun x => - Quotient.liftOn' x (fun a => Quotient.mk'' a⁻¹) + Quotient.liftOn x (fun a => ⟦a⁻¹⟧) (by rintro _ a ⟨b, rfl⟩ apply Quotient.sound' @@ -141,22 +141,22 @@ noncomputable instance linearOrder : LinearOrder (ValueGroup A K) where noncomputable instance linearOrderedCommGroupWithZero : LinearOrderedCommGroupWithZero (ValueGroup A K) := { linearOrder .. with - mul_assoc := by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩; apply Quotient.sound'; rw [mul_assoc]; apply Setoid.refl' - one_mul := by rintro ⟨a⟩; apply Quotient.sound'; rw [one_mul]; apply Setoid.refl' - mul_one := by rintro ⟨a⟩; apply Quotient.sound'; rw [mul_one]; apply Setoid.refl' - mul_comm := by rintro ⟨a⟩ ⟨b⟩; apply Quotient.sound'; rw [mul_comm]; apply Setoid.refl' + mul_assoc := by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩; apply Quotient.sound'; rw [mul_assoc] + one_mul := by rintro ⟨a⟩; apply Quotient.sound'; rw [one_mul] + mul_one := by rintro ⟨a⟩; apply Quotient.sound'; rw [mul_one] + mul_comm := by rintro ⟨a⟩ ⟨b⟩; apply Quotient.sound'; rw [mul_comm] mul_le_mul_left := by rintro ⟨a⟩ ⟨b⟩ ⟨c, rfl⟩ ⟨d⟩ use c; simp only [Algebra.smul_def]; ring - zero_mul := by rintro ⟨a⟩; apply Quotient.sound'; rw [zero_mul]; apply Setoid.refl' - mul_zero := by rintro ⟨a⟩; apply Quotient.sound'; rw [mul_zero]; apply Setoid.refl' + zero_mul := by rintro ⟨a⟩; apply Quotient.sound'; rw [zero_mul] + mul_zero := by rintro ⟨a⟩; apply Quotient.sound'; rw [mul_zero] zero_le_one := ⟨0, by rw [zero_smul]⟩ exists_pair_ne := by use 0, 1 intro c; obtain ⟨d, hd⟩ := Quotient.exact' c apply_fun fun t => d⁻¹ • t at hd simp only [inv_smul_smul, smul_zero, one_ne_zero] at hd - inv_zero := by apply Quotient.sound'; rw [inv_zero]; apply Setoid.refl' + inv_zero := by apply Quotient.sound'; rw [inv_zero] mul_inv_cancel := by rintro ⟨a⟩ ha apply Quotient.sound' @@ -170,7 +170,7 @@ noncomputable instance linearOrderedCommGroupWithZero : /-- Any valuation ring induces a valuation on its fraction field. -/ def valuation : Valuation K (ValueGroup A K) where - toFun := Quotient.mk'' + toFun := Quotient.mk _ map_zero' := rfl map_one' := rfl map_mul' _ _ := rfl diff --git a/Mathlib/RingTheory/Valuation/ValuationSubring.lean b/Mathlib/RingTheory/Valuation/ValuationSubring.lean index fb8a0c376dfbb..a5a2bd4dd1d16 100644 --- a/Mathlib/RingTheory/Valuation/ValuationSubring.lean +++ b/Mathlib/RingTheory/Valuation/ValuationSubring.lean @@ -167,12 +167,12 @@ theorem valuation_le_one_iff (x : K) : A.valuation x ≤ 1 ↔ x ∈ A := ⟨mem_of_valuation_le_one _ _, fun ha => A.valuation_le_one ⟨x, ha⟩⟩ theorem valuation_eq_iff (x y : K) : A.valuation x = A.valuation y ↔ ∃ a : Aˣ, (a : K) * y = x := - Quotient.eq'' + Quotient.eq theorem valuation_le_iff (x y : K) : A.valuation x ≤ A.valuation y ↔ ∃ a : A, (a : K) * y = x := Iff.rfl -theorem valuation_surjective : Function.Surjective A.valuation := surjective_quot_mk _ +theorem valuation_surjective : Function.Surjective A.valuation := Quot.surjective_mk theorem valuation_unit (a : Aˣ) : A.valuation a = 1 := by rw [← A.valuation.map_one, valuation_eq_iff]; use a; simp @@ -227,7 +227,7 @@ def subtype (R : ValuationSubring K) : R →+* K := /-- The canonical map on value groups induced by a coarsening of valuation rings. -/ def mapOfLE (R S : ValuationSubring K) (h : R ≤ S) : R.ValueGroup →*₀ S.ValueGroup where - toFun := Quotient.map' id fun x y ⟨u, hu⟩ => ⟨Units.map (R.inclusion S h).toMonoidHom u, hu⟩ + toFun := Quotient.map id fun x y ⟨u, hu⟩ => ⟨Units.map (R.inclusion S h).toMonoidHom u, hu⟩ map_zero' := rfl map_one' := rfl map_mul' := by rintro ⟨⟩ ⟨⟩; rfl diff --git a/Mathlib/SetTheory/ZFC/Basic.lean b/Mathlib/SetTheory/ZFC/Basic.lean index 8e729f2ef711b..3591724890803 100644 --- a/Mathlib/SetTheory/ZFC/Basic.lean +++ b/Mathlib/SetTheory/ZFC/Basic.lean @@ -591,7 +591,7 @@ open PSet /-- Turns a pre-set into a ZFC set. -/ def mk : PSet → ZFSet := - Quotient.mk'' + Quotient.mk _ @[simp] theorem mk_eq (x : PSet) : @Eq ZFSet ⟦x⟧ (mk x) := diff --git a/Mathlib/Topology/Algebra/Group/Basic.lean b/Mathlib/Topology/Algebra/Group/Basic.lean index 4a1d0f84e6918..045953bff0309 100644 --- a/Mathlib/Topology/Algebra/Group/Basic.lean +++ b/Mathlib/Topology/Algebra/Group/Basic.lean @@ -844,11 +844,11 @@ instance topologicalGroup_quotient [N.Normal] : TopologicalGroup (G ⧸ N) where apply IsOpenMap.to_quotientMap · exact (QuotientGroup.isOpenMap_coe N).prod (QuotientGroup.isOpenMap_coe N) · exact continuous_quot_mk.prod_map continuous_quot_mk - · exact (surjective_quot_mk _).prodMap (surjective_quot_mk _) + · exact Quot.surjective_mk.prodMap Quot.surjective_mk exact quot.continuous_iff.2 cont continuous_inv := by have quot := IsOpenMap.to_quotientMap - (QuotientGroup.isOpenMap_coe N) continuous_quot_mk (surjective_quot_mk _) + (QuotientGroup.isOpenMap_coe N) continuous_quot_mk Quot.surjective_mk rw [quot.continuous_iff] exact continuous_quot_mk.comp continuous_inv diff --git a/Mathlib/Topology/Algebra/Group/TopologicalAbelianization.lean b/Mathlib/Topology/Algebra/Group/TopologicalAbelianization.lean index 5a27525a78e01..1dc668c54b40f 100644 --- a/Mathlib/Topology/Algebra/Group/TopologicalAbelianization.lean +++ b/Mathlib/Topology/Algebra/Group/TopologicalAbelianization.lean @@ -40,7 +40,7 @@ namespace TopologicalAbelianization instance commGroup : CommGroup (G_ab G) where mul_comm := fun x y => - Quotient.inductionOn₂' x y fun a b => + Quotient.inductionOn₂ x y fun a b => Quotient.sound' <| QuotientGroup.leftRel_apply.mpr <| by have h : (a * b)⁻¹ * (b * a) = ⁅b⁻¹, a⁻¹⁆ := by group diff --git a/Mathlib/Topology/Algebra/InfiniteSum/Module.lean b/Mathlib/Topology/Algebra/InfiniteSum/Module.lean index e8ef8f1cd13dc..31fee27f2b9d9 100644 --- a/Mathlib/Topology/Algebra/InfiniteSum/Module.lean +++ b/Mathlib/Topology/Algebra/InfiniteSum/Module.lean @@ -198,7 +198,7 @@ lemma MulAction.automorphize_smul_left [Group α] [MulAction α β] (f : β → MulAction.automorphize ((g ∘ (@Quotient.mk' _ (_))) • f) = g • (MulAction.automorphize f : Quotient (MulAction.orbitRel α β) → M) := by ext x - apply @Quotient.inductionOn' β (MulAction.orbitRel α β) _ x _ + apply @Quotient.inductionOn β (MulAction.orbitRel α β) _ x _ intro b simp only [automorphize, Pi.smul_apply', comp_apply] set π : β → Quotient (MulAction.orbitRel α β) := Quotient.mk (MulAction.orbitRel α β) @@ -217,7 +217,7 @@ lemma AddAction.automorphize_smul_left [AddGroup α] [AddAction α β] (f : β AddAction.automorphize ((g ∘ (@Quotient.mk' _ (_))) • f) = g • (AddAction.automorphize f : Quotient (AddAction.orbitRel α β) → M) := by ext x - apply @Quotient.inductionOn' β (AddAction.orbitRel α β) _ x _ + apply @Quotient.inductionOn β (AddAction.orbitRel α β) _ x _ intro b simp only [automorphize, Pi.smul_apply', comp_apply] set π : β → Quotient (AddAction.orbitRel α β) := Quotient.mk (AddAction.orbitRel α β) diff --git a/Mathlib/Topology/Algebra/Module/Basic.lean b/Mathlib/Topology/Algebra/Module/Basic.lean index fd43144f79855..b9f65718ee27b 100644 --- a/Mathlib/Topology/Algebra/Module/Basic.lean +++ b/Mathlib/Topology/Algebra/Module/Basic.lean @@ -2377,7 +2377,7 @@ instance continuousSMul_quotient [TopologicalSpace R] [TopologicalAddGroup M] [C have quot : QuotientMap fun au : R × M => (au.1, S.mkQ au.2) := IsOpenMap.to_quotientMap (IsOpenMap.id.prod S.isOpenMap_mkQ) (continuous_id.prod_map continuous_quot_mk) - (Function.surjective_id.prodMap <| surjective_quot_mk _) + (Function.surjective_id.prodMap <| Quot.surjective_mk) rw [quot.continuous_iff] exact continuous_quot_mk.comp continuous_smul diff --git a/Mathlib/Topology/Algebra/ProperAction.lean b/Mathlib/Topology/Algebra/ProperAction.lean index 2c645d7ab198d..efa77fd7aedb2 100644 --- a/Mathlib/Topology/Algebra/ProperAction.lean +++ b/Mathlib/Topology/Algebra/ProperAction.lean @@ -128,17 +128,17 @@ theorem t2Space_quotient_mulAction_of_properSMul [ProperSMul G X] : T2Space (Quotient (MulAction.orbitRel G X)) := by rw [t2_iff_isClosed_diagonal] set R := MulAction.orbitRel G X - let π : X → Quotient R := Quotient.mk' + let π : X → Quotient R := Quotient.mk _ have : QuotientMap (Prod.map π π) := (isOpenMap_quotient_mk'_mul.prod isOpenMap_quotient_mk'_mul).to_quotientMap (continuous_quotient_mk'.prod_map continuous_quotient_mk') - ((surjective_quotient_mk' _).prodMap (surjective_quotient_mk' _)) + (Quotient.surjective_mk'.prodMap Quotient.surjective_mk') rw [← this.isClosed_preimage] convert ProperSMul.isProperMap_smul_pair.isClosedMap.isClosed_range · ext ⟨x₁, x₂⟩ simp only [mem_preimage, map_apply, mem_diagonal_iff, mem_range, Prod.mk.injEq, Prod.exists, exists_eq_right] - rw [Quotient.eq_rel, MulAction.orbitRel_apply, MulAction.mem_orbit_iff] + rw [Quotient.eq, MulAction.orbitRel_apply, MulAction.mem_orbit_iff] all_goals infer_instance /-- If a T2 group acts properly on a topological space, then this topological space is T2. -/ diff --git a/Mathlib/Topology/Algebra/SeparationQuotient.lean b/Mathlib/Topology/Algebra/SeparationQuotient.lean index 140e089dc9563..bf6af142d2c3e 100644 --- a/Mathlib/Topology/Algebra/SeparationQuotient.lean +++ b/Mathlib/Topology/Algebra/SeparationQuotient.lean @@ -28,7 +28,7 @@ variable {M X : Type*} [TopologicalSpace X] [SMul M X] [ContinuousConstSMul M X] @[to_additive] instance instSMul : SMul M (SeparationQuotient X) where - smul c := Quotient.map' (c • ·) fun _ _ h ↦ h.const_smul c + smul c := Quotient.map (c • ·) fun _ _ h ↦ h.const_smul c @[to_additive (attr := simp)] theorem mk_smul (c : M) (x : X) : mk (c • x) = c • mk x := rfl @@ -78,7 +78,7 @@ variable {M : Type*} [TopologicalSpace M] @[to_additive] instance instMul [Mul M] [ContinuousMul M] : Mul (SeparationQuotient M) where - mul := Quotient.map₂' (· * ·) fun _ _ h₁ _ _ h₂ ↦ Inseparable.mul h₁ h₂ + mul := Quotient.map₂ (· * ·) fun _ _ h₁ _ _ h₂ ↦ Inseparable.mul h₁ h₂ @[to_additive (attr := simp)] theorem mk_mul [Mul M] [ContinuousMul M] (a b : M) : mk (a * b) = mk a * mk b := rfl @@ -119,7 +119,7 @@ instance (priority := 900) instNSmul [AddMonoid M] [ContinuousAdd M] : @[to_additive existing instNSmul] instance instPow [Monoid M] [ContinuousMul M] : Pow (SeparationQuotient M) ℕ where - pow x n := Quotient.map' (s₁ := inseparableSetoid M) (· ^ n) (fun _ _ h ↦ Inseparable.pow h n) x + pow x n := Quotient.map (· ^ n) (fun _ _ h ↦ Inseparable.pow h n) x @[to_additive, simp] -- `mk_nsmul` is not a `simp` lemma because we have `mk_smul` theorem mk_pow [Monoid M] [ContinuousMul M] (x : M) (n : ℕ) : mk (x ^ n) = (mk x) ^ n := rfl @@ -140,7 +140,7 @@ variable {G : Type*} [TopologicalSpace G] @[to_additive] instance instInv [Inv G] [ContinuousInv G] : Inv (SeparationQuotient G) where - inv := Quotient.map' (·⁻¹) fun _ _ ↦ Inseparable.inv + inv := Quotient.map (·⁻¹) fun _ _ ↦ Inseparable.inv @[to_additive (attr := simp)] theorem mk_inv [Inv G] [ContinuousInv G] (x : G) : mk x⁻¹ = (mk x)⁻¹ := rfl @@ -161,7 +161,7 @@ instance instInvOneClass [InvOneClass G] [ContinuousInv G] : @[to_additive] instance instDiv [Div G] [ContinuousDiv G] : Div (SeparationQuotient G) where - div := Quotient.map₂' (· / ·) fun _ _ h₁ _ _ h₂ ↦ (Inseparable.prod h₁ h₂).map continuous_div' + div := Quotient.map₂ (· / ·) fun _ _ h₁ _ _ h₂ ↦ (Inseparable.prod h₁ h₂).map continuous_div' @[to_additive (attr := simp)] theorem mk_div [Div G] [ContinuousDiv G] (x y : G) : mk (x / y) = mk x / mk y := rfl @@ -175,7 +175,7 @@ instance instZSMul [AddGroup G] [TopologicalAddGroup G] : SMul ℤ (SeparationQu @[to_additive existing] instance instZPow [Group G] [TopologicalGroup G] : Pow (SeparationQuotient G) ℤ where - pow x n := Quotient.map' (s₁ := inseparableSetoid G) (· ^ n) (fun _ _ h ↦ Inseparable.zpow h n) x + pow x n := Quotient.map (· ^ n) (fun _ _ h ↦ Inseparable.zpow h n) x @[to_additive, simp] -- `mk_zsmul` is not a `simp` lemma because we have `mk_smul` theorem mk_zpow [Group G] [TopologicalGroup G] (x : G) (n : ℤ) : mk (x ^ n) = (mk x) ^ n := rfl diff --git a/Mathlib/Topology/Category/Profinite/Basic.lean b/Mathlib/Topology/Category/Profinite/Basic.lean index 8def32734be5c..349840ef9a21a 100644 --- a/Mathlib/Topology/Category/Profinite/Basic.lean +++ b/Mathlib/Topology/Category/Profinite/Basic.lean @@ -106,7 +106,7 @@ spaces in compact Hausdorff spaces. -/ def Profinite.toCompHausEquivalence (X : CompHaus.{u}) (Y : Profinite.{u}) : (CompHaus.toProfiniteObj X ⟶ Y) ≃ (X ⟶ profiniteToCompHaus.obj Y) where - toFun f := f.comp ⟨Quotient.mk'', continuous_quotient_mk'⟩ + toFun f := f.comp ⟨Quotient.mk _, continuous_quotient_mk'⟩ invFun g := { toFun := Continuous.connectedComponentsLift g.2 continuous_toFun := Continuous.connectedComponentsLift_continuous g.2 } diff --git a/Mathlib/Topology/Connected/Basic.lean b/Mathlib/Topology/Connected/Basic.lean index 8d8d2a542f23d..4421d70488118 100644 --- a/Mathlib/Topology/Connected/Basic.lean +++ b/Mathlib/Topology/Connected/Basic.lean @@ -642,7 +642,7 @@ theorem Function.Surjective.connectedSpace [ConnectedSpace α] [TopologicalSpace instance Quotient.instConnectedSpace {s : Setoid α} [ConnectedSpace α] : ConnectedSpace (Quotient s) := - (surjective_quotient_mk' _).connectedSpace continuous_coinduced_rng + Quotient.surjective_mk'.connectedSpace continuous_coinduced_rng theorem DenseRange.preconnectedSpace [TopologicalSpace β] [PreconnectedSpace α] {f : α → β} (hf : DenseRange f) (hc : Continuous f) : PreconnectedSpace β := diff --git a/Mathlib/Topology/Connected/Clopen.lean b/Mathlib/Topology/Connected/Clopen.lean index cfba16bc1231f..680991bd4c000 100644 --- a/Mathlib/Topology/Connected/Clopen.lean +++ b/Mathlib/Topology/Connected/Clopen.lean @@ -480,14 +480,14 @@ def ConnectedComponents (α : Type u) [TopologicalSpace α] := namespace ConnectedComponents /-- Coercion from a topological space to the set of connected components of this space. -/ -def mk : α → ConnectedComponents α := Quotient.mk'' +def mk : α → ConnectedComponents α := Quotient.mk _ instance : CoeTC α (ConnectedComponents α) := ⟨mk⟩ @[simp] theorem coe_eq_coe {x y : α} : (x : ConnectedComponents α) = y ↔ connectedComponent x = connectedComponent y := - Quotient.eq'' + Quotient.eq theorem coe_ne_coe {x y : α} : (x : ConnectedComponents α) ≠ y ↔ connectedComponent x ≠ connectedComponent y := @@ -503,7 +503,7 @@ instance : TopologicalSpace (ConnectedComponents α) := inferInstanceAs (TopologicalSpace (Quotient _)) theorem surjective_coe : Surjective (mk : α → ConnectedComponents α) := - surjective_quot_mk _ + Quot.surjective_mk theorem quotientMap_coe : QuotientMap (mk : α → ConnectedComponents α) := quotientMap_quot_mk diff --git a/Mathlib/Topology/Connected/PathConnected.lean b/Mathlib/Topology/Connected/PathConnected.lean index 8e9c395f62521..fc262e709d19f 100644 --- a/Mathlib/Topology/Connected/PathConnected.lean +++ b/Mathlib/Topology/Connected/PathConnected.lean @@ -1067,7 +1067,7 @@ theorem Function.Surjective.pathConnectedSpace [PathConnectedSpace X] instance Quotient.instPathConnectedSpace {s : Setoid X} [PathConnectedSpace X] : PathConnectedSpace (Quotient s) := - (surjective_quotient_mk' X).pathConnectedSpace continuous_coinduced_rng + Quotient.surjective_mk.pathConnectedSpace continuous_coinduced_rng /-- This is a special case of `NormedSpace.instPathConnectedSpace` (and `TopologicalAddGroup.pathConnectedSpace`). It exists only to simplify dependencies. -/ diff --git a/Mathlib/Topology/Connected/TotallyDisconnected.lean b/Mathlib/Topology/Connected/TotallyDisconnected.lean index 0da1004c037f4..486c8ce39af36 100644 --- a/Mathlib/Topology/Connected/TotallyDisconnected.lean +++ b/Mathlib/Topology/Connected/TotallyDisconnected.lean @@ -235,7 +235,7 @@ theorem Continuous.image_eq_of_connectedComponent_eq (h : Continuous f) (a b : The lift to `connectedComponents α` of a continuous map from `α` to a totally disconnected space -/ def Continuous.connectedComponentsLift (h : Continuous f) : ConnectedComponents α → β := fun x => - Quotient.liftOn' x f h.image_eq_of_connectedComponent_eq + Quotient.liftOn x f h.image_eq_of_connectedComponent_eq @[continuity] theorem Continuous.connectedComponentsLift_continuous (h : Continuous f) : diff --git a/Mathlib/Topology/Constructions.lean b/Mathlib/Topology/Constructions.lean index 8e3db8e45a710..ec13d9d8d9b9f 100644 --- a/Mathlib/Topology/Constructions.lean +++ b/Mathlib/Topology/Constructions.lean @@ -164,12 +164,12 @@ theorem Quotient.preimage_mem_nhds [TopologicalSpace X] [s : Setoid X] {V : Set /-- The image of a dense set under `Quotient.mk'` is a dense set. -/ theorem Dense.quotient [Setoid X] [TopologicalSpace X] {s : Set X} (H : Dense s) : Dense (Quotient.mk' '' s) := - Quotient.surjective_Quotient_mk''.denseRange.dense_image continuous_coinduced_rng H + Quotient.surjective_mk.denseRange.dense_image continuous_coinduced_rng H /-- The composition of `Quotient.mk'` and a function with dense range has dense range. -/ theorem DenseRange.quotient [Setoid X] [TopologicalSpace X] {f : Y → X} (hf : DenseRange f) : DenseRange (Quotient.mk' ∘ f) := - Quotient.surjective_Quotient_mk''.denseRange.comp hf continuous_coinduced_rng + Quotient.surjective_mk.denseRange.comp hf continuous_coinduced_rng theorem continuous_map_of_le {α : Type*} [TopologicalSpace α] {s t : Setoid α} (h : s ≤ t) : Continuous (Setoid.map_of_le h) := @@ -1127,12 +1127,12 @@ theorem Continuous.quotient_lift {f : X → Y} (h : Continuous f) (hs : ∀ a b, theorem Continuous.quotient_liftOn' {f : X → Y} (h : Continuous f) (hs : ∀ a b, @Setoid.r _ s a b → f a = f b) : - Continuous (fun x => Quotient.liftOn' x f hs : Quotient s → Y) := + Continuous (fun x => Quotient.liftOn x f hs : Quotient s → Y) := h.quotient_lift hs @[continuity, fun_prop] theorem Continuous.quotient_map' {t : Setoid Y} {f : X → Y} (hf : Continuous f) - (H : (s.r ⇒ t.r) f f) : Continuous (Quotient.map' f H) := + (H : (s.r ⇒ t.r) f f) : Continuous (Quotient.map f H) := (continuous_quotient_mk'.comp hf).quotient_lift _ end Quotient diff --git a/Mathlib/Topology/ContinuousFunction/Basic.lean b/Mathlib/Topology/ContinuousFunction/Basic.lean index e77f01dabfc8e..1fd2b5cbb6681 100644 --- a/Mathlib/Topology/ContinuousFunction/Basic.lean +++ b/Mathlib/Topology/ContinuousFunction/Basic.lean @@ -489,7 +489,7 @@ variable (hf : QuotientMap f) (g : C(X, Z)) (h : Function.FactorsThrough g f) /-- Descend a continuous map, which is constant on the fibres, along a quotient map. -/ @[simps] noncomputable def lift : C(Y, Z) where - toFun := ((fun i ↦ Quotient.liftOn' i g (fun _ _ (hab : f _ = f _) ↦ h hab)) : + toFun := ((fun i ↦ Quotient.liftOn i g (fun _ _ (hab : f _ = f _) ↦ h hab)) : Quotient (Setoid.ker f) → Z) ∘ hf.homeomorph.symm continuous_toFun := Continuous.comp (continuous_quot_lift _ g.2) (Homeomorph.continuous _) diff --git a/Mathlib/Topology/DiscreteQuotient.lean b/Mathlib/Topology/DiscreteQuotient.lean index a6413350f7c54..70092c053033b 100644 --- a/Mathlib/Topology/DiscreteQuotient.lean +++ b/Mathlib/Topology/DiscreteQuotient.lean @@ -69,7 +69,7 @@ variable {α X Y Z : Type*} [TopologicalSpace X] [TopologicalSpace Y] [Topologic @[ext] -- Porting note: in Lean 4, uses projection to `r` instead of `Setoid`. structure DiscreteQuotient (X : Type*) [TopologicalSpace X] extends Setoid X where /-- For every point `x`, the set `{ y | Rel x y }` is an open set. -/ - protected isOpen_setOf_rel : ∀ x, IsOpen (setOf (toSetoid.Rel x)) + protected isOpen_setOf_rel : ∀ x, IsOpen (setOf (toSetoid x)) namespace DiscreteQuotient @@ -81,13 +81,13 @@ lemma toSetoid_injective : Function.Injective (@toSetoid X _) /-- Construct a discrete quotient from a clopen set. -/ def ofIsClopen {A : Set X} (h : IsClopen A) : DiscreteQuotient X where toSetoid := ⟨fun x y => x ∈ A ↔ y ∈ A, fun _ => Iff.rfl, Iff.symm, Iff.trans⟩ - isOpen_setOf_rel x := by by_cases hx : x ∈ A <;> simp [Setoid.Rel, hx, h.1, h.2, ← compl_setOf] + isOpen_setOf_rel x := by by_cases hx : x ∈ A <;> simp [hx, h.1, h.2, ← compl_setOf] -theorem refl : ∀ x, S.Rel x x := S.refl' +theorem refl : ∀ x, S.toSetoid x x := S.refl' -theorem symm (x y : X) : S.Rel x y → S.Rel y x := S.symm' +theorem symm (x y : X) : S.toSetoid x y → S.toSetoid y x := S.symm' -theorem trans (x y z : X) : S.Rel x y → S.Rel y z → S.Rel x z := S.trans' +theorem trans (x y z : X) : S.toSetoid x y → S.toSetoid y z → S.toSetoid x z := S.trans' /-- The setoid whose quotient yields the discrete quotient. -/ add_decl_doc toSetoid @@ -99,13 +99,13 @@ instance : TopologicalSpace S := inferInstanceAs (TopologicalSpace (Quotient S.toSetoid)) /-- The projection from `X` to the given discrete quotient. -/ -def proj : X → S := Quotient.mk'' +def proj : X → S := Quotient.mk _ -theorem fiber_eq (x : X) : S.proj ⁻¹' {S.proj x} = setOf (S.Rel x) := - Set.ext fun _ => eq_comm.trans Quotient.eq'' +theorem fiber_eq (x : X) : S.proj ⁻¹' {S.proj x} = setOf (S.toSetoid x) := + Set.ext fun _ => eq_comm.trans Quotient.eq theorem proj_surjective : Function.Surjective S.proj := - Quotient.surjective_Quotient_mk'' + Quotient.surjective_mk theorem proj_quotientMap : QuotientMap S.proj := quotientMap_quot_mk @@ -130,7 +130,7 @@ theorem isOpen_preimage (A : Set S) : IsOpen (S.proj ⁻¹' A) := theorem isClosed_preimage (A : Set S) : IsClosed (S.proj ⁻¹' A) := (S.isClopen_preimage A).1 -theorem isClopen_setOf_rel (x : X) : IsClopen (setOf (S.Rel x)) := by +theorem isClopen_setOf_rel (x : X) : IsClopen (setOf (S.toSetoid x)) := by rw [← fiber_eq] apply isClopen_preimage @@ -182,7 +182,7 @@ variable {A B C : DiscreteQuotient X} /-- The map induced by a refinement of a discrete quotient. -/ def ofLE (h : A ≤ B) : A → B := - Quotient.map' (fun x => x) h + Quotient.map (fun x => x) h @[simp] theorem ofLE_refl : ofLE (le_refl A) = id := by @@ -230,7 +230,7 @@ instance [LocallyConnectedSpace X] : OrderBot (DiscreteQuotient X) where @[simp] theorem proj_bot_eq [LocallyConnectedSpace X] {x y : X} : proj ⊥ x = proj ⊥ y ↔ connectedComponent x = connectedComponent y := - Quotient.eq'' + Quotient.eq theorem proj_bot_inj [DiscreteTopology X] {x y : X} : proj ⊥ x = proj ⊥ y ↔ x = y := by simp @@ -264,7 +264,7 @@ theorem LEComap.mono (h : LEComap f A B) (hA : A' ≤ A) (hB : B ≤ B') : LECom hA.trans <| h.trans <| comap_mono _ hB /-- Map a discrete quotient along a continuous map. -/ -def map (f : C(X, Y)) (cond : LEComap f A B) : A → B := Quotient.map' f cond +def map (f : C(X, Y)) (cond : LEComap f A B) : A → B := Quotient.map f cond theorem map_continuous (cond : LEComap f A B) : Continuous (map f cond) := continuous_of_discreteTopology @@ -359,7 +359,7 @@ lemma comp_finsetClopens [CompactSpace X] : (Set.image (fun (t : Clopens X) ↦ t.carrier) ∘ Finset.toSet) ∘ finsetClopens X = fun ⟨f, _⟩ ↦ f.classes := by ext d - simp only [Setoid.classes, Setoid.Rel, Set.mem_setOf_eq, Function.comp_apply, + simp only [Setoid.classes, Set.mem_setOf_eq, Function.comp_apply, finsetClopens, Set.coe_toFinset, Set.mem_image, Set.mem_range, exists_exists_eq_and] constructor @@ -403,7 +403,7 @@ def discreteQuotient : DiscreteQuotient X where /-- The (locally constant) function from the discrete quotient associated to a locally constant function. -/ def lift : LocallyConstant f.discreteQuotient α := - ⟨fun a => Quotient.liftOn' a f fun _ _ => id, fun _ => isOpen_discrete _⟩ + ⟨fun a => Quotient.liftOn a f fun _ _ => id, fun _ => isOpen_discrete _⟩ @[simp] theorem lift_comp_proj : f.lift ∘ f.discreteQuotient.proj = f := rfl diff --git a/Mathlib/Topology/Germ.lean b/Mathlib/Topology/Germ.lean index 5b1e7856f5d62..203f2a36caeb6 100644 --- a/Mathlib/Topology/Germ.lean +++ b/Mathlib/Topology/Germ.lean @@ -44,7 +44,7 @@ namespace Filter.Germ /-- The value associated to a germ at a point. This is the common value shared by all representatives at the given point. -/ def value {X α : Type*} [TopologicalSpace X] {x : X} (φ : Germ (𝓝 x) α) : α := - Quotient.liftOn' φ (fun f ↦ f x) fun f g h ↦ by dsimp only; rw [Eventually.self_of_nhds h] + Quotient.liftOn φ (fun f ↦ f x) fun f g h ↦ by dsimp only; rw [Eventually.self_of_nhds h] theorem value_smul {α β : Type*} [SMul α β] (φ : Germ (𝓝 x) α) (ψ : Germ (𝓝 x) β) : (φ • ψ).value = φ.value • ψ.value := diff --git a/Mathlib/Topology/Inseparable.lean b/Mathlib/Topology/Inseparable.lean index f4f888556c776..a2252ba6c038c 100644 --- a/Mathlib/Topology/Inseparable.lean +++ b/Mathlib/Topology/Inseparable.lean @@ -512,7 +512,7 @@ variable {t : Set (SeparationQuotient X)} namespace SeparationQuotient /-- The natural map from a topological space to its separation quotient. -/ -def mk : X → SeparationQuotient X := Quotient.mk'' +def mk : X → SeparationQuotient X := Quotient.mk _ theorem quotientMap_mk : QuotientMap (mk : X → SeparationQuotient X) := quotientMap_quot_mk @@ -523,10 +523,10 @@ theorem continuous_mk : Continuous (mk : X → SeparationQuotient X) := @[simp] theorem mk_eq_mk : mk x = mk y ↔ (x ~ᵢ y) := - Quotient.eq'' + Quotient.eq theorem surjective_mk : Surjective (mk : X → SeparationQuotient X) := - surjective_quot_mk _ + Quot.surjective_mk @[simp] theorem range_mk : range (mk : X → SeparationQuotient X) = univ := @@ -616,7 +616,7 @@ theorem quotientMap_prodMap_mk : QuotientMap (Prod.map mk mk : X × Y → _) := /-- Lift a map `f : X → α` such that `Inseparable x y → f x = f y` to a map `SeparationQuotient X → α`. -/ def lift (f : X → α) (hf : ∀ x y, (x ~ᵢ y) → f x = f y) : SeparationQuotient X → α := fun x => - Quotient.liftOn' x f hf + Quotient.liftOn x f hf @[simp] theorem lift_mk {f : X → α} (hf : ∀ x y, (x ~ᵢ y) → f x = f y) (x : X) : lift f hf (mk x) = f x := @@ -661,7 +661,7 @@ theorem continuous_lift {hf : ∀ x y, (x ~ᵢ y) → f x = f y} : /-- Lift a map `f : X → Y → α` such that `Inseparable a b → Inseparable c d → f a c = f b d` to a map `SeparationQuotient X → SeparationQuotient Y → α`. -/ def lift₂ (f : X → Y → α) (hf : ∀ a b c d, (a ~ᵢ c) → (b ~ᵢ d) → f a b = f c d) : - SeparationQuotient X → SeparationQuotient Y → α := fun x y => Quotient.liftOn₂' x y f hf + SeparationQuotient X → SeparationQuotient Y → α := fun x y => Quotient.liftOn₂ x y f hf @[simp] theorem lift₂_mk {f : X → Y → α} (hf : ∀ a b c d, (a ~ᵢ c) → (b ~ᵢ d) → f a b = f c d) (x : X) diff --git a/Mathlib/Topology/Instances/AddCircle.lean b/Mathlib/Topology/Instances/AddCircle.lean index 988b0aced090f..506fd4ff9a157 100644 --- a/Mathlib/Topology/Instances/AddCircle.lean +++ b/Mathlib/Topology/Instances/AddCircle.lean @@ -573,12 +573,12 @@ def equivIccQuot : 𝕋 ≃ Quot (EndpointIdent p a) where ((equivIco p a).right_inv ⟨a, le_refl a, lt_add_of_pos_right a hp.out⟩) theorem equivIccQuot_comp_mk_eq_toIcoMod : - equivIccQuot p a ∘ Quotient.mk'' = fun x => + equivIccQuot p a ∘ Quotient.mk _ = fun x => Quot.mk _ ⟨toIcoMod hp.out a x, Ico_subset_Icc_self <| toIcoMod_mem_Ico _ _ x⟩ := rfl theorem equivIccQuot_comp_mk_eq_toIocMod : - equivIccQuot p a ∘ Quotient.mk'' = fun x => + equivIccQuot p a ∘ Quotient.mk _ = fun x => Quot.mk _ ⟨toIocMod hp.out a x, Ioc_subset_Icc_self <| toIocMod_mem_Ioc _ _ x⟩ := by rw [equivIccQuot_comp_mk_eq_toIcoMod] funext x diff --git a/Mathlib/Topology/MetricSpace/Contracting.lean b/Mathlib/Topology/MetricSpace/Contracting.lean index 2fcec8e182a86..ac3f24a9253fa 100644 --- a/Mathlib/Topology/MetricSpace/Contracting.lean +++ b/Mathlib/Topology/MetricSpace/Contracting.lean @@ -137,7 +137,7 @@ theorem efixedPoint_eq_of_edist_lt_top (hf : ContractingWith K f) {x : α} (hx : efixedPoint f hf x hx = efixedPoint f hf y hy := by refine (hf.eq_or_edist_eq_top_of_fixedPoints ?_ ?_).elim id fun h' ↦ False.elim (ne_of_lt ?_ h') <;> try apply efixedPoint_isFixedPt - change edistLtTopSetoid.Rel _ _ + change edistLtTopSetoid _ _ trans x · apply Setoid.symm' -- Porting note: Originally `symm` exact hf.edist_efixedPoint_lt_top hx @@ -221,7 +221,7 @@ theorem efixedPoint_eq_of_edist_lt_top' (hf : ContractingWith K f) {s : Set α} efixedPoint' f hsc hsf hfs x hxs hx = efixedPoint' f htc htf hft y hyt hy := by refine (hf.eq_or_edist_eq_top_of_fixedPoints ?_ ?_).elim id fun h' ↦ False.elim (ne_of_lt ?_ h') <;> try apply efixedPoint_isFixedPt' - change edistLtTopSetoid.Rel _ _ + change edistLtTopSetoid _ _ trans x · apply Setoid.symm' -- Porting note: Originally `symm` apply edist_efixedPoint_lt_top' diff --git a/Mathlib/Topology/MetricSpace/Gluing.lean b/Mathlib/Topology/MetricSpace/Gluing.lean index 53a7579e013fa..f13a8b86f131a 100644 --- a/Mathlib/Topology/MetricSpace/Gluing.lean +++ b/Mathlib/Topology/MetricSpace/Gluing.lean @@ -467,11 +467,11 @@ instance (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : MetricSpace (GlueSpace hΦ h /-- The canonical map from `X` to the space obtained by gluing isometric subsets in `X` and `Y`. -/ def toGlueL (hΦ : Isometry Φ) (hΨ : Isometry Ψ) (x : X) : GlueSpace hΦ hΨ := - Quotient.mk'' (.inl x) + ⟦.inl x⟧ /-- The canonical map from `Y` to the space obtained by gluing isometric subsets in `X` and `Y`. -/ def toGlueR (hΦ : Isometry Φ) (hΨ : Isometry Ψ) (y : Y) : GlueSpace hΦ hΨ := - Quotient.mk'' (.inr y) + ⟦.inr y⟧ instance inhabitedLeft (hΦ : Isometry Φ) (hΨ : Isometry Ψ) [Inhabited X] : Inhabited (GlueSpace hΦ hΨ) := @@ -586,7 +586,7 @@ instance {I : ∀ (n : ℕ), Isometry (f n)} : MetricSpace (InductiveLimit (f := /-- Mapping each `X n` to the inductive limit. -/ def toInductiveLimit (I : ∀ n, Isometry (f n)) (n : ℕ) (x : X n) : Metric.InductiveLimit I := - Quotient.mk'' (Sigma.mk n x) + ⟦Sigma.mk n x⟧ instance (I : ∀ n, Isometry (f n)) [Inhabited (X 0)] : Inhabited (InductiveLimit I) := ⟨toInductiveLimit _ 0 default⟩ diff --git a/Mathlib/Topology/MetricSpace/GromovHausdorffRealized.lean b/Mathlib/Topology/MetricSpace/GromovHausdorffRealized.lean index f343b3d1c3901..83c6b49be447f 100644 --- a/Mathlib/Topology/MetricSpace/GromovHausdorffRealized.lean +++ b/Mathlib/Topology/MetricSpace/GromovHausdorffRealized.lean @@ -455,7 +455,7 @@ instance : MetricSpace (OptimalGHCoupling X Y) := by /-- Injection of `X` in the optimal coupling between `X` and `Y` -/ def optimalGHInjl (x : X) : OptimalGHCoupling X Y := - Quotient.mk'' (inl x) + ⟦inl x⟧ /-- The injection of `X` in the optimal coupling between `X` and `Y` is an isometry. -/ theorem isometry_optimalGHInjl : Isometry (optimalGHInjl X Y) := @@ -463,7 +463,7 @@ theorem isometry_optimalGHInjl : Isometry (optimalGHInjl X Y) := /-- Injection of `Y` in the optimal coupling between `X` and `Y` -/ def optimalGHInjr (y : Y) : OptimalGHCoupling X Y := - Quotient.mk'' (inr y) + ⟦inr y⟧ /-- The injection of `Y` in the optimal coupling between `X` and `Y` is an isometry. -/ theorem isometry_optimalGHInjr : Isometry (optimalGHInjr X Y) := diff --git a/Mathlib/Topology/Separation.lean b/Mathlib/Topology/Separation.lean index b86c559b092ef..b21d0e677d62d 100644 --- a/Mathlib/Topology/Separation.lean +++ b/Mathlib/Topology/Separation.lean @@ -332,7 +332,7 @@ def specializationOrder (X) [TopologicalSpace X] [T0Space X] : PartialOrder X := { specializationPreorder X, PartialOrder.lift (OrderDual.toDual ∘ 𝓝) nhds_injective with } instance SeparationQuotient.instT0Space : T0Space (SeparationQuotient X) := - ⟨fun x y => Quotient.inductionOn₂' x y fun _ _ h => + ⟨fun x y => Quotient.inductionOn₂ x y fun _ _ h => SeparationQuotient.mk_eq_mk.2 <| SeparationQuotient.inducing_mk.inseparable_iff.1 h⟩ theorem minimal_nonempty_closed_subsingleton [T0Space X] {s : Set X} (hs : IsClosed s) @@ -1620,12 +1620,12 @@ instance : TopologicalSpace (t2Quotient X) := /-- The map from a topological space to its largest T2 quotient. -/ def mk : X → t2Quotient X := Quotient.mk (t2Setoid X) -lemma mk_eq {x y : X} : mk x = mk y ↔ ∀ s : Setoid X, T2Space (Quotient s) → s.Rel x y := +lemma mk_eq {x y : X} : mk x = mk y ↔ ∀ s : Setoid X, T2Space (Quotient s) → s x y := Setoid.quotient_mk_sInf_eq variable (X) -lemma surjective_mk : Surjective (mk : X → t2Quotient X) := surjective_quotient_mk _ +lemma surjective_mk : Surjective (mk : X → t2Quotient X) := Quotient.surjective_mk lemma continuous_mk : Continuous (mk : X → t2Quotient X) := continuous_quotient_mk' diff --git a/Mathlib/Topology/StoneCech.lean b/Mathlib/Topology/StoneCech.lean index ba2b4232abec5..8e753c6d82656 100644 --- a/Mathlib/Topology/StoneCech.lean +++ b/Mathlib/Topology/StoneCech.lean @@ -252,7 +252,7 @@ theorem continuous_preStoneCechUnit : Continuous (preStoneCechUnit : α → PreS exact Quot.sound ⟨x, pure_le_nhds x, gx⟩ theorem denseRange_preStoneCechUnit : DenseRange (preStoneCechUnit : α → PreStoneCech α) := - (surjective_quot_mk _).denseRange.comp denseRange_pure continuous_coinduced_rng + Quot.surjective_mk.denseRange.comp denseRange_pure continuous_coinduced_rng section Extension @@ -337,7 +337,7 @@ theorem continuous_stoneCechUnit : Continuous (stoneCechUnit : α → StoneCech theorem denseRange_stoneCechUnit : DenseRange (stoneCechUnit : α → StoneCech α) := by unfold stoneCechUnit t2Quotient.mk have : Function.Surjective (t2Quotient.mk : PreStoneCech α → StoneCech α) := by - exact surjective_quot_mk _ + exact Quot.surjective_mk exact this.denseRange.comp denseRange_preStoneCechUnit continuous_coinduced_rng section Extension diff --git a/Mathlib/Topology/UniformSpace/Separation.lean b/Mathlib/Topology/UniformSpace/Separation.lean index 9d11da63e1ac6..d7aecc54834b0 100644 --- a/Mathlib/Topology/UniformSpace/Separation.lean +++ b/Mathlib/Topology/UniformSpace/Separation.lean @@ -253,7 +253,7 @@ open Classical in TODO: unify with `SeparationQuotient.lift`. -/ def lift' [T0Space β] (f : α → β) : SeparationQuotient α → β := if hc : UniformContinuous f then lift f fun _ _ h => (h.map hc.continuous).eq - else fun x => f (Nonempty.some ⟨x.out'⟩) + else fun x => f (Nonempty.some ⟨x.out⟩) theorem lift'_mk [T0Space β] {f : α → β} (h : UniformContinuous f) (a : α) : lift' f (mk a) = f a := by rw [lift', dif_pos h, lift_mk] diff --git a/test/interactiveUnfold.lean b/test/interactiveUnfold.lean index 0d6bdbed1193f..3aec6b16ad15e 100644 --- a/test/interactiveUnfold.lean +++ b/test/interactiveUnfold.lean @@ -57,7 +57,8 @@ info: Unfolds for 5 / 3: info: Unfolds for 1 + 1: · Ordinal.type (Sum.Lex EmptyRelation EmptyRelation) · ⟦{ α := PUnit.{u_1 + 1} ⊕ PUnit.{u_1 + 1}, r := Sum.Lex EmptyRelation EmptyRelation, wo := ⋯ }⟧ -· Quot.mk Setoid.r { α := PUnit.{u_1 + 1} ⊕ PUnit.{u_1 + 1}, r := Sum.Lex EmptyRelation EmptyRelation, wo := ⋯ } +· Quot.mk ⇑Ordinal.isEquivalent + { α := PUnit.{u_1 + 1} ⊕ PUnit.{u_1 + 1}, r := Sum.Lex EmptyRelation EmptyRelation, wo := ⋯ } -/ #guard_msgs in #unfold? (1 : Ordinal) + 1