Zulip Chat Archive

Stream: Is there code for X?

Topic: Set image of `Quotient.mk`


Artie Khovanov (Jul 19 2025 at 22:00):

I can't find anything like the following:

theorem Quotient.image_mk_eq_lift {α : Type*} {s : Setoid α} (A : Set α)
    (h : ∀ x y, x ≈ y → (x ∈ A ↔ y ∈ A)) :
    (Quotient.mk s) '' A = (Quotient.lift (· ∈ A) (by simpa)) := by
  aesop (add unsafe forward Quotient.exists_rep)

Am I missing some alternative statement? And if not, where should this lemma live?

Weiyi Wang (Jul 19 2025 at 23:03):

My guess is that having by simpa (or any tactical proof) in the theorem statement isn't preferred. I wonder what the use case of this is. Perhaps there is a better way to state things if we see the context

Artie Khovanov (Jul 19 2025 at 23:04):

The application is pushing a DecidablePred instance through a quotient

import Mathlib

@[to_additive]
theorem QuotientGroup.mem_iff_mem_of_rel {G S : Type*} [CommGroup G]
    [SetLike S G] [MulMemClass S G] (H : Subgroup G) {M : S} (hM : (H : Set G) ⊆ M) :
    ∀ x y, QuotientGroup.leftRel H x y → (x ∈ M ↔ y ∈ M) := fun x y hxy => by
  rw [QuotientGroup.leftRel_apply] at hxy
  exact ⟨fun h => by simpa using mul_mem h <| hM hxy,
        fun h => by simpa using mul_mem h <| hM <| inv_mem hxy⟩

def decidablePred_mem_map_quotient_mk
    {R S : Type*} [CommRing R] [SetLike S R] [AddMemClass S R] (I : Ideal R)
    {M : S} (hM : (I : Set R) ⊆ M) [DecidablePred (· ∈ M)] :
    DecidablePred (· ∈ (Ideal.Quotient.mk I) '' M) := by
  have : ∀ x y, I.quotientRel x y → (x ∈ M ↔ y ∈ M) :=
    QuotientAddGroup.mem_iff_mem_of_rel _ (by simpa)
  rw [show (· ∈ (Ideal.Quotient.mk I) '' _) = (· ∈ (Quotient.mk _) '' _) by rfl,
      Quotient.image_mk_eq_lift _ this]
  exact Quotient.lift.decidablePred (· ∈ M) (by simpa)

Aaron Liu (Jul 19 2025 at 23:05):

My guess is that conflating Set (Quotient s) and Quotient s → Prop in the theorem statement isn't preferred

Artie Khovanov (Jul 19 2025 at 23:06):

Does anyone have a thought how to proceed with upstreaming the mathematical content of this?


Last updated: Feb 28 2026 at 14:05 UTC