Zulip Chat Archive

Stream: Is there code for X?

Topic: Quotient dlift


William Sørensen (Nov 10 2025 at 11:26):

Hi is there code for this in Mathlib or should i push it up

def Quotient.liftd
    {α : Sort u} {s : Setoid α} {β : Quotient s  Sort v}
    (f : (v : α)  β (Quotient.mk s v))
    (heq :  (a b : α), a  b  f a  f b)
    (q : Quotient s)
    : β q :=
  let res := Quotient.lift
    (β := (x : Quotient s) ×' β x)
    (s := s) (fun q => Quotient.mk s q, f q)
    (fun a b rel => (PSigma.mk.injEq _ _ _ _).mpr Quotient.sound rel, heq _ _ rel)
    q
  have : res.fst = q := by induction q using Quotient.ind; rfl
  cast (congr rfl this) res.snd

@[simp]
theorem Quotient.liftd_mk
    {α : Sort u} {s : Setoid α} {β : Quotient s  Sort v}
    (f : (v : α)  β (Quotient.mk s v))
    (heq :  (a b : α), a  b  f a  f b)
    (v : α)
    : Quotient.liftd f heq (.mk s v) = f v :=
  rfl

Junyan Xu (Nov 10 2025 at 11:38):

Quotient.hrecOn for the first

William Sørensen (Nov 10 2025 at 13:47):

Hmm yes i guess that is more general. This might just have quite niche usages. Need to experiment with hrecOn to see if it has the same defeq

Aaron Liu (Nov 10 2025 at 16:19):

Its literally defined the same way

Aaron Liu (Nov 10 2025 at 16:20):

well, almost the same way


Last updated: Dec 20 2025 at 21:32 UTC