Section ring.
Variable S : Set.
Variable A : S -> Prop.
Variable Add Mult : S -> S -> S.
Variable O I : S.
Variable Opp : S -> S.
Variable v : S -> nat.
Definition is_ring :=
commutativity S Add /\
is_group S A Add O Opp /\
intern S A Mult /\ associativity S Mult /\ distributivity S Add Mult.
Definition integrity := forall a b : S, Mult a b = O -> {a = O} + {b = O}.
Definition is_unitary_commutative_ring :=
is_ring /\ commutativity S Mult /\ neutral S A Mult I.
(* Division *)
Definition divide (a b : S) :=
A a /\ A b /\ (b = O \/ a <> O /\ (exists q : S, A q /\ b = Mult a q)).
Definition is_gcd (a b d : S) :=
divide d a /\
divide d b /\ (forall q : S, divide q a -> divide q b -> divide q d).

Lemma opp_O : is_ring -> forall x : S, A x -> Opp x = O -> x = O.