Require Export Lci.
Require Export misc.
Section groups.
Variable S : Set.
Variable G : S -> Prop.
Variable Add : S -> S -> S.
Variable O : S.
Variable Opp : S -> S.
Definition is_group :=
intern S G Add /\
associativity S Add /\ neutral S G Add O /\ opposite S G Add O Opp.

(* Specifications: *)
Lemma regular_l :
is_group ->
forall y z : S,
G y -> G z -> forall x : S, G x -> Add x y = Add x z -> y = z.
Lemma add_add :
commutativity S Add ->
associativity S Add ->
forall x1 y1 x2 y2 : S,
Add (Add x1 y1) (Add x2 y2) = Add (Add x1 x2) (Add y1 y2).
Lemma opp_unicity :
is_group -> forall x y : S, is_opposite S G Add O x y -> y = Opp x.
Lemma opp_opp : is_group -> forall x : S, G x -> x = Opp (Opp x).
Lemma opp_add :
is_group ->
commutativity S Add ->
forall x y : S, G x -> G y -> Opp (Add x y) = Add (Opp x) (Opp y).
Lemma opp_neutral : is_group -> Opp O = O.
End groups.