intros x x' y y' H' H'0; try assumption.
simpl in |- *.
red in |- *; auto with algebra.
Qed.
Hint Resolve Build_Ctype_comp2: algebra.
Definition Cring : RING.
apply
(BUILD_RING (E:=Cset) (ringplus:=Cadd) (ringmult:=Cmult) (zero:=Czero)
(un:=Cone) (ringopp:=Copp)).
unfold Cadd in |- *.
auto with algebra.
unfold Cadd in |- *.
simpl in |- *.
auto with algebra.
unfold Cadd, Czero in |- *.
simpl in |- *.
intros x; red in |- *.
simpl in |- *.
auto with algebra.
unfold Copp in |- *.
auto with algebra.
unfold Cadd, Czero, Copp in |- *.
simpl in |- *.
auto with algebra.
unfold Cadd in |- *.
auto with algebra.
unfold Cmult in |- *.
intros x x' y y' H' H'0; try assumption.
apply Build_Ctype_comp.
auto with algebra.
auto with algebra.
unfold Cmult in |- *.
simpl in |- *.
intros x y z; try assumption.
apply Build_Ctype_comp2.
apply
Trans
with
(sgroup_law R
(sgroup_law R (ring_mult (ring_mult x y) z)
(ring_mult (group_inverse R (ring_mult (imag x) (imag y))) z))
(group_inverse R
(sgroup_law R (ring_mult (ring_mult x (imag y)) (imag z))
(ring_mult (ring_mult (imag x) y) (imag z))))).
auto with algebra.
apply
Trans
with
(sgroup_law R
(sgroup_law R (ring_mult x (ring_mult y z))
(ring_mult x (group_inverse R (ring_mult (imag y) (imag z)))))
(group_inverse R
(sgroup_law R (ring_mult (imag x) (ring_mult y (imag z)))
(ring_mult (imag x) (ring_mult (imag y) z))))).
apply
Trans
with
(sgroup_law R (ring_mult (ring_mult x y) z)
(sgroup_law R
(ring_mult (group_inverse R (ring_mult (imag x) (imag y))) z)
(group_inverse R
(sgroup_law R (ring_mult (ring_mult x (imag y)) (imag z))
(ring_mult (ring_mult (imag x) y) (imag z)))))).
auto with algebra.
apply
Trans
with
(sgroup_law R (ring_mult x (ring_mult y z))
(sgroup_law R
(ring_mult x (group_inverse R (ring_mult (imag y) (imag z))))
(group_inverse R
(sgroup_law R (ring_mult (imag x) (ring_mult y (imag z)))
(ring_mult (imag x) (ring_mult (imag y) z)))))).
apply SGROUP_comp.
auto with algebra.
apply
Trans
with
(sgroup_law R
(ring_mult (group_inverse R (ring_mult (imag x) (imag y))) z)
(sgroup_law R
(group_inverse R (ring_mult (ring_mult (imag x) y) (imag z)))
(group_inverse R (ring_mult (ring_mult x (imag y)) (imag z))))).
auto with algebra.
apply
Trans
with
(sgroup_law R
(ring_mult x (group_inverse R (ring_mult (imag y) (imag z))))
(sgroup_law R
(group_inverse R (ring_mult (imag x) (ring_mult (imag y) z)))
(group_inverse R (ring_mult (imag x) (ring_mult y (imag z)))))).
apply
Trans
with
(sgroup_law R
(group_inverse R (ring_mult (ring_mult x (imag y)) (imag z)))
(sgroup_law R
(ring_mult (group_inverse R (ring_mult (imag x) (imag y))) z)
(group_inverse R (ring_mult (ring_mult (imag x) y) (imag z))))).
apply
Trans
with
(sgroup_law R
(ring_mult (group_inverse R (ring_mult (imag x) (imag y))) z)
(sgroup_law R
(group_inverse R (ring_mult (ring_mult x (imag y)) (imag z)))
(group_inverse R (ring_mult (ring_mult (imag x) y) (imag z))))).
auto with algebra.
apply
Trans
with
(sgroup_law R
(group_inverse R (ring_mult (ring_mult x (imag y)) (imag z)))
(sgroup_law R
(ring_mult (group_inverse R (ring_mult (imag x) (imag y))) z)
(group_inverse R (ring_mult (ring_mult (imag x) y) (imag z))))).
auto with algebra.
auto with algebra.
apply SGROUP_comp.
apply
Trans with (ring_mult (group_inverse R (ring_mult x (imag y))) (imag z)).
auto with algebra.
apply
Trans with (ring_mult (ring_mult x (group_inverse R (imag y))) (imag z)).
auto with algebra.
apply
Trans with (ring_mult x (ring_mult (group_inverse R (imag y)) (imag z))).
auto with algebra.
auto with algebra.
apply SGROUP_comp.
apply
Trans with (group_inverse R (ring_mult (ring_mult (imag x) (imag y)) z)).
auto with algebra.
auto with algebra.
auto with algebra.
auto with algebra.
auto with algebra.
auto with algebra.
apply
Trans
with
(sgroup_law R
(sgroup_law R (ring_mult (ring_mult x y) (imag z))
(ring_mult (group_inverse R (ring_mult (imag x) (imag y))) (imag z)))
(sgroup_law R (ring_mult (ring_mult x (imag y)) z)
(ring_mult (ring_mult (imag x) y) z))).
auto with algebra.
apply
Trans
with
(sgroup_law R
(sgroup_law R (ring_mult x (ring_mult y (imag z)))
(ring_mult x (ring_mult (imag y) z)))
(sgroup_law R (ring_mult (imag x) (ring_mult y z))
(ring_mult (imag x) (group_inverse R (ring_mult (imag y) (imag z)))))).
apply
Trans
with
(sgroup_law R (ring_mult (ring_mult x y) (imag z))
(sgroup_law R
(ring_mult (group_inverse R (ring_mult (imag x) (imag y))) (imag z))
(sgroup_law R (ring_mult (ring_mult x (imag y)) z)
(ring_mult (ring_mult (imag x) y) z)))).
auto with algebra.
apply
Trans
with
(sgroup_law R (ring_mult x (ring_mult y (imag z)))
(sgroup_law R (ring_mult x (ring_mult (imag y) z))
(sgroup_law R (ring_mult (imag x) (ring_mult y z))
(ring_mult (imag x)
(group_inverse R (ring_mult (imag y) (imag z))))))).
apply SGROUP_comp.
auto with algebra.
apply
Trans
with
(sgroup_law R (ring_mult (ring_mult x (imag y)) z)
(sgroup_law R
(ring_mult (group_inverse R (ring_mult (imag x) (imag y))) (imag z))
(ring_mult (ring_mult (imag x) y) z))).
auto with algebra.
apply SGROUP_comp.
auto with algebra.
apply
Trans
with
(sgroup_law R (ring_mult (ring_mult (imag x) y) z)
(ring_mult (group_inverse R (ring_mult (imag x) (imag y))) (imag z))).
auto with algebra.
apply SGROUP_comp.
auto with algebra.
apply
Trans
with (group_inverse R (ring_mult (ring_mult (imag x) (imag y)) (imag z))).
auto with algebra.
apply
Trans
with (group_inverse R (ring_mult (imag x) (ring_mult (imag y) (imag z)))).
auto with algebra.
auto with algebra.
auto with algebra.
auto with algebra.
unfold Cmult, Cone in |- *.
simpl in |- *.
intros x; try assumption.
elim x.
simpl in |- *.
unfold Ceq in |- *.
simpl in |- *.
intros real0 imag0; split; [ try assumption | idtac ].
apply Trans with (sgroup_law R real0 (group_inverse R (monoid_unit R)));
auto with algebra.
apply Trans with (sgroup_law R real0 (monoid_unit R)); auto with algebra.
apply Trans with (sgroup_law R (monoid_unit R) imag0); auto with algebra.
unfold Cmult, Cone in |- *.
simpl in |- *.
intros x; try assumption.
elim x.
simpl in |- *.
unfold Ceq in |- *.
simpl in |- *.
intros real0 imag0; split; [ try assumption | idtac ].
apply Trans with (sgroup_law R real0 (group_inverse R (monoid_unit R)));
auto with algebra.
apply Trans with (sgroup_law R real0 (monoid_unit R)); auto with algebra.
apply Trans with (sgroup_law R imag0 (monoid_unit R)); auto with algebra.
unfold Cmult, Cadd in |- *.
simpl in |- *.
unfold Ceq in |- *.
simpl in |- *.
intros x y z; split; [ try assumption | idtac ].
apply
Trans
with
(sgroup_law R (sgroup_law R (ring_mult x y) (ring_mult x z))
(group_inverse R (ring_mult (imag x) (sgroup_law R (imag y) (imag z))))).
auto with algebra.
apply
Trans
with
(sgroup_law R (ring_mult x y)
(sgroup_law R (ring_mult x z)
(group_inverse R
(ring_mult (imag x) (sgroup_law R (imag y) (imag z)))))).
auto with algebra.
apply
Trans
with
(sgroup_law R (ring_mult x y)
(sgroup_law R (group_inverse R (ring_mult (imag x) (imag y)))
(sgroup_law R (ring_mult x z)
(group_inverse R (ring_mult (imag x) (imag z)))))).
apply SGROUP_comp.
auto with algebra.
apply
Trans
with
(sgroup_law R (ring_mult x z)
(ring_mult (group_inverse R (imag x)) (sgroup_law R (imag y) (imag z)))).
auto with algebra.
apply
Trans
with
(sgroup_law R (ring_mult x z)
(sgroup_law R (ring_mult (group_inverse R (imag x)) (imag y))
(ring_mult (group_inverse R (imag x)) (imag z)))).
auto with algebra.
apply
Trans
with
(sgroup_law R (ring_mult (group_inverse R (imag x)) (imag y))
(sgroup_law R (ring_mult x z)
(ring_mult (group_inverse R (imag x)) (imag z)))).
auto with algebra.
auto with algebra.
auto with algebra.
apply
Trans
with
(sgroup_law R
(sgroup_law R (ring_mult x (imag y)) (ring_mult x (imag z)))
(sgroup_law R (ring_mult (imag x) y) (ring_mult (imag x) z))).
auto with algebra.
apply
Trans
with
(sgroup_law R (ring_mult x (imag y))
(sgroup_law R (ring_mult x (imag z))
(sgroup_law R (ring_mult (imag x) y) (ring_mult (imag x) z)))).
auto with algebra.
apply
Trans
with
(sgroup_law R (ring_mult x (imag y))
(sgroup_law R (ring_mult (imag x) y)
(sgroup_law R (ring_mult x (imag z)) (ring_mult (imag x) z)))).
apply SGROUP_comp.
auto with algebra.
auto with algebra.
auto with algebra.
unfold Cmult, Cadd in |- *.
simpl in |- *.
unfold Ceq in |- *.
simpl in |- *.
intros x y z; split; [ try assumption | idtac ].
apply
Trans
with
(sgroup_law R (sgroup_law R (ring_mult x z) (ring_mult y z))
(group_inverse R
(sgroup_law R (ring_mult (imag x) (imag z))
(ring_mult (imag y) (imag z))))).
auto with algebra.
apply
Trans
with
(sgroup_law R (ring_mult x z)
(sgroup_law R (ring_mult y z)
(group_inverse R
(sgroup_law R (ring_mult (imag x) (imag z))
(ring_mult (imag y) (imag z)))))).
auto with algebra.
apply
Trans
with
(sgroup_law R (ring_mult x z)
(sgroup_law R (group_inverse R (ring_mult (imag x) (imag z)))
(sgroup_law R (ring_mult y z)
(group_inverse R (ring_mult (imag y) (imag z)))))).
apply SGROUP_comp.
auto with algebra.
apply
Trans
with
(sgroup_law R (ring_mult y z)
(sgroup_law R (group_inverse R (ring_mult (imag y) (imag z)))
(group_inverse R (ring_mult (imag x) (imag z))))).
auto with algebra.
apply
Trans
with
(sgroup_law R (ring_mult y z)
(sgroup_law R (group_inverse R (ring_mult (imag x) (imag z)))
(group_inverse R (ring_mult (imag y) (imag z))))).
auto with algebra.
auto with algebra.
auto with algebra.
apply
Trans
with
(sgroup_law R
(sgroup_law R (ring_mult x (imag z)) (ring_mult y (imag z)))
(sgroup_law R (ring_mult (imag x) z) (ring_mult (imag y) z))).
auto with algebra.
apply
Trans
with
(sgroup_law R (ring_mult x (imag z))
(sgroup_law R (ring_mult y (imag z))
(sgroup_law R (ring_mult (imag x) z) (ring_mult (imag y) z)))).
auto with algebra.
apply
Trans
with
(sgroup_law R (ring_mult x (imag z))
(sgroup_law R (ring_mult (imag x) z)
(sgroup_law R (ring_mult y (imag z)) (ring_mult (imag y) z)))).
apply SGROUP_comp.
auto with algebra.
auto with algebra.
auto with algebra.
Defined.
Definition Ccring : CRING.
apply (Build_cring (cring_ring:=Cring)).
apply (Build_cring_on (R:=Cring)).
red in |- *.
simpl in |- *.
unfold Cmult, Ceq in |- *; simpl in |- *.
intros x y; split; [ try assumption | idtac ].
auto with algebra.
apply Trans with (sgroup_law R (ring_mult (imag y) x) (ring_mult y (imag x)));
auto with algebra.
apply SGROUP_comp; auto with algebra.
exact (CRING_com (R1:=R) x (imag y)).
exact (CRING_com (R1:=R) (imag x) y).
Defined.
Definition conjugate (z : Ctype) : Ctype :=
Build_Ctype (real z) (group_inverse R (imag z)).
Definition CdivR (z : Ctype) (r : R) : Ctype :=
Build_Ctype (field_div (real z) r) (field_div (imag z) r).
Definition Cinv (z : Ctype) : Ctype :=
CdivR (conjugate z) (Cmult z (conjugate z)).
Definition Cinv_map : MAP Ccring Ccring.
apply (Build_Map (A:=Ccring) (B:=Ccring) (Ap:=Cinv)).
red in |- *.
unfold Cinv in |- *.
unfold CdivR in |- *.
unfold conjugate in |- *.
intros x y H'; try assumption.
simpl in |- *.
unfold Ceq in |- *; simpl in |- *.
simpl in H'.
red in H'.
elim H'; intros H'0 H'1; try exact H'0; clear H'.
split; [ try assumption | idtac ].
unfold field_div in |- *.
apply RING_comp.
auto with algebra.
apply FIELD_comp.
apply SGROUP_comp.
auto with algebra.
auto with algebra.
unfold field_div in |- *.
apply RING_comp.
auto with algebra.
apply FIELD_comp.
apply SGROUP_comp.
auto with algebra.
auto with algebra.
Defined.
Hypothesis
sum_of_square :
forall x y : R,
Equal (sgroup_law R (ring_mult x x) (ring_mult y y)) (monoid_unit R) ->
Equal x (monoid_unit R) /\ Equal y (monoid_unit R).

(* Specifications: *)
Lemma C_inv_r :
forall x : Ccring,
~ Equal x (monoid_unit Ccring) ->
Equal (ring_mult x (Ap Cinv_map x)) (ring_unit Ccring).