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)).

(* Specifications: *)
Theorem div_O_O : is_ring -> divide O O.
Theorem div_add :
is_ring -> forall a b d : S, divide d a -> divide d b -> divide d (Add a b).
Theorem div_mult :
is_ring -> forall a b d : S, divide d a -> A b -> divide d (Mult a b).
Theorem div_opp : is_ring -> forall a d : S, divide d a -> divide d (Opp a).
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 gcd_null : forall a b : S, is_gcd a b O -> a = O /\ b = O.
Lemma gcd_null2 : is_ring -> forall d : S, is_gcd O O d -> d = O.
Lemma simplification_integrity :
is_unitary_commutative_ring ->
integrity -> forall a x : S, A a -> A x -> a <> O -> Mult a x = a -> x = I.
Lemma gcd_unicity_apart_unities :
is_unitary_commutative_ring ->
integrity ->
forall a b d1 d2 : S,
is_gcd a b d1 ->
is_gcd a b d2 ->
exists x : S, inversible S Mult I x /\ A x /\ d2 = Mult d1 x.
Lemma opp_O : is_ring -> forall x : S, A x -> Opp x = O -> x = O.
End ring.