Lean4
/-- Given a qpf `F` and a well-behaved surjection `FG_abs` from `F α` to
functor `G α`, `G` is a qpf. We can consider `G` a quotient on `F` where
elements `x y : F α` are in the same equivalence class if
`FG_abs x = FG_abs y`. -/
def quotientQPF (FG_abs_repr : ∀ {α} (x : G α), FG_abs (FG_repr x) = x)
(FG_abs_map : ∀ {α β} (f : α → β) (x : F α), FG_abs (f <$> x) = f <$> FG_abs x) : QPF G
where
P := q.P
abs {_} p := FG_abs (abs p)
repr {_} x := repr (FG_repr x)
abs_repr {α} x := by rw [abs_repr, FG_abs_repr]
abs_map {α β} f x := by rw [abs_map, FG_abs_map]