text
stringlengths 107
2.17M
|
---|
From mathcomp
Require Import ssreflect ssrbool ssrfun.
From LemmaOverloading
Require Import heaps rels stmod stsep stlog.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Structure tagged_heap := Tag {untag :> heap}.
Definition right_tag := Tag.
Definition left_tag := right_tag.
Canonical Structure found_tag i := left_tag i.
Definition update_axiom k r (h : tagged_heap) := untag h = k :+ r.
Structure update (k r : heap) :=
Update {heap_of :> tagged_heap;
_ : update_axiom k r heap_of}.
Lemma updateE r k (f : update k r) : untag f = k :+ r.
Proof.
(* Goal: @eq heap (untag (@heap_of k r f)) (union2 k r) *)
by case: f=>[[j]] /=; rewrite /update_axiom /= => ->.
Qed.
Lemma found_pf k : update_axiom k empty (found_tag k).
Proof.
(* Goal: update_axiom k empty (found_tag k) *)
by rewrite /update_axiom unh0.
Qed.
Canonical Structure found_struct k := Update (found_pf k).
Lemma left_pf h r (f : forall k, update k r) k :
update_axiom k (r :+ h) (left_tag (f k :+ h)).
Proof.
(* Goal: update_axiom k (union2 r h) (left_tag (union2 (untag (@heap_of k r (f k))) h)) *)
by rewrite updateE /update_axiom /= unA.
Qed.
Canonical Structure left_struct h r (f : forall k, update k r) k :=
Update (left_pf h f k).
Lemma right_pf h r (f : forall k, update k r) k :
update_axiom k (h :+ r) (right_tag (h :+ f k)).
Proof.
(* Goal: update_axiom k (union2 h r) (right_tag (union2 h (untag (@heap_of k r (f k))))) *)
by rewrite updateE /update_axiom /= unCA.
Qed.
Canonical Structure right_struct h r (f : forall k, update k r) k :=
Update (right_pf h f k).
Notation cont A := (ans A -> heap -> Prop).
Section EvalDoR.
Variables (A B : Type).
Lemma val_doR (s : spec A) i j (f : forall k, update k j) (r : cont A) :
s.1 i ->
Lemma try_doR (s : spec A) s1 s2 i j (f : forall k, update k j) (r : cont B) :
s.1 i ->
Lemma bnd_doR (s : spec A) s2 i j (f : forall k, update k j) (r : cont B) :
s.1 i ->
End EvalDoR.
Definition val_retR := val_ret.
Definition try_retR := try_ret.
Definition bnd_retR := bnd_ret.
Section EvalReadR.
Variables (A B : Type).
Lemma val_readR v x i (f : update (x :-> v) i) (r : cont A) :
(def f -> r (Val v) f) ->
verify (read_s A x) f r.
Proof.
(* Goal: forall _ : forall _ : is_true (def (untag (@heap_of (@pts A x v) i f))), r (@Val A v) (untag (@heap_of (@pts A x v) i f)), @verify' A (@fr A (read_s A x)) (untag (@heap_of (@pts A x v) i f)) r *)
by rewrite updateE; apply: val_read.
Qed.
Lemma try_readR s1 s2 v x i (f : update (x :-> v) i) (r : cont B) :
verify (s1 v) f r ->
verify (try_s (read_s A x) s1 s2) f r.
Proof.
(* Goal: forall _ : @verify' B (@fr B (s1 v)) (untag (@heap_of (@pts A x v) i f)) r, @verify' B (@fr B (@try_s A B (read_s A x) s1 s2)) (untag (@heap_of (@pts A x v) i f)) r *)
by rewrite updateE; apply: try_read.
Qed.
Lemma bnd_readR s v x i (f : update (x :-> v) i) (r : cont B) :
verify (s v) f r ->
verify (bind_s (read_s A x) s) f r.
Proof.
(* Goal: forall _ : @verify' B (@fr B (s v)) (untag (@heap_of (@pts A x v) i f)) r, @verify' B (@fr B (@bind_s A B (read_s A x) s)) (untag (@heap_of (@pts A x v) i f)) r *)
by rewrite updateE; apply: bnd_read.
Qed.
End EvalReadR.
Section EvalWriteR.
Variables (A B C : Type).
Lemma val_writeR (v : A) (w : B) x i (f : forall k, update k i) (r : cont unit) :
(def (f (x :-> v)) -> r (Val tt) (f (x :-> v))) ->
verify (write_s x v) (f (x :-> w)) r.
Proof.
(* Goal: forall _ : forall _ : is_true (def (untag (@heap_of (@pts A x v) i (f (@pts A x v))))), r (@Val unit tt) (untag (@heap_of (@pts A x v) i (f (@pts A x v)))), @verify' unit (@fr unit (@write_s A x v)) (untag (@heap_of (@pts B x w) i (f (@pts B x w)))) r *)
by rewrite !updateE; apply: val_write.
Qed.
Lemma try_writeR s1 s2 (v : A) (w : C) x i
(f : forall k, update k i) (r : cont B) :
verify (s1 tt) (f (x :-> v)) r ->
verify (try_s (write_s x v) s1 s2) (f (x :-> w)) r.
Proof.
(* Goal: forall _ : @verify' B (@fr B (s1 tt)) (untag (@heap_of (@pts A x v) i (f (@pts A x v)))) r, @verify' B (@fr B (@try_s unit B (@write_s A x v) s1 s2)) (untag (@heap_of (@pts C x w) i (f (@pts C x w)))) r *)
rewrite !updateE; apply: try_write.
Qed.
Lemma bnd_writeR s (v : A) (w : C) x i (f : forall k, update k i) (r : cont B) :
verify (s tt) (f (x :-> v)) r ->
verify (bind_s (write_s x v) s) (f (x :-> w)) r.
Proof.
(* Goal: forall _ : @verify' B (@fr B (s tt)) (untag (@heap_of (@pts A x v) i (f (@pts A x v)))) r, @verify' B (@fr B (@bind_s unit B (@write_s A x v) s)) (untag (@heap_of (@pts C x w) i (f (@pts C x w)))) r *)
by rewrite !updateE; apply: bnd_write.
Qed.
End EvalWriteR.
Definition val_allocR := val_alloc.
Definition try_allocR := try_alloc.
Definition bnd_allocR := bnd_alloc.
Definition val_allocbR := val_allocb.
Definition try_allocbR := try_allocb.
Definition bnd_allocbR := bnd_allocb.
Section EvalDeallocR.
Variables (A B : Type).
Lemma val_deallocR (v : A) x i (f : forall k, update k i) (r : cont unit) :
(def (f empty) -> r (Val tt) (f empty)) ->
verify (dealloc_s x) (f (x :-> v)) r.
Proof.
(* Goal: forall _ : forall _ : is_true (def (untag (@heap_of empty i (f empty)))), r (@Val unit tt) (untag (@heap_of empty i (f empty))), @verify' unit (@fr unit (dealloc_s x)) (untag (@heap_of (@pts A x v) i (f (@pts A x v)))) r *)
by rewrite !updateE un0h; apply: val_dealloc.
Qed.
Lemma try_deallocR s1 s2 (v : B) x i (f : forall k, update k i) (r : cont A) :
verify (s1 tt) (f empty) r ->
verify (try_s (dealloc_s x) s1 s2) (f (x :-> v)) r.
Proof.
(* Goal: forall _ : @verify' A (@fr A (s1 tt)) (untag (@heap_of empty i (f empty))) r, @verify' A (@fr A (@try_s unit A (dealloc_s x) s1 s2)) (untag (@heap_of (@pts B x v) i (f (@pts B x v)))) r *)
by rewrite !updateE un0h; apply: try_dealloc.
Qed.
Lemma bnd_deallocR s (v : B) x i (f : forall k, update k i) (r : cont A) :
verify (s tt) (f empty) r ->
verify (bind_s (dealloc_s x) s) (f (x :-> v)) r.
Proof.
(* Goal: forall _ : @verify' A (@fr A (s tt)) (untag (@heap_of empty i (f empty))) r, @verify' A (@fr A (@bind_s unit A (dealloc_s x) s)) (untag (@heap_of (@pts B x v) i (f (@pts B x v)))) r *)
by rewrite !updateE un0h; apply: bnd_dealloc.
Qed.
End EvalDeallocR.
Definition val_throwR := val_throw.
Definition try_throwR := try_throw.
Definition bnd_throwR := bnd_throw.
Section EvalGhostR.
Variables (A B C : Type) (t : C) (p : C -> Pred heap) (q : C -> post A).
Variables (s1 : A -> spec B) (s2 : exn -> spec B) (i j : heap).
Variables (f : forall k, update k j) (P : Pred heap).
Lemma val_ghR (r : cont A) :
let: s := (fun i => exists x, i \In p x,
fun y i m => forall x, i \In p x -> q x y i m) in
(forall x m, q t (Val x) i m -> def (f m) -> r (Val x) (f m)) ->
(forall e m, q t (Exn e) i m -> def (f m) -> r (Exn e) (f m)) ->
i \In p t ->
verify s (f i) r.
Lemma val_gh1R (r : cont A) :
let: Q := fun y i m => forall x, i \In p x -> q x y i m in
(i \In p t -> P i) ->
(forall x m, q t (Val x) i m -> def (f m) -> r (Val x) (f m)) ->
(forall e m, q t (Exn e) i m -> def (f m) -> r (Exn e) (f m)) ->
i \In p t ->
verify (P, Q) (f i) r.
Lemma try_ghR (r : cont B) :
let: s := (fun i => exists x, i \In p x,
fun y i m => forall x, i \In p x -> q x y i m) in
(forall x m, q t (Val x) i m -> verify (s1 x) (f m) r) ->
(forall e m, q t (Exn e) i m -> verify (s2 e) (f m) r) ->
i \In p t ->
verify (try_s s s1 s2) (f i) r.
Lemma try_gh1R (r : cont B) :
let: Q := fun y i m => forall x, i \In p x -> q x y i m in
(i \In p t -> P i) ->
(forall x m, q t (Val x) i m -> verify (s1 x) (f m) r) ->
(forall e m, q t (Exn e) i m -> verify (s2 e) (f m) r) ->
i \In p t ->
verify (try_s (P, Q) s1 s2) (f i) r.
Lemma bnd_ghR (r : cont B) :
let: s := (fun i => exists x, i \In p x,
fun y i m => forall x, i \In p x -> q x y i m) in
(forall x m, q t (Val x) i m -> verify (s1 x) (f m) r) ->
(forall e m, q t (Exn e) i m -> def (f m) -> r (Exn e) (f m)) ->
i \In p t ->
verify (bind_s s s1) (f i) r.
Lemma bnd_gh1R (r : cont B) :
let: Q := fun y i m => forall x, i \In p x -> q x y i m in
(i \In p t -> P i) ->
(forall x m, q t (Val x) i m -> verify (s1 x) (f m) r) ->
(forall e m, q t (Exn e) i m -> def (f m) -> r (Exn e) (f m)) ->
i \In p t ->
verify (bind_s (P, Q) s1) (f i) r.
End EvalGhostR.
Structure val_form A i r (p : Prop):=
ValForm {val_pivot :> spec A;
_ : p -> verify val_pivot i r}.
Structure bnd_form A B i (s : A -> spec B) r (p : Prop) :=
BndForm {bnd_pivot :> spec A;
_ : p -> verify (bind_s bnd_pivot s) i r}.
Structure try_form A B i (s1 : A -> spec B)
(s2 : exn -> spec B) r (p : Prop) :=
TryForm {try_pivot :> spec A;
_ : p -> verify (try_s try_pivot s1 s2) i r}.
Definition hstep A i (r : cont A) p (e : val_form i r p) : p -> verify e i r :=
let: ValForm _ pf := e in pf.
Definition hstep_bnd A B i (s : A -> spec B) r p (e : bnd_form i s r p)
: p -> verify (bind_s e s) i r
:= let: BndForm _ pf := e in pf.
Canonical Structure
bnd_case_form A B i (s : A -> spec B) r p (e : bnd_form i s r p) :=
ValForm (hstep_bnd e).
Lemma try_case_pf A B i (s1 : A -> spec B) (s2 : exn -> spec B) r p
(e : try_form i s1 s2 r p) :
p -> verify (try_s e s1 s2) i r.
Proof.
(* Goal: forall _ : p, @verify' B (@fr B (@try_s A B (@try_pivot A B i s1 s2 r p e) s1 s2)) i r *)
by case:e=>[?]; apply.
Qed.
Canonical Structure val_ret_form A v i r :=
ValForm (@val_retR A v i r).
Canonical Structure bnd_ret_form A B s v i r :=
BndForm (@bnd_retR A B s v i r).
Canonical Structure try_ret_form A B s1 s2 v i r :=
TryForm (@try_retR A B s1 s2 v i r).
Canonical Structure val_read_form A v x r j f :=
ValForm (@val_readR A v x j f r).
Canonical Structure bnd_read_form A B s v x r j f :=
BndForm (@bnd_readR A B s v x j f r).
Canonical Structure try_read_form A B s1 s2 v x r j f :=
TryForm (@try_readR A B s1 s2 v x j f r).
Canonical Structure val_write_form A B v w x r j f :=
ValForm (@val_writeR A B v w x j f r).
Canonical Structure bnd_write_form A B C s v w x r j f :=
BndForm (@bnd_writeR A B C s v w x j f r).
Canonical Structure try_write_form A B C s1 s2 v w x r j f :=
TryForm (@try_writeR A B C s1 s2 v w x j f r).
Canonical Structure val_alloc_form A v i r :=
ValForm (@val_allocR A v i r).
Canonical Structure bnd_alloc_form A B s v i r :=
BndForm (@bnd_allocR A B s v i r).
Canonical Structure try_alloc_form A B s1 s2 v i r :=
TryForm (@try_allocR A B s1 s2 v i r).
Canonical Structure val_allocb_form A v n i r :=
ValForm (@val_allocbR A v n i r).
Canonical Structure bnd_allocb_form A B s v n i r :=
BndForm (@bnd_allocbR A B s v n i r).
Canonical Structure try_allocb_form A B s1 s2 v n i r :=
TryForm (@try_allocbR A B s1 s2 v n i r).
Canonical Structure val_dealloc_form A v x r j f :=
ValForm (@val_deallocR A v x j f r).
Canonical Structure bnd_dealloc_form A B s v x r j f :=
BndForm (@bnd_deallocR A B s v x j f r).
Canonical Structure try_dealloc_form A B s1 s2 v x r j f :=
TryForm (@try_deallocR A B s1 s2 v x j f r).
Ltac vauto := (do ?econstructor=>//).
Example ex_read x :
verify (bind_s (write_s x 4) (fun _=> read_s _ x))
(x :-> 0) (fun r _ => r = Val 4).
by do 2! [apply: hstep].
Abort.
Example ex_val_do (s : spec nat) (r : cont nat) (x y : ptr) :
s.1 (y:->2) ->
(forall x' m,
s.2 (Val x') (y:->2) m -> def (x:->1:+m) -> r (Val x') (x:->1:+m)) ->
(forall e m,
s.2 (Exn e) (y:->2) m -> def (x:->1:+m) -> r (Exn e) (x:->1:+m)) ->
verify s (x:->1 :+ y:->2) r.
move=>H1 H2 H3.
apply: (val_doR _ (i:=y:->2))=>//=.
Abort.
Example ex_bwd i x1 x2 (e : unit -> spec nat) q:
verify (e tt) (i :+ (x1 :-> 1 :+ x2 :-> 4)) q ->
verify (bind_s (write_s x2 4) e) (i :+ (x1 :-> 1 :+ x2 :-> 2)) q.
by move=>H; apply: bnd_writeR.
Abort.
Example ex_fwd i x1 x2 (e : unit -> spec nat) q:
verify (e tt) (i :+ (x1 :-> 1 :+ x2 :-> 4)) q ->
verify (bind_s (write_s x2 4) e) (i :+ (x1 :-> 1 :+ x2 :-> 2)) q.
move=>H.
apply: (bnd_writeR (x:=x2) H).
Abort.
|
Require Import syntax.
Require Import utils.
Inductive FV (z : vari) : tm -> Prop :=
| FV_abs :
forall e : tm,
FV z e -> forall v : vari, z <> v -> forall t : ty, FV z (abs v t e)
| FV_fix :
forall e : tm,
FV z e -> forall v : vari, z <> v -> forall t : ty, FV z (Fix v t e)
| FV_appl1 : forall e_1 e_2 : tm, FV z e_1 -> FV z (appl e_1 e_2)
| FV_appl2 : forall e_1 e_2 : tm, FV z e_2 -> FV z (appl e_1 e_2)
| FV_cond1 : forall e_1 e_2 e_3 : tm, FV z e_1 -> FV z (cond e_1 e_2 e_3)
| FV_cond2 : forall e_1 e_2 e_3 : tm, FV z e_2 -> FV z (cond e_1 e_2 e_3)
| FV_cond3 : forall e_1 e_2 e_3 : tm, FV z e_3 -> FV z (cond e_1 e_2 e_3)
| FV_var : forall v : vari, z = v -> FV z (var v)
| FV_succ : forall e : tm, FV z e -> FV z (succ e)
| FV_prd : forall e : tm, FV z e -> FV z (prd e)
| FV_is_o : forall e : tm, FV z e -> FV z (is_o e)
| FV_closa :
forall (v : vari) (t : ty) (e e_1 : tm),
FV z e_1 -> FV z (clos e v t e_1)
| FV_closb :
forall (v : vari) (t : ty) (e e_1 : tm),
FV z e -> z <> v -> FV z (clos e v t e_1).
Goal
forall (x v : vari) (t : ty) (e : tm),
~ FV x (abs v t e) -> x = v \/ ~ FV x e.
intros.
specialize (Xmidvar x v); simple induction 1; intro A.
left; assumption.
right; red in |- *; intro; apply H; apply FV_abs; assumption.
Save notFV_abs.
Goal
forall (v : vari) (e1 e2 : tm), ~ FV v (appl e1 e2) -> ~ FV v e1 /\ ~ FV v e2.
intros v e1 e2 N.
split.
red in |- *; intro; apply N; apply FV_appl1; assumption.
red in |- *; intro; apply N; apply FV_appl2; assumption.
Save notFV_appl.
Goal
forall (v : vari) (e1 e2 e3 : tm),
~ FV v (cond e1 e2 e3) -> ~ FV v e1 /\ ~ FV v e2 /\ ~ FV v e3.
intros v e1 e2 e3 N.
split.
red in |- *; intro; apply N; apply FV_cond1; assumption.
split.
red in |- *; intro; apply N; apply FV_cond2; assumption.
red in |- *; intro; apply N; apply FV_cond3; assumption.
Save notFV_cond.
Goal forall v x : vari, ~ FV v (var x) -> v <> x.
intros v x N.
red in |- *; intro; apply N; apply FV_var; assumption.
Save notFV_var.
Goal forall (v : vari) (e : tm), ~ FV v (succ e) -> ~ FV v e.
intros v e N.
red in |- *; intro; apply N; apply FV_succ; assumption.
Save notFV_succ.
Goal forall (v : vari) (e : tm), ~ FV v (prd e) -> ~ FV v e.
intros v e N.
red in |- *; intro; apply N; apply FV_prd; assumption.
Save notFV_prd.
Goal forall (v : vari) (e : tm), ~ FV v (is_o e) -> ~ FV v e.
intros v e N.
red in |- *; intro; apply N; apply FV_is_o; assumption.
Save notFV_is_o.
Goal
forall (x v : vari) (t : ty) (e : tm),
~ FV x (Fix v t e) -> x = v \/ ~ FV x e.
intros.
specialize (Xmidvar x v); simple induction 1; intro A.
left; assumption.
right; red in |- *; intro; apply H; apply FV_fix; assumption.
Save notFV_fix.
Goal
forall (x v : vari) (t : ty) (e a : tm),
~ FV x (clos e v t a) -> ~ FV x a /\ (x = v \/ ~ FV x e).
intros.
split.
red in |- *; intro; apply H; apply FV_closa; assumption.
specialize (Xmidvar x v); simple induction 1; intro A.
left; assumption.
right; red in |- *; intro; apply H; apply FV_closb; assumption.
Save notFV_clos.
Definition fv (v : vari) (e : tm) :=
match e return Prop with
| o =>
False
| ttt => False
| fff => False
| abs y s e => FV v e /\ v <> y
| appl e1 e2 => FV v e1 \/ FV v e2
| cond e1 e2 e3 => FV v e1 \/ FV v e2 \/ FV v e3
| var y => v = y
| succ n => FV v n
| prd n => FV v n
| is_o n => FV v n
| Fix y s e => FV v e /\ v <> y
| clos e y s e1 => FV v e1 \/ FV v e /\ v <> y
end.
Goal forall (v : vari) (e : tm), FV v e -> fv v e.
simple induction 1; simpl in |- *; intros.
split; assumption.
split; assumption.
left; assumption.
right; assumption.
left; assumption.
right; left; assumption.
right; right; assumption.
assumption.
assumption.
assumption.
assumption.
left; assumption.
right; split; assumption.
Save FV_fv.
Goal forall v : vari, ~ FV v o.
intro v; red in |- *; intro F.
change (fv v o) in |- *.
apply FV_fv; assumption.
Save inv_FV_o.
Goal forall v : vari, ~ FV v ttt.
intro v; red in |- *; intro F.
change (fv v ttt) in |- *.
apply FV_fv; assumption.
Save inv_FV_ttt.
Goal forall v : vari, ~ FV v fff.
intro v; red in |- *; intro F.
change (fv v fff) in |- *.
apply FV_fv; assumption.
Save inv_FV_fff.
Goal
forall (v x : vari) (t : ty) (e : tm), FV v (abs x t e) -> FV v e /\ v <> x.
intros v x t e F.
change (fv v (abs x t e)) in |- *.
apply FV_fv; assumption.
Save inv_FV_abs.
Goal
forall (v x : vari) (t : ty) (e : tm), FV v (Fix x t e) -> FV v e /\ v <> x.
intros v x t e F.
change (fv v (Fix x t e)) in |- *.
apply FV_fv; assumption.
Save inv_FV_fix.
Goal forall (v : vari) (e1 e2 : tm), FV v (appl e1 e2) -> FV v e1 \/ FV v e2.
intros v e1 e2 F.
change (fv v (appl e1 e2)) in |- *.
apply FV_fv; assumption.
Save inv_FV_appl.
Goal
forall (v : vari) (e1 e2 e3 : tm),
FV v (cond e1 e2 e3) -> FV v e1 \/ FV v e2 \/ FV v e3.
intros v e1 e2 e3 F.
change (fv v (cond e1 e2 e3)) in |- *.
apply FV_fv; assumption.
Save inv_FV_cond.
Goal forall v x : vari, FV v (var x) -> v = x.
intros v x F.
change (fv v (var x)) in |- *.
apply FV_fv; assumption.
Save inv_FV_var.
Goal forall (v : vari) (e : tm), FV v (succ e) -> FV v e.
intros v e F.
change (fv v (succ e)) in |- *.
apply FV_fv; assumption.
Save inv_FV_succ.
Goal forall (v : vari) (e : tm), FV v (prd e) -> FV v e.
intros v e F.
change (fv v (prd e)) in |- *.
apply FV_fv; assumption.
Save inv_FV_prd.
Goal forall (v : vari) (e : tm), FV v (is_o e) -> FV v e.
intros v e F.
change (fv v (is_o e)) in |- *.
apply FV_fv; assumption.
Save inv_FV_is_o.
Goal
forall (v x : vari) (t : ty) (e a : tm),
FV v (clos e x t a) -> FV v a \/ FV v e /\ v <> x.
intros v x t e a F.
change (fv v (clos e x t a)) in |- *.
apply FV_fv; assumption.
Save inv_FV_clos.
|
Require Export GeoCoq.Elements.OriginalProofs.lemma_sameside2.
Require Export GeoCoq.Elements.OriginalProofs.lemma_10_12.
Require Export GeoCoq.Elements.OriginalProofs.proposition_07.
Section Euclid.
Context `{Ax:euclidean_neutral_ruler_compass}.
Lemma lemma_erectedperpendicularunique :
forall A B C E,
Per A B C -> Per A B E -> OS C E A B ->
Out B C E.
Proof.
(* Goal: forall (A B C E : @Point Ax0) (_ : @Per Ax0 A B C) (_ : @Per Ax0 A B E) (_ : @OS Ax0 C E A B), @Out Ax0 B C E *)
intros.
(* Goal: @Out Ax0 B C E *)
let Tf:=fresh in assert (Tf:exists D, (BetS A B D /\ Cong A B D B /\ Cong A C D C /\ neq B C)) by (conclude_def Per );destruct Tf as [D];spliter.
(* Goal: @Out Ax0 B C E *)
assert (neq B E) by (conclude_def Per ).
(* Goal: @Out Ax0 B C E *)
rename_H H;let Tf:=fresh in assert (Tf:exists H, (Out B E H /\ Cong B H B C)) by (conclude lemma_layoff);destruct Tf as [H];spliter.
(* Goal: @Out Ax0 B C E *)
assert (eq B B) by (conclude cn_equalityreflexive).
(* Goal: @Out Ax0 B C E *)
assert (Col A B B) by (conclude_def Col ).
(* Goal: @Out Ax0 B C E *)
assert (OS C H A B) by (conclude lemma_sameside2).
(* Goal: @Out Ax0 B C E *)
assert (Per A B H) by (conclude lemma_8_3).
(* Goal: @Out Ax0 B C E *)
assert (Cong B C B H) by (conclude lemma_congruencesymmetric).
(* Goal: @Out Ax0 B C E *)
assert (Cong A C A H) by (conclude lemma_10_12).
(* Goal: @Out Ax0 B C E *)
assert (Cong C A H A) by (forward_using lemma_congruenceflip).
(* Goal: @Out Ax0 B C E *)
assert (Cong C B H B) by (forward_using lemma_congruenceflip).
(* Goal: @Out Ax0 B C E *)
assert (~ eq A B).
(* Goal: @Out Ax0 B C E *)
(* Goal: not (@eq Ax0 A B) *)
{
(* Goal: not (@eq Ax0 A B) *)
intro.
(* Goal: False *)
assert (Col A B C) by (conclude_def Col ).
(* Goal: False *)
assert (nCol A B C) by (conclude lemma_rightangleNC).
(* Goal: False *)
contradict.
(* BG Goal: @Out Ax0 B C E *)
}
(* Goal: @Out Ax0 B C E *)
assert (eq C H) by (conclude proposition_07).
(* Goal: @Out Ax0 B C E *)
assert (Out B E C) by (conclude cn_equalitysub).
(* Goal: @Out Ax0 B C E *)
assert (Out B C E) by (conclude lemma_ray5).
(* Goal: @Out Ax0 B C E *)
close.
Qed.
End Euclid.
|
Require Export GeoCoq.Elements.OriginalProofs.lemma_extension.
Require Export GeoCoq.Elements.OriginalProofs.lemma_lessthancongruence2.
Section Euclid.
Context `{Ax:euclidean_neutral_ruler_compass}.
Lemma lemma_TTflip2 :
forall A B C D E F G H,
TT A B C D E F G H ->
TT A B C D H G F E.
Proof.
(* Goal: forall (A B C D E F G H : @Point Ax0) (_ : @TT Ax0 A B C D E F G H), @TT Ax0 A B C D H G F E *)
intros.
(* Goal: @TT Ax0 A B C D H G F E *)
let Tf:=fresh in assert (Tf:exists J, (BetS E F J /\ Cong F J G H /\ TG A B C D E J)) by (conclude_def TT );destruct Tf as [J];spliter.
(* Goal: @TT Ax0 A B C D H G F E *)
let Tf:=fresh in assert (Tf:exists K, (BetS A B K /\ Cong B K C D /\ Lt E J A K)) by (conclude_def TG );destruct Tf as [K];spliter.
(* Goal: @TT Ax0 A B C D H G F E *)
assert (neq F J) by (forward_using lemma_betweennotequal).
(* Goal: @TT Ax0 A B C D H G F E *)
assert (neq G H) by (conclude axiom_nocollapse).
(* Goal: @TT Ax0 A B C D H G F E *)
assert (neq H G) by (conclude lemma_inequalitysymmetric).
(* Goal: @TT Ax0 A B C D H G F E *)
assert (neq E F) by (forward_using lemma_betweennotequal).
(* Goal: @TT Ax0 A B C D H G F E *)
assert (neq F E) by (conclude lemma_inequalitysymmetric).
(* Goal: @TT Ax0 A B C D H G F E *)
let Tf:=fresh in assert (Tf:exists L, (BetS H G L /\ Cong G L F E)) by (conclude lemma_extension);destruct Tf as [L];spliter.
(* Goal: @TT Ax0 A B C D H G F E *)
assert (Cong L G E F) by (forward_using lemma_congruenceflip).
(* Goal: @TT Ax0 A B C D H G F E *)
assert (Cong G H F J) by (conclude lemma_congruencesymmetric).
(* Goal: @TT Ax0 A B C D H G F E *)
assert (BetS L G H) by (conclude axiom_betweennesssymmetry).
(* Goal: @TT Ax0 A B C D H G F E *)
assert (Cong L H E J) by (conclude cn_sumofparts).
(* Goal: @TT Ax0 A B C D H G F E *)
assert (Cong H L L H) by (conclude cn_equalityreverse).
(* Goal: @TT Ax0 A B C D H G F E *)
assert (Cong H L E J) by (conclude lemma_congruencetransitive).
(* Goal: @TT Ax0 A B C D H G F E *)
assert (Cong E J H L) by (conclude lemma_congruencesymmetric).
(* Goal: @TT Ax0 A B C D H G F E *)
assert (Lt H L A K) by (conclude lemma_lessthancongruence2).
(* Goal: @TT Ax0 A B C D H G F E *)
assert (TG A B C D H L) by (conclude_def TG ).
(* Goal: @TT Ax0 A B C D H G F E *)
assert (TT A B C D H G F E) by (conclude_def TT ).
(* Goal: @TT Ax0 A B C D H G F E *)
close.
Qed.
End Euclid. |
Require Export GeoCoq.Elements.OriginalProofs.proposition_31.
Require Export GeoCoq.Elements.OriginalProofs.lemma_crossbar2.
Require Export GeoCoq.Elements.OriginalProofs.lemma_supplementinequality.
Require Export GeoCoq.Elements.OriginalProofs.lemma_angletrichotomy2.
Require Export GeoCoq.Elements.OriginalProofs.lemma_supplementsymmetric.
Section Euclid.
Context `{Ax:euclidean_euclidean}.
Lemma proposition_29 :
forall A B C D E G H,
Par A B C D -> BetS A G B -> BetS C H D -> BetS E G H -> TS A G H D ->
CongA A G H G H D /\ CongA E G B G H D /\ RT B G H G H D.
Proof.
(* Goal: forall (A B C D E G H : @Point Ax0) (_ : @Par Ax0 A B C D) (_ : @BetS Ax0 A G B) (_ : @BetS Ax0 C H D) (_ : @BetS Ax0 E G H) (_ : @TS Ax0 A G H D), and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
intros.
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (Col C H D) by (conclude_def Col ).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (neq G H) by (forward_using lemma_betweennotequal).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (neq A B) by (forward_using lemma_betweennotequal).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (neq C D) by (forward_using lemma_betweennotequal).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
let Tf:=fresh in assert (Tf:exists R, (BetS A R D /\ Col G H R /\ nCol G H A)) by (conclude_def TS );destruct Tf as [R];spliter.
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (TS D G H A) by (conclude lemma_oppositesidesymmetric).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (nCol G H D) by (conclude_def TS ).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (nCol D H G) by (forward_using lemma_NCorder).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (Col D H C) by (forward_using lemma_collinearorder).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (eq H H) by (conclude cn_equalityreflexive).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (Col D H H) by (conclude_def Col ).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (neq C H) by (forward_using lemma_betweennotequal).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (nCol C H G) by (conclude lemma_NChelper).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (eq C C) by (conclude cn_equalityreflexive).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (Col C H C) by (conclude_def Col ).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (neq C D) by (forward_using lemma_betweennotequal).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (nCol C D G) by (conclude lemma_NChelper).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
let Tf:=fresh in assert (Tf:exists P Q S, (BetS P G Q /\ CongA Q G H G H C /\ CongA Q G H C H G /\ CongA H G Q C H G /\ CongA P G H G H D /\ CongA P G H D H G /\ CongA H G P D H G /\ Par P Q C D /\ Cong P G H D /\ Cong G Q C H /\ Cong G S S H /\ Cong P S S D /\ Cong C S S Q /\ BetS P S D /\ BetS C S Q /\ BetS G S H)) by (conclude proposition_31);destruct Tf as [P[Q[S]]];spliter.
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (~ Meet A B C D) by (conclude_def Par ).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (eq P P) by (conclude cn_equalityreflexive).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (neq P G) by (forward_using lemma_betweennotequal).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (neq G P) by (conclude lemma_inequalitysymmetric).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (Out G P P) by (conclude lemma_ray4).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (Col G S H) by (conclude_def Col ).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (Col G H S) by (forward_using lemma_collinearorder).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (CongA G H D P G H) by (conclude lemma_equalanglessymmetric).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (nCol P G H) by (conclude lemma_equalanglesNC).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (nCol G H P) by (forward_using lemma_NCorder).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (OS A P G H) by (conclude_def OS ).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (eq H H) by (conclude cn_equalityreflexive).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (neq G H) by (forward_using lemma_betweennotequal).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (Out G H H) by (conclude lemma_ray4).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (~ LtA H G A H G P).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
(* Goal: not (@LtA Ax0 H G A H G P) *)
{
(* Goal: not (@LtA Ax0 H G A H G P) *)
intro.
(* Goal: False *)
let Tf:=fresh in assert (Tf:exists M, (BetS P M H /\ Out G A M)) by (conclude lemma_crossbar2);destruct Tf as [M];spliter.
(* Goal: False *)
assert (Cong G S H S) by (forward_using lemma_congruenceflip).
(* Goal: False *)
assert (Cong S P S D) by (forward_using lemma_congruenceflip).
(* Goal: False *)
let Tf:=fresh in assert (Tf:exists K, (BetS G M K /\ BetS D H K)) by (conclude postulate_Euclid5);destruct Tf as [K];spliter.
(* Goal: False *)
assert (Col G A M) by (conclude lemma_rayimpliescollinear).
(* Goal: False *)
assert (Col G M K) by (conclude_def Col ).
(* Goal: False *)
assert (Col M G A) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col M G K) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq G M) by (conclude lemma_raystrict).
(* Goal: False *)
assert (neq M G) by (conclude lemma_inequalitysymmetric).
(* Goal: False *)
assert (Col G A K) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col A G B) by (conclude_def Col ).
(* Goal: False *)
assert (Col A G K) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col G A B) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col G A K) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq A G) by (forward_using lemma_betweennotequal).
(* Goal: False *)
assert (neq G A) by (conclude lemma_inequalitysymmetric).
(* Goal: False *)
assert (Col A B K) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col H D K) by (conclude_def Col ).
(* Goal: False *)
assert (Col H D C) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq H D) by (forward_using lemma_betweennotequal).
(* Goal: False *)
assert (Col D K C) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col C D K) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Meet A B C D) by (conclude_def Meet ).
(* Goal: False *)
contradict.
(* BG Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
}
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (~ LtA H G P H G A).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
(* Goal: not (@LtA Ax0 H G P H G A) *)
{
(* Goal: not (@LtA Ax0 H G P H G A) *)
intro.
(* Goal: False *)
assert (nCol P G H) by (forward_using lemma_NCorder).
(* Goal: False *)
assert (CongA P G H H G P) by (conclude lemma_ABCequalsCBA).
(* Goal: False *)
assert (LtA P G H H G A) by (conclude lemma_angleorderrespectscongruence2).
(* Goal: False *)
assert (~ Col H G A).
(* Goal: False *)
(* Goal: not (@Col Ax0 H G A) *)
{
(* Goal: not (@Col Ax0 H G A) *)
intro.
(* Goal: False *)
assert (Col G H A) by (forward_using lemma_collinearorder).
(* Goal: False *)
contradict.
(* BG Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
(* BG Goal: False *)
}
(* Goal: False *)
assert (CongA H G A A G H) by (conclude lemma_ABCequalsCBA).
(* Goal: False *)
assert (CongA A G H H G A) by (conclude lemma_equalanglessymmetric).
(* Goal: False *)
assert (LtA P G H A G H) by (conclude lemma_angleorderrespectscongruence).
(* Goal: False *)
assert (eq H H) by (conclude cn_equalityreflexive).
(* Goal: False *)
assert (Out G H H) by (conclude lemma_ray4).
(* Goal: False *)
assert (Supp P G H H Q) by (conclude_def Supp ).
(* Goal: False *)
assert (BetS D H C) by (conclude axiom_betweennesssymmetry).
(* Goal: False *)
assert (eq G G) by (conclude cn_equalityreflexive).
(* Goal: False *)
assert (neq H G) by (conclude lemma_inequalitysymmetric).
(* Goal: False *)
assert (Out H G G) by (conclude lemma_ray4).
(* Goal: False *)
assert (Supp D H G G C) by (conclude_def Supp ).
(* Goal: False *)
assert (CongA G H D D H G) by (conclude lemma_ABCequalsCBA).
(* Goal: False *)
assert (CongA P G H D H G) by (conclude lemma_equalanglestransitive).
(* Goal: False *)
assert (CongA H G Q G H C) by (conclude lemma_supplements).
(* Goal: False *)
assert (Supp A G H H B) by (conclude_def Supp ).
(* Goal: False *)
assert (LtA H G B H G Q) by (conclude lemma_supplementinequality).
(* Goal: False *)
assert (BetS B G A) by (conclude axiom_betweennesssymmetry).
(* Goal: False *)
assert (eq G G) by (conclude cn_equalityreflexive).
(* Goal: False *)
assert (Col G H G) by (conclude_def Col ).
(* Goal: False *)
assert (~ Col G H B).
(* Goal: False *)
(* Goal: not (@Col Ax0 G H B) *)
{
(* Goal: not (@Col Ax0 G H B) *)
intro.
(* Goal: False *)
assert (Col A G B) by (conclude_def Col ).
(* Goal: False *)
assert (Col B G A) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col B G H) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq G B) by (forward_using lemma_betweennotequal).
(* Goal: False *)
assert (neq B G) by (conclude lemma_inequalitysymmetric).
(* Goal: False *)
assert (Col G A H) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col H G A) by (forward_using lemma_collinearorder).
(* Goal: False *)
contradict.
(* BG Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
(* BG Goal: False *)
}
(* Goal: False *)
assert (TS B G H A) by (conclude_def TS ).
(* Goal: False *)
assert (TS A G H B) by (conclude lemma_oppositesidesymmetric).
(* Goal: False *)
assert (OS A P G H) by (conclude_def OS ).
(* Goal: False *)
assert (OS P A G H) by (forward_using lemma_samesidesymmetric).
(* Goal: False *)
assert (TS P G H B) by (conclude lemma_planeseparation).
(* Goal: False *)
let Tf:=fresh in assert (Tf:exists L, (BetS P L B /\ Col G H L /\ nCol G H P)) by (conclude_def TS );destruct Tf as [L];spliter.
(* Goal: False *)
assert (BetS B L P) by (conclude axiom_betweennesssymmetry).
(* Goal: False *)
assert (CongA G H C H G Q) by (conclude lemma_equalanglessymmetric).
(* Goal: False *)
assert (nCol H G Q) by (conclude lemma_equalanglesNC).
(* Goal: False *)
assert (~ Col G H Q).
(* Goal: False *)
(* Goal: not (@Col Ax0 G H Q) *)
{
(* Goal: not (@Col Ax0 G H Q) *)
intro.
(* Goal: False *)
assert (Col H G Q) by (forward_using lemma_collinearorder).
(* Goal: False *)
contradict.
(* BG Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
(* BG Goal: False *)
}
(* Goal: False *)
assert (BetS Q G P) by (conclude axiom_betweennesssymmetry).
(* Goal: False *)
assert (OS B Q G H) by (conclude_def OS ).
(* Goal: False *)
assert (eq Q Q) by (conclude cn_equalityreflexive).
(* Goal: False *)
assert (neq Q G) by (forward_using lemma_betweennotequal).
(* Goal: False *)
assert (neq G Q) by (conclude lemma_inequalitysymmetric).
(* Goal: False *)
assert (Out G Q Q) by (conclude lemma_ray4).
(* Goal: False *)
let Tf:=fresh in assert (Tf:exists M, (BetS Q M H /\ Out G B M)) by (conclude lemma_crossbar2);destruct Tf as [M];spliter.
(* Goal: False *)
assert (Cong G S H S) by (forward_using lemma_congruenceflip).
(* Goal: False *)
assert (BetS Q S C) by (conclude axiom_betweennesssymmetry).
(* Goal: False *)
assert (Cong S Q C S) by (conclude lemma_congruencesymmetric).
(* Goal: False *)
assert (Cong S Q S C) by (forward_using lemma_congruenceflip).
(* Goal: False *)
assert (nCol G H C) by (forward_using lemma_NCorder).
(* Goal: False *)
let Tf:=fresh in assert (Tf:exists K, (BetS G M K /\ BetS C H K)) by (conclude postulate_Euclid5);destruct Tf as [K];spliter.
(* Goal: False *)
assert (Col G B M) by (conclude lemma_rayimpliescollinear).
(* Goal: False *)
assert (Col G M K) by (conclude_def Col ).
(* Goal: False *)
assert (Col M G B) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col M G K) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq G M) by (conclude lemma_raystrict).
(* Goal: False *)
assert (neq M G) by (conclude lemma_inequalitysymmetric).
(* Goal: False *)
assert (Col G B K) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col B G A) by (conclude_def Col ).
(* Goal: False *)
assert (Col B G K) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col G B A) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col G B K) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq B G) by (forward_using lemma_betweennotequal).
(* Goal: False *)
assert (neq G B) by (conclude lemma_inequalitysymmetric).
(* Goal: False *)
assert (Col B A K) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col A B K) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col H C K) by (conclude_def Col ).
(* Goal: False *)
assert (Col H C D) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq H C) by (forward_using lemma_betweennotequal).
(* Goal: False *)
assert (Col C K D) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col C D K) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Meet A B C D) by (conclude_def Meet ).
(* Goal: False *)
contradict.
(* BG Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
}
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (~ Col H G P).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
(* Goal: not (@Col Ax0 H G P) *)
{
(* Goal: not (@Col Ax0 H G P) *)
intro.
(* Goal: False *)
assert (Col G H P) by (forward_using lemma_collinearorder).
(* Goal: False *)
contradict.
(* BG Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
}
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (~ Col H G A).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
(* Goal: not (@Col Ax0 H G A) *)
{
(* Goal: not (@Col Ax0 H G A) *)
intro.
(* Goal: False *)
assert (Col G H A) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (nCol G H A) by (conclude_def TS ).
(* Goal: False *)
contradict.
(* BG Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
}
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (~ ~ CongA H G A H G P).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
(* Goal: not (not (@CongA Ax0 H G A H G P)) *)
{
(* Goal: not (not (@CongA Ax0 H G A H G P)) *)
intro.
(* Goal: False *)
assert (LtA H G A H G P) by (conclude lemma_angletrichotomy2).
(* Goal: False *)
contradict.
(* BG Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
}
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (CongA H G P P G H) by (conclude lemma_ABCequalsCBA).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (CongA H G P G H D) by (conclude lemma_equalanglestransitive).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (CongA G H D D H G) by (conclude lemma_ABCequalsCBA).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (CongA H G P D H G) by (conclude lemma_equalanglestransitive).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (CongA H G A D H G) by (conclude lemma_equalanglestransitive).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (~ Col A G H).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
(* Goal: not (@Col Ax0 A G H) *)
{
(* Goal: not (@Col Ax0 A G H) *)
intro.
(* Goal: False *)
assert (Col G H A) by (forward_using lemma_collinearorder).
(* Goal: False *)
contradict.
(* BG Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
}
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (CongA A G H H G A) by (conclude lemma_ABCequalsCBA).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (CongA A G H D H G) by (conclude lemma_equalanglestransitive).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (nCol D H G) by (conclude lemma_equalanglesNC).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (CongA D H G G H D) by (conclude lemma_ABCequalsCBA).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (CongA A G H G H D) by (conclude lemma_equalanglestransitive).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (BetS H G E) by (conclude axiom_betweennesssymmetry).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (CongA A G H E G B) by (conclude proposition_15a).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (CongA E G B A G H) by (conclude lemma_equalanglessymmetric).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (CongA E G B G H D) by (conclude lemma_equalanglestransitive).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (eq H H) by (conclude cn_equalityreflexive).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (Out G H H) by (conclude lemma_ray4).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (Supp A G H H B) by (conclude_def Supp ).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (~ Col B G H).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
(* Goal: not (@Col Ax0 B G H) *)
{
(* Goal: not (@Col Ax0 B G H) *)
intro.
(* Goal: False *)
assert (Col A G B) by (conclude_def Col ).
(* Goal: False *)
assert (Col B G A) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq G B) by (forward_using lemma_betweennotequal).
(* Goal: False *)
assert (neq B G) by (conclude lemma_inequalitysymmetric).
(* Goal: False *)
assert (Col G H A) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col A G H) by (forward_using lemma_collinearorder).
(* Goal: False *)
contradict.
(* BG Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
}
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (CongA B G H B G H) by (conclude lemma_equalanglesreflexive).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (CongA G H D A G H) by (conclude lemma_equalanglessymmetric).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (CongA A G H H G A) by (conclude lemma_ABCequalsCBA).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (CongA G H D H G A) by (conclude lemma_equalanglestransitive).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (Supp B G H H A) by (conclude lemma_supplementsymmetric).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
assert (RT B G H G H D) by (conclude_def RT ).
(* Goal: and (@CongA Ax0 A G H G H D) (and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D)) *)
close.
Qed.
End Euclid.
|
Set Automatic Coercions Import.
Set Implicit Arguments.
Unset Strict Implicit.
Require Export Z_group_facts.
Section Zup1.
Variable R : RING.
Hint Resolve Z_to_group_nat_eq_pos: algebra.
Hint Resolve Z_to_group_nat_unit: algebra.
Hint Resolve Zl1: algebra.
Hint Resolve Zl2: algebra.
Lemma nat_to_group_mult :
forall n m : nat,
Equal (nat_to_group (ring_unit R) (n * m))
(ring_mult (nat_to_group (ring_unit R) n) (nat_to_group (ring_unit R) m)).
Proof.
(* Goal: forall n m : nat, @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Init.Nat.mul n m)) (@ring_mult R (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) n) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) m)) *)
simple induction n; simpl in |- *.
(* Goal: forall (n : nat) (_ : forall m : nat, @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Init.Nat.mul n m)) (@ring_mult R (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) n) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) m))) (m : nat), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Init.Nat.add m (Init.Nat.mul n m))) (@ring_mult R (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) n) (ring_unit R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) m)) *)
(* Goal: forall m : nat, @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) m)) *)
auto with algebra.
(* Goal: forall (n : nat) (_ : forall m : nat, @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Init.Nat.mul n m)) (@ring_mult R (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) n) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) m))) (m : nat), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Init.Nat.add m (Init.Nat.mul n m))) (@ring_mult R (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) n) (ring_unit R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) m)) *)
intros n0 H' m; try assumption.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Init.Nat.add m (Init.Nat.mul n0 m))) (@ring_mult R (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) n0) (ring_unit R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) m)) *)
apply Trans with (sgroup_law R (nat_to_group (ring_unit R) m) (nat_to_group (ring_unit R) (n0 * m))); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) m) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Init.Nat.mul n0 m))) (@ring_mult R (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) n0) (ring_unit R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) m)) *)
apply Trans with (sgroup_law R (ring_mult (nat_to_group (ring_unit R) n0) (nat_to_group (ring_unit R) m)) (ring_mult (ring_unit R) (nat_to_group (ring_unit R) m))); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) m) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Init.Nat.mul n0 m))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@ring_mult R (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) n0) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) m)) (@ring_mult R (ring_unit R) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) m))) *)
apply Trans with (sgroup_law R (ring_mult (nat_to_group (ring_unit R) n0) (nat_to_group (ring_unit R) m)) (nat_to_group (ring_unit R) m)); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) m) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Init.Nat.mul n0 m))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@ring_mult R (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) n0) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) m)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) m)) *)
apply Trans with (sgroup_law R (nat_to_group (ring_unit R) m) (ring_mult (nat_to_group (ring_unit R) n0) (nat_to_group (ring_unit R) m))); auto with algebra.
Qed.
Hint Resolve nat_to_group_mult: algebra.
Hint Resolve Zl3: algebra.
Definition Z_to_ring : Hom (ZZ:RING) R.
Proof.
(* Goal: Carrier (@Hom RING (cring_ring (idomain_ring ZZ) : Ob RING) R) *)
apply (BUILD_HOM_RING (Ring1:=ZZ:RING) (Ring2:=R) (ff:=Z_to_group (ring_unit R))).
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (@ring_mult (cring_ring (idomain_ring ZZ)) x y)) (@ring_mult R (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) y)) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) *)
(* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) x y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) y)) *)
(* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) y) *)
auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (@ring_mult (cring_ring (idomain_ring ZZ)) x y)) (@ring_mult R (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) y)) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) *)
(* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) x y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) y)) *)
auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (@ring_mult (cring_ring (idomain_ring ZZ)) x y)) (@ring_mult R (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) y)) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) *)
auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (@ring_mult (cring_ring (idomain_ring ZZ)) x y)) (@ring_mult R (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) y)) *)
simpl in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: forall x y : Z, @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_fun (abelian_group_group (ring_group R)) (ring_unit R) (@ring_mult Zr_aux x y)) (@ring_mult R (@Z_to_group_fun (abelian_group_group (ring_group R)) (ring_unit R) x) (@Z_to_group_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
intros x y; try assumption.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_fun (abelian_group_group (ring_group R)) (ring_unit R) (@ring_mult Zr_aux x y)) (@ring_mult R (@Z_to_group_fun (abelian_group_group (ring_group R)) (ring_unit R) x) (@Z_to_group_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
apply Trans with (Z_to_group_nat_fun (ring_unit R) (ring_mult (x:ZZ) y)); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (@ring_mult (cring_ring (idomain_ring ZZ)) x y)) (@ring_mult R (@Z_to_group_fun (abelian_group_group (ring_group R)) (ring_unit R) x) (@Z_to_group_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
apply Trans with (ring_mult (Z_to_group_nat_fun (ring_unit R) x) (Z_to_group_nat_fun (ring_unit R) y)); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (@ring_mult (cring_ring (idomain_ring ZZ)) x y)) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) x) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
elim x; simpl in |- *; unfold ring_mult at 1 in |- *; simpl in |- *; intros.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) match y with | Z0 => Z0 | Zpos y' => Zneg (Pos.mul p y') | Zneg y' => Zpos (Pos.mul p y') end) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) match y with | Z0 => Z0 | Zpos y' => Zpos (Pos.mul p y') | Zneg y' => Zneg (Pos.mul p y') end) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) Z0) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) Z0) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
apply Trans with (ring_mult (monoid_unit R) (Z_to_group_nat_fun (ring_unit R) y)); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) match y with | Z0 => Z0 | Zpos y' => Zneg (Pos.mul p y') | Zneg y' => Zpos (Pos.mul p y') end) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) match y with | Z0 => Z0 | Zpos y' => Zpos (Pos.mul p y') | Zneg y' => Zneg (Pos.mul p y') end) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) Z0) (@ring_mult R (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
apply Trans with (monoid_unit R); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) match y with | Z0 => Z0 | Zpos y' => Zneg (Pos.mul p y') | Zneg y' => Zpos (Pos.mul p y') end) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) match y with | Z0 => Z0 | Zpos y' => Zpos (Pos.mul p y') | Zneg y' => Zneg (Pos.mul p y') end) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
elim y; simpl in |- *; intros.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) match y with | Z0 => Z0 | Zpos y' => Zneg (Pos.mul p y') | Zneg y' => Zpos (Pos.mul p y') end) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg (Pos.mul p p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p0))) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos (Pos.mul p p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p0))) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) Z0) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) Z0)) *)
apply Trans with (monoid_unit R); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) match y with | Z0 => Z0 | Zpos y' => Zneg (Pos.mul p y') | Zneg y' => Zpos (Pos.mul p y') end) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg (Pos.mul p p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p0))) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos (Pos.mul p p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p0))) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) Z0)) *)
apply Trans with (ring_mult (Z_to_group_nat_fun (ring_unit R) (Zpos p)) (monoid_unit R)); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) match y with | Z0 => Z0 | Zpos y' => Zneg (Pos.mul p y') | Zneg y' => Zpos (Pos.mul p y') end) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg (Pos.mul p p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p0))) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos (Pos.mul p p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p0))) *)
apply Trans with (nat_to_group (ring_unit R) (nat_of_P (pos_abs (ax3 ((fun (x : positive) (_ : positive -> positive) (y : positive) => (x * y)%positive) p (fun y : positive => y) p0))))); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) match y with | Z0 => Z0 | Zpos y' => Zneg (Pos.mul p y') | Zneg y' => Zpos (Pos.mul p y') end) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg (Pos.mul p p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p0))) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat (@pos_abs (Zpos (Pos.mul p p0)) (ax3 (Pos.mul p p0))))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p0))) *)
simpl in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) match y with | Z0 => Z0 | Zpos y' => Zneg (Pos.mul p y') | Zneg y' => Zpos (Pos.mul p y') end) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg (Pos.mul p p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p0))) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat (Pos.mul p p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p0))) *)
rewrite (fun (x y : positive) (_ : positive -> positive) => nat_of_P_mult_morphism x y).
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) match y with | Z0 => Z0 | Zpos y' => Zneg (Pos.mul p y') | Zneg y' => Zpos (Pos.mul p y') end) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg (Pos.mul p p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p0))) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Init.Nat.mul (Pos.to_nat p) (Pos.to_nat p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p0))) *)
apply Trans with (ring_mult (nat_to_group (ring_unit R) (nat_of_P (pos_abs (ax3 p)))) (nat_to_group (ring_unit R) (nat_of_P (pos_abs (ax3 p0))))); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) match y with | Z0 => Z0 | Zpos y' => Zneg (Pos.mul p y') | Zneg y' => Zpos (Pos.mul p y') end) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg (Pos.mul p p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p0))) *)
apply Trans with (group_inverse R (nat_to_group (ring_unit R) (nat_of_P (pos_abs (ax3 ((fun (x : positive) (_ : positive -> positive) (y : positive) => (x * y)%positive) p (fun y : positive => y) p0)))))); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) match y with | Z0 => Z0 | Zpos y' => Zneg (Pos.mul p y') | Zneg y' => Zpos (Pos.mul p y') end) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (group_inverse (abelian_group_group (ring_group R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat (@pos_abs (Zpos (Pos.mul p p0)) (ax3 (Pos.mul p p0)))))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p0))) *)
simpl in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) match y with | Z0 => Z0 | Zpos y' => Zneg (Pos.mul p y') | Zneg y' => Zpos (Pos.mul p y') end) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (group_inverse (abelian_group_group (ring_group R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat (Pos.mul p p0)))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p0))) *)
rewrite (fun (x y : positive) (_ : positive -> positive) => nat_of_P_mult_morphism x y).
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) match y with | Z0 => Z0 | Zpos y' => Zneg (Pos.mul p y') | Zneg y' => Zpos (Pos.mul p y') end) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (group_inverse (abelian_group_group (ring_group R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Init.Nat.mul (Pos.to_nat p) (Pos.to_nat p0)))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p0))) *)
apply Trans with (ring_mult (nat_to_group (ring_unit R) (nat_of_P (pos_abs (ax3 p)))) (group_inverse R (nat_to_group (ring_unit R) (nat_of_P (pos_abs (ax3 p0)))))); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) match y with | Z0 => Z0 | Zpos y' => Zneg (Pos.mul p y') | Zneg y' => Zpos (Pos.mul p y') end) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (group_inverse (abelian_group_group (ring_group R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Init.Nat.mul (Pos.to_nat p) (Pos.to_nat p0)))) (@ring_mult R (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat (@pos_abs (Zpos p) (ax3 p)))) (group_inverse (abelian_group_group (ring_group R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat (@pos_abs (Zpos p0) (ax3 p0)))))) *)
simpl in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) match y with | Z0 => Z0 | Zpos y' => Zneg (Pos.mul p y') | Zneg y' => Zpos (Pos.mul p y') end) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (group_inverse (abelian_group_group (ring_group R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Init.Nat.mul (Pos.to_nat p) (Pos.to_nat p0)))) (@ring_mult R (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat p)) (group_inverse (abelian_group_group (ring_group R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat p0)))) *)
apply Trans with (group_inverse R (ring_mult (nat_to_group (ring_unit R) (nat_of_P p)) (nat_to_group (ring_unit R) (nat_of_P p0)))); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) match y with | Z0 => Z0 | Zpos y' => Zneg (Pos.mul p y') | Zneg y' => Zpos (Pos.mul p y') end) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) y)) *)
elim y; simpl in |- *; intros.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos (Pos.mul p p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p0))) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg (Pos.mul p p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p0))) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) Z0) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) Z0)) *)
apply Trans with (monoid_unit R); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos (Pos.mul p p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p0))) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg (Pos.mul p p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p0))) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) Z0)) *)
apply Trans with (ring_mult (Z_to_group_nat_fun (ring_unit R) (Zneg p)) (monoid_unit R)); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos (Pos.mul p p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p0))) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg (Pos.mul p p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p0))) *)
apply Trans with (group_inverse R (nat_to_group (ring_unit R) (nat_of_P (pos_abs (ax3 ((fun (x : positive) (_ : positive -> positive) (y : positive) => (x * y)%positive) p (fun y : positive => y) p0)))))); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos (Pos.mul p p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p0))) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (group_inverse (abelian_group_group (ring_group R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat (@pos_abs (Zpos (Pos.mul p p0)) (ax3 (Pos.mul p p0)))))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p0))) *)
simpl in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos (Pos.mul p p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p0))) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (group_inverse (abelian_group_group (ring_group R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat (Pos.mul p p0)))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p0))) *)
rewrite (fun (x y : positive) (_ : positive -> positive) => nat_of_P_mult_morphism x y).
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos (Pos.mul p p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p0))) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (group_inverse (abelian_group_group (ring_group R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Init.Nat.mul (Pos.to_nat p) (Pos.to_nat p0)))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos p0))) *)
apply Trans with (ring_mult (group_inverse R (nat_to_group (ring_unit R) (nat_of_P (pos_abs (ax3 p))))) (nat_to_group (ring_unit R) (nat_of_P (pos_abs (ax3 p0))))); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos (Pos.mul p p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p0))) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (group_inverse (abelian_group_group (ring_group R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Init.Nat.mul (Pos.to_nat p) (Pos.to_nat p0)))) (@ring_mult R (group_inverse (abelian_group_group (ring_group R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat (@pos_abs (Zpos p) (ax3 p))))) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat (@pos_abs (Zpos p0) (ax3 p0))))) *)
simpl in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos (Pos.mul p p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p0))) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (group_inverse (abelian_group_group (ring_group R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Init.Nat.mul (Pos.to_nat p) (Pos.to_nat p0)))) (@ring_mult R (group_inverse (abelian_group_group (ring_group R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat p))) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat p0))) *)
apply Trans with (group_inverse R (ring_mult (nat_to_group (ring_unit R) (nat_of_P p)) (nat_to_group (ring_unit R) (nat_of_P p0)))); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zpos (Pos.mul p p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p0))) *)
apply Trans with (nat_to_group (ring_unit R) (nat_of_P (pos_abs (ax3 ((fun (x : positive) (_ : positive -> positive) (y : positive) => (x * y)%positive) p (fun y : positive => y) p0))))); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat (@pos_abs (Zpos (Pos.mul p p0)) (ax3 (Pos.mul p p0))))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p0))) *)
simpl in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat (Pos.mul p p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p0))) *)
rewrite (fun (x y : positive) (_ : positive -> positive) => nat_of_P_mult_morphism x y).
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Init.Nat.mul (Pos.to_nat p) (Pos.to_nat p0))) (@ring_mult R (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p)) (@Z_to_group_nat_fun (abelian_group_group (ring_group R)) (ring_unit R) (Zneg p0))) *)
apply Trans with (ring_mult (group_inverse R (nat_to_group (ring_unit R) (nat_of_P (pos_abs (ax3 p))))) (group_inverse R (nat_to_group (ring_unit R) (nat_of_P (pos_abs (ax3 p0)))))); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Init.Nat.mul (Pos.to_nat p) (Pos.to_nat p0))) (@ring_mult R (group_inverse (abelian_group_group (ring_group R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat (@pos_abs (Zpos p) (ax3 p))))) (group_inverse (abelian_group_group (ring_group R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat (@pos_abs (Zpos p0) (ax3 p0)))))) *)
apply Trans with (ring_mult (nat_to_group (ring_unit R) (nat_of_P p)) (nat_to_group (ring_unit R) (nat_of_P p0))); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat p)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat p0))) (@ring_mult R (group_inverse (abelian_group_group (ring_group R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat (@pos_abs (Zpos p) (ax3 p))))) (group_inverse (abelian_group_group (ring_group R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat (@pos_abs (Zpos p0) (ax3 p0)))))) *)
simpl in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat p)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat p0))) (@ring_mult R (group_inverse (abelian_group_group (ring_group R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat p))) (group_inverse (abelian_group_group (ring_group R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat p0)))) *)
apply Trans with (group_inverse R (ring_mult (nat_to_group (ring_unit R) (nat_of_P p)) (group_inverse R (nat_to_group (ring_unit R) (nat_of_P p0))))); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat p)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat p0))) (group_inverse (abelian_group_group (ring_group R)) (@ring_mult R (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat p)) (group_inverse (abelian_group_group (ring_group R)) (@nat_to_group (abelian_group_group (ring_group R)) (ring_unit R) (Pos.to_nat p0))))) *)
apply Trans with (group_inverse R (group_inverse R (ring_mult (nat_to_group (ring_unit R) (nat_of_P p)) (nat_to_group (ring_unit R) (nat_of_P p0))))); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid (abelian_group_group (ring_group R))) (@Z_to_group (abelian_group_group (ring_group R)) (ring_unit R)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *)
simpl in |- *; auto with algebra.
Qed.
End Zup1. |
"\nRequire Import Ensf.\nRequire Import Words.\nRequire Import more_words.\nRequire Import Rat.\nReq(...TRUNCATED) |
"\nRequire Import Ensf.\nRequire Import Words.\nRequire Import more_words.\nRequire Import Rat.\nReq(...TRUNCATED) |
"Require Import Coq.Arith.Div2.\nRequire Import Coq.micromega.Lia.\nRequire Import Coq.NArith.NArith(...TRUNCATED) |
"\nRequire Import Ensf.\nRequire Import Max.\nRequire Import Words.\nRequire Import fonctions.\nRequ(...TRUNCATED) |
End of preview. Expand
in Dataset Viewer.
README.md exists but content is empty.
- Downloads last month
- 35