Section Generated_ideal.
Variable R : RING.
Variable A : part_set R.
Definition generated_module_subgroup : subgroup R.
apply (BUILD_SUB_GROUP (G:=R) (H:=generated_module (R:=R) (Mod:=R) A));
simpl in |- *; auto with algebra.
intros x y H' H'0; try assumption.
elim H'0; intros x0 E; elim E; intros H'1 H'2; try exact H'2; clear E H'0.
elim H'; intros x1 E; elim E; intros H'0 H'3; try exact H'3; clear E H'.
exists (Law x1 x0); split; [ try assumption | idtac ].
simpl in |- *.
exact (SGROUP_comp (E:=R) H'3 H'2).
exists (Unit R A); split; [ idtac | try assumption ].
auto with algebra.
simpl in |- *.
auto with algebra.
intros x H'; try assumption.
elim H'; intros x0 E; elim E; intros H'0 H'1; try exact H'1; clear E H'.
exists (Inv x0); split; [ idtac | try assumption ].
auto with algebra.
simpl in |- *.
exact (GROUP_comp (G:=R) H'1).
Defined.
Definition generated_ideal : ideal R.
apply (Build_ideal (R:=R) (ideal_subgroup:=generated_module_subgroup)).
red in |- *.
simpl in |- *.
intros x H' a; try assumption.
elim H'; intros x0 E; elim E; intros H'0 H'1; try exact H'1; clear E H'.
exists (Op a x0); split; [ idtac | try assumption ].
auto with algebra.
simpl in |- *.
exact (MODULE_comp (R:=R) (Mod:=R:MODULE R) (Refl a) H'1).
Defined.
red in |- *.
simpl in |- *.
intros x H';
exists (Var R (V:=A) (Build_subtype (E:=R) (P:=A) (subtype_elt:=x) H'));
split; [ idtac | try assumption ].
auto with algebra.
simpl in |- *.
auto with algebra.
Qed.

Lemma generated_ideal_minimal :
forall I : ideal R, included A I -> included generated_ideal I.