Section Monic_Iso_Monic_Factorization.
Context
{A B : Type}
{f : A → B}
(fm : @is_Monic Type_Cat _ _ f)
.
Definition Monic_Image_of : Type := {x : B & {a : A | f a = x}}.
Definition Monic_From_Image_forward : Monic_Image_of → B := fun x => projT1 x.
Program Definition Monic_Iso_Monic_Factor_Monic :
@Monic Type_Cat Monic_Image_of B :=
{|
mono_morphism := Monic_From_Image_forward;
mono_morphism_monomorphic := fun T g h => _
|}
.
Next Obligation.
Definition Monic_To_Image : A → Monic_Image_of :=
fun a => existT _ (f a) (exist _ a eq_refl).
Definition Monic_From_Image_back : Monic_Image_of → A :=
fun x => proj1_sig (projT2 x).
Program Definition Monic_Iso_Monic_Factor_Iso :
(A ≃≃ Monic_Image_of ::> Type_Cat)%isomorphism
:=
Monic_is_split_Epic_Iso
_
_
(is_Monic_Monic Monic_From_Image_back_is_Monic)
(
@Build_is_split_Monic
(Type_Cat ^op)
_
_
Monic_To_Image
_
Monic_To_Image_form_split_epic
)
.

Theorem Monic_Iso_Monic_Factorization :
f = fun x =>  Monic_From_Image_forward (Monic_To_Image x).