End MorphismTheory.
Notation "''ker' f" := (ker_group (MorPhantom f)) : Group_scope.
Notation "''ker_' G f" := (G :&: 'ker f)%G : Group_scope.
Notation "f @* G" := (morphim_group (MorPhantom f) G) : Group_scope.
Notation "f @*^-1 M" := (morphpre_group (MorPhantom f) M) : Group_scope.
Notation "f @: D" := (morph_dom_group f D) : Group_scope.
Arguments injmP {aT rT D f}.
Arguments morphpreK {aT rT D f} [R] sRf.
Section IdentityMorphism.
Variable gT : finGroupType.
Implicit Types A B : {set gT}.
Implicit Type G : {group gT}.
Definition idm of {set gT} := fun x : gT => x : FinGroup.sort gT.

(* Specifications: *)
Lemma idm_morphM A : {in A & , {morph idm A : x y / x * y}}.
Lemma morphpre_idm A B : idm A @*^-1 B = A :&: B.
Lemma domP (f : {morphism D >-> rT}) : 'dom f = A ->
{g : {morphism A >-> rT} | [/\ g = f :> (aT -> rT), 'ker g = 'ker f,
forall R, g @*^-1 R = f @*^-1 R
& forall B, g @* B = f @* B]}.
Lemma ker_trivm (G : {group aT}) : 'ker (trivm G) = G.
Canonical comp_morphism := Morphism comp_morphM.
Lemma ker_comp : 'ker gof = f @*^-1 'ker g.
Lemma morphpre_comp (C : {set rT}) : gof @*^-1 C = f @*^-1 (g @*^-1 C).
Lemma factm_morphM : {in q @* G &, {morph ff : x y / x * y}}.
Canonical factm_morphism := Morphism factm_morphM.
Lemma morphim_factm (A : {set aT}) : ff @* (q @* A) = f @* A.
Lemma morphpre_factm (C : {set rT}) : ff @*^-1 C =  q @* (f @*^-1 C).
Lemma ker_factm : 'ker ff = q @* 'ker f.
Lemma ker_factm_loc (K : {group aT}) : 'ker_(q @* K) ff = q @* 'ker_K f.
Lemma injm_proper A B :
A \subset G -> B \subset G -> (f @* A \proper f @* B) = (A \proper B).
Lemma injm_invm : 'injm invm.
Lemma morphim_ifactm (A : {set gT}) :
A \subset D -> ifactm @* (f @* A) = g @* A.
Lemma im_ifactm : G \subset D -> ifactm @* (f @* G) = g @* G.
Lemma ker_ifactm : 'ker ifactm = f @* 'ker g.
Definition morphm of morphic f := f : aT -> FinGroup.sort rT.
Lemma morphmE fM : morphm fM = f. Proof. by []. Qed.
Canonical morphm_morphism fM := @Morphism _ _ A (morphm fM) (morphicP fM).