Section pos_def.
Variable r : G.
Fixpoint pos_to_group (p : positive) : G :=
match p with
| xH => r
| xO p' => group_square G (pos_to_group p')
| xI p' => sgroup_law G (group_square G (pos_to_group p')) r
end.
simple induction p; simpl in |- *.
intros p0 H'; try assumption.
rewrite ZL6.
unfold group_square in |- *.
apply
Trans
with
(sgroup_law G
(sgroup_law G (nat_to_group r (nat_of_P p0))
(nat_to_group r (nat_of_P p0))) r); auto with *.
unfold group_square in |- *.
intros p0 H'; try assumption.
unfold nat_of_P in |- *.
simpl in |- *.
rewrite ZL6.
apply
Trans
with
(sgroup_law G (nat_to_group r (nat_of_P p0))
(nat_to_group r (nat_of_P p0))); auto with *.
auto with *.
Qed.
End pos_def.
Hint Resolve pos_nat_group: algebra.
Variable r : G.
Definition Z_to_group_fun : ZZ -> G.
intros x.
case (Z_gt_le_dec x 0); intros z.
exact (pos_to_group r (pos_abs z)).
case (Z_le_lt_eq_dec _ _ z); intros.
cut (- x > 0)%Z.
intros H'.
exact (pos_to_group (group_inverse G r) (pos_abs H')).
apply Zlemma1.
auto with *.
exact (monoid_unit G).
Defined.
simple induction n; simpl in |- *; auto with *.
intros n0 H' r0; try assumption.
apply
Trans
with
(sgroup_law G (group_inverse G r0) (group_inverse G (nat_to_group r0 n0)));
auto with *.
apply
Trans
with
(sgroup_law G (group_inverse G r0) (nat_to_group (group_inverse G r0) n0));
auto with *.
Qed.
Hint Resolve nat_to_group_inverse: algebra.
intros z; simpl in |- *.
unfold Z_to_group_fun in |- *.
unfold Z_to_group_nat_fun in |- *.
case (Z_gt_le_dec z 0); intros z0.
auto with *.
case (Z_le_lt_eq_dec z 0 z0); intros z1.
apply
Trans
with (nat_to_group (group_inverse G r) (nat_of_P (pos_abs (Zlemma1 z1))));
auto with *.
auto with *.
Qed.
Hint Resolve Z_to_group_fun_eq: algebra.
Definition Z_to_group : Hom (ZZ:GROUP) G.
apply (BUILD_HOM_GROUP (G:=ZZ:GROUP) (G':=G) (ff:=Z_to_group_fun)).
intros x y H'; try assumption.
apply Trans with (Z_to_group_nat r x); auto with *.
apply Trans with (Z_to_group_nat r y); auto with *.
intros x y; try assumption.
apply Trans with (Z_to_group_nat r (sgroup_law ZZ x y)); auto with *.
apply Trans with (sgroup_law G (Z_to_group_nat r x) (Z_to_group_nat r y));
auto with *.
apply Trans with (Z_to_group_nat r (monoid_unit ZZ)); auto with *.
Defined.
End Zup2.
Set Strict Implicit.
Unset Implicit Arguments.
Definition group_power (G : GROUP) (x : G) (n : ZZ) := Z_to_group x n.
Set Implicit Arguments.
Unset Strict Implicit.
Definition sgroup_powers (G : GROUP) (g : G) := coKer (Z_to_group g).
intros G g x H'; try assumption.
elim H'.
intros x0 H'0; try assumption.
elim H'0; intros H'1 H'2; try exact H'2; clear H'0.
exists x0; try assumption.
Qed.

Lemma sgroup_powers_rev :
forall (G : GROUP) (g : G) (n : ZZ),
in_part (group_power G g n) (sgroup_powers g).