End InjmAutIn.
Section GroupAction.
Variables (aT rT : finGroupType) (D : {set aT}) (R : {set rT}).
Local Notation actT := (action D rT).
Definition is_groupAction (to : actT) :=
{in D, forall a, actperm to a \in Aut R}.
Structure groupAction := GroupAction {gact :> actT; _ : is_groupAction gact}.
Definition clone_groupAction to :=
let: GroupAction _ toA := to return {type of GroupAction for to} -> _ in
fun k => k toA : groupAction.
End GroupAction.
Delimit Scope groupAction_scope with gact.
Bind Scope groupAction_scope with groupAction.
Arguments is_groupAction {aT rT D%g} R%g to%act.
Arguments groupAction {aT rT} D%g R%g.
Arguments gact {aT rT D%g R%g} to%gact : rename.
Notation "[ 'groupAction' 'of' to ]" :=
(clone_groupAction (@GroupAction _ _ _ _ to))
(at level 0, format "[ 'groupAction'  'of'  to ]") : form_scope.
Section GroupActionDefs.
Variables (aT rT : finGroupType) (D : {set aT}) (R : {set rT}).
Implicit Type A : {set aT}.
Implicit Type S : {set rT}.
Implicit Type to : groupAction D R.
Definition gact_range of groupAction D R := R.
Definition gacent to A := 'Fix_(R | to)(D :&: A).
Definition acts_on_group A S to := [acts A, on S | to] /\ S \subset R.
Coercion actby_cond_group A S to : acts_on_group A S to -> actby_cond A S to :=
@proj1 _ _.
Definition acts_irreducibly A S to :=
[min S of G | G :!=: 1 & [acts A, on G | to]].
End GroupActionDefs.
Arguments gacent {aT rT D%g R%g} to%gact A%g.
Arguments acts_on_group {aT rT D%g R%g} A%g S%g to%gact.
Arguments acts_irreducibly {aT rT D%g R%g} A%g S%g to%gact.
Notation "''C_' ( | to ) ( A )" := (gacent to A)
(at level 8, format "''C_' ( | to ) ( A )") : group_scope.
Notation "''C_' ( G | to ) ( A )" := (G :&: 'C_(|to)(A))
(at level 8, format "''C_' ( G  |  to ) ( A )") : group_scope.
Notation "''C_' ( | to ) [ a ]" := 'C_(|to)([set a])
(at level 8, format "''C_' ( | to ) [ a ]") : group_scope.
Notation "''C_' ( G | to ) [ a ]" := 'C_(G | to)([set a])
(at level 8, format "''C_' ( G  |  to ) [ a ]") : group_scope.
Notation "{ 'acts' A , 'on' 'group' G | to }" := (acts_on_group A G to)
(at level 0, format "{ 'acts'  A ,  'on'  'group'  G  |  to }") : form_scope.
Section RawGroupAction.
Variables (aT rT : finGroupType) (D : {set aT}) (R : {set rT}).
Variable to : groupAction D R.

(* Specifications: *)
Lemma actperm_Aut : is_groupAction R to. Proof. by case: to. Qed.
Lemma im_actperm_Aut : actperm to @* D \subset Aut R.
Lemma actmM a : {in R &, {morph actm to a : x y / x * y}}.
Lemma group_set_gacent A : group_set 'C_(|to)(A).
Canonical gacent_group A := Group (group_set_gacent A).
Lemma gacent1 : 'C_(|to)(1) = R.
Lemma gacentD1 A : 'C_(|to)(A^#) = 'C_(|to)(A).
Lemma gacent_cycle a : a \in D -> 'C_(|to)(<[a]>) = 'C_(|to)[a].
Lemma astab1 : 'C(1 | to) = D.
Lemma astab_range : 'C(R | to) = 'C(setT | to).
Lemma gacentC A S :
A \subset D -> S \subset R ->
(S \subset 'C_(|to)(A)) = (A \subset 'C(S | to)).
Lemma astabM M N :
M \subset R -> N \subset R -> 'C(M * N | to) = 'C(M | to) :&: 'C(N | to).
Lemma astabs1 : 'N(1 | to) = D.
Lemma astabsD1 S : 'N(S^# | to) = 'N(S | to).
Lemma gacts_range A : A \subset D -> {acts A, on group R | to}.
Lemma acts_subnorm_subgacent A B S :
A \subset D -> [acts B, on S | to] -> [acts 'N_B(A), on 'C_(S | to)(A) | to].
Lemma acts_gen A S :
S \subset R -> [acts A, on S | to] -> [acts A, on <<S>> | to].
Lemma acts_joing A M N :
M \subset R -> N \subset R -> [acts A, on M | to] -> [acts A, on N | to] ->
[acts A, on M <*> N | to].
Lemma im_actm a : actm to a @* R = R.
Lemma acts_char G M : G \subset D -> M \char R -> [acts G, on M | to].
Lemma gacts_char G M :
G \subset D -> M \char R -> {acts G, on group M | to}.