Section Group.
Variable E : Setoid.
Variable genlaw : E -> E -> E.
Variable e : E.
Variable geninv : E -> E.
Hypothesis
fcomp :
forall x x' y y' : E,
Equal x x' -> Equal y y' -> Equal (genlaw x y) (genlaw x' y').
Hypothesis
genlawassoc :
forall x y z : E, Equal (genlaw (genlaw x y) z) (genlaw x (genlaw y z)).
Hypothesis eunitgenlawr : forall x : E, Equal (genlaw x e) x.
Hypothesis invcomp : forall x y : E, Equal x y -> Equal (geninv x) (geninv y).
Hypothesis geninvr : forall x : E, Equal (genlaw x (geninv x)) e.
intros x; try assumption.
apply Trans with (genlaw (genlaw (geninv x) x) e); auto with algebra.
apply
Trans
with (genlaw (genlaw (geninv x) x) (genlaw (geninv x) (geninv (geninv x))));
auto with algebra.
apply
Trans
with (genlaw (geninv x) (genlaw x (genlaw (geninv x) (geninv (geninv x)))));
auto with algebra.
apply
Trans
with (genlaw (geninv x) (genlaw (genlaw x (geninv x)) (geninv (geninv x))));
auto with algebra.
apply Trans with (genlaw (geninv x) (genlaw e (geninv (geninv x))));
auto with algebra.
apply Trans with (genlaw (genlaw (geninv x) e) (geninv (geninv x)));
auto with algebra.
apply Trans with (genlaw (geninv x) (geninv (geninv x))); auto with algebra.
Qed.
Hint Resolve geninvl: algebra.
intros x; try assumption.
apply Trans with (genlaw (genlaw x (geninv x)) x); auto with algebra.
apply Trans with (genlaw x (genlaw (geninv x) x)); auto with algebra.
apply Trans with (genlaw x e); auto with algebra.
Qed.
Hint Resolve eunitgenlawl: algebra.
Definition f := uncurry fcomp.
red in |- *.
simpl in |- *; auto with algebra.
Qed.
red in |- *.
simpl in |- *; auto with algebra.
Qed.
red in |- *.
simpl in |- *; auto with algebra.
Qed.
Definition inv := Build_Map (Ap:=geninv) invcomp.

Lemma invr : inverse_r f e inv.