text
stringlengths
1.3k
3.62M
(* Contribution to the Coq Library V6.3 (July 1999) *) (****************************************************************************) (* The Calculus of Inductive Constructions *) (* *) (* Projet Coq *) (* *) (* INRIA ENS-CNRS *) (* Rocquencourt Lyon *) (* *) (* Coq V5.10 *) (* Nov 25th 1994 *) (* *) (****************************************************************************) (* sur_les_relations.v *) (****************************************************************************) (*****************************************************************************) (* Projet Coq - Calculus of Inductive Constructions V5.8 *) (*****************************************************************************) (* *) (* Meta-theory of the explicit substitution calculus lambda-env *) (* Amokrane Saibi *) (* *) (* September 1993 *) (* *) (*****************************************************************************) (* Generalites sur les relations *) (**************) (* Relations *) (**************) Section Rels. Variable A : Set. (* R* fermeture reflexive-transitive d une relation binaire R *) Inductive explicit_star (R : A -> A -> Prop) : A -> A -> Prop := | star_refl : forall x : A, explicit_star R x x | star_trans1 : forall x y z : A, R x y -> explicit_star R y z -> explicit_star R x z. (* composition de deux relations *) Inductive explicit_comp_rel (R1 R2 : A -> A -> Prop) : A -> A -> Prop := comp_2rel : forall x y z : A, R1 x y -> R2 y z -> explicit_comp_rel R1 R2 x z. (* R+ frmeture transitive de R *) Inductive explicit_rel_plus (R : A -> A -> Prop) : A -> A -> Prop := | relplus_1step : forall x y : A, R x y -> explicit_rel_plus R x y | relplus_trans1 : forall x y z : A, R x y -> explicit_rel_plus R y z -> explicit_rel_plus R x z. End Rels. Hint Resolve star_refl. Hint Resolve relplus_1step. Notation star := (explicit_star _) (only parsing). (* <Warning> : Syntax is discontinued *) Notation comp_rel := (explicit_comp_rel _) (only parsing). (* <Warning> : Syntax is discontinued *) Notation rel_plus := (explicit_rel_plus _) (only parsing). (* <Warning> : Syntax is discontinued *) (**************) (* proprietes *) Section rels_prop. Variable A : Set. Variable R : A -> A -> Prop. (* R confluente *) Definition confluence_en (x : A) := forall y z : A, explicit_star _ R x y -> explicit_star _ R x z -> exists u : A, explicit_star _ R y u /\ explicit_star _ R z u. Definition explicit_confluence := forall x : A, confluence_en x. (* R localement confluente *) Definition local_confluence_en (x : A) := forall y z : A, R x y -> R x z -> exists u : A, explicit_star _ R y u /\ explicit_star _ R z u. Definition explicit_local_confluence := forall x : A, local_confluence_en x. (* R fortement confluente *) Definition strong_confluence_en (x : A) := forall y z : A, R x y -> R x z -> exists u : A, R y u /\ R z u. Definition explicit_strong_confluence := forall x : A, strong_confluence_en x. End rels_prop. Notation confluence := (explicit_confluence _) (only parsing). (* <Warning> : Syntax is discontinued *) Notation local_confluence := (explicit_local_confluence _) (only parsing). (* <Warning> : Syntax is discontinued *) Notation strong_confluence := (explicit_strong_confluence _) (only parsing). (* <Warning> : Syntax is discontinued *) (* inclusion de relations binaires, R1 inclus dans R2: R1 incl R2*) Definition explicit_inclus (A : Set) (R1 R2 : A -> A -> Prop) := forall x y : A, R1 x y -> R2 x y. Notation inclus := (explicit_inclus _) (only parsing). (* <Warning> : Syntax is discontinued *) Section relations_noetherian. Variable U : Set. Variable R : U -> U -> Prop. (* Sets as characteristic predicates over universe U *) Definition a_set := U -> Prop. (* A is a subset of B *) Definition sub (A B : a_set) := forall x : U, A x -> B x. (* The full universe *) Definition universal (A : a_set) := forall x : U, A x. (* Adjoint map *) Definition adjoint (A : a_set) : a_set := fun x : U => sub (R x) A. Definition hereditary (A : a_set) := sub (adjoint A) A. (* i.e (hereditary A) <-> (x:A)(sub (R x) A)->(A x) *) Definition explicit_noetherian := forall A : a_set, hereditary A -> universal A. End relations_noetherian. Notation noetherian := (explicit_noetherian _) (only parsing). (* <Warning> : Syntax is discontinued *) (**********************) (* quelques resultats *) (* sur le Ex *) Goal forall (A : Set) (P Q : A -> Prop), (exists u : A, P u /\ Q u) -> exists u : A, Q u /\ P u. (* Goal: forall (A : Set) (P Q : forall _ : A, Prop) (_ : @ex A (fun u : A => and (P u) (Q u))), @ex A (fun u : A => and (Q u) (P u)) *) simple induction 1; intros u1 H1. (* Goal: @ex A (fun u : A => and (Q u) (P u)) *) elim H1; intros H2 H3. (* Goal: @ex A (fun u : A => and (Q u) (P u)) *) exists u1; split; assumption. Save Ex_PQ. Hint Resolve Ex_PQ. (* sur les constructions de relations *) Lemma star_trans : forall (A : Set) (R : A -> A -> Prop) (x y z : A), explicit_star _ R x y -> explicit_star _ R y z -> explicit_star _ R x z. (* Goal: forall (A : Set) (R : forall (_ : A) (_ : A), Prop) (x y z : A) (_ : explicit_star A R x y) (_ : explicit_star A R y z), explicit_star A R x z *) intros A R x y z H; elim H. (* Goal: forall (x : A) (_ : explicit_star A R x z), explicit_star A R x z *) (* Goal: forall (x y z0 : A) (_ : R x y) (_ : explicit_star A R y z0) (_ : forall _ : explicit_star A R z0 z, explicit_star A R y z) (_ : explicit_star A R z0 z), explicit_star A R x z *) intros x0 H1; assumption. (* Goal: forall (x y z0 : A) (_ : R x y) (_ : explicit_star A R y z0) (_ : forall _ : explicit_star A R z0 z, explicit_star A R y z) (_ : explicit_star A R z0 z), explicit_star A R x z *) intros x0 y0 z0 H1 H2 H3 H4; apply star_trans1 with y0. (* Goal: R x1 y2 *) assumption. (* Goal: explicit_star A R y0 z *) exact (H3 H4). Qed. Goal forall (A : Set) (R : A -> A -> Prop) (x y : A), R x y -> explicit_star _ R x y. (* Goal: forall (A : Set) (R : forall (_ : A) (_ : A), Prop) (x y : A) (_ : R x y), explicit_star A R x y *) intros; apply star_trans1 with y. (* Goal: R x1 y2 *) assumption. (* Goal: explicit_star A R y y *) apply star_refl. Save star_step1. Hint Resolve star_step1. Goal forall (A : Set) (R1 R2 : A -> A -> Prop) (M N : A), explicit_comp_rel _ R1 R2 M N -> exists u : A, R1 M u /\ R2 u N. (* Goal: forall (A : Set) (R1 R2 : forall (_ : A) (_ : A), Prop) (M N : A) (_ : explicit_comp_rel A R1 R2 M N), @ex A (fun u : A => and (R1 M u) (R2 u N)) *) intros A R1 R2 M N H; elim H. (* Goal: R x1 y2 *) intros x y z H1 H2; exists y; split; assumption. Save comp_case. Goal forall (A : Set) (R : A -> A -> Prop) (x y : A), explicit_comp_rel _ R (explicit_star _ R) x y -> explicit_rel_plus _ R x y. (* Goal: forall (A : Set) (R : forall (_ : A) (_ : A), Prop) (x y : A) (_ : explicit_comp_rel A R (explicit_star A R) x y), explicit_rel_plus A R x y *) intros A R x y H; elim H. (* Goal: forall (x y z : A) (_ : R x y) (_ : explicit_star A R y z), explicit_rel_plus A R x z *) intros a b c H1 H2; generalize H1; generalize a. (* Goal: forall (a : A) (_ : R a b), explicit_rel_plus A R a c *) elim H2. (* Goal: R x1 y2 *) intros; apply relplus_1step; assumption. (* Goal: forall (x y z : A) (_ : R x y) (_ : explicit_star A R y z) (_ : forall (a : A) (_ : R a y), explicit_rel_plus A R a z) (a : A) (_ : R a x), explicit_rel_plus A R a z *) intros x0 y0 z H3 H4 H5 a0 H6; apply relplus_trans1 with x0. (* Goal: R x1 y2 *) assumption. (* Goal: R x1 y2 *) apply H5; assumption. Save comp_relplus. Goal forall (A : Set) (R : A -> A -> Prop) (M N : A), explicit_star _ R M N -> M = N \/ (exists u : A, R M u /\ explicit_star _ R u N). (* Goal: forall (A : Set) (R : forall (_ : A) (_ : A), Prop) (M N : A) (_ : explicit_star A R M N), or (@eq A M N) (@ex A (fun u : A => and (R M u) (explicit_star A R u N))) *) intros A R M N H; elim H. (* Goal: forall x : A, or (@eq A x x) (@ex A (fun u : A => and (R x u) (explicit_star A R u x))) *) (* Goal: forall (x y z : A) (_ : R x y) (_ : explicit_star A R y z) (_ : or (@eq A y z) (@ex A (fun u : A => and (R y u) (explicit_star A R u z)))), or (@eq A x z) (@ex A (fun u : A => and (R x u) (explicit_star A R u z))) *) intros x; left; trivial. (* Goal: forall (x y z : A) (_ : R x y) (_ : explicit_star A R y z) (_ : or (@eq A y z) (@ex A (fun u : A => and (R y u) (explicit_star A R u z)))), or (@eq A x z) (@ex A (fun u : A => and (R x u) (explicit_star A R u z))) *) intros x y z H1 H2 H3; right; exists y; split; trivial. Save star_case. Goal forall (A : Set) (R : A -> A -> Prop) (x y z : A), explicit_rel_plus _ R x y -> explicit_rel_plus _ R y z -> explicit_rel_plus _ R x z. (* Goal: forall (A : Set) (R : forall (_ : A) (_ : A), Prop) (x y z : A) (_ : explicit_rel_plus A R x y) (_ : explicit_rel_plus A R y z), explicit_rel_plus A R x z *) simple induction 1. (* Goal: forall (x y : A) (_ : R x y) (_ : explicit_rel_plus A R y z), explicit_rel_plus A R x z *) (* Goal: forall (x y z0 : A) (_ : R x y) (_ : explicit_rel_plus A R y z0) (_ : forall _ : explicit_rel_plus A R z0 z, explicit_rel_plus A R y z) (_ : explicit_rel_plus A R z0 z), explicit_rel_plus A R x z *) intros; apply relplus_trans1 with y0; trivial. (* Goal: forall (x y z0 : A) (_ : R x y) (_ : explicit_rel_plus A R y z0) (_ : forall _ : explicit_rel_plus A R z0 z, explicit_rel_plus A R y z) (_ : explicit_rel_plus A R z0 z), explicit_rel_plus A R x z *) intros; apply relplus_trans1 with y0; auto. Save Rplus_transitive. Goal forall (A : Set) (R : A -> A -> Prop) (x y : A), explicit_rel_plus _ R x y -> explicit_star _ R x y. (* Goal: forall (A : Set) (R : forall (_ : A) (_ : A), Prop) (x y z : A) (_ : explicit_star A R x y) (_ : explicit_rel_plus A R y z), @ex A (fun u : A => and (R x u) (explicit_star A R u z)) *) simple induction 1; intros. (* Goal: forall x : A, explicit_star A S x x *) (* Goal: forall (x y z : A) (_ : R x y) (_ : explicit_star A R y z) (_ : explicit_star A S y z), explicit_star A S x z *) auto. (* Goal: forall x : A, explicit_star A S x x *) (* Goal: forall (x y z : A) (_ : R x y) (_ : explicit_star A R y z) (_ : explicit_star A S y z), explicit_star A S x z *) apply star_trans1 with y0; auto. Save Rplus_Rstar. Hint Resolve Rplus_Rstar. Goal forall (A : Set) (R : A -> A -> Prop) (x y z : A), explicit_star _ R x y -> explicit_rel_plus _ R y z -> exists u : A, R x u /\ explicit_star _ R u z. (* Goal: forall (A : Set) (R : forall (_ : A) (_ : A), Prop) (x y z : A) (_ : explicit_star A R x y) (_ : explicit_rel_plus A R y z), @ex A (fun u : A => and (R x u) (explicit_star A R u z)) *) simple induction 1; intros. (* Goal: @ex A (fun u : A => and (R x0 u) (explicit_star A R u z)) *) (* Goal: @ex A (fun u : A => and (R x0 u) (explicit_star A R u z)) *) elim H0; intros. (* Goal: forall x : A, explicit_star A S x x *) (* Goal: forall (x y z : A) (_ : R x y) (_ : explicit_star A R y z) (_ : explicit_star A S y z), explicit_star A S x z *) exists y0; auto. (* Goal: forall x : A, explicit_star A S x x *) (* Goal: forall (x y z : A) (_ : R x y) (_ : explicit_star A R y z) (_ : explicit_star A S y z), explicit_star A S x z *) exists y0; auto. (* Goal: @ex A (fun u : A => and (R x0 u) (explicit_star A R u z)) *) exists y0; split; trivial. (* Goal: forall x : A, explicit_star A S x x *) (* Goal: forall (x y z : A) (_ : R x y) (_ : explicit_star A R y z) (_ : explicit_star A S y z), explicit_star A S x z *) apply star_trans with z0; auto. Save Rstar_Rplus_R. (* sur les relations noetheriennes *) Goal forall (A : Set) (R : A -> A -> Prop), explicit_noetherian _ R -> forall A1 : a_set A, hereditary A (explicit_rel_plus _ R) A1 -> universal A (adjoint A (explicit_star _ R) A1). unfold explicit_noetherian in |- *; unfold hereditary in |- *; unfold universal in |- *; unfold sub in |- *; intros A R N A1 H x. (* Goal: adjoint A (explicit_star A R) A1 x *) apply (N (adjoint A (explicit_star _ R) A1)). (* Goal: forall (x : A) (_ : adjoint A R (adjoint A (explicit_star A R) A1) x), adjoint A (explicit_star A R) A1 x *) unfold adjoint in |- *; unfold sub in |- *; intros. (* Goal: forall (x : A) (_ : adjoint A R (adjoint A (explicit_star A R) A1) x), adjoint A (explicit_star A R) A1 x *) apply H; unfold adjoint in |- *; unfold sub in |- *; intros. (* Goal: A1 x2 *) elim Rstar_Rplus_R with A R x0 x1 x2; trivial. (* Goal: forall (x : A) (_ : and (R x0 x) (explicit_star A R x x2)), A1 x2 *) intro z; simple induction 1; intros C1 C2; apply H0 with z; trivial. Save noetherian_course_of_values. Lemma plus_preserves_noetherian : forall (A : Set) (R : A -> A -> Prop), explicit_noetherian _ R -> explicit_noetherian _ (explicit_rel_plus _ R). (* Goal: forall (A : Set) (R : forall (_ : A) (_ : A), Prop) (_ : explicit_noetherian A R), explicit_noetherian A (explicit_rel_plus A R) *) generalize noetherian_course_of_values. (* Goal: forall (_ : forall (A : Set) (R : forall (_ : A) (_ : A), Prop) (_ : explicit_noetherian A R) (A1 : a_set A) (_ : hereditary A (explicit_rel_plus A R) A1), universal A (adjoint A (explicit_star A R) A1)) (A : Set) (R : forall (_ : A) (_ : A), Prop) (_ : explicit_noetherian A R), explicit_noetherian A (explicit_rel_plus A R) *) unfold adjoint in |- *; unfold universal in |- *; unfold sub in |- *; intros. unfold explicit_noetherian in |- *; unfold universal in |- *; unfold sub in |- *; intros. (* Goal: A0 x *) apply (H A R H0 A0 H1 x x). (* Goal: forall x : A, explicit_star A S x x *) (* Goal: forall (x y z : A) (_ : R x y) (_ : explicit_star A R y z) (_ : explicit_star A S y z), explicit_star A S x z *) auto. Qed. Lemma noetherian_induction1 : forall (A : Set) (R : A -> A -> Prop), explicit_noetherian _ R -> forall (x : A) (P : A -> Prop), (forall y : A, (forall z : A, R y z -> P z) -> P y) -> P x. unfold explicit_noetherian in |- *; unfold universal in |- *; unfold hereditary in |- *; unfold adjoint in |- *; unfold sub in |- *; unfold a_set in |- *; intros. (* Goal: P x *) pattern x in |- *; apply H; exact H0. Qed. Lemma noetherian_induction : forall (A : Set) (R : A -> A -> Prop), explicit_noetherian _ R -> forall (x : A) (P : A -> Prop), (forall y : A, (forall z : A, explicit_rel_plus _ R y z -> P z) -> P y) -> P x. intros; pattern x in |- *; apply noetherian_induction1 with A (explicit_rel_plus _ R). (* Goal: R x1 y2 *) apply plus_preserves_noetherian; assumption. (* Goal: forall (y : A) (_ : forall (z : A) (_ : explicit_rel_plus A R y z), P z), P y *) exact H0. Qed. Lemma noether_inclus : forall (A : Set) (R R' : A -> A -> Prop), explicit_noetherian _ R -> (forall x y : A, R' x y -> R x y) -> explicit_noetherian _ R'. intros; unfold explicit_noetherian in |- *; unfold universal in |- *; unfold hereditary in |- *; unfold adjoint in |- *; unfold sub in |- *; unfold a_set in |- *; intros. (* Goal: forall x : A, explicit_star A S x x *) (* Goal: forall (x y z : A) (_ : R x y) (_ : explicit_star A R y z) (_ : explicit_star A S y z), explicit_star A S x z *) pattern x in |- *; apply (noetherian_induction1 A R H); auto. Qed. (* sur l'inclusion *) Goal forall (A : Set) (R S : A -> A -> Prop), explicit_inclus _ R (explicit_star _ S) -> explicit_inclus _ (explicit_star _ R) (explicit_star _ S). (* Goal: forall (A : Set) (R : forall (_ : A) (_ : A), Prop) (x y z : A) (_ : explicit_rel_plus A R x y) (_ : explicit_rel_plus A R y z), explicit_rel_plus A R x z *) intros A R S H; red in |- *; simple induction 1. (* Goal: forall x : A, explicit_star A S x x *) (* Goal: forall (x y z : A) (_ : R x y) (_ : explicit_star A R y z) (_ : explicit_star A S y z), explicit_star A S x z *) auto. (* Goal: forall x : A, explicit_star A S x x *) (* Goal: forall (x y z : A) (_ : R x y) (_ : explicit_star A R y z) (_ : explicit_star A S y z), explicit_star A S x z *) intros x0 y0 z H1 H2 H3; apply star_trans with y0; auto. Save inclus_star. Goal forall (A : Set) (R S : A -> A -> Prop), explicit_inclus _ R S -> explicit_inclus _ (explicit_star _ R) (explicit_star _ S). (* Goal: forall (A : Set) (R S : forall (_ : A) (_ : A), Prop) (_ : explicit_inclus A R S), explicit_inclus A (explicit_star A R) (explicit_star A S) *) unfold explicit_inclus in |- *; simple induction 2. (* Goal: forall x : A, explicit_star A S x x *) (* Goal: forall (x y z : A) (_ : R x y) (_ : explicit_star A R y z) (_ : explicit_star A S y z), explicit_star A S x z *) auto. (* Goal: forall (x y z : A) (_ : R x y) (_ : explicit_star A R y z) (_ : explicit_star A S y z), explicit_star A S x z *) intros x0 y0 z H1 H2 H3; apply star_trans1 with y0. (* Goal: S x0 y0 *) (* Goal: explicit_star A S y0 z *) apply (H x0 y0 H1). (* Goal: R x1 y2 *) assumption. Save inclus_reg_star. Hint Resolve inclus_reg_star. Goal forall (A : Set) (R1 R2 S : A -> A -> Prop), explicit_inclus _ R1 S -> explicit_inclus _ R2 S -> (* S transitive *) (forall x y z : A, S x y -> S y z -> S x z) -> explicit_inclus _ (explicit_comp_rel _ R1 R2) S. (* Goal: forall (A : Set) (R : forall (_ : A) (_ : A), Prop) (x y z : A) (_ : explicit_rel_plus A R x y) (_ : explicit_rel_plus A R y z), explicit_rel_plus A R x z *) intros A R1 R2 S H H0 H1; red in |- *; simple induction 1. (* Goal: forall x : A, explicit_star A S x x *) (* Goal: forall (x y z : A) (_ : R x y) (_ : explicit_star A R y z) (_ : explicit_star A S y z), explicit_star A S x z *) intros x0 y0 z H3 H4; apply H1 with y0; auto. Save inclus_comp. Hint Resolve inclus_comp. (* sur la confluence *) Goal forall (A : Set) (R : A -> A -> Prop), explicit_strong_confluence _ R -> explicit_confluence _ R. (* Goal: forall (A : Set) (R : forall (_ : A) (_ : A), Prop) (_ : explicit_strong_confluence A R), explicit_confluence A R *) intros A R H; red in |- *; red in |- *. (* Goal: forall (x y z : A) (_ : explicit_star A R x y) (_ : explicit_star A R x z), @ex A (fun u : A => and (explicit_star A R y u) (explicit_star A R z u)) *) intros x y z H1; generalize z; elim H1. (* Goal: forall x : A, explicit_star A S x x *) (* Goal: forall (x y z : A) (_ : R x y) (_ : explicit_star A R y z) (_ : explicit_star A S y z), explicit_star A S x z *) intros x0 z0 H2; exists z0; split; auto. (* Goal: forall (x y z : A) (_ : R x y) (_ : explicit_star A R y z) (_ : forall (z0 : A) (_ : explicit_star A R y z0), @ex A (fun u : A => and (explicit_star A R z u) (explicit_star A R z0 u))) (z0 : A) (_ : explicit_star A R x z0), @ex A (fun u : A => and (explicit_star A R z u) (explicit_star A R z0 u)) *) intros x0 y0 y1 H2 H3 H4 z0 H5. (* Goal: @ex A (fun u : A => and (explicit_star A R y1 u) (explicit_star A R z0 u)) *) cut (exists u : A, explicit_star _ R y0 u /\ R z0 u). (* Goal: forall _ : @ex A (fun u : A => and (explicit_star A R y0 u) (R z0 u)), @ex A (fun u : A => and (explicit_star A R y1 u) (explicit_star A R z0 u)) *) (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (R z0 u)) *) intro H6; elim H6; intros z1 H7; elim H7; intros H8 H9. (* Goal: @ex A (fun u : A => and (explicit_star A R y1 u) (explicit_star A R z0 u)) *) (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (R z0 u)) *) elim (H4 z1 H8); intros u H10; elim H10; intros H11 H12. (* Goal: @ex A (fun u : A => and (explicit_star A R y1 u) (explicit_star A R z0 u)) *) (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (R z0 u)) *) exists u; split. (* Goal: R x1 y2 *) assumption. (* Goal: R x1 y2 *) apply star_trans1 with z1; assumption. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (R z0 u)) *) generalize H2; generalize y0; elim H5. (* Goal: forall x : A, explicit_star A S x x *) (* Goal: forall (x y z : A) (_ : R x y) (_ : explicit_star A R y z) (_ : explicit_star A S y z), explicit_star A S x z *) intros x1 y2 H6; exists y2; split; auto. (* Goal: forall (x y z : A) (_ : R x y) (_ : explicit_star A R y z) (_ : forall (y0 : A) (_ : R y y0), @ex A (fun u : A => and (explicit_star A R y0 u) (R z u))) (y0 : A) (_ : R x y0), @ex A (fun u : A => and (explicit_star A R y0 u) (R z u)) *) intros x1 y2 z1 H6 H7 H8 y3 H9; elim (H x1 y3 y2). (* Goal: forall (x : A) (_ : and (R y3 x) (R y2 x)), @ex A (fun u : A => and (explicit_star A R y3 u) (R z1 u)) *) (* Goal: R x1 y3 *) (* Goal: R x1 y2 *) intros x2 H10; elim H10; intros H11 H12. (* Goal: @ex A (fun u : A => and (explicit_star A R y3 u) (R z1 u)) *) (* Goal: R x1 y3 *) (* Goal: R x1 y2 *) elim (H8 x2 H12); intros u H13; elim H13; intros H14 H15. exists u; split; [ apply star_trans1 with x2; assumption | assumption ]; trivial. (* Goal: R x1 y2 *) assumption. (* Goal: R x1 y2 *) assumption. Save strong_conf_conf. Goal forall (A : Set) (R S : A -> A -> Prop), explicit_inclus _ R S -> explicit_inclus _ S (explicit_star _ R) -> explicit_confluence _ S -> explicit_confluence _ R. red in |- *; red in |- *; intros A R S H H0 H1 x y z H2 H3. cut (explicit_inclus _ (explicit_star _ R) (explicit_star _ S)). (* Goal: forall x : A, explicit_star A S x x *) (* Goal: forall (x y z : A) (_ : R x y) (_ : explicit_star A R y z) (_ : explicit_star A S y z), explicit_star A S x z *) 2: auto. intro H4; elim (H1 x y z (H4 x y H2) (H4 x z H3)). intros x' H5; elim H5; intros H6 H7. exists x'; split. exact (inclus_star A S R H0 y x' H6). exact (inclus_star A S R H0 z x' H7). Save inclus_conf.
(* Contribution to the Coq Library V6.3 (July 1999) *) (****************************************************************************) (* The Calculus of Inductive Constructions *) (* *) (* Projet Coq *) (* *) (* INRIA ENS-CNRS *) (* Rocquencourt Lyon *) (* *) (* Coq V5.10 *) (* Nov 25th 1994 *) (* *) (****************************************************************************) (* egaliteTS.v *) (****************************************************************************) (*****************************************************************************) (* Projet Coq - Calculus of Inductive Constructions V5.8 *) (*****************************************************************************) (* *) (* Meta-theory of the explicit substitution calculus lambda-env *) (* Amokrane Saibi *) (* *) (* September 1993 *) (* *) (*****************************************************************************) (* egalite dans les termes-sub_explicits (TS) *) Require Import TS. (***********************************************) (* Inegalites dans TS *) (***********************************************) Goal forall (n : nat) (a b : terms), var n <> app a b. (* Goal: forall s t u : sub_explicits, not (@eq (TS ws) (comp s t) (lift u)) *) intros; discriminate. Save diff_var_app. Goal forall (n : nat) (a : terms), var n <> lambda a. (* Goal: forall s t u : sub_explicits, not (@eq (TS ws) (comp s t) (lift u)) *) intros; discriminate. Save diff_var_lambda. Goal forall (n : nat) (a : terms) (s : sub_explicits), var n <> env a s. (* Goal: forall s t u : sub_explicits, not (@eq (TS ws) (comp s t) (lift u)) *) intros; discriminate. Save diff_var_env. Goal forall a b c : terms, app a b <> lambda c. (* Goal: forall s t u : sub_explicits, not (@eq (TS ws) (comp s t) (lift u)) *) intros; discriminate. Save diff_app_lambda. Goal forall (a b c : terms) (s : sub_explicits), app a b <> env c s. (* Goal: forall s t u : sub_explicits, not (@eq (TS ws) (comp s t) (lift u)) *) intros; discriminate. Save diff_app_env. Goal forall (a b : terms) (s : sub_explicits), lambda a <> env b s. (* Goal: forall s t u : sub_explicits, not (@eq (TS ws) (comp s t) (lift u)) *) intros; discriminate. Save diff_lambda_env. Goal id <> shift. (* Goal: forall s t u : sub_explicits, not (@eq (TS ws) (comp s t) (lift u)) *) intros; discriminate. Save diff_id_shift. Goal forall (a : terms) (s : sub_explicits), id <> cons a s. (* Goal: forall s t u : sub_explicits, not (@eq (TS ws) (comp s t) (lift u)) *) intros; discriminate. Save diff_id_cons. Goal forall s t : sub_explicits, id <> comp s t. (* Goal: forall s t u : sub_explicits, not (@eq (TS ws) (comp s t) (lift u)) *) intros; discriminate. Save diff_id_comp. Goal forall s : sub_explicits, id <> lift s. (* Goal: forall s t u : sub_explicits, not (@eq (TS ws) (comp s t) (lift u)) *) intros; discriminate. Save diff_id_lift. Goal forall (a : terms) (s : sub_explicits), shift <> cons a s. (* Goal: forall s t u : sub_explicits, not (@eq (TS ws) (comp s t) (lift u)) *) intros; discriminate. Save diff_shift_cons. Goal forall s t : sub_explicits, shift <> comp s t. (* Goal: forall s t u : sub_explicits, not (@eq (TS ws) (comp s t) (lift u)) *) intros; discriminate. Save diff_shift_comp. Goal forall s : sub_explicits, shift <> lift s. (* Goal: forall s t u : sub_explicits, not (@eq (TS ws) (comp s t) (lift u)) *) intros; discriminate. Save diff_shift_lift. Goal forall (a : terms) (s t u : sub_explicits), cons a s <> comp t u. (* Goal: forall s t u : sub_explicits, not (@eq (TS ws) (comp s t) (lift u)) *) intros; discriminate. Save diff_cons_comp. Goal forall (a : terms) (s t : sub_explicits), cons a s <> lift t. (* Goal: forall s t u : sub_explicits, not (@eq (TS ws) (comp s t) (lift u)) *) intros; discriminate. Save diff_cons_lift. Goal forall s t u : sub_explicits, comp s t <> lift u. (* Goal: forall s t u : sub_explicits, not (@eq (TS ws) (comp s t) (lift u)) *) intros; discriminate. Save diff_comp_lift. (***********************************************) (* Egalite dans TS *) (***********************************************) Goal forall n1 n2 : nat, var n1 = var n2 -> n1 = n2. (* Goal: forall (n1 n2 : nat) (_ : @eq (TS wt) (var n1) (var n2)), @eq nat n1 n2 *) intros n1 n2 H; injection H; trivial. Save proj_var. Goal forall a1 b1 a2 b2 : terms, app a1 b1 = app a2 b2 -> a1 = a2. (* Goal: forall (a1 b1 a2 b2 : terms) (_ : @eq (TS wt) (app a1 b1) (app a2 b2)), @eq terms b1 b2 *) intros a1 b1 a2 b2 H; injection H; trivial. Save proj_app1. Goal forall a1 b1 a2 b2 : terms, app a1 b1 = app a2 b2 -> b1 = b2. (* Goal: forall (a1 b1 a2 b2 : terms) (_ : @eq (TS wt) (app a1 b1) (app a2 b2)), @eq terms b1 b2 *) intros a1 b1 a2 b2 H; injection H; trivial. Save proj_app2. Goal forall a b : terms, lambda a = lambda b -> a = b. (* Goal: forall (a b : terms) (_ : @eq (TS wt) (lambda a) (lambda b)), @eq terms a b *) intros a b H; injection H; trivial. Save proj_lambda. Goal forall (a b : terms) (s t : sub_explicits), env a s = env b t -> a = b. (* Goal: forall (a b : terms) (s t : sub_explicits) (_ : @eq (TS ws) (cons a s) (cons b t)), @eq sub_explicits s t *) intros a b s t H; injection H; trivial. Save proj_env1. Goal forall (a b : terms) (s t : sub_explicits), env a s = env b t -> s = t. (* Goal: forall (a b : terms) (s t : sub_explicits) (_ : @eq (TS ws) (cons a s) (cons b t)), @eq sub_explicits s t *) intros a b s t H; injection H; trivial. Save proj_env2. Goal forall (a b : terms) (s t : sub_explicits), cons a s = cons b t -> a = b. (* Goal: forall (a b : terms) (s t : sub_explicits) (_ : @eq (TS ws) (cons a s) (cons b t)), @eq sub_explicits s t *) intros a b s t H; injection H; trivial. Save proj_cons1. Goal forall (a b : terms) (s t : sub_explicits), cons a s = cons b t -> s = t. (* Goal: forall (a b : terms) (s t : sub_explicits) (_ : @eq (TS ws) (cons a s) (cons b t)), @eq sub_explicits s t *) intros a b s t H; injection H; trivial. Save proj_cons2. Goal forall s1 s2 t1 t2 : sub_explicits, comp s1 t1 = comp s2 t2 -> s1 = s2. (* Goal: forall (s1 s2 t1 t2 : sub_explicits) (_ : @eq (TS ws) (comp s1 t1) (comp s2 t2)), @eq sub_explicits t1 t2 *) intros s1 s2 t1 t2 H; injection H; trivial. Save proj_comp1. Goal forall s1 s2 t1 t2 : sub_explicits, comp s1 t1 = comp s2 t2 -> t1 = t2. (* Goal: forall (s1 s2 t1 t2 : sub_explicits) (_ : @eq (TS ws) (comp s1 t1) (comp s2 t2)), @eq sub_explicits t1 t2 *) intros s1 s2 t1 t2 H; injection H; trivial. Save proj_comp2. Goal forall s t : sub_explicits, lift s = lift t -> s = t. (* Goal: forall (s t : sub_explicits) (_ : @eq (TS ws) (lift s) (lift t)), @eq sub_explicits s t *) intros s t H; injection H; trivial. Save proj_lift.
(* Contribution to the Coq Library V6.3 (July 1999) *) (****************************************************************************) (* The Calculus of Inductive Constructions *) (* *) (* Projet Coq *) (* *) (* INRIA ENS-CNRS *) (* Rocquencourt Lyon *) (* *) (* Coq V5.10 *) (* Nov 25th 1994 *) (* *) (****************************************************************************) (* conf_local_SL.v *) (****************************************************************************) (*****************************************************************************) (* Projet Coq - Calculus of Inductive Constructions V5.8 *) (*****************************************************************************) (* *) (* Meta-theory of the explicit substitution calculus lambda-env *) (* Amokrane Saibi *) (* *) (* September 1993 *) (* *) (*****************************************************************************) (* Confluence locale de sigma-lift *) Require Import TS. Require Import sur_les_relations. Require Import sigma_lift. Require Import determinePC_SL. Require Import resoudPC_SL. Definition e_local1 (b : wsort) (x y : TS b) := forall z : TS b, e_relSL _ x z -> exists u : TS b, e_relSLstar _ y u /\ e_relSLstar _ z u. Notation local1 := (e_local1 _) (only parsing). (* <Warning> : Syntax is discontinued *) (* app *) Goal forall x y : terms, reg_app x y -> e_local1 _ x y. (* Goal: forall (x y : terms) (_ : reg_app x y), e_local1 wt x y *) simple induction 1; red in |- *; intros a b0 s z H0. (* Goal: @ex (TS wt) (fun u : TS wt => and (e_relSLstar wt (app (env a s) (env b0 s)) u) (e_relSLstar wt z u)) *) pattern s, z in |- *; apply case_SL_reg_app with a b0; auto. (* Goal: @ex (TS wt) (fun u : TS wt => and (e_relSLstar wt (app (env a s) (env b0 s)) u) (e_relSLstar wt (app (env a s) (env b0 s)) u)) *) exists (app (env a s) (env b0 s)); auto. Save local_app. Hint Resolve local_app. (* lambda *) Goal forall x y : terms, reg_lambda x y -> e_local1 _ x y. (* Goal: forall (x y : terms) (_ : reg_lambda x y), e_local1 wt x y *) simple induction 1; red in |- *; intros a s z H0. (* Goal: @ex (TS wt) (fun u : TS wt => and (e_relSLstar wt (lambda (env a (lift s))) u) (e_relSLstar wt z u)) *) pattern s, z in |- *; apply case_SL_reg_lambda with a; auto. (* Goal: @ex (TS wt) (fun u : TS wt => and (e_relSLstar wt (lambda (env a (lift s))) u) (e_relSLstar wt (lambda (env a (lift s))) u)) *) exists (lambda (env a (lift s))); auto. Save local_lambda. Hint Resolve local_lambda. (* clos *) Goal forall x y : terms, reg_clos x y -> e_local1 _ x y. (* Goal: forall (x y : sub_explicits) (_ : reg_liftenv x y), e_local1 ws x y *) simple induction 1; red in |- *; intros a s t z H0. (* Goal: @ex (TS wt) (fun u : TS wt => and (e_relSLstar wt (env a (comp s t)) u) (e_relSLstar wt z u)) *) pattern t, z in |- *; apply case_SL_clos with a s; auto. (* Goal: @ex (TS wt) (fun u : TS wt => and (e_relSLstar wt (env a (comp s t)) u) (e_relSLstar wt (env a (comp s t)) u)) *) exists (env a (comp s t)); auto. Save local_clos. Hint Resolve local_clos. (* varshift1 *) Goal forall x y : terms, reg_varshift1 x y -> e_local1 _ x y. (* Goal: forall (x y : terms) (_ : reg_varshift1 x y), e_local1 wt x y *) simple induction 1; red in |- *; intros n z H0. (* Goal: @ex (TS wt) (fun u : TS wt => and (e_relSLstar wt (var (S n)) u) (e_relSLstar wt z u)) *) pattern z in |- *; apply case_SL_varshift1 with n; auto. (* Goal: @ex (TS wt) (fun u : TS wt => and (e_relSLstar wt (var (S n)) u) (e_relSLstar wt (var (S n)) u)) *) exists (var (S n)); auto. Save local_varshift1. Hint Resolve local_varshift1. (* varshift2 *) Goal forall x y : terms, reg_varshift2 x y -> e_local1 _ x y. (* Goal: forall (x y : terms) (_ : reg_rvarlift1 x y), e_local1 wt x y *) simple induction 1; red in |- *; intros n s z H0. (* Goal: @ex (TS wt) (fun u : TS wt => and (e_relSLstar wt (env (var (S n)) s) u) (e_relSLstar wt z u)) *) pattern z in |- *; apply case_SL_varshift2 with n s; auto. (* Goal: @ex (TS wt) (fun u : TS wt => and (e_relSLstar wt (env (var (S n)) s) u) (e_relSLstar wt (env (var (S n)) s) u)) *) exists (env (var (S n)) s); auto. Save local_varshift2. Hint Resolve local_varshift2. (* fvarcons *) Goal forall x y : terms, reg_fvarcons x y -> e_local1 _ x y. (* Goal: forall (x y : terms) (_ : reg_lambda x y), e_local1 wt x y *) simple induction 1; red in |- *; intros a s z H0. pattern z in |- *; apply case_SL_fvarcons with a s; intros. 3: assumption. exists a; auto. apply PC_fvarcons_ctxt_r with s; assumption. Save local_fvarcons. Hint Resolve local_fvarcons. (* fvarlift1 *) Goal forall x y : terms, reg_fvarlift1 x y -> e_local1 _ x y. (* Goal: forall (x y : sub_explicits) (_ : reg_idr x y), e_local1 ws x y *) simple induction 1; red in |- *; intros s z H0. pattern z in |- *; apply case_SL_fvarlift1 with s; intros. 3: assumption. exists (var 0); auto. apply PC_fvarlift1_ctxt_r' with s; assumption. Save local_fvarlift1. Hint Resolve local_fvarlift1. (* fvarlift2 *) Goal forall x y : terms, reg_fvarlift2 x y -> e_local1 _ x y. (* Goal: forall (x y : sub_explicits) (_ : reg_lift1 x y), e_local1 ws x y *) simple induction 1; red in |- *; intros s t z H0. pattern z in |- *; apply case_SL_fvarlift2 with s t; intros. 3: assumption. exists (env (var 0) t); auto. apply PC_fvarlift2_ctxt_r with s; assumption. Save local_fvarlift2. Hint Resolve local_fvarlift2. (* rvarcons *) Goal forall x y : terms, reg_rvarcons x y -> e_local1 _ x y. simple induction 1; red in |- *; intros n a s z H0. pattern z in |- *; apply case_SL_rvarcons with n a s; intros. 3: assumption. exists (env (var n) s); auto. apply PC_rvarcons_ctxt_r with a; assumption. Save local_rvarcons. Hint Resolve local_rvarcons. (* rvarlift1 *) Goal forall x y : terms, reg_rvarlift1 x y -> e_local1 _ x y. (* Goal: forall (x y : terms) (_ : reg_rvarlift1 x y), e_local1 wt x y *) simple induction 1; red in |- *; intros n s z H0. (* Goal: @ex (TS wt) (fun u : TS wt => and (e_relSLstar wt (env (var n) (comp s shift)) u) (e_relSLstar wt z u)) *) pattern z in |- *; apply case_SL_rvarlift1 with n s; auto. (* Goal: @ex (TS wt) (fun u : TS wt => and (e_relSLstar wt (env (var n) (comp s shift)) u) (e_relSLstar wt (env (var n) (comp s shift)) u)) *) exists (env (var n) (comp s shift)); auto. Save local_rvarlift1. Hint Resolve local_rvarlift1. (* rvarlift2 *) Goal forall x y : terms, reg_rvarlift2 x y -> e_local1 _ x y. (* Goal: forall (x y : terms) (_ : reg_rvarlift2 x y), e_local1 wt x y *) simple induction 1; red in |- *; intros n s t z H0. (* Goal: @ex (TS wt) (fun u : TS wt => and (e_relSLstar wt (env (var n) (comp s (comp shift t))) u) (e_relSLstar wt z u)) *) pattern z in |- *; apply case_SL_rvarlift2 with n s t; auto. (* Goal: @ex (TS wt) (fun u : TS wt => and (e_relSLstar wt (env (var n) (comp s (comp shift t))) u) (e_relSLstar wt (env (var n) (comp s (comp shift t))) u)) *) exists (env (var n) (comp s (comp shift t))); auto. Save local_rvarlift2. Hint Resolve local_rvarlift2. (* assenv *) Goal forall x y : sub_explicits, reg_assenv x y -> e_local1 _ x y. (* Goal: forall (x y : sub_explicits) (_ : reg_lift2 x y), e_local1 ws x y *) simple induction 1; red in |- *; intros s t u z H0. (* Goal: @ex (TS ws) (fun u0 : TS ws => and (e_relSLstar ws (comp s (comp t u)) u0) (e_relSLstar ws z u0)) *) pattern u, z in |- *; apply case_SL_assenv with s t; auto. (* Goal: @ex (TS ws) (fun u0 : TS ws => and (e_relSLstar ws (comp s (comp t u)) u0) (e_relSLstar ws (comp s (comp t u)) u0)) *) exists (comp s (comp t u)); auto. Save local_assenv. Hint Resolve local_assenv. (* mapenv *) Goal forall x y : sub_explicits, reg_mapenv x y -> e_local1 _ x y. (* Goal: forall (x y : sub_explicits) (_ : reg_liftenv x y), e_local1 ws x y *) simple induction 1; red in |- *; intros a s t z H0. (* Goal: @ex (TS ws) (fun u : TS ws => and (e_relSLstar ws (cons (env a t) (comp s t)) u) (e_relSLstar ws z u)) *) pattern t, z in |- *; apply case_SL_mapenv with a s; auto. (* Goal: @ex (TS ws) (fun u : TS ws => and (e_relSLstar ws (cons (env a t) (comp s t)) u) (e_relSLstar ws (cons (env a t) (comp s t)) u)) *) exists (cons (env a t) (comp s t)); auto. Save local_mapenv. Hint Resolve local_mapenv. (* shiftcons *) Goal forall x y : sub_explicits, reg_shiftcons x y -> e_local1 _ x y. (* Goal: forall (x y : terms) (_ : reg_lambda x y), e_local1 wt x y *) simple induction 1; red in |- *; intros a s z H0. pattern z in |- *; apply case_SL_shiftcons with a s; intros. 3: assumption. (* Goal: @ex (TS ws) (fun u : TS ws => and (e_relSLstar ws s u) (e_relSLstar ws s u)) *) exists s; auto. apply PC_shiftcons_ctxt_r with a; assumption. Save local_shiftcons. Hint Resolve local_shiftcons. (* shiftlift1 *) Goal forall x y : sub_explicits, reg_shiftlift1 x y -> e_local1 _ x y. (* Goal: forall (x y : sub_explicits) (_ : reg_idr x y), e_local1 ws x y *) simple induction 1; red in |- *; intros s z H0. (* Goal: @ex (TS ws) (fun u : TS ws => and (e_relSLstar ws (comp s shift) u) (e_relSLstar ws z u)) *) pattern z in |- *; apply case_SL_shiflift1 with s; auto. (* Goal: @ex (TS ws) (fun u : TS ws => and (e_relSLstar ws (comp s shift) u) (e_relSLstar ws (comp s shift) u)) *) exists (comp s shift); auto. Save local_shiftlift1. Hint Resolve local_shiftlift1. (* shiftlift2 *) Goal forall x y : sub_explicits, reg_shiftlift2 x y -> e_local1 _ x y. (* Goal: forall (x y : sub_explicits) (_ : reg_lift1 x y), e_local1 ws x y *) simple induction 1; red in |- *; intros s t z H0. (* Goal: @ex (TS ws) (fun u : TS ws => and (e_relSLstar ws (comp s (comp shift t)) u) (e_relSLstar ws z u)) *) pattern z in |- *; apply case_SL_shiflift2 with s t; auto. (* Goal: @ex (TS ws) (fun u : TS ws => and (e_relSLstar ws (comp s (comp shift t)) u) (e_relSLstar ws (comp s (comp shift t)) u)) *) exists (comp s (comp shift t)); auto. Save local_shiftlift2. Hint Resolve local_shiftlift2. (* lift1 *) Goal forall x y : sub_explicits, reg_lift1 x y -> e_local1 _ x y. (* Goal: forall (x y : sub_explicits) (_ : reg_lift1 x y), e_local1 ws x y *) simple induction 1; red in |- *; intros s t z H0. (* Goal: @ex (TS ws) (fun u : TS ws => and (e_relSLstar ws (lift (comp s t)) u) (e_relSLstar ws z u)) *) pattern z in |- *; apply case_SL_lift1 with s t; auto. (* Goal: @ex (TS ws) (fun u : TS ws => and (e_relSLstar ws (lift (comp s t)) u) (e_relSLstar ws (lift (comp s t)) u)) *) exists (lift (comp s t)); auto. Save local_lift1. Hint Resolve local_lift1. (* lift2 *) Goal forall x y : sub_explicits, reg_lift2 x y -> e_local1 _ x y. (* Goal: forall (x y : sub_explicits) (_ : reg_lift2 x y), e_local1 ws x y *) simple induction 1; red in |- *; intros s t u z H0. (* Goal: @ex (TS ws) (fun u0 : TS ws => and (e_relSLstar ws (comp (lift (comp s t)) u) u0) (e_relSLstar ws z u0)) *) pattern z in |- *; apply case_SL_lift2 with s t u; auto. (* Goal: @ex (TS ws) (fun u0 : TS ws => and (e_relSLstar ws (comp (lift (comp s t)) u) u0) (e_relSLstar ws (comp (lift (comp s t)) u) u0)) *) exists (comp (lift (comp s t)) u); auto. Save local_lift2. Hint Resolve local_lift2. (* liftenv *) Goal forall x y : sub_explicits, reg_liftenv x y -> e_local1 _ x y. (* Goal: forall (x y : sub_explicits) (_ : reg_liftenv x y), e_local1 ws x y *) simple induction 1; red in |- *; intros a s t z H0. (* Goal: @ex (TS ws) (fun u : TS ws => and (e_relSLstar ws (cons a (comp s t)) u) (e_relSLstar ws z u)) *) pattern z in |- *; apply case_SL_liftenv with a s t; auto. (* Goal: @ex (TS ws) (fun u : TS ws => and (e_relSLstar ws (cons a (comp s t)) u) (e_relSLstar ws (cons a (comp s t)) u)) *) exists (cons a (comp s t)); auto. Save local_liftenv. Hint Resolve local_liftenv. (* idl *) Goal forall x y : sub_explicits, reg_idl x y -> e_local1 _ x y. (* Goal: forall (x y : sub_explicits) (_ : reg_idr x y), e_local1 ws x y *) simple induction 1; red in |- *; intros s z H0. (* Goal: @ex (TS ws) (fun u : TS ws => and (e_relSLstar ws s u) (e_relSLstar ws z u)) *) pattern s, z in |- *; apply case_SL_idl; auto. (* Goal: @ex (TS ws) (fun u : TS ws => and (e_relSLstar ws s u) (e_relSLstar ws s u)) *) exists s; auto. Save local_idl. Hint Resolve local_idl. (* idr *) Goal forall x y : sub_explicits, reg_idr x y -> e_local1 _ x y. (* Goal: forall (x y : sub_explicits) (_ : reg_idr x y), e_local1 ws x y *) simple induction 1; red in |- *; intros s z H0. (* Goal: @ex (TS ws) (fun u : TS ws => and (e_relSLstar ws s u) (e_relSLstar ws z u)) *) apply Ex_PQ; pattern s, z in |- *; apply case_SL_idr; auto. (* Goal: @ex (TS ws) (fun u : TS ws => and (e_relSLstar ws s u) (e_relSLstar ws s u)) *) exists s; auto. Save local_idr. Hint Resolve local_idr. (* liftid *) Goal forall x y : sub_explicits, reg_liftid x y -> e_local1 _ x y. (* Goal: forall (x y : sub_explicits) (_ : reg_liftid x y), e_local1 ws x y *) simple induction 1; red in |- *; intros z H0. (* Goal: @ex (TS ws) (fun u : TS ws => and (e_relSLstar ws id u) (e_relSLstar ws z u)) *) pattern z in |- *; apply case_SL_liftid; auto. Save local_liftid. Hint Resolve local_liftid. (* id *) Goal forall x y : terms, reg_id x y -> e_local1 _ x y. (* Goal: forall (x y : terms) (_ : reg_id x y), e_local1 wt x y *) simple induction 1; red in |- *; intros a z H0. (* Goal: @ex (TS wt) (fun u : TS wt => and (e_relSLstar wt a u) (e_relSLstar wt z u)) *) apply Ex_PQ; pattern a, z in |- *; apply case_SL_reg_id; auto. (* Goal: @ex (TS wt) (fun u : TS wt => and (e_relSLstar wt a u) (e_relSLstar wt a u)) *) exists a; auto 6. Save local_id. Hint Resolve local_id. (* systeme SL *) Goal forall (b : wsort) (x y : TS b), e_systemSL _ x y -> e_local1 _ x y. (* Goal: forall (b : wsort) (x y : TS b) (_ : e_systemSL b x y), e_local1 b x y *) simple induction 1; auto. Save local_systemSL. Goal forall (b : wsort) (x y : TS b), e_relSL _ x y -> e_local1 _ x y. simple induction 1. (* systemSL *) intros; apply local_systemSL; assumption. (* contexte app gauche *) red in |- *; intros a a' b0 H0 H1 z H2. pattern z in |- *; apply case_SLapp with a b0. 3: assumption. intros a'' H3; elim (H1 a'' H3); intros a_ H4. elim H4; intros H5 H6. exists (app a_ b0); auto. intros b0' H3; exists (app a' b0'); auto. (* contexte app droit *) red in |- *; intros a b0 b0' H0 H1 z H2. pattern z in |- *; apply case_SLapp with a b0. 3: assumption. intros a' H3; exists (app a' b0'); auto. intros b0'' H3; elim (H1 b0'' H3); intros b0_ H4. elim H4; intros H5 H6. exists (app a b0_); auto. (* contexte lambda *) red in |- *; intros a a' H0 H1 z H2. pattern z in |- *; apply case_SLlambda with a. 2: assumption. intros a'' H3; elim (H1 a'' H3); intros a_ H4; elim H4; intros H5 H6. exists (lambda a_); auto. (* contexte env gauche *) red in |- *; intros a a' s H0 H1 z H2. apply Ex_PQ; generalize H0; pattern a, s, z in |- *; apply case_SLenv; auto. intros n H3; elim (case_SLvar n a' H3). intros n s1 H3; elim (case_SLvar n a' H3). intros a1 s1 H3; elim (case_SLvar 0 a' H3). intros s1 H3; elim (case_SLvar 0 a' H3). intros s1 s2 H3; elim (case_SLvar 0 a' H3). intros n a1 s1 H3; elim (case_SLvar (S n) a' H3). intros n s1 H3; elim (case_SLvar (S n) a' H3). intros n s1 s2 H3; elim (case_SLvar (S n) a' H3). intros a'' H3 H4; elim (H1 a'' H3); intros a_ H5; elim H5; intros H6 H7. exists (env a_ s); auto. intros s' H3 H4; exists (env a' s'); auto. (* contexte env droit *) red in |- *; intros a s s' H0 H1 z H2. apply Ex_PQ; generalize H0; pattern a, s, z in |- *; apply case_SLenv; auto. intros n H3; elim (case_SLshift s' H3). intros; apply PC_fvarcons_ctxt_r with s1; assumption. intros; apply PC_fvarlift1_ctxt_r' with s1; assumption. intros; apply PC_fvarlift2_ctxt_r with s1; assumption. intros; apply PC_rvarcons_ctxt_r with a1; assumption. intro H3; elim (case_SLid s' H3). intros a' H3 H4; exists (env a' s'); auto. intros s'' H3 H4; elim (H1 s'' H3); intros s_ H5; elim H5; intros H6 H7. exists (env a s_); auto. (* contexte cons gauche *) red in |- *; intros a a' s H0 H1 z H2. pattern z in |- *; apply case_SLcons with a s; auto. intros a'' H3; elim (H1 a'' H3); intros a_ H4; elim H4; intros H5 H6. exists (cons a_ s); auto. intros s' H3; exists (cons a' s'); auto. (* contexte cons droit *) red in |- *; intros a s s' H0 H1 z H2. pattern z in |- *; apply case_SLcons with a s; auto. intros a' H3; exists (cons a' s'); auto. intros s'' H3; elim (H1 s'' H3); intros s_ H4; elim H4; intros H5 H6. exists (cons a s_); auto. (* contexte comp gauche *) red in |- *; intros s s' t H0 H1 z H2. apply Ex_PQ; generalize H0; pattern s, t, z in |- *; apply case_SLcomp; auto. intros a t1 H3; elim (case_SLshift s' H3). intros t1 H3; elim (case_SLshift s' H3). intros t1 t2 H3; elim (case_SLshift s' H3). intro H3; elim (case_SLid s' H3). intros s'' H3; elim (H1 s'' H3); intros s_ H4; elim H4; intros H5 H6. exists (comp s_ t); auto. intros t' H3; exists (comp s' t'); auto. (* contexte comp droit *) red in |- *; intros s t t' H0 H1 z H2. apply Ex_PQ; generalize H0; pattern s, t, z in |- *; apply case_SLcomp; auto. intros; apply PC_shiftcons_ctxt_r with a; assumption. intro H3; elim (case_SLid t' H3). intros s' H3; exists (comp s' t'); auto. intros t'' H3; elim (H1 t'' H3); intros t_ H4; elim H4; intros H5 H6. exists (comp s t_); auto. (* contexte lift *) red in |- *; intros s s' H0 H1 z H2. generalize H0; pattern s, z in |- *; apply case_SLlift. 3: assumption. intro H3; elim (case_SLid s' H3). intros s'' H3; elim (H1 s'' H3); intros s_ H4; elim H4; intros H5 H6. exists (lift s_); auto. Save local_relSL. (*************************************************************) (* sigma-lift est localement confluente *) (*************************************************************) Theorem conf_local_SL : forall b : wsort, explicit_local_confluence _ (e_relSL b). (* Goal: forall b : wsort, explicit_local_confluence (TS b) (e_relSL b) *) red in |- *; red in |- *; intros b x y z H H0. (* Goal: @ex (TS b) (fun u : TS b => and (explicit_star (TS b) (e_relSL b) y u) (explicit_star (TS b) (e_relSL b) z u)) *) generalize z H0. (* Goal: forall (z : TS b) (_ : e_relSL b x z), @ex (TS b) (fun u : TS b => and (explicit_star (TS b) (e_relSL b) y u) (explicit_star (TS b) (e_relSL b) z u)) *) change (e_local1 _ x y) in |- *; apply local_relSL; assumption. Qed.
(* Contribution to the Coq Library V6.3 (July 1999) *) (****************************************************************************) (* The Calculus of Inductive Constructions *) (* *) (* Projet Coq *) (* *) (* INRIA ENS-CNRS *) (* Rocquencourt Lyon *) (* *) (* Coq V5.10 *) (* Nov 25th 1994 *) (* *) (****************************************************************************) (* Newman.v *) (****************************************************************************) (*****************************************************************************) (* Projet Coq - Calculus of Inductive Constructions V5.8 *) (*****************************************************************************) (* *) (* Meta-theory of the explicit substitution calculus lambda-env *) (* Amokrane Saibi *) (* *) (* September 1993 *) (* *) (*****************************************************************************) (* Theoreme de Newman *) Require Import sur_les_relations. Section NewmanS. Variable A : Set. Variable R : A -> A -> Prop. Hypothesis N : explicit_noetherian _ R. Hypothesis C : explicit_local_confluence _ R. Theorem Newman : explicit_confluence _ R. unfold explicit_confluence in |- *; intro x; pattern x in |- *; apply (noetherian_induction1 A R N). (* Goal: forall (y : A) (_ : forall (z : A) (_ : R y z), confluence_en A R z), confluence_en A R y *) intros y H1; unfold confluence_en in |- *. (* Goal: forall (y0 z : A) (_ : explicit_star A R y y0) (_ : explicit_star A R y z), @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) intros y0 z H2 H3; elim (star_case A R y z H3); intro H4. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) exists y0; split. (* Goal: explicit_star A R z z *) (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) apply star_refl. (* Goal: explicit_star A R z y0 *) (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) rewrite <- H4; assumption. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) elim (star_case A R y y0 H2); intro H5. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) exists z; split. (* Goal: explicit_star A R y0 z *) (* Goal: explicit_star A R z z *) (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) rewrite <- H5; assumption. (* Goal: explicit_star A R z z *) (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) apply star_refl. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) elim H5; intros y0' H6; elim H6; intros H7 H8. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) elim H4; intros z' H9; elim H9; intros H10 H11. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) elim (C y y0' z' H7 H10); intros y' H12. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) elim H12; intros H13 H14. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) elim (H1 y0' H7 y0 y' H8 H13); intros y'' H15. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) elim H15; intros H16 H17. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) elim (H1 z' H10 y'' z (star_trans A R z' y' y'' H14 H17) H11). (* Goal: forall (x : A) (_ : and (explicit_star A R y'' x) (explicit_star A R z x)), @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) intros u H18; elim H18; intros H19 H20. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) exists u; split. (* Goal: explicit_star A R y0 u *) (* Goal: explicit_star A R z u *) apply star_trans with y''; assumption. (* Goal: explicit_star A R z u *) assumption. Qed. End NewmanS.
(* Contribution to the Coq Library V6.3 (July 1999) *) (****************************************************************************) (* The Calculus of Inductive Constructions *) (* *) (* Projet Coq *) (* *) (* INRIA ENS-CNRS *) (* Rocquencourt Lyon *) (* *) (* Coq V5.10 *) (* Nov 25th 1994 *) (* *) (****************************************************************************) (* TS.v *) (****************************************************************************) (*****************************************************************************) (* Projet Coq - Calculus of Inductive Constructions V5.8 *) (*****************************************************************************) (* *) (* Meta-theory of the explicit substitution calculus lambda-env *) (* Amokrane Saibi *) (* *) (* September 1993 *) (* *) (*****************************************************************************) (* Termes et Substitutions *) Inductive wsort : Set := | ws : wsort | wt : wsort. Inductive TS : wsort -> Set := | var : nat -> TS wt | app : TS wt -> TS wt -> TS wt | lambda : TS wt -> TS wt | env : TS wt -> TS ws -> TS wt | id : TS ws | shift : TS ws | cons : TS wt -> TS ws -> TS ws | comp : TS ws -> TS ws -> TS ws | lift : TS ws -> TS ws | meta_X : nat -> TS wt | meta_x : nat -> TS ws. Definition terms := TS wt. Definition sub_explicits := TS ws. (* Principe d induction pour les terms *) Goal (terms -> Prop) -> forall b : wsort, TS b -> Prop. (* Goal: forall (_ : forall _ : sub_explicits, Prop) (b : wsort) (_ : TS b), Prop *) intros P b; elim b. (* Goal: forall _ : TS ws, Prop *) (* Goal: forall _ : TS wt, Prop *) exact (fun x : TS ws => True). (* Goal: forall _ : TS ws, Prop *) (* Goal: forall _ : TS wt, Prop *) exact P. Defined Pterms. Lemma terms_ind : forall P : terms -> Prop, (forall n : nat, P (var n)) -> (forall a b : terms, P a -> P b -> P (app a b)) -> (forall a : terms, P a -> P (lambda a)) -> (forall a : terms, P a -> forall s : sub_explicits, P (env a s)) -> (forall n : nat, P (meta_X n)) -> forall a : terms, P a. (* Goal: forall (P : forall _ : terms, Prop) (_ : forall n : nat, P (var n)) (_ : forall (a b : terms) (_ : P a) (_ : P b), P (app a b)) (_ : forall (a : terms) (_ : P a), P (lambda a)) (_ : forall (a : terms) (_ : P a) (s : sub_explicits), P (env a s)) (_ : forall n : nat, P (meta_X n)) (a : terms), P a *) intros; change (Pterms P wt a) in |- *; elim a; simpl in |- *; auto. Qed. (* Principe d induction pour les sub_explicits *) Goal (sub_explicits -> Prop) -> forall b : wsort, TS b -> Prop. (* Goal: forall (_ : forall _ : sub_explicits, Prop) (b : wsort) (_ : TS b), Prop *) intros P b; elim b. (* Goal: forall _ : TS ws, Prop *) (* Goal: forall _ : TS wt, Prop *) exact P. (* Goal: forall _ : TS wt, Prop *) exact (fun x : TS wt => True). Defined Psubst. Lemma sub_explicits_ind : forall P : sub_explicits -> Prop, P id -> P shift -> (forall s : sub_explicits, P s -> forall a : terms, P (cons a s)) -> (forall s t : sub_explicits, P s -> P t -> P (comp s t)) -> (forall s : sub_explicits, P s -> P (lift s)) -> (forall n : nat, P (meta_x n)) -> forall s : sub_explicits, P s. (* Goal: forall (P : forall _ : sub_explicits, Prop) (_ : P id) (_ : P shift) (_ : forall (s : sub_explicits) (_ : P s) (a : terms), P (cons a s)) (_ : forall (s t : sub_explicits) (_ : P s) (_ : P t), P (comp s t)) (_ : forall (s : sub_explicits) (_ : P s), P (lift s)) (_ : forall n : nat, P (meta_x n)) (s : sub_explicits), P s *) intros; change (Psubst P ws s) in |- *; elim s; simpl in |- *; auto. Qed.
(* Contribution to the Coq Library V6.3 (July 1999) *) (****************************************************************************) (* The Calculus of Inductive Constructions *) (* *) (* Projet Coq *) (* *) (* INRIA ENS-CNRS *) (* Rocquencourt Lyon *) (* *) (* Coq V5.10 *) (* Nov 25th 1994 *) (* *) (****************************************************************************) (* inversionSL.v *) (****************************************************************************) (*****************************************************************************) (* *) (* Meta-theory of the explicit substitution calculus lambda-env *) (* Amokrane Saibi *) (* *) (* September 1993 *) (* *) (*****************************************************************************) (* Inversion de sigma_lift (relSL) *) Require Import sur_les_relations. Require Import TS. Require Import sigma_lift. (***************** Definition e_invSL:=[b:wsort][M:(TS b)][N:(TS b)] (<[b:wsort]Prop>Case M of (* var *) [n:nat] False (* app *) [M1,M2:terms] (<[b:wsort]Prop>Case N of (* var *) [n:nat]False (* app *) [N1,N2:terms] ((relSL M1 N1) /\ (M2=N2)) \/ ((M1=N1) /\ (relSL M2 N2)) (* lam *) [N1:terms]False (* env *) [N1:terms][N2:sub_explicits]False (* id *) False (* | *) False (* . *) [N1:terms][N2:sub_explicits]False (* o *) [N1,N2:sub_explicits]False (* || *) [N1:sub_explicits]False (* X *) [n:nat]False (* x *) [n:nat]False end) (* lam *) [M1:terms] (<[b:wsort]Prop>Case N of (* var *) [n:nat]False (* app *) [N1,N2:terms]False (* lam *) [N1:terms](relSL M1 N1) (* env *) [N1:terms][N2:sub_explicits]False (* id *) False (* | *) False (* . *) [N1:terms][N2:sub_explicits]False (* o *) [N1,N2:sub_explicits]False (* || *) [N1:sub_explicits]False (* X *) [n:nat]False (* x *) [n:nat]False end) (* env *) [M1:terms][M2:sub_explicits] (<[b:wsort]Prop>Case N of (* var *) [n:nat] (Ex( ([m:nat] (M1=(var m)) /\ (n=(S m)) /\ (M2=shift) ))) \/ (Ex( ([s:sub_explicits] (M1=(var O)) /\ (M2=(lift s)) /\ (n=O) ))) \/ (Ex( ([s:sub_explicits] (M1=(var O)) /\ (M2=(cons (var n) s)) ))) \/ ((M1=(var n)) /\ (M2=id)) (* app *) [N1,N2:terms] (Ex( ([a:terms] (Ex( ([b:terms] (M1=(app a b)) /\ (N1=(env a M2)) /\ (N2=(env b M2)) ))) ))) \/ (Ex( ([s:sub_explicits] (M1=(var O)) /\ (M2=(cons (app N1 N2) s)) ))) \/ ((M1=(app N1 N2)) /\ (M2=id)) (* lam *) [N1:terms] (Ex( ([a:terms] (M1=(lambda a)) /\ (N1=(env a (lift M2))) ))) \/ (Ex( ([s:sub_explicits] (M1=(var O)) /\ (M2=(cons (lambda N1) s)) ))) \/ ((M1=(lambda N1)) /\ (M2=id) ) (* env *) [N1:terms][N2:sub_explicits] (Ex( ([s:sub_explicits] (M1=(env N1 s)) /\ (N2=(comp s M2)) ))) \/ (Ex( ([n:nat] (M1=(var n)) /\ (M2=(comp shift N2)) /\ (N1=(var (S n))) ))) \/ (Ex( ([s:sub_explicits] (M1=(var O)) /\ (M2=(cons (env N1 N2) s)) ))) \/ (Ex( ([s:sub_explicits] (M1=(var O)) /\ (M2=(comp (lift s) N2)) /\ (N1=(var O)) ))) \/ (Ex( ([n:nat] (Ex( ([a:terms] (M1=(var (S n))) /\ (M2=(cons a N2)) /\ (N1=(var n)) ))) ))) \/ (Ex( ([n:nat] (Ex( ([s:sub_explicits] (M1=(var (S n))) /\ (M2=(lift s)) /\ (N1=(var n)) /\ (N2=(comp s shift)) ))) ))) \/ (Ex( ([n:nat] (Ex( ([s:sub_explicits] (Ex( ([t:sub_explicits] (M1=(var (S n))) /\ (M2=(comp (lift s) t)) /\ (N1=(var n)) /\ (N2=(comp s (comp shift t))) ))) ))) ))) \/ ((M1=(env N1 N2)) /\ (M2=id)) \/ ((relSL M1 N1) /\ (M2=N2)) \/ ((M1=N1) /\ (relSL M2 N2)) (* id *) False (* | *) False (* . *) [N1:terms][N2:sub_explicits]False (* o *) [N1,N2:sub_explicits]False (* || *) [N1:sub_explicits]False (* X *) [n:nat] (Ex( ([s:sub_explicits] (M1=(var O)) /\ (M2=(cons (meta_X n) s)) ))) \/ ((M1=(meta_X n)) /\ (M2=id)) (* x *) [n:nat]False end) (* id *) False (* | *) False (* . *) [M1:terms][M2:sub_explicits] (<[b:wsort]Prop>Case N of (* var *) [n:nat]False (* app *) [N1,N2:terms]False (* lam *) [N1:terms]False (* env *) [N1:terms][N2:sub_explicits]False (* id *) False (* | *) False (* . *) [N1:terms][N2:sub_explicits] ((relSL M1 N1) /\ (M2=N2)) \/ ((M1=N1) /\ (relSL M2 N2)) (* o *) [N1,N2:sub_explicits]False (* || *) [N1:sub_explicits]False (* X *) [n:nat]False (* x *) [n:nat]False end) (* o *) [M1,M2:sub_explicits] (<[b:wsort]Prop>Case N of (* var *) [n:nat]False (* app *) [N1,N2:terms]False (* lam *) [N1:terms]False (* env *) [N1:terms][N2:sub_explicits]False (* id *) (Ex( ([a:terms] (M1=shift) /\ (M2=(cons a id)) ))) \/ ((M1=id) /\ (M2=id)) (* | *) (Ex( ([a:terms] (M1=shift) /\ (M2=(cons a shift)) ))) \/ ((M1=id) /\ (M2=shift)) \/ ((M1=shift) /\ (M2=id)) (* . *) [N1:terms][N2:sub_explicits] (Ex( ([a:terms](Ex( ([s:sub_explicits] (M1=(cons a s)) /\ (N1=(env a M2)) /\ (N2=(comp s M2)) ))) ))) \/ (Ex( ([a:terms] (M1=shift) /\ (M2=(cons a (cons N1 N2))) ))) \/ (Ex( ([s:sub_explicits] (Ex( ([t:sub_explicits] (M1=(lift s)) /\ (M2=(cons N1 t)) /\ (N2=(comp s t)) ))) ))) \/ ((M1=id) /\ (M2=(cons N1 N2))) \/ ((M1=(cons N1 N2)) /\ (M2=id)) (* o *) [N1,N2:sub_explicits] (Ex( ([t:sub_explicits] (M1=(comp N1 t)) /\ (N2=(comp t M2)) ))) \/ (Ex( ([a:terms] (M1=shift) /\ (M2=(cons a (comp N1 N2))) ))) \/ ((M1=shift) /\ (M2=(lift N1)) /\ (N2=shift)) \/ (Ex( ([t:sub_explicits] (M1=shift) /\ (M2=(comp (lift N1) t)) /\ (N2=(comp shift t)) ))) \/ (Ex( ([s:sub_explicits] (Ex( ([t:sub_explicits] (M1=(lift s)) /\ (M2=(comp (lift t) N2)) /\ (N1=(lift (comp s t))))))))) \/ ((M1=id) /\ (M2=(comp N1 N2))) \/ ((M1=(comp N1 N2)) /\ (M2=id)) \/ ((relSL M1 N1) /\ (M2=N2)) \/ ((M1=N1) /\ (relSL M2 N2)) (* || *) [N1:sub_explicits] (Ex( ([a:terms] (M1=shift) /\ (M2=(cons a (lift N1)))))) \/ (Ex( ([s:sub_explicits] (Ex( ([t:sub_explicits] (M1=(lift s)) /\ (M2=(lift t)) /\ (N1=(comp s t)) ))) ))) \/ ((M1=id) /\ (M2=(lift N1))) \/ ((M1=(lift N1)) /\ (M2=id)) (* X *) [n:nat]False (* x *) [n:nat] (Ex( ([a:terms] (M1=shift) /\ (M2=(cons a (meta_x n)))))) \/ ((M1=id) /\ (M2=(meta_x n))) \/ ((M1=(meta_x n)) /\ (M2=id)) end) (* || *) [M1:sub_explicits] (<[b:wsort]Prop>Case N of (* var *) [n:nat]False (* app *) [N1,N2:terms]False (* lam *) [N1:terms]False (* env *) [N1:terms][N2:sub_explicits]False (* id *) (M1=id) (* | *) False (* . *) [N1:terms][N2:sub_explicits]False (* o *) [N1,N2:sub_explicits]False (* || *) [N1:sub_explicits](relSL M1 N1) (* X *) [n:nat]False (* x *) [n:nat]False end) (* X *) [n:nat]False (* x *) [n:nat]False end). ****************) Definition e_invSL (b : wsort) (M N : TS b) := match M, N with | lift M1, id => M1 = id | lift M1, lift N1 => e_relSL _ M1 N1 | lambda M1, lambda N1 => e_relSL _ M1 N1 | app M1 M2, app N1 N2 => e_relSL _ M1 N1 /\ M2 = N2 \/ M1 = N1 /\ e_relSL _ M2 N2 | env M1 M2, var n as V => (exists m : nat, M1 = var m /\ n = S m /\ M2 = shift) \/ (exists s : sub_explicits, M1 = var 0 /\ M2 = lift s /\ n = 0) \/ (exists s : sub_explicits, M1 = var 0 /\ M2 = cons V s) \/ M1 = V /\ M2 = id | env M1 M2, app N1 N2 as A => (exists a : terms, (exists b : terms, M1 = app a b /\ N1 = env a M2 /\ N2 = env b M2)) \/ (exists s : sub_explicits, M1 = var 0 /\ M2 = cons A s) \/ M1 = A /\ M2 = id | env M1 M2, lambda N1 as L => (exists a : terms, M1 = lambda a /\ N1 = env a (lift M2)) \/ (exists s : sub_explicits, M1 = var 0 /\ M2 = cons L s) \/ M1 = L /\ M2 = id | env M1 M2, env N1 N2 as E => (exists s : sub_explicits, M1 = env N1 s /\ N2 = comp s M2) \/ (exists n : nat, M1 = var n /\ M2 = comp shift N2 /\ N1 = var (S n)) \/ (exists s : sub_explicits, M1 = var 0 /\ M2 = cons E s) \/ (exists s : sub_explicits, M1 = var 0 /\ M2 = comp (lift s) N2 /\ N1 = var 0) \/ (exists n : nat, (exists a : terms, M1 = var (S n) /\ M2 = cons a N2 /\ N1 = var n)) \/ (exists n : nat, (exists s : sub_explicits, M1 = var (S n) /\ M2 = lift s /\ N1 = var n /\ N2 = comp s shift)) \/ (exists n : nat, (exists s : sub_explicits, (exists t : sub_explicits, M1 = var (S n) /\ M2 = comp (lift s) t /\ N1 = var n /\ N2 = comp s (comp shift t)))) \/ M1 = E /\ M2 = id \/ e_relSL _ M1 N1 /\ M2 = N2 \/ M1 = N1 /\ e_relSL _ M2 N2 | env M1 M2, meta_X n => (exists s : sub_explicits, M1 = var 0 /\ M2 = cons (meta_X n) s) \/ M1 = meta_X n /\ M2 = id | cons M1 M2, cons N1 N2 => e_relSL _ M1 N1 /\ M2 = N2 \/ M1 = N1 /\ e_relSL _ M2 N2 | comp M1 M2, id => (exists a : terms, M1 = shift /\ M2 = cons a id) \/ M1 = id /\ M2 = id | comp M1 M2, shift => (exists a : terms, M1 = shift /\ M2 = cons a shift) \/ M1 = id /\ M2 = shift \/ M1 = shift /\ M2 = id | comp M1 M2, cons N1 N2 as C => (exists a : terms, (exists s : sub_explicits, M1 = cons a s /\ N1 = env a M2 /\ N2 = comp s M2)) \/ (exists a : terms, M1 = shift /\ M2 = cons a C) \/ (exists s : sub_explicits, (exists t : sub_explicits, M1 = lift s /\ M2 = cons N1 t /\ N2 = comp s t)) \/ M1 = id /\ M2 = C \/ M1 = C /\ M2 = id | comp M1 M2, comp N1 N2 => (exists t : sub_explicits, M1 = comp N1 t /\ N2 = comp t M2) \/ (exists a : terms, M1 = shift /\ M2 = cons a (comp N1 N2)) \/ M1 = shift /\ M2 = lift N1 /\ N2 = shift \/ (exists t : sub_explicits, M1 = shift /\ M2 = comp (lift N1) t /\ N2 = comp shift t) \/ (exists s : sub_explicits, (exists t : sub_explicits, M1 = lift s /\ M2 = comp (lift t) N2 /\ N1 = lift (comp s t))) \/ M1 = id /\ M2 = comp N1 N2 \/ M1 = comp N1 N2 /\ M2 = id \/ e_relSL _ M1 N1 /\ M2 = N2 \/ M1 = N1 /\ e_relSL _ M2 N2 | comp M1 M2, lift N1 as L => (exists a : terms, M1 = shift /\ M2 = cons a L) \/ (exists s : sub_explicits, (exists t : sub_explicits, M1 = lift s /\ M2 = lift t /\ N1 = comp s t)) \/ M1 = id /\ M2 = L \/ M1 = L /\ M2 = id | comp M1 M2, meta_x n as x => (exists a : terms, M1 = shift /\ M2 = cons a x) \/ M1 = id /\ M2 = x \/ M1 = x /\ M2 = id | _, _ => False end. (***********) Notation invSL := (e_invSL _) (only parsing). (* <Warning> : Syntax is discontinued *) Goal forall (b : wsort) (M N : TS b), e_systemSL _ M N -> e_invSL _ M N. (* Goal: forall (b : wsort) (M N : TS b) (_ : e_systemSL b M N), e_invSL b M N *) simple induction 1; simple induction 1; intros. (* app *) (* Goal: e_invSL wt (env (app a0 b1) s) (app (env a0 s) (env b1 s)) *) (* Goal: e_invSL wt (env (lambda a0) s) (lambda (env a0 (lift s))) *) (* Goal: e_invSL wt (env (env a0 s) t) (env a0 (comp s t)) *) (* Goal: e_invSL wt (env (var n) shift) (var (S n)) *) (* Goal: e_invSL wt (env (var n) (comp shift s)) (env (var (S n)) s) *) (* Goal: e_invSL wt (env (var O) (cons a0 s)) a0 *) (* Goal: e_invSL wt (env (var O) (lift s)) (var O) *) (* Goal: e_invSL wt (env (var O) (comp (lift s) t)) (env (var O) t) *) (* Goal: e_invSL wt (env (var (S n)) (cons a0 s)) (env (var n) s) *) (* Goal: e_invSL wt (env (var (S n)) (lift s)) (env (var n) (comp s shift)) *) (* Goal: e_invSL wt (env (var (S n)) (comp (lift s) t)) (env (var n) (comp s (comp shift t))) *) (* Goal: e_invSL ws (comp (comp s0 t0) u) (comp s0 (comp t0 u)) *) (* Goal: e_invSL ws (comp (cons a s0) t0) (cons (env a t0) (comp s0 t0)) *) (* Goal: e_invSL ws (comp shift (cons a s0)) s0 *) (* Goal: e_invSL ws (comp shift (lift s0)) (comp s0 shift) *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) simpl in |- *; left; exists a0; exists b1; auto. (* lambda *) (* Goal: e_invSL wt (env (lambda a0) s) (lambda (env a0 (lift s))) *) (* Goal: e_invSL wt (env (env a0 s) t) (env a0 (comp s t)) *) (* Goal: e_invSL wt (env (var n) shift) (var (S n)) *) (* Goal: e_invSL wt (env (var n) (comp shift s)) (env (var (S n)) s) *) (* Goal: e_invSL wt (env (var O) (cons a0 s)) a0 *) (* Goal: e_invSL wt (env (var O) (lift s)) (var O) *) (* Goal: e_invSL wt (env (var O) (comp (lift s) t)) (env (var O) t) *) (* Goal: e_invSL wt (env (var (S n)) (cons a0 s)) (env (var n) s) *) (* Goal: e_invSL wt (env (var (S n)) (lift s)) (env (var n) (comp s shift)) *) (* Goal: e_invSL wt (env (var (S n)) (comp (lift s) t)) (env (var n) (comp s (comp shift t))) *) (* Goal: e_invSL ws (comp (comp s0 t0) u) (comp s0 (comp t0 u)) *) (* Goal: e_invSL ws (comp (cons a s0) t0) (cons (env a t0) (comp s0 t0)) *) (* Goal: e_invSL ws (comp shift (cons a s0)) s0 *) (* Goal: e_invSL ws (comp shift (lift s0)) (comp s0 shift) *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) simpl in |- *; left; exists a0; auto. (* clos *) (* Goal: e_invSL wt (env (env a0 s) t) (env a0 (comp s t)) *) (* Goal: e_invSL wt (env (var n) shift) (var (S n)) *) (* Goal: e_invSL wt (env (var n) (comp shift s)) (env (var (S n)) s) *) (* Goal: e_invSL wt (env (var O) (cons a0 s)) a0 *) (* Goal: e_invSL wt (env (var O) (lift s)) (var O) *) (* Goal: e_invSL wt (env (var O) (comp (lift s) t)) (env (var O) t) *) (* Goal: e_invSL wt (env (var (S n)) (cons a0 s)) (env (var n) s) *) (* Goal: e_invSL wt (env (var (S n)) (lift s)) (env (var n) (comp s shift)) *) (* Goal: e_invSL wt (env (var (S n)) (comp (lift s) t)) (env (var n) (comp s (comp shift t))) *) (* Goal: e_invSL ws (comp (comp s0 t0) u) (comp s0 (comp t0 u)) *) (* Goal: e_invSL ws (comp (cons a s0) t0) (cons (env a t0) (comp s0 t0)) *) (* Goal: e_invSL ws (comp shift (cons a s0)) s0 *) (* Goal: e_invSL ws (comp shift (lift s0)) (comp s0 shift) *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) simpl in |- *; left; exists s; auto. (* varshift1 *) (* Goal: e_invSL wt (env (var n) shift) (var (S n)) *) (* Goal: e_invSL wt (env (var n) (comp shift s)) (env (var (S n)) s) *) (* Goal: e_invSL wt (env (var O) (cons a0 s)) a0 *) (* Goal: e_invSL wt (env (var O) (lift s)) (var O) *) (* Goal: e_invSL wt (env (var O) (comp (lift s) t)) (env (var O) t) *) (* Goal: e_invSL wt (env (var (S n)) (cons a0 s)) (env (var n) s) *) (* Goal: e_invSL wt (env (var (S n)) (lift s)) (env (var n) (comp s shift)) *) (* Goal: e_invSL wt (env (var (S n)) (comp (lift s) t)) (env (var n) (comp s (comp shift t))) *) (* Goal: e_invSL ws (comp (comp s0 t0) u) (comp s0 (comp t0 u)) *) (* Goal: e_invSL ws (comp (cons a s0) t0) (cons (env a t0) (comp s0 t0)) *) (* Goal: e_invSL ws (comp shift (cons a s0)) s0 *) (* Goal: e_invSL ws (comp shift (lift s0)) (comp s0 shift) *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) simpl in |- *; left; exists n; auto. (* varshift2 *) (* Goal: e_invSL wt (env (var n) (comp shift s)) (env (var (S n)) s) *) (* Goal: e_invSL wt (env (var O) (cons a0 s)) a0 *) (* Goal: e_invSL wt (env (var O) (lift s)) (var O) *) (* Goal: e_invSL wt (env (var O) (comp (lift s) t)) (env (var O) t) *) (* Goal: e_invSL wt (env (var (S n)) (cons a0 s)) (env (var n) s) *) (* Goal: e_invSL wt (env (var (S n)) (lift s)) (env (var n) (comp s shift)) *) (* Goal: e_invSL wt (env (var (S n)) (comp (lift s) t)) (env (var n) (comp s (comp shift t))) *) (* Goal: e_invSL ws (comp (comp s0 t0) u) (comp s0 (comp t0 u)) *) (* Goal: e_invSL ws (comp (cons a s0) t0) (cons (env a t0) (comp s0 t0)) *) (* Goal: e_invSL ws (comp shift (cons a s0)) s0 *) (* Goal: e_invSL ws (comp shift (lift s0)) (comp s0 shift) *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) simpl in |- *; right; left; exists n; auto. (* fvarcons *) (* Goal: e_invSL wt (env a0 id) a0 *) pattern a0 in |- *; apply terms_ind; intros; simpl in |- *. (* var *) (* Goal: or (@ex sub_explicits (fun s1 : sub_explicits => and (@eq (TS wt) (var O) (env a1 s1)) (@eq (TS ws) s0 (comp s1 (cons (env a1 s0) s))))) (or (@ex nat (fun n : nat => and (@eq (TS wt) (var O) (var n)) (and (@eq (TS ws) (cons (env a1 s0) s) (comp shift s0)) (@eq (TS wt) a1 (var (S n)))))) (or (@ex sub_explicits (fun s1 : sub_explicits => and (@eq (TS wt) (var O) (var O)) (@eq (TS ws) (cons (env a1 s0) s) (cons (env a1 s0) s1)))) (or (@ex sub_explicits (fun s1 : sub_explicits => and (@eq (TS wt) (var O) (var O)) (and (@eq (TS ws) (cons (env a1 s0) s) (comp (lift s1) s0)) (@eq (TS wt) a1 (var O))))) (or (@ex nat (fun n : nat => @ex terms (fun a : terms => and (@eq (TS wt) (var O) (var (S n))) (and (@eq (TS ws) (cons (env a1 s0) s) (cons a s0)) (@eq (TS wt) a1 (var n)))))) (or (@ex nat (fun n : nat => @ex sub_explicits (fun s1 : sub_explicits => and (@eq (TS wt) (var O) (var (S n))) (and (@eq (TS ws) (cons (env a1 s0) s) (lift s1)) (and (@eq (TS wt) a1 (var n)) (@eq (TS ws) s0 (comp s1 shift))))))) (or (@ex nat (fun n : nat => @ex sub_explicits (fun s1 : sub_explicits => @ex sub_explicits (fun t : sub_explicits => and (@eq (TS wt) (var O) (var (S n))) (and (@eq (TS ws) (cons (env a1 s0) s) (comp (lift s1) t)) (and (@eq (TS wt) a1 (var n)) (@eq (TS ws) s0 (comp s1 (comp shift t))))))))) (or (and (@eq (TS wt) (var O) (env a1 s0)) (@eq (TS ws) (cons (env a1 s0) s) id)) (or (and (e_relSL wt (var O) a1) (@eq (TS ws) (cons (env a1 s0) s) s0)) (and (@eq (TS wt) (var O) a1) (e_relSL ws (cons (env a1 s0) s) s0)))))))))) *) (* Goal: or (@ex sub_explicits (fun s0 : sub_explicits => and (@eq (TS wt) (var O) (var O)) (@eq (TS ws) (cons (meta_X n) s) (cons (meta_X n) s0)))) (and (@eq (TS wt) (var O) (meta_X n)) (@eq (TS ws) (cons (meta_X n) s) id)) *) (* Goal: e_invSL wt (env (var O) (lift s)) (var O) *) (* Goal: e_invSL wt (env (var O) (comp (lift s) t)) (env (var O) t) *) (* Goal: e_invSL wt (env (var (S n)) (cons a0 s)) (env (var n) s) *) (* Goal: e_invSL wt (env (var (S n)) (lift s)) (env (var n) (comp s shift)) *) (* Goal: e_invSL wt (env (var (S n)) (comp (lift s) t)) (env (var n) (comp s (comp shift t))) *) (* Goal: e_invSL ws (comp (comp s0 t0) u) (comp s0 (comp t0 u)) *) (* Goal: e_invSL ws (comp (cons a s0) t0) (cons (env a t0) (comp s0 t0)) *) (* Goal: e_invSL ws (comp shift (cons a s0)) s0 *) (* Goal: e_invSL ws (comp shift (lift s0)) (comp s0 shift) *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) do 2 right; left; exists s; auto. (* app *) (* Goal: or (@ex terms (fun a : terms => and (@eq (TS wt) (var O) (lambda a)) (@eq (TS wt) a1 (env a (lift (cons (lambda a1) s)))))) (or (@ex sub_explicits (fun s0 : sub_explicits => and (@eq (TS wt) (var O) (var O)) (@eq (TS ws) (cons (lambda a1) s) (cons (lambda a1) s0)))) (and (@eq (TS wt) (var O) (lambda a1)) (@eq (TS ws) (cons (lambda a1) s) id))) *) (* Goal: or (@ex sub_explicits (fun s1 : sub_explicits => and (@eq (TS wt) (var O) (env a1 s1)) (@eq (TS ws) s0 (comp s1 (cons (env a1 s0) s))))) (or (@ex nat (fun n : nat => and (@eq (TS wt) (var O) (var n)) (and (@eq (TS ws) (cons (env a1 s0) s) (comp shift s0)) (@eq (TS wt) a1 (var (S n)))))) (or (@ex sub_explicits (fun s1 : sub_explicits => and (@eq (TS wt) (var O) (var O)) (@eq (TS ws) (cons (env a1 s0) s) (cons (env a1 s0) s1)))) (or (@ex sub_explicits (fun s1 : sub_explicits => and (@eq (TS wt) (var O) (var O)) (and (@eq (TS ws) (cons (env a1 s0) s) (comp (lift s1) s0)) (@eq (TS wt) a1 (var O))))) (or (@ex nat (fun n : nat => @ex terms (fun a : terms => and (@eq (TS wt) (var O) (var (S n))) (and (@eq (TS ws) (cons (env a1 s0) s) (cons a s0)) (@eq (TS wt) a1 (var n)))))) (or (@ex nat (fun n : nat => @ex sub_explicits (fun s1 : sub_explicits => and (@eq (TS wt) (var O) (var (S n))) (and (@eq (TS ws) (cons (env a1 s0) s) (lift s1)) (and (@eq (TS wt) a1 (var n)) (@eq (TS ws) s0 (comp s1 shift))))))) (or (@ex nat (fun n : nat => @ex sub_explicits (fun s1 : sub_explicits => @ex sub_explicits (fun t : sub_explicits => and (@eq (TS wt) (var O) (var (S n))) (and (@eq (TS ws) (cons (env a1 s0) s) (comp (lift s1) t)) (and (@eq (TS wt) a1 (var n)) (@eq (TS ws) s0 (comp s1 (comp shift t))))))))) (or (and (@eq (TS wt) (var O) (env a1 s0)) (@eq (TS ws) (cons (env a1 s0) s) id)) (or (and (e_relSL wt (var O) a1) (@eq (TS ws) (cons (env a1 s0) s) s0)) (and (@eq (TS wt) (var O) a1) (e_relSL ws (cons (env a1 s0) s) s0)))))))))) *) (* Goal: or (@ex sub_explicits (fun s0 : sub_explicits => and (@eq (TS wt) (var O) (var O)) (@eq (TS ws) (cons (meta_X n) s) (cons (meta_X n) s0)))) (and (@eq (TS wt) (var O) (meta_X n)) (@eq (TS ws) (cons (meta_X n) s) id)) *) (* Goal: e_invSL wt (env (var O) (lift s)) (var O) *) (* Goal: e_invSL wt (env (var O) (comp (lift s) t)) (env (var O) t) *) (* Goal: e_invSL wt (env (var (S n)) (cons a0 s)) (env (var n) s) *) (* Goal: e_invSL wt (env (var (S n)) (lift s)) (env (var n) (comp s shift)) *) (* Goal: e_invSL wt (env (var (S n)) (comp (lift s) t)) (env (var n) (comp s (comp shift t))) *) (* Goal: e_invSL ws (comp (comp s0 t0) u) (comp s0 (comp t0 u)) *) (* Goal: e_invSL ws (comp (cons a s0) t0) (cons (env a t0) (comp s0 t0)) *) (* Goal: e_invSL ws (comp shift (cons a s0)) s0 *) (* Goal: e_invSL ws (comp shift (lift s0)) (comp s0 shift) *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) right; left; exists s; auto. (* lam *) (* Goal: or (@ex terms (fun a : terms => and (@eq (TS wt) (var O) (lambda a)) (@eq (TS wt) a1 (env a (lift (cons (lambda a1) s)))))) (or (@ex sub_explicits (fun s0 : sub_explicits => and (@eq (TS wt) (var O) (var O)) (@eq (TS ws) (cons (lambda a1) s) (cons (lambda a1) s0)))) (and (@eq (TS wt) (var O) (lambda a1)) (@eq (TS ws) (cons (lambda a1) s) id))) *) (* Goal: or (@ex sub_explicits (fun s1 : sub_explicits => and (@eq (TS wt) (var O) (env a1 s1)) (@eq (TS ws) s0 (comp s1 (cons (env a1 s0) s))))) (or (@ex nat (fun n : nat => and (@eq (TS wt) (var O) (var n)) (and (@eq (TS ws) (cons (env a1 s0) s) (comp shift s0)) (@eq (TS wt) a1 (var (S n)))))) (or (@ex sub_explicits (fun s1 : sub_explicits => and (@eq (TS wt) (var O) (var O)) (@eq (TS ws) (cons (env a1 s0) s) (cons (env a1 s0) s1)))) (or (@ex sub_explicits (fun s1 : sub_explicits => and (@eq (TS wt) (var O) (var O)) (and (@eq (TS ws) (cons (env a1 s0) s) (comp (lift s1) s0)) (@eq (TS wt) a1 (var O))))) (or (@ex nat (fun n : nat => @ex terms (fun a : terms => and (@eq (TS wt) (var O) (var (S n))) (and (@eq (TS ws) (cons (env a1 s0) s) (cons a s0)) (@eq (TS wt) a1 (var n)))))) (or (@ex nat (fun n : nat => @ex sub_explicits (fun s1 : sub_explicits => and (@eq (TS wt) (var O) (var (S n))) (and (@eq (TS ws) (cons (env a1 s0) s) (lift s1)) (and (@eq (TS wt) a1 (var n)) (@eq (TS ws) s0 (comp s1 shift))))))) (or (@ex nat (fun n : nat => @ex sub_explicits (fun s1 : sub_explicits => @ex sub_explicits (fun t : sub_explicits => and (@eq (TS wt) (var O) (var (S n))) (and (@eq (TS ws) (cons (env a1 s0) s) (comp (lift s1) t)) (and (@eq (TS wt) a1 (var n)) (@eq (TS ws) s0 (comp s1 (comp shift t))))))))) (or (and (@eq (TS wt) (var O) (env a1 s0)) (@eq (TS ws) (cons (env a1 s0) s) id)) (or (and (e_relSL wt (var O) a1) (@eq (TS ws) (cons (env a1 s0) s) s0)) (and (@eq (TS wt) (var O) a1) (e_relSL ws (cons (env a1 s0) s) s0)))))))))) *) (* Goal: or (@ex sub_explicits (fun s0 : sub_explicits => and (@eq (TS wt) (var O) (var O)) (@eq (TS ws) (cons (meta_X n) s) (cons (meta_X n) s0)))) (and (@eq (TS wt) (var O) (meta_X n)) (@eq (TS ws) (cons (meta_X n) s) id)) *) (* Goal: e_invSL wt (env (var O) (lift s)) (var O) *) (* Goal: e_invSL wt (env (var O) (comp (lift s) t)) (env (var O) t) *) (* Goal: e_invSL wt (env (var (S n)) (cons a0 s)) (env (var n) s) *) (* Goal: e_invSL wt (env (var (S n)) (lift s)) (env (var n) (comp s shift)) *) (* Goal: e_invSL wt (env (var (S n)) (comp (lift s) t)) (env (var n) (comp s (comp shift t))) *) (* Goal: e_invSL ws (comp (comp s0 t0) u) (comp s0 (comp t0 u)) *) (* Goal: e_invSL ws (comp (cons a s0) t0) (cons (env a t0) (comp s0 t0)) *) (* Goal: e_invSL ws (comp shift (cons a s0)) s0 *) (* Goal: e_invSL ws (comp shift (lift s0)) (comp s0 shift) *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) right; left; exists s; auto. (* env *) (* Goal: or (@ex sub_explicits (fun s1 : sub_explicits => and (@eq (TS wt) (var O) (env a1 s1)) (@eq (TS ws) s0 (comp s1 (cons (env a1 s0) s))))) (or (@ex nat (fun n : nat => and (@eq (TS wt) (var O) (var n)) (and (@eq (TS ws) (cons (env a1 s0) s) (comp shift s0)) (@eq (TS wt) a1 (var (S n)))))) (or (@ex sub_explicits (fun s1 : sub_explicits => and (@eq (TS wt) (var O) (var O)) (@eq (TS ws) (cons (env a1 s0) s) (cons (env a1 s0) s1)))) (or (@ex sub_explicits (fun s1 : sub_explicits => and (@eq (TS wt) (var O) (var O)) (and (@eq (TS ws) (cons (env a1 s0) s) (comp (lift s1) s0)) (@eq (TS wt) a1 (var O))))) (or (@ex nat (fun n : nat => @ex terms (fun a : terms => and (@eq (TS wt) (var O) (var (S n))) (and (@eq (TS ws) (cons (env a1 s0) s) (cons a s0)) (@eq (TS wt) a1 (var n)))))) (or (@ex nat (fun n : nat => @ex sub_explicits (fun s1 : sub_explicits => and (@eq (TS wt) (var O) (var (S n))) (and (@eq (TS ws) (cons (env a1 s0) s) (lift s1)) (and (@eq (TS wt) a1 (var n)) (@eq (TS ws) s0 (comp s1 shift))))))) (or (@ex nat (fun n : nat => @ex sub_explicits (fun s1 : sub_explicits => @ex sub_explicits (fun t : sub_explicits => and (@eq (TS wt) (var O) (var (S n))) (and (@eq (TS ws) (cons (env a1 s0) s) (comp (lift s1) t)) (and (@eq (TS wt) a1 (var n)) (@eq (TS ws) s0 (comp s1 (comp shift t))))))))) (or (and (@eq (TS wt) (var O) (env a1 s0)) (@eq (TS ws) (cons (env a1 s0) s) id)) (or (and (e_relSL wt (var O) a1) (@eq (TS ws) (cons (env a1 s0) s) s0)) (and (@eq (TS wt) (var O) a1) (e_relSL ws (cons (env a1 s0) s) s0)))))))))) *) (* Goal: or (@ex sub_explicits (fun s0 : sub_explicits => and (@eq (TS wt) (var O) (var O)) (@eq (TS ws) (cons (meta_X n) s) (cons (meta_X n) s0)))) (and (@eq (TS wt) (var O) (meta_X n)) (@eq (TS ws) (cons (meta_X n) s) id)) *) (* Goal: e_invSL wt (env (var O) (lift s)) (var O) *) (* Goal: e_invSL wt (env (var O) (comp (lift s) t)) (env (var O) t) *) (* Goal: e_invSL wt (env (var (S n)) (cons a0 s)) (env (var n) s) *) (* Goal: e_invSL wt (env (var (S n)) (lift s)) (env (var n) (comp s shift)) *) (* Goal: e_invSL wt (env (var (S n)) (comp (lift s) t)) (env (var n) (comp s (comp shift t))) *) (* Goal: e_invSL ws (comp (comp s0 t0) u) (comp s0 (comp t0 u)) *) (* Goal: e_invSL ws (comp (cons a s0) t0) (cons (env a t0) (comp s0 t0)) *) (* Goal: e_invSL ws (comp shift (cons a s0)) s0 *) (* Goal: e_invSL ws (comp shift (lift s0)) (comp s0 shift) *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) do 2 right; left; exists s; auto. (* X *) (* Goal: or (@ex sub_explicits (fun s0 : sub_explicits => and (@eq (TS wt) (var O) (var O)) (@eq (TS ws) (cons (meta_X n) s) (cons (meta_X n) s0)))) (and (@eq (TS wt) (var O) (meta_X n)) (@eq (TS ws) (cons (meta_X n) s) id)) *) (* Goal: e_invSL wt (env (var O) (lift s)) (var O) *) (* Goal: e_invSL wt (env (var O) (comp (lift s) t)) (env (var O) t) *) (* Goal: e_invSL wt (env (var (S n)) (cons a0 s)) (env (var n) s) *) (* Goal: e_invSL wt (env (var (S n)) (lift s)) (env (var n) (comp s shift)) *) (* Goal: e_invSL wt (env (var (S n)) (comp (lift s) t)) (env (var n) (comp s (comp shift t))) *) (* Goal: e_invSL ws (comp (comp s0 t0) u) (comp s0 (comp t0 u)) *) (* Goal: e_invSL ws (comp (cons a s0) t0) (cons (env a t0) (comp s0 t0)) *) (* Goal: e_invSL ws (comp shift (cons a s0)) s0 *) (* Goal: e_invSL ws (comp shift (lift s0)) (comp s0 shift) *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) left; exists s; auto. (* fvarlift1 *) (* Goal: or (@ex terms (fun a : terms => and (@eq (TS wt) (var O) (lambda a)) (@eq (TS wt) a1 (env a (lift (cons (lambda a1) s)))))) (or (@ex sub_explicits (fun s0 : sub_explicits => and (@eq (TS wt) (var O) (var O)) (@eq (TS ws) (cons (lambda a1) s) (cons (lambda a1) s0)))) (and (@eq (TS wt) (var O) (lambda a1)) (@eq (TS ws) (cons (lambda a1) s) id))) *) (* Goal: or (@ex sub_explicits (fun s1 : sub_explicits => and (@eq (TS wt) (var O) (env a1 s1)) (@eq (TS ws) s0 (comp s1 (cons (env a1 s0) s))))) (or (@ex nat (fun n : nat => and (@eq (TS wt) (var O) (var n)) (and (@eq (TS ws) (cons (env a1 s0) s) (comp shift s0)) (@eq (TS wt) a1 (var (S n)))))) (or (@ex sub_explicits (fun s1 : sub_explicits => and (@eq (TS wt) (var O) (var O)) (@eq (TS ws) (cons (env a1 s0) s) (cons (env a1 s0) s1)))) (or (@ex sub_explicits (fun s1 : sub_explicits => and (@eq (TS wt) (var O) (var O)) (and (@eq (TS ws) (cons (env a1 s0) s) (comp (lift s1) s0)) (@eq (TS wt) a1 (var O))))) (or (@ex nat (fun n : nat => @ex terms (fun a : terms => and (@eq (TS wt) (var O) (var (S n))) (and (@eq (TS ws) (cons (env a1 s0) s) (cons a s0)) (@eq (TS wt) a1 (var n)))))) (or (@ex nat (fun n : nat => @ex sub_explicits (fun s1 : sub_explicits => and (@eq (TS wt) (var O) (var (S n))) (and (@eq (TS ws) (cons (env a1 s0) s) (lift s1)) (and (@eq (TS wt) a1 (var n)) (@eq (TS ws) s0 (comp s1 shift))))))) (or (@ex nat (fun n : nat => @ex sub_explicits (fun s1 : sub_explicits => @ex sub_explicits (fun t : sub_explicits => and (@eq (TS wt) (var O) (var (S n))) (and (@eq (TS ws) (cons (env a1 s0) s) (comp (lift s1) t)) (and (@eq (TS wt) a1 (var n)) (@eq (TS ws) s0 (comp s1 (comp shift t))))))))) (or (and (@eq (TS wt) (var O) (env a1 s0)) (@eq (TS ws) (cons (env a1 s0) s) id)) (or (and (e_relSL wt (var O) a1) (@eq (TS ws) (cons (env a1 s0) s) s0)) (and (@eq (TS wt) (var O) a1) (e_relSL ws (cons (env a1 s0) s) s0)))))))))) *) (* Goal: or (@ex sub_explicits (fun s0 : sub_explicits => and (@eq (TS wt) (var O) (var O)) (@eq (TS ws) (cons (meta_X n) s) (cons (meta_X n) s0)))) (and (@eq (TS wt) (var O) (meta_X n)) (@eq (TS ws) (cons (meta_X n) s) id)) *) (* Goal: e_invSL wt (env (var O) (lift s)) (var O) *) (* Goal: e_invSL wt (env (var O) (comp (lift s) t)) (env (var O) t) *) (* Goal: e_invSL wt (env (var (S n)) (cons a0 s)) (env (var n) s) *) (* Goal: e_invSL wt (env (var (S n)) (lift s)) (env (var n) (comp s shift)) *) (* Goal: e_invSL wt (env (var (S n)) (comp (lift s) t)) (env (var n) (comp s (comp shift t))) *) (* Goal: e_invSL ws (comp (comp s0 t0) u) (comp s0 (comp t0 u)) *) (* Goal: e_invSL ws (comp (cons a s0) t0) (cons (env a t0) (comp s0 t0)) *) (* Goal: e_invSL ws (comp shift (cons a s0)) s0 *) (* Goal: e_invSL ws (comp shift (lift s0)) (comp s0 shift) *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) simpl in |- *; right; left; exists s; auto. (* fvarlift2 *) (* Goal: or (@ex terms (fun a : terms => and (@eq (TS wt) (var O) (lambda a)) (@eq (TS wt) a1 (env a (lift (cons (lambda a1) s)))))) (or (@ex sub_explicits (fun s0 : sub_explicits => and (@eq (TS wt) (var O) (var O)) (@eq (TS ws) (cons (lambda a1) s) (cons (lambda a1) s0)))) (and (@eq (TS wt) (var O) (lambda a1)) (@eq (TS ws) (cons (lambda a1) s) id))) *) (* Goal: or (@ex sub_explicits (fun s1 : sub_explicits => and (@eq (TS wt) (var O) (env a1 s1)) (@eq (TS ws) s0 (comp s1 (cons (env a1 s0) s))))) (or (@ex nat (fun n : nat => and (@eq (TS wt) (var O) (var n)) (and (@eq (TS ws) (cons (env a1 s0) s) (comp shift s0)) (@eq (TS wt) a1 (var (S n)))))) (or (@ex sub_explicits (fun s1 : sub_explicits => and (@eq (TS wt) (var O) (var O)) (@eq (TS ws) (cons (env a1 s0) s) (cons (env a1 s0) s1)))) (or (@ex sub_explicits (fun s1 : sub_explicits => and (@eq (TS wt) (var O) (var O)) (and (@eq (TS ws) (cons (env a1 s0) s) (comp (lift s1) s0)) (@eq (TS wt) a1 (var O))))) (or (@ex nat (fun n : nat => @ex terms (fun a : terms => and (@eq (TS wt) (var O) (var (S n))) (and (@eq (TS ws) (cons (env a1 s0) s) (cons a s0)) (@eq (TS wt) a1 (var n)))))) (or (@ex nat (fun n : nat => @ex sub_explicits (fun s1 : sub_explicits => and (@eq (TS wt) (var O) (var (S n))) (and (@eq (TS ws) (cons (env a1 s0) s) (lift s1)) (and (@eq (TS wt) a1 (var n)) (@eq (TS ws) s0 (comp s1 shift))))))) (or (@ex nat (fun n : nat => @ex sub_explicits (fun s1 : sub_explicits => @ex sub_explicits (fun t : sub_explicits => and (@eq (TS wt) (var O) (var (S n))) (and (@eq (TS ws) (cons (env a1 s0) s) (comp (lift s1) t)) (and (@eq (TS wt) a1 (var n)) (@eq (TS ws) s0 (comp s1 (comp shift t))))))))) (or (and (@eq (TS wt) (var O) (env a1 s0)) (@eq (TS ws) (cons (env a1 s0) s) id)) (or (and (e_relSL wt (var O) a1) (@eq (TS ws) (cons (env a1 s0) s) s0)) (and (@eq (TS wt) (var O) a1) (e_relSL ws (cons (env a1 s0) s) s0)))))))))) *) (* Goal: or (@ex sub_explicits (fun s0 : sub_explicits => and (@eq (TS wt) (var O) (var O)) (@eq (TS ws) (cons (meta_X n) s) (cons (meta_X n) s0)))) (and (@eq (TS wt) (var O) (meta_X n)) (@eq (TS ws) (cons (meta_X n) s) id)) *) (* Goal: e_invSL wt (env (var O) (lift s)) (var O) *) (* Goal: e_invSL wt (env (var O) (comp (lift s) t)) (env (var O) t) *) (* Goal: e_invSL wt (env (var (S n)) (cons a0 s)) (env (var n) s) *) (* Goal: e_invSL wt (env (var (S n)) (lift s)) (env (var n) (comp s shift)) *) (* Goal: e_invSL wt (env (var (S n)) (comp (lift s) t)) (env (var n) (comp s (comp shift t))) *) (* Goal: e_invSL ws (comp (comp s0 t0) u) (comp s0 (comp t0 u)) *) (* Goal: e_invSL ws (comp (cons a s0) t0) (cons (env a t0) (comp s0 t0)) *) (* Goal: e_invSL ws (comp shift (cons a s0)) s0 *) (* Goal: e_invSL ws (comp shift (lift s0)) (comp s0 shift) *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) simpl in |- *; do 3 right; left; exists s; auto. (* rvarcons *) (* Goal: e_invSL wt (env (var (S n)) (cons a0 s)) (env (var n) s) *) (* Goal: e_invSL wt (env (var (S n)) (lift s)) (env (var n) (comp s shift)) *) (* Goal: e_invSL wt (env (var (S n)) (comp (lift s) t)) (env (var n) (comp s (comp shift t))) *) (* Goal: e_invSL ws (comp (comp s0 t0) u) (comp s0 (comp t0 u)) *) (* Goal: e_invSL ws (comp (cons a s0) t0) (cons (env a t0) (comp s0 t0)) *) (* Goal: e_invSL ws (comp shift (cons a s0)) s0 *) (* Goal: e_invSL ws (comp shift (lift s0)) (comp s0 shift) *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) simpl in |- *; do 4 right; left; exists n; exists a0; auto. (* rvarlift1 *) (* Goal: e_invSL wt (env (var (S n)) (lift s)) (env (var n) (comp s shift)) *) (* Goal: e_invSL wt (env (var (S n)) (comp (lift s) t)) (env (var n) (comp s (comp shift t))) *) (* Goal: e_invSL ws (comp (comp s0 t0) u) (comp s0 (comp t0 u)) *) (* Goal: e_invSL ws (comp (cons a s0) t0) (cons (env a t0) (comp s0 t0)) *) (* Goal: e_invSL ws (comp shift (cons a s0)) s0 *) (* Goal: e_invSL ws (comp shift (lift s0)) (comp s0 shift) *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) simpl in |- *; do 5 right; left; exists n; exists s; auto. (* rvarlift2 *) (* Goal: e_invSL wt (env (var (S n)) (comp (lift s) t)) (env (var n) (comp s (comp shift t))) *) (* Goal: e_invSL ws (comp (comp s0 t0) u) (comp s0 (comp t0 u)) *) (* Goal: e_invSL ws (comp (cons a s0) t0) (cons (env a t0) (comp s0 t0)) *) (* Goal: e_invSL ws (comp shift (cons a s0)) s0 *) (* Goal: e_invSL ws (comp shift (lift s0)) (comp s0 shift) *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) simpl in |- *; do 6 right; left; exists n; exists s; exists t; auto. (* assenv *) (* Goal: e_invSL ws (comp (comp s0 t0) u) (comp s0 (comp t0 u)) *) (* Goal: e_invSL ws (comp (cons a s0) t0) (cons (env a t0) (comp s0 t0)) *) (* Goal: e_invSL ws (comp shift (cons a s0)) s0 *) (* Goal: e_invSL ws (comp shift (lift s0)) (comp s0 shift) *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) simpl in |- *; left; exists t0; auto. (* mapenv *) (* Goal: e_invSL ws (comp (cons a s0) t0) (cons (env a t0) (comp s0 t0)) *) (* Goal: e_invSL ws (comp shift (cons a s0)) s0 *) (* Goal: e_invSL ws (comp shift (lift s0)) (comp s0 shift) *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) simpl in |- *; left; exists a; exists s0; auto. (* shiftcons *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) pattern s0 in |- *; apply sub_explicits_ind; intros; simpl in |- *. (* id *) (* Goal: or (@ex terms (fun a0 : terms => and (@eq (TS ws) shift shift) (@eq (TS ws) (cons a (meta_x n)) (cons a0 (meta_x n))))) (or (and (@eq (TS ws) shift id) (@eq (TS ws) (cons a (meta_x n)) (meta_x n))) (and (@eq (TS ws) shift (meta_x n)) (@eq (TS ws) (cons a (meta_x n)) id))) *) (* Goal: e_invSL ws (comp shift (lift s0)) (comp s0 shift) *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) left; exists a; auto. (*| *) (* Goal: or (@ex terms (fun a0 : terms => and (@eq (TS ws) shift shift) (@eq (TS ws) (cons a (meta_x n)) (cons a0 (meta_x n))))) (or (and (@eq (TS ws) shift id) (@eq (TS ws) (cons a (meta_x n)) (meta_x n))) (and (@eq (TS ws) shift (meta_x n)) (@eq (TS ws) (cons a (meta_x n)) id))) *) (* Goal: e_invSL ws (comp shift (lift s0)) (comp s0 shift) *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) left; exists a; auto. (* . *) (* Goal: or (@ex terms (fun a0 : terms => and (@eq (TS ws) shift shift) (@eq (TS ws) (cons a (meta_x n)) (cons a0 (meta_x n))))) (or (and (@eq (TS ws) shift id) (@eq (TS ws) (cons a (meta_x n)) (meta_x n))) (and (@eq (TS ws) shift (meta_x n)) (@eq (TS ws) (cons a (meta_x n)) id))) *) (* Goal: e_invSL ws (comp shift (lift s0)) (comp s0 shift) *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) right; left; exists a; auto. (* o *) (* Goal: or (@ex terms (fun a0 : terms => and (@eq (TS ws) shift shift) (@eq (TS ws) (cons a (meta_x n)) (cons a0 (meta_x n))))) (or (and (@eq (TS ws) shift id) (@eq (TS ws) (cons a (meta_x n)) (meta_x n))) (and (@eq (TS ws) shift (meta_x n)) (@eq (TS ws) (cons a (meta_x n)) id))) *) (* Goal: e_invSL ws (comp shift (lift s0)) (comp s0 shift) *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) right; left; exists a; auto. (*|| *) (* Goal: or (@ex terms (fun a0 : terms => and (@eq (TS ws) shift shift) (@eq (TS ws) (cons a (meta_x n)) (cons a0 (meta_x n))))) (or (and (@eq (TS ws) shift id) (@eq (TS ws) (cons a (meta_x n)) (meta_x n))) (and (@eq (TS ws) shift (meta_x n)) (@eq (TS ws) (cons a (meta_x n)) id))) *) (* Goal: e_invSL ws (comp shift (lift s0)) (comp s0 shift) *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) left; exists a; auto. (* x *) (* Goal: or (@ex terms (fun a0 : terms => and (@eq (TS ws) shift shift) (@eq (TS ws) (cons a (meta_x n)) (cons a0 (meta_x n))))) (or (and (@eq (TS ws) shift id) (@eq (TS ws) (cons a (meta_x n)) (meta_x n))) (and (@eq (TS ws) shift (meta_x n)) (@eq (TS ws) (cons a (meta_x n)) id))) *) (* Goal: e_invSL ws (comp shift (lift s0)) (comp s0 shift) *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) left; exists a; auto. (* shiftlift1 *) (* Goal: e_invSL ws (comp shift (lift s0)) (comp s0 shift) *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) simpl in |- *; do 2 right; left; auto. (* shiftlift2 *) (* Goal: e_invSL ws (comp shift (comp (lift s0) t0)) (comp s0 (comp shift t0)) *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) simpl in |- *; do 3 right; left; exists t0; auto. (* lift1 *) (* Goal: e_invSL ws (comp (lift s0) (lift t0)) (lift (comp s0 t0)) *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) simpl in |- *; right; left; exists s0; exists t0; auto. (* lift2 *) (* Goal: e_invSL ws (comp (lift s0) (comp (lift t0) u)) (comp (lift (comp s0 t0)) u) *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) simpl in |- *; do 4 right; left; exists s0; exists t0; auto. (* liftenv *) (* Goal: e_invSL ws (comp (lift s0) (cons a t0)) (cons a (comp s0 t0)) *) (* Goal: e_invSL ws (comp id s0) s0 *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) simpl in |- *; right; right; left; exists s0; exists t0; auto. (* idl *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) pattern s0 in |- *; apply sub_explicits_ind; intros; simpl in |- *. (* id *) (* Goal: or (@ex sub_explicits (fun s : sub_explicits => and (@eq (TS wt) (meta_X n) (var O)) (@eq (TS ws) id (cons (meta_X n) s)))) (and (@eq (TS wt) (meta_X n) (meta_X n)) (@eq (TS ws) id id)) *) right; auto. (*| *) (* Goal: or (@ex terms (fun a : terms => and (@eq (TS ws) id shift) (@eq (TS ws) (meta_x n) (cons a (meta_x n))))) (or (and (@eq (TS ws) id id) (@eq (TS ws) (meta_x n) (meta_x n))) (and (@eq (TS ws) id (meta_x n)) (@eq (TS ws) (meta_x n) id))) *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) right; left; auto. (* . *) (* Goal: or (@ex terms (fun a : terms => and (@eq (TS ws) id shift) (@eq (TS ws) (meta_x n) (cons a (meta_x n))))) (or (and (@eq (TS ws) id id) (@eq (TS ws) (meta_x n) (meta_x n))) (and (@eq (TS ws) id (meta_x n)) (@eq (TS ws) (meta_x n) id))) *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) do 3 right; left; auto. (* o *) (* Goal: or (@ex terms (fun a : terms => and (@eq (TS ws) id shift) (@eq (TS ws) (meta_x n) (cons a (meta_x n))))) (or (and (@eq (TS ws) id id) (@eq (TS ws) (meta_x n) (meta_x n))) (and (@eq (TS ws) id (meta_x n)) (@eq (TS ws) (meta_x n) id))) *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) do 5 right; left; auto. (*|| *) (* Goal: or (@ex terms (fun a : terms => and (@eq (TS ws) id shift) (@eq (TS ws) (meta_x n) (cons a (meta_x n))))) (or (and (@eq (TS ws) id id) (@eq (TS ws) (meta_x n) (meta_x n))) (and (@eq (TS ws) id (meta_x n)) (@eq (TS ws) (meta_x n) id))) *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) do 2 right; left; auto. (* x *) (* Goal: or (@ex terms (fun a : terms => and (@eq (TS ws) id shift) (@eq (TS ws) (meta_x n) (cons a (meta_x n))))) (or (and (@eq (TS ws) id id) (@eq (TS ws) (meta_x n) (meta_x n))) (and (@eq (TS ws) id (meta_x n)) (@eq (TS ws) (meta_x n) id))) *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) right; left; auto. (* idr *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) pattern s0 in |- *; apply sub_explicits_ind; intros; simpl in |- *. (* id *) (* Goal: or (@ex sub_explicits (fun s : sub_explicits => and (@eq (TS wt) (meta_X n) (var O)) (@eq (TS ws) id (cons (meta_X n) s)))) (and (@eq (TS wt) (meta_X n) (meta_X n)) (@eq (TS ws) id id)) *) right; auto. (*| *) (* Goal: or (@ex sub_explicits (fun s : sub_explicits => and (@eq (TS wt) (meta_X n) (var O)) (@eq (TS ws) id (cons (meta_X n) s)))) (and (@eq (TS wt) (meta_X n) (meta_X n)) (@eq (TS ws) id id)) *) right; right; auto. (* . *) (* Goal: or (@ex sub_explicits (fun s : sub_explicits => and (@eq (TS wt) (meta_X n) (var O)) (@eq (TS ws) id (cons (meta_X n) s)))) (and (@eq (TS wt) (meta_X n) (meta_X n)) (@eq (TS ws) id id)) *) do 4 right; auto. (* o *) (* Goal: or (@ex terms (fun a : terms => and (@eq (TS ws) id shift) (@eq (TS ws) (meta_x n) (cons a (meta_x n))))) (or (and (@eq (TS ws) id id) (@eq (TS ws) (meta_x n) (meta_x n))) (and (@eq (TS ws) id (meta_x n)) (@eq (TS ws) (meta_x n) id))) *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) do 6 right; left; auto. (*|| *) (* Goal: or (@ex sub_explicits (fun s : sub_explicits => and (@eq (TS wt) (meta_X n) (var O)) (@eq (TS ws) id (cons (meta_X n) s)))) (and (@eq (TS wt) (meta_X n) (meta_X n)) (@eq (TS ws) id id)) *) do 3 right; auto. (* x *) (* Goal: or (@ex sub_explicits (fun s : sub_explicits => and (@eq (TS wt) (meta_X n) (var O)) (@eq (TS ws) id (cons (meta_X n) s)))) (and (@eq (TS wt) (meta_X n) (meta_X n)) (@eq (TS ws) id id)) *) right; right; auto. (* liftid *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) simpl in |- *; auto. (* id *) (* Goal: e_invSL wt (env a0 id) a0 *) pattern a0 in |- *; apply terms_ind; intros; simpl in |- *. (* var *) (* Goal: or (@ex sub_explicits (fun s : sub_explicits => and (@eq (TS wt) (meta_X n) (var O)) (@eq (TS ws) id (cons (meta_X n) s)))) (and (@eq (TS wt) (meta_X n) (meta_X n)) (@eq (TS ws) id id)) *) do 3 right; auto. (* app *) (* Goal: or (@ex sub_explicits (fun s : sub_explicits => and (@eq (TS wt) (meta_X n) (var O)) (@eq (TS ws) id (cons (meta_X n) s)))) (and (@eq (TS wt) (meta_X n) (meta_X n)) (@eq (TS ws) id id)) *) do 2 right; auto. (* lam *) (* Goal: or (@ex sub_explicits (fun s : sub_explicits => and (@eq (TS wt) (meta_X n) (var O)) (@eq (TS ws) id (cons (meta_X n) s)))) (and (@eq (TS wt) (meta_X n) (meta_X n)) (@eq (TS ws) id id)) *) do 2 right; auto. (* env *) (* Goal: or (@ex terms (fun a : terms => and (@eq (TS ws) id shift) (@eq (TS ws) (meta_x n) (cons a (meta_x n))))) (or (and (@eq (TS ws) id id) (@eq (TS ws) (meta_x n) (meta_x n))) (and (@eq (TS ws) id (meta_x n)) (@eq (TS ws) (meta_x n) id))) *) (* Goal: e_invSL ws (comp s0 id) s0 *) (* Goal: e_invSL ws (lift id) id *) (* Goal: e_invSL wt (env a0 id) a0 *) do 7 right; left; auto. (* X *) (* Goal: or (@ex sub_explicits (fun s : sub_explicits => and (@eq (TS wt) (meta_X n) (var O)) (@eq (TS ws) id (cons (meta_X n) s)))) (and (@eq (TS wt) (meta_X n) (meta_X n)) (@eq (TS ws) id id)) *) right; auto. Save lemma1_inv_systemSL. Hint Resolve lemma1_inv_systemSL. Goal forall (b : wsort) (M N : TS b), e_relSL _ M N -> e_invSL _ M N. (* Goal: forall (b : wsort) (M N : TS b) (_ : e_relSL b M N), e_invSL b M N *) simple induction 1; intros; simpl in |- *; auto 11. Save lemma1_invSL. Hint Resolve lemma1_invSL.
(* Contribution to the Coq Library V6.3 (July 1999) *) (****************************************************************************) (* The Calculus of Inductive Constructions *) (* *) (* Projet Coq *) (* *) (* INRIA ENS-CNRS *) (* Rocquencourt Lyon *) (* *) (* Coq V5.10 *) (* Nov 25th 1994 *) (* *) (****************************************************************************) (* betapar.v *) (****************************************************************************) (*****************************************************************************) (* Projet Coq - Calculus of Inductive Constructions V5.8 *) (*****************************************************************************) (* *) (* Meta-theory of the explicit substitution calculus lambda-env *) (* Amokrane Saibi *) (* *) (* September 1993 *) (* *) (*****************************************************************************) (* relation bata_par: Beta|| *) Require Import TS. Require Import sur_les_relations. Inductive e_beta_par : forall b : wsort, TS b -> TS b -> Prop := | var_bpar : forall n : nat, e_beta_par wt (var n) (var n) | id_bpar : e_beta_par ws id id | shift_bpar : e_beta_par ws shift shift | app_bpar : forall M N M' N' : terms, e_beta_par wt M M' -> e_beta_par wt N N' -> e_beta_par wt (app M N) (app M' N') | lambda_bpar : forall M M' : terms, e_beta_par wt M M' -> e_beta_par wt (lambda M) (lambda M') | env_bpar : forall (M M' : terms) (s s' : sub_explicits), e_beta_par wt M M' -> e_beta_par ws s s' -> e_beta_par wt (env M s) (env M' s') | beta_bpar : forall M N M' N' : terms, e_beta_par wt M M' -> e_beta_par wt N N' -> e_beta_par wt (app (lambda M) N) (env M' (cons N' id)) | cons_bpar : forall (M M' : terms) (s s' : sub_explicits), e_beta_par wt M M' -> e_beta_par ws s s' -> e_beta_par ws (cons M s) (cons M' s') | lift_bpar : forall s s' : sub_explicits, e_beta_par ws s s' -> e_beta_par ws (lift s) (lift s') | comp_bpar : forall s s' t t' : sub_explicits, e_beta_par ws s s' -> e_beta_par ws t t' -> e_beta_par ws (comp s t) (comp s' t') | metaX_bpar : forall n : nat, e_beta_par wt (meta_X n) (meta_X n) | metax_bpar : forall n : nat, e_beta_par ws (meta_x n) (meta_x n). Hint Resolve var_bpar id_bpar shift_bpar app_bpar lambda_bpar env_bpar beta_bpar cons_bpar lift_bpar comp_bpar metaX_bpar metax_bpar. Notation beta_par := (e_beta_par _) (only parsing). (* <Warning> : Syntax is discontinued *) Goal forall (b : wsort) (M : TS b), e_beta_par _ M M. (* Goal: forall (b : wsort) (M : TS b), e_beta_par b M M *) simple induction M; auto. Save refl_betapar. Hint Resolve refl_betapar. Definition e_betapar_inv (b : wsort) (M N : TS b) := match M in (TS b) return Prop with | var n => (* var *) match N in (TS b) return Prop with | var m => (* var *) n = m (* app *) | app N1 N2 => False (* lam *) | lambda N1 => False (* env *) | env N1 N2 => False (* id *) | id => False (* | *) | shift => False (* . *) | cons N1 N2 => False (* o *) | comp N1 N2 => False (* || *) | lift N1 => False (* X *) | meta_X n => False (* x *) | meta_x n => False end (* app *) | app M1 M2 => match N in (TS b) return Prop with | var n => (* var *) False (* app *) | app N1 N2 => e_beta_par _ M1 N1 /\ e_beta_par _ M2 N2 (* lam *) | lambda N1 => False (* env *) | env N1 N2 => exists M3 : terms, (exists N3 : terms, M1 = lambda M3 /\ e_beta_par _ M3 N1 /\ N2 = cons N3 id /\ e_beta_par _ M2 N3) (* id *) | id => False (* | *) | shift => False (* . *) | cons N1 N2 => False (* o *) | comp N1 N2 => False (* || *) | lift N1 => False (* X *) | meta_X n => False (* x *) | meta_x n => False end (* lam *) | lambda M1 => match N in (TS b) return Prop with | var n => (* var *) False (* app *) | app N1 N2 => False (* lam *) | lambda N1 => e_beta_par _ M1 N1 (* env *) | env N1 N2 => False (* id *) | id => False (* | *) | shift => False (* . *) | cons N1 N2 => False (* o *) | comp N1 N2 => False (* || *) | lift N1 => False (* X *) | meta_X n => False (* x *) | meta_x n => False end (* env *) | env M1 M2 => match N in (TS b) return Prop with | var n => (* var *) False (* app *) | app N1 N2 => False (* lam *) | lambda N1 => False (* env *) | env N1 N2 => e_beta_par _ M1 N1 /\ e_beta_par _ M2 N2 (* id *) | id => False (* | *) | shift => False (* . *) | cons N1 N2 => False (* o *) | comp N1 N2 => False (* || *) | lift N1 => False (* X *) | meta_X n => False (* x *) | meta_x n => False end (* id *) | id => match N in (TS b) return Prop with | var n => (* var *) False (* app *) | app N1 N2 => False (* lam *) | lambda N1 => False (* env *) | env N1 N2 => False (* id *) | id => True (* | *) | shift => False (* . *) | cons N1 N2 => False (* o *) | comp N1 N2 => False (* || *) | lift N1 => False (* X *) | meta_X n => False (* x *) | meta_x n => False end (* | *) | shift => match N in (TS b) return Prop with | var n => (* var *) False (* app *) | app N1 N2 => False (* lam *) | lambda N1 => False (* env *) | env N1 N2 => False (* id *) | id => False (* | *) | shift => True (* . *) | cons N1 N2 => False (* o *) | comp N1 N2 => False (* || *) | lift N1 => False (* X *) | meta_X n => False (* x *) | meta_x n => False end (* . *) | cons M1 M2 => match N in (TS b) return Prop with | var n => (* var *) False (* app *) | app N1 N2 => False (* lam *) | lambda N1 => False (* env *) | env N1 N2 => False (* id *) | id => False (* | *) | shift => False (* . *) | cons N1 N2 => e_beta_par _ M1 N1 /\ e_beta_par _ M2 N2 (* o *) | comp N1 N2 => False (* || *) | lift N1 => False (* X *) | meta_X n => False (* x *) | meta_x n => False end (* o *) | comp M1 M2 => match N in (TS b) return Prop with | var n => (* var *) False (* app *) | app N1 N2 => False (* lam *) | lambda N1 => False (* env *) | env N1 N2 => False (* id *) | id => False (* | *) | shift => False (* . *) | cons N1 N2 => False (* o *) | comp N1 N2 => e_beta_par _ M1 N1 /\ e_beta_par _ M2 N2 (* || *) | lift N1 => False (* X *) | meta_X n => False (* x *) | meta_x n => False end (* || *) | lift M1 => match N in (TS b) return Prop with | var n => (* var *) False (* app *) | app N1 N2 => False (* lam *) | lambda N1 => False (* env *) | env N1 N2 => False (* id *) | id => False (* | *) | shift => False (* . *) | cons N1 N2 => False (* o *) | comp N1 N2 => False (* || *) | lift N1 => e_beta_par _ M1 N1 (* X *) | meta_X n => False (* x *) | meta_x n => False end (* X *) | meta_X n => match N in (TS b) return Prop with | var n => (* var *) False (* app *) | app N1 N2 => False (* lam *) | lambda N1 => False (* env *) | env N1 N2 => False (* id *) | id => False (* | *) | shift => False (* . *) | cons N1 N2 => False (* o *) | comp N1 N2 => False (* || *) | lift N1 => False (* X *) | meta_X m => n = m (* x *) | meta_x m => False end (* x *) | meta_x n => match N in (TS b) return Prop with | var n => (* var *) False (* app *) | app N1 N2 => False (* lam *) | lambda N1 => False (* env *) | env N1 N2 => False (* id *) | id => False (* | *) | shift => False (* . *) | cons N1 N2 => False (* o *) | comp N1 N2 => False (* || *) | lift N1 => False (* X *) | meta_X m => False (* x *) | meta_x m => n = m end end. Notation betapar_inv := (e_betapar_inv _) (only parsing). (* <Warning> : Syntax is discontinued *) Goal forall (b : wsort) (M N : TS b), e_beta_par _ M N -> e_betapar_inv _ M N. (* Goal: forall (b : wsort) (M N : TS b) (_ : e_beta_par b M N), e_betapar_inv b M N *) simple induction 1; intros; simpl in |- *; auto. (* Goal: @ex terms (fun M3 : terms => @ex terms (fun N3 : terms => and (@eq (TS wt) (lambda M0) (lambda M3)) (and (e_beta_par wt M3 M') (and (@eq (TS ws) (cons N' id) (cons N3 id)) (e_beta_par wt N0 N3))))) *) (* beta *)exists M0; exists N'; auto. Save lemma1_inv_betapar. Hint Resolve lemma1_inv_betapar. Goal forall (P : terms -> Prop) (n : nat), P (var n) -> forall M : terms, e_beta_par _ (var n) M -> P M. intros P n H M H0; cut (e_betapar_inv _ (var n) M). 2: auto. pattern M in |- *; apply terms_ind. (* var *) simple induction 1; assumption. (* app *) simple induction 3. (* lam *) simple induction 2. (* env *) simple induction 2. (* X *)simple induction 1. Save case_bvar. Goal forall (P : terms -> Prop) (a b : terms), (forall a' b' : terms, e_beta_par _ a a' -> e_beta_par _ b b' -> P (app a' b')) -> (forall a1 a1' b' : terms, a = lambda a1 -> e_beta_par _ a1 a1' -> e_beta_par _ b b' -> P (env a1' (cons b' id))) -> forall M : terms, e_beta_par _ (app a b) M -> P M. intros P a b H H0 M H1; cut (e_betapar_inv _ (app a b) M). 2: auto. pattern M in |- *; apply terms_ind. (* var *) simple induction 1. (* app *) unfold e_betapar_inv at 3 in |- *; intros a' b' H2 H3 H4. elim H4; intros H5 H6. apply H; assumption. (* lam *) simple induction 2. (* env *) unfold e_betapar_inv at 2 in |- *; intros a1' H2 s H3. elim H3; intros a1 H4; elim H4; intros b' H5. elim H5; intros H6 H7; elim H7; intros H8 H9; elim H9; intros H10 H11. try rewrite H6; try rewrite H10; apply (H0 a1); assumption. (* X *)simple induction 1. Save case_bapp. Goal forall (P : terms -> Prop) (a : terms), (forall a' : terms, e_beta_par _ a a' -> P (lambda a')) -> forall M : terms, e_beta_par _ (lambda a) M -> P M. intros P a H M H0; cut (e_betapar_inv _ (lambda a) M). 2: auto. pattern M in |- *; apply terms_ind. (* var *) simple induction 1. (* app *) simple induction 3. (* lam *) unfold e_betapar_inv at 2 in |- *; intros a' H1 H2. apply H; assumption. (* env *) simple induction 2. (* X *)simple induction 1. Save case_blambda. Goal forall (P : terms -> Prop) (a : terms) (s : sub_explicits), (forall (a' : terms) (s' : sub_explicits), e_beta_par _ a a' -> e_beta_par _ s s' -> P (env a' s')) -> forall M : terms, e_beta_par _ (env a s) M -> P M. intros P a s H M H0; cut (e_betapar_inv _ (env a s) M). 2: auto. pattern M in |- *; apply terms_ind. (* var *) simple induction 1. (* app *) simple induction 3. (* lam *) simple induction 2. (* env *) unfold e_betapar_inv at 2 in |- *; intros a' H1 s' H2. elim H2; intros; apply H; assumption. (* X *)simple induction 1. Save case_benv. Goal forall P : sub_explicits -> Prop, P id -> forall M : sub_explicits, e_beta_par _ id M -> P M. intros P H M H0; cut (e_betapar_inv _ id M). 2: auto. pattern M in |- *; apply sub_explicits_ind. (* id *) intro; assumption. (* | *) simple induction 1. (* . *) simple induction 2. (* o *) simple induction 3. (* || *) simple induction 2. (* x *)simple induction 1. Save case_bid. Goal forall P : sub_explicits -> Prop, P shift -> forall M : sub_explicits, e_beta_par _ shift M -> P M. intros P H M H0; cut (e_betapar_inv _ shift M). 2: auto. pattern M in |- *; apply sub_explicits_ind. (* id *) simple induction 1. (* | *) intro; assumption. (* . *) simple induction 2. (* o *) simple induction 3. (* || *) simple induction 2. (* x *)simple induction 1. Save case_bshift. Goal forall (P : sub_explicits -> Prop) (a : terms) (s : sub_explicits), (forall (a' : terms) (s' : sub_explicits), e_beta_par _ a a' -> e_beta_par _ s s' -> P (cons a' s')) -> forall M : sub_explicits, e_beta_par _ (cons a s) M -> P M. intros P a s H M H0; cut (e_betapar_inv _ (cons a s) M). 2: auto. pattern M in |- *; apply sub_explicits_ind. (* id *) simple induction 1. (* | *) simple induction 1. (* . *) unfold e_betapar_inv at 2 in |- *; intros s' H1 a' H2. elim H2; intros. apply H; assumption. (* o *) simple induction 3. (* || *) simple induction 2. (* x *)simple induction 1. Save case_bcons. Goal forall (P : sub_explicits -> Prop) (s t : sub_explicits), (forall s' t' : sub_explicits, e_beta_par _ s s' -> e_beta_par _ t t' -> P (comp s' t')) -> forall M : sub_explicits, e_beta_par _ (comp s t) M -> P M. intros P s t H M H0; cut (e_betapar_inv _ (comp s t) M). 2: auto. pattern M in |- *; apply sub_explicits_ind. (* id *) simple induction 1. (* | *) simple induction 1. (* . *) simple induction 2. (* o *) unfold e_betapar_inv at 3 in |- *. intros s' t' H1 H2 H3; elim H3; intros; apply H; assumption. (* || *) simple induction 2. (* x *)simple induction 1. Save case_bcomp. Goal forall (P : sub_explicits -> Prop) (s : sub_explicits), (forall s' : sub_explicits, e_beta_par _ s s' -> P (lift s')) -> forall M : sub_explicits, e_beta_par _ (lift s) M -> P M. intros P s H M H0; cut (e_betapar_inv _ (lift s) M). 2: auto. pattern M in |- *; apply sub_explicits_ind. (* id *) simple induction 1. (* | *) simple induction 1. (* . *) simple induction 2. (* o *) simple induction 3. (* || *) unfold e_betapar_inv at 2 in |- *. intros s' H1 H2; apply H; assumption. (* x *)simple induction 1. Save case_blift. Goal forall (P : terms -> Prop) (n : nat), P (meta_X n) -> forall M : terms, e_beta_par _ (meta_X n) M -> P M. intros P n H M H0; cut (e_betapar_inv _ (meta_X n) M). 2: auto. pattern M in |- *; apply terms_ind. (* var *) simple induction 1. (* app *) simple induction 3. (* lam *) simple induction 2. (* env *) simple induction 2. (* X *)simple induction 1; assumption. Save case_bmetaX. Goal forall (P : sub_explicits -> Prop) (n : nat), P (meta_x n) -> forall M : sub_explicits, e_beta_par _ (meta_x n) M -> P M. intros P n H M H0; cut (e_betapar_inv _ (meta_x n) M). 2: auto. pattern M in |- *; apply sub_explicits_ind. (* id *) simple induction 1. (* | *) simple induction 1. (* . *) simple induction 2. (* o *) simple induction 3. (* || *) simple induction 2. (* x *)simple induction 1; assumption. Save case_bmetax.
(* Contribution to the Coq Library V6.3 (July 1999) *) (****************************************************************************) (* The Calculus of Inductive Constructions *) (* *) (* Projet Coq *) (* *) (* INRIA ENS-CNRS *) (* Rocquencourt Lyon *) (* *) (* Coq V5.10 *) (* Nov 25th 1994 *) (* *) (****************************************************************************) (* lambda_sigma_lift.v *) (****************************************************************************) (*****************************************************************************) (* Projet Coq - Calculus of Inductive Constructions V5.8 *) (*****************************************************************************) (* *) (* Meta-theory of the explicit substitution calculus lambda-env *) (* Amokrane Saibi *) (* *) (* September 1993 *) (* *) (*****************************************************************************) (* theorie lambda-sigma-lift-calcul *) Require Import TS. Require Import sur_les_relations. Require Import sigma_lift. (* regle beta *) Inductive reg_beta : terms -> terms -> Prop := reg1_beta : forall a b : terms, reg_beta (app (lambda a) b) (env a (cons b id)). Hint Resolve reg1_beta. (* systeme lambda-sigma-lift *) Inductive e_systemLSL : forall b : wsort, TS b -> TS b -> Prop := | beta1 : forall M N : terms, reg_beta M N -> e_systemLSL wt M N | SL1 : forall (b : wsort) (M N : TS b), e_systemSL _ M N -> e_systemLSL b M N. Hint Resolve beta1 SL1. Notation systemLSL := (e_systemLSL _) (only parsing). (* <Warning> : Syntax is discontinued *) (* relation engendree par le systeme lambda-sigma-lift *) Inductive e_relLSL : forall b : wsort, TS b -> TS b -> Prop := | LSL_one_regle : forall (b : wsort) (M N : TS b), e_systemLSL _ M N -> e_relLSL b M N | LSL_context_app_l : forall a a' b : terms, e_relLSL wt a a' -> e_relLSL wt (app a b) (app a' b) | LSL_context_app_r : forall a b b' : terms, e_relLSL wt b b' -> e_relLSL wt (app a b) (app a b') | LSL_context_lambda : forall a a' : terms, e_relLSL wt a a' -> e_relLSL wt (lambda a) (lambda a') | LSL_context_env_t : forall (a a' : terms) (s : sub_explicits), e_relLSL wt a a' -> e_relLSL wt (env a s) (env a' s) | LSL_context_env_s : forall (a : terms) (s s' : sub_explicits), e_relLSL ws s s' -> e_relLSL wt (env a s) (env a s') | LSL_context_cons_t : forall (a a' : terms) (s : sub_explicits), e_relLSL wt a a' -> e_relLSL ws (cons a s) (cons a' s) | LSL_context_cons_s : forall (a : terms) (s s' : sub_explicits), e_relLSL ws s s' -> e_relLSL ws (cons a s) (cons a s') | LSL_context_comp_l : forall s s' t : sub_explicits, e_relLSL ws s s' -> e_relLSL ws (comp s t) (comp s' t) | LSL_context_comp_r : forall s t t' : sub_explicits, e_relLSL ws t t' -> e_relLSL ws (comp s t) (comp s t') | LSL_context_lift : forall s s' : sub_explicits, e_relLSL ws s s' -> e_relLSL ws (lift s) (lift s'). Notation relLSL := (e_relLSL _) (only parsing). (* <Warning> : Syntax is discontinued *) Hint Resolve LSL_one_regle LSL_context_app_l LSL_context_app_r LSL_context_lambda LSL_context_env_t LSL_context_env_s LSL_context_cons_t LSL_context_cons_s LSL_context_comp_l LSL_context_comp_r LSL_context_lift. (* fermeture reflexive-transitive de la relation lambda-sigma-lift *) Definition e_relLSLstar (b : wsort) := explicit_star _ (e_relLSL b). Notation relLSLstar := (e_relLSLstar _) (only parsing). (* <Warning> : Syntax is discontinued *) Hint Unfold e_relLSLstar. (* un exemple *) Goal e_relLSLstar _ (lambda (app (lambda (app (var 0) (var 0))) (lambda (app (var 0) (var 1))))) (lambda (app (var 0) (var 0))). red in |- *; apply star_trans1 with (lambda (env (app (var 0) (var 0)) (cons (lambda (app (var 0) (var 1))) id))). (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) auto. apply star_trans1 with (lambda (app (env (var 0) (cons (lambda (app (var 0) (var 1))) id)) (env (var 0) (cons (lambda (app (var 0) (var 1))) id)))). (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) auto. apply star_trans1 with (lambda (app (lambda (app (var 0) (var 1))) (env (var 0) (cons (lambda (app (var 0) (var 1))) id)))). (* Goal: e_relLSL wt (lambda (app (env (var O) id) (env (var O) id))) (lambda (app (var O) (env (var O) id))) *) (* Goal: explicit_star (TS wt) (e_relLSL wt) (lambda (app (var O) (env (var O) id))) (lambda (app (var O) (var O))) *) auto 6. apply star_trans1 with (lambda (app (lambda (app (var 0) (var 1))) (lambda (app (var 0) (var 1))))). (* Goal: e_relLSL wt (lambda (app (env (var O) id) (env (var O) id))) (lambda (app (var O) (env (var O) id))) *) (* Goal: explicit_star (TS wt) (e_relLSL wt) (lambda (app (var O) (env (var O) id))) (lambda (app (var O) (var O))) *) auto 6. apply star_trans1 with (lambda (env (app (var 0) (var 1)) (cons (lambda (app (var 0) (var 1))) id))). (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) auto. apply star_trans1 with (lambda (app (env (var 0) (cons (lambda (app (var 0) (var 1))) id)) (env (var 1) (cons (lambda (app (var 0) (var 1))) id)))). (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) auto. apply star_trans1 with (lambda (app (lambda (app (var 0) (var 1))) (env (var 1) (cons (lambda (app (var 0) (var 1))) id)))). (* Goal: e_relLSL wt (lambda (app (env (var O) id) (env (var O) id))) (lambda (app (var O) (env (var O) id))) *) (* Goal: explicit_star (TS wt) (e_relLSL wt) (lambda (app (var O) (env (var O) id))) (lambda (app (var O) (var O))) *) auto 6. apply star_trans1 with (lambda (app (lambda (app (var 0) (var 1))) (env (var 0) id))). (* Goal: e_relLSL wt (lambda (app (env (var O) id) (env (var O) id))) (lambda (app (var O) (env (var O) id))) *) (* Goal: explicit_star (TS wt) (e_relLSL wt) (lambda (app (var O) (env (var O) id))) (lambda (app (var O) (var O))) *) auto 6. apply star_trans1 with (lambda (env (app (var 0) (var 1)) (cons (env (var 0) id) id))). (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) auto. apply star_trans1 with (lambda (app (env (var 0) (cons (env (var 0) id) id)) (env (var 1) (cons (env (var 0) id) id)))). (* Goal: e_relLSL wt (lambda (app (env (var O) id) (env (var O) id))) (lambda (app (var O) (env (var O) id))) *) (* Goal: explicit_star (TS wt) (e_relLSL wt) (lambda (app (var O) (env (var O) id))) (lambda (app (var O) (var O))) *) auto 6. apply star_trans1 with (lambda (app (env (var 0) id) (env (var 1) (cons (env (var 0) id) id)))). (* Goal: e_relLSL wt (lambda (app (env (var O) id) (env (var O) id))) (lambda (app (var O) (env (var O) id))) *) (* Goal: explicit_star (TS wt) (e_relLSL wt) (lambda (app (var O) (env (var O) id))) (lambda (app (var O) (var O))) *) auto 6. (* Goal: explicit_star (TS wt) (e_relLSL wt) (lambda (app (env (var O) id) (env (var (S O)) (cons (env (var O) id) id)))) (lambda (app (var O) (var O))) *) apply star_trans1 with (lambda (app (env (var 0) id) (env (var 0) id))). (* Goal: e_relLSL wt (lambda (app (env (var O) id) (env (var O) id))) (lambda (app (var O) (env (var O) id))) *) (* Goal: explicit_star (TS wt) (e_relLSL wt) (lambda (app (var O) (env (var O) id))) (lambda (app (var O) (var O))) *) auto 6. (* Goal: explicit_star (TS wt) (e_relLSL wt) (lambda (app (env (var O) id) (env (var O) id))) (lambda (app (var O) (var O))) *) apply star_trans1 with (lambda (app (var 0) (env (var 0) id))). (* Goal: e_relLSL wt (lambda (app (env (var O) id) (env (var O) id))) (lambda (app (var O) (env (var O) id))) *) (* Goal: explicit_star (TS wt) (e_relLSL wt) (lambda (app (var O) (env (var O) id))) (lambda (app (var O) (var O))) *) auto 6. (* Goal: e_relLSL wt (lambda (app (env (var O) id) (env (var O) id))) (lambda (app (var O) (env (var O) id))) *) (* Goal: explicit_star (TS wt) (e_relLSL wt) (lambda (app (var O) (env (var O) id))) (lambda (app (var O) (var O))) *) apply star_trans1 with (lambda (app (var 0) (var 0))); auto 6. Save exemple. (* *) Goal forall a a' b : terms, e_relLSLstar _ a a' -> e_relLSLstar _ (app a b) (app a' b). (* Goal: forall (s s' : sub_explicits) (_ : e_relLSLstar ws s s'), e_relLSLstar ws (lift s) (lift s') *) red in |- *; simple induction 1; intros. (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) auto. (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) apply star_trans1 with (app y b); auto. Save LSLstar_context_app_l. Hint Resolve LSLstar_context_app_l. Goal forall a b b' : terms, e_relLSLstar _ b b' -> e_relLSLstar _ (app a b) (app a b'). (* Goal: forall (s s' : sub_explicits) (_ : e_relLSLstar ws s s'), e_relLSLstar ws (lift s) (lift s') *) red in |- *; simple induction 1; intros. (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) auto. (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) apply star_trans1 with (app a y); auto. Save LSLstar_context_app_r. Hint Resolve LSLstar_context_app_r. Goal forall a a' b b' : terms, e_relLSLstar _ a a' -> e_relLSLstar _ b b' -> e_relLSLstar _ (app a b) (app a' b'). (* Goal: forall (s s' t t' : sub_explicits) (_ : e_relLSLstar ws t t') (_ : e_relLSLstar ws s s'), e_relLSLstar ws (comp s t) (comp s' t') *) intros; red in |- *. (* Goal: explicit_star (TS wt) (e_relLSL wt) (app a b) (app a' b') *) apply star_trans with (app a' b). (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) change (e_relLSLstar _ (app a b) (app a' b)) in |- *; auto. (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) change (e_relLSLstar _ (app a' b) (app a' b')) in |- *; auto. Save LSLstar_context_app. Hint Resolve LSLstar_context_app. Goal forall a a' : terms, e_relLSLstar _ a a' -> e_relLSLstar _ (lambda a) (lambda a'). (* Goal: forall (s s' : sub_explicits) (_ : e_relLSLstar ws s s'), e_relLSLstar ws (lift s) (lift s') *) red in |- *; simple induction 1; intros. (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) auto. (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) apply star_trans1 with (lambda y); auto. Save LSLstar_context_lambda. Hint Resolve LSLstar_context_lambda. Goal forall (a a' : terms) (s : sub_explicits), e_relLSLstar _ a a' -> e_relLSLstar _ (env a s) (env a' s). (* Goal: forall (s s' : sub_explicits) (_ : e_relLSLstar ws s s'), e_relLSLstar ws (lift s) (lift s') *) red in |- *; simple induction 1; intros. (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) auto. (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) apply star_trans1 with (env y s); auto. Save LSLstar_context_env_t. Hint Resolve LSLstar_context_env_t. Goal forall (a : terms) (s s' : sub_explicits), e_relLSLstar _ s s' -> e_relLSLstar _ (env a s) (env a s'). (* Goal: forall (s s' : sub_explicits) (_ : e_relLSLstar ws s s'), e_relLSLstar ws (lift s) (lift s') *) red in |- *; simple induction 1; intros. (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) auto. (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) apply star_trans1 with (env a y); auto. Save LSLstar_context_env_s. Hint Resolve LSLstar_context_env_s. Goal forall (a a' : terms) (s s' : sub_explicits), e_relLSLstar _ a a' -> e_relLSLstar _ s s' -> e_relLSLstar _ (env a s) (env a' s'). (* Goal: forall (s s' t t' : sub_explicits) (_ : e_relLSLstar ws t t') (_ : e_relLSLstar ws s s'), e_relLSLstar ws (comp s t) (comp s' t') *) intros; red in |- *. (* Goal: explicit_star (TS wt) (e_relLSL wt) (env a s) (env a' s') *) apply star_trans with (env a' s). (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) change (e_relLSLstar _ (env a s) (env a' s)) in |- *; auto. (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) change (e_relLSLstar _ (env a' s) (env a' s')) in |- *; auto. Save LSLstar_context_env. Hint Resolve LSLstar_context_env. Goal forall (a a' : terms) (s : sub_explicits), e_relLSLstar _ a a' -> e_relLSLstar _ (cons a s) (cons a' s). (* Goal: forall (s s' : sub_explicits) (_ : e_relLSLstar ws s s'), e_relLSLstar ws (lift s) (lift s') *) red in |- *; simple induction 1; intros. (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) auto. (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) apply star_trans1 with (cons y s); auto. Save LSLstar_context_cons_t. Hint Resolve LSLstar_context_cons_t. Goal forall (a : terms) (s s' : sub_explicits), e_relLSLstar _ s s' -> e_relLSLstar _ (cons a s) (cons a s'). (* Goal: forall (s s' : sub_explicits) (_ : e_relLSLstar ws s s'), e_relLSLstar ws (lift s) (lift s') *) red in |- *; simple induction 1; intros. (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) auto. (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) apply star_trans1 with (cons a y); auto. Save LSLstar_context_cons_s. Hint Resolve LSLstar_context_cons_s. Goal forall (a a' : terms) (s s' : sub_explicits), e_relLSLstar _ a a' -> e_relLSLstar _ s s' -> e_relLSLstar _ (cons a s) (cons a' s'). (* Goal: forall (s s' t t' : sub_explicits) (_ : e_relLSLstar ws t t') (_ : e_relLSLstar ws s s'), e_relLSLstar ws (comp s t) (comp s' t') *) intros; red in |- *. (* Goal: explicit_star (TS ws) (e_relLSL ws) (cons a s) (cons a' s') *) apply star_trans with (cons a' s). (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) change (e_relLSLstar _ (cons a s) (cons a' s)) in |- *; auto. (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) change (e_relLSLstar _ (cons a' s) (cons a' s')) in |- *; auto. Save LSLstar_context_cons. Hint Resolve LSLstar_context_cons. Goal forall s s' t : sub_explicits, e_relLSLstar _ s s' -> e_relLSLstar _ (comp s t) (comp s' t). (* Goal: forall (s s' : sub_explicits) (_ : e_relLSLstar ws s s'), e_relLSLstar ws (lift s) (lift s') *) red in |- *; simple induction 1; intros. (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) auto. (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) apply star_trans1 with (comp y t); auto. Save LSLstar_context_comp_l. Hint Resolve LSLstar_context_comp_l. Goal forall s t t' : sub_explicits, e_relLSLstar _ t t' -> e_relLSLstar _ (comp s t) (comp s t'). (* Goal: forall (s s' : sub_explicits) (_ : e_relLSLstar ws s s'), e_relLSLstar ws (lift s) (lift s') *) red in |- *; simple induction 1; intros. (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) auto. (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) apply star_trans1 with (comp s y); auto. Save LSLstar_context_comp_r. Hint Resolve LSLstar_context_comp_r. Goal forall s s' t t' : sub_explicits, e_relLSLstar _ t t' -> e_relLSLstar _ s s' -> e_relLSLstar _ (comp s t) (comp s' t'). (* Goal: forall (s s' t t' : sub_explicits) (_ : e_relLSLstar ws t t') (_ : e_relLSLstar ws s s'), e_relLSLstar ws (comp s t) (comp s' t') *) intros; red in |- *. (* Goal: explicit_star (TS ws) (e_relLSL ws) (comp s t) (comp s' t') *) apply star_trans with (comp s' t). (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) change (e_relLSLstar _ (comp s t) (comp s' t)) in |- *; auto. (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) change (e_relLSLstar _ (comp s' t) (comp s' t')) in |- *; auto. Save LSLstar_context_comp. Hint Resolve LSLstar_context_comp. Goal forall s s' : sub_explicits, e_relLSLstar _ s s' -> e_relLSLstar _ (lift s) (lift s'). (* Goal: forall (s s' : sub_explicits) (_ : e_relLSLstar ws s s'), e_relLSLstar ws (lift s) (lift s') *) red in |- *; simple induction 1; intros. (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) auto. (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relLSL ws) (lift x) (lift z) *) apply star_trans1 with (lift y); auto. Save LSLstar_context_lift. Hint Resolve LSLstar_context_lift.
(* Contribution to the Coq Library V6.3 (July 1999) *) (****************************************************************************) (* The Calculus of Inductive Constructions *) (* *) (* Projet Coq *) (* *) (* INRIA ENS-CNRS *) (* Rocquencourt Lyon *) (* *) (* Coq V5.10 *) (* Nov 25th 1994 *) (* *) (****************************************************************************) (* sigma_lift.v *) (****************************************************************************) (*****************************************************************************) (* Projet Coq - Calculus of Inductive Constructions V5.8 *) (*****************************************************************************) (* *) (* Meta-theory of the explicit substitution calculus lambda-env *) (* Amokrane Saibi *) (* *) (* September 1993 *) (* *) (*****************************************************************************) (* Systeme sigma-lift *) Require Import TS. Require Import sur_les_relations. (* regles de reecriture *) Inductive reg_app : terms -> terms -> Prop := reg1_app : forall (a b : terms) (s : sub_explicits), reg_app (env (app a b) s) (app (env a s) (env b s)). Hint Resolve reg1_app. Inductive reg_lambda : terms -> terms -> Prop := reg1_lambda : forall (a : terms) (s : sub_explicits), reg_lambda (env (lambda a) s) (lambda (env a (lift s))). Hint Resolve reg1_lambda. Inductive reg_clos : terms -> terms -> Prop := reg1_clos : forall (a : terms) (s t : sub_explicits), reg_clos (env (env a s) t) (env a (comp s t)). Hint Resolve reg1_clos. Inductive reg_varshift1 : terms -> terms -> Prop := reg1_varshift1 : forall n : nat, reg_varshift1 (env (var n) shift) (var (S n)). Hint Resolve reg1_varshift1. Inductive reg_varshift2 : terms -> terms -> Prop := reg1_varshift2 : forall (n : nat) (s : sub_explicits), reg_varshift2 (env (var n) (comp shift s)) (env (var (S n)) s). Hint Resolve reg1_varshift2. Inductive reg_fvarcons : terms -> terms -> Prop := reg1_fvarcons : forall (a : terms) (s : sub_explicits), reg_fvarcons (env (var 0) (cons a s)) a. Hint Resolve reg1_fvarcons. Inductive reg_fvarlift1 : terms -> terms -> Prop := reg1_fvarlift1 : forall s : sub_explicits, reg_fvarlift1 (env (var 0) (lift s)) (var 0). Hint Resolve reg1_fvarlift1. Inductive reg_fvarlift2 : terms -> terms -> Prop := reg1_fvarlift2 : forall s t : sub_explicits, reg_fvarlift2 (env (var 0) (comp (lift s) t)) (env (var 0) t). Hint Resolve reg1_fvarlift2. Inductive reg_rvarcons : terms -> terms -> Prop := reg1_rvarcons : forall (n : nat) (a : terms) (s : sub_explicits), reg_rvarcons (env (var (S n)) (cons a s)) (env (var n) s). Hint Resolve reg1_rvarcons. Inductive reg_rvarlift1 : terms -> terms -> Prop := reg1_rvarlift1 : forall (n : nat) (s : sub_explicits), reg_rvarlift1 (env (var (S n)) (lift s)) (env (var n) (comp s shift)). Hint Resolve reg1_rvarlift1. Inductive reg_rvarlift2 : terms -> terms -> Prop := reg1_rvarlift2 : forall (n : nat) (s t : sub_explicits), reg_rvarlift2 (env (var (S n)) (comp (lift s) t)) (env (var n) (comp s (comp shift t))). Hint Resolve reg1_rvarlift2. Inductive reg_assenv : sub_explicits -> sub_explicits -> Prop := reg1_assenv : forall s t u : sub_explicits, reg_assenv (comp (comp s t) u) (comp s (comp t u)). Hint Resolve reg1_assenv. Inductive reg_mapenv : sub_explicits -> sub_explicits -> Prop := reg1_mapenv : forall (a : terms) (s t : sub_explicits), reg_mapenv (comp (cons a s) t) (cons (env a t) (comp s t)). Hint Resolve reg1_mapenv. Inductive reg_shiftcons : sub_explicits -> sub_explicits -> Prop := reg1_shiftcons : forall (a : terms) (s : sub_explicits), reg_shiftcons (comp shift (cons a s)) s. Hint Resolve reg1_shiftcons. Inductive reg_shiftlift1 : sub_explicits -> sub_explicits -> Prop := reg1_shiftlift1 : forall s : sub_explicits, reg_shiftlift1 (comp shift (lift s)) (comp s shift). Hint Resolve reg1_shiftlift1. Inductive reg_shiftlift2 : sub_explicits -> sub_explicits -> Prop := reg1_shiftlift2 : forall s t : sub_explicits, reg_shiftlift2 (comp shift (comp (lift s) t)) (comp s (comp shift t)). Hint Resolve reg1_shiftlift2. Inductive reg_lift1 : sub_explicits -> sub_explicits -> Prop := reg1_lift1 : forall s t : sub_explicits, reg_lift1 (comp (lift s) (lift t)) (lift (comp s t)). Hint Resolve reg1_lift1. Inductive reg_lift2 : sub_explicits -> sub_explicits -> Prop := reg1_lift2 : forall s t u : sub_explicits, reg_lift2 (comp (lift s) (comp (lift t) u)) (comp (lift (comp s t)) u). Hint Resolve reg1_lift2. Inductive reg_liftenv : sub_explicits -> sub_explicits -> Prop := reg1_liftenv : forall (a : terms) (s t : sub_explicits), reg_liftenv (comp (lift s) (cons a t)) (cons a (comp s t)). Hint Resolve reg1_liftenv. Inductive reg_idl : sub_explicits -> sub_explicits -> Prop := reg1_idl : forall s : sub_explicits, reg_idl (comp id s) s. Hint Resolve reg1_idl. Inductive reg_idr : sub_explicits -> sub_explicits -> Prop := reg1_idr : forall s : sub_explicits, reg_idr (comp s id) s. Hint Resolve reg1_idr. Inductive reg_liftid : sub_explicits -> sub_explicits -> Prop := reg1_liftid : reg_liftid (lift id) id. Hint Resolve reg1_liftid. Inductive reg_id : terms -> terms -> Prop := reg1_id : forall a : terms, reg_id (env a id) a. Hint Resolve reg1_id. (* systeme sigma-lift *) Inductive e_systemSL : forall b : wsort, TS b -> TS b -> Prop := | regle_app : forall a b : terms, reg_app a b -> e_systemSL wt a b | regle_lambda : forall a b : terms, reg_lambda a b -> e_systemSL wt a b | regle_clos : forall a b : terms, reg_clos a b -> e_systemSL wt a b | regle_varshift1 : forall a b : terms, reg_varshift1 a b -> e_systemSL wt a b | regle_varshift2 : forall a b : terms, reg_varshift2 a b -> e_systemSL wt a b | regle_fvarcons : forall a b : terms, reg_fvarcons a b -> e_systemSL wt a b | regle_fvarlift1 : forall a b : terms, reg_fvarlift1 a b -> e_systemSL wt a b | regle_fvarlift2 : forall a b : terms, reg_fvarlift2 a b -> e_systemSL wt a b | regle_rvarcons : forall a b : terms, reg_rvarcons a b -> e_systemSL wt a b | regle_rvarlift1 : forall a b : terms, reg_rvarlift1 a b -> e_systemSL wt a b | regle_rvarlift2 : forall a b : terms, reg_rvarlift2 a b -> e_systemSL wt a b | regle_assenv : forall s t : sub_explicits, reg_assenv s t -> e_systemSL ws s t | regle_mapenv : forall s t : sub_explicits, reg_mapenv s t -> e_systemSL ws s t | regle_shiftcons : forall s t : sub_explicits, reg_shiftcons s t -> e_systemSL ws s t | regle_shiftlift1 : forall s t : sub_explicits, reg_shiftlift1 s t -> e_systemSL ws s t | regle_shiftlift2 : forall s t : sub_explicits, reg_shiftlift2 s t -> e_systemSL ws s t | regle_lift1 : forall s t : sub_explicits, reg_lift1 s t -> e_systemSL ws s t | regle_lift2 : forall s t : sub_explicits, reg_lift2 s t -> e_systemSL ws s t | regle_liftenv : forall s t : sub_explicits, reg_liftenv s t -> e_systemSL ws s t | regle_idl : forall s t : sub_explicits, reg_idl s t -> e_systemSL ws s t | regle_idr : forall s t : sub_explicits, reg_idr s t -> e_systemSL ws s t | regle_liftid : forall s t : sub_explicits, reg_liftid s t -> e_systemSL ws s t | regle_id : forall a b : terms, reg_id a b -> e_systemSL wt a b. Notation systemSL := (e_systemSL _) (only parsing). (* <Warning> : Syntax is discontinued *) Hint Resolve regle_app regle_lambda regle_clos regle_varshift1 regle_varshift2 regle_fvarcons regle_fvarlift1 regle_fvarlift2 regle_rvarcons regle_rvarlift1 regle_rvarlift2 regle_assenv regle_mapenv regle_shiftcons regle_shiftlift1 regle_shiftlift2 regle_lift1 regle_lift2 regle_liftenv regle_idl regle_idr regle_liftid regle_id. (* relation engendree par le systeme sigma-lift *) Inductive e_relSL : forall b : wsort, TS b -> TS b -> Prop := | SL_one_regle : forall (b : wsort) (M N : TS b), e_systemSL _ M N -> e_relSL b M N | SL_context_app_l : forall a a' b : terms, e_relSL wt a a' -> e_relSL wt (app a b) (app a' b) | SL_context_app_r : forall a b b' : terms, e_relSL wt b b' -> e_relSL wt (app a b) (app a b') | SL_context_lambda : forall a a' : terms, e_relSL wt a a' -> e_relSL wt (lambda a) (lambda a') | SL_context_env_t : forall (a a' : terms) (s : sub_explicits), e_relSL wt a a' -> e_relSL wt (env a s) (env a' s) | SL_context_env_s : forall (a : terms) (s s' : sub_explicits), e_relSL ws s s' -> e_relSL wt (env a s) (env a s') | SL_context_cons_t : forall (a a' : terms) (s : sub_explicits), e_relSL wt a a' -> e_relSL ws (cons a s) (cons a' s) | SL_context_cons_s : forall (a : terms) (s s' : sub_explicits), e_relSL ws s s' -> e_relSL ws (cons a s) (cons a s') | SL_context_comp_l : forall s s' t : sub_explicits, e_relSL ws s s' -> e_relSL ws (comp s t) (comp s' t) | SL_context_comp_r : forall s t t' : sub_explicits, e_relSL ws t t' -> e_relSL ws (comp s t) (comp s t') | SL_context_lift : forall s s' : sub_explicits, e_relSL ws s s' -> e_relSL ws (lift s) (lift s'). Notation relSL := (e_relSL _) (only parsing). (* <Warning> : Syntax is discontinued *) Hint Resolve SL_one_regle SL_context_app_l SL_context_app_r SL_context_lambda SL_context_env_t SL_context_env_s SL_context_cons_t SL_context_cons_s SL_context_comp_l SL_context_comp_r SL_context_lift. (* fermeture reflexive-transitive de la relation sigma-lift *) Definition e_relSLstar (b : wsort) := explicit_star _ (e_relSL b). Notation relSLstar := (e_relSLstar _) (only parsing). (* <Warning> : Syntax is discontinued *) Hint Unfold e_relSLstar. (* *) Goal forall a a' b : terms, e_relSLstar _ a a' -> e_relSLstar _ (app a b) (app a' b). (* Goal: forall (s s' : sub_explicits) (_ : e_relSLstar ws s s'), e_relSLstar ws (lift s) (lift s') *) red in |- *; simple induction 1; intros. (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift z) *) auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift z) *) apply star_trans1 with (app y b); auto. Save SLstar_context_app_l. Hint Resolve SLstar_context_app_l. Goal forall a b b' : terms, e_relSLstar _ b b' -> e_relSLstar _ (app a b) (app a b'). (* Goal: forall (s s' : sub_explicits) (_ : e_relSLstar ws s s'), e_relSLstar ws (lift s) (lift s') *) red in |- *; simple induction 1; intros. (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift z) *) auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift z) *) apply star_trans1 with (app a y); auto. Save SLstar_context_app_r. Hint Resolve SLstar_context_app_r. Goal forall a a' : terms, e_relSLstar _ a a' -> e_relSLstar _ (lambda a) (lambda a'). (* Goal: forall (s s' : sub_explicits) (_ : e_relSLstar ws s s'), e_relSLstar ws (lift s) (lift s') *) red in |- *; simple induction 1; intros. (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift z) *) auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift z) *) apply star_trans1 with (lambda y); auto. Save SLstar_context_lambda. Hint Resolve SLstar_context_lambda. Goal forall (a a' : terms) (s : sub_explicits), e_relSLstar _ a a' -> e_relSLstar _ (env a s) (env a' s). (* Goal: forall (s s' : sub_explicits) (_ : e_relSLstar ws s s'), e_relSLstar ws (lift s) (lift s') *) red in |- *; simple induction 1; intros. (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift z) *) auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift z) *) apply star_trans1 with (env y s); auto. Save SLstar_context_env_t. Hint Resolve SLstar_context_env_t. Goal forall (a : terms) (s s' : sub_explicits), e_relSLstar _ s s' -> e_relSLstar _ (env a s) (env a s'). (* Goal: forall (s s' : sub_explicits) (_ : e_relSLstar ws s s'), e_relSLstar ws (lift s) (lift s') *) red in |- *; simple induction 1; intros. (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift z) *) auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift z) *) apply star_trans1 with (env a y); auto. Save SLstar_context_env_s. Hint Resolve SLstar_context_env_s. Goal forall (a a' : terms) (s : sub_explicits), e_relSLstar _ a a' -> e_relSLstar _ (cons a s) (cons a' s). (* Goal: forall (s s' : sub_explicits) (_ : e_relSLstar ws s s'), e_relSLstar ws (lift s) (lift s') *) red in |- *; simple induction 1; intros. (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift z) *) auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift z) *) apply star_trans1 with (cons y s); auto. Save SLstar_context_cons_t. Hint Resolve SLstar_context_cons_t. Goal forall (a : terms) (s s' : sub_explicits), e_relSLstar _ s s' -> e_relSLstar _ (cons a s) (cons a s'). (* Goal: forall (s s' : sub_explicits) (_ : e_relSLstar ws s s'), e_relSLstar ws (lift s) (lift s') *) red in |- *; simple induction 1; intros. (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift z) *) auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift z) *) apply star_trans1 with (cons a y); auto. Save SLstar_context_cons_s. Hint Resolve SLstar_context_cons_s. Goal forall s s' t : sub_explicits, e_relSLstar _ s s' -> e_relSLstar _ (comp s t) (comp s' t). (* Goal: forall (s s' : sub_explicits) (_ : e_relSLstar ws s s'), e_relSLstar ws (lift s) (lift s') *) red in |- *; simple induction 1; intros. (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift z) *) auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift z) *) apply star_trans1 with (comp y t); auto. Save SLstar_context_comp_l. Hint Resolve SLstar_context_comp_l. Goal forall s t t' : sub_explicits, e_relSLstar _ t t' -> e_relSLstar _ (comp s t) (comp s t'). (* Goal: forall (s s' : sub_explicits) (_ : e_relSLstar ws s s'), e_relSLstar ws (lift s) (lift s') *) red in |- *; simple induction 1; intros. (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift z) *) auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift z) *) apply star_trans1 with (comp s y); auto. Save SLstar_context_comp_r. Hint Resolve SLstar_context_comp_r. Goal forall s s' : sub_explicits, e_relSLstar _ s s' -> e_relSLstar _ (lift s) (lift s'). (* Goal: forall (s s' : sub_explicits) (_ : e_relSLstar ws s s'), e_relSLstar ws (lift s) (lift s') *) red in |- *; simple induction 1; intros. (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift z) *) auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift x) *) (* Goal: explicit_star (TS ws) (e_relSL ws) (lift x) (lift z) *) apply star_trans1 with (lift y); auto. Save SLstar_context_lift. Hint Resolve SLstar_context_lift.
(* Contribution to the Coq Library V6.3 (July 1999) *) (****************************************************************************) (* The Calculus of Inductive Constructions *) (* *) (* Projet Coq *) (* *) (* INRIA ENS-CNRS *) (* Rocquencourt Lyon *) (* *) (* Coq V5.10 *) (* Nov 25th 1994 *) (* *) (****************************************************************************) (* commutation.v *) (****************************************************************************) (*****************************************************************************) (* Projet Coq - Calculus of Inductive Constructions V5.8 *) (*****************************************************************************) (* *) (* Meta-theory of the explicit substitution calculus lambda-env *) (* Amokrane Saibi *) (* *) (* September 1993 *) (* *) (*****************************************************************************) (* SL commute avec B|| de la maniere suivante: B|| x ---------> z | | SL | |SL* | | V V y ----------> u SL*B||SL* *) Require Import sur_les_relations. Require Import TS. Require Import egaliteTS. Require Import sigma_lift. Require Import betapar. Require Import SLstar_bpar_SLstar. Require Import determinePC_SL. Definition e_diag1 (b : wsort) (x y : TS b) := forall z : TS b, e_beta_par _ x z -> exists u : TS b, e_slstar_bp_slstar _ y u /\ e_relSLstar _ z u. Notation diag1 := (e_diag1 _) (only parsing). (* <Warning> : Syntax is discontinued *) (* les regles du systeme sigma-lift (SL) verifient le diagramme *) Goal forall x y : terms, reg_app x y -> e_diag1 _ x y. simple induction 1; red in |- *; intros a b0 s z H0. pattern z in |- *; apply case_benv with (app a b0) s. 2: assumption. intros x' s' H1 H2; pattern x' in |- *; apply case_bapp with a b0. 3: assumption. (* 1-regle B||: app *) intros a' b0' H3 H4; exists (app (env a' s') (env b0' s')); auto 6. (* (a[s])(b0[s]) SL*B||SL* (a'[s'])(b0'[s']) *) (* (a'b0')[s'] SL* (a'[s'])(b0'[s']) *) (* 2-regle B||: beta *) intros a1 a1' b0' H3 H4 H5; rewrite H3. exists (env a1' (cons (env b0' s') s')); split. (* ((L a1)[s])(b0[s]) SL*B||SL* a1'[b0'[s'].s'] *) red in |- *; apply comp_2rel with (app (lambda (env a1 (lift s))) (env b0 s)). (* ((L a1)[s])(b0[s]) SL* (L (a1[||S]))(b0[s]) *) auto 6. (* (L (a1[||S]))(b0[s]) B|| (a1'[||s'])[b0'[s'].id] *) apply comp_2rel with (env (env a1' (lift s')) (cons (env b0' s') id)). auto. (* (a1'[||s'])[b0'[s'].id] SL* a1'[b0'[s'].s'] *) red in |- *; apply star_trans1 with (env a1' (comp (lift s') (cons (env b0' s') id))). auto. apply star_trans1 with (env a1' (cons (env b0' s') (comp s' id))); auto 6. (* (a1'[b0'id])[s'] SL* a1'[b0'[s'].s'] *) red in |- *; apply star_trans1 with (env a1' (comp (cons b0' id) s')). auto. apply star_trans1 with (env a1' (cons (env b0' s') (comp id s'))); auto 6. Save commut_app. Hint Resolve commut_app. Goal forall x y : terms, reg_lambda x y -> e_diag1 _ x y. simple induction 1; red in |- *; intros a s z H0. pattern z in |- *; apply case_benv with (lambda a) s. 2: assumption. intros x' s' H1 H2; pattern x' in |- *; apply case_blambda with a. 2: assumption. intros a' H3; exists (lambda (env a' (lift s'))); auto 6. (* L(a[||s]) SL*B||*SL L(a'[||s']) *) (* (L a0')[s'] SL* L(a0'[||s']) *) Save commut_lambda. Hint Resolve commut_lambda. Goal forall x y : terms, reg_clos x y -> e_diag1 _ x y. simple induction 1; red in |- *; intros a s t z H0. pattern z in |- *; apply case_benv with (env a s) t. 2: assumption. intros x' t' H1 H2; pattern x' in |- *; apply case_benv with a s. 2: assumption. intros a' s' H3 H4; exists (env a' (comp s' t')); auto 6. (* a[sot] SL*B||SL* a'[s'ot'] *) (* (a'[s'])[t'] SL* a'[s'ot'] *) Save commut_clos. Hint Resolve commut_clos. Goal forall x y : terms, reg_varshift1 x y -> e_diag1 _ x y. simple induction 1; red in |- *; intros n z H0. pattern z in |- *; apply case_benv with (var n) shift. 2: assumption. intros x' s' H1 H2; pattern x' in |- *; apply case_bvar with n. 2: assumption. pattern s' in |- *; apply case_bshift. 2: assumption. exists (var (S n)); auto 6. (* n+1 SL*B||SL* n+1 *) (* n[|] SL* n+1 *) Save commut_varshift1. Hint Resolve commut_varshift1. Goal forall x y : terms, reg_varshift2 x y -> e_diag1 _ x y. simple induction 1; red in |- *; intros n s z H0. pattern z in |- *; apply case_benv with (var n) (comp shift s). 2: assumption. intros x' y' H1 H2; pattern x' in |- *; apply case_bvar with n. 2: assumption. pattern y' in |- *; apply case_bcomp with shift s. 2: assumption. intros t' s' H3 H4; pattern t' in |- *; apply case_bshift. 2: assumption. exists (env (var (S n)) s'); auto 6. (* n+1[s] SL*B||SL* n+1[s'] *) (* n[|os'] SL* n+1[s'] *) Save commut_varshift2. Hint Resolve commut_varshift2. Goal forall x y : terms, reg_fvarcons x y -> e_diag1 _ x y. simple induction 1; red in |- *; intros a s z H0. pattern z in |- *; apply case_benv with (var 0) (cons a s). 2: assumption. intros x' y' H1 H2; pattern x' in |- *; apply case_bvar with 0. 2: assumption. pattern y' in |- *; apply case_bcons with a s. 2: assumption. intros a' s' H3 H4; exists a'; auto 6. (* a SL*B||SL* a' *) (* 0[a'.s'] SL* a' *) Save commut_fvarcons. Hint Resolve commut_fvarcons. Goal forall x y : terms, reg_fvarlift1 x y -> e_diag1 _ x y. simple induction 1; red in |- *; intros s z H0. pattern z in |- *; apply case_benv with (var 0) (lift s). 2: assumption. intros x' y' H1 H2; pattern x' in |- *; apply case_bvar with 0. 2: assumption. pattern y' in |- *; apply case_blift with s. 2: assumption. intros s' H3; exists (var 0); auto 6. (* 0 SL*B||SL* 0 *) (* 0[||s'] SL* 0 *) Save commut_fvarlift1. Hint Resolve commut_fvarlift1. Goal forall x y : terms, reg_fvarlift2 x y -> e_diag1 _ x y. simple induction 1; red in |- *; intros s t z H0. pattern z in |- *; apply case_benv with (var 0) (comp (lift s) t). 2: assumption. intros x' y' H1 H2; pattern x' in |- *; apply case_bvar with 0. 2: assumption. pattern y' in |- *; apply case_bcomp with (lift s) t. 2: assumption. intros z' t' H3 H4; pattern z' in |- *; apply case_blift with s. 2: assumption. intros s' H5; exists (env (var 0) t'); auto 6. (* 0[t] SL*B||SL* 0[t'] *) (* 0[||s'ot'] SL* 0[t'] *) Save commut_fvarlift2. Hint Resolve commut_fvarlift2. Goal forall x y : terms, reg_rvarcons x y -> e_diag1 _ x y. simple induction 1; red in |- *; intros n a s z H0. pattern z in |- *; apply case_benv with (var (S n)) (cons a s). 2: assumption. intros x' y' H1 H2; pattern x' in |- *; apply case_bvar with (S n). 2: assumption. pattern y' in |- *; apply case_bcons with a s. 2: assumption. intros a' s' H3 H4; exists (env (var n) s'); auto 6. (* n[s] SL*B||SL* n[s'] *) (* n+1[a'.s'] SL* n[s'] *) Save commut_rvarcons. Hint Resolve commut_rvarcons. Goal forall x y : terms, reg_rvarlift1 x y -> e_diag1 _ x y. simple induction 1; red in |- *; intros n s z H0. pattern z in |- *; apply case_benv with (var (S n)) (lift s). 2: assumption. intros x' y' H1 H2; pattern x' in |- *; apply case_bvar with (S n). 2: assumption. pattern y' in |- *; apply case_blift with s. 2: assumption. intros s' H3; exists (env (var n) (comp s' shift)); auto 6. (* n[so|] SL*B||SL* n[s'o|] *) (* n+1[||s'] SL* n[s'o|] *) Save commut_rvarlift1. Hint Resolve commut_rvarlift1. Goal forall x y : terms, reg_rvarlift2 x y -> e_diag1 _ x y. simple induction 1; red in |- *; intros n s t z H0. pattern z in |- *; apply case_benv with (var (S n)) (comp (lift s) t). 2: assumption. intros x' y' H1 H2; pattern x' in |- *; apply case_bvar with (S n). 2: assumption. pattern y' in |- *; apply case_bcomp with (lift s) t. 2: assumption. intros z' t' H3 H4; pattern z' in |- *; apply case_blift with s. 2: assumption. intros s' H5; exists (env (var n) (comp s' (comp shift t'))); auto 6. (* n[so(|ot)] SL*B||SL* n[s'o(|ot')] *) (* n+1[||s'ot'] SL* n[s'o(|ot')] *) Save commut_rvarlift2. Hint Resolve commut_rvarlift2. Goal forall x y : sub_explicits, reg_assenv x y -> e_diag1 _ x y. simple induction 1; red in |- *; intros s t u z H0. pattern z in |- *; apply case_bcomp with (comp s t) u. 2: assumption. intros x' u' H1 H2; pattern x' in |- *; apply case_bcomp with s t. 2: assumption. intros s' t' H3 H4; exists (comp s' (comp t' u')); auto 6. (* so(tou) SL*B||SL* s'o(t'ou') *) (* (s'ot')ou' SL* s'o(t'ou') *) Save commut_assenv. Hint Resolve commut_assenv. Goal forall x y : sub_explicits, reg_mapenv x y -> e_diag1 _ x y. simple induction 1; red in |- *; intros a s t z H0. pattern z in |- *; apply case_bcomp with (cons a s) t. 2: assumption. intros x' t' H1 H2; pattern x' in |- *; apply case_bcons with a s. 2: assumption. intros a' s' H3 H4; exists (cons (env a' t') (comp s' t')); auto 6. (* a[t].(sot) SL*B||SL a'[t'].(s'ot') *) (* (a'.s')ot' SL* a'[t'].(s'ot') *) Save commut_mapenv. Hint Resolve commut_mapenv. Goal forall x y : sub_explicits, reg_shiftcons x y -> e_diag1 _ x y. simple induction 1; red in |- *; intros a s z H0. pattern z in |- *; apply case_bcomp with shift (cons a s). 2: assumption. intros x' y' H1 H2; pattern x' in |- *; apply case_bshift. 2: assumption. pattern y' in |- *; apply case_bcons with a s. 2: assumption. intros a' s' H3 H4; exists s'; auto 6. (* s SL*B||SL* s' *) (* shift o(a'.s') SL* s' *) Save commut_shiftcons. Hint Resolve commut_shiftcons. Goal forall x y : sub_explicits, reg_shiftlift1 x y -> e_diag1 _ x y. simple induction 1; red in |- *; intros s z H0. pattern z in |- *; apply case_bcomp with shift (lift s). 2: assumption. intros x' y' H1 H2; pattern x' in |- *; apply case_bshift. 2: assumption. pattern y' in |- *; apply case_blift with s. 2: assumption. intros s' H3; exists (comp s' shift); auto 6. (* so| SL*B||SL* s'o| *) (* |o(|| s') SL* s'o| *) Save commut_shiftlift1. Hint Resolve commut_shiftlift1. Goal forall x y : sub_explicits, reg_shiftlift2 x y -> e_diag1 _ x y. simple induction 1; red in |- *; intros s t z H0. pattern z in |- *; apply case_bcomp with shift (comp (lift s) t). 2: assumption. intros x' y' H1 H2; pattern x' in |- *; apply case_bshift. 2: assumption. pattern y' in |- *; apply case_bcomp with (lift s) t. 2: assumption. intros z' t' H3 H4; pattern z' in |- *; apply case_blift with s. 2: assumption. intros s' H5; exists (comp s' (comp shift t')); auto 6. (* so(|ot) SL*B||SL* s'o(|ot') *) (* (|| s')ot' SL* s'o(|ot') *) Save commut_shiftlift2. Hint Resolve commut_shiftlift2. Goal forall x y : sub_explicits, reg_lift1 x y -> e_diag1 _ x y. simple induction 1; red in |- *; intros s t z H0. pattern z in |- *; apply case_bcomp with (lift s) (lift t). 2: assumption. intros x' y' H1 H2; pattern x' in |- *; apply case_blift with s. 2: assumption. intros s' H3; pattern y' in |- *; apply case_blift with t. 2: assumption. intros t' H4; exists (lift (comp s' t')); auto 6. (* ||(sot) SL*B||SL* ||(s'ot') *) (* ||s' o ||t' SL* ||(s'ot') *) Save commut_lift1. Hint Resolve commut_lift1. Goal forall x y : sub_explicits, reg_lift2 x y -> e_diag1 _ x y. simple induction 1; red in |- *; intros s t u z H0. pattern z in |- *; apply case_bcomp with (lift s) (comp (lift t) u). 2: assumption. intros x' y' H1 H2; pattern x' in |- *; apply case_blift with s. 2: assumption. intros s' H3; pattern y' in |- *; apply case_bcomp with (lift t) u. 2: assumption. intros z' u' H4 H5; pattern z' in |- *; apply case_blift with t. 2: assumption. intros t' H6; exists (comp (lift (comp s' t')) u'); auto 6. (* ||(sot)ou SL*B||SL* ||(s'ot')ou' *) (* ||s'o(||t'ou') SL* ||(s'ot')ou' *) Save commut_lift2. Hint Resolve commut_lift2. Goal forall x y : sub_explicits, reg_liftenv x y -> e_diag1 _ x y. simple induction 1; red in |- *; intros a s t z H0. pattern z in |- *; apply case_bcomp with (lift s) (cons a t). 2: assumption. intros x' y' H1 H2; pattern x' in |- *; apply case_blift with s. 2: assumption. intros s' H3; pattern y' in |- *; apply case_bcons with a t. 2: assumption. intros a' t' H4 H5; exists (cons a' (comp s' t')); auto 6. (* a.(sot) SL*B||SL* a'.(s'ot') *) (* ||s'o(a'.t') SL* a'.(s'ot') *) Save commut_liftenv. Hint Resolve commut_liftenv. Goal forall x y : sub_explicits, reg_idl x y -> e_diag1 _ x y. simple induction 1; red in |- *; intros s z H0. pattern z in |- *; apply case_bcomp with id s. 2: assumption. intros x' s' H1 H2; pattern x' in |- *; apply case_bid. 2: assumption. exists s'; auto 6. (* s SL*B||SL* s' *) (* idos' SL* s' *) Save commut_idl. Hint Resolve commut_idl. Goal forall x y : sub_explicits, reg_idr x y -> e_diag1 _ x y. simple induction 1; red in |- *; intros s z H0. pattern z in |- *; apply case_bcomp with s id. 2: assumption. intros s' x' H1 H2; pattern x' in |- *; apply case_bid. 2: assumption. exists s'; auto 6. (* s SL*B||SL* s' *) (* s'oid SL* s' *) Save commut_idr. Hint Resolve commut_idr. Goal forall x y : sub_explicits, reg_liftid x y -> e_diag1 _ x y. simple induction 1; red in |- *; intros z H0. pattern z in |- *; apply case_blift with id. 2: assumption. intros x' H1; pattern x' in |- *; apply case_bid. 2: assumption. exists id; auto 6. (* id SL*B||SL* id *) (* ||id SL* id *) Save commut_liftid. Hint Resolve commut_liftid. Goal forall x y : terms, reg_id x y -> e_diag1 _ x y. simple induction 1; red in |- *; intros a z H0. pattern z in |- *; apply case_benv with a id. 2: assumption. intros a' x' H1 H2; pattern x' in |- *; apply case_bid. 2: assumption. exists a'; auto 6. (* a SLB||SL* a' *) (* a'[id] SL* a' *) Save commut_id. Hint Resolve commut_id. Goal forall (b : wsort) (x y : TS b), e_systemSL _ x y -> e_diag1 _ x y. simple induction 1; intros; auto. Save commut_systemSL. (* lemmes techniques *) Goal forall (P : terms -> Prop) (a : terms), (forall a' : terms, e_relSLstar _ a a' -> P (lambda a')) -> forall M N : terms, e_relSLstar _ N M -> N = lambda a -> P M. intros P a H M N H0; generalize a H; elim H0. intros x a0 H1 H2; rewrite H2; apply (H1 a0); red in |- *; apply star_refl. intros x y z H1 H2 H3 a0 H4 H5; generalize H1; rewrite H5; intro H6. cut (y = y). 2: trivial. pattern y at 2 in |- *; apply case_SLlambda with a0. 2: assumption. intros a0' H7 H8; apply (H3 a0'). intros a' H9; apply H4; red in |- *; apply star_trans1 with a0'; assumption. assumption. Save case_SLstar_lambda'. Goal forall (P : terms -> Prop) (a : terms), (forall a' : terms, e_relSLstar _ a a' -> P (lambda a')) -> forall M : terms, e_relSLstar _ (lambda a) M -> P M. intros; pattern M in |- *; apply case_SLstar_lambda' with a (lambda a); auto 6. Save case_SLstar_lambda. Goal forall (P : terms -> Prop) (a : terms), (forall a' : terms, e_slstar_bp_slstar _ a a' -> P (lambda a')) -> forall M : terms, e_slstar_bp_slstar _ (lambda a) M -> P M. intros P a H M H0. elim (comp_case terms (e_relSLstar wt) (explicit_comp_rel _ (e_beta_par wt) (e_relSLstar wt)) (lambda a) M H0). intros x H1; elim H1; intros H2. pattern x in |- *; apply case_SLstar_lambda with a. 2: assumption. intros a' H3 H4. elim (comp_case terms (e_beta_par wt) (e_relSLstar wt) (lambda a') M H4). intros y H5; elim H5; intros H6. pattern y in |- *; apply case_blambda with a'. 2: assumption. intros a'' H7 H8. pattern M in |- *; apply case_SLstar_lambda with a''. 2: assumption. intros a_ H9; apply H. red in |- *; apply comp_2rel with a'. assumption. apply comp_2rel with a''; assumption. Save case_slbpsl_lambda. Goal forall a a' : terms, e_diag1 _ (lambda a) (lambda a') -> e_diag1 _ a a'. red in |- *; intros a a' H z H0. elim (H (lambda z)). 2: apply lambda_bpar; assumption. intros u1 H1; elim H1; intros H2 H3. cut (u1 = u1). 2: trivial. pattern u1 at 1 in |- *; apply case_SLstar_lambda with z. 2: assumption. intros z' H4; pattern u1 in |- *; apply case_slbpsl_lambda with a'. 2: assumption. intros a'' H5 H6; exists a''; split. assumption. elim (proj_lambda z' a'' H6); assumption. Save diag1_lambda. Theorem commut : forall (b : wsort) (x y : TS b), e_relSL _ x y -> e_diag1 _ x y. simple induction 1; intros. (* regles de reecriture *) apply commut_systemSL; assumption. (* contexte app droit *) red in |- *; intros z H2; generalize H0 H1. pattern z in |- *; apply case_bapp with a b0. 3: assumption. (* regle B||: app *) intros a'' b0'' H3 H4 H5 H6. elim (H6 a'' H3); intros a_ H7; elim H7; intros H8 H9. exists (app a_ b0''); auto. (* regle B||: beta *) intros a1 a1'' b0'' H3 H4 H5; rewrite H3. intro H6; pattern a' in |- *; apply case_SLlambda with a1. 2: assumption. intros a1' H7 H8. elim (diag1_lambda a1 a1' H8 a1'' H4); intros a_ H9; elim H9; intros H10 H11. exists (env a_ (cons b0'' id)); auto. (* contexte app gauche *) red in |- *; intros z H2; pattern z in |- *; apply case_bapp with a b0. 3: assumption. (* regle B||: app *) intros a'' b0'' H3 H4. elim (H1 b0'' H4); intros b0_ H5; elim H5; intros H6 H7. exists (app a'' b0_); auto. (* regle B||: beta *) intros a1 a1'' b0'' H3 H4 H5; rewrite H3. elim (H1 b0'' H5); intros b0_ H6; elim H6; intros H7 H8. exists (env a1'' (cons b0_ id)); auto. (* contexte lambda *) red in |- *; intros z H2. pattern z in |- *; apply case_blambda with a. 2: assumption. intros a'' H3. elim (H1 a'' H3); intros a_ H4; elim H4; intros H5 H6. exists (lambda a_); auto. (* contexte env droit *) red in |- *; intros z H2. pattern z in |- *; apply case_benv with a s. 2: assumption. intros a'' s'' H3 H4. elim (H1 a'' H3); intros a_ H5; elim H5; intros H6 H7. exists (env a_ s''); auto. (* contexte env gauche *) red in |- *; intros z H2. pattern z in |- *; apply case_benv with a s. 2: assumption. intros a'' s'' H3 H4. elim (H1 s'' H4); intros s_ H5; elim H5; intros H6 H7. exists (env a'' s_); auto. (* contexte cons droit *) red in |- *; intros z H2. pattern z in |- *; apply case_bcons with a s. 2: assumption. intros a'' s'' H3 H4. elim (H1 a'' H3); intros a_ H5; elim H5; intros H6 H7. exists (cons a_ s''); auto. (* contexte cons gauche *) red in |- *; intros z H2. pattern z in |- *; apply case_bcons with a s. 2: assumption. intros a'' s'' H3 H4. elim (H1 s'' H4); intros s_ H5; elim H5; intros H6 H7. exists (cons a'' s_); auto. (* contexte comp droit *) red in |- *; intros z H2. pattern z in |- *; apply case_bcomp with s t. 2: assumption. intros s'' t'' H3 H4. elim (H1 s'' H3); intros s_ H5; elim H5; intros H6 H7. exists (comp s_ t''); auto. (* contexte comp gauche *) red in |- *; intros z H2. pattern z in |- *; apply case_bcomp with s t. 2: assumption. intros s'' t'' H3 H4. elim (H1 t'' H4); intros t_ H5; elim H5; intros H6 H7. exists (comp s'' t_); auto. (* contexte lift *) red in |- *; intros z H2. pattern z in |- *; apply case_blift with s. 2: assumption. intros s'' H3. elim (H1 s'' H3); intros s_ H4; elim H4; intros H5 H6. exists (lift s_); auto. Qed. (***************************************************) (* SL verifie le diagramme ci-dessus *) (***************************************************) Theorem commutation : forall (b : wsort) (x y z : TS b), e_relSL _ x y -> e_beta_par _ x z -> exists u : TS b, e_relSLstar _ z u /\ e_slstar_bp_slstar _ y u. (* Goal: forall (b : wsort) (x y z : TS b) (_ : e_relSL b x y) (_ : e_beta_par b x z), @ex (TS b) (fun u : TS b => and (e_relSLstar b z u) (e_slstar_bp_slstar b y u)) *) intros b x y z H H0; apply Ex_PQ; generalize z H0. (* Goal: forall (z : TS b) (_ : e_beta_par b x z), @ex (TS b) (fun u : TS b => and (e_slstar_bp_slstar b y u) (e_relSLstar b z u)) *) change (e_diag1 _ x y) in |- *. apply commut; assumption. Qed.
(* Contribution to the Coq Library V6.3 (July 1999) *) (****************************************************************************) (* The Calculus of Inductive Constructions *) (* *) (* Projet Coq *) (* *) (* INRIA ENS-CNRS *) (* Rocquencourt Lyon *) (* *) (* Coq V5.10 *) (* Nov 25th 1994 *) (* *) (****************************************************************************) (* resoudPC_SL.v *) (****************************************************************************) (* confluence locale de sigma_lift: resolution des paires critiques *) Require Import TS. Require Import sur_les_relations. Require Import sigma_lift. Require Import determinePC_SL. (*** app ***) Goal forall a b : terms, exists u : terms, e_relSLstar _ (app (env a id) (env b id)) u /\ e_relSLstar _ (app a b) u. (* Goal: forall a b : terms, @ex terms (fun u : terms => and (e_relSLstar wt (app (env a id) (env b id)) u) (e_relSLstar wt (app a b) u)) *) intros; exists (app a b); split; red in |- *. (* Goal: explicit_star (TS wt) (e_relSL wt) (app (env a id) (env b id)) (app a b) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (app a b) (app a b) *) apply star_trans1 with (app a (env b id)); auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. Save PC_app_id. Hint Resolve PC_app_id. Goal forall (a a' b : terms) (s : sub_explicits), e_relSL _ a a' -> exists u : terms, e_relSLstar _ (app (env a s) (env b s)) u /\ e_relSLstar _ (env (app a' b) s) u. (* Goal: forall (a a' b : terms) (s : sub_explicits) (_ : e_relSL wt a a'), @ex terms (fun u : terms => and (e_relSLstar wt (app (env a s) (env b s)) u) (e_relSLstar wt (env (app a' b) s) u)) *) intros; exists (app (env a' s) (env b s)); auto 6. Save PC1_app_ctxt_l. Hint Resolve PC1_app_ctxt_l. Goal forall (a b b' : terms) (s : sub_explicits), e_relSL _ b b' -> exists u : terms, e_relSLstar _ (app (env a s) (env b s)) u /\ e_relSLstar _ (env (app a b') s) u. (* Goal: forall (a b b' : terms) (s : sub_explicits) (_ : e_relSL wt b b'), @ex terms (fun u : terms => and (e_relSLstar wt (app (env a s) (env b s)) u) (e_relSLstar wt (env (app a b') s) u)) *) intros; exists (app (env a s) (env b' s)); auto 6. Save PC2_app_ctxt_l. Hint Resolve PC2_app_ctxt_l. Goal forall (a b : terms) (s s' : sub_explicits), e_relSL _ s s' -> exists u : terms, e_relSLstar _ (app (env a s) (env b s)) u /\ e_relSLstar _ (env (app a b) s') u. (* Goal: forall (a b : terms) (s s' : sub_explicits) (_ : e_relSL ws s s'), @ex terms (fun u : terms => and (e_relSLstar wt (app (env a s) (env b s)) u) (e_relSLstar wt (env (app a b) s') u)) *) intros; exists (app (env a s') (env b s')); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (app (env a s') (env b s)); auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. Save PC_app_ctxt_r. Hint Resolve PC_app_ctxt_r. Goal forall (a b x' : terms) (s : sub_explicits), e_relSL _ (app a b) x' -> exists u : terms, e_relSLstar _ (app (env a s) (env b s)) u /\ e_relSLstar _ (env x' s) u. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros a b x' s H; pattern x' in |- *; apply case_SLapp with a b; auto. Save PC_app_ctxt_l. Hint Resolve PC_app_ctxt_l. (*** lambda ***) Goal forall a : terms, exists u : terms, e_relSLstar _ (lambda (env a (lift id))) u /\ e_relSLstar _ (lambda a) u. (* Goal: forall a : terms, @ex terms (fun u : terms => and (e_relSLstar wt (lambda (env a (lift id))) u) (e_relSLstar wt (lambda a) u)) *) intro; exists (lambda a); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (lambda (env a id)); auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. Save PC_lambda_id. Hint Resolve PC_lambda_id. Goal forall (a x' : terms) (s : sub_explicits), e_relSL _ (lambda a) x' -> exists u : terms, e_relSLstar _ (lambda (env a (lift s))) u /\ e_relSLstar _ (env x' s) u. intros a x' s H; pattern x' in |- *; apply case_SLlambda with a; intros. 2: assumption. exists (lambda (env a' (lift s))); auto 6. Save PC_lambda_ctxt_l. Hint Resolve PC_lambda_ctxt_l. Goal forall (a : terms) (s s' : sub_explicits), e_relSL _ s s' -> exists u : terms, e_relSLstar _ (lambda (env a (lift s))) u /\ e_relSLstar _ (env (lambda a) s') u. (* Goal: forall (a : terms) (s s' : sub_explicits) (_ : e_relSL ws s s'), @ex terms (fun u : terms => and (e_relSLstar wt (lambda (env a (lift s))) u) (e_relSLstar wt (env (lambda a) s') u)) *) intros; exists (lambda (env a (lift s'))); auto 8. Save PC_lambda_ctxt_r. Hint Resolve PC_lambda_ctxt_r. (*** Clos ***) Goal forall (a : terms) (s : sub_explicits), exists u : terms, e_relSLstar _ (env a (comp s id)) u /\ e_relSLstar _ (env a s) u. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros; exists (env a s); split; red in |- *; auto. Save PC1_clos_id. Hint Resolve PC1_clos_id. Goal forall (a b : terms) (s t : sub_explicits), exists u : terms, e_relSLstar _ (env (app a b) (comp s t)) u /\ e_relSLstar _ (env (app (env a s) (env b s)) t) u. intros; exists (app (env a (comp s t)) (env b (comp s t))); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (app (env a s) (env b s)) t) (app (env a (comp s t)) (env b (comp s t))) *) apply star_trans1 with (app (env (env a s) t) (env (env b s) t)). (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (app (env a (comp s t)) (env (env b s) t)); auto. Save PC_clos_app. Hint Resolve PC_clos_app. Goal forall (a : terms) (s t : sub_explicits), exists u : terms, e_relSLstar _ (env (lambda a) (comp s t)) u /\ e_relSLstar _ (env (lambda (env a (lift s))) t) u. (* Goal: forall (a : terms) (s t : sub_explicits), @ex terms (fun u : terms => and (e_relSLstar wt (env (lambda a) (comp s t)) u) (e_relSLstar wt (env (lambda (env a (lift s))) t) u)) *) intros; exists (lambda (env a (lift (comp s t)))); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (lambda (env a (lift s))) t) (lambda (env a (lift (comp s t)))) *) apply star_trans1 with (lambda (env (env a (lift s)) (lift t))). (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. (* Goal: explicit_star (TS wt) (e_relSL wt) (lambda (env (env a (lift s)) (lift t))) (lambda (env a (lift (comp s t)))) *) apply star_trans1 with (lambda (env a (comp (lift s) (lift t)))); auto 6. Save PC_clos_lambda. Hint Resolve PC_clos_lambda. Goal forall (a : terms) (s s1 t : sub_explicits), exists u : terms, e_relSLstar _ (env (env a s1) (comp s t)) u /\ e_relSLstar _ (env (env a (comp s1 s)) t) u. (* Goal: forall (a : terms) (s s1 t : sub_explicits), @ex terms (fun u : terms => and (e_relSLstar wt (env (env a s1) (comp s t)) u) (e_relSLstar wt (env (env a (comp s1 s)) t) u)) *) intros; exists (env a (comp s1 (comp s t))); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (env a (comp (comp s1 s) t)); auto. Save PC_clos_clos. Hint Resolve PC_clos_clos. Goal forall (n : nat) (t : sub_explicits), exists u : terms, e_relSLstar _ (env (var n) (comp shift t)) u /\ e_relSLstar _ (env (var (S n)) t) u. (* Goal: forall (n : nat) (t : sub_explicits), @ex terms (fun u : terms => and (e_relSLstar wt (env (var n) (comp shift t)) u) (e_relSLstar wt (env (var (S n)) t) u)) *) intros; exists (env (var (S n)) t); auto 6. Save PC_clos_varshift1. Hint Resolve PC_clos_varshift1. Goal forall (n : nat) (s t : sub_explicits), exists u : terms, e_relSLstar _ (env (var n) (comp (comp shift s) t)) u /\ e_relSLstar _ (env (env (var (S n)) s) t) u. (* Goal: forall (n : nat) (s t : sub_explicits), @ex terms (fun u : terms => and (e_relSLstar wt (env (var n) (comp (comp shift s) t)) u) (e_relSLstar wt (env (env (var (S n)) s) t) u)) *) intros; exists (env (var (S n)) (comp s t)); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (env (var n) (comp shift (comp s t))); auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. Save PC_clos_varshift2. Hint Resolve PC_clos_varshift2. Goal forall (a : terms) (s t : sub_explicits), exists u : terms, e_relSLstar _ (env (var 0) (comp (cons a s) t)) u /\ e_relSLstar _ (env a t) u. (* Goal: forall (a : terms) (s t : sub_explicits), @ex terms (fun u : terms => and (e_relSLstar wt (env (var O) (comp (cons a s) t)) u) (e_relSLstar wt (env a t) u)) *) intros; exists (env a t); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (env (var 0) (cons (env a t) (comp s t))); auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. Save PC_clos_fvarcons. Hint Resolve PC_clos_fvarcons. Goal forall s t : sub_explicits, exists u : terms, e_relSLstar _ (env (var 0) (comp (lift s) t)) u /\ e_relSLstar _ (env (var 0) t) u. (* Goal: forall s' t : sub_explicits, @ex terms (fun u : terms => and (e_relSLstar wt (env (var O) t) u) (e_relSLstar wt (env (var O) (comp (lift s') t)) u)) *) intros; exists (env (var 0) t); auto 6. Save PC_clos_fvarlift1. Hint Resolve PC_clos_fvarlift1. Goal forall s1 s2 t : sub_explicits, exists u : terms, e_relSLstar _ (env (var 0) (comp (comp (lift s1) s2) t)) u /\ e_relSLstar _ (env (env (var 0) s2) t) u. (* Goal: forall s1 s2 t : sub_explicits, @ex terms (fun u : terms => and (e_relSLstar wt (env (var O) (comp (comp (lift s1) s2) t)) u) (e_relSLstar wt (env (env (var O) s2) t) u)) *) intros; exists (env (var 0) (comp s2 t)); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (env (var 0) (comp (lift s1) (comp s2 t))); auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. Save PC_clos_fvarlift2. Hint Resolve PC_clos_fvarlift2. Goal forall (n : nat) (a : terms) (s t : sub_explicits), exists u : terms, e_relSLstar _ (env (var (S n)) (comp (cons a s) t)) u /\ e_relSLstar _ (env (env (var n) s) t) u. (* Goal: forall (n : nat) (a : terms) (s t : sub_explicits), @ex terms (fun u : terms => and (e_relSLstar wt (env (var (S n)) (comp (cons a s) t)) u) (e_relSLstar wt (env (env (var n) s) t) u)) *) intros; exists (env (var n) (comp s t)); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (env (var (S n)) (cons (env a t) (comp s t))); auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. Save PC_clos_rvarcons. Hint Resolve PC_clos_rvarcons. Goal forall (n : nat) (s t : sub_explicits), exists u : terms, e_relSLstar _ (env (var (S n)) (comp (lift s) t)) u /\ e_relSLstar _ (env (env (var n) (comp s shift)) t) u. (* Goal: forall (n : nat) (s t : sub_explicits), @ex terms (fun u : terms => and (e_relSLstar wt (env (var (S n)) (comp (lift s) t)) u) (e_relSLstar wt (env (env (var n) (comp s shift)) t) u)) *) intros; exists (env (var n) (comp s (comp shift t))); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (env (var n) (comp (comp s shift) t)); auto. Save PC_clos_rvarlift1. Hint Resolve PC_clos_rvarlift1. Goal forall (n : nat) (s1 s2 t : sub_explicits), exists u : terms, e_relSLstar _ (env (var (S n)) (comp (comp (lift s1) s2) t)) u /\ e_relSLstar _ (env (env (var n) (comp s1 (comp shift s2))) t) u. intros; exists (env (var n) (comp s1 (comp shift (comp s2 t)))); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (env (var (S n)) (comp (lift s1) (comp s2 t))); auto. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (env (var n) (comp s1 (comp shift s2))) t) (env (var n) (comp s1 (comp shift (comp s2 t)))) *) apply star_trans1 with (env (var n) (comp (comp s1 (comp shift s2)) t)). (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. apply star_trans1 with (env (var n) (comp s1 (comp (comp shift s2) t))); (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) auto 6. Save PC_clos_rvarlift2. Hint Resolve PC_clos_rvarlift2. Goal forall (a : terms) (t : sub_explicits), exists u : terms, e_relSLstar _ (env a (comp id t)) u /\ e_relSLstar _ (env a t) u. (* Goal: forall (a : terms) (t : sub_explicits), @ex terms (fun u : terms => and (e_relSLstar wt (env a (comp id t)) u) (e_relSLstar wt (env a t) u)) *) intros; exists (env a t); auto 8. Save PC2_clos_id. Hint Resolve PC2_clos_id. Goal forall (a a' : terms) (s t : sub_explicits), e_relSL _ a a' -> exists u : terms, e_relSLstar _ (env a (comp s t)) u /\ e_relSLstar _ (env (env a' s) t) u. (* Goal: forall (a a' : terms) (s t : sub_explicits) (_ : e_relSL wt a a'), @ex terms (fun u : terms => and (e_relSLstar wt (env a (comp s t)) u) (e_relSLstar wt (env (env a' s) t) u)) *) intros; exists (env a' (comp s t)); auto 8. Save PC1_clos_ctxt_l. Hint Resolve PC1_clos_ctxt_l. Goal forall (a : terms) (s s' t : sub_explicits), e_relSL _ s s' -> exists u : terms, e_relSLstar _ (env a (comp s t)) u /\ e_relSLstar _ (env (env a s') t) u. (* Goal: forall (a : terms) (s s' t : sub_explicits) (_ : e_relSL ws s s'), @ex terms (fun u : terms => and (e_relSLstar wt (env a (comp s t)) u) (e_relSLstar wt (env (env a s') t) u)) *) intros; exists (env a (comp s' t)); auto 6. Save PC2_clos_ctxt_l. Hint Resolve PC2_clos_ctxt_l. Goal forall (a : terms) (s t t' : sub_explicits), e_relSL _ t t' -> exists u : terms, e_relSLstar _ (env a (comp s t)) u /\ e_relSLstar _ (env (env a s) t') u. (* Goal: forall (a : terms) (s t t' : sub_explicits) (_ : e_relSL ws t t'), @ex terms (fun u : terms => and (e_relSLstar wt (env a (comp s t)) u) (e_relSLstar wt (env (env a s) t') u)) *) intros; exists (env a (comp s t')); auto 6. Save PC_clos_ctxt_r. Hint Resolve PC_clos_ctxt_r. Goal forall (a x' : terms) (s t : sub_explicits), e_relSL _ (env a s) x' -> exists u : terms, e_relSLstar _ (env a (comp s t)) u /\ e_relSLstar _ (env x' t) u. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros a x' s t H; pattern a, s, x' in |- *; apply case_SLenv; auto. Save PC_clos_ctxt_l. Hint Resolve PC_clos_ctxt_l. (*** varshift1 ***) (* aucune PC *) (*** varshift2 ***) Goal forall (n : nat) (a : terms) (s : sub_explicits), exists u : terms, e_relSLstar _ (env (var (S n)) (cons a s)) u /\ e_relSLstar _ (env (var n) s) u. (* Goal: forall (n : nat) (a' : terms) (s : sub_explicits), @ex terms (fun u : terms => and (e_relSLstar wt (env (var n) s) u) (e_relSLstar wt (env (var (S n)) (cons a' s)) u)) *) intros; exists (env (var n) s); auto 6. Save PC_varshift2_shiftcons. Hint Resolve PC_varshift2_shiftcons. Goal forall (n : nat) (s : sub_explicits), exists u : terms, e_relSLstar _ (env (var (S n)) (lift s)) u /\ e_relSLstar _ (env (var n) (comp s shift)) u. (* Goal: forall (n : nat) (s : sub_explicits), @ex terms (fun u : terms => and (e_relSLstar wt (env (var (S n)) (lift s)) u) (e_relSLstar wt (env (var n) (comp s shift)) u)) *) intros; exists (env (var n) (comp s shift)); auto 6. Save PC_varshift2_shiftlift1. Hint Resolve PC_varshift2_shiftlift1. Goal forall (n : nat) (s t : sub_explicits), exists u : terms, e_relSLstar _ (env (var (S n)) (comp (lift s) t)) u /\ e_relSLstar _ (env (var n) (comp s (comp shift t))) u. (* Goal: forall (n : nat) (s t : sub_explicits), @ex terms (fun u : terms => and (e_relSLstar wt (env (var (S n)) (comp (lift s) t)) u) (e_relSLstar wt (env (var n) (comp s (comp shift t))) u)) *) intros; exists (env (var n) (comp s (comp shift t))); auto 6. Save PC_varshift2_shiftlift2. Hint Resolve PC_varshift2_shiftlift2. Goal forall n : nat, exists u : terms, e_relSLstar _ (env (var (S n)) id) u /\ e_relSLstar _ (env (var n) shift) u. (* Goal: forall n : nat, @ex terms (fun u : terms => and (e_relSLstar wt (env (var (S n)) id) u) (e_relSLstar wt (env (var n) shift) u)) *) intros; exists (var (S n)); auto 6. Save PC_varshift2_idr. Hint Resolve PC_varshift2_idr. Goal forall (n : nat) (s s' : sub_explicits), e_relSL _ s s' -> exists u : terms, e_relSLstar _ (env (var (S n)) s) u /\ e_relSLstar _ (env (var n) (comp shift s')) u. (* Goal: forall (n : nat) (s s' : sub_explicits) (_ : e_relSL ws s s'), @ex terms (fun u : terms => and (e_relSLstar wt (env (var (S n)) s) u) (e_relSLstar wt (env (var n) (comp shift s')) u)) *) intros; exists (env (var (S n)) s'); auto 6. Save PC_varshift2_ctxt_r. Hint Resolve PC_varshift2_ctxt_r. Goal forall (n : nat) (s x' : sub_explicits), e_relSL _ (comp shift s) x' -> exists u : terms, e_relSLstar _ (env (var (S n)) s) u /\ e_relSLstar _ (env (var n) x') u. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros n s x' H; pattern s, x' in |- *; apply case_SLcomp1; auto. Save PC_varshift2_ctxt_r'. Hint Resolve PC_varshift2_ctxt_r'. (*** fvarcons ***) Goal forall (a a' : terms) (s : sub_explicits), e_relSL _ a a' -> exists u : terms, e_relSLstar _ a u /\ e_relSLstar _ (env (var 0) (cons a' s)) u. (* Goal: forall (a a' : terms) (_ : e_relSL wt a a'), @ex terms (fun u : terms => and (e_relSLstar wt a u) (e_relSLstar wt (env a' id) u)) *) intros; exists a'; auto 6. Save PC1_fvarcons_ctxt_r. Hint Resolve PC1_fvarcons_ctxt_r. Goal forall (a : terms) (s' : sub_explicits), exists u : terms, e_relSLstar _ a u /\ e_relSLstar _ (env (var 0) (cons a s')) u. (* Goal: forall (a : terms) (s t : sub_explicits), @ex terms (fun u : terms => and (e_relSLstar wt (env (var O) (cons a t)) u) (e_relSLstar wt (env (var O) (cons a (comp s t))) u)) *) intros; exists a; auto 6. Save PC2_fvarcons_ctxt_r. Hint Resolve PC2_fvarcons_ctxt_r. Goal forall (a : terms) (s x' : sub_explicits), e_relSL _ (cons a s) x' -> exists u : terms, e_relSLstar _ a u /\ e_relSLstar _ (env (var 0) x') u. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros a s x' H; pattern x' in |- *; apply case_SLcons with a s; auto. Save PC_fvarcons_ctxt_r. (*** fvarlift1 ***) Goal exists u : terms, e_relSLstar _ (var 0) u /\ e_relSLstar _ (env (var 0) id) u. (* Goal: forall s t : sub_explicits, @ex terms (fun u : terms => and (e_relSLstar wt (env (var O) (lift t)) u) (e_relSLstar wt (env (var O) (lift (comp s t))) u)) *) intros; exists (var 0); auto 6. Save PC_fvarlift1_liftid. Hint Resolve PC_fvarlift1_liftid. Goal forall s' : sub_explicits, exists u : terms, e_relSLstar _ (var 0) u /\ e_relSLstar _ (env (var 0) (lift s')) u. (* Goal: forall s t : sub_explicits, @ex terms (fun u : terms => and (e_relSLstar wt (env (var O) (lift t)) u) (e_relSLstar wt (env (var O) (lift (comp s t))) u)) *) intros; exists (var 0); auto 6. Save PC_fvarlift1_ctxt_r. Hint Resolve PC_fvarlift1_ctxt_r. Goal forall s x' : sub_explicits, e_relSL _ (lift s) x' -> exists u : terms, e_relSLstar _ (var 0) u /\ e_relSLstar _ (env (var 0) x') u. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros s x' H; pattern s, x' in |- *; apply case_SLlift; auto. Save PC_fvarlift1_ctxt_r'. (*** fvarlift2 ***) Goal forall s t : sub_explicits, exists u : terms, e_relSLstar _ (env (var 0) (lift t)) u /\ e_relSLstar _ (env (var 0) (lift (comp s t))) u. (* Goal: forall s t : sub_explicits, @ex terms (fun u : terms => and (e_relSLstar wt (env (var O) (lift t)) u) (e_relSLstar wt (env (var O) (lift (comp s t))) u)) *) intros; exists (var 0); auto 6. Save PC_fvarlift2_lift1. Hint Resolve PC_fvarlift2_lift1. Goal forall s t v : sub_explicits, exists u : terms, e_relSLstar _ (env (var 0) (comp (lift t) v)) u /\ e_relSLstar _ (env (var 0) (comp (lift (comp s t)) v)) u. (* Goal: forall s t v : sub_explicits, @ex terms (fun u : terms => and (e_relSLstar wt (env (var O) (comp (lift t) v)) u) (e_relSLstar wt (env (var O) (comp (lift (comp s t)) v)) u)) *) intros; exists (env (var 0) v); auto 6. Save PC_fvarlift2_lift2. Hint Resolve PC_fvarlift2_lift2. Goal forall (a : terms) (s t : sub_explicits), exists u : terms, e_relSLstar _ (env (var 0) (cons a t)) u /\ e_relSLstar _ (env (var 0) (cons a (comp s t))) u. (* Goal: forall (a : terms) (s t : sub_explicits), @ex terms (fun u : terms => and (e_relSLstar wt (env (var O) (cons a t)) u) (e_relSLstar wt (env (var O) (cons a (comp s t))) u)) *) intros; exists a; auto 6. Save PC_fvarlift2_liftenv. Hint Resolve PC_fvarlift2_liftenv. Goal forall s : sub_explicits, exists u : terms, e_relSLstar _ (env (var 0) id) u /\ e_relSLstar _ (env (var 0) (lift s)) u. (* Goal: forall s : sub_explicits, @ex terms (fun u : terms => and (e_relSLstar wt (env (var O) id) u) (e_relSLstar wt (env (var O) (lift s)) u)) *) exists (var 0); auto 6. Save PC_fvarlift2_idr. Hint Resolve PC_fvarlift2_idr. Goal forall t : sub_explicits, exists u : terms, e_relSLstar _ (env (var 0) t) u /\ e_relSLstar _ (env (var 0) (comp id t)) u. (* Goal: forall t : sub_explicits, @ex terms (fun u : terms => and (e_relSLstar wt (env (var O) t) u) (e_relSLstar wt (env (var O) (comp id t)) u)) *) intros; exists (env (var 0) t); auto 7. Save PC_fvarlift2_liftid. Hint Resolve PC_fvarlift2_liftid. Goal forall s' t : sub_explicits, exists u : terms, e_relSLstar _ (env (var 0) t) u /\ e_relSLstar _ (env (var 0) (comp (lift s') t)) u. (* Goal: forall s' t : sub_explicits, @ex terms (fun u : terms => and (e_relSLstar wt (env (var O) t) u) (e_relSLstar wt (env (var O) (comp (lift s') t)) u)) *) intros; exists (env (var 0) t); auto 6. Save PC1_fvarlift2_ctxt_r. Hint Resolve PC1_fvarlift2_ctxt_r. Goal forall s t t' : sub_explicits, e_relSL _ t t' -> exists u : terms, e_relSLstar _ (env (var 0) t) u /\ e_relSLstar _ (env (var 0) (comp (lift s) t')) u. (* Goal: forall (s t t' : sub_explicits) (_ : e_relSL ws t t'), @ex terms (fun u : terms => and (e_relSLstar wt (env (var O) t) u) (e_relSLstar wt (env (var O) (comp (lift s) t')) u)) *) intros; exists (env (var 0) t'); auto 6. Save PC2_fvarlift2_ctxt_r. Hint Resolve PC2_fvarlift2_ctxt_r. Goal forall s t x' : sub_explicits, e_relSL _ (comp (lift s) t) x' -> exists u : terms, e_relSLstar _ (env (var 0) t) u /\ e_relSLstar _ (env (var 0) x') u. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros s t x' H; pattern t, x' in |- *; apply case_SLcomp2 with s; auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros; pattern s, x'0 in |- *; apply case_SLlift; auto. Save PC_fvarlift2_ctxt_r. (*** rvarcons ***) Goal forall (n : nat) (a' : terms) (s : sub_explicits), exists u : terms, e_relSLstar _ (env (var n) s) u /\ e_relSLstar _ (env (var (S n)) (cons a' s)) u. (* Goal: forall (n : nat) (a' : terms) (s : sub_explicits), @ex terms (fun u : terms => and (e_relSLstar wt (env (var n) s) u) (e_relSLstar wt (env (var (S n)) (cons a' s)) u)) *) intros; exists (env (var n) s); auto 6. Save PC1_rvarcons_ctxt_r. Hint Resolve PC1_rvarcons_ctxt_r. Goal forall (n : nat) (a : terms) (s s' : sub_explicits), e_relSL _ s s' -> exists u : terms, e_relSLstar _ (env (var n) s) u /\ e_relSLstar _ (env (var (S n)) (cons a s')) u. (* Goal: forall (n : nat) (a : terms) (s s' : sub_explicits) (_ : e_relSL ws s s'), @ex terms (fun u : terms => and (e_relSLstar wt (env (var n) s) u) (e_relSLstar wt (env (var (S n)) (cons a s')) u)) *) intros; exists (env (var n) s'); auto 6. Save PC2_rvarcons_ctxt_r. Hint Resolve PC2_rvarcons_ctxt_r. Goal forall (n : nat) (a : terms) (s x' : sub_explicits), e_relSL _ (cons a s) x' -> exists u : terms, e_relSLstar _ (env (var n) s) u /\ e_relSLstar _ (env (var (S n)) x') u. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros n a s x' H; pattern x' in |- *; apply case_SLcons with a s; auto. Save PC_rvarcons_ctxt_r. (*** rvarlift1 ***) Goal forall n : nat, exists u : terms, e_relSLstar _ (env (var n) (comp id shift)) u /\ e_relSLstar _ (env (var (S n)) id) u. (* Goal: forall n : nat, @ex terms (fun u : terms => and (e_relSLstar wt (env (var n) (comp id shift)) u) (e_relSLstar wt (env (var (S n)) id) u)) *) intros; exists (var (S n)); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (env (var n) shift); auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. Save PC_rvarlift1_id. Hint Resolve PC_rvarlift1_id. Goal forall (n : nat) (s s' : sub_explicits), e_relSL _ s s' -> exists u : terms, e_relSLstar _ (env (var n) (comp s shift)) u /\ e_relSLstar _ (env (var (S n)) (lift s')) u. (* Goal: forall (n : nat) (s s' : sub_explicits) (_ : e_relSL ws s s'), @ex terms (fun u : terms => and (e_relSLstar wt (env (var n) (comp s shift)) u) (e_relSLstar wt (env (var (S n)) (lift s')) u)) *) intros; exists (env (var n) (comp s' shift)); auto 6. Save PC_rvarlift1_ctxt_r. Hint Resolve PC_rvarlift1_ctxt_r. Goal forall (n : nat) (s x' : sub_explicits), e_relSL _ (lift s) x' -> exists u : terms, e_relSLstar _ (env (var n) (comp s shift)) u /\ e_relSLstar _ (env (var (S n)) x') u. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros n s x' H; pattern s, x' in |- *; apply case_SLlift; auto. Save PC_rvarlift1_ctxt_r'. Hint Resolve PC_rvarlift1_ctxt_r'. (*** rvarlift2 ***) Goal forall (n : nat) (s t : sub_explicits), exists u : terms, e_relSLstar _ (env (var n) (comp s (comp shift (lift t)))) u /\ e_relSLstar _ (env (var (S n)) (lift (comp s t))) u. (* Goal: forall (n : nat) (s t : sub_explicits), @ex terms (fun u : terms => and (e_relSLstar wt (env (var n) (comp s (comp shift (lift t)))) u) (e_relSLstar wt (env (var (S n)) (lift (comp s t))) u)) *) intros; exists (env (var n) (comp s (comp t shift))); split; red in |- *. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) auto 6. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (env (var n) (comp (comp s t) shift)); auto. Save PC_rvarlift2_lift1. Hint Resolve PC_rvarlift2_lift1. Goal forall (n : nat) (s t v : sub_explicits), exists u : terms, e_relSLstar _ (env (var n) (comp s (comp shift (comp (lift t) v)))) u /\ e_relSLstar _ (env (var (S n)) (comp (lift (comp s t)) v)) u. intros; exists (env (var n) (comp s (comp t (comp shift v)))); split; red in |- *. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) auto 6. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (env (var n) (comp (comp s t) (comp shift v))); auto. Save PC_rvarlift2_lift2. Hint Resolve PC_rvarlift2_lift2. Goal forall (n : nat) (a : terms) (s t : sub_explicits), exists u : terms, e_relSLstar _ (env (var n) (comp s (comp shift (cons a t)))) u /\ e_relSLstar _ (env (var (S n)) (cons a (comp s t))) u. (* Goal: forall (n : nat) (a : terms) (s t : sub_explicits), @ex terms (fun u : terms => and (e_relSLstar wt (env (var n) (comp s (comp shift (cons a t)))) u) (e_relSLstar wt (env (var (S n)) (cons a (comp s t))) u)) *) intros; exists (env (var n) (comp s t)); auto 8. Save PC_rvarlift2_liftenv. Hint Resolve PC_rvarlift2_liftenv. Goal forall (n : nat) (s : sub_explicits), exists u : terms, e_relSLstar _ (env (var n) (comp s (comp shift id))) u /\ e_relSLstar _ (env (var (S n)) (lift s)) u. (* Goal: forall (n : nat) (s : sub_explicits), @ex terms (fun u : terms => and (e_relSLstar wt (env (var n) (comp s (comp shift id))) u) (e_relSLstar wt (env (var (S n)) (lift s)) u)) *) intros; exists (env (var n) (comp s shift)); auto 8. Save PC_rvarlift2_idr. Hint Resolve PC_rvarlift2_idr. Goal forall (n : nat) (t : sub_explicits), exists u : terms, e_relSLstar _ (env (var n) (comp id (comp shift t))) u /\ e_relSLstar _ (env (var (S n)) (comp id t)) u. (* Goal: forall (n : nat) (t : sub_explicits), @ex terms (fun u : terms => and (e_relSLstar wt (env (var n) (comp id (comp shift t))) u) (e_relSLstar wt (env (var (S n)) (comp id t)) u)) *) intros; exists (env (var (S n)) t); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (env (var n) (comp shift t)); auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. Save PC_rvarlift2_liftid. Hint Resolve PC_rvarlift2_liftid. Goal forall (n : nat) (s s' t : sub_explicits), e_relSL _ s s' -> exists u : terms, e_relSLstar _ (env (var n) (comp s (comp shift t))) u /\ e_relSLstar _ (env (var (S n)) (comp (lift s') t)) u. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) intros; exists (env (var n) (comp s' (comp shift t))); auto 6. Save PC1_rvarlift2_ctxt_r. Hint Resolve PC1_rvarlift2_ctxt_r. Goal forall (n : nat) (s t t' : sub_explicits), e_relSL _ t t' -> exists u : terms, e_relSLstar _ (env (var n) (comp s (comp shift t))) u /\ e_relSLstar _ (env (var (S n)) (comp (lift s) t')) u. (* Goal: forall (n : nat) (s t t' : sub_explicits) (_ : e_relSL ws t t'), @ex terms (fun u : terms => and (e_relSLstar wt (env (var n) (comp s (comp shift t))) u) (e_relSLstar wt (env (var (S n)) (comp (lift s) t')) u)) *) intros; exists (env (var n) (comp s (comp shift t'))); auto 7. Save PC2_rvarlift2_ctxt_r. Hint Resolve PC2_rvarlift2_ctxt_r. Goal forall (n : nat) (s t x' : sub_explicits), e_relSL _ (comp (lift s) t) x' -> exists u : terms, e_relSLstar _ (env (var n) (comp s (comp shift t))) u /\ e_relSLstar _ (env (var (S n)) x') u. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros n s t x' H; pattern t, x' in |- *; apply case_SLcomp2 with s; auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros; pattern s, x'0 in |- *; apply case_SLlift; auto. Save PC_rvarlift2_ctxt_r. Hint Resolve PC_rvarlift2_ctxt_r. (*** assenv ***) Goal forall s1 s2 t v : sub_explicits, exists u : sub_explicits, e_relSLstar _ (comp (comp s1 s2) (comp t v)) u /\ e_relSLstar _ (comp (comp s1 (comp s2 t)) v) u. (* Goal: forall s1 s2 t v : sub_explicits, @ex sub_explicits (fun u : sub_explicits => and (e_relSLstar ws (comp (comp s1 s2) (comp t v)) u) (e_relSLstar ws (comp (comp s1 (comp s2 t)) v) u)) *) intros; exists (comp s1 (comp s2 (comp t v))); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (comp s1 (comp (comp s2 t) v)); auto. Save PC_assenv_assenv. Hint Resolve PC_assenv_assenv. Goal forall (a : terms) (s t v : sub_explicits), exists u : sub_explicits, e_relSLstar _ (comp (cons a s) (comp t v)) u /\ e_relSLstar _ (comp (cons (env a t) (comp s t)) v) u. intros; exists (cons (env a (comp t v)) (comp s (comp t v))); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (cons (env a t) (comp s t)) v) (cons (env a (comp t v)) (comp s (comp t v))) *) apply star_trans1 with (cons (env (env a t) v) (comp (comp s t) v)). (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (cons (env a (comp t v)) (comp (comp s t) v)); auto. Save PC_assenv_mapenv. Hint Resolve PC_assenv_mapenv. Goal forall (a : terms) (s v : sub_explicits), exists u : sub_explicits, e_relSLstar _ (comp shift (comp (cons a s) v)) u /\ e_relSLstar _ (comp s v) u. (* Goal: forall (a : terms) (s v : sub_explicits), @ex sub_explicits (fun u : sub_explicits => and (e_relSLstar ws (comp shift (comp (cons a s) v)) u) (e_relSLstar ws (comp s v) u)) *) intros; exists (comp s v); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (comp shift (cons (env a v) (comp s v))); auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. Save PC_assenv_shiftcons. Hint Resolve PC_assenv_shiftcons. Goal forall s v : sub_explicits, exists u : sub_explicits, e_relSLstar _ (comp shift (comp (lift s) v)) u /\ e_relSLstar _ (comp (comp s shift) v) u. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) intros; exists (comp s (comp shift v)); auto 6. Save PC_assenv_shiftlift1. Hint Resolve PC_assenv_shiftlift1. Goal forall s t v : sub_explicits, exists u : sub_explicits, e_relSLstar _ (comp shift (comp (comp (lift s) t) v)) u /\ e_relSLstar _ (comp (comp s (comp shift t)) v) u. (* Goal: forall s t v : sub_explicits, @ex sub_explicits (fun u : sub_explicits => and (e_relSLstar ws (comp shift (comp (comp (lift s) t) v)) u) (e_relSLstar ws (comp (comp s (comp shift t)) v) u)) *) intros; exists (comp s (comp shift (comp t v))); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (comp shift (comp (lift s) (comp t v))); auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (comp s (comp (comp shift t) v)); auto. Save PC_assenv_shiftlift2. Hint Resolve PC_assenv_shiftlift2. Goal forall s t v : sub_explicits, exists u : sub_explicits, e_relSLstar _ (comp (lift s) (comp (lift t) v)) u /\ e_relSLstar _ (comp (lift (comp s t)) v) u. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) intros; exists (comp (lift (comp s t)) v); auto 6. Save PC_assenv_lift1. Hint Resolve PC_assenv_lift1. Goal forall s t1 t2 v : sub_explicits, exists u : sub_explicits, e_relSLstar _ (comp (lift s) (comp (comp (lift t1) t2) v)) u /\ e_relSLstar _ (comp (comp (lift (comp s t1)) t2) v) u. (* Goal: forall s t1 t2 v : sub_explicits, @ex sub_explicits (fun u : sub_explicits => and (e_relSLstar ws (comp (lift s) (comp (comp (lift t1) t2) v)) u) (e_relSLstar ws (comp (comp (lift (comp s t1)) t2) v) u)) *) intros; exists (comp (lift (comp s t1)) (comp t2 v)); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (comp (lift s) (comp (lift t1) (comp t2 v))); auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. Save PC_assenv_lift2. Hint Resolve PC_assenv_lift2. Goal forall (a : terms) (s t v : sub_explicits), exists u : sub_explicits, e_relSLstar _ (comp (lift s) (comp (cons a t) v)) u /\ e_relSLstar _ (comp (cons a (comp s t)) v) u. (* Goal: forall (a : terms) (s t v : sub_explicits), @ex sub_explicits (fun u : sub_explicits => and (e_relSLstar ws (comp (lift s) (comp (cons a t) v)) u) (e_relSLstar ws (comp (cons a (comp s t)) v) u)) *) intros; exists (cons (env a v) (comp s (comp t v))); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (comp (lift s) (cons (env a v) (comp t v))); auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (cons (env a v) (comp (comp s t) v)); auto. Save PC_assenv_liftenv. Hint Resolve PC_assenv_liftenv. Goal forall t v : sub_explicits, exists u : sub_explicits, e_relSLstar _ (comp id (comp t v)) u /\ e_relSLstar _ (comp t v) u. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) intros; exists (comp t v); auto 6. Save PC_assenv_idl. Hint Resolve PC_assenv_idl. Goal forall s v : sub_explicits, exists u : sub_explicits, e_relSLstar _ (comp s (comp id v)) u /\ e_relSLstar _ (comp s v) u. (* Goal: forall s v : sub_explicits, @ex sub_explicits (fun u : sub_explicits => and (e_relSLstar ws (comp s (comp id v)) u) (e_relSLstar ws (comp s v) u)) *) intros; exists (comp s v); auto 7. Save PC1_assenv_idr. Hint Resolve PC1_assenv_idr. Goal forall s t : sub_explicits, exists u : sub_explicits, e_relSLstar _ (comp s (comp t id)) u /\ e_relSLstar _ (comp s t) u. (* Goal: forall (a : terms) (s t : sub_explicits), @ex sub_explicits (fun u : sub_explicits => and (e_relSLstar ws (comp s (comp shift (cons a t))) u) (e_relSLstar ws (comp shift (cons a (comp s t))) u)) *) intros; exists (comp s t); auto 7. Save PC2_assenv_idr. Hint Resolve PC2_assenv_idr. Goal forall s s' t v : sub_explicits, e_relSL _ s s' -> exists u : sub_explicits, e_relSLstar _ (comp s (comp t v)) u /\ e_relSLstar _ (comp (comp s' t) v) u. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) intros; exists (comp s' (comp t v)); auto 6. Save PC_assenv_ctxt_l. Hint Resolve PC_assenv_ctxt_l. Goal forall s t t' v : sub_explicits, e_relSL _ t t' -> exists u : sub_explicits, e_relSLstar _ (comp s (comp t v)) u /\ e_relSLstar _ (comp (comp s t') v) u. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) intros; exists (comp s (comp t' v)); auto 6. Save PC1_assenv_ctxt_r. Hint Resolve PC1_assenv_ctxt_r. Goal forall s t v v' : sub_explicits, e_relSL _ v v' -> exists u : sub_explicits, e_relSLstar _ (comp s (comp t v)) u /\ e_relSLstar _ (comp (comp s t) v') u. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) intros; exists (comp s (comp t v')); auto 6. Save PC2_assenv_ctxt_r. Hint Resolve PC2_assenv_ctxt_r. Goal forall s t v x' : sub_explicits, e_relSL _ (comp s t) x' -> exists u : sub_explicits, e_relSLstar _ (comp s (comp t v)) u /\ e_relSLstar _ (comp x' v) u. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros s t v x' H; pattern s, t, x' in |- *; apply case_SLcomp; auto. Save PC_assenv_ctxt_r. Hint Resolve PC_assenv_ctxt_r. (*** mapenv ***) Goal forall (a : terms) (s : sub_explicits), exists u : sub_explicits, e_relSLstar _ (cons (env a id) (comp s id)) u /\ e_relSLstar _ (cons a s) u. (* Goal: forall (a : terms) (s : sub_explicits), @ex sub_explicits (fun u : sub_explicits => and (e_relSLstar ws (cons (env a id) (comp s id)) u) (e_relSLstar ws (cons a s) u)) *) intros; exists (cons a s); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (cons a (comp s id)); auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. Save PC_mapenv_idr. Hint Resolve PC_mapenv_idr. Goal forall (a a' : terms) (s t : sub_explicits), e_relSL _ a a' -> exists u : sub_explicits, e_relSLstar _ (cons (env a t) (comp s t)) u /\ e_relSLstar _ (comp (cons a' s) t) u. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) intros; exists (cons (env a' t) (comp s t)); auto 6. Save PC1_mapenv_ctxt_l. Hint Resolve PC1_mapenv_ctxt_l. Goal forall (a : terms) (s s' t : sub_explicits), e_relSL _ s s' -> exists u : sub_explicits, e_relSLstar _ (cons (env a t) (comp s t)) u /\ e_relSLstar _ (comp (cons a s') t) u. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) intros; exists (cons (env a t) (comp s' t)); auto 6. Save PC2_mapenv_ctxt_l. Hint Resolve PC2_mapenv_ctxt_l. Goal forall (a : terms) (s t t' : sub_explicits), e_relSL _ t t' -> exists u : sub_explicits, e_relSLstar _ (cons (env a t) (comp s t)) u /\ e_relSLstar _ (comp (cons a s) t') u. (* Goal: forall (a : terms) (s t t' : sub_explicits) (_ : e_relSL ws t t'), @ex sub_explicits (fun u : sub_explicits => and (e_relSLstar ws (cons (env a t) (comp s t)) u) (e_relSLstar ws (comp (cons a s) t') u)) *) intros; exists (cons (env a t') (comp s t')); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (cons (env a t') (comp s t)); auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. Save PC_mapenv_ctxt_r. Hint Resolve PC_mapenv_ctxt_r. Goal forall (a : terms) (s t x' : sub_explicits), e_relSL _ (cons a s) x' -> exists u : sub_explicits, e_relSLstar _ (cons (env a t) (comp s t)) u /\ e_relSLstar _ (comp x' t) u. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros a s t x' H; pattern x' in |- *; apply case_SLcons with a s; auto. Save PC_mapenv_ctxt_l. Hint Resolve PC_mapenv_ctxt_l. (*** shiftcons ***) Goal forall (a' : terms) (s : sub_explicits), exists u : sub_explicits, e_relSLstar _ s u /\ e_relSLstar _ (comp shift (cons a' s)) u. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) intros; exists s; auto 6. Save PC1_shiftcons_ctxt_r. Hint Resolve PC1_shiftcons_ctxt_r. Goal forall (a : terms) (s s' : sub_explicits), e_relSL _ s s' -> exists u : sub_explicits, e_relSLstar _ s u /\ e_relSLstar _ (comp shift (cons a s')) u. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) intros; exists s'; auto 6. Save PC2_shiftcons_ctxt_r. Hint Resolve PC2_shiftcons_ctxt_r. Goal forall (a : terms) (s x' : sub_explicits), e_relSL _ (cons a s) x' -> exists u : sub_explicits, e_relSLstar _ s u /\ e_relSLstar _ (comp shift x') u. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros a s x' H; pattern x' in |- *; apply case_SLcons with a s; auto. Save PC_shiftcons_ctxt_r. (*** shiftlift1 ***) Goal exists u : sub_explicits, e_relSLstar _ (comp id shift) u /\ e_relSLstar _ (comp shift id) u. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) intros; exists shift; auto 6. Save PC_shiftlift1_liftid. Hint Resolve PC_shiftlift1_liftid. Goal forall s s' : sub_explicits, e_relSL _ s s' -> exists u : sub_explicits, e_relSLstar _ (comp s shift) u /\ e_relSLstar _ (comp shift (lift s')) u. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) intros; exists (comp s' shift); auto 6. Save PC_shiftlift1_ctxt_r. Hint Resolve PC_shiftlift1_ctxt_r. Goal forall s x' : sub_explicits, e_relSL _ (lift s) x' -> exists u : sub_explicits, e_relSLstar _ (comp s shift) u /\ e_relSLstar _ (comp shift x') u. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros s x' H; pattern s, x' in |- *; apply case_SLlift; auto. Save PC_shiftlift1_ctxt_r'. Hint Resolve PC_shiftlift1_ctxt_r'. (*** shiftlift2 ***) Goal forall s t : sub_explicits, exists u : sub_explicits, e_relSLstar _ (comp s (comp shift (lift t))) u /\ e_relSLstar _ (comp shift (lift (comp s t))) u. (* Goal: forall s t : sub_explicits, @ex sub_explicits (fun u : sub_explicits => and (e_relSLstar ws (comp s (comp shift (lift t))) u) (e_relSLstar ws (comp shift (lift (comp s t))) u)) *) intros; exists (comp s (comp t shift)); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (comp (comp s t) shift); auto. Save PC_shiftlift2_lift1. Hint Resolve PC_shiftlift2_lift1. Goal forall s t v : sub_explicits, exists u : sub_explicits, e_relSLstar _ (comp s (comp shift (comp (lift t) v))) u /\ e_relSLstar _ (comp shift (comp (lift (comp s t)) v)) u. (* Goal: forall s t v : sub_explicits, @ex sub_explicits (fun u : sub_explicits => and (e_relSLstar ws (comp s (comp shift (comp (lift t) v))) u) (e_relSLstar ws (comp shift (comp (lift (comp s t)) v)) u)) *) intros; exists (comp s (comp t (comp shift v))); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (comp (comp s t) (comp shift v)); auto. Save PC_shiftlift2_lift2. Hint Resolve PC_shiftlift2_lift2. Goal forall (a : terms) (s t : sub_explicits), exists u : sub_explicits, e_relSLstar _ (comp s (comp shift (cons a t))) u /\ e_relSLstar _ (comp shift (cons a (comp s t))) u. (* Goal: forall (a : terms) (s t : sub_explicits), @ex sub_explicits (fun u : sub_explicits => and (e_relSLstar ws (comp s (comp shift (cons a t))) u) (e_relSLstar ws (comp shift (cons a (comp s t))) u)) *) intros; exists (comp s t); auto 7. Save PC_shiftlift2_liftenv. Hint Resolve PC_shiftlift2_liftenv. Goal forall t : sub_explicits, exists u : sub_explicits, e_relSLstar _ (comp id (comp shift t)) u /\ e_relSLstar _ (comp shift (comp id t)) u. (* Goal: forall t : sub_explicits, @ex sub_explicits (fun u : sub_explicits => and (e_relSLstar ws (comp id (comp shift t)) u) (e_relSLstar ws (comp shift (comp id t)) u)) *) intros; exists (comp shift t); auto 7. Save PC_shiftlift2_liftid. Hint Resolve PC_shiftlift2_liftid. Goal forall s : sub_explicits, exists u : sub_explicits, e_relSLstar _ (comp s (comp shift id)) u /\ e_relSLstar _ (comp shift (lift s)) u. (* Goal: forall s : sub_explicits, @ex sub_explicits (fun u : sub_explicits => and (e_relSLstar ws (comp s (comp shift id)) u) (e_relSLstar ws (comp shift (lift s)) u)) *) intros; exists (comp s shift); auto 7. Save PC_shiftlift2_idr. Hint Resolve PC_shiftlift2_idr. Goal forall s s' t : sub_explicits, e_relSL _ s s' -> exists u : sub_explicits, e_relSLstar _ (comp s (comp shift t)) u /\ e_relSLstar _ (comp shift (comp (lift s') t)) u. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) intros; exists (comp s' (comp shift t)); auto 6. Save PC1_shiftlift2_ctxt_r. Hint Resolve PC1_shiftlift2_ctxt_r. Goal forall s t t' : sub_explicits, e_relSL _ t t' -> exists u : sub_explicits, e_relSLstar _ (comp s (comp shift t)) u /\ e_relSLstar _ (comp shift (comp (lift s) t')) u. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) intros; exists (comp s (comp shift t')); auto 6. Save PC2_shiftlift2_ctxt_r. Hint Resolve PC2_shiftlift2_ctxt_r. Goal forall s t x' : sub_explicits, e_relSL _ (comp (lift s) t) x' -> exists u : sub_explicits, e_relSLstar _ (comp s (comp shift t)) u /\ e_relSLstar _ (comp shift x') u. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros s t x' H; pattern t, x' in |- *; apply case_SLcomp2 with s; auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros; pattern s, x'0 in |- *; apply case_SLlift; auto. Save PC_shiftlift2_ctxt_r. Hint Resolve PC_shiftlift2_ctxt_r. (*** lift1 ***) Goal forall t : sub_explicits, exists u : sub_explicits, e_relSLstar _ (lift (comp id t)) u /\ e_relSLstar _ (comp id (lift t)) u. (* Goal: forall t : sub_explicits, @ex sub_explicits (fun u : sub_explicits => and (e_relSLstar ws (lift (comp id t)) u) (e_relSLstar ws (comp id (lift t)) u)) *) intros; exists (lift t); auto 7. Save PC1_lift1_liftid. Hint Resolve PC1_lift1_liftid. Goal forall s : sub_explicits, exists u : sub_explicits, e_relSLstar _ (lift (comp s id)) u /\ e_relSLstar _ (comp (lift s) id) u. (* Goal: forall s : sub_explicits, @ex sub_explicits (fun u : sub_explicits => and (e_relSLstar ws (lift (comp s id)) u) (e_relSLstar ws (comp (lift s) id) u)) *) intros; exists (lift s); auto 7. Save PC2_lift1_liftid. Hint Resolve PC2_lift1_liftid. Goal forall s s' t : sub_explicits, e_relSL _ s s' -> exists u : sub_explicits, e_relSLstar _ (lift (comp s t)) u /\ e_relSLstar _ (comp (lift s') (lift t)) u. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) intros; exists (lift (comp s' t)); auto 6. Save PC_lift1_ctxt_l. Hint Resolve PC_lift1_ctxt_l. Goal forall s t t' : sub_explicits, e_relSL _ t t' -> exists u : sub_explicits, e_relSLstar _ (lift (comp s t)) u /\ e_relSLstar _ (comp (lift s) (lift t')) u. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) intros; exists (lift (comp s t')); auto 6. Save PC_lift1_ctxt_r. Hint Resolve PC_lift1_ctxt_r. Goal forall s t x' : sub_explicits, e_relSL _ (lift s) x' -> exists u : sub_explicits, e_relSLstar _ (lift (comp s t)) u /\ e_relSLstar _ (comp x' (lift t)) u. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros s t x' H; pattern s, x' in |- *; apply case_SLlift; auto. Save PC_lift1_ctxt_l'. Hint Resolve PC_lift1_ctxt_l'. Goal forall s t x' : sub_explicits, e_relSL _ (lift t) x' -> exists u : sub_explicits, e_relSLstar _ (lift (comp s t)) u /\ e_relSLstar _ (comp (lift s) x') u. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros a t x' H; pattern t, x' in |- *; apply case_SLlift; auto. Save PC_lift1_ctxt_r'. Hint Resolve PC_lift1_ctxt_r'. (*** lift2 ***) Goal forall s t v : sub_explicits, exists u : sub_explicits, e_relSLstar _ (comp (lift (comp s t)) (lift v)) u /\ e_relSLstar _ (comp (lift s) (lift (comp t v))) u. (* Goal: forall s t v : sub_explicits, @ex sub_explicits (fun u : sub_explicits => and (e_relSLstar ws (comp (lift (comp s t)) (lift v)) u) (e_relSLstar ws (comp (lift s) (lift (comp t v))) u)) *) intros; exists (lift (comp s (comp t v))); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (lift (comp (comp s t) v)); auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. Save PC_lift2_lift1. Hint Resolve PC_lift2_lift1. Goal forall s t1 t2 v : sub_explicits, exists u : sub_explicits, e_relSLstar _ (comp (lift (comp s t1)) (comp (lift t2) v)) u /\ e_relSLstar _ (comp (lift s) (comp (lift (comp t1 t2)) v)) u. (* Goal: forall s t1 t2 v : sub_explicits, @ex sub_explicits (fun u : sub_explicits => and (e_relSLstar ws (comp (lift (comp s t1)) (comp (lift t2) v)) u) (e_relSLstar ws (comp (lift s) (comp (lift (comp t1 t2)) v)) u)) *) intros; exists (comp (lift (comp s (comp t1 t2))) v); split; red in |- *. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) apply star_trans1 with (comp (lift (comp (comp s t1) t2)) v); auto 6. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. Save PC_lift2_lift2. Hint Resolve PC_lift2_lift2. Goal forall (a : terms) (s t v : sub_explicits), exists u : sub_explicits, e_relSLstar _ (comp (lift (comp s t)) (cons a v)) u /\ e_relSLstar _ (comp (lift s) (cons a (comp t v))) u. (* Goal: forall (a : terms) (s t v : sub_explicits), @ex sub_explicits (fun u : sub_explicits => and (e_relSLstar ws (comp (lift (comp s t)) (cons a v)) u) (e_relSLstar ws (comp (lift s) (cons a (comp t v))) u)) *) intros; exists (cons a (comp s (comp t v))); split; red in |- *. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) apply star_trans1 with (cons a (comp (comp s t) v)); auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) auto. Save PC_lift2_liftenv. Hint Resolve PC_lift2_liftenv. Goal forall t v : sub_explicits, exists u : sub_explicits, e_relSLstar _ (comp (lift (comp id t)) v) u /\ e_relSLstar _ (comp id (comp (lift t) v)) u. (* Goal: forall t v : sub_explicits, @ex sub_explicits (fun u : sub_explicits => and (e_relSLstar ws (comp (lift (comp id t)) v) u) (e_relSLstar ws (comp id (comp (lift t) v)) u)) *) intros; exists (comp (lift t) v); auto 8. Save PC1_lift2_liftid. Hint Resolve PC1_lift2_liftid. Goal forall s v : sub_explicits, exists u : sub_explicits, e_relSLstar _ (comp (lift (comp s id)) v) u /\ e_relSLstar _ (comp (lift s) (comp id v)) u. (* Goal: forall s v : sub_explicits, @ex sub_explicits (fun u : sub_explicits => and (e_relSLstar ws (comp (lift (comp s id)) v) u) (e_relSLstar ws (comp (lift s) (comp id v)) u)) *) intros; exists (comp (lift s) v); auto 8. Save PC2_lift2_liftid. Hint Resolve PC2_lift2_liftid. Goal forall s t : sub_explicits, exists u : sub_explicits, e_relSLstar _ (comp (lift (comp s t)) id) u /\ e_relSLstar _ (comp (lift s) (lift t)) u. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) intros; exists (lift (comp s t)); auto 6. Save PC_lift2_idr. Hint Resolve PC_lift2_idr. Goal forall s s' t v : sub_explicits, e_relSL _ s s' -> exists u : sub_explicits, e_relSLstar _ (comp (lift (comp s t)) v) u /\ e_relSLstar _ (comp (lift s') (comp (lift t) v)) u. (* Goal: forall (s s' t v : sub_explicits) (_ : e_relSL ws s s'), @ex sub_explicits (fun u : sub_explicits => and (e_relSLstar ws (comp (lift (comp s t)) v) u) (e_relSLstar ws (comp (lift s') (comp (lift t) v)) u)) *) intros; exists (comp (lift (comp s' t)) v); auto 7. Save PC_lift2_ctxt_l. Hint Resolve PC_lift2_ctxt_l. Goal forall s t t' v : sub_explicits, e_relSL _ t t' -> exists u : sub_explicits, e_relSLstar _ (comp (lift (comp s t)) v) u /\ e_relSLstar _ (comp (lift s) (comp (lift t') v)) u. (* Goal: forall (s t t' v : sub_explicits) (_ : e_relSL ws t t'), @ex sub_explicits (fun u : sub_explicits => and (e_relSLstar ws (comp (lift (comp s t)) v) u) (e_relSLstar ws (comp (lift s) (comp (lift t') v)) u)) *) intros; exists (comp (lift (comp s t')) v); auto 7. Save PC1_lift2_ctxt_r. Hint Resolve PC1_lift2_ctxt_r. Goal forall s t v v' : sub_explicits, e_relSL _ v v' -> exists u : sub_explicits, e_relSLstar _ (comp (lift (comp s t)) v) u /\ e_relSLstar _ (comp (lift s) (comp (lift t) v')) u. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) intros; exists (comp (lift (comp s t)) v'); auto 6. Save PC2_lift2_ctxt_r. Hint Resolve PC2_lift2_ctxt_r. Goal forall s t v x' : sub_explicits, e_relSL _ (lift s) x' -> exists u : sub_explicits, e_relSLstar _ (comp (lift (comp s t)) v) u /\ e_relSLstar _ (comp x' (comp (lift t) v)) u. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros s t v x' H; pattern s, x' in |- *; apply case_SLlift; auto. Save PC_lift2_ctxt_l'. Hint Resolve PC_lift2_ctxt_l'. Goal forall s t v x' : sub_explicits, e_relSL _ (comp (lift t) v) x' -> exists u : sub_explicits, e_relSLstar _ (comp (lift (comp s t)) v) u /\ e_relSLstar _ (comp (lift s) x') u. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros s t v x' H; pattern v, x' in |- *; apply case_SLcomp2 with t; auto. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros; pattern t, x'0 in |- *; apply case_SLlift; auto. Save PC_lift2_ctxt_r. Hint Resolve PC_lift2_ctxt_r. (*** liftenv ***) Goal forall (a : terms) (t : sub_explicits), exists u : sub_explicits, e_relSLstar _ (cons a (comp id t)) u /\ e_relSLstar _ (comp id (cons a t)) u. (* Goal: forall (a : terms) (t : sub_explicits), @ex sub_explicits (fun u : sub_explicits => and (e_relSLstar ws (cons a (comp id t)) u) (e_relSLstar ws (comp id (cons a t)) u)) *) intros; exists (cons a t); auto 7. Save PC_liftenv_liftid. Hint Resolve PC_liftenv_liftid. Goal forall (a : terms) (s s' t : sub_explicits), e_relSL _ s s' -> exists u : sub_explicits, e_relSLstar _ (cons a (comp s t)) u /\ e_relSLstar _ (comp (lift s') (cons a t)) u. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) intros; exists (cons a (comp s' t)); auto 6. Save PC_liftenv_ctxt_l. Hint Resolve PC_liftenv_ctxt_l. Goal forall (a a' : terms) (s t : sub_explicits), e_relSL _ a a' -> exists u : sub_explicits, e_relSLstar _ (cons a (comp s t)) u /\ e_relSLstar _ (comp (lift s) (cons a' t)) u. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) intros; exists (cons a' (comp s t)); auto 6. Save PC1_liftenv_ctxt_r. Hint Resolve PC1_liftenv_ctxt_r. Goal forall (a : terms) (s t t' : sub_explicits), e_relSL _ t t' -> exists u : sub_explicits, e_relSLstar _ (cons a (comp s t)) u /\ e_relSLstar _ (comp (lift s) (cons a t')) u. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) intros; exists (cons a (comp s t')); auto 6. Save PC2_liftenv_ctxt_r. Hint Resolve PC2_liftenv_ctxt_r. Goal forall (a : terms) (s t x' : sub_explicits), e_relSL _ (lift s) x' -> exists u : sub_explicits, e_relSLstar _ (cons a (comp s t)) u /\ e_relSLstar _ (comp x' (cons a t)) u. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros a s t x' H; pattern s, x' in |- *; apply case_SLlift; auto. Save PC_liftenv_ctxt_l'. Hint Resolve PC_liftenv_ctxt_l'. Goal forall (a : terms) (s t x' : sub_explicits), e_relSL _ (cons a t) x' -> exists u : sub_explicits, e_relSLstar _ (cons a (comp s t)) u /\ e_relSLstar _ (comp (lift s) x') u. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros a s t x' H; pattern x' in |- *; apply case_SLcons with a t; auto. Save PC_liftenv_ctxt_r. Hint Resolve PC_liftenv_ctxt_r. (*** idl ***) Goal exists u : sub_explicits, e_relSLstar _ id u /\ e_relSLstar _ id u. (* Goal: explicit_star (TS ws) (e_relSL ws) (comp (lift s) (cons a (comp t v))) (cons a (comp s (comp t v))) *) intros; exists id; auto. Save PC_idl_idr. Hint Resolve PC_idl_idr. Goal forall s s' : sub_explicits, e_relSL _ s s' -> exists u : sub_explicits, e_relSLstar _ s u /\ e_relSLstar _ (comp id s') u. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) intros; exists s'; auto 6. Save PC_idl_ctxt_r. Hint Resolve PC_idl_ctxt_r. (*** idr ***) Goal forall s s' : sub_explicits, e_relSL _ s s' -> exists u : sub_explicits, e_relSLstar _ s u /\ e_relSLstar _ (comp s' id) u. (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var n) (comp s (comp shift (comp (lift t) v)))) (env (var n) (comp s (comp t (comp shift v)))) *) (* Goal: explicit_star (TS wt) (e_relSL wt) (env (var (S n)) (comp (lift (comp s t)) v)) (env (var n) (comp s (comp t (comp shift v)))) *) intros; exists s'; auto 6. Save PC_idr_ctxt_l. Hint Resolve PC_idr_ctxt_l. (*** liftid ***) (* aucune PC *) (*** id ***) Goal forall a a' : terms, e_relSL _ a a' -> exists u : terms, e_relSLstar _ a u /\ e_relSLstar _ (env a' id) u. (* Goal: forall (a a' : terms) (_ : e_relSL wt a a'), @ex terms (fun u : terms => and (e_relSLstar wt a u) (e_relSLstar wt (env a' id) u)) *) intros; exists a'; auto 6. Save PC_id_ctxt_l. Hint Resolve PC_id_ctxt_l.
(* Contribution to the Coq Library V6.3 (July 1999) *) (****************************************************************************) (* The Calculus of Inductive Constructions *) (* *) (* Projet Coq *) (* *) (* INRIA ENS-CNRS *) (* Rocquencourt Lyon *) (* *) (* Coq V5.10 *) (* Nov 25th 1994 *) (* *) (****************************************************************************) (* terminaison_SL.v *) (****************************************************************************) (*****************************************************************************) (* Projet Coq - Calculus of Inductive Constructions V5.8 *) (*****************************************************************************) (* *) (* Meta-theory of the explicit substitution calculus lambda-env *) (* Amokrane Saibi *) (* *) (* September 1993 *) (* *) (*****************************************************************************) (* Preuve de terminaison *) Require Import Le. Require Import Lt. Require Import Plus. Require Import Gt. Require Import Minus. Require Import Mult. Require Import sur_les_relations. Require Import TS. Require Import sigma_lift. Require Import comparith. Require Import Pol1. Require Import Pol2. Section ordre. Variable A : Set. Variable f g : A -> nat. Definition e_lexfg (a b : A) := f a > f b \/ f a = f b /\ g a > g b. Lemma lexfg_notherian : explicit_noetherian _ e_lexfg. Proof. unfold explicit_noetherian in |- *; unfold universal in |- *; unfold hereditary in |- *; unfold adjoint in |- *; unfold sub in |- *; unfold a_set in |- *. (* Goal: forall (A0 : forall _ : A, Prop) (_ : forall (x : A) (_ : forall (x0 : A) (_ : e_lexfg x x0), A0 x0), A0 x) (x : A), A0 x *) intros P H. (* Goal: forall x : A, P x *) cut (forall (n m : nat) (a : A), n > f a \/ n = f a /\ m > g a -> P a). (* Goal: forall (_ : forall (n m : nat) (a : A) (_ : or (gt n (f a)) (and (@eq nat n (f a)) (gt m (g a)))), P a) (x : A), P x *) (* Goal: forall (n m : nat) (a : A) (_ : or (gt n (f a)) (and (@eq nat n (f a)) (gt m (g a)))), P a *) intros H0 x; apply (H0 (S (f x)) 0). (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) auto with arith. (* Goal: forall (n m : nat) (a : A) (_ : or (gt n (f a)) (and (@eq nat n (f a)) (gt m (g a)))), P a *) simple induction n; simple induction m. (* m=n=0 *) (* Goal: forall (a : A) (_ : or (gt O (f a)) (and (@eq nat O (f a)) (gt O (g a)))), P a *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt O (f a)) (and (@eq nat O (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt O (f a)) (and (@eq nat O (f a)) (gt (S n) (g a)))), P a *) (* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *) simple induction 1; intro H1. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) absurd (0 > f a); auto with arith. (* Goal: P a *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt O (f a)) (and (@eq nat O (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt O (f a)) (and (@eq nat O (f a)) (gt (S n) (g a)))), P a *) (* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *) elim H1; intros. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) absurd (0 > g a); auto with arith. (* n=0, m=(S y) *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt O (f a)) (and (@eq nat O (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt O (f a)) (and (@eq nat O (f a)) (gt (S n) (g a)))), P a *) (* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *) intros y H' a H0. (* Goal: P a *) (* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *) apply H; intros b lexfgab. (* Goal: P b *) (* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *) apply H'; right. (* Goal: and (@eq nat O (f b)) (gt y (g b)) *) (* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *) elim H0; intro H1. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) absurd (0 > f a); auto with arith. (* Goal: and (@eq nat O (f b)) (gt y (g b)) *) (* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *) elim H1; intros H2 H3; elim lexfgab; intro H4. (* Goal: and (@eq nat O (f b)) (gt y (g b)) *) (* Goal: and (@eq nat O (f b)) (gt y (g b)) *) (* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *) absurd (0 > f b). (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) auto with arith. (* Goal: @eq nat O (f b) *) (* Goal: gt y (g b) *) (* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *) rewrite H2; assumption. (* Goal: and (@eq nat O (f b)) (gt y (g b)) *) (* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *) elim H4; intros. (* Goal: and (@eq nat O (f b)) (gt y (g b)) *) (* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *) split. (* Goal: @eq nat O (f b) *) (* Goal: gt y (g b) *) (* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *) rewrite H2; assumption. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) apply le_gt_trans with (g a); auto with arith. (* n=(S y), m=0 *) (* Goal: P a *) (* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *) intros a H0'; apply H; intros b lexfgab. (* Goal: P b *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *) apply (H0 (g a) b); elim H0'; intro H1. (* Goal: or (gt n0 (f b)) (and (@eq nat n0 (f b)) (gt (g a) (g b))) *) (* Goal: or (gt n0 (f b)) (and (@eq nat n0 (f b)) (gt (g a) (g b))) *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *) elim lexfgab; intro H2. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) left; apply le_gt_trans with (f a); auto with arith. (* Goal: or (gt n0 (f b)) (and (@eq nat n0 (f b)) (gt (g a) (g b))) *) (* Goal: or (gt n0 (f b)) (and (@eq nat n0 (f b)) (gt (g a) (g b))) *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *) elim H2; intros H3 H4; elim (gt_S n0 (f a) H1); intro H5. (* Goal: or (gt n0 (f b)) (and (@eq nat n0 (f b)) (gt (g a) (g b))) *) (* Goal: or (gt n0 (f b)) (and (@eq nat n0 (f b)) (gt (g a) (g b))) *) (* Goal: or (gt n0 (f b)) (and (@eq nat n0 (f b)) (gt (g a) (g b))) *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *) left; elim H3; assumption. (* Goal: and (@eq nat O (f b)) (gt y (g b)) *) (* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *) right; split. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) elim H3; auto with arith. (* Goal: @eq nat (e_P1 ws s) (e_P1 ws s') *) (* Goal: gt (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) O)))) (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') O)))) *) assumption. (* Goal: or (gt n0 (f b)) (and (@eq nat n0 (f b)) (gt (g a) (g b))) *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *) elim H1; intros H2 H3. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) absurd (0 > g a); auto with arith. (* n=(S y), m=(S y0) *) (* Goal: P a *) (* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *) intros y0 H0' a H1; apply H; intros b lexfgab. (* Goal: P b *) apply H0'; elim H1; elim lexfgab; intros H2 H3. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) left; apply le_gt_trans with (f a); auto with arith. (* Goal: @eq nat (e_P1 ws s) (e_P1 ws s') *) (* Goal: gt (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) O)))) (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') O)))) *) elim H2; intros H4 H5; left; elim H4; assumption. (* Goal: @eq nat (e_P1 ws s) (e_P1 ws s') *) (* Goal: gt (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) O)))) (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') O)))) *) elim H3; intros H4 H5; left; rewrite H4; assumption. (* Goal: or (gt (S n0) (f b)) (and (@eq nat (S n0) (f b)) (gt y0 (g b))) *) elim H2; intros H4 H5; elim H3; intros H6 H7. (* Goal: and (@eq nat O (f b)) (gt y (g b)) *) (* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *) right; split. (* Goal: @eq nat (e_P1 ws s) (e_P1 ws s') *) (* Goal: gt (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) O)))) (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') O)))) *) apply trans_equal with (f a); assumption. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) apply le_gt_trans with (g a); auto with arith. Qed. End ordre. Notation lexfg := (e_lexfg _) (only parsing). (* <Warning> : Syntax is discontinued *) Theorem lexfg_systemSL : forall (b : wsort) (M N : TS b), e_systemSL _ M N -> e_lexfg _ (e_P1 b) (e_P2 b) M N. Proof. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) red in |- *; simple induction 1; auto with arith. Qed. Hint Resolve lexfg_systemSL. Theorem lexfg_app_l : forall a a' b : terms, e_lexfg _ (e_P1 wt) (e_P2 wt) a a' -> e_lexfg _ (e_P1 wt) (e_P2 wt) (app a b) (app a' b). Proof. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) unfold e_lexfg in |- *; simple induction 1; simpl in |- *; auto with arith. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) intros; elim H0; auto with arith. Qed. Hint Resolve lexfg_app_l. Theorem lexfg_app_r : forall a b b' : terms, e_lexfg _ (e_P1 wt) (e_P2 wt) b b' -> e_lexfg _ (e_P1 wt) (e_P2 wt) (app a b) (app a b'). Proof. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) unfold e_lexfg in |- *; simple induction 1; simpl in |- *; auto with arith. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) intros; elim H0; auto with arith. Qed. Hint Resolve lexfg_app_r. Theorem lexfg_lambda : forall a a' : terms, e_lexfg _ (e_P1 wt) (e_P2 wt) a a' -> e_lexfg _ (e_P1 wt) (e_P2 wt) (lambda a) (lambda a'). Proof. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) unfold e_lexfg in |- *; simple induction 1; simpl in |- *; auto with arith. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) intros; elim H0; auto with arith. Qed. Hint Resolve lexfg_lambda. Theorem lexfg_env_t : forall (a a' : terms) (s : sub_explicits), e_lexfg _ (e_P1 wt) (e_P2 wt) a a' -> e_lexfg _ (e_P1 wt) (e_P2 wt) (env a s) (env a' s). Proof. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) unfold e_lexfg in |- *; simple induction 1; simpl in |- *; auto with arith. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) intros; elim H0; auto with arith. Qed. Hint Resolve lexfg_env_t. Theorem lexfg_env_s : forall (a : terms) (s s' : sub_explicits), e_lexfg _ (e_P1 ws) (e_P2 ws) s s' -> e_lexfg _ (e_P1 wt) (e_P2 wt) (env a s) (env a s'). Proof. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) unfold e_lexfg in |- *; simple induction 1; simpl in |- *; auto with arith. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) intros; elim H0; auto with arith. Qed. Hint Resolve lexfg_env_s. Theorem lexfg_cons_t : forall (a a' : terms) (s : sub_explicits), e_lexfg _ (e_P1 wt) (e_P2 wt) a a' -> e_lexfg _ (e_P1 ws) (e_P2 ws) (cons a s) (cons a' s). Proof. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) unfold e_lexfg in |- *; simple induction 1; simpl in |- *; auto with arith. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) intros; elim H0; auto with arith. Qed. Hint Resolve lexfg_cons_t. Theorem lexfg_cons_s : forall (a : terms) (s s' : sub_explicits), e_lexfg _ (e_P1 ws) (e_P2 ws) s s' -> e_lexfg _ (e_P1 ws) (e_P2 ws) (cons a s) (cons a s'). Proof. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) unfold e_lexfg in |- *; simple induction 1; simpl in |- *; auto with arith. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) intros; elim H0; auto with arith. Qed. Hint Resolve lexfg_cons_s. Theorem lexfg_comp_l : forall s s' t : sub_explicits, e_lexfg _ (e_P1 ws) (e_P2 ws) s s' -> e_lexfg _ (e_P1 ws) (e_P2 ws) (comp s t) (comp s' t). Proof. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) unfold e_lexfg in |- *; simple induction 1; simpl in |- *; auto with arith. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) intros; elim H0; auto with arith. Qed. Hint Resolve lexfg_comp_l. Theorem lexfg_comp_r : forall s t t' : sub_explicits, e_lexfg _ (e_P1 ws) (e_P2 ws) t t' -> e_lexfg _ (e_P1 ws) (e_P2 ws) (comp s t) (comp s t'). Proof. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) unfold e_lexfg in |- *; simple induction 1; simpl in |- *; auto with arith. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) intros; elim H0; auto with arith. Qed. Hint Resolve lexfg_comp_r. Theorem lexfg_lift : forall s s' : sub_explicits, e_lexfg _ (e_P1 ws) (e_P2 ws) s s' -> e_lexfg _ (e_P1 ws) (e_P2 ws) (lift s) (lift s'). Proof. (* Goal: forall (s s' : sub_explicits) (_ : e_lexfg (TS ws) (e_P1 ws) (e_P2 ws) s s'), e_lexfg (TS ws) (e_P1 ws) (e_P2 ws) (lift s) (lift s') *) unfold e_lexfg in |- *; simple induction 1; simpl in |- *; intros. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) auto with arith. (* Goal: and (@eq nat O (f b)) (gt y (g b)) *) (* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *) (* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *) elim H0; intros; right; split. (* Goal: @eq nat (e_P1 ws s) (e_P1 ws s') *) (* Goal: gt (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) O)))) (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') O)))) *) assumption. (* Goal: gt (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) O)))) (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') O)))) *) change (4 * e_P2 _ s > 4 * e_P2 _ s') in |- *. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) auto with arith. Qed. Hint Resolve lexfg_lift. Theorem lexfg_relSL : forall (b : wsort) (M N : TS b), e_relSL _ M N -> e_lexfg _ (e_P1 b) (e_P2 b) M N. Proof. (* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *) simple induction 1; auto with arith. Qed. (***************************************************) (* la relation sigma-lift (SL) est noetherienne *) (***************************************************) Theorem relSL_noetherian : forall b : wsort, explicit_noetherian _ (e_relSL b). Proof. (* Goal: forall b : wsort, explicit_noetherian (TS b) (e_relSL b) *) intro b; apply noether_inclus with (e_lexfg _ (e_P1 b) (e_P2 b)). (* Goal: explicit_noetherian (TS b) (e_lexfg (TS b) (e_P1 b) (e_P2 b)) *) (* Goal: forall (x y : TS b) (_ : e_relSL b x y), e_lexfg (TS b) (e_P1 b) (e_P2 b) x y *) apply lexfg_notherian. (* Goal: forall (x y : TS b) (_ : e_relSL b x y), e_lexfg (TS b) (e_P1 b) (e_P2 b) x y *) exact (lexfg_relSL b). Qed.
(* Contribution to the Coq Library V6.3 (July 1999) *) (****************************************************************************) (* The Calculus of Inductive Constructions *) (* *) (* Projet Coq *) (* *) (* INRIA ENS-CNRS *) (* Rocquencourt Lyon *) (* *) (* Coq V5.10 *) (* Nov 25th 1994 *) (* *) (****************************************************************************) (* confluence_LSL.v *) (****************************************************************************) (*****************************************************************************) (* Projet Coq - Calculus of Inductive Constructions V5.8 *) (*****************************************************************************) (* *) (* Meta-theory of the explicit substitution calculus lambda-env *) (* Amokrane Saibi *) (* *) (* September 1993 *) (* *) (*****************************************************************************) (* Confluence du lambda-sigma-lift *) Require Import TS. Require Import sur_les_relations. Require Import sigma_lift. Require Import lambda_sigma_lift. Require Import terminaison_SL. Require Import conf_local_SL. Require Import betapar. Require Import SLstar_bpar_SLstar. Require Import conf_strong_betapar. Require Import commutation. Require Import Newman. Require Import Yokouchi. Goal forall b : wsort, explicit_confluence _ (e_relSL b). (* Goal: forall b : wsort, explicit_confluence (TS b) (e_relSL b) *) intros b. (* Goal: explicit_confluence (TS b) (e_relSL b) *) apply Newman. (* Goal: explicit_noetherian (TS b) (e_relSL b) *) (* Goal: explicit_strong_confluence (TS b) (e_beta_par b) *) (* Goal: forall (f g h : TS b) (_ : e_relSL b f h) (_ : e_beta_par b f g), @ex (TS b) (fun k : TS b => and (explicit_star (TS b) (e_relSL b) g k) (Rstar_S_Rstar (TS b) (e_relSL b) (e_beta_par b) h k)) *) apply relSL_noetherian. (* Goal: explicit_local_confluence (TS b) (e_relSL b) *) apply conf_local_SL. Save confluence_SL. Goal forall b : wsort, explicit_strong_confluence _ (e_slstar_bp_slstar b). (* Goal: forall b : wsort, explicit_strong_confluence (TS b) (e_slstar_bp_slstar b) *) intro b; unfold e_slstar_bp_slstar in |- *. change (explicit_strong_confluence _ (Rstar_S_Rstar (TS b) (e_relSL b) (e_beta_par b))) in |- *. (* Goal: explicit_strong_confluence (TS b) (Rstar_S_Rstar (TS b) (e_relSL b) (e_beta_par b)) *) apply Yokouchi. (* Goal: explicit_confluence (TS b) (e_relSL b) *) (* Goal: explicit_noetherian (TS b) (e_relSL b) *) (* Goal: explicit_strong_confluence (TS b) (e_beta_par b) *) (* Goal: forall (f g h : TS b) (_ : e_relSL b f h) (_ : e_beta_par b f g), @ex (TS b) (fun k : TS b => and (explicit_star (TS b) (e_relSL b) g k) (Rstar_S_Rstar (TS b) (e_relSL b) (e_beta_par b) h k)) *) apply confluence_SL. (* Goal: explicit_noetherian (TS b) (e_relSL b) *) (* Goal: explicit_strong_confluence (TS b) (e_beta_par b) *) (* Goal: forall (f g h : TS b) (_ : e_relSL b f h) (_ : e_beta_par b f g), @ex (TS b) (fun k : TS b => and (explicit_star (TS b) (e_relSL b) g k) (Rstar_S_Rstar (TS b) (e_relSL b) (e_beta_par b) h k)) *) apply relSL_noetherian. (* Goal: explicit_strong_confluence (TS b) (e_beta_par b) *) (* Goal: forall (f g h : TS b) (_ : e_relSL b f h) (_ : e_beta_par b f g), @ex (TS b) (fun k : TS b => and (explicit_star (TS b) (e_relSL b) g k) (Rstar_S_Rstar (TS b) (e_relSL b) (e_beta_par b) h k)) *) apply sconf_betapar. (* Goal: forall (f g h : TS b) (_ : e_relSL b f h) (_ : e_beta_par b f g), @ex (TS b) (fun k : TS b => and (explicit_star (TS b) (e_relSL b) g k) (Rstar_S_Rstar (TS b) (e_relSL b) (e_beta_par b) h k)) *) intros f g h H H0. (* Goal: @ex (TS b) (fun k : TS b => and (explicit_star (TS b) (e_relSL b) g k) (Rstar_S_Rstar (TS b) (e_relSL b) (e_beta_par b) h k)) *) unfold Rstar_S_Rstar in |- *. change (exists k : TS b, e_relSLstar _ g k /\ e_slstar_bp_slstar _ h k) in |- *. (* Goal: @ex (TS b) (fun k : TS b => and (e_relSLstar b g k) (e_slstar_bp_slstar b h k)) *) apply commutation with f; assumption. Save strong_confluence_slbpsl. Goal forall b : wsort, explicit_confluence _ (e_slstar_bp_slstar b). (* Goal: forall b : wsort, explicit_confluence (TS b) (e_slstar_bp_slstar b) *) intro b; apply strong_conf_conf; apply strong_confluence_slbpsl. Save confluence_slbpsl. (**********************************************) (* lambda-sigma-lift est confluent *) (**********************************************) Theorem confluence_LSL : forall b : wsort, explicit_confluence _ (e_relLSL b). Proof. (* Goal: forall b : wsort, explicit_confluence (TS b) (e_relLSL b) *) intro b; apply inclus_conf with (e_slstar_bp_slstar b). (* Goal: explicit_inclus (TS b) (e_relLSL b) (e_slstar_bp_slstar b) *) (* Goal: explicit_inclus (TS b) (e_slstar_bp_slstar b) (explicit_star (TS b) (e_relLSL b)) *) (* Goal: explicit_confluence (TS b) (e_slstar_bp_slstar b) *) apply relLSL_inclus_slbpsl. (* Goal: explicit_inclus (TS b) (e_slstar_bp_slstar b) (explicit_star (TS b) (e_relLSL b)) *) (* Goal: explicit_confluence (TS b) (e_slstar_bp_slstar b) *) change (explicit_inclus _ (e_slstar_bp_slstar b) (e_relLSLstar b)) in |- *. (* Goal: explicit_inclus (TS b) (e_slstar_bp_slstar b) (e_relLSLstar b) *) (* Goal: explicit_confluence (TS b) (e_slstar_bp_slstar b) *) apply slbpsl_inclus_relLSLstar. (* Goal: explicit_confluence (TS b) (e_slstar_bp_slstar b) *) apply confluence_slbpsl. Qed.
(*************************************************************************) (* Copyright (C) 2013 - 2015 *) (* Author C. Cohen *) (* DRAFT - PLEASE USE WITH CAUTION *) (* License CeCILL-B *) (*************************************************************************) From mathcomp Require Import ssreflect ssrbool ssrnat eqtype ssrfun seq. From mathcomp Require Import choice path finset finfun fintype bigop. Require Import finmap. (*****************************************************************************) (* This file provides a representation of multisets based on fsfun *) (* {mset T} == the type of multisets on a choiceType T *) (* The following notations are in the %mset scope *) (* mset0 == the empty multiset *) (* mset n a == the multiset with n times element a *) (* [mset a] == the singleton multiset {k} := mset 1 a *) (* [mset a1; ..; an] == the multiset obtained from the elements a1,..,an *) (* A `&` B == the intersection of A and B (the min of each) *) (* A `|` B == the union of A and B (the max of each) *) (* A `+` B == the sum of A and B *) (* a |` B == the union of singleton a and B *) (* a +` B == the addition of singleton a to B *) (* A `\` B == the difference A minus B *) (* A `\ b == A without one b *) (* A `*` B == the product of A and B *) (* [disjoint A & B] := A `&` B == 0 *) (* A `<=` B == A is a sub-multiset of B *) (* A `<` B == A is a proper sub-multiset of B *) (*****************************************************************************) Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Lemma sumn_map I (f : I -> nat) s : sumn [seq f i | i <- s] = \sum_(i <- s) f i. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) Proof. by elim: s => [|i s IHs] in f *; rewrite ?(big_nil, big_cons) //= IHs. Qed. Lemma sumn_filter s P : sumn [seq i <- s | P i] = \sum_(i <- s | P i) i. Proof. by rewrite -big_filter -sumn_map map_id. Qed. Lemma sumn_map_filter I s (f : I -> nat) P : sumn [seq f i | i <- s & P i] = \sum_(i <- s | P i) f i. Proof. by rewrite sumn_map big_filter. Qed. Delimit Scope mset_scope with mset. Local Open Scope fset_scope. Local Open Scope fmap_scope. Local Open Scope mset_scope. Local Open Scope nat_scope. Definition multiset (T : choiceType) := {fsfun T -> nat with 0}. Definition multiset_of (T : choiceType) of phant T := @multiset T. Notation "'{mset' T }" := (@multiset_of _ (Phant T)) (format "'{mset' T }") : mset_scope. Notation "[ 'mset[' key ] x 'in' aT => F ]" := ([fsfun[key] x in aT => F] : {mset _}) (at level 0, x ident, only parsing) : mset_scope. Notation "[ 'mset' x 'in' aT => F ]" := ([fsfun x in aT => F] : {mset _}) (at level 0, x ident, only parsing) : mset_scope. Notation "[ 'm' 'set' x 'in' aT => F ]" := ([fsfun[_] x in aT => F] : {mset _}) (at level 0, x ident, format "[ 'm' 'set' x 'in' aT => F ]") : mset_scope. Identity Coercion multiset_multiset_of : multiset_of >-> multiset. Notation enum_mset_def A := (flatten [seq nseq (A%mset x) x | x <- finsupp A%mset]). Module Type EnumMsetSig. Axiom f : forall K, multiset K -> seq K. Axiom E : f = (fun K (A : multiset K) => enum_mset_def A). End EnumMsetSig. Module EnumMset : EnumMsetSig. Definition f K (A : multiset K) := enum_mset_def A. Definition E := (erefl f). End EnumMset. Notation enum_mset := EnumMset.f. Coercion enum_mset : multiset >-> seq. Canonical enum_mset_unlock := Unlockable EnumMset.E. Canonical multiset_predType (K : choiceType) := Eval hnf in mkPredType (fun (A : multiset K) a => a \in enum_mset A). Canonical mset_finpredType (T: choiceType) := mkFinPredType (multiset T) (fun A => undup (enum_mset A)) (fun _ => undup_uniq _) (fun _ _ => mem_undup _ _). Section MultisetOps. Context {K : choiceType}. Implicit Types (a b c : K) (A B C D : {mset K}) (s : seq K). Definition mset0 : {mset K} := [fsfun]. Fact msetn_key : unit. Proof. exact: tt. Qed. Definition msetn n a := [mset[msetn_key] x in [fset a] => n]. Fact seq_mset_key : unit. Proof. exact: tt. Qed. Definition seq_mset (s : seq K) := [mset[seq_mset_key] x in [fset x in s] => count (pred1 x) s]. Fact msetU_key : unit. Proof. exact: tt. Qed. Definition msetU A B := [mset[msetU_key] x in finsupp A `|` finsupp B => maxn (A x) (B x)]. Fact msetI_key : unit. Proof. exact: tt. Qed. Definition msetI A B := [mset[msetI_key] x in finsupp A `|` finsupp B => minn (A x) (B x)]. Fact msetD_key : unit. Proof. exact: tt. Qed. Definition msetD A B := [mset[msetD_key] x in finsupp A `|` finsupp B => A x + B x]. Fact msetB_key : unit. Proof. exact: tt. Qed. Definition msetB A B := [mset[msetB_key] x in finsupp A `|` finsupp B => A x - B x]. Fact msetM_key : unit. Proof. exact: tt. Qed. Definition msetM A B := [mset[msetM_key] x in finsupp A `*` finsupp B => A x.1 * B x.2]. Definition msubset A B := [forall x : finsupp A, A (val x) <= B (val x)]. Definition mproper A B := msubset A B && ~~ msubset B A. Definition mdisjoint A B := (msetI A B == mset0). End MultisetOps. Notation "[ 'mset' a ]" := (msetn 1 a) (at level 0, a at level 99, format "[ 'mset' a ]") : mset_scope. Notation "[ 'mset' a : T ]" := [mset (a : T)] (at level 0, a at level 99, format "[ 'mset' a : T ]") : mset_scope. Notation "A `|` B" := (msetU A B) : mset_scope. Notation "A `+` B" := (msetD A B) : mset_scope. Notation "A `\` B" := (msetB A B) : mset_scope. Notation "A `\ a" := (A `\` [mset a]) : mset_scope. Notation "a |` A" := ([mset (a)] `|` A) : mset_scope. Notation "a +` A" := ([mset (a)] `+` A) : mset_scope. Notation "A `*` B" := (msetM A B) : mset_scope. Notation "A `<=` B" := (msubset A B) (at level 70, no associativity) : mset_scope. Notation "A `<` B" := (mproper A B) (at level 70, no associativity) : mset_scope. (* This is left-associative due to historical limitations of the .. Notation. *) Notation "[ 'mset' a1 ; a2 ; .. ; an ]" := (msetD .. (a1 +` (msetn 1 a2)) .. (msetn 1 an)) (at level 0, a1 at level 99, format "[ 'mset' a1 ; a2 ; .. ; an ]") : mset_scope. Notation "A `&` B" := (msetI A B) : mset_scope. Section MSupp. Context {K : choiceType}. Implicit Types (a b c : K) (A B C D : {mset K}) (s : seq K). Lemma enum_msetE a A : (a \in A) = (a \in flatten [seq nseq (A x) x | x <- finsupp A]). Proof. by transitivity (a \in enum_mset A); rewrite // unlock. Qed. Lemma msuppE a A : (a \in finsupp A) = (a \in A). Proof. (* Goal: @eq (list (Choice.sort K)) (@EnumMset.f K (@msetn K (S n) a)) (@nseq (Choice.sort K) (S n) a) *) rewrite enum_msetE. (* Goal: Bool.reflect (@eq (@multiset_of K (Phant (Choice.sort K))) (@seq_mset K s) (@seq_mset K s')) (@perm_eq (Choice.eqType K) s s') *) apply/idP/flattenP => [aA|/=[_ /mapP[x xA -> /nseqP[->//]]]]. (* Goal: @eq bool (@msubset K (@msetU K B C) A) (andb (@msubset K B A) (@msubset K C A)) *) exists (nseq (A a) a); first by apply/mapP; exists a. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by apply/nseqP; split=> //; rewrite lt0n -mem_finsupp. Qed. End MSupp. Section MSetTheory. Context {K : choiceType}. Implicit Types (a b c : K) (A B C D : {mset K}) (s : seq K). Lemma msetP {A B} : A =1 B <-> A = B. Proof. exact: fsfunP. Qed. Lemma mset_neq0 a A : (A a != 0) = (a \in A). Proof. by rewrite -msuppE mem_finsupp. Qed. Lemma in_mset a A : (a \in A) = (A a > 0). Proof. by rewrite -mset_neq0 lt0n. Qed. Lemma mset_eq0 a A : (A a == 0) = (a \notin A). Proof. by rewrite -mset_neq0 negbK. Qed. Lemma mset_eq0P {a A} : reflect (A a = 0) (a \notin A). Proof. by rewrite -mset_eq0; apply: eqP. Qed. Lemma mset_gt0 a A : (A a > 0) = (a \in A). Proof. by rewrite -in_mset. Qed. Lemma mset_eqP {A B} : reflect (A =1 B) (A == B). Proof. exact: (equivP eqP (iff_sym msetP)). Qed. Lemma mset0E a : mset0 a = 0. Proof. by rewrite /mset0 fsfunE. Qed. Lemma msetnE n a b : (msetn n a) b = if b == a then n else 0. Proof. by rewrite fsfunE inE. Qed. Lemma msetnxx n a : (msetn n a) a = n. Proof. by rewrite msetnE eqxx. Qed. Lemma msetE2 A B a : ((A `+` B) a = A a + B a) * ((A `|` B) a = maxn (A a) (B a)) * ((A `&` B) a = minn (A a) (B a)) * ((A `\` B) a = (A a) - (B a)). Proof. (* Goal: @eq (Equality.sort nat_eqType) (@fun_of_fsfun (prod_choiceType K K) nat_eqType (fun _ : Choice.sort (prod_choiceType K K) => O) (@msetM K A B) u) (muln (@fun_of_fsfun K nat_eqType (fun _ : Choice.sort K => O) A (@fst (Choice.sort K) (Choice.sort K) u)) (@fun_of_fsfun K nat_eqType (fun _ : Choice.sort K => O) B (@snd (Choice.sort K) (Choice.sort K) u))) *) rewrite !fsfunE !inE !msuppE -!mset_neq0; case: ifPn => //. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by rewrite negb_or !negbK => /andP [/eqP-> /eqP->]. Qed. Lemma count_mem_mset a A : count_mem a A = A a. Proof. (* Goal: @eq (list (Choice.sort K)) (@EnumMset.f K (@msetn K (S n) a)) (@nseq (Choice.sort K) (S n) a) *) rewrite unlock count_flatten sumn_map big_map. (* Goal: @eq (list (Choice.sort K)) (@EnumMset.f K (@msetn K (S n) a)) (@nseq (Choice.sort K) (S n) a) *) rewrite (eq_bigr _ (fun _ _ => esym (sum1_count _ _))) /=. (* Goal: @eq (list (Choice.sort K)) (@EnumMset.f K (@msetn K (S n) a)) (@nseq (Choice.sort K) (S n) a) *) rewrite (eq_bigr _ (fun _ _ => big_nseq_cond _ _ _ _ _ _)) /= -big_mkcond /=. (* Goal: @eq nat (@BigOp.bigop nat (Choice.sort K) O (@enum_fset K (@FinSupp.fs K nat_eqType (fun _ : Choice.sort K => O) A)) (fun i : Choice.sort K => @BigBody nat (Choice.sort K) i addn (@eq_op (Choice.eqType K) i a) (@iter nat (@fun_of_fsfun K nat_eqType (fun _ : Choice.sort K => O) A i) (addn (S O)) O))) (@fun_of_fsfun K nat_eqType (fun _ : Choice.sort K => O) A a) *) have [aNA|aA] := finsuppP. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by rewrite big1_fset // => i iA /eqP eq_ia; rewrite -eq_ia iA in aNA. (* Goal: @eq (list (Choice.sort K)) (@EnumMset.f K (@msetn K (S n) a)) (@nseq (Choice.sort K) (S n) a) *) rewrite big_fset_condE/= (big_fsetD1 a) ?inE ?eqxx ?andbT //= iter_addn mul1n. (* Goal: @eq (list (Choice.sort K)) (@EnumMset.f K (@msetn K (S n) a)) (@nseq (Choice.sort K) (S n) a) *) rewrite (_ : (_ `\ _)%fset = fset0) ?big_seq_fset0 ?addn0//. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by apply/fsetP=> i; rewrite !inE; case: (i == a); rewrite ?(andbF, andbT). Qed. Lemma perm_undup_mset A : perm_eq (undup A) (finsupp A). Proof. (* Goal: is_true (@perm_eq (Choice.eqType K) (@undup (Choice.eqType K) (@EnumMset.f K A)) (@enum_fset K (@FinSupp.fs K nat_eqType (fun _ : Choice.sort K => O) A))) *) apply: uniq_perm_eq; rewrite ?undup_uniq // => a. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by rewrite mem_undup msuppE. Qed. Section big_com. Variables (R : Type) (idx : R) (op : Monoid.com_law idx). Implicit Types (X : {mset K}) (P : pred K) (F : K -> R). Lemma big_mset X P F : \big[op/idx]_(i <- X | P i) F i = \big[op/idx]_(i <- finsupp X | P i) iterop (X i) op (F i) idx. Proof. (* Goal: @eq (list (Choice.sort K)) (@EnumMset.f K (@msetn K (S n) a)) (@nseq (Choice.sort K) (S n) a) *) rewrite [in RHS](eq_big_perm (undup X)) 1?perm_eq_sym ?perm_undup_mset//. (* Goal: @eq bool (@eq_op nat_eqType (@BigOp.bigop nat (Equality.sort I) O r (fun i : Equality.sort I => @BigBody nat (Equality.sort I) i addn (P i) (E i))) O) (@all (Equality.sort I) (@pred_of_simpl (Equality.sort I) (@SimplPred (Equality.sort I) (fun i : Equality.sort I => implb (P i) (@eq_op nat_eqType (E i) O)))) r) *) rewrite -[in LHS]big_undup_iterop_count; apply: eq_bigr => i _. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by rewrite count_mem_mset. Qed. End big_com. Lemma sum_mset (X : {mset K}) (P : pred K) (F : K -> nat) : \sum_(i <- X | P i) F i = \sum_(i <- finsupp X | P i) X i * F i. Proof. (* Goal: @eq bool (@eq_op nat_eqType (@BigOp.bigop nat (Equality.sort I) O r (fun i : Equality.sort I => @BigBody nat (Equality.sort I) i addn (P i) (E i))) O) (@all (Equality.sort I) (@pred_of_simpl (Equality.sort I) (@SimplPred (Equality.sort I) (fun i : Equality.sort I => implb (P i) (@eq_op nat_eqType (E i) O)))) r) *) rewrite big_mset; apply: eq_bigr => i _ //. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by rewrite Monoid.iteropE iter_addn addn0 mulnC. Qed. Lemma prod_mset (X : {mset K}) (P : pred K) (F : K -> nat) : \prod_(i <- X | P i) F i = \prod_(i <- finsupp X | P i) F i ^ X i. Proof. by rewrite big_mset. Qed. Lemma mset_seqE s a : (seq_mset s) a = count_mem a s. Proof. by rewrite fsfunE inE/=; case: ifPn => // /count_memPn ->. Qed. Lemma perm_eq_seq_mset s : perm_eq (seq_mset s) s. Proof. by apply/allP => a _ /=; rewrite count_mem_mset mset_seqE. Qed. Lemma seq_mset_id A : seq_mset A = A. Proof. by apply/msetP=> a; rewrite mset_seqE count_mem_mset. Qed. Lemma eq_seq_msetP s s' : reflect (seq_mset s = seq_mset s') (perm_eq s s'). Proof. (* Goal: Bool.reflect (@eq (@multiset_of K (Phant (Choice.sort K))) (@seq_mset K s) (@seq_mset K s')) (@perm_eq (Choice.eqType K) s s') *) apply: (iffP idP) => [/perm_eqP perm_ss'|eq_ss']. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by apply/msetP => a; rewrite !mset_seqE perm_ss'. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by apply/allP => a _ /=; rewrite -!mset_seqE eq_ss'. Qed. Lemma msetME A B (u : K * K) : (A `*` B) u = A u.1 * B u.2. Proof. (* Goal: @eq (Equality.sort nat_eqType) (@fun_of_fsfun (prod_choiceType K K) nat_eqType (fun _ : Choice.sort (prod_choiceType K K) => O) (@msetM K A B) u) (muln (@fun_of_fsfun K nat_eqType (fun _ : Choice.sort K => O) A (@fst (Choice.sort K) (Choice.sort K) u)) (@fun_of_fsfun K nat_eqType (fun _ : Choice.sort K => O) B (@snd (Choice.sort K) (Choice.sort K) u))) *) rewrite !fsfunE inE; case: ifPn => //=. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by rewrite negb_and !memNfinsupp => /orP [] /eqP->; rewrite ?muln0. Qed. Lemma mset1DE a A b : (a +` A) b = (b == a) + A b. Proof. by rewrite msetE2 msetnE; case: (b == a). Qed. Lemma mset1UE a A b : (a |` A) b = maxn (b == a) (A b). Proof. by rewrite msetE2 msetnE; case: (b == a). Qed. Lemma msetB1E a A b : (A `\ a) b = (A b) - (b == a). Proof. by rewrite msetE2 msetnE; case: (b == a). Qed. Let msetE := (mset0E, msetE2, msetnE, msetnxx, mset1DE, mset1UE, msetB1E, mset_seqE, msetME). Lemma in_mset0 a : a \in mset0 = false. Proof. by rewrite in_mset !msetE. Qed. Lemma in_msetn n a' a : a \in msetn n a' = (n > 0) && (a == a'). Proof. by rewrite in_mset msetE; case: (a == a'); rewrite ?andbT ?andbF. Qed. Lemma in_mset1 a' a : a \in [mset a'] = (a == a'). Proof. by rewrite in_msetn. Qed. Lemma in_msetD A B a : (a \in A `+` B) = (a \in A) || (a \in B). Proof. by rewrite !in_mset !msetE addn_gt0. Qed. Lemma in_msetU A B a : (a \in A `|` B) = (a \in A) || (a \in B). Proof. by rewrite !in_mset !msetE leq_max. Qed. Lemma in_msetDU A B a : (a \in A `+` B) = (a \in A `|` B). Proof. by rewrite in_msetU in_msetD. Qed. Lemma in_msetI A B a : (a \in A `&` B) = (a \in A) && (a \in B). Proof. by rewrite !in_mset msetE leq_min. Qed. Lemma in_msetB A B a : (a \in A `\` B) = (B a < A a). Proof. by rewrite -mset_neq0 msetE subn_eq0 ltnNge. Qed. Lemma in_mset1U a' A a : (a \in a' |` A) = (a == a') || (a \in A). Proof. by rewrite in_msetU in_mset msetE; case: (_ == _). Qed. Lemma in_mset1D a' A a : (a \in a' +` A) = (a == a') || (a \in A). Proof. by rewrite in_msetDU in_mset1U. Qed. Lemma in_msetB1 A b a : (a \in A `\ b) = ((a == b) ==> (A a > 1)) && (a \in A). Proof. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by rewrite in_msetB msetE in_mset; case: (_ == _); rewrite -?geq_max. Qed. Lemma in_msetM A B (u : K * K) : (u \in A `*` B) = (u.1 \in A) && (u.2 \in B). Proof. by rewrite -!msuppE !mem_finsupp msetE muln_eq0 negb_or. Qed. Definition in_msetE := (in_mset0, in_msetn, in_msetB1, in_msetU, in_msetI, in_msetD, in_msetM). Let inE := (inE, in_msetE, (@msuppE K)). Lemma enum_mset0 : mset0 = [::] :> seq K. Proof. by rewrite unlock finsupp0. Qed. Lemma msetn0 (a : K) : msetn 0 a = mset0. Proof. by apply/msetP=> i; rewrite !msetE if_same. Qed. Lemma finsupp_msetn n a : finsupp (msetn n a) = if n > 0 then [fset a] else fset0. Proof. by apply/fsetP => i; rewrite !inE; case: ifP => //=; rewrite inE. Qed. Lemma enum_msetn n a : msetn n a = nseq n a :> seq K. Proof. (* Goal: @eq bool (@msubset K (@msetU K B C) A) (andb (@msubset K B A) (@msubset K C A)) *) case: n => [|n]; first by rewrite msetn0 /= enum_mset0. (* Goal: @eq (list (Choice.sort K)) (@EnumMset.f K (@msetn K (S n) a)) (@nseq (Choice.sort K) (S n) a) *) rewrite unlock finsupp_msetn /= enum_fsetE /= enum_fset1 /= cats0. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by rewrite msetE eqxx. Qed. Section big. Variables (R : Type) (idx : R) (op : Monoid.law idx). Implicit Types (X : {mset K}) (P : pred K) (F : K -> R). Lemma big_mset0 P F : \big[op/idx]_(i <- mset0 | P i) F i = idx. Proof. by rewrite enum_mset0 big_nil. Qed. Lemma big_msetn n a P F : \big[op/idx]_(i <- msetn n a | P i) F i = if P a then iterop n op (F a) idx else idx. Proof. by rewrite enum_msetn big_nseq_cond Monoid.iteropE. Qed. End big. Lemma msetDC (A B : {mset K}) : A `+` B = B `+` A. Proof. by apply/msetP=> a; rewrite !msetE addnC. Qed. Lemma msetIC (A B : {mset K}) : A `&` B = B `&` A. Proof. by apply/msetP=> a; rewrite !msetE minnC. Qed. Lemma msetUC (A B : {mset K}) : A `|` B = B `|` A. Proof. by apply/msetP => a; rewrite !msetE maxnC. Qed. (* intersection *) Lemma mset0I A : mset0 `&` A = mset0. Proof. by apply/msetP => x; rewrite !msetE min0n. Qed. Lemma msetI0 A : A `&` mset0 = mset0. Proof. by rewrite msetIC mset0I. Qed. Lemma msetIA A B C : A `&` (B `&` C) = A `&` B `&` C. Proof. by apply/msetP=> x; rewrite !msetE minnA. Qed. Lemma msetICA A B C : A `&` (B `&` C) = B `&` (A `&` C). Proof. by rewrite !msetIA (msetIC A). Qed. Lemma msetIAC A B C : A `&` B `&` C = A `&` C `&` B. Proof. by rewrite -!msetIA (msetIC B). Qed. Lemma msetIACA A B C D : (A `&` B) `&` (C `&` D) = (A `&` C) `&` (B `&` D). Proof. by rewrite -!msetIA (msetICA B). Qed. Lemma msetIid A : A `&` A = A. Proof. by apply/msetP=> x; rewrite !msetE minnn. Qed. Lemma msetIIl A B C : A `&` B `&` C = (A `&` C) `&` (B `&` C). Proof. by rewrite msetIA !(msetIAC _ C) -(msetIA _ C) msetIid. Qed. Lemma msetIIr A B C : A `&` (B `&` C) = (A `&` B) `&` (A `&` C). Proof. by rewrite !(msetIC A) msetIIl. Qed. (* union *) Lemma mset0U A : mset0 `|` A = A. Proof. by apply/msetP => x; rewrite !msetE max0n. Qed. Lemma msetU0 A : A `|` mset0 = A. Proof. by rewrite msetUC mset0U. Qed. Lemma msetUA A B C : A `|` (B `|` C) = A `|` B `|` C. Proof. by apply/msetP=> x; rewrite !msetE maxnA. Qed. Lemma msetUCA A B C : A `|` (B `|` C) = B `|` (A `|` C). Proof. by rewrite !msetUA (msetUC B). Qed. Lemma msetUAC A B C : A `|` B `|` C = A `|` C `|` B. Proof. by rewrite -!msetUA (msetUC B). Qed. Lemma msetUACA A B C D : (A `|` B) `|` (C `|` D) = (A `|` C) `|` (B `|` D). Proof. by rewrite -!msetUA (msetUCA B). Qed. Lemma msetUid A : A `|` A = A. Proof. by apply/msetP=> x; rewrite !msetE maxnn. Qed. Lemma msetUUl A B C : A `|` B `|` C = (A `|` C) `|` (B `|` C). Proof. by rewrite msetUA !(msetUAC _ C) -(msetUA _ C) msetUid. Qed. Lemma msetUUr A B C : A `|` (B `|` C) = (A `|` B) `|` (A `|` C). Proof. by rewrite !(msetUC A) msetUUl. Qed. (* adjunction *) Lemma mset0D A : mset0 `+` A = A. Proof. by apply/msetP => x; rewrite !msetE add0n. Qed. Lemma msetD0 A : A `+` mset0 = A. Proof. by rewrite msetDC mset0D. Qed. Lemma msetDA A B C : A `+` (B `+` C) = A `+` B `+` C. Proof. by apply/msetP=> x; rewrite !msetE addnA. Qed. Lemma msetDCA A B C : A `+` (B `+` C) = B `+` (A `+` C). Proof. by rewrite !msetDA (msetDC B). Qed. Lemma msetDAC A B C : A `+` B `+` C = A `+` C `+` B. Proof. by rewrite -!msetDA (msetDC B). Qed. Lemma msetDACA A B C D : (A `+` B) `+` (C `+` D) = (A `+` C) `+` (B `+` D). Proof. by rewrite -!msetDA (msetDCA B). Qed. (* adjunction, union and difference with one element *) Lemma msetU1l x A B : x \in A -> x \in A `|` B. Proof. by move=> Ax /=; rewrite inE Ax. Qed. Lemma msetU1r A b : b \in A `|` [mset b]. Proof. by rewrite !inE eqxx orbT. Qed. Lemma msetB1P x A b : reflect ((x = b -> A x > 1) /\ x \in A) (x \in A `\ b). Proof. (* Goal: @eq (list (Choice.sort K)) (@EnumMset.f K (@msetn K (S n) a)) (@nseq (Choice.sort K) (S n) a) *) rewrite !inE. apply: (iffP andP); first by move=> [/implyP Ax ->]; split => // /eqP. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by move=> [Ax ->]; split => //; apply/implyP => /eqP. Qed. Lemma msetB11 b A : (b \in A `\ b) = (A b > 1). Proof. by rewrite inE eqxx /= in_mset -geq_max. Qed. Lemma msetB1K a A : a \in A -> a +` (A `\ a) = A. Proof. (* Goal: forall _ : is_true (negb (@in_mem (Choice.sort K) a (@mem (Equality.sort (Choice.eqType K)) (multiset_predType K) A))), @eq (@multiset_of K (Phant (Choice.sort K))) (@msetB K A (@msetn K (S O) a)) A *) move=> aA; apply/msetP=> x; rewrite !msetE subnKC //=. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by have [->|//] := altP eqP; rewrite mset_gt0. Qed. Lemma msetD1K a B : (a +` B) `\ a = B. Proof. by apply/msetP => x; rewrite !msetE addKn. Qed. Lemma msetU1K a B : a \notin B -> (a |` B) `\ a = B. Proof. (* Goal: forall _ : is_true (negb (@in_mem (Choice.sort K) a (@mem (Equality.sort (Choice.eqType K)) (multiset_predType K) A))), @eq (@multiset_of K (Phant (Choice.sort K))) (@msetB K A (@msetn K (S O) a)) A *) move=> aB; apply/msetP=> x; rewrite !msetE. (* Goal: @eq bool (@msubset K (@msetU K B C) A) (andb (@msubset K B A) (@msubset K C A)) *) have [->|] := altP eqP; first by rewrite (mset_eq0P _). (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by rewrite max0n subn0. Qed. Lemma mset1U1 x B : x \in x |` B. Proof. by rewrite !inE eqxx. Qed. Lemma mset1D1 x B : x \in x +` B. Proof. by rewrite !inE eqxx. Qed. Lemma mset1Ur x a B : x \in B -> x \in a |` B. Proof. by move=> Bx; rewrite !inE predU1r. Qed. Lemma mset1Dr x a B : x \in B -> x \in a +` B. Proof. by move=> Bx; rewrite !inE predU1r. Qed. Lemma mset2P x a b : reflect (x = a \/ x = b) (x \in [mset a; b]). Proof. by rewrite !inE; apply: (iffP orP) => [] [] /eqP; intuition. Qed. Lemma in_mset2 x a b : (x \in [mset a; b]) = (x == a) || (x == b). Proof. by rewrite !inE. Qed. Lemma mset21 a b : a \in [mset a; b]. Proof. by rewrite mset1D1. Qed. Lemma mset22 a b : b \in [mset a; b]. Proof. by rewrite in_mset2 eqxx orbT. Qed. Lemma msetUP x A B : reflect (x \in A \/ x \in B) (x \in A `|` B). Proof. by rewrite !inE; exact: orP. Qed. Lemma msetDP x A B : reflect (x \in A \/ x \in B) (x \in A `+` B). Proof. by rewrite !inE; exact: orP. Qed. Lemma msetULVR x A B : x \in A `|` B -> (x \in A) + (x \in B). Proof. by rewrite inE; case: (x \in A); [left|right]. Qed. Lemma msetDLVR x A B : x \in A `+` B -> (x \in A) + (x \in B). Proof. by rewrite inE; case: (x \in A); [left|right]. Qed. (* distribute /cancel *) Lemma msetIUr A B C : A `&` (B `|` C) = (A `&` B) `|` (A `&` C). Proof. by apply/msetP=> x; rewrite !msetE minn_maxr. Qed. Lemma msetIUl A B C : (A `|` B) `&` C = (A `&` C) `|` (B `&` C). Proof. by apply/msetP=> x; rewrite !msetE minn_maxl. Qed. Lemma msetUIr A B C : A `|` (B `&` C) = (A `|` B) `&` (A `|` C). Proof. by apply/msetP=> x; rewrite !msetE maxn_minr. Qed. Lemma msetUIl A B C : (A `&` B) `|` C = (A `|` C) `&` (B `|` C). Proof. by apply/msetP=> x; rewrite !msetE maxn_minl. Qed. Lemma msetUKC A B : (A `|` B) `&` A = A. Proof. by apply/msetP=> x; rewrite !msetE maxnK. Qed. Lemma msetUK A B : (B `|` A) `&` A = A. Proof. by rewrite msetUC msetUKC. Qed. Lemma msetKUC A B : A `&` (B `|` A) = A. Proof. by rewrite msetIC msetUK. Qed. Lemma msetKU A B : A `&` (A `|` B) = A. Proof. by rewrite msetIC msetUKC. Qed. Lemma msetIKC A B : (A `&` B) `|` A = A. Proof. by apply/msetP=> x; rewrite !msetE minnK. Qed. Lemma msetIK A B : (B `&` A) `|` A = A. Proof. by rewrite msetIC msetIKC. Qed. Lemma msetKIC A B : A `|` (B `&` A) = A. Proof. by rewrite msetUC msetIK. Qed. Lemma msetKI A B : A `|` (A `&` B) = A. Proof. by rewrite msetIC msetKIC. Qed. Lemma msetUKid A B : B `|` A `|` A = B `|` A. Proof. by rewrite -msetUA msetUid. Qed. Lemma msetUKidC A B : A `|` B `|` A = A `|` B. Proof. by rewrite msetUAC msetUid. Qed. Lemma msetKUid A B : A `|` (A `|` B) = A `|` B. Proof. by rewrite msetUA msetUid. Qed. Lemma msetKUidC A B : A `|` (B `|` A) = B `|` A. Proof. by rewrite msetUCA msetUid. Qed. Lemma msetIKid A B : B `&` A `&` A = B `&` A. Proof. by rewrite -msetIA msetIid. Qed. Lemma msetIKidC A B : A `&` B `&` A = A `&` B. Proof. by rewrite msetIAC msetIid. Qed. Lemma msetKIid A B : A `&` (A `&` B) = A `&` B. Proof. by rewrite msetIA msetIid. Qed. Lemma msetKIidC A B : A `&` (B `&` A) = B `&` A. Proof. by rewrite msetICA msetIid. Qed. Lemma msetDIr A B C : A `+` (B `&` C) = (A `+` B) `&` (A `+` C). Proof. by apply/msetP=> x; rewrite !msetE addn_minr. Qed. Lemma msetDIl A B C : (A `&` B) `+` C = (A `+` C) `&` (B `+` C). Proof. by apply/msetP=> x; rewrite !msetE addn_minl. Qed. Lemma msetDKIC A B : (A `+` B) `&` A = A. Proof. by apply/msetP=> x; rewrite !msetE (minn_idPr _) // leq_addr. Qed. Lemma msetDKI A B : (B `+` A) `&` A = A. Proof. by rewrite msetDC msetDKIC. Qed. Lemma msetKDIC A B : A `&` (B `+` A) = A. Proof. by rewrite msetIC msetDKI. Qed. Lemma msetKDI A B : A `&` (A `+` B) = A. Proof. by rewrite msetDC msetKDIC. Qed. (* adjunction / subtraction *) Lemma msetDKB A : cancel (msetD A) (msetB^~ A). Proof. by move=> B; apply/msetP => a; rewrite !msetE addKn. Qed. Lemma msetDKBC A : cancel (msetD^~ A) (msetB^~ A). Proof. by move=> B; rewrite msetDC msetDKB. Qed. Lemma msetBSKl A B a : ((a +` A) `\` B) `\ a = A `\` B. Proof. (* Goal: @eq (@multiset_of K (Phant (Choice.sort K))) (@msetB K (@msetB K (@msetD K (@msetn K (S O) a) A) B) (@msetn K (S O) a)) (@msetB K A B) *) apply/msetP=> b; rewrite !msetE; case: ifPn; rewrite ?add0n ?subn0 //. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by rewrite add1n subn1 subSKn. Qed. Lemma msetBDl C A B : (C `+` A) `\` (C `+` B) = A `\` B. Proof. by apply/msetP=> a; rewrite !msetE subnDl. Qed. Lemma msetBDr C A B : (A `+` C) `\` (B `+` C) = A `\` B. Proof. by apply/msetP=> a; rewrite !msetE subnDr. Qed. Lemma msetBDA A B C : B `\` (A `+` C) = B `\` A `\` C. Proof. by apply/msetP=> a; rewrite !msetE subnDA. Qed. Lemma msetUE A B C : msetU A B = A `+` (B `\` A). Proof. by apply/msetP=> a; rewrite !msetE maxnE. Qed. (* subset *) Lemma msubsetP {A B} : reflect (forall x, A x <= B x) (A `<=` B). Proof. (* Goal: Bool.reflect (forall x : Choice.sort K, is_true (leq (@fun_of_fsfun K nat_eqType (fun _ : Choice.sort K => O) A x) (@fun_of_fsfun K nat_eqType (fun _ : Choice.sort K => O) B x))) (@msubset K A B) *) apply: (iffP forallP)=> // ? x; case: (in_fsetP (finsupp A) x) => //. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by rewrite msuppE => /mset_eq0P->. Qed. Lemma msubset_subset {A B} : A `<=` B -> {subset A <= B}. Proof. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by move=> /msubsetP AB x; rewrite !in_mset => ?; exact: (leq_trans _ (AB _)). Qed. Lemma msetB_eq0 (A B : {mset K}) : (A `\` B == mset0) = (A `<=` B). Proof. apply/mset_eqP/msubsetP => AB a; by have := AB a; rewrite !msetE -subn_eq0 => /eqP. Qed. Lemma msubset_refl A : A `<=` A. Proof. exact/msubsetP. Qed. Hint Resolve msubset_refl. Lemma msubset_trans : transitive (@msubset K). Proof. (* Goal: @transitive (@multiset_of K (Phant (Choice.sort K))) (@msubset K) *) move=> y x z /msubsetP xy /msubsetP yz ; apply/msubsetP => a. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by apply: (leq_trans (xy _)). Qed. Arguments msubset_trans {C A B} _ _ : rename. Lemma msetUS C A B : A `<=` B -> C `|` A `<=` C `|` B. Proof. (* Goal: forall _ : is_true (negb (@in_mem (Choice.sort K) a (@mem (Equality.sort (Choice.eqType K)) (multiset_predType K) A))), @eq (@multiset_of K (Phant (Choice.sort K))) (@msetB K A (@msetn K (S O) a)) A *) move=> sAB; apply/msubsetP=> x; rewrite !msetE. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by rewrite geq_max !leq_max leqnn (msubsetP sAB) orbT. Qed. Lemma msetDS C A B : A `<=` B -> C `+` A `<=` C `+` B. Proof. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by move=> /msubsetP sAB; apply/msubsetP=> x; rewrite !msetE leq_add2l. Qed. Lemma msetSU C A B : A `<=` B -> A `|` C `<=` B `|` C. Proof. by move=> sAB; rewrite -!(msetUC C) msetUS. Qed. Lemma msetSD C A B : A `<=` B -> A `+` C `<=` B `+` C. Proof. by move=> sAB; rewrite -!(msetDC C) msetDS. Qed. Lemma msetUSS A B C D : A `<=` C -> B `<=` D -> A `|` B `<=` C `|` D. Proof. by move=> /(msetSU B) /msubset_trans sAC /(msetUS C)/sAC. Qed. Lemma msetDSS A B C D : A `<=` C -> B `<=` D -> A `+` B `<=` C `+` D. Proof. by move=> /(msetSD B) /msubset_trans sAC /(msetDS C)/sAC. Qed. Lemma msetIidPl {A B} : reflect (A `&` B = A) (A `<=` B). Proof. (* Goal: @eq bool (@msubset K (@msetU K B C) A) (andb (@msubset K B A) (@msubset K C A)) *) apply: (iffP msubsetP) => [?|<- a]; last by rewrite !msetE geq_min leqnn orbT. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by apply/msetP => a; rewrite !msetE (minn_idPl _). Qed. Lemma msetIidPr {A B} : reflect (A `&` B = B) (B `<=` A). Proof. by rewrite msetIC; apply: msetIidPl. Qed. Lemma msubsetIidl A B : (A `<=` A `&` B) = (A `<=` B). Proof. (* Goal: @eq bool (@msubset K A (@msetI K A B)) (@msubset K A B) *) apply/msubsetP/msubsetP=> sAB a; have := sAB a; rewrite !msetE. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by rewrite leq_min leqnn. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by move/minn_idPl->. Qed. Lemma msubsetIidr A B : (B `<=` A `&` B) = (B `<=` A). Proof. by rewrite msetIC msubsetIidl. Qed. Lemma msetUidPr A B : reflect (A `|` B = B) (A `<=` B). Proof. (* Goal: @eq bool (@msubset K (@msetU K B C) A) (andb (@msubset K B A) (@msubset K C A)) *) apply: (iffP msubsetP) => [AB|<- a]; last by rewrite !msetE leq_max leqnn. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by apply/msetP=> a; rewrite !msetE (maxn_idPr _). Qed. Lemma msetUidPl A B : reflect (A `|` B = A) (B `<=` A). Proof. by rewrite msetUC; apply/msetUidPr. Qed. Lemma msubsetUl A B : A `<=` A `|` B. Proof. by apply/msubsetP=> a; rewrite !msetE leq_maxl. Qed. Hint Resolve msubsetUl. Lemma msubsetUr A B : B `<=` (A `|` B). Proof. by rewrite msetUC. Qed. Hint Resolve msubsetUr. Lemma msubsetU1 x A : A `<=` (x |` A). Proof. by rewrite msubsetUr. Qed. Hint Resolve msubsetU1. Lemma msubsetU A B C : (A `<=` B) || (A `<=` C) -> A `<=` (B `|` C). Proof. by move=> /orP [] /msubset_trans ->. Qed. Lemma eqEmsubset A B : (A == B) = (A `<=` B) && (B `<=` A). Proof. (* Goal: @eq bool (@msubset K (@msetU K B C) A) (andb (@msubset K B A) (@msubset K C A)) *) apply/eqP/andP => [<-|[/msubsetP AB /msubsetP BA]]; first by split. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by apply/msetP=> a; apply/eqP; rewrite eqn_leq AB BA. Qed. Lemma msubEproper A B : A `<=` B = (A == B) || (A `<` B). Proof. by rewrite eqEmsubset -andb_orr orbN andbT. Qed. Lemma mproper_sub A B : A `<` B -> A `<=` B. Proof. by rewrite msubEproper orbC => ->. Qed. Lemma eqVmproper A B : A `<=` B -> A = B \/ A `<` B. Proof. by rewrite msubEproper => /predU1P. Qed. Lemma mproperEneq A B : A `<` B = (A != B) && (A `<=` B). Proof. by rewrite andbC eqEmsubset negb_and andb_orr andbN. Qed. Lemma mproper_neq A B : A `<` B -> A != B. Proof. by rewrite mproperEneq; case/andP. Qed. Lemma eqEmproper A B : (A == B) = (A `<=` B) && ~~ (A `<` B). Proof. by rewrite negb_and negbK andb_orr andbN eqEmsubset. Qed. Lemma msub0set A : msubset mset0 A. Proof. by apply/msubsetP=> x; rewrite msetE. Qed. Hint Resolve msub0set. Lemma msubset0 A : (A `<=` mset0) = (A == mset0). Proof. by rewrite eqEmsubset msub0set andbT. Qed. Lemma mproper0 A : (mproper mset0 A) = (A != mset0). Proof. by rewrite /mproper msub0set msubset0. Qed. Lemma mproperE A B : (A `<` B) = (A `<=` B) && ~~ (msubset B A). Proof. by []. Qed. Lemma mproper_sub_trans B A C : A `<` B -> B `<=` C -> A `<` C. Proof. (* Goal: forall (_ : is_true (@msubset K A B)) (_ : is_true (@mproper K B C)), is_true (@mproper K A C) *) move=> /andP [AB NBA] BC; rewrite /mproper (msubset_trans AB) //=. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by apply: contra NBA=> /(msubset_trans _)->. Qed. Lemma msub_proper_trans B A C : A `<=` B -> B `<` C -> A `<` C. Proof. (* Goal: forall (_ : is_true (@msubset K A B)) (_ : is_true (@mproper K B C)), is_true (@mproper K A C) *) move=> AB /andP [CB NCB]; rewrite /mproper (msubset_trans AB) //=. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by apply: contra NCB=> /msubset_trans->. Qed. Lemma msubset_neq0 A B : A `<=` B -> A != mset0 -> B != mset0. Proof. by rewrite -!mproper0 => sAB /mproper_sub_trans->. Qed. (* msub is a morphism *) Lemma msetBDKC A B : A `<=` B -> A `+` (B `\` A) = B. Proof. by move=> /msubsetP AB; apply/msetP=> a; rewrite !msetE subnKC. Qed. Lemma msetBDK A B : A `<=` B -> B `\` A `+` A = B. Proof. by move=> /msubsetP AB; apply/msetP => a; rewrite !msetE subnK. Qed. Lemma msetBBK A B : A `<=` B -> B `\` (B `\` A) = A. Proof. by move=> /msubsetP AB; apply/msetP => a; rewrite !msetE subKn. Qed. Lemma msetBD1K A B a : A `<=` B -> A a < B a -> a +` (B `\` (a +` A)) = B `\` A. Proof. (* Goal: forall _ : is_true (negb (@in_mem (Choice.sort K) a (@mem (Equality.sort (Choice.eqType K)) (multiset_predType K) A))), @eq (@multiset_of K (Phant (Choice.sort K))) (@msetB K A (@msetn K (S O) a)) A *) move=> /msubsetP AB ABa; apply/msetP => b; rewrite !msetE. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by case: ifP => //= /eqP->; rewrite !add1n subnSK. Qed. Lemma subset_msetBLR A B C : (msubset (A `\` B) C) = (A `<=` B `+` C). Proof. apply/msubsetP/msubsetP => [] sABC a; by have := sABC a; rewrite !msetE ?leq_subLR. Qed. Lemma msetnP n x a : reflect (0 < n /\ x = a) (x \in msetn n a). Proof. by do [apply: (iffP idP); rewrite !inE] => [/andP[]|[]] -> /eqP. Qed. Lemma gt0_msetnP n x a : 0 < n -> reflect (x = a) (x \in msetn n a). Proof. by move=> n_gt0; rewrite inE n_gt0 /=; exact: eqP. Qed. Lemma msetn1 n a : a \in msetn n a = (n > 0). Proof. by rewrite inE eqxx andbT. Qed. Lemma mset1P x a : reflect (x = a) (x \in [mset a]). Proof. by rewrite inE; exact: eqP. Qed. Lemma mset11 a : a \in [mset a]. Proof. by rewrite inE /=. Qed. Lemma msetn_inj n : n > 0 -> injective (@msetn K n). Proof. (* Goal: @transitive (@multiset_of K (Phant (Choice.sort K))) (@msubset K) *) move=> n_gt0 a b eqsab; apply/(gt0_msetnP _ _ n_gt0). (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by rewrite -eqsab inE n_gt0 eqxx. Qed. Lemma mset1UP x a B : reflect (x = a \/ x \in B) (x \in a |` B). Proof. by rewrite !inE; exact: predU1P. Qed. Lemma mset_cons a s : seq_mset (a :: s) = a +` (seq_mset s). Proof. by apply/msetP=> x; rewrite !msetE /= eq_sym. Qed. (* intersection *) Lemma msetIP x A B : reflect (x \in A /\ x \in B) (x \in A `&` B). Proof. by rewrite inE; apply: andP. Qed. Lemma msetIS C A B : A `<=` B -> C `&` A `<=` C `&` B. Proof. (* Goal: forall _ : is_true (negb (@in_mem (Choice.sort K) a (@mem (Equality.sort (Choice.eqType K)) (multiset_predType K) A))), @eq (@multiset_of K (Phant (Choice.sort K))) (@msetB K A (@msetn K (S O) a)) A *) move=> sAB; apply/msubsetP=> x; rewrite !msetE. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by rewrite leq_min !geq_min leqnn (msubsetP sAB) orbT. Qed. Lemma msetSI C A B : A `<=` B -> A `&` C `<=` B `&` C. Proof. by move=> sAB; rewrite -!(msetIC C) msetIS. Qed. Lemma msetISS A B C D : A `<=` C -> B `<=` D -> A `&` B `<=` C `&` D. Proof. by move=> /(msetSI B) /msubset_trans sAC /(msetIS C) /sAC. Qed. (* difference *) Lemma msetSB C A B : A `<=` B -> A `\` C `<=` B `\` C. Proof. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by move=> /msubsetP sAB; apply/msubsetP=> x; rewrite !msetE leq_sub2r. Qed. Lemma msetBS C A B : A `<=` B -> C `\` B `<=` C `\` A. Proof. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by move=> /msubsetP sAB; apply/msubsetP=> x; rewrite !msetE leq_sub2l. Qed. Lemma msetBSS A B C D : A `<=` C -> D `<=` B -> A `\` B `<=` C `\` D. Proof. by move=> /(msetSB B) /msubset_trans sAC /(msetBS C) /sAC. Qed. Lemma msetB0 A : A `\` mset0 = A. Proof. by apply/msetP=> x; rewrite !msetE subn0. Qed. Lemma mset0B A : mset0 `\` A = mset0. Proof. by apply/msetP=> x; rewrite !msetE sub0n. Qed. Lemma msetBxx A : A `\` A = mset0. Proof. by apply/msetP=> x; rewrite !msetE subnn. Qed. (* other inclusions *) Lemma msubsetIl A B : A `&` B `<=` A. Proof. by apply/msubsetP=> x; rewrite msetE geq_minl. Qed. Lemma msubsetIr A B : A `&` B `<=` B. Proof. by apply/msubsetP=> x; rewrite msetE geq_minr. Qed. Lemma msubsetDl A B : A `\` B `<=` A. Proof. by apply/msubsetP=> x; rewrite msetE leq_subLR leq_addl. Qed. Lemma msubD1set A x : A `\ x `<=` A. Proof. by rewrite msubsetDl. Qed. Hint Resolve msubsetIl msubsetIr msubsetDl msubD1set. (* cardinal lemmas for msets *) Lemma mem_mset1U a A : a \in A -> a |` A = A. Proof. (* Goal: forall _ : is_true (@in_mem (Choice.sort K) a (@mem (Equality.sort (Choice.eqType K)) (multiset_predType K) A)), @eq (@multiset_of K (Phant (Choice.sort K))) (@msetU K (@msetn K (S O) a) A) A *) rewrite in_mset => aA; apply/msetP => x; rewrite !msetE (maxn_idPr _) //. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by have [->|//] := altP eqP; rewrite (leq_trans _ aA). Qed. Lemma mem_msetD1 a A : a \notin A -> A `\ a = A. Proof. (* Goal: forall _ : is_true (negb (@in_mem (Choice.sort K) a (@mem (Equality.sort (Choice.eqType K)) (multiset_predType K) A))), @eq (@multiset_of K (Phant (Choice.sort K))) (@msetB K A (@msetn K (S O) a)) A *) move=> /mset_eq0P aA; apply/msetP => x; rewrite !msetE. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by have [->|] := altP eqP; rewrite ?aA ?subn0. Qed. Lemma msetIn a A n : A `&` msetn n a = msetn (minn (A a) n) a. Proof. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by apply/msetP => x; rewrite !msetE; have [->|] := altP eqP; rewrite ?minn0. Qed. Lemma msubIset A B C : (B `<=` A) || (C `<=` A) -> (B `&` C `<=` A). Proof. by case/orP; apply: msubset_trans; rewrite (msubsetIl, msubsetIr). Qed. Lemma msubsetI A B C : (A `<=` B `&` C) = (A `<=` B) && (A `<=` C). Proof. (* Goal: @eq bool (@msubset K A (@msetI K B C)) (andb (@msubset K A B) (@msubset K A C)) *) rewrite !(sameP msetIidPl eqP) msetIA; have [-> //| ] := altP (A `&` B =P A). (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by apply: contraNF => /eqP <-; rewrite -msetIA -msetIIl msetIAC. Qed. Lemma msubsetIP A B C : reflect (A `<=` B /\ A `<=` C) (A `<=` B `&` C). Proof. by rewrite msubsetI; exact: andP. Qed. Lemma msubUset A B C : (B `|` C `<=` A) = (B `<=` A) && (C `<=` A). Proof. (* Goal: @eq bool (@msubset K (@msetU K B C) A) (andb (@msubset K B A) (@msubset K C A)) *) apply/idP/idP => [subA|/andP [AB CA]]; last by rewrite -[A]msetUid msetUSS. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by rewrite !(msubset_trans _ subA). Qed. Lemma msubUsetP A B C : reflect (A `<=` C /\ B `<=` C) (A `|` B `<=` C). Proof. by rewrite msubUset; exact: andP. Qed. Lemma msetU_eq0 A B : (A `|` B == mset0) = (A == mset0) && (B == mset0). Proof. by rewrite -!msubset0 msubUset. Qed. Lemma setD_eq0 A B : (A `\` B == mset0) = (A `<=` B). Proof. by rewrite -msubset0 subset_msetBLR msetD0. Qed. Lemma msub1set A a : ([mset a] `<=` A) = (a \in A). Proof. (* Goal: @eq bool (@msubset K (@msetU K B C) A) (andb (@msubset K B A) (@msubset K C A)) *) apply/msubsetP/idP; first by move/(_ a); rewrite msetnxx in_mset. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by move=> ainA b; rewrite msetnE; case: eqP => // ->; rewrite -in_mset. Qed. Lemma msetDBA A B C : C `<=` B -> A `+` B `\` C = (A `+` B) `\` C. Proof. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by move=> /msubsetP CB; apply/msetP=> a; rewrite !msetE2 addnBA. Qed. Lemma mset_0Vmem A : (A = mset0) + {x : K | x \in A}. Proof. (* Goal: @eq bool (@msubset K (@msetU K B C) A) (andb (@msubset K B A) (@msubset K C A)) *) have [/fsetP Aisfset0 | [a ainA]] := fset_0Vmem (finsupp A); last first. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by right; exists a; rewrite -msuppE. left; apply/msetP => a; rewrite mset0E; apply/mset_eq0P. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by rewrite -msuppE Aisfset0 inE. Qed. Definition size_mset A : size A = \sum_(a <- finsupp A) A a. Proof. by rewrite -sum1_size sum_mset; apply: eq_bigr => i; rewrite muln1. Qed. Lemma size_mset0 : size (mset0 : {mset K}) = 0. Proof. by rewrite -sum1_size big_mset0. Qed. From mathcomp Require Import tuple. Lemma sum_nat_seq_eq0 (I : eqType) r (P : pred I) (E : I -> nat) : (\sum_(i <- r | P i) E i == 0) = all [pred i | P i ==> (E i == 0)] r. Proof. (* Goal: @eq bool (@eq_op nat_eqType (@BigOp.bigop nat (Equality.sort I) O r (fun i : Equality.sort I => @BigBody nat (Equality.sort I) i addn (P i) (E i))) O) (@all (Equality.sort I) (@pred_of_simpl (Equality.sort I) (@SimplPred (Equality.sort I) (fun i : Equality.sort I => implb (P i) (@eq_op nat_eqType (E i) O)))) r) *) rewrite big_tnth sum_nat_eq0; apply/forallP/allP => /= HE x. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by move=> /seq_tnthP[i ->]; apply: HE. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by apply: HE; rewrite mem_tnth. Qed. Lemma size_mset_eq0 A : (size A == 0) = (A == mset0). Proof. (* Goal: @eq bool (@msubset K (@msetU K B C) A) (andb (@msubset K B A) (@msubset K C A)) *) apply/idP/eqP => [|->]; last by rewrite size_mset0. rewrite size_mset sum_nat_seq_eq0 => /allP AP. apply/msetP => a /=; rewrite msetE. (* Goal: is_true (implb (P (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) (@eq_op nat_eqType (E (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) x)) O)) *) by have /= := AP a; case: finsuppP => // _ /(_ _)/eqP->. Qed. End MSetTheory.
(*************************************************************************) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Copyright (C) 2013 - 2015 *) (* Author C. Cohen *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* DRAFT - PLEASE USE WITH CAUTION *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* License CeCILL-B *) (*************************************************************************) From mathcomp Require Import ssreflect ssrbool ssrnat eqtype ssrfun seq. From mathcomp Require Import choice path finset finfun fintype bigop. From mathcomp Require Import bigenough. (*****************************************************************************) (* This file provides representations for finite sets over a choiceType K, *) (* finite maps with keys in a choiceType K and the values in an arbitrary *) (* type V, and total functions from K to V with finite support. *) (* The domain (resp. support) of a finite map (resp. fintely supported *) (* function) is a finite set, and so is the codomain (resp. image) when V *) (* is a choice type. *) (* *) (* {fset K} == finite sets of elements of K *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* {fmap K -> V} == finitely supported maps from K to V. *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* {fsfun K -> T for dflt} == finitely supported functions *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* with default value dflt : K -> V outside the support *) (* *) (********* finite sets *******************************************************) (* *) (* In the remainder, A and B are of type {fset K}. *) (* *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* - {fset K} is provided with a canonical structure of predType, in order *) (* to enable the notation "a \in A" *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* - There is a coercion from {fset K} to Type in order to interpret any *) (* finset A as the subType of elements a : K such that a \in A. *) (* Because of this coercion, writing a : A makes sense. *) (* *) (* The following notations are in the %fset scope *) (* fset0 == the empty finite set *) (* [fset k] == the singleton finite set {k} *) (* A `&` B == the intersection of A and B *) (* A `|` B == the union of A and B *) (* a |` B == the union of singleton a and B *) (* A `\` B == the complement of B in A *) (* A `\ b == A without b *) (* A `*` B == the cartesian product of A and B *) (* [disjoint A & B] := A `&` B == 0 *) (* A `<=` B == A is a subset of B *) (* A `<` B == A is a proper subset of B *) (* #|`A| == cardinal of A *) (* fincl AsubB a == turns a : A into an element of B *) (* using a proof AsubB of A \fsubset B *) (* fsub B A == turns A : {fset K} into a {set B} *) (* f @` A == the image set of the collective predicate A by f. *) (* f @2`(A, B) == the image set of A x B by the binary function f. *) (* *) (* In order to support the following notations, we introduce three canonical *) (* structure that reflect the finiteness of a predicate, in the following *) (* notations, p (resp q) are such finite predicates, which are ultimately *) (* represented by elements A (resp B) from {fset K}. *) (* *) (* [fset x in p | P] == the set of all x of type K, such that *) (* x \in p and P x where P is a predicate on K *) (* [fset x in p | P & Q] := [set x in p | P && Q]. *) (* *) (* [fset E | x in p] == the set of all the values of the expression E, for x *) (* drawn from the collective finite predicate p. *) (* [fset E | x in p & P] == the set of values of E for x drawn from p, such *) (* that P is true. *) (* [fset E | x in p, y in q] == the set of values of E for x drawn from p and*) (* and y drawn from q; q may depend on x. *) (* [fset E | x in p, y in q & P] == the set of values of E for x drawn from *) (* p and y drawn from q; such that P is true. *) (* [fsetval x in p] == the set of (val x) for x in the finite predicate p *) (* [fsetval x in p | P ] == the set of (val x) for x in p, such that P *) (* [fsetval x in p | P & Q] := [fsetval x in p | P && Q] *) (* *) (* For each notation above, there is an additional one with ':' instead of *) (* 'in' which is used to range over the finite type A instead of the finite *) (* set A, and the optional predicate is over A instead of K *) (* For example: *) (* [fset x : A | P] := [fset x in {: A} | P] *) (* == the set of all x of type A, such that P x *) (* [fset E | x : A] == the set of all the values of the expression E, for x *) (* drawn from the finite type A *) (* *) (* For each [fset ...] or [fsetval ...] notation, there is a keyed variant *) (* written [fset[key] ...] or [fsetval[key] ...] for locking *) (******* finite maps *********************************************************) (* *) (* Operations on finmap: *) (* The following notations are in the %fmap scope *) (* *) (* f.[? k] == returns Some v if k maps to v, otherwise None *) (* f.[p] == returns v if p has type k \in f, and k maps to v *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* f.[k <- v] == f extended with the mapping k -> v *) (* domf f == finite set (of type {fset K}) of keys of f *) (* codomf f == finite set (of type {fset V}) of values of f *) (* k \in f == k is a key of f *) (* := k \in domf f *) (* [fmap] == the empty finite map *) (* [fmap x : S => E] == the finmap defined by E on the support S *) (* f.[& A] == f restricted to A (intersected with domf f) *) (* f.[\ A] := f.[& domf `\` A] *) (* == f where all the keys in A have been removed *) (* f.[~ k] := f.[\ [fset k]] *) (* f + g == concatenation of f and g, *) (* the keys of g override the keys of f *) (* *) (******* finitely supported functions ****************************************) (* *) (* Operation on function with finite support, i.e. finmap with default value *) (* for elements outside of the support. Contrarly to finmap, these are total *) (* function, so we provide a coercion to Funclass *) (* *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* {fsfun K -> T for dflt} == finitely supported functions with default *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* value dflt : K -> V outside the support *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* {fsfun K -> T of x => dflt} := {fsfun K -> T for fun x => dflt} *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* {fsfun K -> T with dflt} := {fsfun K -> T for fun=> dflt} *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* {fsfun K -> K} := {fsfun K -> T for fun x => x} *) (* *) (* [fsfun for dflt] == the default fsfun *) (* [fsfun of x => dflt] == the default fsfun *) (* [fsfun x : A => F | default] == the fsfun which takes value F on A *) (* x has type A : {fset T} *) (* [fsfun x in A => F | default] == the fsfun which takes value F on A *) (* x has type T, where A : {fset T} *) (* we also provide untyped variants and variants where default is ommitted *) (* e.g. [fsfun x : A => F] [fsfun x => F | default] [fsfun]... *) (* and many variants to give the possibility to insert a key : unit *) (* to prevent conversion from diverging, e.g. *) (* [fsfun[key] x : A => F | default] and [fsfun[key] x in A => F | default] *) (* ... *) (* (f \o g)%fsfun == composition of fsfun *) (* fsinjectiveb f == boolean predicate of injectivity of f *) (*****************************************************************************) Set Implicit Arguments. Unset Strict Implicit. Import Prenex Implicits. Reserved Notation "{fset K }" (at level 0, format "{fset K }"). Reserved Notation "A `&` B" (at level 48, left associativity). Reserved Notation "A `*` B" (at level 46, left associativity). Reserved Notation "A `+` B" (at level 54, left associativity). Reserved Notation "A +` B" (at level 54, left associativity). Reserved Notation "A `|` B" (at level 52, left associativity). Reserved Notation "a |` A" (at level 52, left associativity). Reserved Notation "A `\` B" (at level 50, left associativity). Reserved Notation "A `\ b" (at level 50, left associativity). Reserved Notation "{fmap T }" (at level 0, format "{fmap T }"). (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Reserved Notation "x .[ k <- v ]" (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (at level 2, k at level 200, v at level 200, format "x .[ k <- v ]"). Reserved Notation "x .[~ k ]" (at level 2, k at level 200, format "x .[~ k ]"). Reserved Notation "x .[& k ]" (at level 2, k at level 200, format "x .[& k ]"). Reserved Notation "x .[\ k ]" (at level 2, k at level 200, format "x .[\ k ]"). Reserved Notation "x .[? k ]" (at level 2, k at level 200, format "x .[? k ]"). Reserved Infix "`~`" (at level 52). Reserved Notation "[ 'fset' k ]" (at level 0, k at level 99, format "[ 'fset' k ]"). Local Notation predOfType T := (sort_of_simpl_pred (@pred_of_argType T)). Section extra. Lemma mem_remF (T : eqType) (s : seq T) x : uniq s -> x \in rem x s = false. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) Proof. by move=> us; rewrite mem_rem_uniq // inE eqxx. Qed. Definition ffun0 (T : finType) (X : Type) : #|T| = 0 -> {ffun T -> X}. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) Proof. by move=> T0; split; rewrite T0; exists nil. Defined. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Definition oextract (T : Type) (o : option T) : o -> T := (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) if o is Some t return o -> T then fun=> t else False_rect T \o notF. Lemma oextractE (T : Type) (x : T) (xP : Some x) : oextract xP = x. Proof. by []. Qed. Lemma Some_oextract T (x : option T) (x_ex : x) : Some (oextract x_ex) = x. Proof. by case: x x_ex. Qed. Definition ojoin T (x : option (option T)) := if x is Some y then y else None. Lemma Some_ojoin T (x : option (option T)) : x -> Some (ojoin x) = x. Proof. by case : x. Qed. Lemma ojoinT T (x : option (option T)) : ojoin x -> x. Proof. by case: x. Qed. Section AllSigs. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Variables (S : Type) (T : S -> Type) (R : Type) (f : forall x, T x -> R). Implicit Types (s : seq S) (t : forall x, seq (T x)). Definition allsigs s t := foldr (fun x => cat (map (@f x) (t x))) [::] s. Lemma size_allsigs s t : size (allsigs s t) = sumn [seq size (t x) | x <- s]. Proof. by elim: s => //= x s IHs; rewrite size_cat size_map IHs. Qed. Lemma allsigs_cat s1 s2 t : allsigs (s1 ++ s2) t = allsigs s1 t ++ allsigs s2 t. Proof. by elim: s1 => //= x s1 ->; rewrite catA. Qed. End AllSigs. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma allsigs_comp S (T : S -> Type) R R' (f : forall x, T x -> R) (g : R -> R') s t : allsigs (fun x y => g (f x y)) s t = map g (allsigs f s t). Proof. by elim: s => //= x s ->; rewrite map_cat map_comp. Qed. Prenex Implicits allsigs. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Notation "[ 'seq' E | i <- s & j <- t ]" := (allsigs (fun i j => E) s (fun i => t)) (at level 0, E at level 99, i ident, j ident, (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) format "[ '[hv' 'seq' E '/ ' | i <- s & '/ ' j <- t ] ']'") : seq_scope. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Notation "[ 'seq' E | i : T <- s & j : U <- t ]" := (allsigs (fun (i : T) (j : U) => E) s (fun i : T => t)) (at level 0, E at level 99, i ident, j ident, only parsing) : seq_scope. Section EqAllSigs. Variables (S : eqType) (T : S -> eqType). Implicit Types (R : eqType) (s : seq S) (t : forall x, seq (T x)). (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma allsigsP R (f : forall x, T x -> R) s t z : reflect (exists p : sigT T, [/\ tag p \in s, tagged p \in t (tag p) & z = f (tag p) (tagged p)]) (z \in allsigs f s t). Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) elim: s => [|x s IHs /=]; first by right=> [[p []]]. (* Goal: @eq bool (@fsubset K A (@fsetI K B C)) (andb (@fsubset K A B) (@fsubset K A C)) *) rewrite mem_cat; have [fxt_z | not_fxt_z] := altP mapP. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by left; have [y t_y ->] := fxt_z; exists (Tagged T y); rewrite mem_head. (* Goal: is_true (negb (@eq_op (fset_eqType K) (@fsetD K C B) (@fsetD K C A))) *) apply: (iffP IHs) => [] [[x' y] /= [s_x' t_y def_z]]; exists (Tagged T y) => /=. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite !inE predU1r. (* Goal: Bool.reflect (@ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x1) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Equality.sort (Choice.eqType K)) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) a)) (@mem (Choice.sort K) (finSetPredType K) S))))) (fsinjectiveb f) *) have [def_x' | //] := predU1P s_x'. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by do [case: _ / def_x'; rewrite def_z map_f] in s_x' not_fxt_z *. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma mem_allsigs R (f : forall x, T x -> R) s1 t1 s2 t2 : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) s1 =i s2 -> (forall x, x \in s1 -> t1 x =i t2 x) -> allsigs f s1 t1 =i allsigs f s2 t2. Proof. move=> eq_s eq_t z; apply/allsigsP/allsigsP=> [] [p fpz]; exists p => []; by move: fpz (fpz) => [???]; rewrite eq_s eq_t //= 1?eq_s. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma allsigs_catr R (f : forall x, T x -> R) s t1 t2 : allsigs f s (fun x => t1 x ++ t2 x) =i allsigs f s t1 ++ allsigs f s t2. Proof. (* Goal: forall (_ : is_true (@fdisjoint K (@domf K V f) (@domf K V h))) (_ : is_true (@fdisjoint K (@domf K V g) (@domf K V h))) (_ : @eq (finMap K V) (catf h f) (catf h g)), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f g *) move=> z; rewrite mem_cat. (* Goal: Bool.reflect (@ex (Choice.sort K) (fun x : Choice.sort K => @eq (option (Choice.sort V)) (@fnd K (Choice.sort V) (@domf K (Choice.sort V) f) (@ffun_of_fmap K (Choice.sort V) f) x) (@Some (Choice.sort V) v))) (@in_mem (Choice.sort V) v (@mem (Choice.sort V) (finSetPredType V) (codomf f))) *) apply/allsigsP/orP=> [[p [sP1]]|]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite mem_cat; case/orP; [left | right]; apply/allsigsP; exists p. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by case=> /allsigsP[p [sp1 sp2 ->]]; exists p; rewrite mem_cat sp2 ?orbT. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma allsigs_uniq R (f : forall x, T x -> R) s t : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) uniq s -> (forall x, x \in s -> uniq (t x)) -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) {in [seq Tagged T y | x <- s & y <- t x] &, (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) injective (fun p : sigT T => f (tag p) (tagged p))} -> uniq (allsigs f s t). Proof. (* Goal: forall (_ : forall (x : Choice.sort T) (px : is_true (@in_mem (Choice.sort T) x (@pred_of_finmempred (Choice.eqType T) p))), P (@FSetSub K (@Imfset.imfset key T K f p (Phantom (mem_pred (Equality.sort (Choice.eqType T))) (@pred_of_finmempred (Choice.eqType T) p))) (f x) (@in_imfset T f p x px))) (k : @fset_sub_type K (@Imfset.imfset key T K f p (Phantom (mem_pred (Equality.sort (Choice.eqType T))) (@pred_of_finmempred (Choice.eqType T) p)))), P k *) move=> Us Ut inj_f; have: all (mem s) s by apply/allP. (* Goal: forall _ : is_true (@fsubset T (@fsetD T U X) U), P (@fsetD T U (@fsetD T U X)) *) elim: {-2}s Us => //= x s1 IHs /andP[s1'x Us1] /andP[sx1 ss1]. (* Goal: @big_rel_class_of (@finset_of K (Phant (Choice.sort K))) (@fsubset K) *) rewrite cat_uniq {}IHs // andbT map_inj_in_uniq ?Ut // => [|y1 y2 *]. (* Goal: @eq (@finset_of V (Phant (Choice.sort V))) (codomf (@restrictf K (Choice.sort V) f A)) (@Imfset.imfset imfset_key (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) V (fun k : Choice.sort (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) => @FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) (@mem_fin (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (simplPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@subfinset_finpred (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) (@mem_fin (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (predPredType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType)) (@fin_finpred (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (pred_finpredType (@fset_sub_finType K (@domf K (Choice.sort V) f))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType) (pred_of_argType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType))))) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => @in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@fset_sub_subType K (@domf K (Choice.sort V) f)) k) (@mem (Choice.sort K) (finSetPredType K) A)))) (Phantom (mem_pred (@fset_sub_type K (@domf K (Choice.sort V) f))) (@mem (@fset_sub_type K (@domf K (Choice.sort V) f)) (simplPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@SimplPred (@fset_sub_type K (@domf K (Choice.sort V) f)) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => andb (@in_mem (@fset_sub_type K (@domf K (Choice.sort V) f)) k (@mem (@fset_sub_type K (@domf K (Choice.sort V) f)) (predPredType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType)) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType) (pred_of_argType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType))))) (@in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@fset_sub_subType K (@domf K (Choice.sort V) f)) k) (@mem (Choice.sort K) (finSetPredType K) A))))))) *) apply/hasPn=> _ /allsigsP[z [s1z tz ->]]; apply/mapP=> [[y ty Dy]]. suffices [Dz1 _]: Tagged T (tagged z) = Tagged T y. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite -Dz1 s1z in s1'x. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) apply: inj_f => //; apply/allsigsP; last by exists (Tagged T y). (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by have:= allP ss1 _ s1z; exists z. suffices /eqP: Tagged T y1 = Tagged T y2 by rewrite eq_Tagged => /eqP. apply: inj_f => //; apply/allsigsP; by [exists (Tagged T y1) | exists (Tagged T y2)]. Qed. End EqAllSigs. Lemma big_allsigs (R : Type) (idx : R) (op : Monoid.law idx) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (I1 : Type) (I2 : I1 -> Type) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (r1 : seq I1) (r2 : forall i1, seq (I2 i1)) (F : sigT I2 -> R) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(i <- [seq Tagged I2 i2 | i1 <- r1 & i2 <- r2 i1]) F i = (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(i1 <- r1) \big[op/idx]_(i2 <- r2 i1) F (Tagged I2 i2). Proof. (* Goal: @eq R (@BigOp.bigop R (@sigT I1 (fun x : I1 => I2 x)) idx (@allsigs I1 (fun i1 : I1 => I2 i1) (@sigT I1 (fun x : I1 => I2 x)) (fun (i1 : I1) (i2 : (fun i2 : I1 => I2 i2) i1) => @Tagged I1 i1 I2 i2) r1 (fun i1 : I1 => r2 i1)) (fun i : @sigT I1 (fun x : I1 => I2 x) => @BigBody R (@sigT I1 (fun x : I1 => I2 x)) i (@Monoid.operator R idx op) true (F i))) (@BigOp.bigop R I1 idx r1 (fun i1 : I1 => @BigBody R I1 i1 (@Monoid.operator R idx op) true (@BigOp.bigop R (I2 i1) idx (r2 i1) (fun i2 : I2 i1 => @BigBody R (I2 i1) i2 (@Monoid.operator R idx op) true (F (@Tagged I1 i1 I2 i2)))))) *) elim: r1 => [|i1 r1 IHr1]; rewrite !(big_nil, big_cons)//= big_cat {}IHr1. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by case: (r2 i1) => [|i2 r21]; rewrite /= !(big_nil, big_cons)//= big_map. Qed. Section NatHomomorphism. Variable T : Type. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma homo_ltn_in (D : pred nat) (f : nat -> T) (r : T -> T -> Prop) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (forall y x z, r x y -> r y z -> r x z) -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) {in D &, forall i j k, i < k < j -> k \in D} -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) {in D, forall i, i.+1 \in D -> r (f i) (f i.+1)} -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) {in D &, {homo f : i j / i < j >-> r i j}}. Proof. move=> r_trans Dcx r_incr i j iD jD lt_ij; move: (lt_ij) (jD) => /subnKC<-. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) elim: (_ - _) => [|k ihk]; first by rewrite addn0 => Dsi; apply: r_incr. (* Goal: forall (_ : is_true (@fdisjoint K A B)) (C : @finset_of K (Phant (Choice.sort K))), is_true (@disjoint (@fset_sub_finType K C) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C A))) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C B)))) *) move=> DSiSk [: DSik]; apply: (r_trans _ _ _ (ihk _)); rewrite ?addnS. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by abstract: DSik; apply: (Dcx _ _ iD DSiSk); rewrite ltn_addr ?addnS /=. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply: r_incr; rewrite -?addnS. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma homo_ltn (f : nat -> T) (r : T -> T -> Prop) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (forall y x z, r x y -> r y z -> r x z) -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (forall i, r (f i) (f i.+1)) -> {homo f : i j / i < j >-> r i j}. Proof. by move=> /(@homo_ltn_in predT f) fr fS i j; apply: fr. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma homo_leq_in (D : pred nat) (f : nat -> T) (r : T -> T -> Prop) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (forall x, r x x) -> (forall y x z, r x y -> r y z -> r x z) -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) {in D &, forall i j k, i < k < j -> k \in D} -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) {in D, forall i, i.+1 \in D -> r (f i) (f i.+1)} -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) {in D &, {homo f : i j / i <= j >-> r i j}}. Proof. (* Goal: forall _ : is_true (@fsubset K (@fsetU K A B) C), @eq bool (@disjoint (@fset_sub_finType K C) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C A))) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C B)))) (@fdisjoint K A B) *) move=> r_refl r_trans Dcx /(homo_ltn_in r_trans Dcx) lt_r i j iD jD. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite leq_eqVlt => /predU1P[->//|/lt_r]; apply. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma homo_leq (f : nat -> T) (r : T -> T -> Prop) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (forall x, r x x) -> (forall y x z, r x y -> r y z -> r x z) -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (forall i, r (f i) (f i.+1)) -> {homo f : i j / i <= j >-> r i j}. Proof. by move=> rrefl /(@homo_leq_in predT f r) fr fS i j; apply: fr. Qed. End NatHomomorphism. End extra. Module Type SortKeysSig. Section SortKeys. Variable (K : choiceType). Implicit Types (k : K) (ks : seq K). Axiom f : seq K -> seq K. Axiom perm : forall s, perm_eq (f s) (undup s). Axiom uniq : forall s, uniq (f s). Axiom E : forall (s : seq K), f s =i s. Axiom eq : forall (s s' : seq K), s =i s' <-> f s = f s'. End SortKeys. End SortKeysSig. Module SortKeys : SortKeysSig. Section SortKeys. Variable (K : choiceType). Implicit Types (k : K) (ks : seq K). Definition f (s : seq K) := choose (perm_eq (undup s)) (undup s). Fact perm s : perm_eq (f s) (undup s). Proof. by rewrite perm_eq_sym chooseP. Qed. Fact uniq s : uniq (f s). Proof. by rewrite (perm_eq_uniq (perm _)) undup_uniq. Qed. Fact E (s : seq K) : f s =i s. Proof. by move=> x; rewrite (perm_eq_mem (perm _)) mem_undup. Qed. Lemma eq (s s' : seq K) : s =i s' <-> f s = f s'. Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) split=> [eq_ss'|eq_ss' k]; last by rewrite -E eq_ss' E. (* Goal: @eq bool (@fsubset K A (@fsetI K B C)) (andb (@fsubset K A B) (@fsubset K A C)) *) rewrite /f; have peq_ss' : perm_eq (undup s) (undup s'). (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply: uniq_perm_eq; rewrite ?undup_uniq // => x; rewrite !mem_undup. (* Goal: is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) a)) (@mem (Choice.sort K) (finSetPredType K) (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f))) *) (* Goal: @ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x1) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Choice.sort K) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K S a)) (@mem (Choice.sort K) (finSetPredType K) S)))) *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite (@choose_id _ _ _ (undup s')) //=; apply: eq_choose => x /=. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply: sym_left_transitive; [exact: perm_eq_sym|exact: perm_eq_trans|]. Qed. End SortKeys. End SortKeys. Hint Resolve SortKeys.perm. Hint Resolve SortKeys.uniq. Hint Resolve SortKeys.E. Notation sort_keys := SortKeys.f. Notation sort_keys_perm := SortKeys.perm. Notation sort_keys_uniq := SortKeys.uniq. Notation sort_keysE := SortKeys.E. Notation eq_sort_keys := SortKeys.eq. Section ChoiceKeys. Variable (K : choiceType). Implicit Types (k : K) (ks : seq K). Lemma mem_sort_keys ks k : k \in ks -> k \in sort_keys ks. Proof. by rewrite sort_keysE. Qed. Lemma mem_sort_keys_intro ks k : k \in sort_keys ks -> k \in ks. Proof. by rewrite sort_keysE. Qed. Lemma sort_keys_nil : sort_keys [::] = [::] :> seq K. Proof. (* Goal: Bool.reflect (@ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x1) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Equality.sort (Choice.eqType K)) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) a)) (@mem (Choice.sort K) (finSetPredType K) S))))) (fsinjectiveb f) *) have := sort_keysE ([::] : seq K). (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by case: sort_keys => //= a l /(_ a); rewrite mem_head. Qed. Lemma sort_keys_id ks : sort_keys (sort_keys ks) = sort_keys ks. Proof. by have /eq_sort_keys := sort_keysE ks. Qed. Definition canonical_keys ks := sort_keys ks == ks. Lemma canonical_uniq ks : canonical_keys ks -> uniq ks. Proof. by move=> /eqP <-; exact: sort_keys_uniq. Qed. Lemma canonical_sort_keys ks : canonical_keys (sort_keys ks). Proof. by rewrite /canonical_keys sort_keys_id. Qed. Lemma canonical_eq_keys ks ks' : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) canonical_keys ks -> canonical_keys ks' -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) ks =i ks' -> ks = ks'. Proof. (* Goal: forall (_ : is_true (canonical_keys ks)) (_ : is_true (canonical_keys ks')) (_ : @eq_mem (Equality.sort (Choice.eqType K)) (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) ks) (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) ks')), @eq (list (Choice.sort K)) ks ks' *) move=> /eqP; case: _ /; move=> /eqP; case: _ / => eq_ks_ks'. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply/eq_sort_keys => x; rewrite -sort_keysE eq_ks_ks' sort_keysE. Qed. Lemma size_sort_keys ks : size (sort_keys ks) = size (undup ks). Proof. exact: perm_eq_size. Qed. End ChoiceKeys. Arguments eq_sort_keys {K s s'}. Section Def. Variables (K : choiceType). Structure finSet : Type := mkFinSet { enum_fset :> seq K; _ : canonical_keys enum_fset }. Definition finset_of (_ : phant K) := finSet. End Def. Identity Coercion type_of_finset : finset_of >-> finSet. Notation "{fset T }" := (@finset_of _ (Phant T)) : type_scope. Definition pred_of_finset (K : choiceType) (f : finSet K) : pred K := fun k => k \in (enum_fset f). Canonical finSetPredType (K : choiceType) := Eval hnf in mkPredType (@pred_of_finset K). Section FinSetCanonicals. Variable (K : choiceType). Canonical fsetType := Eval hnf in [subType for (@enum_fset K)]. Definition fset_eqMixin := Eval hnf in [eqMixin of {fset K} by <:]. Canonical fset_eqType := Eval hnf in EqType {fset K} fset_eqMixin. Definition fset_choiceMixin := Eval hnf in [choiceMixin of {fset K} by <:]. Canonical fset_choiceType := Eval hnf in ChoiceType {fset K} fset_choiceMixin. End FinSetCanonicals. Section FinTypeSet. Variables (K : choiceType) (A : finSet K). Lemma keys_canonical : canonical_keys (enum_fset A). Proof. by case: A. Qed. Lemma fset_uniq : uniq (enum_fset A). Proof. by rewrite canonical_uniq // keys_canonical. Qed. Record fset_sub_type : predArgType := FSetSub {fsval : K; fsvalP : in_mem fsval (@mem K _ A)}. Canonical fset_sub_subType := Eval hnf in [subType for fsval]. Definition fset_sub_eqMixin := Eval hnf in [eqMixin of fset_sub_type by <:]. Canonical fset_sub_eqType := Eval hnf in EqType fset_sub_type fset_sub_eqMixin. Definition fset_sub_choiceMixin := Eval hnf in [choiceMixin of fset_sub_type by <:]. Canonical fset_sub_choiceType := Eval hnf in ChoiceType fset_sub_type fset_sub_choiceMixin. Definition fset_sub_enum : seq fset_sub_type := undup (pmap insub (enum_fset A)). Lemma mem_fset_sub_enum x : x \in fset_sub_enum. Proof. by rewrite mem_undup mem_pmap -valK map_f // fsvalP. Qed. Lemma val_fset_sub_enum : map val fset_sub_enum = enum_fset A. Proof. (* Goal: @eq (Equality.sort V) (@fun_of_fsfun K V default (of_ffun key) x) (@Option.default (Equality.sort V) (default x) (@Option.map (@fset_sub_type K S) (Equality.sort V) h (@insub (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) x))) *) rewrite /fset_sub_enum undup_id ?pmap_sub_uniq ?fset_uniq//. (* Goal: is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) a)) (@mem (Choice.sort K) (finSetPredType K) (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f))) *) (* Goal: @ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x1) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Choice.sort K) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K S a)) (@mem (Choice.sort K) (finSetPredType K) S)))) *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite (pmap_filter (@insubK _ _ _)); apply/all_filterP. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply/allP => x; rewrite isSome_insub. Qed. Definition fset_sub_pickle x := index x fset_sub_enum. Definition fset_sub_unpickle n := nth None (map some fset_sub_enum) n. Lemma fset_sub_pickleK : pcancel fset_sub_pickle fset_sub_unpickle. Proof. (* Goal: @big_rel_class_of (@finset_of K (Phant (Choice.sort K))) (@fsubset K) *) rewrite /fset_sub_unpickle => x. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite (nth_map x) ?nth_index ?index_mem ?mem_fset_sub_enum. Qed. Definition fset_sub_countMixin := CountMixin fset_sub_pickleK. Canonical fset_sub_countType := Eval hnf in CountType fset_sub_type fset_sub_countMixin. Definition fset_sub_finMixin := Eval hnf in UniqFinMixin (undup_uniq _) mem_fset_sub_enum. Canonical fset_sub_finType := Eval hnf in FinType fset_sub_type fset_sub_finMixin. Canonical fset_sub_subfinType := [subFinType of fset_sub_type]. Lemma enum_fsetE : enum_fset A = [seq val i | i <- enum fset_sub_type]. Proof. by rewrite enumT unlock val_fset_sub_enum. Qed. Lemma cardfE : size (enum_fset A) = #|fset_sub_type|. Proof. by rewrite cardE enum_fsetE size_map. Qed. End FinTypeSet. Identity Coercion finSet_sub_type : finset_of >-> finSet. Coercion fset_sub_type : finSet >-> predArgType. Hint Resolve fsvalP fset_uniq mem_fset_sub_enum. Delimit Scope fset_scope with fset. Local Open Scope fset_scope. Notation "[` kf ]" := (FSetSub kf) (format "[` kf ]") : fset_scope. Lemma fsetsubE (T : choiceType) (A : {fset T}) (x : A) (xA : val x \in A) : [` xA] = x. Proof. by apply/val_inj => /=. Qed. Notation "#|` A |" := (size (enum_fset A)) (at level 0, A at level 99, format "#|` A |") : nat_scope. Definition fset_predT {T : choiceType} {A : {fset T}} : simpl_pred A := @predT A. Coercion set_of_fset (K : choiceType) (A : {fset K}) : {set A} := [set x in {: A}]. Arguments pred_of_finset : simpl never. Section SeqFset. Variable finset_key : unit. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Definition seq_fset : forall K : choiceType, seq K -> {fset K} := locked_with finset_key (fun K s => mkFinSet (@canonical_sort_keys K s)). Variable (K : choiceType) (s : seq K). Lemma seq_fsetE : seq_fset s =i s. Proof. by move=> a; rewrite [seq_fset]unlock sort_keysE. Qed. Lemma size_seq_fset : size (seq_fset s) = size (undup s). Proof. by rewrite [seq_fset]unlock /= size_sort_keys. Qed. Lemma seq_fset_uniq : uniq (seq_fset s). Proof. by rewrite [seq_fset]unlock /= sort_keys_uniq. Qed. Lemma seq_fset_perm : perm_eq (seq_fset s) (undup s). Proof. by rewrite [seq_fset]unlock //= sort_keys_perm. Qed. End SeqFset. Hint Resolve keys_canonical. Hint Resolve sort_keys_uniq. Canonical finSetSubType K := [subType for (@enum_fset K)]. Definition finSetEqMixin (K : choiceType) := [eqMixin of {fset K} by <:]. Canonical finSetEqType (K : choiceType) := EqType {fset K} (finSetEqMixin K). Definition finSetChoiceMixin (K : choiceType) := [choiceMixin of {fset K} by <:]. Canonical finSetChoiceType (K : choiceType) := ChoiceType {fset K} (finSetChoiceMixin K). Section FinPredStruct. Structure finpredType (T : eqType) := FinPredType { finpred_sort :> Type; (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) tofinpred : finpred_sort -> pred T; (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) _ : {mem : finpred_sort -> mem_pred T | isMem tofinpred mem}; (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) _ : {finpred_seq : finpred_sort -> seq T | ((forall p, uniq (finpred_seq p)) * forall p x, x \in finpred_seq p = tofinpred p x)%type} }. Canonical finpredType_predType (T : eqType) (fpT : finpredType T) := @PredType T (finpred_sort fpT) (@tofinpred T fpT) (let: FinPredType _ _ mem _ := fpT in mem). Definition enum_finpred (T : eqType) (fpT : finpredType T) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) fpT -> seq T := let: FinPredType _ _ _ (exist s _) := fpT in s. Lemma enum_finpred_uniq (T : eqType) (fpT : finpredType T) (p : fpT) : uniq (enum_finpred p). Proof. by case: fpT p => ??? [s sE] p; rewrite sE. Qed. Lemma enum_finpredE (T : eqType) (fpT : finpredType T) (p : fpT) : enum_finpred p =i p. Proof. by case: fpT p => ??? [s sE] p x; rewrite sE -topredE. Qed. Lemma mkFinPredType_of_subproof (T : eqType) (pT : predType T) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (fpred_seq : pT -> seq T) (pred_fsetE : forall p, fpred_seq p =i p) : forall p x, x \in fpred_seq p = topred p x. Proof. by move=> p x; rewrite topredE pred_fsetE. Qed. Definition mkFinPredType_of (T : eqType) (U : Type) := (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) fun (pT : predType T) & pred_sort pT -> U => fun a mP (pT' := @PredType T U a mP) & phant_id pT' pT => (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) fun (fpred_seq : pT' -> seq T) (fpred_seq_uniq : forall p, uniq (fpred_seq p)) (fpred_seqE : forall p, fpred_seq p =i p) => @FinPredType T U a mP (exist _ fpred_seq (fpred_seq_uniq, (mkFinPredType_of_subproof fpred_seqE))). Definition clone_finpredType (T : eqType) (U : Type) := (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) fun (pT : finpredType T) & finpred_sort pT -> U => fun a mP pP (pT' := @FinPredType T U a mP pP) & phant_id pT' pT => pT'. Structure is_finite (T : eqType) (P : pred T) := IsFinite { seq_of_is_finite :> seq T; _ : uniq seq_of_is_finite; _ : forall x, x \in seq_of_is_finite = P x; }. Lemma is_finite_uniq (T : eqType) (P : pred T) (p : is_finite P) : uniq p. Proof. by case: p. Qed. Lemma is_finiteE (T : eqType) (P : pred T) (p : is_finite P) x : x \in (seq_of_is_finite p) = P x. Proof. by case: p. Qed. Structure finpred (T : eqType) (pT : predType T) := FinPred { pred_of_finpred :> pT; _ : is_finite [pred x in pred_of_finpred] }. Definition enum_fin (T : eqType) (pT : predType T) (p : finpred pT) : seq T := let: FinPred _ fp := p in fp. Lemma enum_fin_uniq (T : eqType) (pT : predType T) (p : finpred pT) : uniq (enum_fin p). Proof. by case: p => ?[]. Qed. Lemma enum_finE (T : eqType) (pT : predType T) (p : finpred pT) : enum_fin p =i (pred_of_finpred p). Proof. by case: p => ?[]. Qed. Canonical fin_finpred (T : eqType) (pT : finpredType T) (p : pT) := @FinPred _ _ p (@IsFinite _ _ (enum_finpred p) (enum_finpred_uniq p) (enum_finpredE p)). Definition finpred_of (T : eqType) (pT : predType T) (p : pT) (fp : finpred pT) & phantom pT fp : finpred pT := fp. Structure finmempred (T : eqType) := FinMemPred { pred_of_finmempred :> mem_pred T; _ : is_finite (fun x => in_mem x pred_of_finmempred) }. Definition enum_finmem (T : eqType) (p : finmempred T) : seq T := let: FinMemPred _ fp := p in fp. Lemma enum_finmem_uniq (T : eqType) (p : finmempred T) : uniq (enum_finmem p). Proof. by case: p => ?[]. Qed. Lemma enum_finmemE (T : eqType) (p : finmempred T) : enum_finmem p =i p. Proof. by case: p => ?[]. Qed. Definition finmempred_of (T : eqType) (P : pred T) (mP : finmempred T) & phantom (mem_pred T) mP : finmempred T := mP. Canonical mem_fin (T : eqType) (pT : predType T) (p : finpred pT) := @FinMemPred _ (mem p) (@IsFinite _ _ (enum_fin p) (enum_fin_uniq p) (enum_finE p)). End FinPredStruct. Notation "[ 'finpredType' 'of' T ]" := (@clone_finpredType _ T _ id _ _ _ id) (at level 0, format "[ 'finpredType' 'of' T ]") : form_scope. Notation mkFinPredType T s s_uniq sE := (@mkFinPredType_of _ T _ id _ _ id s s_uniq sE). Section CanonicalFinPred. Canonical fset_finpredType (T: choiceType) := mkFinPredType (finSet T) (@enum_fset T) (@fset_uniq T) (fun _ _ => erefl). Canonical pred_finpredType (T : finType) := mkFinPredType (pred T) (fun P => enum_mem (mem P)) (@enum_uniq T) (@mem_enum T). Canonical simpl_pred_finpredType (T : finType) := mkFinPredType (simpl_pred T) (fun P => enum_mem (mem P)) (@enum_uniq T) (@mem_enum T). Canonical fset_finpred (T: choiceType) (A : finSet T) := @FinPred _ _ (enum_fset A) (@IsFinite _ _ (enum_fset A) (fset_uniq _) (fun=> erefl)). Program Canonical subfinset_finpred (T : choiceType) (A : finmempred T) (Q : pred T) := @FinPred _ _ [pred x in A | Q x] (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (@IsFinite _ _ [seq x <- enum_finmem A | Q x] _ _). Next Obligation. by rewrite filter_uniq// enum_finmem_uniq. Qed. Next Obligation. by rewrite !inE !mem_filter andbC enum_finmemE. Qed. Canonical seq_finpredType (T : eqType) := mkFinPredType (seq T) undup (@undup_uniq T) (@mem_undup T). End CanonicalFinPred. Local Notation imfset_def key := (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (fun (T K : choiceType) (f : T -> K) (p : finmempred T) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) of phantom (mem_pred T) p => seq_fset key [seq f x | x <- enum_finmem p]). Local Notation imfset2_def key := (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (fun (K T1 : choiceType) (T2 : T1 -> choiceType) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (f : forall x : T1, T2 x -> K) (p1 : finmempred T1) (p2 : forall x : T1, finmempred (T2 x)) of phantom (mem_pred T1) p1 & phantom (forall x, mem_pred (T2 x)) p2 => seq_fset key (allsigs f (enum_finmem p1) (fun x => enum_finmem (p2 x)))). Module Type ImfsetSig. Parameter imfset : forall (key : unit) (T K : choiceType) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (f : T -> K) (p : finmempred T), (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) phantom (mem_pred T) p -> {fset K}. Parameter imfset2 : forall (key : unit) (K T1 : choiceType) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (T2 : T1 -> choiceType)(f : forall x : T1, T2 x -> K) (p1 : finmempred T1) (p2 : forall x : T1, finmempred (T2 x)), (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) phantom (mem_pred T1) p1 -> phantom (forall x, mem_pred (T2 x)) p2 -> {fset K}. Axiom imfsetE : forall key, imfset key = imfset_def key. Axiom imfset2E : forall key, imfset2 key = imfset2_def key. End ImfsetSig. Module Imfset : ImfsetSig. Definition imfset key := imfset_def key. Definition imfset2 key := imfset2_def key. Lemma imfsetE key : imfset key = imfset_def key. Proof. by []. Qed. Lemma imfset2E key : imfset2 key = imfset2_def key. Proof. by []. Qed. End Imfset. Notation imfset key f p := (Imfset.imfset key f (Phantom _ (pred_of_finmempred p))). Notation imfset2 key f p q := (Imfset.imfset2 key f (Phantom _ (pred_of_finmempred p)) (Phantom _ (fun x => (pred_of_finmempred (q x))))). Canonical imfset_unlock k := Unlockable (Imfset.imfsetE k). Canonical imfset2_unlock k := Unlockable (Imfset.imfset2E k). Notation "A `=` B" := (A = B :> {fset _}) (at level 70, no associativity, only parsing) : fset_scope. Notation "A `<>` B" := (A <> B :> {fset _}) (at level 70, no associativity, only parsing) : fset_scope. Notation "A `==` B" := (A == B :> {fset _}) (at level 70, no associativity, only parsing) : fset_scope. Notation "A `!=` B" := (A != B :> {fset _}) (at level 70, no associativity, only parsing) : fset_scope. Notation "A `=P` B" := (A =P B :> {fset _}) (at level 70, no associativity, only parsing) : fset_scope. Notation "f @`[ key ] A" := (Imfset.imfset key f (Phantom _ (mem A))) (at level 24, key at level 0) : fset_scope. Notation "f @2`[ key ] ( A , B )" := (Imfset.imfset2 key f (Phantom _ (mem A)) (Phantom _ (fun x => (mem (B x))))) (at level 24, format "f @2`[ key ] ( A , B )") : fset_scope. Fact imfset_key : unit. Proof. exact: tt. Qed. Notation "f @` A" := (f @`[imfset_key] A) (at level 24) : fset_scope. Notation "f @2` ( A , B )" := (f @2`[imfset_key] (A, B)) (at level 24, format "f @2` ( A , B )") : fset_scope. (* unary *) Notation "[ 'fset' E | x : T 'in' A ]" := ((fun x : T => E) @` A) (at level 0, E, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' E | x 'in' A ]" := [fset E | x : _ in A] (at level 0, E, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' E | x : A ]" := [fset E | x : _ in {: A} ] (at level 0, E, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' x : T 'in' A ]" := [fset (x : T) | x in A] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' x : T 'in' A | P ]" := [fset (x : T) | x in [pred x in A | P]] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' x 'in' A | P ]" := [fset x : _ in A | P] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' x 'in' A ]" := [fset x : _ in A ] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' x : T | P ]" := [fset x in {: T} | P] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' x : T | P & Q ]" := [fset x : T | P && Q] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' x : T 'in' A | P & Q ]" := [fset x : T in A | P && Q] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' x 'in' A | P & Q ]" := [fset x in A | P && Q] (at level 0, x at level 99, only parsing) : fset_scope. (* binary *) Notation "[ 'fset' E | x : T 'in' A , y : T' 'in' B ]" := ((fun (x : T) (y : T') => E) @2` (A, fun x => B)) (at level 0, E, x at level 99, A at level 200, y at level 99, only parsing) : fset_scope. Notation "[ 'fset' E | x 'in' A , y 'in' B ]" := [fset E | x : _ in A, y : _ in B] (at level 0, E, x at level 99, A at level 200, y at level 99, only parsing) : fset_scope. (* keyed parse only *) Notation "[ 'fset[' key ] E | x : T 'in' A ]" := ((fun x : T => E) @`[key] A) (at level 0, E, x at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] E | x 'in' A ]" := [fset[key] E | x : _ in A] (at level 0, E, x at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] E | x : A ]" := [fset[key] E | x : _ in {: A} ] (at level 0, E, x at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] x : T 'in' A ]" := [fset[key] (x : T) | x in A] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] x : T 'in' A | P ]" := [fset[key] (x : T) | x in [pred x in A | P]] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] x 'in' A | P ]" := [fset[key] x : _ in A | P] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] x 'in' A ]" := [fset[key] x : _ in A ] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] x : T | P ]" := [fset[key] x in {: T} | P] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] x : T | P & Q ]" := [fset[key] x : T | P && Q] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] x : T 'in' A | P & Q ]" := [fset[key] x : T in A | P && Q] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] x 'in' A | P & Q ]" := [fset[key] x in A | P && Q] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] E | x : T 'in' A , y : T' 'in' B ]" := ((fun (x : T) (y : T') => E) @2` (A, fun x => B)) (at level 0, E, x at level 99, A at level 200, y at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] E | x 'in' A , y 'in' B ]" := [fset[key] E | x : _ in A, y : _ in B] (at level 0, E, x at level 99, A at level 200, y at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] E | x : A , y : B ]" := [fset[key] E | x : _ in {: A}, y : _ in {: B}] (at level 0, E, x at level 99, A at level 200, y at level 99, only parsing) : fset_scope. (* printing only *) Notation "[ 'f' 'set' E | x 'in' A ]" := [fset[_] E | x in A] (at level 0, E, x at level 99, format "[ '[hv' 'f' 'set' E '/ ' | x 'in' A ] ']'") : fset_scope. Notation "[ 'f' 'set' E | x : A ]" := [fset[_] E | x : A] (at level 0, E, x at level 99, format "[ '[hv' 'f' 'set' E '/ ' | x : A ] ']'") : fset_scope. Notation "[ 'f' 'set' x 'in' A | P ]" := [fset[_] x in A | P] (at level 0, x at level 99, format "[ 'f' 'set' x 'in' A | P ]") : fset_scope. Notation "[ 'f' 'set' x 'in' A ]" := [fset[_] x in A] (at level 0, x at level 99, format "[ 'f' 'set' x 'in' A ]") : fset_scope. Notation "[ 'f' 'set' x : T | P ]" := [fset[_] x : T | P] (at level 0, x at level 99, format "[ 'f' 'set' x : T | P ]") : fset_scope. Notation "[ 'f' 'set' x : T | P & Q ]" := [fset[_] x : T | P & Q] (at level 0, x at level 99, format "[ 'f' 'set' x : T | P & Q ]") : fset_scope. Notation "[ 'f' 'set' x 'in' A | P & Q ]" := [fset[_] x in A | P & Q] (at level 0, x at level 99, format "[ 'f' 'set' x 'in' A | P & Q ]") : fset_scope. (* binary printing only*) Notation "[ 'f' 'set' E | x 'in' A , y 'in' B ]" := [fset[_] E | x in A, y in B] (at level 0, E, x at level 99, A at level 200, y at level 99, format "[ '[hv' 'f' 'set' E '/ ' | x 'in' A , '/' y 'in' B ] ']'" ) : fset_scope. Section Ops. Context {K K': choiceType}. Implicit Types (a b c : K) (A B C D : {fset K}) (E : {fset K'}) (s : seq K). Definition fset0 : {fset K} := @mkFinSet K [::] (introT eqP (@sort_keys_nil K)). (* very transparent, to ensure x \in fset0 is convertible to false *) Fact fset1_key : unit. Proof. exact: tt. Qed. Definition fset1 a : {fset K} := [fset[fset1_key] x in [:: a]]. Fact fsetU_key : unit. Proof. exact: tt. Qed. Definition fsetU A B := [fset[fsetU_key] x in enum_fset A ++ enum_fset B]. Fact fsetI_key : unit. Proof. exact: tt. Qed. Definition fsetI A B := [fset[fsetI_key] x in A | x \in B]. Fact fsetD_key : unit. Proof. exact: tt. Qed. Definition fsetD A B := [fset[fsetD_key] x in A | x \notin B]. Fact fsetM_key : unit. Proof. exact: tt. Qed. Definition fsetM A E := [fset[fsetM_key] (x, y) | x : K in A, y : K' in E]. Definition fsubset A B := fsetI A B == A. Definition fproper A B := fsubset A B && ~~ fsubset B A. Definition fdisjoint A B := (fsetI A B == fset0). End Ops. Notation "[ 'fset' a ]" := (fset1 a) (at level 0, a at level 99, format "[ 'fset' a ]") : fset_scope. Notation "[ 'fset' a : T ]" := [fset (a : T)] (at level 0, a at level 99, format "[ 'fset' a : T ]") : fset_scope. Notation "A `|` B" := (fsetU A B) : fset_scope. Notation "a |` A" := ([fset a] `|` A) : fset_scope. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* This is left-associative due to historical limitations of the .. Notation. *) Notation "[ 'fset' a1 ; a2 ; .. ; an ]" := (fsetU .. (a1 |` [fset a2]) .. [fset an]) (at level 0, a1 at level 99, format "[ 'fset' a1 ; a2 ; .. ; an ]") : fset_scope. Notation "A `&` B" := (fsetI A B) : fset_scope. Notation "A `*` B" := (fsetM A B) : fset_scope. Notation "A `\` B" := (fsetD A B) : fset_scope. Notation "A `\ a" := (A `\` [fset a]) : fset_scope. Notation "A `<=` B" := (fsubset A B) (at level 70, no associativity) : fset_scope. Notation "A `<` B" := (fproper A B) (at level 70, no associativity) : fset_scope. Notation "[ 'disjoint' A & B ]" := (fdisjoint A B) : fset_scope. (* Comprehensions *) Notation "[ 'fset' E | x 'in' A & P ]" := [fset E | x in [pred x in A | P]] (at level 0, E, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' E | x : A & P ]" := [fset E | x in {: A} & P] (at level 0, E, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' E | x : A , y 'in' B ]" := [fset E | x in {: A}, y in B] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fset' E | x 'in' A , y : B ]" := [fset E | x in A, y in {: B}] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fset' E | x : A , y : B ]" := [fset E | x in {: A}, y in {: B}] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fset' E | x 'in' A , y 'in' B & P ]" := [fset E | x in A, y in [pred y in B | P]] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fset' E | x : A , y 'in' B & P ]" := [fset E | x in {: A}, y in B & P] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fset' E | x 'in' A , y : B & P ]" := [fset E | x in A, y in {: B} & P] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fset' E | x : A , y : B & P ]" := [fset E | x in {: A}, y in {: B} & P] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fsetval' x 'in' A ]" := [fset val x | x in A] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fsetval' x 'in' A | P ]" := [fset val x | x in A & P] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fsetval' x 'in' A | P & Q ]" := [fsetval x in A | (P && Q)] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fsetval' x : A ]" := [fset val x | x in {: A}] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fsetval' x : A | P ]" := [fset val x | x in {: A} & P] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fsetval' x : A | P & Q ]" := [fsetval x in {: A} | (P && Q)] (at level 0, x at level 99, only parsing) : fset_scope. (* keyed parse only *) Notation "[ 'fset[' key ] E | x 'in' A & P ]" := [fset[key] E | x in [pred x in A | P]] (at level 0, E, x at level 99, only parsing). Notation "[ 'fset[' key ] E | x : A & P ]" := [fset[key] E | x in {: A} & P] (at level 0, E, x at level 99, only parsing). Notation "[ 'fset[' key ] E | x : A , y 'in' B ]" := [fset[key] E | x in {: A}, y in B] (at level 0, E, x, y at level 99, only parsing). Notation "[ 'fset[' key ] E | x 'in' A , y : B ]" := [fset[key] E | x in A, y in {: B}] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] E | x : A , y : B ]" := [fset[key] E | x in {: A}, y in {: B}] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] E | x 'in' A , y 'in' B & P ]" := [fset[key] E | x in A, y in [pred y in B | P]] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] E | x : A , y 'in' B & P ]" := [fset[key] E | x in {: A}, y in B & P] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] E | x 'in' A , y : B & P ]" := [fset[key] E | x in A, y in {: B} & P] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] E | x : A , y : B & P ]" := [fset[key] E | x in {: A}, y in {: B} & P] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fsetval[' key ] x 'in' A ]" := [fset[key] val x | x in A] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fsetval[' key ] x 'in' A | P ]" := [fset[key] val x | x in A & P] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fsetval[' key ] x 'in' A | P & Q ]" := [fsetval[key] x in A | (P && Q)] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fsetval[' key ] x : A ]" := [fset[key] val x | x in {: A}] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fsetval[' key ] x : A | P ]" := [fset[key] val x | x in {: A} & P] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fsetval[' key ] x : A | P & Q ]" := [fsetval[key] x in {: A} | (P && Q)] (at level 0, x at level 99, only parsing) : fset_scope. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Print-only variants to work around the Coq pretty-printer K-term kink. *) Notation "[ 'f' 'set' E | x 'in' A & P ]" := [fset[_] E | x in A & P] (at level 0, E, x at level 99, format "[ '[hv' 'f' 'set' E '/ ' | x 'in' A '/ ' & P ] ']'" ) : fset_scope. Notation "[ 'f' 'set' E | x : A & P ]" := [fset[_] E | x : A & P] (at level 0, E, x at level 99, format "[ '[hv' 'f' 'set' E '/ ' | x : A '/ ' & P ] ']'") : fset_scope. Notation "[ 'f' 'set' E | x : A , y 'in' B ]" := [fset[_] E | x : A, y in B] (at level 0, E, x, y at level 99, format "[ '[hv' 'f' 'set' E '/ ' | x : A , '/ ' y 'in' B ] ']'" ) : fset_scope. Notation "[ 'f' 'set' E | x 'in' A , y : B ]" := [fset[_] E | x in A, y : B] (at level 0, E, x, y at level 99, format "[ '[hv' 'f' 'set' E '/ ' | x 'in' A , '/ ' y : B ] ']'" ) : fset_scope. Notation "[ 'f' 'set' E | x : A , y : B ]" := [fset[_] E | x : A, y : B] (at level 0, E, x, y at level 99, format "[ '[hv' 'f' 'set' E '/ ' | x : A , '/ ' y : B ] ']'" ) : fset_scope. Notation "[ 'f' 'set' E | x 'in' A , y 'in' B & P ]" := [fset[_] E | x in A, y in B & P] (at level 0, E, x, y at level 99, format "[ '[hv' 'f' 'set' E '/ ' | x 'in' A , '/ ' y 'in' B '/ ' & P ] ']'" ) : fset_scope. Notation "[ 'f' 'set' E | x : A , y 'in' B & P ]" := [fset[_] E | x : A, y in B & P] (at level 0, E, x, y at level 99, format "[ '[hv' 'f' 'set' E '/ ' | x : A , '/ ' y 'in' B & P ] ']'" ) : fset_scope. Notation "[ 'f' 'set' E | x 'in' A , y : B & P ]" := [fset[_] E | x in A, y : B & P] (at level 0, E, x, y at level 99, format "[ '[hv' 'f' 'set' E '/ ' | x 'in' A , '/ ' y : B & P ] ']'" ) : fset_scope. Notation "[ 'f' 'set' E | x : A , y : B & P ]" := [fset[_] E | x : A, y : B & P] (at level 0, E, x, y at level 99, format "[ '[hv' 'f' 'set' E '/ ' | x : A , '/ ' y : B & P ] ']'" ) : fset_scope. Notation "[ 'f' 'setval' x 'in' A ]" := [fset[_] val x | x in A] (at level 0, x at level 99, format "[ 'f' 'setval' x 'in' A ]") : fset_scope. Notation "[ 'f' 'setval' x 'in' A | P ]" := [fset[_] val x | x in A & P] (at level 0, x at level 99, format "[ 'f' 'setval' x 'in' A | P ]") : fset_scope. Notation "[ 'f' 'setval' x 'in' A | P & Q ]" := [fsetval[_] x in A | (P && Q)] (at level 0, x at level 99, format "[ 'f' 'setval' x 'in' A | P & Q ]") : fset_scope. Notation "[ 'f' 'setval' x : A ]" := [fsetval[_] x : A] (at level 0, x at level 99, format "[ 'f' 'setval' x : A ]") : fset_scope. Notation "[ 'f' 'setval' x : A | P ]" := [fsetval[_] x : A | P] (at level 0, x at level 99, format "[ 'f' 'setval' x : A | P ]") : fset_scope. Notation "[ 'f' 'setval' x : A | P & Q ]" := [fsetval[_] x : A | (P && Q)] (at level 0, x at level 99, format "[ 'f' 'setval' x : A | P & Q ]") : fset_scope. Section imfset. Variables (key : unit) (K : choiceType). Implicit Types (A B : {fset K}). (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma imfsetP (T : choiceType) (f : T -> K) (p : finmempred T) (k : K) : reflect (exists2 x : T, in_mem x p & k = f x) (k \in imfset key f p). Proof. rewrite unlock seq_fsetE /=; apply: (iffP mapP) => [] [x xp eqkf]; by exists x => //=; move: xp; rewrite enum_finmemE. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma in_imfset (T : choiceType) (f : T -> K) (p : finmempred T) (x : T) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) in_mem x p -> f x \in imfset key f p. Proof. by move=> px; apply/imfsetP; exists x. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma imfset_rec (T : choiceType) (f : T -> K) (p : finmempred T) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (P : imfset key f p -> Prop) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (forall (x : T) (px : in_mem x p), P [` in_imfset f px ]) -> forall k, P k. Proof. (* Goal: forall (_ : forall (x : Choice.sort T) (px : is_true (@in_mem (Choice.sort T) x (@pred_of_finmempred (Choice.eqType T) p))), P (@FSetSub K (@Imfset.imfset key T K f p (Phantom (mem_pred (Equality.sort (Choice.eqType T))) (@pred_of_finmempred (Choice.eqType T) p))) (f x) (@in_imfset T f p x px))) (k : @fset_sub_type K (@Imfset.imfset key T K f p (Phantom (mem_pred (Equality.sort (Choice.eqType T))) (@pred_of_finmempred (Choice.eqType T) p)))), P k *) move=> PP v; have /imfsetP [k pk vv_eq] := valP v. (* Goal: P v *) pose vP := in_imfset f pk; suff -> : P v = P [` vP] by apply: PP. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by congr P; apply/val_inj => /=; rewrite vv_eq. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma mem_imfset (T : choiceType) (f : T -> K) (p : finmempred T) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) injective f -> forall (x : T), (f x \in imfset key f p) = (in_mem x p). Proof. by move=> f_inj x; rewrite unlock seq_fsetE mem_map// enum_finmemE. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma imfset2P (T1 : choiceType) (T2 : T1 -> choiceType) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (f : forall x, T2 x -> K) (p1 : finmempred T1) (p2 : forall x, finmempred (T2 x)) k : reflect (exists2 x : T1, in_mem x p1 & exists2 y : T2 x, in_mem y (p2 x) & k = f x y) (k \in imfset2 key f p1 p2). Proof. (* Goal: is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) a)) (@mem (Choice.sort K) (finSetPredType K) (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f))) *) (* Goal: @ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x1) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Choice.sort K) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K S a)) (@mem (Choice.sort K) (finSetPredType K) S)))) *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite unlock !seq_fsetE; apply: (iffP (allsigsP _ _ _ _)). (* Goal: forall (_ : @eq (@finset_of K (Phant (Choice.sort K))) (@domf K V f) (@domf K V g)) (_ : forall (k : Choice.sort K) (kMf : is_true (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f))) (kMg : is_true (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) g))), @eq V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V f)) V (@ffun_of_fmap K V f) (@FSetSub K (@domf K V f) k kMf)) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V g)) V (@ffun_of_fmap K V g) (@FSetSub K (@domf K V g) k kMg))), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f g *) move=> [[/=x y]]; rewrite !enum_finmemE => -[xp yp ->]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by exists x => //; exists y. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> [x xp [y yp ->]]; exists (Tagged T2 y); rewrite ?enum_finmemE. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma in_imfset2 (T1 : choiceType) (T2 : T1 -> choiceType) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (f : forall x, T2 x -> K) (p1 : finmempred T1) (p2 : forall x, finmempred (T2 x)) (x : T1) (y : T2 x) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) in_mem x p1 -> in_mem y (p2 x) -> f x y \in imfset2 key f p1 p2. Proof. by move=> xD1 yD2; apply/imfset2P; exists x => //; exists y. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma mem_imfset2 (T1 : choiceType) (T2 : T1 -> choiceType) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (f : forall x, T2 x -> K) (p1 : finmempred T1) (p2 : forall x, finmempred (T2 x)) (x : T1) (y : T2 x) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) injective (fun x : sigT T2 => f (tag x) (tagged x)) -> f x y \in imfset2 key f p1 p2 = (in_mem x p1) && (in_mem y (p2 x)). Proof. (* Goal: forall (_ : is_true (@fdisjoint K (@domf K V f) (@domf K V h))) (_ : is_true (@fdisjoint K (@domf K V g) (@domf K V h))) (_ : @eq (finMap K V) (catf h f) (catf h g)), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f g *) move=> f_inj; rewrite unlock seq_fsetE. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) apply/allsigsP/idP => [[t]|]; last first. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> /andP[xp1 xp2]; exists (Tagged T2 y); rewrite ?enum_finmemE. rewrite !enum_finmemE => -[pt1 pt2]; pose xy := Tagged T2 y. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite -[x]/(tag xy) -[y]/(tagged xy) => /f_inj ->; apply/andP. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma enum_imfset (T : choiceType) (f : T -> K) (p : finmempred T) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) {in p &, injective f} -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) perm_eq (imfset key f p) [seq f x | x <- enum_finmem p]. Proof. (* Goal: forall (_ : is_true (@fdisjoint K (@domf K V f) (@domf K V h))) (_ : is_true (@fdisjoint K (@domf K V g) (@domf K V h))) (_ : @eq (finMap K V) (catf h f) (catf h g)), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f g *) move=> f_inj; rewrite unlock -[X in perm_eq _ X]undup_id ?seq_fset_perm//. (* Goal: @big_rel_class_of (@finset_of K (Phant (Choice.sort K))) (@fsubset K) *) rewrite map_inj_in_uniq ?enum_finmem_uniq // => ??. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite ?enum_finmemE; apply: f_inj. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma enum_imfset2 (T1 : choiceType) (T2 : T1 -> choiceType) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (f : forall x, T2 x -> K) (p1 : finmempred T1) (p2 : forall x, finmempred (T2 x)) : {in [pred t | p1 (tag t) & p2 _ (tagged t)] &, (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) injective (fun t : sigT T2 => f (tag t) (tagged t))} -> perm_eq (imfset2 key f p1 p2) (allsigs f (enum_finmem p1) (fun x => enum_finmem (p2 x))). Proof. (* Goal: forall (_ : is_true (@fdisjoint K (@domf K V f) (@domf K V h))) (_ : is_true (@fdisjoint K (@domf K V g) (@domf K V h))) (_ : @eq (finMap K V) (catf h f) (catf h g)), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f g *) move=> f_inj; rewrite unlock. (* Goal: is_true (@fsubset K (@FinSupp.fs K V (fun a : Choice.sort K => default a) (@fsfun_of_ffun key K V S (fun a : @fset_sub_type K S => h a) (fun a : Choice.sort K => default a))) S) *) apply: uniq_perm_eq => [||i]; rewrite ?seq_fset_uniq ?seq_fsetE //. (* Goal: @eq (Equality.sort V) (@fun_of_fsfun K V default (of_ffun key) x) (@Option.default (Equality.sort V) (default x) (@Option.map (@fset_sub_type K S) (Equality.sort V) h (@insub (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) x))) *) rewrite allsigs_uniq ?enum_finmem_uniq//. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> x; rewrite enum_finmem_uniq. (* Goal: forall (_ : @eq (@finset_of K (Phant (Choice.sort K))) (@domf K V f) (@domf K V g)) (_ : forall (k : Choice.sort K) (kMf : is_true (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f))) (kMg : is_true (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) g))), @eq V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V f)) V (@ffun_of_fmap K V f) (@FSetSub K (@domf K V f) k kMf)) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V g)) V (@ffun_of_fmap K V g) (@FSetSub K (@domf K V g) k kMg))), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f g *) move=> t0 t0' /allsigsP[t]; rewrite !enum_finmemE => -[tp1 tp2 ->]. (* Goal: forall (_ : @eq (@finset_of K (Phant (Choice.sort K))) (@domf K V f) (@domf K V g)) (_ : forall (k : Choice.sort K) (kMf : is_true (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f))) (kMg : is_true (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) g))), @eq V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V f)) V (@ffun_of_fmap K V f) (@FSetSub K (@domf K V f) k kMf)) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V g)) V (@ffun_of_fmap K V g) (@FSetSub K (@domf K V g) k kMg))), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f g *) move=> /allsigsP[t']; rewrite !enum_finmemE => -[t'p1 t'p2 ->]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply: f_inj; rewrite inE; apply/andP. Qed. End imfset. Section in_imfset. Variable (key : unit) (K : choiceType). Implicit Types (A B : {fset K}) (a b : K). Lemma in_fset (p : finmempred K) (k : K) : (k \in imfset key id p) = in_mem k p. Proof. by rewrite mem_imfset; apply: inj_id. Qed. Lemma val_in_fset A (p : finmempred _) (k : A) : (val k \in imfset key val p) = (in_mem k p). Proof. by rewrite mem_imfset ?in_finmempred //; exact: val_inj. Qed. Lemma in_fset_val A (p : finmempred [eqType of A]) (k : K) : (k \in imfset key val p) = if insub k is Some a then in_mem a p else false. Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) have [a _ <- /=|kNA] := insubP; first by rewrite val_in_fset. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply/imfsetP => [] [a _ k_def]; move: kNA; rewrite k_def [_ \in _]valP. Qed. Lemma in_fset_valT A (p : finmempred _) (k : K) (kA : k \in A) : (k \in imfset key val p) = in_mem [` kA] p. Proof. by rewrite in_fset_val insubT /=. Qed. Lemma in_fset_valP A (p : finmempred _) (k : K) : reflect {kA : k \in A & in_mem [` kA] p} (k \in imfset key val p). Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) apply: (iffP (imfsetP _ _ _ _)) => [|[kA xkA]]; last by exists [`kA]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> /sig2_eqW[/= x Xx ->]; exists (valP x); rewrite fsetsubE. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma in_fset_valF A (p : finmempred [eqType of A]) (k : K) : k \notin A -> (k \in imfset key val p) = false. Proof. by apply: contraNF => /imfsetP[/= a Xa->]. Qed. Lemma in_fset_nil a : a \in [fset[key] x in [::]] = false. Proof. by rewrite !mem_imfset. Qed. Lemma in_fset_cons x (xs : seq K) a : (a \in [fset[key] x in x :: xs]) = ((a == x) || (a \in [fset[key] x in xs])). Proof. by rewrite !mem_imfset. Qed. Lemma in_fset_cat (xs ys : seq K) a : (a \in [fset[key] x in xs ++ ys]) = ((a \in [fset[key] x in xs]) || (a \in [fset[key] x in ys])). Proof. by rewrite !mem_imfset//= mem_cat. Qed. Definition in_fset_ (key : unit) := (in_fset_cons, in_fset_nil, in_fset_cat, in_fset). (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma card_in_imfset (T T' : choiceType) (f : T -> T') (p : finmempred T) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) {in p &, injective f} -> #|` (imfset key f p)| = (size (enum_finmem p)). Proof. (* Goal: forall (_ : is_true (@fdisjoint K (@domf K V f) (@domf K V h))) (_ : is_true (@fdisjoint K (@domf K V g) (@domf K V h))) (_ : @eq (finMap K V) (catf h f) (catf h g)), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f g *) move=> f_inj; rewrite unlock /= size_seq_fset undup_id ?size_map//. (* Goal: @big_rel_class_of (@finset_of K (Phant (Choice.sort K))) (@fsubset K) *) rewrite map_inj_in_uniq ?enum_finmem_uniq// => ??. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite !enum_finmemE; apply: f_inj. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma card_imfset (T T' : choiceType) (f : T -> T') (p : finmempred _) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) injective f -> #|` (imfset key f p)| = size (enum_finmem p). Proof. by move=> f_inj; rewrite card_in_imfset //= => x y ? ?; apply: f_inj. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma leq_imfset_card (T T' : choiceType) (f : T -> T') (p : finmempred _) : (#|` imfset key f p| <= size (enum_finmem p))%N. Proof. by rewrite unlock size_seq_fset (leq_trans (size_undup _)) ?size_map. Qed. End in_imfset. Section Theory. Variables (key : unit) (K K': choiceType). Implicit Types (a b x : K) (A B C D : {fset K}) (E : {fset K'}) (pA pB pC : pred K) (s : seq K). Lemma fsetP {A B} : A =i B <-> A = B. Proof. by split=> [eqAB|-> //]; apply/val_inj/canonical_eq_keys => //= a. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) CoInductive in_fset_spec (A : {fset K}) (x : K) : K -> bool -> Prop := | InFset (u : A) & x = val u : in_fset_spec A x (val u) true | OutFset of x \notin A : in_fset_spec A x x false. Lemma in_fsetP A x : in_fset_spec A x x (x \in A). Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) have [xA|xNA] := boolP (x \in A); last by constructor. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by have {2}-> : x = val [` xA] by []; constructor. Qed. Lemma fset_eqP {A B} : reflect (A =i B) (A == B). Proof. exact: (equivP eqP (iff_sym fsetP)). Qed. Lemma in_fset0 x : x \in fset0 = false. Proof. by []. Qed. Lemma in_fset1 a' a : a \in [fset a'] = (a == a'). Proof. by rewrite !in_fset_ orbF. Qed. Lemma in_fsetU A B a : (a \in A `|` B) = (a \in A) || (a \in B). Proof. by rewrite !in_fset_. Qed. Lemma in_fset1U a' A a : (a \in a' |` A) = (a == a') || (a \in A). Proof. by rewrite in_fsetU in_fset1. Qed. Lemma in_fsetI A B a : (a \in A `&` B) = (a \in A) && (a \in B). Proof. by rewrite in_fset. Qed. Lemma in_fsetD A B a : (a \in A `\` B) = (a \notin B) && (a \in A). Proof. by rewrite in_fset andbC. Qed. Lemma in_fsetD1 A b a : (a \in A `\ b) = (a != b) && (a \in A). Proof. by rewrite in_fsetD in_fset1. Qed. Lemma in_fsetM A E (u : K * K') : (u \in A `*` E) = (u.1 \in A) && (u.2 \in E). Proof. by case: u => /= x y; rewrite mem_imfset2//= => -[??] [??] [-> ->]. Qed. Definition in_fsetE := (@in_fset_ imfset_key, val_in_fset, in_fset0, in_fset1, in_fsetU, in_fsetI, in_fsetD, in_fsetM, in_fset1U, in_fsetD1). Let inE := (inE, in_fsetE). Lemma fsetIC (A B : {fset K}) : A `&` B = B `&` A. Proof. by apply/fsetP => a; rewrite !inE andbC. Qed. Lemma fsetUC (A B : {fset K}) : A `|` B = B `|` A. Proof. by apply/fsetP => a; rewrite !inE orbC. Qed. Lemma fset0I A : fset0 `&` A = fset0. Proof. by apply/fsetP => x; rewrite !inE andFb. Qed. Lemma fsetI0 A : A `&` fset0 = fset0. Proof. by rewrite fsetIC fset0I. Qed. Lemma fsetIA A B C : A `&` (B `&` C) = A `&` B `&` C. Proof. by apply/fsetP=> x; rewrite !inE andbA. Qed. Lemma fsetICA A B C : A `&` (B `&` C) = B `&` (A `&` C). Proof. by rewrite !fsetIA (fsetIC A). Qed. Lemma fsetIAC A B C : A `&` B `&` C = A `&` C `&` B. Proof. by rewrite -!fsetIA (fsetIC B). Qed. Lemma fsetIACA A B C D : (A `&` B) `&` (C `&` D) = (A `&` C) `&` (B `&` D). Proof. by rewrite -!fsetIA (fsetICA B). Qed. Lemma fsetIid A : A `&` A = A. Proof. by apply/fsetP=> x; rewrite inE andbb. Qed. Lemma fsetIIl A B C : A `&` B `&` C = (A `&` C) `&` (B `&` C). Proof. by rewrite fsetIA !(fsetIAC _ C) -(fsetIA _ C) fsetIid. Qed. Lemma fsetIIr A B C : A `&` (B `&` C) = (A `&` B) `&` (A `&` C). Proof. by rewrite !(fsetIC A) fsetIIl. Qed. Lemma fsetUA A B C : A `|` (B `|` C) = A `|` B `|` C. Proof. by apply/fsetP => x; rewrite !inE orbA. Qed. Lemma fsetUCA A B C : A `|` (B `|` C) = B `|` (A `|` C). Proof. by rewrite !fsetUA (fsetUC B). Qed. Lemma fsetUAC A B C : A `|` B `|` C = A `|` C `|` B. Proof. by rewrite -!fsetUA (fsetUC B). Qed. Lemma fsetUACA A B C D : (A `|` B) `|` (C `|` D) = (A `|` C) `|` (B `|` D). Proof. by rewrite -!fsetUA (fsetUCA B). Qed. Lemma fsetUid A : A `|` A = A. Proof. by apply/fsetP=> x; rewrite inE orbb. Qed. Lemma fsetUUl A B C : A `|` B `|` C = (A `|` C) `|` (B `|` C). Proof. by rewrite fsetUA !(fsetUAC _ C) -(fsetUA _ C) fsetUid. Qed. Lemma fsetUUr A B C : A `|` (B `|` C) = (A `|` B) `|` (A `|` C). Proof. by rewrite !(fsetUC A) fsetUUl. Qed. (* distribute /cancel *) Lemma fsetIUr A B C : A `&` (B `|` C) = (A `&` B) `|` (A `&` C). Proof. by apply/fsetP=> x; rewrite !inE andb_orr. Qed. Lemma fsetIUl A B C : (A `|` B) `&` C = (A `&` C) `|` (B `&` C). Proof. by apply/fsetP=> x; rewrite !inE andb_orl. Qed. Lemma fsetUIr A B C : A `|` (B `&` C) = (A `|` B) `&` (A `|` C). Proof. by apply/fsetP=> x; rewrite !inE orb_andr. Qed. Lemma fsetUIl A B C : (A `&` B) `|` C = (A `|` C) `&` (B `|` C). Proof. by apply/fsetP=> x; rewrite !inE orb_andl. Qed. Lemma fsetUKC A B : (A `|` B) `&` A = A. Proof. by apply/fsetP=> x; rewrite !inE orbK. Qed. Lemma fsetUK A B : (B `|` A) `&` A = A. Proof. by rewrite fsetUC fsetUKC. Qed. Lemma fsetKUC A B : A `&` (B `|` A) = A. Proof. by rewrite fsetIC fsetUK. Qed. Lemma fsetKU A B : A `&` (A `|` B) = A. Proof. by rewrite fsetIC fsetUKC. Qed. Lemma fsetIKC A B : (A `&` B) `|` A = A. Proof. by apply/fsetP=> x; rewrite !inE andbK. Qed. Lemma fsetIK A B : (B `&` A) `|` A = A. Proof. by rewrite fsetIC fsetIKC. Qed. Lemma fsetKIC A B : A `|` (B `&` A) = A. Proof. by rewrite fsetUC fsetIK. Qed. Lemma fsetKI A B : A `|` (A `&` B) = A. Proof. by rewrite fsetIC fsetKIC. Qed. Lemma fsetUKid A B : B `|` A `|` A = B `|` A. Proof. by rewrite -fsetUA fsetUid. Qed. Lemma fsetUKidC A B : A `|` B `|` A = A `|` B. Proof. by rewrite fsetUAC fsetUid. Qed. Lemma fsetKUid A B : A `|` (A `|` B) = A `|` B. Proof. by rewrite fsetUA fsetUid. Qed. Lemma fsetKUidC A B : A `|` (B `|` A) = B `|` A. Proof. by rewrite fsetUCA fsetUid. Qed. Lemma fsetIKid A B : B `&` A `&` A = B `&` A. Proof. by rewrite -fsetIA fsetIid. Qed. Lemma fsetIKidC A B : A `&` B `&` A = A `&` B. Proof. by rewrite fsetIAC fsetIid. Qed. Lemma fsetKIid A B : A `&` (A `&` B) = A `&` B. Proof. by rewrite fsetIA fsetIid. Qed. Lemma fsetKIidC A B : A `&` (B `&` A) = B `&` A. Proof. by rewrite fsetICA fsetIid. Qed. (* subset *) Lemma fsubsetP {A B} : reflect {subset A <= B} (A `<=` B). Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) apply: (iffP fset_eqP) => AsubB a; first by rewrite -AsubB inE => /andP[]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite inE; have [/AsubB|] := boolP (a \in A). Qed. Lemma fset_sub_val A (p : finmempred [eqType of A]) : (imfset key val p) `<=` A. Proof. by apply/fsubsetP => k /in_fset_valP []. Qed. Lemma fset_sub A (P : pred K) : [fset x in A | P x] `<=` A. Proof. by apply/fsubsetP => k; rewrite in_fset inE /= => /andP []. Qed. Lemma fsetD_eq0 (A B : {fset K}) : (A `\` B == fset0) = (A `<=` B). Proof. (* Goal: Bool.reflect (@ex (Choice.sort K) (fun x : Choice.sort K => @eq (option (Choice.sort V)) (@fnd K (Choice.sort V) (@domf K (Choice.sort V) f) (@ffun_of_fmap K (Choice.sort V) f) x) (@Some (Choice.sort V) v))) (@in_mem (Choice.sort V) v (@mem (Choice.sort V) (finSetPredType V) (codomf f))) *) apply/fset_eqP/fsubsetP => sAB a. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> aA; have := sAB a; rewrite !inE aA andbT => /negPn. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite !inE andbC; apply/negP => /andP [/sAB ->]. Qed. Lemma fsubset_refl A : A `<=` A. Proof. exact/fsubsetP. Qed. Hint Resolve fsubset_refl. Definition fincl A B (AsubB : A `<=` B) (a : A) : B := [` (fsubsetP AsubB) _ (valP a)]. Definition fsub B A : {set B} := [set x : B | val x \in A]. Lemma fsubE A B (AsubB : A `<=` B) : fsub B A = [set fincl AsubB x | x : A]. Proof. (* Goal: @eq (@finset_of V (Phant (Choice.sort V))) (codomf (@fmap0 K (Choice.sort V))) (@fset0 V) *) apply/setP => x; rewrite in_set; apply/idP/imsetP => [|[[a aA] aA' ->]] //. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> xA; exists [` xA]=> //; apply: val_inj. Qed. Lemma fincl_fsub A B (AsubB : A `<=` B) (a : A) : fincl AsubB a \in fsub B A. Proof. by rewrite inE /= (valP a). Qed. Lemma in_fsub B A (b : B) : (b \in fsub B A) = (val b \in A). Proof. by rewrite inE. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma subset_fsubE C A B : A `<=` C -> B `<=` C -> (fsub C A \subset fsub C B) = (A `<=` B). Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) move=> sAC sBC; apply/subsetP/fsubsetP => sAB a; last first. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite !inE => /sAB. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> aA; have := sAB _ (fincl_fsub sAC [` aA]); rewrite inE. Qed. Lemma fsubset_trans : transitive (@fsubset K). Proof. by move=>??? s t ; apply/fsubsetP => a /(fsubsetP s) /(fsubsetP t). Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma subset_fsub A B C : A `<=` B -> B `<=` C -> fsub C A \subset fsub C B. Proof. by move=> sAB sBC; rewrite subset_fsubE // (fsubset_trans sAB). Qed. Lemma fsetIidPl {A B} : reflect (A `&` B = A) (A `<=` B). Proof. exact: eqP. Qed. Lemma fsetIidPr {A B} : reflect (A `&` B = B) (B `<=` A). Proof. by rewrite fsetIC; apply: fsetIidPl. Qed. Lemma fsubsetIidl A B : (A `<=` A `&` B) = (A `<=` B). Proof. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply/fsubsetP/fsubsetP=> sAB a aA; have := sAB _ aA; rewrite !inE ?aA. Qed. Lemma fsubsetIidr A B : (B `<=` A `&` B) = (B `<=` A). Proof. by rewrite fsetIC fsubsetIidl. Qed. Lemma fsetUidPr A B : reflect (A `|` B = B) (A `<=` B). Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) apply: (iffP fsubsetP) => sAB; last by move=> a aA; rewrite -sAB inE aA. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply/fsetP => b; rewrite inE; have [/sAB|//] := boolP (_ \in _). Qed. Lemma fsetUidPl A B : reflect (A `|` B = A) (B `<=` A). Proof. by rewrite fsetUC; apply/fsetUidPr. Qed. Lemma fsubsetUl A B : A `<=` A `|` B. Proof. by apply/fsubsetP => a; rewrite inE => ->. Qed. Hint Resolve fsubsetUl. Lemma fsubsetUr A B : B `<=` A `|` B. Proof. by rewrite fsetUC. Qed. Hint Resolve fsubsetUr. Lemma fsubsetU1 x A : A `<=` x |` A. Proof. by rewrite fsubsetUr. Qed. Hint Resolve fsubsetU1. Lemma fsubsetU A B C : (A `<=` B) || (A `<=` C) -> A `<=` B `|` C. Proof. by move=> /orP [] /fsubset_trans ->. Qed. Lemma fincl_inj A B (AsubB : A `<=` B) : injective (fincl AsubB). Proof. by move=> a b [eq_ab]; apply: val_inj. Qed. Hint Resolve fincl_inj. Lemma fsub_inj B : {in [pred A | A `<=` B] &, injective (fsub B)}. Proof. (* Goal: @prop_in2 (@finset_of K (Phant (Choice.sort K))) (@mem (@finset_of K (Phant (Choice.sort K))) (simplPredType (@finset_of K (Phant (Choice.sort K)))) (@SimplPred (@finset_of K (Phant (Choice.sort K))) (fun A : @finset_of K (Phant (Choice.sort K)) => @fsubset K A B))) (fun x1 x2 : @finset_of K (Phant (Choice.sort K)) => forall _ : @eq (@set_of (@fset_sub_finType K B) (Phant (@fset_sub_type K B))) (fsub B x1) (fsub B x2), @eq (@finset_of K (Phant (Choice.sort K))) x1 x2) (inPhantom (@injective (@set_of (@fset_sub_finType K B) (Phant (@fset_sub_type K B))) (@finset_of K (Phant (Choice.sort K))) (fsub B))) *) move=> A A'; rewrite -!topredE /= => sAB sA'B /setP eqAA'; apply/fsetP => a. (* Goal: Bool.reflect (@ex (Choice.sort K) (fun x : Choice.sort K => @eq (option (Choice.sort V)) (@fnd K (Choice.sort V) (@domf K (Choice.sort V) f) (@ffun_of_fmap K (Choice.sort V) f) x) (@Some (Choice.sort V) v))) (@in_mem (Choice.sort V) v (@mem (Choice.sort V) (finSetPredType V) (codomf f))) *) apply/idP/idP => mem_a. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by have := eqAA' (fincl sAB [` mem_a]); rewrite !inE // => <-. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by have := eqAA' (fincl sA'B [` mem_a]); rewrite !inE // => ->. Qed. Hint Resolve fsub_inj. Lemma eqEfsubset A B : (A == B) = (A `<=` B) && (B `<=` A). Proof. (* Goal: Bool.reflect (@ex (Choice.sort K) (fun x : Choice.sort K => @eq (option (Choice.sort V)) (@fnd K (Choice.sort V) (@domf K (Choice.sort V) f) (@ffun_of_fmap K (Choice.sort V) f) x) (@Some (Choice.sort V) v))) (@in_mem (Choice.sort V) v (@mem (Choice.sort V) (finSetPredType V) (codomf f))) *) apply/eqP/andP => [-> //|[/fsubsetP AB /fsubsetP BA]]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply/fsetP=> x; apply/idP/idP=> [/AB|/BA]. Qed. Lemma subEfproper A B : A `<=` B = (A == B) || (A `<` B). Proof. by rewrite eqEfsubset -andb_orr orbN andbT. Qed. Lemma fproper_sub A B : A `<` B -> A `<=` B. Proof. by rewrite subEfproper orbC => ->. Qed. Lemma eqVfproper A B : A `<=` B -> A = B \/ A `<` B. Proof. by rewrite subEfproper => /predU1P. Qed. Lemma fproperEneq A B : A `<` B = (A != B) && (A `<=` B). Proof. by rewrite andbC eqEfsubset negb_and andb_orr andbN. Qed. Lemma fproper_neq A B : A `<` B -> A != B. Proof. by rewrite fproperEneq; case/andP. Qed. Lemma fproper_irrefl A : ~~ (A `<` A). Proof. by rewrite fproperEneq eqxx. Qed. Lemma eqEfproper A B : (A == B) = (A `<=` B) && ~~ (A `<` B). Proof. by rewrite negb_and negbK andb_orr andbN eqEfsubset. Qed. Lemma card_fsub B A : A `<=` B -> #|fsub B A| = #|` A|. Proof. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> sAB; rewrite cardfE fsubE card_imset //; apply: fincl_inj. Qed. Lemma eqEfcard A B : (A == B) = (A `<=` B) && (#|` B| <= #|` A|)%N. Proof. (* Goal: @eq (Equality.sort V) (@fun_of_fsfun K V default (of_ffun key) x) (@Option.default (Equality.sort V) (default x) (@Option.map (@fset_sub_type K S) (Equality.sort V) h (@insub (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) x))) *) rewrite -(inj_in_eq (@fsub_inj (A `|` B))) -?topredE //=. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite eqEcard !(@subset_fsubE (A `|` B)) ?(@card_fsub (A `|` B)). Qed. Lemma fproperEcard A B : (A `<` B) = (A `<=` B) && (#|` A| < #|` B|)%N. Proof. by rewrite fproperEneq ltnNge andbC eqEfcard; case: (A `<=` B). Qed. Lemma fsubset_leqif_cards A B : A `<=` B -> (#|` A| <= #|` B| ?= iff (A == B))%N. Proof. (* Goal: @eq (Equality.sort V) (@fun_of_fsfun K V default (of_ffun key) x) (@Option.default (Equality.sort V) (default x) (@Option.map (@fset_sub_type K S) (Equality.sort V) h (@insub (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) x))) *) rewrite -!(@card_fsub (A `|` B)) // -(@subset_fsubE (A `|` B)) //. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> /subset_leqif_cards; rewrite (inj_in_eq (@fsub_inj _)) -?topredE /=. Qed. Lemma fsub0set A : fset0 `<=` A. Proof. by apply/fsubsetP=> x; rewrite inE. Qed. Hint Resolve fsub0set. Lemma fsubset0 A : (A `<=` fset0) = (A == fset0). Proof. by rewrite eqEfsubset fsub0set andbT. Qed. Lemma fproper0 A : (fset0 `<` A) = (A != fset0). Proof. by rewrite /fproper fsub0set fsubset0. Qed. Lemma fproperE A B : (A `<` B) = (A `<=` B) && ~~ (B `<=` A). Proof. by []. Qed. Lemma fsubEproper A B : (A `<=` B) = (A == B) || (A `<` B). Proof. by rewrite fproperEneq; case: eqP => //= ->; apply: fsubset_refl. Qed. Lemma fsubset_leq_card A B : A `<=` B -> (#|` A| <= #|` B|)%N. Proof. by move=> /fsubset_leqif_cards ->. Qed. Lemma fproper_ltn_card A B : A `<` B -> (#|` A| < #|` B|)%N. Proof. by rewrite fproperEcard => /andP []. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma fsubset_cardP A B : #|` A| = #|` B| -> reflect (A =i B) (A `<=` B). Proof. (* Goal: forall (_ : is_true (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f)))) (_ : is_true (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f')))) (_ : @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (@setf K V f k v) (@setf K V f' k v)), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f f' *) move=> eq_cardAB; apply: (iffP idP) => [/eqVfproper [->//|]|/fsetP -> //]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite fproperEcard eq_cardAB ltnn andbF. Qed. Lemma fproper_sub_trans B A C : A `<` B -> B `<=` C -> A `<` C. Proof. (* Goal: @big_rel_class_of (@finset_of K (Phant (Choice.sort K))) (@fsubset K) *) rewrite !fproperEcard => /andP [sAB lt_AB] sBC. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite (fsubset_trans sAB) //= (leq_trans lt_AB) // fsubset_leq_card. Qed. Lemma fsub_proper_trans B A C : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) A `<=` B -> B `<` C -> A `<` C. Proof. (* Goal: @big_rel_class_of (@finset_of K (Phant (Choice.sort K))) (@fsubset K) *) rewrite !fproperEcard => sAB /andP [sBC lt_BC]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite (fsubset_trans sAB) //= (leq_ltn_trans _ lt_BC) // fsubset_leq_card. Qed. Lemma fsubset_neq0 A B : A `<=` B -> A != fset0 -> B != fset0. Proof. by rewrite -!fproper0 => sAB /fproper_sub_trans->. Qed. (* fsub is a morphism *) Lemma fsub0 A : fsub A fset0 = set0 :> {set A}. Proof. by apply/setP => x; rewrite !inE. Qed. Lemma fsubT A : fsub A A = [set : A]. Proof. by apply/setP => x; rewrite !inE (valP x). Qed. Lemma fsub1 A a (aA : a \in A) : fsub A [fset a] = [set [` aA]] :> {set A}. Proof. by apply/setP=> x; rewrite !inE; congr eq_op. Qed. Lemma fsubU C A B : fsub C (A `|` B) = fsub C A :|: fsub C B. Proof. by apply/setP => x; rewrite !inE. Qed. Lemma fsubI C A B : fsub C (A `&` B) = fsub C A :&: fsub C B. Proof. by apply/setP => x; rewrite !inE. Qed. Lemma fsubD C A B : fsub C (A `\` B) = fsub C A :\: fsub C B. Proof. by apply/setP => x; rewrite !inE andbC. Qed. Lemma fsubD1 C A b (bC : b \in C) : fsub C (A `\ b) = fsub C A :\ [` bC]. Proof. by rewrite fsubD fsub1. Qed. Lemma fsub_eq0 A B : A `<=` B -> (fsub B A == set0) = (A == fset0). Proof. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> sAB; rewrite -fsub0 (inj_in_eq (@fsub_inj _)) -?topredE /=. Qed. Lemma fset_0Vmem A : (A = fset0) + {x : K | x \in A}. Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) have [|[x mem_x]] := set_0Vmem (fsub A A); last first. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by right; exists (val x); rewrite inE // in mem_x. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> /eqP; rewrite fsub_eq0 // => /eqP; left. Qed. Lemma fset1P x a : reflect (x = a) (x \in [fset a]). Proof. by rewrite inE; exact: eqP. Qed. Lemma fset11 x : x \in [fset x]. Proof. by rewrite inE. Qed. Lemma fset1_inj : injective (@fset1 K). Proof. by move=> a b eqsab; apply/fset1P; rewrite -eqsab fset11. Qed. Lemma fset1UP x a B : reflect (x = a \/ x \in B) (x \in a |` B). Proof. by rewrite !inE; exact: predU1P. Qed. Lemma fset_cons a s : [fset[key] x in a :: s] = a |` [fset[key] x in s]. Proof. by apply/fsetP=> x; rewrite in_fset_cons !inE. Qed. Lemma fset_nil : [fset[key] x in [::] : seq K] = fset0. Proof. by apply/fsetP=> x; rewrite in_fset_nil. Qed. Lemma fset_cat s s' : [fset[key] x in s ++ s'] = [fset[key] x in s] `|` [fset[key] x in s']. Proof. by apply/fsetP=> x; rewrite !inE !in_fset_cat. Qed. Lemma fset1U1 x B : x \in x |` B. Proof. by rewrite !inE eqxx. Qed. Lemma fset1Ur x a B : x \in B -> x \in a |` B. Proof. by move=> Bx; rewrite !inE predU1r. Qed. (* We need separate lemmas for the explicit enumerations since they *) (* associate on the left. *) Lemma fsetU1l x A b : x \in A -> x \in A `|` [fset b]. Proof. by move=> Ax; rewrite !inE Ax. Qed. Lemma fsetU1r A b : b \in A `|` [fset b]. Proof. by rewrite !inE eqxx orbT. Qed. Lemma fsetD1P x A b : reflect (x != b /\ x \in A) (x \in A `\ b). Proof. by rewrite !inE; exact: andP. Qed. Lemma fsetD11 b A : (b \in A `\ b) = false. Proof. by rewrite !inE eqxx. Qed. Lemma fsetD1K a A : a \in A -> a |` (A `\ a) = A. Proof. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> Aa; apply/fsetP=> x; rewrite !inE; case: eqP => // ->. Qed. Lemma fsetU1K a B : a \notin B -> (a |` B) `\ a = B. Proof. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move/negPf=> nBa; apply/fsetP=> x; rewrite !inE; case: eqP => // ->. Qed. Lemma fset2P x a b : reflect (x = a \/ x = b) (x \in [fset a; b]). Proof. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite !inE; apply: (iffP orP) => [] [] /eqP ->; [left|right|left|right]. Qed. Lemma in_fset2 x a b : (x \in [fset a; b]) = (x == a) || (x == b). Proof. by rewrite !inE. Qed. Lemma fset21 a b : a \in [fset a; b]. Proof. by rewrite fset1U1. Qed. Lemma fset22 a b : b \in [fset a; b]. Proof. by rewrite in_fset2 eqxx orbT. Qed. Lemma fsetUP x A B : reflect (x \in A \/ x \in B) (x \in A `|` B). Proof. by rewrite !inE; exact: orP. Qed. Lemma fsetULVR x A B : x \in A `|` B -> (x \in A) + (x \in B). Proof. by rewrite inE; case: (x \in A); [left|right]. Qed. Lemma fsetUS A B C : A `<=` B -> C `|` A `<=` C `|` B. Proof. (* Goal: forall (_ : is_true (@fdisjoint K A B)) (C : @finset_of K (Phant (Choice.sort K))), is_true (@disjoint (@fset_sub_finType K C) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C A))) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C B)))) *) move=> sAB; apply/fsubsetP=> x; rewrite !inE. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by case: (x \in C) => //; exact: (fsubsetP sAB). Qed. Lemma fsetSU A B C : A `<=` B -> A `|` C `<=` B `|` C. Proof. by move=> sAB; rewrite -!(fsetUC C) fsetUS. Qed. Lemma fsetUSS A B C D : A `<=` C -> B `<=` D -> A `|` B `<=` C `|` D. Proof. by move=> /(fsetSU B) /fsubset_trans sAC /(fsetUS C)/sAC. Qed. Lemma fset0U A : fset0 `|` A = A. Proof. by apply/fsetP => x; rewrite !inE orFb. Qed. Lemma fsetU0 A : A `|` fset0 = A. Proof. by rewrite fsetUC fset0U. Qed. (* intersection *) Lemma fsetIP x A B : reflect (x \in A /\ x \in B) (x \in A `&` B). Proof. by rewrite inE; apply: andP. Qed. Lemma fsetIS A B C : A `<=` B -> C `&` A `<=` C `&` B. Proof. (* Goal: forall (_ : is_true (@fdisjoint K A B)) (C : @finset_of K (Phant (Choice.sort K))), is_true (@disjoint (@fset_sub_finType K C) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C A))) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C B)))) *) move=> sAB; apply/fsubsetP=> x; rewrite !inE. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by case: (x \in C) => //; exact: (fsubsetP sAB). Qed. Lemma fsetSI A B C : A `<=` B -> A `&` C `<=` B `&` C. Proof. by move=> sAB; rewrite -!(fsetIC C) fsetIS. Qed. Lemma fsetISS A B C D : A `<=` C -> B `<=` D -> A `&` B `<=` C `&` D. Proof. by move=> /(fsetSI B) /fsubset_trans sAC /(fsetIS C) /sAC. Qed. (* difference *) Lemma fsetDP A B x : reflect (x \in A /\ x \notin B) (x \in A `\` B). Proof. by rewrite inE andbC; apply: andP. Qed. Lemma fsetSD C A B : A `<=` B -> A `\` C `<=` B `\` C. Proof. (* Goal: forall (_ : is_true (@fdisjoint K A B)) (C : @finset_of K (Phant (Choice.sort K))), is_true (@disjoint (@fset_sub_finType K C) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C A))) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C B)))) *) move=> sAB; apply/fsubsetP=> x; rewrite !inE. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by case: (x \in C) => //; exact: (fsubsetP sAB). Qed. Lemma fsetDS C A B : A `<=` B -> C `\` B `<=` C `\` A. Proof. (* Goal: forall (_ : is_true (@fdisjoint K A B)) (C : @finset_of K (Phant (Choice.sort K))), is_true (@disjoint (@fset_sub_finType K C) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C A))) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C B)))) *) move=> sAB; apply/fsubsetP=> x; rewrite !inE ![_ && (_ \in _)]andbC. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by case: (x \in C) => //; apply: contra; exact: (fsubsetP sAB). Qed. Lemma fsetDSS A B C D : A `<=` C -> D `<=` B -> A `\` B `<=` C `\` D. Proof. by move=> /(fsetSD B) /fsubset_trans sAC /(fsetDS C) /sAC. Qed. Lemma fsetD0 A : A `\` fset0 = A. Proof. by apply/fsetP=> x; rewrite !inE. Qed. Lemma fset0D A : fset0 `\` A = fset0. Proof. by apply/fsetP=> x; rewrite !inE andbF. Qed. Lemma fsetDv A : A `\` A = fset0. Proof. by apply/fsetP=> x; rewrite !inE andNb. Qed. Lemma fsetID B A : A `&` B `|` A `\` B = A. Proof. by apply/fsetP=> x; rewrite !inE; do ?case: (_ \in _). Qed. Lemma fsetDUl A B C : (A `|` B) `\` C = (A `\` C) `|` (B `\` C). Proof. by apply/fsetP=> x; rewrite !inE; do ?case: (_ \in _). Qed. Lemma fsetDUr A B C : A `\` (B `|` C) = (A `\` B) `&` (A `\` C). Proof. by apply/fsetP=> x; rewrite !inE; do ?case: (_ \in _). Qed. Lemma fsetDIl A B C : (A `&` B) `\` C = (A `\` C) `&` (B `\` C). Proof. by apply/fsetP=> x; rewrite !inE; do ?case: (_ \in _). Qed. Lemma fsetIDA A B C : A `&` (B `\` C) = (A `&` B) `\` C. Proof. by apply/fsetP=> x; rewrite !inE; do ?case: (_ \in _). Qed. Lemma fsetIDAC A B C : (A `\` B) `&` C = (A `&` C) `\` B. Proof. by apply/fsetP=> x; rewrite !inE; do ?case: (_ \in _). Qed. Lemma fsetDIr A B C : A `\` (B `&` C) = (A `\` B) `|` (A `\` C). Proof. by apply/fsetP=> x; rewrite !inE; do ?case: (_ \in _). Qed. Lemma fsetDDl A B C : (A `\` B) `\` C = A `\` (B `|` C). Proof. by apply/fsetP=> x; rewrite !inE; do ?case: (_ \in _). Qed. Lemma fsetDDr A B C : A `\` (B `\` C) = (A `\` B) `|` (A `&` C). Proof. by apply/fsetP=> x; rewrite !inE; do ?case: (_ \in _). Qed. Lemma fsetDK A B : B `<=` A -> A `\` (A `\` B) = B. Proof. by rewrite fsetDDr => /fsetIidPr->; rewrite fsetDv fset0U. Qed. Lemma fsetUDl (A B C : {fset K}) : A `|` (B `\` C) = (A `|` B) `\` (C `\` A). Proof. by apply/fsetP=> x; rewrite !inE; do ?case: (_ \in _). Qed. Lemma fsetUDr (A B C : {fset K}) : (A `\` B) `|` C = (A `|` C) `\` (B `\` C). Proof. by apply/fsetP=> x; rewrite !inE; do ?case: (_ \in _). Qed. (* other inclusions *) Lemma fsubsetIl A B : A `&` B `<=` A. Proof. by apply/fsubsetP=> x; rewrite inE => /andP []. Qed. Lemma fsubsetIr A B : A `&` B `<=` B. Proof. by apply/fsubsetP=> x; rewrite inE => /andP []. Qed. Lemma fsubsetDl A B : A `\` B `<=` A. Proof. by apply/fsubsetP=> x; rewrite inE => /andP []. Qed. Lemma fsubD1set A x : A `\ x `<=` A. Proof. by rewrite fsubsetDl. Qed. Lemma fsubsetD2l C A B : A `<=` C -> B `<=` C -> (C `\` B `<=` C `\` A) = (A `<=` B). Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) move=> sAC sBC; apply/idP/idP; last exact: fsetDS. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> /(@fsetDS C); rewrite !fsetDK //; apply; apply: fsubsetDl. Qed. Hint Resolve fsubsetIl fsubsetIr fsubsetDl fsubD1set. (* cardinal lemmas for fsets *) Lemma card_finset (T : finType) (P : pred T) : #|` [fset x in P] | = #|P|. Proof. by rewrite card_imfset //= -cardE. Qed. Lemma card_fset (T : choiceType) (A : {fset T}) : #|` [fset x in A] | = #|` A|. Proof. by rewrite card_imfset. Qed. Lemma card_fseq (T : choiceType) (s : seq T) : #|` [fset x in s] | = size (undup s). Proof. by rewrite card_imfset. Qed. Lemma cardfs0 : #|` @fset0 K| = 0. Proof. by rewrite -(@card_fsub fset0) // fsub0 cards0. Qed. Lemma cardfT0 : #|{: @fset0 K}| = 0. Proof. by rewrite -cardfE cardfs0. Qed. Lemma cardfs_eq0 A : (#|` A| == 0) = (A == fset0). Proof. by rewrite -(@card_fsub A) // cards_eq0 fsub_eq0. Qed. Lemma cardfs0_eq A : #|` A| = 0 -> A = fset0. Proof. by move=> /eqP; rewrite cardfs_eq0 => /eqP. Qed. Lemma fset0Pn A : reflect (exists x, x \in A) (A != fset0). Proof. (* Goal: is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) a)) (@mem (Choice.sort K) (finSetPredType K) (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f))) *) (* Goal: @ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x1) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Choice.sort K) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K S a)) (@mem (Choice.sort K) (finSetPredType K) S)))) *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite -cardfs_eq0 cardfE; apply: (equivP existsP). (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by split=> [] [a aP]; [exists (val a); apply: valP|exists [` aP]]. Qed. Lemma cardfs_gt0 A : (0 < #|` A|)%N = (A != fset0). Proof. by rewrite lt0n cardfs_eq0. Qed. Lemma cardfs1 x : #|` [fset x]| = 1. Proof. by rewrite card_imfset. Qed. Lemma cardfsUI A B : #|` A `|` B| + #|` A `&` B| = #|` A| + #|` B|. Proof. (* Goal: @eq (Equality.sort V) (@fun_of_fsfun K V default (of_ffun key) x) (@Option.default (Equality.sort V) (default x) (@Option.map (@fset_sub_type K S) (Equality.sort V) h (@insub (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) x))) *) rewrite -!(@card_fsub (A `|` B)) ?(fsubset_trans (fsubsetIl _ _)) //. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite fsubU fsubI cardsUI. Qed. Lemma cardfsU A B : #|` A `|` B| = (#|` A| + #|` B| - #|` A `&` B|)%N. Proof. by rewrite -cardfsUI addnK. Qed. Lemma cardfsI A B : #|` A `&` B| = (#|` A| + #|` B| - #|` A `|` B|)%N. Proof. by rewrite -cardfsUI addKn. Qed. Lemma cardfsID B A : #|` A `&` B| + #|` A `\` B| = #|` A|. Proof. by rewrite -!(@card_fsub A) // fsubI fsubD cardsID. Qed. Lemma cardfsD A B : #|` A `\` B| = (#|` A| - #|` A `&` B|)%N. Proof. by rewrite -(cardfsID B A) addKn. Qed. Lemma mem_fset1U a A : a \in A -> a |` A = A. Proof. (* Goal: forall (_ : is_true (@fdisjoint K A B)) (C : @finset_of K (Phant (Choice.sort K))), is_true (@disjoint (@fset_sub_finType K C) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C A))) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C B)))) *) move=> aA; apply/fsetP => x; rewrite !inE orbC. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by have [//|/=] := boolP (_ \in A); apply: contraNF => /eqP ->. Qed. Lemma mem_fsetD1 a A : a \notin A -> A `\ a = A. Proof. (* Goal: forall (_ : is_true (@fdisjoint K A B)) (C : @finset_of K (Phant (Choice.sort K))), is_true (@disjoint (@fset_sub_finType K C) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C A))) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C B)))) *) move=> aA; apply/fsetP => x; rewrite !inE andbC. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by have [/= xA|//] := boolP (_ \in A); apply: contraNneq aA => <-. Qed. Lemma fsetI1 a A : A `&` [fset a] = if a \in A then [fset a] else fset0. Proof. (* Goal: is_true (@fsubset K (@FinSupp.fs K V (fun a : Choice.sort K => default a) (@fsfun_of_ffun key K V S (fun a : @fset_sub_type K S => h a) (fun a : Choice.sort K => default a))) S) *) apply/fsetP => x; rewrite (fun_if (fun X => _ \in X)) !inE. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by have [[->|?] []] := (altP (x =P a), boolP (a \in A)); rewrite ?andbF. Qed. Lemma cardfsU1 a A : #|` a |` A| = (a \notin A) + #|` A|. Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) have [aA|aNA] := boolP (a \in A); first by rewrite mem_fset1U. (* Goal: @eq (Equality.sort V) (@fun_of_fsfun K V default (of_ffun key) x) (@Option.default (Equality.sort V) (default x) (@Option.map (@fset_sub_type K S) (Equality.sort V) h (@insub (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) x))) *) rewrite cardfsU -addnBA ?fsubset_leq_card // fsetIC -cardfsD. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite mem_fsetD1 // cardfs1. Qed. Lemma cardfs2 a b : #|` [fset a; b]| = (a != b).+1. Proof. by rewrite !cardfsU1 cardfs1 inE addn1. Qed. Lemma cardfsD1 a A : #|` A| = (a \in A) + #|` A `\ a|. Proof. (* Goal: @eq (Equality.sort V) (@fun_of_fsfun K V default (of_ffun key) x) (@Option.default (Equality.sort V) (default x) (@Option.map (@fset_sub_type K S) (Equality.sort V) h (@insub (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) x))) *) rewrite -(cardfsID [fset a]) fsetI1 (fun_if (fun A => #|` A|)). (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite cardfs0 cardfs1; case: (_ \in _). Qed. (* other inclusions *) Lemma fsub1set A x : ([fset x] `<=` A) = (x \in A). Proof. (* Goal: @big_rel_class_of (@finset_of K (Phant (Choice.sort K))) (@fsubset K) *) rewrite -(@subset_fsubE (x |` A)) // fsub1 ?fset1U1 // => xxA. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite sub1set inE. Qed. Lemma cardfs1P A : reflect (exists x, A = [fset x]) (#|` A| == 1). Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) apply: (iffP idP) => [|[x ->]]; last by rewrite cardfs1. (* Goal: @big_rel_class_of (@finset_of K (Phant (Choice.sort K))) (@fsubset K) *) rewrite eq_sym eqn_leq cardfs_gt0=> /andP[/fset0Pn[x Ax] leA1]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by exists x; apply/eqP; rewrite eq_sym eqEfcard fsub1set cardfs1 leA1 Ax. Qed. Lemma fsubset1 A x : (A `<=` [fset x]) = (A == [fset x]) || (A == fset0). Proof. (* Goal: @eq (Equality.sort V) (@fun_of_fsfun K V default (of_ffun key) x) (@Option.default (Equality.sort V) (default x) (@Option.map (@fset_sub_type K S) (Equality.sort V) h (@insub (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) x))) *) rewrite eqEfcard cardfs1 -cardfs_eq0 orbC andbC. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by case: posnP => // A0; rewrite (cardfs0_eq A0) fsub0set. Qed. Arguments fsetIidPl {A B}. Lemma cardfsDS A B : B `<=` A -> #|` A `\` B| = (#|` A| - #|` B|)%N. Proof. by rewrite cardfsD => /fsetIidPr->. Qed. Lemma fsubIset A B C : (B `<=` A) || (C `<=` A) -> (B `&` C `<=` A). Proof. by case/orP; apply: fsubset_trans; rewrite (fsubsetIl, fsubsetIr). Qed. Lemma fsubsetI A B C : (A `<=` B `&` C) = (A `<=` B) && (A `<=` C). Proof. (* Goal: @eq bool (@fsubset K A (@fsetI K B C)) (andb (@fsubset K A B) (@fsubset K A C)) *) rewrite !(sameP fsetIidPl eqP) fsetIA; have [-> //| ] := altP (A `&` B =P A). (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply: contraNF => /eqP <-; rewrite -fsetIA -fsetIIl fsetIAC. Qed. Lemma fsubsetIP A B C : reflect (A `<=` B /\ A `<=` C) (A `<=` B `&` C). Proof. by rewrite fsubsetI; exact: andP. Qed. Lemma fsubUset A B C : (B `|` C `<=` A) = (B `<=` A) && (C `<=` A). Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) apply/idP/idP => [subA|/andP [AB CA]]; last by rewrite -[A]fsetUid fsetUSS. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite !(fsubset_trans _ subA). Qed. Lemma fsubUsetP A B C : reflect (A `<=` C /\ B `<=` C) (A `|` B `<=` C). Proof. by rewrite fsubUset; exact: andP. Qed. Lemma fsubDset A B C : (A `\` B `<=` C) = (A `<=` B `|` C). Proof. (* Goal: is_true (@fsubset K (@FinSupp.fs K V (fun a : Choice.sort K => default a) (@fsfun_of_ffun key K V S (fun a : @fset_sub_type K S => h a) (fun a : Choice.sort K => default a))) S) *) apply/fsubsetP/fsubsetP=> sABC x; rewrite !inE. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by case Bx: (x \in B) => // Ax; rewrite sABC ?in_fsetD ?Bx. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by case Bx: (x \in B) => //; move/sABC; rewrite inE Bx. Qed. Lemma fsetU_eq0 A B : (A `|` B == fset0) = (A == fset0) && (B == fset0). Proof. by rewrite -!fsubset0 fsubUset. Qed. Lemma fsubsetD1 A B x : (A `<=` B `\ x) = (A `<=` B) && (x \notin A). Proof. (* Goal: @eq bool (@fsubset K A (@fsetD K B (@fset1 K x))) (andb (@fsubset K A B) (negb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)))) *) do !rewrite -(@subset_fsubE (x |` A `|` B)) ?fsubDset ?fsetUA // 1?fsetUAC //. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite fsubD1 => [|mem_x]; first by rewrite -fsetUA fset1U1. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite subsetD1 // inE. Qed. Lemma fsubsetD1P A B x : reflect (A `<=` B /\ x \notin A) (A `<=` B `\ x). Proof. by rewrite fsubsetD1; exact: andP. Qed. Lemma fsubsetPn A B : reflect (exists2 x, x \in A & x \notin B) (~~ (A `<=` B)). Proof. (* Goal: is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) a)) (@mem (Choice.sort K) (finSetPredType K) (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f))) *) (* Goal: @ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x1) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Choice.sort K) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K S a)) (@mem (Choice.sort K) (finSetPredType K) S)))) *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite -fsetD_eq0; apply: (iffP (fset0Pn _)) => [[x]|[x xA xNB]]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite inE => /andP[]; exists x. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by exists x; rewrite inE xA xNB. Qed. Lemma fproperD1 A x : x \in A -> A `\ x `<` A. Proof. (* Goal: forall _ : is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)), is_true (@fproper K (@fsetD K A (@fset1 K x)) A) *) move=> Ax; rewrite fproperE fsubsetDl; apply/fsubsetPn; exists x=> //. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite in_fsetD1 Ax eqxx. Qed. Lemma fproperIr A B : ~~ (B `<=` A) -> A `&` B `<` B. Proof. by move=> nsAB; rewrite fproperE fsubsetIr fsubsetI negb_and nsAB. Qed. Lemma fproperIl A B : ~~ (A `<=` B) -> A `&` B `<` A. Proof. by move=> nsBA; rewrite fproperE fsubsetIl fsubsetI negb_and nsBA orbT. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma fproperUr A B : ~~ (A `<=` B) -> B `<` A `|` B. Proof. by rewrite fproperE fsubsetUr fsubUset fsubset_refl /= andbT. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma fproperUl A B : ~~ (B `<=` A) -> A `<` A `|` B. Proof. by move=> not_sBA; rewrite fsetUC fproperUr. Qed. Lemma fproper1set A x : ([fset x] `<` A) -> (x \in A). Proof. by move/fproper_sub; rewrite fsub1set. Qed. Lemma fproperIset A B C : (B `<` A) || (C `<` A) -> (B `&` C `<` A). Proof. by case/orP; apply: fsub_proper_trans; rewrite (fsubsetIl, fsubsetIr). Qed. Lemma fproperI A B C : (A `<` B `&` C) -> (A `<` B) && (A `<` C). Proof. (* Goal: forall (_ : is_true (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f)))) (_ : is_true (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f')))) (_ : @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (@setf K V f k v) (@setf K V f' k v)), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f f' *) move=> pAI; apply/andP. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by split; apply: (fproper_sub_trans pAI); rewrite (fsubsetIl, fsubsetIr). Qed. Lemma fproperU A B C : (B `|` C `<` A) -> (B `<` A) && (C `<` A). Proof. (* Goal: forall (_ : is_true (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f)))) (_ : is_true (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f')))) (_ : @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (@setf K V f k v) (@setf K V f' k v)), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f f' *) move=> pUA; apply/andP. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by split; apply: fsub_proper_trans pUA; rewrite (fsubsetUr, fsubsetUl). Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma fsetDpS C A B : B `<=` C -> A `<` B -> C `\` B `<` C `\` A. Proof. (* Goal: forall (_ : is_true (@fdisjoint K (@domf K V f) (@domf K V h))) (_ : is_true (@fdisjoint K (@domf K V g) (@domf K V h))) (_ : @eq (finMap K V) (catf h f) (catf h g)), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f g *) move=> subBC subAB; rewrite fproperEneq fsetDS 1?fproper_sub// andbT. (* Goal: is_true (negb (@eq_op (fset_eqType K) (@fsetD K C B) (@fsetD K C A))) *) apply/negP => /eqP /(congr1 (fsetD C)); rewrite !fsetDK // => [eqAB//|]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite eqAB (negPf (fproper_irrefl _)) in subAB. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply: fsubset_trans subBC; apply: fproper_sub. Qed. Lemma fproperD2l C A B : A `<=` C -> B `<=` C -> (C `\` B `<` C `\` A) = (A `<` B). Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) move=> sAC sBC; apply/idP/idP; last exact: fsetDpS. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> /(@fsetDpS C); rewrite !fsetDK //; apply; apply: fsubsetDl. Qed. Lemma fsetI_eq0 A B : (A `&` B == fset0) = [disjoint A & B]. Proof. by []. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma fdisjoint_sub {A B} : [disjoint A & B]%fset -> forall C : {fset K}, [disjoint fsub C A & fsub C B]%bool. Proof. (* Goal: forall (_ : is_true (@fdisjoint K A B)) (C : @finset_of K (Phant (Choice.sort K))), is_true (@disjoint (@fset_sub_finType K C) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C A))) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C B)))) *) move=> disjointAB C; apply/pred0P => a /=; rewrite !inE. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by have /eqP /fsetP /(_ (val a)) := disjointAB; rewrite !inE. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma disjoint_fsub C A B : A `|` B `<=` C -> [disjoint fsub C A & fsub C B]%bool = [disjoint A & B]. Proof. (* Goal: forall _ : is_true (@fsubset K (@fsetU K A B) C), @eq bool (@disjoint (@fset_sub_finType K C) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C A))) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C B)))) (@fdisjoint K A B) *) move=> ABsubC. (* Goal: @eq (@finset_of V (Phant (Choice.sort V))) (codomf (@restrictf K (Choice.sort V) f A)) (@Imfset.imfset imfset_key (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) V (fun k : Choice.sort (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) => @FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) (@mem_fin (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (simplPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@subfinset_finpred (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) (@mem_fin (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (predPredType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType)) (@fin_finpred (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (pred_finpredType (@fset_sub_finType K (@domf K (Choice.sort V) f))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType) (pred_of_argType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType))))) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => @in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@fset_sub_subType K (@domf K (Choice.sort V) f)) k) (@mem (Choice.sort K) (finSetPredType K) A)))) (Phantom (mem_pred (@fset_sub_type K (@domf K (Choice.sort V) f))) (@mem (@fset_sub_type K (@domf K (Choice.sort V) f)) (simplPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@SimplPred (@fset_sub_type K (@domf K (Choice.sort V) f)) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => andb (@in_mem (@fset_sub_type K (@domf K (Choice.sort V) f)) k (@mem (@fset_sub_type K (@domf K (Choice.sort V) f)) (predPredType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType)) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType) (pred_of_argType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType))))) (@in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@fset_sub_subType K (@domf K (Choice.sort V) f)) k) (@mem (Choice.sort K) (finSetPredType K) A))))))) *) apply/idP/idP=> [/pred0P DAB|/fdisjoint_sub->//]; apply/eqP/fsetP=> a. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite !inE; have [aC|] := boolP (a \in A `|` B); last first. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite !inE => /norP [/negPf-> /negPf->]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by have /= := DAB [` fsubsetP ABsubC _ aC]; rewrite !inE. Qed. Lemma fdisjointP {A B} : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) reflect (forall a, a \in A -> a \notin B) [disjoint A & B]%fset. Proof. (* Goal: Bool.reflect (@ex (Choice.sort K) (fun x : Choice.sort K => @eq (option (Choice.sort V)) (@fnd K (Choice.sort V) (@domf K (Choice.sort V) f) (@ffun_of_fmap K (Choice.sort V) f) x) (@Some (Choice.sort V) v))) (@in_mem (Choice.sort V) v (@mem (Choice.sort V) (finSetPredType V) (codomf f))) *) apply: (iffP eqP) => [AIB_eq0 a aA|neq_ab]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by have /fsetP /(_ a) := AIB_eq0; rewrite !inE aA /= => ->. (* Goal: is_true (@fsubset K (@FinSupp.fs K V (fun a : Choice.sort K => default a) (@fsfun_of_ffun key K V S (fun a : @fset_sub_type K S => h a) (fun a : Choice.sort K => default a))) S) *) apply/fsetP => a; rewrite !inE. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by case: (boolP (a \in A)) => // /neq_ab /negPf ->. Qed. Lemma fsetDidPl A B : reflect (A `\` B = A) [disjoint A & B]%fset. Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) apply: (iffP fdisjointP)=> [NB|<- a]; last by rewrite inE => /andP[]. (* Goal: is_true (@fsubset K (@FinSupp.fs K V (fun a : Choice.sort K => default a) (@fsfun_of_ffun key K V S (fun a : @fset_sub_type K S => h a) (fun a : Choice.sort K => default a))) S) *) apply/fsetP => a; rewrite !inE andbC. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by case: (boolP (a \in A)) => //= /NB ->. Qed. Lemma disjoint_fsetI0 A B : [disjoint A & B] -> A `&` B = fset0. Proof. by rewrite -fsetI_eq0; move/eqP. Qed. Lemma fsubsetD A B C : (A `<=` (B `\` C)) = (A `<=` B) && [disjoint A & C]%fset. Proof. (* Goal: @eq bool (@fsubset K A (@fsetD K B C)) (andb (@fsubset K A B) (@fdisjoint K A C)) *) pose D := A `|` B `|` C. (* Goal: Bool.reflect (@ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x1) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Equality.sort (Choice.eqType K)) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) a)) (@mem (Choice.sort K) (finSetPredType K) S))))) (fsinjectiveb f) *) have AD : A `<=` D by rewrite /D -fsetUA fsubsetUl. (* Goal: Bool.reflect (@ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x1) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Equality.sort (Choice.eqType K)) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) a)) (@mem (Choice.sort K) (finSetPredType K) S))))) (fsinjectiveb f) *) have BD : B `<=` D by rewrite /D fsetUAC fsubsetUr. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite -(@subset_fsubE D) //; last first. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite fsubDset (fsubset_trans BD) // fsubsetUr. (* Goal: @eq (Equality.sort V) (@fun_of_fsfun K V default (of_ffun key) x) (@Option.default (Equality.sort V) (default x) (@Option.map (@fset_sub_type K S) (Equality.sort V) h (@insub (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) x))) *) rewrite fsubD subsetD !subset_fsubE // disjoint_fsub //. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite /D fsetUAC fsubsetUl. Qed. Lemma fsubsetDP A B C : reflect (A `<=` B /\ [disjoint A & C]%fset) (A `<=` (B `\` C)). Proof. by rewrite fsubsetD; apply: andP. Qed. Lemma fdisjoint_sym A B : [disjoint A & B] = [disjoint B & A]. Proof. by rewrite -!fsetI_eq0 fsetIC. Qed. Lemma fdisjointP_sym {A B} : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) reflect (forall a, a \in A -> a \notin B) [disjoint B & A]%fset. Proof. by rewrite fdisjoint_sym; apply: fdisjointP. Qed. Lemma fdisjoint_trans A B C : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) A `<=` B -> [disjoint B & C] -> [disjoint A & C]. Proof. (* Goal: forall (_ : is_true (@fdisjoint K (@domf K V f) (@domf K V h))) (_ : is_true (@fdisjoint K (@domf K V g) (@domf K V h))) (_ : @eq (finMap K V) (catf h f) (catf h g)), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f g *) move=> AsubB; rewrite -!(@disjoint_fsub (B `|` C)) ?fsetSU //. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply: disjoint_trans; rewrite subset_fsub. Qed. Lemma fdisjoint0X A : [disjoint fset0 & A]. Proof. by rewrite -fsetI_eq0 fset0I. Qed. Lemma fdisjointX0 A : [disjoint A & fset0]. Proof. by rewrite -fsetI_eq0 fsetI0. Qed. Lemma fdisjoint1X x A : [disjoint [fset x] & A] = (x \notin A). Proof. (* Goal: @eq (Equality.sort V) (@fun_of_fsfun K V default (of_ffun key) x) (@Option.default (Equality.sort V) (default x) (@Option.map (@fset_sub_type K S) (Equality.sort V) h (@insub (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) x))) *) rewrite -(@disjoint_fsub (x |` A)) //. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite (@eq_disjoint1 _ [` fset1U1 _ _]) ?inE =>// ?; rewrite !inE. Qed. Lemma fdisjointX1 x A : [disjoint A & [fset x]] = (x \notin A). Proof. by rewrite fdisjoint_sym fdisjoint1X. Qed. Lemma fdisjointUX A B C : [disjoint A `|` B & C] = [disjoint A & C]%fset && [disjoint B & C]%fset. Proof. by rewrite -!fsetI_eq0 fsetIUl fsetU_eq0. Qed. Lemma fdisjointXU A B C : [disjoint A & B `|` C] = [disjoint A & B]%fset && [disjoint A & C]%fset. Proof. by rewrite -!fsetI_eq0 fsetIUr fsetU_eq0. Qed. Lemma fdisjointU1X x A B : [disjoint x |` A & B]%fset = (x \notin B) && [disjoint A & B]%fset. Proof. by rewrite fdisjointUX fdisjoint1X. Qed. Lemma fsubK A B : A `<=` B -> [fsetval k in fsub B A] = A. Proof. (* Goal: forall _ : is_true (@fsubset K A B), @eq (@finset_of K (Phant (Choice.sort K))) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@subFin_sort K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subfinType K B))) K (fun k : Choice.sort (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@subFin_sort K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subfinType K B))) => @val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@subFin_sort K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subfinType K B)) k) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@subFin_sort K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subfinType K B)))) (predPredType (Finite.sort (@fset_sub_finType K B))) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@subFin_sort K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subfinType K B)))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subfinType K B))) (@SetDef.pred_of_set (@fset_sub_finType K B) (fsub B A)))) (Phantom (mem_pred (Finite.sort (@fset_sub_finType K B))) (@mem (Finite.sort (@fset_sub_finType K B)) (predPredType (Finite.sort (@fset_sub_finType K B))) (@SetDef.pred_of_set (@fset_sub_finType K B) (fsub B A))))) A *) move=> AsubB; apply/fsetP => k /=; symmetry. (* Goal: Bool.reflect (@ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x1) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Equality.sort (Choice.eqType K)) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) a)) (@mem (Choice.sort K) (finSetPredType K) S))))) (fsinjectiveb f) *) have [kB|kNB] := (boolP (k \in B)). (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite in_fset_valT /= inE. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite in_fset_valF //; apply: contraNF kNB; apply/fsubsetP. Qed. Lemma FSetK A (X : {set A}) : fsub A [fsetval k in X] = X. Proof. by apply/setP => x; rewrite !inE. Qed. End Theory. Hint Resolve fsubset_refl. Hint Resolve fsubset_trans. Hint Resolve fproper_irrefl. Hint Resolve fsub0set. Module Import FSetInE. Definition inE := (inE, in_fsetE). End FSetInE. Section Card. (* Lemma card_finset (T : finType) (P : pred T) : #|` [fset x in P] | = #|P|. *) (* Proof. *) (* rewrite cardfE cardE; apply/eqP. *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* rewrite -uniq_size_uniq ?fset_uniq ?enum_uniq // => x. *) (* by rewrite !inE mem_enum. *) (* Qed. *) End Card. Section Enum. Lemma enum_fset0 (T : choiceType) : enum [finType of fset0] = [::] :> seq (@fset0 T). Proof. by rewrite enumT unlock. Qed. Lemma enum_fset1 (T : choiceType) (x : T) : enum [finType of [fset x]] = [:: [`fset11 x]]. Proof. (* Goal: @eq (@finset_of V (Phant (Choice.sort V))) (codomf (@restrictf K (Choice.sort V) f A)) (@Imfset.imfset imfset_key (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) V (fun k : Choice.sort (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) => @FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) (@mem_fin (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (simplPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@subfinset_finpred (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) (@mem_fin (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (predPredType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType)) (@fin_finpred (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (pred_finpredType (@fset_sub_finType K (@domf K (Choice.sort V) f))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType) (pred_of_argType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType))))) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => @in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@fset_sub_subType K (@domf K (Choice.sort V) f)) k) (@mem (Choice.sort K) (finSetPredType K) A)))) (Phantom (mem_pred (@fset_sub_type K (@domf K (Choice.sort V) f))) (@mem (@fset_sub_type K (@domf K (Choice.sort V) f)) (simplPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@SimplPred (@fset_sub_type K (@domf K (Choice.sort V) f)) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => andb (@in_mem (@fset_sub_type K (@domf K (Choice.sort V) f)) k (@mem (@fset_sub_type K (@domf K (Choice.sort V) f)) (predPredType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType)) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType) (pred_of_argType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType))))) (@in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@fset_sub_subType K (@domf K (Choice.sort V) f)) k) (@mem (Choice.sort K) (finSetPredType K) A))))))) *) apply/perm_eq_small=> //; apply/uniq_perm_eq => //. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply/enum_uniq. (* Goal: @eq (Equality.sort V) (@Option.default (Equality.sort V) (default x) (@fnd K (Equality.sort V) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) (@FunFinfun.finfun (@fset_sub_finType K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a))))))))) (Equality.sort V) (fun a : @fset_sub_type K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) => h (@fincl K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (@fsval K S) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun x : @fset_sub_type K S => negb (@eq_op V (h x) (default (@fsval K S x)))))))) S (@fset_sub_val imfset_key K S (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0))))))) a))) x)) (default x) *) (* Goal: @eq (Equality.sort V) (@Option.default (Equality.sort V) (default (@fsval K S u)) (@fnd K (Equality.sort V) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) (@FunFinfun.finfun (@fset_sub_finType K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a))))))))) (Equality.sort V) (fun a : @fset_sub_type K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) => h (@fincl K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (@fsval K S) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun x : @fset_sub_type K S => negb (@eq_op V (h x) (default (@fsval K S x)))))))) S (@fset_sub_val imfset_key K S (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0))))))) a))) (@fsval K S u))) (h u) *) case=> [y hy]; rewrite mem_seq1 mem_enum /in_mem /=. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite eqE /=; rewrite in_fset1 in hy. Qed. End Enum. Section ImfsetTh. Variables (key : unit) (K V : choiceType). Implicit Types (f : K -> V) (g : V -> K) (A V : {fset K}). Lemma imfset_id (A : {fset K}) : id @` A = A. Proof. by apply/fsetP=> a; rewrite in_fset. Qed. Lemma imfset_comp f g (p : finmempred _) : imfset key (g \o f) p = g @` (imfset key f p). Proof. (* Goal: @eq (@finset_of V (Phant (Choice.sort V))) (codomf (@restrictf K (Choice.sort V) f A)) (@Imfset.imfset imfset_key (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) V (fun k : Choice.sort (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) => @FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) (@mem_fin (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (simplPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@subfinset_finpred (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) (@mem_fin (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (predPredType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType)) (@fin_finpred (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (pred_finpredType (@fset_sub_finType K (@domf K (Choice.sort V) f))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType) (pred_of_argType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType))))) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => @in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@fset_sub_subType K (@domf K (Choice.sort V) f)) k) (@mem (Choice.sort K) (finSetPredType K) A)))) (Phantom (mem_pred (@fset_sub_type K (@domf K (Choice.sort V) f))) (@mem (@fset_sub_type K (@domf K (Choice.sort V) f)) (simplPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@SimplPred (@fset_sub_type K (@domf K (Choice.sort V) f)) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => andb (@in_mem (@fset_sub_type K (@domf K (Choice.sort V) f)) k (@mem (@fset_sub_type K (@domf K (Choice.sort V) f)) (predPredType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType)) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType) (pred_of_argType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType))))) (@in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@fset_sub_subType K (@domf K (Choice.sort V) f)) k) (@mem (Choice.sort K) (finSetPredType K) A))))))) *) apply/fsetP=> a; apply/imfsetP/imfsetP=> [[/= x xA ->]|]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by exists (f x); rewrite // in_imfset. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> [/= x /imfsetP [/= y yA ->] ->]; exists y. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma subset_imfset f (p q : finmempred _) : {subset p <= q} -> imfset key f p `<=` imfset key f q. Proof. (* Goal: forall (_ : is_true (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f)))) (_ : is_true (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f')))) (_ : @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (@setf K V f k v) (@setf K V f' k v)), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f f' *) move=> subPQ; apply/fsubsetP=> x /imfsetP [y /= yA ->]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite in_imfset //= [in_mem _ _]subPQ. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma eq_imfset (f f' : K -> V) (p q : finmempred _): (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) f =1 f' -> (forall x, in_mem x p = in_mem x q) -> imfset key f p = imfset key f' q. Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) move=> eq_f eqP; apply/fsetP => x; apply/imfsetP/imfsetP => /= [] [k Pk ->]; by exists k => //=; rewrite ?eq_f ?eqP in Pk *. Qed. End ImfsetTh. Section PowerSetTheory. Variable (K : choiceType). Fact fpowerset_key : unit. Proof. exact: tt. Qed. Definition fpowerset (A : {fset K}) : {fset {fset K}} := [fset[fpowerset_key] [fsetval y in Y : {set A}] | Y in powerset [set: A]]. Lemma fpowersetE A B : (B \in fpowerset A) = (B `<=` A). Proof. (* Goal: Bool.reflect (@ex (Choice.sort K) (fun x : Choice.sort K => @eq (option (Choice.sort V)) (@fnd K (Choice.sort V) (@domf K (Choice.sort V) f) (@ffun_of_fmap K (Choice.sort V) f) x) (@Some (Choice.sort V) v))) (@in_mem (Choice.sort V) v (@mem (Choice.sort V) (finSetPredType V) (codomf f))) *) apply/imfsetP/fsubsetP => /= [[Z _ -> y /in_fset_valP [] //]|/fsubsetP subYX]. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) exists (fsub _ B); last by rewrite fsubK. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite powersetE /= -fsubT subset_fsub ?fsubset_refl. Qed. Lemma fpowersetCE (X A B : {fset K}) : (A \in fpowerset (X `\` B)) = (A `<=` X) && [disjoint A & B]%fset. Proof. by rewrite fpowersetE fsubsetD. Qed. Lemma fpowersetS A B : (fpowerset A `<=` fpowerset B) = (A `<=` B). Proof. (* Goal: Bool.reflect (@ex (Choice.sort K) (fun x : Choice.sort K => @eq (option (Choice.sort V)) (@fnd K (Choice.sort V) (@domf K (Choice.sort V) f) (@ffun_of_fmap K (Choice.sort V) f) x) (@Some (Choice.sort V) v))) (@in_mem (Choice.sort V) v (@mem (Choice.sort V) (finSetPredType V) (codomf f))) *) apply/fsubsetP/fsubsetP => [sub_pA_pB a|subAB X]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by have := sub_pA_pB [fset a]; rewrite !fpowersetE !fsub1set. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite !fpowersetE => /fsubsetP XA; apply/fsubsetP => x /XA /subAB. Qed. Lemma fpowerset0 : fpowerset fset0 = [fset fset0]. Proof. by apply/fsetP=> X; rewrite inE fpowersetE fsubset0. Qed. Lemma fpowerset1 (x : K) : fpowerset [fset x] = [fset fset0; [fset x]]. Proof. by apply/fsetP => X; rewrite !inE fpowersetE fsubset1 orbC. Qed. Lemma fpowersetI A B : fpowerset (A `&` B) = fpowerset A `&` fpowerset B. Proof. by apply/fsetP=> X; rewrite inE !fpowersetE fsubsetI. Qed. Lemma card_fpowerset (A : {fset K}) : #|` fpowerset A| = 2 ^ #|` A|. Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite !card_imfset; first by rewrite -cardE card_powerset cardsE cardfE. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> X Y /fsetP eqXY; apply/setP => x; have := eqXY (val x); rewrite !inE. Qed. End PowerSetTheory. Section BigFSet. Variable (R : Type) (idx : R) (op : Monoid.law idx). Variable (I : choiceType). (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma big_seq_fsetE (X : {fset I}) (P : pred I) (F : I -> R) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(i <- X | P i) F i = \big[op/idx]_(x : X | P (val x)) F (val x). Proof. by rewrite enum_fsetE big_map enumT. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma big1_fset (X : {fset I}) (P : pred I) (F : I -> R) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (forall i, i \in X -> P i -> F i = idx) -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(i <- X | P i) F i = idx. Proof. by move=> Fid; rewrite big_seq_fsetE big1//= => -[]. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma big_fset0 (P : pred fset0) (F : @fset0 I -> R) : \big[op/idx]_(i : fset0 | P i) F i = idx. Proof. by rewrite /index_enum -enumT /= enum_fset0 big_nil. Qed. Lemma big_seq_fset0 (F : I -> R): \big[op/idx]_(i <- fset0) F i = idx. Proof. by rewrite big_seq_fsetE big_fset0. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma big_fset1 (a : I) (F : [fset a] -> R) : \big[op/idx]_(i : [fset a]) F i = F [` fset11 a]. Proof. by rewrite /index_enum -enumT enum_fset1 big_seq1. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma big_seq_fset1 (a : I) (F : I -> R) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(i <- [fset a]) F i = F a. Proof. by rewrite big_seq_fsetE big_fset1. Qed. End BigFSet. Notation eq_big_imfset := (eq_big_perm _ (enum_imfset _ _)). Section BigComFSet. Variable (R : Type) (idx : R) (op : Monoid.com_law idx). Variable (I J : choiceType). (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma big_fset (X : finmempred _) (P : pred I) (F : I -> R) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(i <- [fset i in X | P i]) F i = \big[op/idx]_(i <- enum_finmem X | P i) F i. Proof. by rewrite !eq_big_imfset//= !big_map !big_filter_cond big_andbC. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma big_fset_condE (X : {fset I}) (P : pred I) (F : I -> R) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(i <- X | P i) F i = \big[op/idx]_(i <- [fset i in X | P i]) F i. Proof. by rewrite big_fset. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma eq_fbig_cond (A B : {fset I}) (P Q : pred I) (F G : I -> R) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) [fset x in A | P x] =i [fset x in B | Q x] -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (forall x, x \in A -> P x -> F x = G x) -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(i <- A | P i) F i = \big[op/idx]_(i <- B | Q i) G i. Proof. (* Goal: forall (_ : is_true (@fdisjoint K (@domf K V f) (@domf K V h))) (_ : is_true (@fdisjoint K (@domf K V g) (@domf K V h))) (_ : @eq (finMap K V) (catf h f) (catf h g)), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f g *) move=> /fsetP eqABPQ FG; rewrite big_fset_condE [in RHS]big_fset_condE -eqABPQ. (* Goal: is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) a)) (@mem (Choice.sort K) (finSetPredType K) (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f))) *) (* Goal: @ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x1) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Choice.sort K) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K S a)) (@mem (Choice.sort K) (finSetPredType K) S)))) *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite big_seq_cond [in RHS]big_seq_cond; apply: eq_bigr => i. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite in_fset !inE => /andP[/andP[??] _]; apply: FG. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma eq_fbig (A B : {fset I}) (F G : I -> R) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) A =i B -> (forall x, x \in A -> F x = G x) -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(i <- A) F i = \big[op/idx]_(i <- B) G i. Proof. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> AB FG; apply: eq_fbig_cond => x; rewrite ?inE/= -?AB// => /FG. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma eq_fbigl_cond (A B : {fset I}) (P Q : pred I) (F : I -> R) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) [fset x in A | P x] =i [fset x in B | Q x] -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(i <- A | P i) F i = \big[op/idx]_(i <- B | Q i) F i. Proof. by move=> AB; apply: eq_fbig_cond. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma eq_fbigl (A B : {fset I}) (F : I -> R) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) A =i B -> \big[op/idx]_(i <- A) F i = \big[op/idx]_(i <- B) F i. Proof. by move=> AB; apply: eq_fbig. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma eq_fbigr (A : {fset I}) (P : pred I) (F G : I -> R) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (forall x, x \in A -> P x -> F x = G x) -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(i <- A | P i) F i = \big[op/idx]_(i <- A | P i) G i. Proof. by apply: eq_fbig_cond. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma big_fsetID (B : pred I) (A : {fset I}) (F : I -> R) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(i <- A) F i = (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) op (\big[op/idx]_(i <- [fset x in A | B x]) F i) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (\big[op/idx]_(i <- [fset x in A | ~~ B x]) F i). Proof. by rewrite !big_fset; apply: bigID. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma big_fsetIDcond (B : pred I) (A : {fset I}) (P : pred I) (F : I -> R) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(i <- A | P i) F i = (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) op (\big[op/idx]_(i <- [fset x in A | B x] | P i) F i) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (\big[op/idx]_(i <- [fset x in A | ~~ B x] | P i) F i). Proof. by rewrite big_mkcond (big_fsetID B) // -!big_mkcond. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma big_fsetD1 (a : I) (A : {fset I}) (F : I -> R) : a \in A -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(i <- A) F i = op (F a) (\big[op/idx]_(i <- A `\ a) F i). Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) move=> aA; rewrite (big_fsetID (mem [fset a])); congr (op _ _); last first. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply: eq_fbigl=> i; rewrite !inE/= andbC. (* Goal: @eq (Equality.sort V) (@fun_of_fsfun K V default (of_ffun key) x) (@Option.default (Equality.sort V) (default x) (@Option.map (@fset_sub_type K S) (Equality.sort V) h (@insub (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) x))) *) rewrite (_ : [fset _ | _ in _ & _] = [fset a]) ?big_seq_fset1//=. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply/fsetP=> i; rewrite !inE /= andbC; case: eqP => //->. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma big_setU1 (a : I) (A : {fset I}) (F : I -> R) : a \notin A -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(i <- (a |` A)) F i = op (F a) (\big[op/idx]_(i <- A) F i). Proof. (* Goal: forall (_ : is_true (@fdisjoint K (@domf K V f) (@domf K V h))) (_ : is_true (@fdisjoint K (@domf K V g) (@domf K V h))) (_ : @eq (finMap K V) (catf h f) (catf h g)), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f g *) move=> aNA; rewrite eq_big_imfset//= big_map undup_id ?big_cat ?big_seq_fset1//. (* Goal: @eq (@finset_of V (Phant (Choice.sort V))) (codomf (@setf K (Choice.sort V) f k v)) (@fsetU V (@fset1 V v) (codomf (@restrictf K (Choice.sort V) f (@fsetD K (@domf K (Choice.sort V) f) (@fset1 K k))))) *) rewrite cat_uniq ?fset_uniq andbT//=; apply/hasPn=> /= x xA; rewrite !inE/=. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply: contraNneq aNA => <-. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma big_fset_incl (A : {fset I}) B F : A `<=` B -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (forall x, x \in B -> x \notin A -> F x = idx) -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(x <- A) F x = \big[op/idx]_(x <- B) F x. Proof. (* Goal: forall (_ : is_true (@fdisjoint K (@domf K V f) (@domf K V h))) (_ : is_true (@fdisjoint K (@domf K V g) (@domf K V h))) (_ : @eq (finMap K V) (catf h f) (catf h g)), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f g *) move=> subAB Fid; rewrite [in RHS](big_fsetID (mem A)) /=. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite [X in op _ X]big1_fset ?Monoid.mulm1; last first. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> i; rewrite !inE /= => /andP[iB iNA _]; apply: Fid. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply: eq_fbigl => i; rewrite !inE /= -(@in_fsetI _ B A) (fsetIidPr _). Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma big_imfset key (h : I -> J) (A : finmempred _) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (G : J -> R) : {in A &, injective h} -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(j <- imfset key h A) G j = (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(i <- enum_finmem A) G (h i). Proof. by move=> h_inj; rewrite eq_big_imfset// big_map. Qed. End BigComFSet. Arguments big_fsetD1 {R idx op I} a [A F]. Notation eq_big_imfset2 := (eq_big_perm _ (enum_imfset2 _ _)). Section BigComImfset2. Variables (R : Type) (idx : R) (op : Monoid.com_law idx) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (I : choiceType) (J : I -> choiceType) (K : choiceType). Lemma big_imfset2 key (A : finmempred I) (B : forall i, finmempred (J i)) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (h : forall i : I, J i -> K) (F : K -> R) : {in [pred t : sigT J | A (tag t) & B _ (tagged t)] &, (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) injective (fun t => h (tag t) (tagged t))} -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(k <- imfset2 key h A B) F k = (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(i <- enum_finmem A) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(j <- enum_finmem (B i)) F (h i j). Proof. (* Goal: forall (_ : is_true (@fdisjoint K (@domf K V f) (@domf K V h))) (_ : is_true (@fdisjoint K (@domf K V g) (@domf K V h))) (_ : @eq (finMap K V) (catf h f) (catf h g)), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f g *) move=> h_inj; rewrite eq_big_imfset2 //. (* Goal: @eq (Equality.sort V) (@fun_of_fsfun K V default (of_ffun key) x) (@Option.default (Equality.sort V) (default x) (@Option.map (@fset_sub_type K S) (Equality.sort V) h (@insub (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) x))) *) rewrite (allsigs_comp (fun _ j => Tagged _ j) (fun t => h (tag t) (tagged t))). (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite big_map big_allsigs /=. Qed. End BigComImfset2. Section BigFsetDep. Variables (R : Type) (idx : R) (op : Monoid.com_law idx) (I : choiceType) (J : choiceType) (K : choiceType). (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma pair_big_dep_cond (A : {fset I}) (B : I -> {fset J}) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (P : pred I) (Q : I -> pred J) (F : I -> J -> R) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(i <- A | P i) \big[op/idx]_(j <- B i | Q i j) F i j = (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(p <- [fset ((i, j) : I * J) | i in [fset i in A | P i], j in [fset j in B i | Q i j]]) F p.1 p.2. Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite big_imfset2 //=; last by move=> [??] [??] _ _ /= [-> ->]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite big_fset /=; apply: eq_bigr => i _; rewrite big_fset. Qed. End BigFsetDep. Section BigComImfset. Variables (R : Type) (idx : R) (op : Monoid.com_law idx) (I : choiceType) (J : choiceType) (K : choiceType). (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma partition_big_imfset (h : I -> J) (A : {fset I}) (F : I -> R) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(i <- A) F i = (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \big[op/idx]_(j <- [fset h x | x in A]) \big[op/idx]_(i <- A | h i == j) F i. Proof. transitivity (\big[op/idx]_(i <- [fset (h i, i) | i in A]) F i.2). (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite eq_big_imfset ?big_map// => i j ? ? []. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) transitivity (\big[op/idx]_(i <- [fset ij | ij in (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) [seq (i1, i2) | i1 <- [fset h x | x in A], i2 <- A]]) if h i.2 == i.1 then F i.2 else idx). (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite -big_mkcond; apply: eq_fbigl_cond; move=> x; rewrite !inE/= andbT. (* Goal: Bool.reflect (@ex (Choice.sort K) (fun x : Choice.sort K => @eq (option (Choice.sort V)) (@fnd K (Choice.sort V) (@domf K (Choice.sort V) f) (@ffun_of_fmap K (Choice.sort V) f) x) (@Some (Choice.sort V) v))) (@in_mem (Choice.sort V) v (@mem (Choice.sort V) (finSetPredType V) (codomf f))) *) apply/imfsetP/idP => [[i /= iA -> /=]|]. rewrite eqxx andbT; apply/allpairsP; exists (h i, i) => /=. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite in_imfset. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> /andP[/allpairsP[[/= j i] [/imfsetP[/=a aA ->] iA ->/= /eqP<-]]]; exists i. (* Goal: @eq (Equality.sort V) (@fun_of_fsfun K V default (of_ffun key) x) (@Option.default (Equality.sort V) (default x) (@Option.map (@fset_sub_type K S) (Equality.sort V) h (@insub (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) x))) *) rewrite eq_big_imfset //= big_map undup_id. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite big_allpairs; apply: eq_bigr => i /= _; rewrite -big_mkcond. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite allpairs_uniq => //= -[j0 i0] [j1 i1] /=. Qed. End BigComImfset. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Notation "\bigcup_ ( i <- r | P ) F" := (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (\big[@fsetU _/fset0]_(i <- r | P%fset) F%fset) : fset_scope. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Notation "\bigcup_ ( i <- r ) F" := (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (\big[@fsetU _/fset0]_(i <- r) F%fset) : fset_scope. Notation "\bigcup_ ( i | P ) F" := (\big[@fsetU _/fset0]_(i | P) F%fset) : fset_scope. Notation "\bigcup_ ( i 'in' A | P ) F" := (\big[@fsetU _/fset0]_(i in A | P) F%fset) : fset_scope. Notation "\bigcup_ ( i 'in' A ) F" := (\big[@fsetU _/fset0]_(i in A) F%fset) : fset_scope. Section FSetMonoids. Import Monoid. Variable (T : choiceType). Canonical fsetU_monoid := Law (@fsetUA T) (@fset0U T) (@fsetU0 T). Canonical fsetU_comoid := ComLaw (@fsetUC T). End FSetMonoids. Section BigFOpsSeq. Variables (T : choiceType) (I : eqType) (r : seq I). (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Implicit Types (P : pred I) (F : I -> {fset T}). Lemma bigfcup_undup P F : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) \bigcup_(i <- undup r | P i) F i = \bigcup_(i <- r | P i) F i. Proof. by rewrite big_undup => //= A; rewrite fsetUid. Qed. Lemma bigfcup_sup j P F : j \in r -> P j -> F j `<=` \bigcup_(i <- r | P i) F i. Proof. (* Goal: forall (_ : is_true (@fdisjoint K (@domf K V f) (@domf K V h))) (_ : is_true (@fdisjoint K (@domf K V g) (@domf K V h))) (_ : @eq (finMap K V) (catf h f) (catf h g)), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f g *) move=> jr Pj; rewrite -bigfcup_undup big_mkcond. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite (bigD1_seq j) ?mem_undup ?undup_uniq ?Pj //= fsubsetUl. Qed. Lemma bigfcupP x F P : reflect (exists2 i : I, (i \in r) && P i & x \in F i) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (x \in \bigcup_(i <- r | P i) F i). Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) apply: (iffP idP) => [|[i /andP[ri Pi]]]; last first. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply: fsubsetP x; rewrite bigfcup_sup. rewrite big_seq_cond; elim/big_rec: _ => [|i _ /andP[ri Pi] _ /fsetUP[|//]]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite in_fset0. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by exists i; rewrite ?ri. Qed. Lemma bigfcupsP (U : {fset T}) P F : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) reflect (forall i : I, i \in r -> P i -> F i `<=` U) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (\bigcup_(i <- r | P i) F i `<=` U). Proof. (* Goal: Bool.reflect (@ex (Choice.sort K) (fun x : Choice.sort K => @eq (option (Choice.sort V)) (@fnd K (Choice.sort V) (@domf K (Choice.sort V) f) (@ffun_of_fmap K (Choice.sort V) f) x) (@Some (Choice.sort V) v))) (@in_mem (Choice.sort V) v (@mem (Choice.sort V) (finSetPredType V) (codomf f))) *) apply: (iffP idP) => [sFU i ri Pi| sFU]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply: fsubset_trans sFU; apply: bigfcup_sup. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply/fsubsetP=> x /bigfcupP[i /andP[ri Pi]]; apply/fsubsetP/sFU. Qed. End BigFOpsSeq. (* ** Induction Principles *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma finSet_rect (T : choiceType) (P : {fset T} -> Type) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) P fset0 -> (forall X, (forall Y, Y `<` X -> P Y) -> P X) -> forall X, P X. Proof. (* Goal: forall (_ : P (@fset0 T)) (_ : forall (X : @finset_of T (Phant (Choice.sort T))) (_ : forall (Y : @finset_of T (Phant (Choice.sort T))) (_ : is_true (@fproper T Y X)), P Y), P X) (X : @finset_of T (Phant (Choice.sort T))), P X *) move=> P0 Psub X; move: (leqnn #|` X|); move: (X in Y in _ <= Y) => Y. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) elim: #|` _| X => [|n IHn] {Y} X; first by rewrite leqn0 cardfs_eq0 => /eqP->. (* Goal: forall _ : is_true (leq (@size (Choice.sort T) (@enum_fset T X)) (S n)), P X *) move=> Xleq; apply: Psub => Y XsubY; apply: IHn. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite -ltnS (leq_trans _ Xleq) // fproper_ltn_card. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma fset_bounded_coind (T : choiceType) (P : {fset T} -> Type) (U : {fset T}): (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (forall X, (forall Y, Y `<=` U -> X `<` Y -> P Y) -> P X) -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) forall X, X `<=` U -> P X. Proof. (* Goal: forall (_ : is_true (@fdisjoint K (@domf K V f) (@domf K V h))) (_ : is_true (@fdisjoint K (@domf K V g) (@domf K V h))) (_ : @eq (finMap K V) (catf h f) (catf h g)), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f g *) move=> Psuper X XsubU; rewrite -[X](fsetDK XsubU)//. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) have {XsubU}: (U `\` X) `<=` U by rewrite fsubsetDl. (* Goal: forall _ : is_true (@fsubset T (@fsetD T U X) U), P (@fsetD T U (@fsetD T U X)) *) elim: (_ `\` X) => {X} [|X IHX] XsubU. (* Goal: is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) a)) (@mem (Choice.sort K) (finSetPredType K) (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f))) *) (* Goal: @ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x1) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Choice.sort K) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K S a)) (@mem (Choice.sort K) (finSetPredType K) S)))) *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite fsetD0; apply: Psuper => Y /fsub_proper_trans UY/UY. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite fproperEneq eqxx. (* Goal: is_true (@fsubset K (@FinSupp.fs K V (fun a : Choice.sort K => default a) (@fsfun_of_ffun key K V S (fun a : @fset_sub_type K S => h a) (fun a : Choice.sort K => default a))) S) *) apply: Psuper => Y /fsetDK<-; rewrite fproperD2l ?fsubsetDl //. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> /IHX; apply; rewrite fsubsetDl. Qed. (** ** Fixpoints *) Lemma iter_fix T (f : T -> T) x n : f x = x -> iter n f x = x. Proof. by move=> fixf; elim: n => //= n ->. Qed. Section SetFixpoint. (** Least Fixpoints *) Section Least. Variables (T : finType) (F : {set T} -> {set T}). Hypothesis (F_mono : {homo F : X Y / X \subset Y}). Let n := #|T|. Notation iterF := (fun i => iter i F set0). Lemma set_iterF_sub i : iterF i \subset iterF i.+1. Proof. by elim: i => [| i IHi]; rewrite /= ?sub0set ?F_mono. Qed. Lemma set_iterF_mono : {homo iterF : i j / i <= j >-> i \subset j}. Proof. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply: homo_leq => //[???|]; [apply: subset_trans|apply: set_iterF_sub]. Qed. Definition set_fix := iterF n. Lemma set_fixK : F set_fix = set_fix. Proof. suff /'exists_eqP[x /= e]: [exists k : 'I_n.+1, iterF k == iterF k.+1]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite /set_fix -(subnK (leq_ord x)) iter_add iter_fix. (* Goal: is_true (negb (@eq_op (fset_eqType K) (@fsetD K C B) (@fsetD K C A))) *) apply: contraT; rewrite negb_exists => /forallP /(_ (Ordinal _)) /= neq_iter. suff iter_big k : k <= n.+1 -> k <= #|iter k F set0|. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by have := iter_big _ (leqnn _); rewrite ltnNge max_card. elim: k => [|k IHk] k_lt //=; apply: (leq_ltn_trans (IHk (ltnW k_lt))). (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite proper_card// properEneq// set_iterF_sub neq_iter. Qed. Hint Resolve set_fixK. Lemma set_fixKn k : iter k F set_fix = set_fix. Proof. by rewrite iter_fix. Qed. Lemma iter_sub_fix k : iterF k \subset set_fix. Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) have [/set_iterF_mono//|/ltnW/subnK<-] := leqP k n; by rewrite iter_add set_fixKn. Qed. Lemma fix_order_proof x : x \in set_fix -> exists n, x \in iterF n. Proof. by move=> x_fix; exists n. Qed. Definition fix_order (x : T) := if (x \in set_fix) =P true isn't ReflectT x_fix then 0 else (ex_minn (fix_order_proof x_fix)). Lemma fix_order_le_max (x : T) : fix_order x <= n. Proof. (* Goal: @eq bool (@in_mem (Choice.sort V) x (@mem (Choice.sort V) (simplPredType (Choice.sort V)) (@SimplPred (Choice.sort V) (fun x : Choice.sort V => andb (@in_mem (Choice.sort V) x (@mem (Choice.sort V) (predPredType (Choice.sort V)) (fun x0 : Choice.sort V => @pred_of_eq_seq (Choice.eqType V) (@enum_fset V (codomf f)) x0))) (negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (@in_mem (Choice.sort K) (@fsval K (@domf K (Choice.sort V) f) k) (@mem (Choice.sort K) (finSetPredType K) (@fsetD K (@domf K (Choice.sort V) f) A))) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) x))) k))))))) (@in_mem (Choice.sort V) x (@mem (Choice.sort V) (simplPredType (Choice.sort V)) (@SimplPred (Choice.sort V) (fun x : Choice.sort V => andb (@in_mem (Choice.sort V) x (@mem (Choice.sort V) (predPredType (Choice.sort V)) (fun x0 : Choice.sort V => @pred_of_eq_seq (Choice.eqType V) (@enum_fset V (codomf f)) x0))) (negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (negb (@in_mem (Choice.sort K) (@fsval K (@domf K (Choice.sort V) f) k) (@mem (Choice.sort K) (finSetPredType K) A))) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) x))) k))))))) *) rewrite /fix_order; case: eqP => //= x_in. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by case: ex_minnP => //= ??; apply. Qed. Lemma in_iter_fix_orderE (x : T) : (x \in iterF (fix_order x)) = (x \in set_fix). Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite /fix_order; case: eqP; last by move=>/negP/negPf->; rewrite inE. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> x_in; case: ex_minnP => m ->; rewrite x_in. Qed. Lemma fix_order_gt0 (x : T) : (fix_order x > 0) = (x \in set_fix). Proof. (* Goal: @eq bool (@in_mem (Choice.sort V) x (@mem (Choice.sort V) (simplPredType (Choice.sort V)) (@SimplPred (Choice.sort V) (fun x : Choice.sort V => andb (@in_mem (Choice.sort V) x (@mem (Choice.sort V) (predPredType (Choice.sort V)) (fun x0 : Choice.sort V => @pred_of_eq_seq (Choice.eqType V) (@enum_fset V (codomf f)) x0))) (negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (@in_mem (Choice.sort K) (@fsval K (@domf K (Choice.sort V) f) k) (@mem (Choice.sort K) (finSetPredType K) (@fsetD K (@domf K (Choice.sort V) f) A))) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) x))) k))))))) (@in_mem (Choice.sort V) x (@mem (Choice.sort V) (simplPredType (Choice.sort V)) (@SimplPred (Choice.sort V) (fun x : Choice.sort V => andb (@in_mem (Choice.sort V) x (@mem (Choice.sort V) (predPredType (Choice.sort V)) (fun x0 : Choice.sort V => @pred_of_eq_seq (Choice.eqType V) (@enum_fset V (codomf f)) x0))) (negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (negb (@in_mem (Choice.sort K) (@fsval K (@domf K (Choice.sort V) f) k) (@mem (Choice.sort K) (finSetPredType K) A))) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) x))) k))))))) *) rewrite /fix_order; case: eqP => [x_in|/negP/negPf->//]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite x_in; case: ex_minnP => -[|m]; rewrite ?inE//= => _; apply. Qed. Lemma fix_order_eq0 (x : T) : (fix_order x == 0) = (x \notin set_fix). Proof. by rewrite -fix_order_gt0 -ltnNge ltnS leqn0. Qed. Lemma in_iter_fixE (x : T) k : (x \in iterF k) = (0 < fix_order x <= k). Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite /fix_order; case: eqP => //= [x_in|/negP xNin]; last first. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply: contraNF xNin; apply/subsetP/iter_sub_fix. (* Goal: @eq bool (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (@iter (@set_of T (Phant (Finite.sort T))) k F (@set0 T))))) (andb (leq (S O) (@ex_minn (fun n : nat => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (@iter (@set_of T (Phant (Finite.sort T))) n F (@set0 T))))) (@fix_order_proof x x_in))) (leq (@ex_minn (fun n : nat => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (@iter (@set_of T (Phant (Finite.sort T))) n F (@set0 T))))) (@fix_order_proof x x_in)) k)) *) case: ex_minnP => -[|m]; rewrite ?inE// => xm mP. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply/idP/idP=> [/mP//|lt_mk]; apply: subsetP xm; apply: set_iterF_mono. Qed. Lemma in_iter (x : T) k : x \in set_fix -> fix_order x <= k -> x \in iterF k. Proof. by move=> x_in xk; rewrite in_iter_fixE fix_order_gt0 x_in xk. Qed. Lemma notin_iter (x : T) k : k < fix_order x -> x \notin iterF k. Proof. by move=> k_le; rewrite in_iter_fixE negb_and orbC -ltnNge k_le. Qed. Lemma fix_order_small x k : x \in iterF k -> fix_order x <= k. Proof. by rewrite in_iter_fixE => /andP[]. Qed. Lemma fix_order_big x k : x \in set_fix -> x \notin iterF k -> fix_order x > k. Proof. by move=> x_in; rewrite in_iter_fixE fix_order_gt0 x_in /= -ltnNge. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma le_fix_order (x y : T) : y \in iterF (fix_order x) -> fix_order y <= fix_order x. Proof. exact: fix_order_small. Qed. End Least. Section Greatest. Variables (T : finType) (F : {set T} -> {set T}). Hypothesis (F_mono : {homo F : X Y / X \subset Y}). Notation n := #|T|. Definition funsetC X := ~: (F (~: X)). Notation G := funsetC. Lemma funsetC_mono : {homo G : X Y / X \subset Y}. Proof. by move=> *; rewrite subCset setCK F_mono// subCset setCK. Qed. Hint Resolve funsetC_mono. Definition set_cofix := ~: set_fix G. Lemma set_cofixK : F set_cofix = set_cofix. Proof. by rewrite /set_cofix -[in RHS]set_fixK ?setCK. Qed. End Greatest. End SetFixpoint. Section Fixpoints. Variables (T : choiceType) (U : {fset T}). (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Definition sub_fun (F : {fset T} -> {fset T}) (X : {set U}) : {set U} := fsub U (F [fsetval x in X]). Lemma fset_fsub X : X `<=` U -> [fsetval x in fsub U X] = X. Proof. (* Goal: forall _ : is_true (leq (@size (Choice.sort T) (@enum_fset T X)) (S n)), P X *) move=> XU; apply/fsetP => x; apply/in_fset_valP/idP. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> [xU/=]; rewrite in_fsub. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> xX; exists (fsubsetP XU x xX); rewrite /= in_fsub. Qed. Variable (F : {fset T} -> {fset T}). Hypothesis (F_mono : {homo F : X Y / X `<=` Y}) (F_bound : {homo F : X / X `<=` U}). Notation Fsub := (sub_fun F). Notation iterF := (fun i => iter i F fset0). Lemma Fsub_mono : {homo Fsub : X Y / X \subset Y}. Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) move=> X Y subXY; apply: subset_fsub; last by apply/F_bound/fset_sub_val. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply/F_mono/subset_imfset/subsetP. Qed. Hint Resolve Fsub_mono. Definition fset_fix := [fsetval x in set_fix Fsub]. Lemma fset_iterFE i : iterF i = [fsetval x in iter i Fsub set0]. Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) elim: i => [|i /= -> /=]; last by rewrite fset_fsub // F_bound//= fset_sub_val. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply/fsetP=> x; rewrite in_fset_val /=; case: insub=> //= ?; rewrite !inE. Qed. Lemma fset_iterF_sub i : iterF i `<=` U. Proof. by rewrite /= fset_iterFE fset_sub_val. Qed. Lemma fset_fixK : F fset_fix = fset_fix. Proof. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite /fset_fix -[in RHS]set_fixK// fset_fsub// F_bound//= fset_sub_val. Qed. Hint Resolve fset_fixK. Lemma fset_fixKn k : iter k F fset_fix = fset_fix. Proof. by rewrite iter_fix. Qed. Lemma iter_sub_ffix k : iterF k `<=` fset_fix. Proof. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite /fset_fix !fset_iterFE; apply/subset_imfset/subsetP/iter_sub_fix. Qed. Definition ffix_order (x : T) := if x \in U =P true is ReflectT xU then fix_order Fsub [` xU] else 0. Lemma ffix_order_le_max (x : T) : ffix_order x <= #|` U|. Proof. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite /ffix_order; case: eqP => //= x_in; rewrite cardfE fix_order_le_max. Qed. Lemma in_iter_ffix_orderE (x : T) : (x \in iterF (ffix_order x)) = (x \in fset_fix). Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite /ffix_order; case: eqP => [xU|/negP xNU]; last first. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite !inE /fset_fix in_fset_valF. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite fset_iterFE !in_fset_valT /= in_iter_fix_orderE. Qed. Lemma ffix_order_gt0 (x : T) : (ffix_order x > 0) = (x \in fset_fix). Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite /ffix_order; case: eqP => [xU|/negP xNU]; last by rewrite in_fset_valF. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite fix_order_gt0 in_fset_valT. Qed. Lemma ffix_order_eq0 (x : T) : (ffix_order x == 0) = (x \notin fset_fix). Proof. by rewrite -ffix_order_gt0 -ltnNge ltnS leqn0. Qed. Lemma in_iter_ffixE (x : T) k : (x \in iterF k) = (0 < ffix_order x <= k). Proof. rewrite /ffix_order fset_iterFE; case: eqP => [xU|/negP xNU]; by [rewrite in_fset_valF|rewrite in_fset_valT /= in_iter_fixE]. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma in_iter_ffix (x : T) k : x \in fset_fix -> ffix_order x <= k -> x \in iterF k. Proof. by move=> x_in xk; rewrite in_iter_ffixE ffix_order_gt0 x_in xk. Qed. Lemma notin_iter_ffix (x : T) k : k < ffix_order x -> x \notin iterF k. Proof. by move=> k_le; rewrite in_iter_ffixE negb_and orbC -ltnNge k_le. Qed. Lemma ffix_order_small x k : x \in iterF k -> ffix_order x <= k. Proof. by rewrite in_iter_ffixE => /andP[]. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma ffix_order_big x k : x \in fset_fix -> x \notin iterF k -> ffix_order x > k. Proof. by move=> x_in; rewrite in_iter_ffixE ffix_order_gt0 x_in -ltnNge. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma le_ffix_order (x y : T) : y \in iterF (ffix_order x) -> ffix_order y <= ffix_order x. Proof. exact: ffix_order_small. Qed. End Fixpoints. (* apply/apply/fsetP=> x /=. *) (* apply//in_fset_valP. *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* rewrite -IHi /=. *) (* rewrite in_imfset. *) Section DefMap. Variables (K : choiceType) (V : Type). Record finMap : Type := FinMap { domf : {fset K}; (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) ffun_of_fmap :> {ffun domf -> V} }. Definition finmap_of (_ : phant (K -> V)) := finMap. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Let T_ (domf : {fset K}) := {ffun domf -> V}. Local Notation finMap' := {domf : _ & T_ domf}. End DefMap. Notation "{fmap T }" := (@finmap_of _ _ (Phant T)) : type_scope. Definition pred_of_finmap (K : choiceType) (V : Type) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (f : {fmap K -> V}) : pred K := mem (domf f). Canonical finMapPredType (K : choiceType) (V : Type) := Eval hnf in mkPredType (@pred_of_finmap K V). Delimit Scope fmap_scope with fmap. Local Open Scope fmap_scope. Notation "f .[ kf ]" := (f [` kf]) : fmap_scope. Arguments ffun_of_fmap : simpl never. Notation "[ 'fmap' x : aT => F ]" := (FinMap [ffun x : aT => F]) (at level 0, x ident, only parsing) : fun_scope. Notation "[ 'fmap' : aT => F ]" := (FinMap [ffun : aT => F]) (at level 0, only parsing) : fun_scope. Notation "[ 'fmap' x => F ]" := [fmap x : _ => F] (at level 0, x ident, format "[ 'fmap' x => F ]") : fun_scope. Notation "[ 'fmap' => F ]" := [fmap: _ => F] (at level 0, format "[ 'fmap' => F ]") : fun_scope. Canonical finmap_of_finfun (K : choiceType) V (A : {fset K}) (f : {ffun A -> V}) := FinMap f. Arguments finmap_of_finfun /. Arguments ffun_of_fmap : simpl nomatch. Section OpsMap. Variables (K : choiceType). Definition fmap0 V : {fmap K -> V} := FinMap (ffun0 _ (cardfT0 K)). (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Definition fnd V (A : {fset K}) (f : {ffun A -> V}) (k : K) := omap f (insub k). (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Inductive fnd_spec V (A : {fset K}) (f : {ffun A -> V}) k : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) bool -> option A -> option V -> Type := | FndIn (kf : k \in A) : fnd_spec f k true (some [` kf]) (some (f.[kf])) | FndOut (kNf : k \notin A) : fnd_spec f k false None None. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Definition setf V (f : {fmap K -> V}) (k0 : K) (v0 : V) : {fmap K -> V} := [fmap k : k0 |` domf f => if val k == k0 then v0 else odflt v0 (fnd f (val k))]. End OpsMap. Prenex Implicits fnd setf. Arguments fmap0 {K V}. Arguments setf : simpl never. Arguments fnd : simpl never. Notation "[ 'fmap' 'of' T ]" := (fmap0 : {fmap T}) (only parsing) : fmap_scope. Notation "[fmap]" := fmap0 : fmap_scope. Notation "x .[ k <- v ]" := (setf x k v) : fmap_scope. Notation "f .[? k ]" := (fnd f k) : fmap_scope. Section FinMapCanonicals. Variable K : choiceType. Let finMap_on (V : Type) (d : {fset K}) := {ffun d -> V}. Local Notation finMap_ V := {d : _ & finMap_on V d}. Definition finMap_encode V (f : {fmap K -> V}) := Tagged (finMap_on V) (ffun_of_fmap f). Definition finMap_decode V (f : finMap_ V) := FinMap (tagged f). Lemma finMap_codeK V : cancel (@finMap_encode V) (@finMap_decode V). Proof. by case. Qed. Section FinMapEqType. Variable V : eqType. Definition finMap_eqMixin := CanEqMixin (@finMap_codeK V). Canonical finMap_eqType := EqType {fmap K -> V} finMap_eqMixin. End FinMapEqType. Section FinMapChoiceType. Variable V : choiceType. Definition finMap_choiceMixin := CanChoiceMixin (@finMap_codeK V). Canonical finMap_choiceType := ChoiceType {fmap K -> V} finMap_choiceMixin. End FinMapChoiceType. End FinMapCanonicals. Section FinMapTheory. Variables (K : choiceType). (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma fndP V (f : {fmap K -> V}) k : fnd_spec f k (k \in domf f) (insub k) (f.[? k]). Proof. (* Goal: @eq bool (@in_mem (Choice.sort V) x (@mem (Choice.sort V) (simplPredType (Choice.sort V)) (@SimplPred (Choice.sort V) (fun x : Choice.sort V => andb (@in_mem (Choice.sort V) x (@mem (Choice.sort V) (predPredType (Choice.sort V)) (fun x0 : Choice.sort V => @pred_of_eq_seq (Choice.eqType V) (@enum_fset V (codomf f)) x0))) (negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (@in_mem (Choice.sort K) (@fsval K (@domf K (Choice.sort V) f) k) (@mem (Choice.sort K) (finSetPredType K) (@fsetD K (@domf K (Choice.sort V) f) A))) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) x))) k))))))) (@in_mem (Choice.sort V) x (@mem (Choice.sort V) (simplPredType (Choice.sort V)) (@SimplPred (Choice.sort V) (fun x : Choice.sort V => andb (@in_mem (Choice.sort V) x (@mem (Choice.sort V) (predPredType (Choice.sort V)) (fun x0 : Choice.sort V => @pred_of_eq_seq (Choice.eqType V) (@enum_fset V (codomf f)) x0))) (negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (negb (@in_mem (Choice.sort K) (@fsval K (@domf K (Choice.sort V) f) k) (@mem (Choice.sort K) (finSetPredType K) A))) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) x))) k))))))) *) rewrite /fnd; case: insubP=> [[k' k'f] _ {k} <- /=|kNf]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite k'f; constructor. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite (negPf kNf); constructor. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma fndSome V (f : {fmap K -> V}) (k : K) : f.[? k] = (k \in f) :> bool. Proof. by case: fndP. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma not_fnd V (f : {fmap K -> V}) (k : K) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) k \notin f -> f.[? k] = None. Proof. by case: fndP. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma getfE V (f : {fmap K -> V}) (k : domf f) (kf : val k \in domf f) : f.[kf] = f k :> V. Proof. by congr (_ _); apply: val_inj. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma eq_getf V (f : {fmap K -> V}) k (kf kf' : k \in domf f) : f.[kf] = f.[kf'] :> V. Proof. by rewrite (@getfE _ _ [` kf']). Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma Some_fnd V (f : {fmap K -> V}) (k : domf f) : Some (f k) = f.[? val k]. Proof. by case: fndP (valP k) => // ? _; rewrite getfE. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma in_fnd V (f : {fmap K -> V}) (k : K) (kf : k \in domf f) : f.[? k] = Some f.[kf]. Proof. by rewrite Some_fnd. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma fnd_if V (cond : bool) (f g : {fmap K -> V}) (k : K) : ((if cond then f else g) : finMap _ _).[? k] = if cond then f.[? k] else g.[? k]. Proof. by case: cond. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma getfP V (f g : {fmap K -> V}) : domf f = domf g -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (forall k (kMf : k \in f) (kMg : k \in g), f.[kMf] = g.[kMg]) -> f = g. Proof. (* Goal: forall (_ : @eq (@finset_of K (Phant (Choice.sort K))) (@domf K V f) (@domf K V g)) (_ : forall (k : Choice.sort K) (kMf : is_true (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f))) (kMg : is_true (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) g))), @eq V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V f)) V (@ffun_of_fmap K V f) (@FSetSub K (@domf K V f) k kMf)) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V g)) V (@ffun_of_fmap K V g) (@FSetSub K (@domf K V g) k kMg))), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f g *) move: f g => [kf f] [kg g] /= eq_kfg; case: _ / eq_kfg in g * => {kg}. (* Goal: forall _ : forall (k : Choice.sort K) (kMf : is_true (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) (@FinMap K V kf f)))) (kMg : is_true (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) (@FinMap K V kf g)))), @eq V (@FunFinfun.fun_of_fin (@fset_sub_finType K kf) V f (@FSetSub K kf k kMf)) (@FunFinfun.fun_of_fin (@fset_sub_finType K kf) V g (@FSetSub K kf k kMg)), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (@FinMap K V kf f) (@FinMap K V kf g) *) move=> eq_fg; congr FinMap; apply/ffunP => /= x. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by do [rewrite -!getfE; do ?exact: valP] => *. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma fmapP V (f g : {fmap K -> V}) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (forall k, f.[? k] = g.[? k]) <-> f = g. Proof. (* Goal: iff (@eqfun (Equality.sort V) (Choice.sort K) (@fun_of_fsfun K V default f) (@fun_of_fsfun K V default f')) (@eq (@fsfun K V default) f f') *) split=> [fnd_fg|-> //]; apply: getfP => [|k kMf kMg]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply/fsetP => x; rewrite -!fndSome fnd_fg. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply: Some_inj; rewrite !Some_fnd. Qed. Lemma fnd_fmap0 V k : ([fmap] : {fmap K -> V}).[? k] = None. Proof. by rewrite not_fnd // in_fset0. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma mem_setf V (f : {fmap K -> V}) (k0 : K) (v0 : V) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) f.[k0 <- v0] =i predU1 k0 (mem (domf f)). Proof. by move=> k; rewrite !inE. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma dom_setf V (f : {fmap K -> V}) (k0 : K) (v0 : V) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) domf (f.[k0 <- v0]) = k0 |` domf f. Proof. by apply/fsetP=> k; rewrite mem_setf. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma fnd_set_in V (f : {fmap K -> V}) k0 v0 (x : domf f.[k0 <- v0]) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) val x != k0 -> val x \in f. Proof. by have := valP x; rewrite mem_setf inE; case: eqP. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma setfK V (f : {fmap K -> V}) k0 v0 (x : domf f.[k0 <- v0]): (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) f.[k0 <- v0] x = if eqVneq (val x) k0 is right xNk0 then f.[fnd_set_in xNk0] else v0. Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) case: eqVneq => [|xNk0]; rewrite ?ffunE /=; first by move->; rewrite eqxx. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite (negPf xNk0) in_fnd ?fnd_set_in //= => xf; apply: eq_getf. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma fnd_set V (f : {fmap K -> V}) k0 v0 k : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) f.[k0 <- v0].[? k] = if k == k0 then Some v0 else f.[? k]. Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) case: fndP => [ksf|]; last first. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite mem_setf inE negb_or => /andP [/negPf ->]; case: fndP. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite setfK; case: eqVneq => //= [->|kNk0]; first by rewrite eqxx. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite Some_fnd (negPf kNk0). Qed. Lemma fmap_nil V (f : {fmap K -> V}) : domf f = fset0 -> f = [fmap]. Proof. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> kf0; apply: getfP => //= k ? kMg; have := kMg; rewrite !inE. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma getf_set V (f : {fmap K -> V}) (k : K) (v : V) (kf' : k \in _) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) f.[k <- v].[kf'] = v. Proof. by apply: Some_inj; rewrite Some_fnd fnd_set eqxx. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma setf_get V (f : {fmap K -> V}) (k : domf f) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) f.[val k <- f k] = f. Proof. by apply/fmapP=> k'; rewrite fnd_set Some_fnd; case: eqP => [->|]. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma setfNK V (f : {fmap K -> V}) (k k' : K) (v : V) (k'f : k' \in _) (k'f' : k' \in _): (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) f.[k <- v].[k'f'] = if k' == k then v else f.[k'f]. Proof. by apply: Some_inj; rewrite Some_fnd !fnd_set in_fnd; case: ifP. Qed. Lemma domf0 V : domf [fmap of K -> V] = fset0. Proof. by apply/fsetP => x. Qed. End FinMapTheory. Section ReduceOp. Variable (K : choiceType) (V : Type). Implicit Types (f : {fmap K -> option V}). Lemma reducef_subproof f (x : [fsetval x : domf f | f x]) : f (fincl (fset_sub_val _ _) x). Proof. (* Goal: is_true (@isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) (@fincl K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) K (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (predPredType (@fset_sub_type K (@domf K (option V) f) : predArgType)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subfinType K (@domf K (option V) f)))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (option V) f) : predArgType) (pred_of_argType (@fset_sub_type K (@domf K (option V) f) : predArgType))))) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x)))) (Phantom (mem_pred (Equality.sort (@Equality.clone (@fset_sub_type K (@domf K (option V) f)) (@fset_sub_eqType K (@domf K (option V) f)) (@fset_sub_eqMixin K (@domf K (option V) f)) (fun x : Equality.sort (@fset_sub_eqType K (@domf K (option V) f)) => x) (fun x : phantom Equality.type (@Equality.Pack (@fset_sub_type K (@domf K (option V) f)) (@fset_sub_eqMixin K (@domf K (option V) f))) => x)))) (@pred_of_finmempred (@Equality.clone (@fset_sub_type K (@domf K (option V) f)) (@fset_sub_eqType K (@domf K (option V) f)) (@fset_sub_eqMixin K (@domf K (option V) f)) (fun x : Equality.sort (@fset_sub_eqType K (@domf K (option V) f)) => x) (fun x : phantom Equality.type (@Equality.Pack (@fset_sub_type K (@domf K (option V) f)) (@fset_sub_eqMixin K (@domf K (option V) f))) => x)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (predPredType (@fset_sub_type K (@domf K (option V) f) : predArgType)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subfinType K (@domf K (option V) f)))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (option V) f) : predArgType) (pred_of_argType (@fset_sub_type K (@domf K (option V) f) : predArgType))))) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x))))))) (@domf K (option V) f) (@fset_sub_val imfset_key K (@domf K (option V) f) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (predPredType (@fset_sub_type K (@domf K (option V) f) : predArgType)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subfinType K (@domf K (option V) f)))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (option V) f) : predArgType) (pred_of_argType (@fset_sub_type K (@domf K (option V) f) : predArgType))))) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x))))) x))) *) set y := (y in f y); suff : val y \in [fsetval x : domf f | f x]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite val_in_fset. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by suff -> : val y = val x by exact: valP. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Definition reducef f : {fmap K -> V} := [fmap x => oextract (@reducef_subproof f x)]. Lemma domf_reduce f : domf (reducef f) = [fsetval x : domf f | f x]. Proof. by []. Qed. Lemma mem_reducef f k : k \in reducef f = ojoin f.[? k]. Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite inE; case: fndP => [kf|] /=; first by rewrite in_fset_valT. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply: contraNF; apply: (fsubsetP (fset_sub_val _ _)). Qed. Lemma fnd_reducef f k : (reducef f).[? k] = ojoin f.[? k]. Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) case: fndP => /= [kf|]; last by rewrite mem_reducef; case: ojoin. (* Goal: @eq (@finset_of V (Phant (Choice.sort V))) (codomf (@setf K (Choice.sort V) f k v)) (@fsetU V (@fset1 V v) (codomf (@restrictf K (Choice.sort V) f (@fsetD K (@domf K (Choice.sort V) f) (@fset1 K k))))) *) rewrite ffunE /= Some_oextract; apply: Some_inj; rewrite Some_fnd. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite Some_ojoin // ojoinT // -mem_reducef. Qed. Lemma get_reducef f k (krf : k \in reducef f) (kf : k \in f): Some (reducef f).[krf] = f.[kf]. Proof. by rewrite Some_fnd fnd_reducef in_fnd. Qed. End ReduceOp. Arguments reducef : simpl never. Section RestrictionOps. Variable (K : choiceType) (V : Type). Implicit Types (f g : {fmap K -> V}). (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Definition filterf f (P : pred K) : {fmap K -> V} := [fmap x : [fset x in domf f | P x] => f (fincl (fset_sub _ _) x)]. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Definition restrictf f (A : {fset K}) : {fmap K -> V} := filterf f (mem A). Notation "x .[& A ]" := (restrictf x A) : fmap_scope. Notation "x .[\ A ]" := (x.[& domf x `\` A]) : fmap_scope. Notation "x .[~ k ]" := (x.[\ [fset k]]) : fmap_scope. Lemma domf_filterf f (P : pred K) : domf (filterf f P) = [fset k in domf f | P k]. Proof. by []. Qed. Lemma mem_filterf f (P : pred K) (k : K) : (k \in domf (filterf f P)) = (k \in f) && (P k) :> bool. Proof. by rewrite !inE. Qed. Lemma mem_restrictf f (A : {fset K}) (k : K) : k \in f.[& A] = (k \in A) && (k \in f) :> bool. Proof. by rewrite mem_filterf andbC. Qed. Lemma mem_remf f (A : {fset K}) (k : K) : k \in f.[\ A] = (k \notin A) && (k \in f) :> bool. Proof. by rewrite mem_restrictf inE -andbA andbb. Qed. Lemma mem_remf1 f (k' k : K) : k \in f.[~ k'] = (k != k') && (k \in f) :> bool. Proof. by rewrite mem_remf inE. Qed. Lemma domf_restrict f A : domf f.[& A] = A `&` domf f. Proof. by apply/fsetP=> k'; rewrite mem_restrictf !inE. Qed. Lemma domf_rem f A : domf f.[\ A] = domf f `\` A. Proof. by rewrite domf_restrict fsetIDAC fsetIid. Qed. Lemma mem_remfF f (k : K) : k \in f.[~ k] = false. Proof. by rewrite mem_remf1 eqxx. Qed. Lemma fnd_filterf f P k : (filterf f P).[? k] = if P k then f.[? k] else None. Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) case: fndP => [kff|]; last first. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite in_fset => /nandP [/not_fnd->|/negPf-> //]; rewrite if_same. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by have := kff; rewrite in_fset => /andP [kf ->]; rewrite ffunE Some_fnd. Qed. Lemma get_filterf f P k (kff : k \in filterf f P) (kf : k \in f) : (filterf f P).[kff] = f.[kf]. Proof. (* Goal: is_true (@fsubset K (@FinSupp.fs K V (fun a : Choice.sort K => default a) (@fsfun_of_ffun key K V S (fun a : @fset_sub_type K S => h a) (fun a : Choice.sort K => default a))) S) *) apply: Some_inj; rewrite !Some_fnd /= fnd_filterf. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move: kff; rewrite !(in_fset, inE) => /andP [? ->]. Qed. Lemma fnd_restrict f A (k : K) : f.[& A].[? k] = if k \in A then f.[? k] else None. Proof. by rewrite fnd_filterf. Qed. Lemma fnd_rem f A (k : K) : f.[\ A].[? k] = if k \in A then None else f.[? k]. Proof. (* Goal: @eq (Equality.sort V) (@fun_of_fsfun K V default (of_ffun key) x) (@Option.default (Equality.sort V) (default x) (@Option.map (@fset_sub_type K S) (Equality.sort V) h (@insub (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) x))) *) rewrite fnd_restrict inE. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by case: fndP => ?; rewrite ?(andbT, andbF) //=; case: (_ \in _). Qed. Lemma restrictf_comp f A B : f.[& A].[& B] = f.[& A `&` B]. Proof. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply/fmapP=> k; rewrite !fnd_restrict !inE; do !case: (_ \in _). Qed. Lemma remf_comp f A B : f.[\ A].[\ B] = f.[\ A `|` B]. Proof. by apply/fmapP=> k; rewrite !fnd_rem inE; do !case: (_ \in _). Qed. Lemma restrictfT f : f.[& domf f] = f. Proof. by apply/fmapP=> k; rewrite fnd_restrict; case: fndP. Qed. Lemma restrictf0 f : f.[& fset0] = [fmap]. Proof. by apply/fmapP => k; rewrite fnd_restrict !(inE, not_fnd). Qed. Lemma remf0 f : f.[\ fset0] = f. Proof. by rewrite fsetD0 restrictfT. Qed. Lemma fnd_rem1 f (k k' : K) : f.[~ k].[? k'] = if k' != k then f.[? k'] else None. Proof. by rewrite fnd_rem inE; case: eqP. Qed. Lemma getf_restrict f A (k : K) (kf : k \in f) (kfA : k \in f.[& A]) : f.[& A].[kfA] = f.[kf]. Proof. by rewrite get_filterf. Qed. Lemma setf_restrict f A (k : K) (v : V) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) f.[& A].[k <- v] = f.[k <- v].[& k |` A]. Proof. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply/fmapP=> k'; rewrite !(fnd_set, fnd_restrict, inE); case: eqP. Qed. Lemma setf_rem f A (k : K) (v : V) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) f.[\ A].[k <- v] = f.[k <- v].[\ (A `\ k)]. Proof. by rewrite setf_restrict fsetUDl. Qed. Lemma setf_rem1 f (k : K) (v : V) : f.[~ k].[k <- v] = f.[k <- v]. Proof. by rewrite setf_rem fsetDv remf0. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma setfC f k1 k2 v1 v2 : f.[k1 <- v1].[k2 <- v2] = (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) if k2 == k1 then f.[k2 <- v2] else f.[k2 <- v2].[k1 <- v1]. Proof. (* Goal: Bool.reflect (@ex (Choice.sort K) (fun x : Choice.sort K => @eq (option (Choice.sort V)) (@fnd K (Choice.sort V) (@domf K (Choice.sort V) f) (@ffun_of_fmap K (Choice.sort V) f) x) (@Some (Choice.sort V) v))) (@in_mem (Choice.sort V) v (@mem (Choice.sort V) (finSetPredType V) (codomf f))) *) apply/fmapP => k. rewrite fnd_if !fnd_set. (* Goal: Bool.reflect (@ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x1) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Equality.sort (Choice.eqType K)) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) a)) (@mem (Choice.sort K) (finSetPredType K) S))))) (fsinjectiveb f) *) have [[->|kNk2] [// <-|k2Nk1]] // := (altP (k =P k2), altP (k2 =P k1)). (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite (negPf kNk2). Qed. Lemma restrictf_mkdom f A : f.[& A] = f.[& domf f `&` A]. Proof. (* Goal: is_true (@fsubset K (@FinSupp.fs K V (fun a : Choice.sort K => default a) (@fsfun_of_ffun key K V S (fun a : @fset_sub_type K S => h a) (fun a : Choice.sort K => default a))) S) *) apply/fmapP=> k; rewrite !fnd_restrict inE. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by case: fndP => ?; rewrite ?(andbT, andbF) //=; case: (_ \in _). Qed. Lemma restrictf_id f A : [disjoint domf f & A] -> f.[& A] = [fmap]. Proof. by move=> dAf; rewrite restrictf_mkdom (eqP dAf) restrictf0. Qed. Lemma remf_id f A : [disjoint domf f & A] -> f.[\ A] = f. Proof. by move=> /fsetDidPl ->; rewrite restrictfT. Qed. Lemma remf1_id f k : k \notin f -> f.[~ k] = f. Proof. by move=> kNf; rewrite remf_id //= fdisjointX1. Qed. Lemma restrictf_set f A (k : K) (v : V) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) f.[k <- v].[& A] = if k \in A then f.[& A].[k <- v] else f.[& A]. Proof. (* Goal: is_true (@fsubset K (@FinSupp.fs K V (fun a : Choice.sort K => default a) (@fsfun_of_ffun key K V S (fun a : @fset_sub_type K S => h a) (fun a : Choice.sort K => default a))) S) *) apply/fmapP => k' /=; rewrite !(fnd_if, fnd_set, fnd_restrict). (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by case: eqP => [->|]; do !case: ifP. Qed. Lemma remf_set f A (k : K) (v : V) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) f.[k <- v].[\ A] = if k \in A then f.[\ A] else f.[\ A].[k <- v]. Proof. (* Goal: is_true (@fsubset K (@FinSupp.fs K V (fun a : Choice.sort K => default a) (@fsfun_of_ffun key K V S (fun a : @fset_sub_type K S => h a) (fun a : Choice.sort K => default a))) S) *) apply/fmapP => k' /=; rewrite !(fnd_if, fnd_rem, fnd_set, inE). (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by case: eqP => [->|]; do !case: (_ \in _). Qed. Lemma remf1_set f (k k' : K) (v : V) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) f.[k' <- v].[~ k] = if k == k' then f.[~ k] else f.[~ k].[k' <- v]. Proof. by rewrite remf_set inE eq_sym. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma setf_inj f f' k v : k \notin f -> k \notin f' -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) f.[k <- v] = f'.[k <- v]-> f = f'. Proof. (* Goal: forall (_ : is_true (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f)))) (_ : is_true (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f')))) (_ : @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (@setf K V f k v) (@setf K V f' k v)), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f f' *) move=> kf kf' eq_fkv; apply/fmapP => k'. (* Goal: Bool.reflect (@ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x1) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Equality.sort (Choice.eqType K)) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) a)) (@mem (Choice.sort K) (finSetPredType K) S))))) (fsinjectiveb f) *) have := congr1 (fun g => g.[? k']) eq_fkv. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite !fnd_set; case: eqP => // ->; rewrite !not_fnd. Qed. End RestrictionOps. Arguments filterf : simpl never. Arguments restrictf : simpl never. Notation "x .[& A ]" := (restrictf x A) : fmap_scope. Notation "x .[\ A ]" := (x.[& domf x `\` A]) : fmap_scope. Notation "x .[~ k ]" := (x.[\ [fset k]]) : fmap_scope. Section Cat. Variables (K : choiceType) (V : Type). Implicit Types (f g : {fmap K -> V}). (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Definition catf (f g : {fmap K -> V}) := [fmap k : (domf f `\` domf g) `|` domf g=> match fsetULVR (valP k) with | inl kfDg => f.[fsubsetP (fsubsetDl _ _) _ kfDg] | inr kg => g.[kg] end]. Local Notation "f + g" := (catf f g) : fset_scope. Lemma domf_cat f g : domf (f + g) = domf f `|` domf g. Proof. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply/fsetP=> x; rewrite !inE; case: (boolP (_ \in domf _)); rewrite ?orbT. Qed. Lemma mem_catf f g k : k \in domf (f + g) = (k \in f) || (k \in g). Proof. by rewrite domf_cat inE. Qed. Lemma fnd_cat f g k : (f + g).[? k] = if k \in domf g then g.[? k] else f.[? k]. Proof. (* Goal: @eq (Equality.sort V) (@Option.default (Equality.sort V) (default x) (@fnd K (Equality.sort V) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) (@FunFinfun.finfun (@fset_sub_finType K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a))))))))) (Equality.sort V) (fun a : @fset_sub_type K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) => h (@fincl K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (@fsval K S) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun x : @fset_sub_type K S => negb (@eq_op V (h x) (default (@fsval K S x)))))))) S (@fset_sub_val imfset_key K S (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0))))))) a))) x)) (default x) *) (* Goal: @eq (Equality.sort V) (@Option.default (Equality.sort V) (default (@fsval K S u)) (@fnd K (Equality.sort V) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) (@FunFinfun.finfun (@fset_sub_finType K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a))))))))) (Equality.sort V) (fun a : @fset_sub_type K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) => h (@fincl K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (@fsval K S) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun x : @fset_sub_type K S => negb (@eq_op V (h x) (default (@fsval K S x)))))))) S (@fset_sub_val imfset_key K S (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0))))))) a))) (@fsval K S u))) (h u) *) case: fndP => //= [kfg|]; rewrite /catf /=. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite ffunE /=; case: fsetULVR => [kf|kg]; last by rewrite Some_fnd kg. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite -in_fnd; move: kf; rewrite inE => /andP[/negPf ->]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite mem_catf => /norP [kNf kNg]; rewrite !not_fnd // if_same. Qed. Lemma catfE f g : f + g = f.[\ domf g] + g. Proof. by apply/fmapP=> k; rewrite !(fnd_cat, fnd_rem); case: ifP. Qed. Lemma getf_catl f g k (kfg : k \in domf (f + g)) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (kf : k \in domf f) : k \notin domf g -> (f + g).[kfg] = f.[kf]. Proof. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> kNg; apply: Some_inj; rewrite Some_fnd fnd_cat (negPf kNg) in_fnd. Qed. Lemma getf_catr f g k (kfg : k \in domf (f + g)) (kg : k \in domf g) : (f + g).[kfg] = g.[kg]. Proof. by apply: Some_inj; rewrite Some_fnd fnd_cat kg in_fnd. Qed. Lemma catf0 f : f + [fmap] = f. Proof. by apply/fmapP => k; rewrite fnd_cat in_fset0. Qed. Lemma cat0f f : [fmap] + f = f. Proof. (* Goal: @eq (finMap K V) (catf (@fmap0 K V) f) f *) apply/fmapP => k; rewrite fnd_cat; case: ifPn => //= kf. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite !not_fnd ?inE. Qed. Lemma catf_setl f g k (v : V) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) f.[k <- v] + g = if k \in g then f + g else (f + g).[k <- v]. Proof. (* Goal: is_true (@fsubset K (@FinSupp.fs K V (fun a : Choice.sort K => default a) (@fsfun_of_ffun key K V S (fun a : @fset_sub_type K S => h a) (fun a : Choice.sort K => default a))) S) *) apply/fmapP=> k'; rewrite !(fnd_if, fnd_cat, fnd_set). (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by have [->|Nkk'] := altP eqP; do !case: (_ \in _). Qed. Lemma catf_setr f g k (v : V) : f + g.[k <- v] = (f + g).[k <- v]. Proof. (* Goal: is_true (@fsubset K (@FinSupp.fs K V (fun a : Choice.sort K => default a) (@fsfun_of_ffun key K V S (fun a : @fset_sub_type K S => h a) (fun a : Choice.sort K => default a))) S) *) apply/fmapP=> k'; rewrite !(fnd_cat, fnd_set, mem_setf, inE). (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by have [->|Nkk'] := altP eqP; do !case: (_ \in _). Qed. Lemma restrictf_cat f g A : (f + g).[& A] = f.[& A] + g.[& A]. Proof. (* Goal: is_true (@fsubset K (@FinSupp.fs K V (fun a : Choice.sort K => default a) (@fsfun_of_ffun key K V S (fun a : @fset_sub_type K S => h a) (fun a : Choice.sort K => default a))) S) *) apply/fmapP => k'; rewrite !(fnd_cat, fnd_restrict) mem_restrictf. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by case: (_ \in _). Qed. Lemma restrictf_cat_domr f g : (f + g).[& domf g] = g. Proof. (* Goal: @eq (Equality.sort V) (@fun_of_fsfun K V default (of_ffun key) x) (@Option.default (Equality.sort V) (default x) (@Option.map (@fset_sub_type K S) (Equality.sort V) h (@insub (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) x))) *) rewrite catfE restrictf_cat restrictf_comp. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite fsetIDAC fsetDIl fsetDv fsetI0 restrictf0 restrictfT cat0f. Qed. Lemma remf_cat f g A : (f + g).[\ A] = f.[\ A] + g.[\ A]. Proof. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply/fmapP => k'; rewrite !(fnd_cat, fnd_rem) mem_remf; case: (_ \in _). Qed. Lemma catf_restrictl A f g : f.[& A] + g = (f + g).[& A `|` domf g]. Proof. (* Goal: is_true (@fsubset K (@FinSupp.fs K V (fun a : Choice.sort K => default a) (@fsfun_of_ffun key K V S (fun a : @fset_sub_type K S => h a) (fun a : Choice.sort K => default a))) S) *) apply/fmapP=> k; rewrite !(fnd_cat, fnd_restrict) !inE. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by do !case: (_ \in _). Qed. Lemma catf_reml A f g : f.[\ A] + g = (f + g).[\ A `\` domf g]. Proof. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply/fmapP=> k; rewrite !(fnd_cat, fnd_rem) inE; case: (_ \in _). Qed. Lemma catf_rem1l k f g : f.[~ k] + g = if k \in g then f + g else (f + g).[~ k]. Proof. (* Goal: is_true (@fsubset K (@FinSupp.fs K V (fun a : Choice.sort K => default a) (@fsfun_of_ffun key K V S (fun a : @fset_sub_type K S => h a) (fun a : Choice.sort K => default a))) S) *) apply/fmapP => k'; rewrite !(fnd_if, fnd_cat, fnd_rem1). (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by have [->|?] := altP eqP; do !case: (_ \in _). Qed. Lemma setf_catr f g k (v : V) : (f + g).[k <- v] = f + g.[k <- v]. Proof. by rewrite catf_setr. Qed. Lemma setf_catl f g k (v : V) : (f + g).[k <- v] = f.[k <- v] + g.[~ k]. Proof. by rewrite catf_setl mem_remf1 eqxx /= !setf_catr setf_rem1. Qed. Lemma catfA f g h : f + (g + h) = f + g + h. Proof. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply/fmapP => k; rewrite !fnd_cat !mem_catf; do !case: (_ \in _). Qed. Lemma catfC f g : f + g = g + f.[\ domf g]. Proof. (* Goal: is_true (@fsubset K (@FinSupp.fs K V (fun a : Choice.sort K => default a) (@fsfun_of_ffun key K V S (fun a : @fset_sub_type K S => h a) (fun a : Choice.sort K => default a))) S) *) apply/fmapP=> k; rewrite !fnd_cat fnd_rem domf_rem inE. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by have [|kNg] //= := boolP (_ \in domf g); rewrite (not_fnd kNg); case: fndP. Qed. Lemma disjoint_catfC f g : [disjoint domf f & domf g] -> f + g = g + f. Proof. by move=> dfg; rewrite catfC remf_id. Qed. Lemma catfAC f g h : f + g + h = f + h + g.[\ domf h]. Proof. by rewrite -!catfA [X in _ + X]catfC. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma disjoint_catfAC f g h : [disjoint domf g & domf h]%fmap -> f + g + h = f + h + g. Proof. by move=> dgh; rewrite catfAC remf_id. Qed. Lemma catfCA f g h : f + (g + h) = g + (f.[\ domf g] + h). Proof. by rewrite !catfA [X in X + _]catfC. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma disjoint_catfCA f g h : [disjoint domf f & domf g]%fmap -> f + (g + h) = g + (f + h). Proof. by move=> dfg; rewrite catfCA remf_id. Qed. Lemma catfIs f g h : f + h = g + h -> f.[\ domf h] = g.[\ domf h]. Proof. (* Goal: forall _ : @eq (finMap K V) (catf f g) (catf f h), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (@restrictf K V g (@domf K V h)) (@restrictf K V h (@domf K V g)) *) move=> /fmapP eq_fg_fh; apply/fmapP => k; have := eq_fg_fh k. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite !fnd_cat !fnd_rem; case: ifP. Qed. Lemma disjoint_catfIs h f g : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) [disjoint domf f & domf h] -> [disjoint domf g & domf h] -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) f + h = g + h -> f = g. Proof. by move=> dfg dgh /catfIs; rewrite !remf_id. Qed. Lemma restrict_catfsI f g h : f + g = f + h -> g.[& domf h] = h.[& domf g]. Proof. (* Goal: forall _ : @eq (finMap K V) (catf f g) (catf f h), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (@restrictf K V g (@domf K V h)) (@restrictf K V h (@domf K V g)) *) move=> /fmapP eq_fg_fh; apply/fmapP => k; have := eq_fg_fh k. (* Goal: @eq (Equality.sort V) (@fun_of_fsfun K V default (of_ffun key) x) (@Option.default (Equality.sort V) (default x) (@Option.map (@fset_sub_type K S) (Equality.sort V) h (@insub (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) x))) *) rewrite !fnd_cat !fnd_restrict. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by do ![case: (boolP (_ \in domf _)) => ? //=] => _; rewrite not_fnd. Qed. Lemma disjoint_catfsI h f g : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) [disjoint domf f & domf h] -> [disjoint domf g & domf h] -> (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) h + f = h + g -> f = g. Proof. (* Goal: forall (_ : is_true (@fdisjoint K (@domf K V f) (@domf K V h))) (_ : is_true (@fdisjoint K (@domf K V g) (@domf K V h))) (_ : @eq (finMap K V) (catf h f) (catf h g)), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f g *) move=> dfg dgh; rewrite -disjoint_catfC // -[RHS]disjoint_catfC //. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply: disjoint_catfIs. Qed. End Cat. Module Import FmapE. Definition fmapE := (fndSome, getfE, setfK, fnd_set, getf_set, setfNK, fnd_reducef, get_reducef, fnd_filterf, get_filterf, fnd_restrict, getf_restrict, fnd_rem, fnd_rem1, restrictfT, restrictf0, restrictf_id, remf_id, remf1_id, fnd_cat). End FmapE. Arguments catf : simpl never. Notation "f + g" := (catf f g) : fset_scope. Section FinMapKeyType. Variables (K V : choiceType). Implicit Types (f g : {fmap K -> V}). Definition codomf f : {fset V} := [fset f k | k : domf f]. Lemma mem_codomf f v : (v \in codomf f) = [exists x : domf f, f x == v]. Proof. (* Goal: Bool.reflect (@ex (Choice.sort K) (fun x : Choice.sort K => @eq (option (Choice.sort V)) (@fnd K (Choice.sort V) (@domf K (Choice.sort V) f) (@ffun_of_fmap K (Choice.sort V) f) x) (@Some (Choice.sort V) v))) (@in_mem (Choice.sort V) v (@mem (Choice.sort V) (finSetPredType V) (codomf f))) *) apply: sameP existsP. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply: (iffP (imfsetP _ _ _ _)) => /= [[x _ ->]|[x /eqP <-]]; exists x. Qed. Lemma codomfP f v : reflect (exists x, f.[? x] = Some v) (v \in codomf f). Proof. (* Goal: Bool.reflect (@ex (Choice.sort K) (fun x : Choice.sort K => @eq (option (Choice.sort V)) (@fnd K (Choice.sort V) (@domf K (Choice.sort V) f) (@ffun_of_fmap K (Choice.sort V) f) x) (@Some (Choice.sort V) v))) (@in_mem (Choice.sort V) v (@mem (Choice.sort V) (finSetPredType V) (codomf f))) *) apply: (iffP (imfsetP _ _ _ _)) => /= [[x _ ->]|[k]]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by exists (val x); rewrite Some_fnd. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by case: fndP => //= kf [<-]; exists [` kf]. Qed. Lemma codomfPn f v : reflect (forall x, f.[? x] != Some v) (v \notin codomf f). Proof. (* Goal: is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) a)) (@mem (Choice.sort K) (finSetPredType K) (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f))) *) (* Goal: @ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x1) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Choice.sort K) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K S a)) (@mem (Choice.sort K) (finSetPredType K) S)))) *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite mem_codomf negb_exists; apply: (iffP forallP) => f_eq_v x /=. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by case: fndP => //= kf; rewrite f_eq_v. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply: contraNneq (f_eq_v (val x)) => <-; rewrite Some_fnd. Qed. Lemma codomf0 : codomf [fmap] = fset0. Proof. (* Goal: @eq (@finset_of V (Phant (Choice.sort V))) (codomf (@fmap0 K (Choice.sort V))) (@fset0 V) *) apply/fsetP=> k; rewrite inE; apply/negP => /codomfP [k']. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite not_fnd //= inE. Qed. Lemma in_codomf f (k : domf f) : f k \in codomf f. Proof. by rewrite in_imfset. Qed. Lemma fndSomeP f (k : K) (v : V): (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (f.[? k] = Some v) <-> {kf : k \in f & f.[kf] = v}. Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) split => [fk|[kf fk]]; last by rewrite in_fnd fk. (* Goal: Bool.reflect (@ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x1) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Equality.sort (Choice.eqType K)) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) a)) (@mem (Choice.sort K) (finSetPredType K) S))))) (fsinjectiveb f) *) have kf : k \in f by rewrite -fndSome fk. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by exists kf; apply: Some_inj; rewrite Some_fnd. Qed. Lemma codomf_restrict f (A : {fset K}) : codomf f.[& A] = [fset f k | k : domf f & val k \in A]. Proof. (* Goal: @eq (@finset_of V (Phant (Choice.sort V))) (codomf (@restrictf K (Choice.sort V) f A)) (@Imfset.imfset imfset_key (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) V (fun k : Choice.sort (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) => @FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) (@mem_fin (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (simplPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@subfinset_finpred (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) (@mem_fin (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (predPredType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType)) (@fin_finpred (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (pred_finpredType (@fset_sub_finType K (@domf K (Choice.sort V) f))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType) (pred_of_argType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType))))) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => @in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@fset_sub_subType K (@domf K (Choice.sort V) f)) k) (@mem (Choice.sort K) (finSetPredType K) A)))) (Phantom (mem_pred (@fset_sub_type K (@domf K (Choice.sort V) f))) (@mem (@fset_sub_type K (@domf K (Choice.sort V) f)) (simplPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@SimplPred (@fset_sub_type K (@domf K (Choice.sort V) f)) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => andb (@in_mem (@fset_sub_type K (@domf K (Choice.sort V) f)) k (@mem (@fset_sub_type K (@domf K (Choice.sort V) f)) (predPredType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType)) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType) (pred_of_argType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType))))) (@in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@fset_sub_subType K (@domf K (Choice.sort V) f)) k) (@mem (Choice.sort K) (finSetPredType K) A))))))) *) apply/fsetP=> v; apply/imfsetP/imfsetP => /= [] [k kP ->]. (* Goal: @ex2 (@fset_sub_type K (@domf K (Choice.sort V) f)) (fun x : @fset_sub_type K (@domf K (Choice.sort V) f) => is_true (@in_mem (@fset_sub_type K (@domf K (Choice.sort V) f)) x (@mem (@fset_sub_type K (@domf K (Choice.sort V) f)) (simplPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@SimplPred (@fset_sub_type K (@domf K (Choice.sort V) f)) (fun x0 : @fset_sub_type K (@domf K (Choice.sort V) f) => @in_mem (Choice.sort K) (@fsval K (@domf K (Choice.sort V) f) x0) (@mem (Choice.sort K) (finSetPredType K) A)))))) (fun x : @fset_sub_type K (@domf K (Choice.sort V) f) => @eq (Choice.sort V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) (Choice.sort V) (@FunFinfun.finfun (@fset_sub_finType K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) (Choice.sort V) (fun x0 : @fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A))))))) => @FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@fincl K (@Imfset.imfset imfset_key K K (fun x1 : Choice.sort K => x1) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x1 : Choice.sort K => andb (@in_mem (Choice.sort K) x1 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x1 (@mem (Choice.sort K) (finSetPredType K) A))))))) (@domf K (Choice.sort V) f) (@fset_sub K (@domf K (Choice.sort V) f) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A)))) x0))) k) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) x)) *) (* Goal: @ex2 (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x : Choice.sort K => x) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x : Choice.sort K => andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)))))))) (fun x : @fset_sub_type K (@Imfset.imfset imfset_key K K (fun x : Choice.sort K => x) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x : Choice.sort K => andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))))))) => is_true (@in_mem (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) x (@mem (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) (predPredType (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A))))))))) (@sort_of_simpl_pred (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) (pred_of_argType (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A))))))))))))) (fun x : @fset_sub_type K (@Imfset.imfset imfset_key K K (fun x : Choice.sort K => x) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x : Choice.sort K => andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))))))) => @eq (Choice.sort V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) (Choice.sort V) (@FunFinfun.finfun (@fset_sub_finType K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) (Choice.sort V) (fun x0 : @fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A))))))) => @FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@fincl K (@Imfset.imfset imfset_key K K (fun x1 : Choice.sort K => x1) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x1 : Choice.sort K => andb (@in_mem (Choice.sort K) x1 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x1 (@mem (Choice.sort K) (finSetPredType K) A))))))) (@domf K (Choice.sort V) f) (@fset_sub K (@domf K (Choice.sort V) f) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A)))) x0))) x)) *) have := valP k; rewrite !inE => /andP [kf kA]; exists [` kf] => //. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite ffunE /= -getfE. (* Goal: Bool.reflect (@ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x1) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Equality.sort (Choice.eqType K)) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) a)) (@mem (Choice.sort K) (finSetPredType K) S))))) (fsinjectiveb f) *) have kA : val k \in [fset x | x in domf f & x \in A] by rewrite !inE (valP k). (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by exists [` kA]; rewrite // ?ffunE !getfE. Qed. Lemma codomf_restrict_exists f (A : {fset K}) : codomf f.[& A] = [fset v in codomf f | [exists k : domf f, (val k \in A) && (f k == v)]]. Proof. rewrite codomf_restrict; apply/fsetP => v; rewrite !(in_fset, inE) /=; apply/imfsetP/idP. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> [k kA ->]; rewrite in_codomf /=; apply/existsP; exists k; apply/andP. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> /andP[fkdom /existsP [k /andP[kA /eqP<-]]]; exists k. Qed. Lemma codomf_rem f (A : {fset K}) : codomf f.[\ A] = [fset f k | k : domf f & val k \notin A]. Proof. (* Goal: @eq (Equality.sort V) (@fun_of_fsfun K V default (of_ffun key) x) (@Option.default (Equality.sort V) (default x) (@Option.map (@fset_sub_type K S) (Equality.sort V) h (@insub (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) x))) *) rewrite codomf_restrict. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply: eq_imfset => //= x /=; rewrite -!topredE /= !inE (valP x) andbT. Qed. Lemma codomf_rem_exists f (A : {fset K}) : codomf f.[\ A] = [fset v in codomf f | [exists k : domf f, (val k \notin A) && (f k == v)]]. Proof. (* Goal: is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) a)) (@mem (Choice.sort K) (finSetPredType K) (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f))) *) (* Goal: @ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x1) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Choice.sort K) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K S a)) (@mem (Choice.sort K) (finSetPredType K) S)))) *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite codomf_restrict_exists; apply: eq_imfset => x //=. (* Goal: @eq bool (@in_mem (Choice.sort V) x (@mem (Choice.sort V) (simplPredType (Choice.sort V)) (@SimplPred (Choice.sort V) (fun x : Choice.sort V => andb (@in_mem (Choice.sort V) x (@mem (Choice.sort V) (predPredType (Choice.sort V)) (fun x0 : Choice.sort V => @pred_of_eq_seq (Choice.eqType V) (@enum_fset V (codomf f)) x0))) (negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (@in_mem (Choice.sort K) (@fsval K (@domf K (Choice.sort V) f) k) (@mem (Choice.sort K) (finSetPredType K) (@fsetD K (@domf K (Choice.sort V) f) A))) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) x))) k))))))) (@in_mem (Choice.sort V) x (@mem (Choice.sort V) (simplPredType (Choice.sort V)) (@SimplPred (Choice.sort V) (fun x : Choice.sort V => andb (@in_mem (Choice.sort V) x (@mem (Choice.sort V) (predPredType (Choice.sort V)) (fun x0 : Choice.sort V => @pred_of_eq_seq (Choice.eqType V) (@enum_fset V (codomf f)) x0))) (negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (negb (@in_mem (Choice.sort K) (@fsval K (@domf K (Choice.sort V) f) k) (@mem (Choice.sort K) (finSetPredType K) A))) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) x))) k))))))) *) rewrite !inE; case: (_ \in _) => //=. apply/existsP/existsP => [] /= [k]; rewrite ?inE; by do 2?[move=>/andP []]; exists k; rewrite ?inE; do 2?[apply/andP; split]. Qed. Lemma in_codomf_rem1 f (k : K) (kf : k \in domf f) : codomf f.[~ k] = if [exists k' : domf f, (val k' != k) && (f k' == f.[kf])] then codomf f else codomf f `\ f.[kf]. Proof. (* Goal: is_true (@fsubset K (@FinSupp.fs K V (fun a : Choice.sort K => default a) (@fsfun_of_ffun key K V S (fun a : @fset_sub_type K S => h a) (fun a : Choice.sort K => default a))) S) *) apply/fsetP => v; rewrite codomf_rem_exists (fun_if (fun x => v \in x)) !(in_fset, inE). (* Goal: @eq (option (Equality.sort V)) (@fnd K (Equality.sort V) (@domf K (Equality.sort V) (@val (@finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V))) (fun x : @finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V)) => @FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Equality.sort V) x)) (fun k : @fset_sub_type K (@domf K (Equality.sort V) x) => @FiniteQuant.all (@fset_sub_finType K (@domf K (Equality.sort V) x)) (FiniteQuant.Quantified (negb (@eq_op V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) x)) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) x) k) (default (@val (Choice.sort K) (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Equality.sort V) x))) (@fset_sub_subType K (@domf K (Equality.sort V) x)) k))))) k)) (@fsfun_subType K V default) f)) (@ffun_of_fmap K (Equality.sort V) (@val (@finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V))) (fun x : @finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V)) => @FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Equality.sort V) x)) (fun k : @fset_sub_type K (@domf K (Equality.sort V) x) => @FiniteQuant.all (@fset_sub_finType K (@domf K (Equality.sort V) x)) (FiniteQuant.Quantified (negb (@eq_op V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) x)) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) x) k) (default (@val (Choice.sort K) (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Equality.sort V) x))) (@fset_sub_subType K (@domf K (Equality.sort V) x)) k))))) k)) (@fsfun_subType K V default) f)) k) (@fnd K (Equality.sort V) (@domf K (Equality.sort V) (@val (@finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V))) (fun x : @finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V)) => @FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Equality.sort V) x)) (fun k : @fset_sub_type K (@domf K (Equality.sort V) x) => @FiniteQuant.all (@fset_sub_finType K (@domf K (Equality.sort V) x)) (FiniteQuant.Quantified (negb (@eq_op V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) x)) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) x) k) (default (@val (Choice.sort K) (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Equality.sort V) x))) (@fset_sub_subType K (@domf K (Equality.sort V) x)) k))))) k)) (@fsfun_subType K V default) f')) (@ffun_of_fmap K (Equality.sort V) (@val (@finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V))) (fun x : @finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V)) => @FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Equality.sort V) x)) (fun k : @fset_sub_type K (@domf K (Equality.sort V) x) => @FiniteQuant.all (@fset_sub_finType K (@domf K (Equality.sort V) x)) (FiniteQuant.Quantified (negb (@eq_op V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) x)) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) x) k) (default (@val (Choice.sort K) (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Equality.sort V) x))) (@fset_sub_subType K (@domf K (Equality.sort V) x)) k))))) k)) (@fsfun_subType K V default) f')) k) *) have [vf|vNf] := boolP (_ \in codomf f); rewrite /= ?(andbF,andbT) ?if_same //. (* Goal: is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) a)) (@mem (Choice.sort K) (finSetPredType K) (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f))) *) (* Goal: @ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x1) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Choice.sort K) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K S a)) (@mem (Choice.sort K) (finSetPredType K) S)))) *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite -/(_ || _); apply/existsP/idP => /= [[k' /andP[xk /eqP <-]]|]. (* Goal: is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) a)) (@mem (Choice.sort K) (finSetPredType K) (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f))) *) (* Goal: @ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x1) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Choice.sort K) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K S a)) (@mem (Choice.sort K) (finSetPredType K) S)))) *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite orbC -implybE; apply/implyP => eq_fk. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite inE /= in xk; apply/existsP; exists k'; rewrite // xk eq_fk. (* Goal: @eq (option (Equality.sort V)) (@fnd K (Equality.sort V) (@domf K (Equality.sort V) (@val (@finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V))) (fun x : @finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V)) => @FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Equality.sort V) x)) (fun k : @fset_sub_type K (@domf K (Equality.sort V) x) => @FiniteQuant.all (@fset_sub_finType K (@domf K (Equality.sort V) x)) (FiniteQuant.Quantified (negb (@eq_op V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) x)) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) x) k) (default (@val (Choice.sort K) (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Equality.sort V) x))) (@fset_sub_subType K (@domf K (Equality.sort V) x)) k))))) k)) (@fsfun_subType K V default) f)) (@ffun_of_fmap K (Equality.sort V) (@val (@finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V))) (fun x : @finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V)) => @FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Equality.sort V) x)) (fun k : @fset_sub_type K (@domf K (Equality.sort V) x) => @FiniteQuant.all (@fset_sub_finType K (@domf K (Equality.sort V) x)) (FiniteQuant.Quantified (negb (@eq_op V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) x)) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) x) k) (default (@val (Choice.sort K) (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Equality.sort V) x))) (@fset_sub_subType K (@domf K (Equality.sort V) x)) k))))) k)) (@fsfun_subType K V default) f)) k) (@fnd K (Equality.sort V) (@domf K (Equality.sort V) (@val (@finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V))) (fun x : @finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V)) => @FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Equality.sort V) x)) (fun k : @fset_sub_type K (@domf K (Equality.sort V) x) => @FiniteQuant.all (@fset_sub_finType K (@domf K (Equality.sort V) x)) (FiniteQuant.Quantified (negb (@eq_op V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) x)) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) x) k) (default (@val (Choice.sort K) (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Equality.sort V) x))) (@fset_sub_subType K (@domf K (Equality.sort V) x)) k))))) k)) (@fsfun_subType K V default) f')) (@ffun_of_fmap K (Equality.sort V) (@val (@finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V))) (fun x : @finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V)) => @FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Equality.sort V) x)) (fun k : @fset_sub_type K (@domf K (Equality.sort V) x) => @FiniteQuant.all (@fset_sub_finType K (@domf K (Equality.sort V) x)) (FiniteQuant.Quantified (negb (@eq_op V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) x)) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) x) k) (default (@val (Choice.sort K) (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Equality.sort V) x))) (@fset_sub_subType K (@domf K (Equality.sort V) x)) k))))) k)) (@fsfun_subType K V default) f')) k) *) have /imfsetP /= [[l lf] _ ->] := vf; rewrite orbC. (* Goal: Bool.reflect (@ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x1) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Equality.sort (Choice.eqType K)) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) a)) (@mem (Choice.sort K) (finSetPredType K) S))))) (fsinjectiveb f) *) have [->|neq_f _] := altP (f.[lf] =P _). (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> /existsP [m /andP[Nmk /eqP <-]]; exists m; rewrite eqxx inE Nmk. (* Goal: @ex (@fset_sub_type K (@domf K (Choice.sort V) f)) (fun x : @fset_sub_type K (@domf K (Choice.sort V) f) => is_true (andb (negb (@in_mem (Choice.sort K) (@fsval K (@domf K (Choice.sort V) f) x) (@mem (Choice.sort K) (finSetPredType K) (@fset1 K k)))) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) x) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) l lf))))) *) exists [` lf]; rewrite eqxx andbT inE /=. (* Goal: is_true (@fsubset K (@FinSupp.fs K V (fun a : Choice.sort K => default a) (@fsfun_of_ffun key K V S (fun a : @fset_sub_type K S => h a) (fun a : Choice.sort K => default a))) S) *) apply: contra neq_f => /eqP eq_lk; rewrite eq_lk in lf *. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply/eqP; congr f.[_]; apply: bool_irrelevance. Qed. Lemma codomf_set f (k : K) (v : V) (kf : k \in domf f) : (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) codomf f.[k <- v] = v |` codomf f.[~ k]. Proof. (* Goal: @eq (@finset_of V (Phant (Choice.sort V))) (codomf (@setf K (Choice.sort V) f k v)) (@fsetU V (@fset1 V v) (codomf (@restrictf K (Choice.sort V) f (@fsetD K (@domf K (Choice.sort V) f) (@fset1 K k))))) *) rewrite -setf_rem1; apply/fsetP=> v'; rewrite !inE. (* Goal: Bool.reflect (@ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x1) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Equality.sort (Choice.eqType K)) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) a)) (@mem (Choice.sort K) (finSetPredType K) S))))) (fsinjectiveb f) *) have [->|neq_v'v] /= := altP eqP. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply/codomfP; exists k; rewrite fnd_set eqxx. apply/codomfP/codomfP => [] [k' fk'_eq]; exists k'; move: fk'_eq; rewrite fnd_set. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by have [_ [eq_vv']|//] := altP eqP; rewrite eq_vv' eqxx in neq_v'v *. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by have [->|//] := altP eqP; rewrite fnd_rem inE eqxx. Qed. End FinMapKeyType. Module Import FinmapInE. Definition inE := (inE, mem_codomf, mem_catf, mem_remfF, mem_filterf, mem_reducef, mem_restrictf, mem_remf, mem_remf1, mem_setf). End FinmapInE. Section FsfunDef. Variables (K : choiceType) (V : eqType) (default : K -> V). Record fsfun := Fsfun { (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) fmap_of_fsfun : {fmap K -> V}; _ : [forall k : domf fmap_of_fsfun, fmap_of_fsfun k != default (val k)] }. Canonical fsfun_subType := Eval hnf in [subType for fmap_of_fsfun]. Definition fsfun_eqMixin := [eqMixin of fsfun by <:]. Canonical fsfun_eqType := EqType fsfun fsfun_eqMixin. Fact fsfun_subproof (f : fsfun) : forall (k : K) (kf : k \in fmap_of_fsfun f), (fmap_of_fsfun f).[kf]%fmap != default k. Proof. (* Goal: @eq (Equality.sort V) (@Option.default (Equality.sort V) (default (@fsval K S u)) (@fnd K (Equality.sort V) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) (@FunFinfun.finfun (@fset_sub_finType K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a))))))))) (Equality.sort V) (fun a : @fset_sub_type K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) => h (@fincl K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (@fsval K S) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun x : @fset_sub_type K S => negb (@eq_op V (h x) (default (@fsval K S x)))))))) S (@fset_sub_val imfset_key K S (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0))))))) a))) (@fsval K S u))) (h u) *) case:f => f f_stable k kf /=. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) exact: (forallP f_stable [` kf]). Qed. Definition fun_of_fsfun (f : fsfun) (k : K) := odflt (default k) (fmap_of_fsfun f).[? k]%fmap. End FsfunDef. Coercion fun_of_fsfun : fsfun >-> Funclass. Module Type FinSuppSig. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Axiom fs : forall (K : choiceType) (V : eqType) (default : K -> V), (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) fsfun default -> {fset K}. Axiom E : fs = (fun K V d f => domf (@fmap_of_fsfun K V d f)). End FinSuppSig. Module FinSupp : FinSuppSig. Definition fs := (fun K V d f => domf (@fmap_of_fsfun K V d f)). Definition E := erefl fs. End FinSupp. Notation finsupp := FinSupp.fs. Canonical unlockable_finsupp := Unlockable FinSupp.E. Section FSfunBasics. Variables (K : choiceType) (V : eqType) (default : K -> V). Implicit Types (f : fsfun default) (k : K) (v : V). Lemma mem_finsupp f k : (k \in finsupp f) = (f k != default k). Proof. (* Goal: @eq bool (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@FinSupp.fs K V default f))) (negb (@eq_op V (@fun_of_fsfun K V default f k) (default k))) *) rewrite /fun_of_fsfun [finsupp]unlock; case: fndP; rewrite ?eqxx //=. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> kf; rewrite fsfun_subproof. Qed. Lemma memNfinsupp f k : (k \notin finsupp f) = (f k == default k). Proof. by rewrite mem_finsupp negbK. Qed. Lemma fsfun_dflt f k : k \notin finsupp f -> f k = default k. Proof. by rewrite mem_finsupp negbK => /eqP. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) CoInductive fsfun_spec f k : V -> bool -> Type := (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) | FsfunOut : k \notin finsupp f -> fsfun_spec f k (default k) false | FsfunIn (kf : k \in finsupp f) : fsfun_spec f k (f k) true. Lemma finsuppP f k : fsfun_spec f k (f k) (k \in finsupp f). Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) have [kf|kNf] := boolP (_ \in _); first by constructor. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite fsfun_dflt // ; constructor. Qed. Lemma fsfunP f f' : f =1 f' <-> f = f'. Proof. (* Goal: iff (@eqfun (Equality.sort V) (Choice.sort K) (@fun_of_fsfun K V default f) (@fun_of_fsfun K V default f')) (@eq (@fsfun K V default) f f') *) split=> [eq_fg|->//]; apply/val_inj/fmapP => k. (* Goal: @eq (option (Equality.sort V)) (@fnd K (Equality.sort V) (@domf K (Equality.sort V) (@val (@finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V))) (fun x : @finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V)) => @FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Equality.sort V) x)) (fun k : @fset_sub_type K (@domf K (Equality.sort V) x) => @FiniteQuant.all (@fset_sub_finType K (@domf K (Equality.sort V) x)) (FiniteQuant.Quantified (negb (@eq_op V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) x)) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) x) k) (default (@val (Choice.sort K) (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Equality.sort V) x))) (@fset_sub_subType K (@domf K (Equality.sort V) x)) k))))) k)) (@fsfun_subType K V default) f)) (@ffun_of_fmap K (Equality.sort V) (@val (@finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V))) (fun x : @finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V)) => @FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Equality.sort V) x)) (fun k : @fset_sub_type K (@domf K (Equality.sort V) x) => @FiniteQuant.all (@fset_sub_finType K (@domf K (Equality.sort V) x)) (FiniteQuant.Quantified (negb (@eq_op V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) x)) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) x) k) (default (@val (Choice.sort K) (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Equality.sort V) x))) (@fset_sub_subType K (@domf K (Equality.sort V) x)) k))))) k)) (@fsfun_subType K V default) f)) k) (@fnd K (Equality.sort V) (@domf K (Equality.sort V) (@val (@finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V))) (fun x : @finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V)) => @FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Equality.sort V) x)) (fun k : @fset_sub_type K (@domf K (Equality.sort V) x) => @FiniteQuant.all (@fset_sub_finType K (@domf K (Equality.sort V) x)) (FiniteQuant.Quantified (negb (@eq_op V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) x)) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) x) k) (default (@val (Choice.sort K) (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Equality.sort V) x))) (@fset_sub_subType K (@domf K (Equality.sort V) x)) k))))) k)) (@fsfun_subType K V default) f')) (@ffun_of_fmap K (Equality.sort V) (@val (@finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V))) (fun x : @finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V)) => @FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Equality.sort V) x)) (fun k : @fset_sub_type K (@domf K (Equality.sort V) x) => @FiniteQuant.all (@fset_sub_finType K (@domf K (Equality.sort V) x)) (FiniteQuant.Quantified (negb (@eq_op V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) x)) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) x) k) (default (@val (Choice.sort K) (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Equality.sort V) x))) (@fset_sub_subType K (@domf K (Equality.sort V) x)) k))))) k)) (@fsfun_subType K V default) f')) k) *) have := eq_fg k; rewrite /(f _) /(f' _) /=. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) case: fndP; case: fndP => //= kf kf'; first by move->. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move/eqP/negPn; rewrite fsfun_subproof. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move/eqP/negPn; rewrite eq_sym fsfun_subproof. Qed. Lemma fsfun_injective_inP f (T : {fset K}) : reflect {in T &, injective f} (injectiveb [ffun x : T => f (val x)]). Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) apply: (iffP (@injectiveP _ _ _)) => f_inj a b; last first. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite !ffunE => *; apply: val_inj; apply: f_inj => //; apply: valP. (* Goal: forall (_ : is_true (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) T))) (_ : is_true (@in_mem (Choice.sort K) b (@mem (Choice.sort K) (finSetPredType K) T))) (_ : @eq (Equality.sort V) (@fun_of_fsfun K V default f a) (@fun_of_fsfun K V default f b)), @eq (Choice.sort K) a b *) move=> aT bT eq_ga_gb; have := f_inj.[aT].[bT]; rewrite !ffunE /=. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> /(_ eq_ga_gb) /(congr1 val). Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Definition fsfun_of_can_ffun (T : {fset K}) (g : {ffun T -> V}) (can_g : forall k : T, g k != default (val k)) := @Fsfun K V default (FinMap g) (appP forallP idP can_g). (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma fsfun_of_can_ffunE (T : {fset K}) (g : {ffun T -> V}) (can_g : forall k : T , g k != default (val k)) k (kg : k \in T) : (fsfun_of_can_ffun can_g) k = g.[kg]. Proof. by rewrite/fun_of_fsfun in_fnd. Qed. End FSfunBasics. Notation "{ 'fsfun' ty 'for' dflt }" := (fsfun (dflt : ty)) (at level 0, format "{ 'fsfun' ty 'for' dflt }") : type_scope. Notation "{ 'fsfun' ty 'of' x => dflt }" := {fsfun ty for fun x => dflt} (at level 0, x at level 99, format "{ 'fsfun' ty 'of' x => dflt }") : type_scope. Notation "{ 'fsfun' ty 'with' dflt }" := {fsfun ty of _ => dflt} (at level 0, format "{ 'fsfun' ty 'with' dflt }") : type_scope. Notation "{ 'fsfun' ty }" := {fsfun ty of x => x} (at level 0, format "{ 'fsfun' ty }") : type_scope. Notation "{ 'fsfun' 'for' dflt }" := {fsfun _ for dflt} (at level 0, only parsing) : type_scope. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Notation "{ 'fsfun' 'of' x : T => dflt }" := {fsfun T -> _ of x => dflt} (at level 0, x at level 99, only parsing) : type_scope. Notation "{ 'fsfun' 'of' x => dflt }" := {fsfun of x : _ => dflt} (at level 0, x at level 99, only parsing) : type_scope. Notation "{ 'fsfun' 'with' dflt }" := {fsfun of _ => dflt} (at level 0, only parsing) : type_scope. Module Type FsfunSig. Section FsfunSig. Variables (K : choiceType) (V : eqType) (default : K -> V). Parameter of_ffun : forall (S : {fset K}), (S -> V) -> unit -> fsfun default. Variables (S : {fset K}) (h : S -> V). Axiom of_ffunE :forall key x, of_ffun h key x = odflt (default x) (omap h (insub x)). End FsfunSig. End FsfunSig. Module Fsfun : FsfunSig. Section FsfunOfFinfun. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Variables (K : choiceType) (V : eqType) (default : K -> V) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (S : {fset K}) (h : S -> V). Let fmap := [fmap a : [fsetval a in {: S} | h a != default (val a)] => h (fincl (fset_sub_val _ _) a)]. Fact fmapP a : fmap a != default (val a). Proof. (* Goal: @eq bool (@fsubset K A (@fsetI K B C)) (andb (@fsubset K A B) (@fsubset K A C)) *) rewrite ffunE; have /in_fset_valP [a_in_S] := valP a. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by have -> : [` a_in_S] = fincl (fset_sub_val _ _) a by exact/val_inj. Qed. Definition of_ffun (k : unit) := fsfun_of_can_ffun fmapP. Lemma of_ffunE key x : of_ffun key x = odflt (default x) (omap h (insub x)). Proof. (* Goal: @eq (Equality.sort V) (@fun_of_fsfun K V default (of_ffun key) x) (@Option.default (Equality.sort V) (default x) (@Option.map (@fset_sub_type K S) (Equality.sort V) h (@insub (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) x))) *) rewrite /fun_of_fsfun /=. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) case: insubP => /= [u _ <-|xNS]; last first. (* Goal: @eq (Equality.sort V) (@Option.default (Equality.sort V) (default x) (@fnd K (Equality.sort V) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) (@FunFinfun.finfun (@fset_sub_finType K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a))))))))) (Equality.sort V) (fun a : @fset_sub_type K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) => h (@fincl K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (@fsval K S) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun x : @fset_sub_type K S => negb (@eq_op V (h x) (default (@fsval K S x)))))))) S (@fset_sub_val imfset_key K S (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0))))))) a))) x)) (default x) *) (* Goal: @eq (Equality.sort V) (@Option.default (Equality.sort V) (default (@fsval K S u)) (@fnd K (Equality.sort V) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) (@FunFinfun.finfun (@fset_sub_finType K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a))))))))) (Equality.sort V) (fun a : @fset_sub_type K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) => h (@fincl K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (@fsval K S) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun x : @fset_sub_type K S => negb (@eq_op V (h x) (default (@fsval K S x)))))))) S (@fset_sub_val imfset_key K S (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0))))))) a))) (@fsval K S u))) (h u) *) case: fndP => //= kf; rewrite !ffunE /=. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by set y := (X in h X); rewrite (valP y) in xNS. (* Goal: @eq (Equality.sort V) (@Option.default (Equality.sort V) (default (@fsval K S u)) (@fnd K (Equality.sort V) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) (@FunFinfun.finfun (@fset_sub_finType K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a))))))))) (Equality.sort V) (fun a : @fset_sub_type K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) => h (@fincl K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (@fsval K S) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun x : @fset_sub_type K S => negb (@eq_op V (h x) (default (@fsval K S x)))))))) S (@fset_sub_val imfset_key K S (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0))))))) a))) (@fsval K S u))) (h u) *) case: fndP => /= [kf|]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite ffunE; congr (h _); apply/val_inj => //. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite inE /= -topredE /= negbK => /eqP ->. Qed. End FsfunOfFinfun. End Fsfun. Canonical fsfun_of_funE K V default S h key x := Unlockable (@Fsfun.of_ffunE K V default S h key x). Fact fsfun_key : unit. Proof. exact: tt. Qed. Definition fsfun_of_ffun key (K : choiceType) (V : eqType) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (S : {fset K}) (h : S -> V) (default : K -> V) := (Fsfun.of_ffun default h key). (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Definition fsfun_choiceMixin (K V : choiceType) (d : K -> V) := [choiceMixin of fsfun d by <:]. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Canonical fsfun_choiceType (K V : choiceType) (d : K -> V) := ChoiceType (fsfun d) (fsfun_choiceMixin d). Delimit Scope fsfun_scope with fsfun. Notation "[ 'fsfun[' key ] x : aT => F | default ]" := (fsfun_of_ffun key (fun x : aT => F) (fun x => default)) (at level 0, x at level 99, only parsing) : fun_scope. Notation "[ 'fsfun' x : aT => F | default ]" := [fsfun[fsfun_key] x : aT => F | default] (at level 0, x at level 99, only parsing) : fun_scope. Notation "[ 'fsfun[' key ] x : aT => F ]" := [fsfun[key] x : aT => F | _] (at level 0, x at level 99, only parsing) : fun_scope. Notation "[ 'fsfun' x : aT => F ]" := [fsfun x : aT => F | _] (at level 0, x at level 99, only parsing) : fun_scope. Notation "[ 'fsfun[' key ] x => F | default ]" := [fsfun[key] x : _ => F | default ] (at level 0, x at level 99, only parsing) : fun_scope. Notation "[ 'fsfun' x => F | default ]" := [fsfun x : _ => F | default] (at level 0, x at level 99, only parsing) : fun_scope. Notation "[ 'fsfun[' key ] x => F ]" := [fsfun[key] x => F | _] (at level 0, x at level 99, only parsing) : fun_scope. Notation "[ 'fsfun' x => F ]" := [fsfun x => F | _] (at level 0, x at level 99, only parsing) : fun_scope. Notation "[ 'fsfun[' key ]=> F | default ]" := [fsfun[key] _ => F | default ] (at level 0, only parsing) : fun_scope. Notation "[ 'fsfun=>' F | default ]" := [fsfun _ => F | default] (at level 0, only parsing) : fun_scope. Notation "[ 'fsfun[' key ]=> F ]" := [fsfun[key]=> F | _] (at level 0, only parsing) : fun_scope. Notation "[ 'fsfun=>' F ]" := [fsfun=> F | _] (at level 0, only parsing) : fun_scope. Definition fsfun_of_fun key (K : choiceType) (V : eqType) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (S : {fset K}) (h : K -> V) default := [fsfun[key] x : S => h (val x) | default x]. Notation "[ 'fsfun[' key ] x 'in' S => F | default ]" := (fsfun_of_fun key S (fun x => F) (fun x => default)) (at level 0, x at level 99, only parsing) : fun_scope. Notation "[ 'fsfun' x 'in' S => F | default ]" := [fsfun[fsfun_key] x in S => F | default] (at level 0, x at level 99, only parsing) : fun_scope. Notation "[ 'fsfun[' key ] x 'in' S => F ]" := [fsfun[key] x in S => F | _] (at level 0, x at level 99, only parsing) : fun_scope. Notation "[ 'fsfun' x 'in' S => F ]" := [fsfun[fsfun_key] x in S => F | _] (at level 0, x at level 99, only parsing) : fun_scope. Notation "[ 'fsfun[' key ] 'in' S => F | default ]" := [fsfun[key] _ in S => F | default] (at level 0, only parsing) : fun_scope. Notation "[ 'fsfun' 'in' S => F | default ]" := [fsfun[fsfun_key] in S => F | default] (at level 0, only parsing) : fun_scope. Notation "[ 'fsfun[' key ] 'in' S => F ]" := [fsfun[key] in S => F | _] (at level 0, only parsing) : fun_scope. Notation "[ 'fsfun' 'in' S => F ]" := [fsfun[fsfun_key] in S => F | _] (at level 0, only parsing) : fun_scope. (* only printing *) Notation "[ 'fs' 'fun' x : aT => F ]" := [fsfun[_] x : aT => F] (at level 0, x at level 99, format "[ 'fs' 'fun' x : aT => F ]") : fun_scope. Notation "[ 'fs' 'fun' x 'in' aT => F ]" := [fsfun[_] x in aT => F] (at level 0, x at level 99, format "[ 'fs' 'fun' x 'in' aT => F ]") : fun_scope. Fact fsfun0_key : unit. Proof. exact: tt. Qed. Notation "[ 'fsfun' 'for' default ]" := (fsfun_of_ffun fsfun0_key [fmap] default) (at level 0, only parsing) : fun_scope. Notation "[ 'fsfun' 'of' x => default ]" := [fsfun for fun x => default] (at level 0, x at level 99, only parsing) : fun_scope. Notation "[ 'fsfun' 'with' default ]" := [fsfun of _ => default] (at level 0, only parsing) : fun_scope. Notation "[ 'fsfun' ]" := [fsfun for _] (at level 0, format "[ 'fsfun' ]") : fun_scope. Section FsfunTheory. Variables (key : unit) (K : choiceType) (V : eqType) (default : K -> V). (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma fsfun_ffun (S : {fset K}) (h : S -> V) (x : K) : [fsfun[key] a : S => h a | default a] x = odflt (default x) (omap h (insub x)). Proof. by rewrite unlock. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma fsfun_fun (S : {fset K}) (h : K -> V) (x : K) : [fsfun[key] a in S => h a | default a] x = if x \in S then h x else (default x). Proof. by rewrite fsfun_ffun; case: insubP => //= [u -> ->|/negPf ->]. Qed. Lemma fsfun0E : [fsfun for default] =1 default. Proof. by move=> x; rewrite unlock insubF ?inE. Qed. Definition fsfunE := (fsfun_fun, fsfun0E). (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Lemma finsupp_sub (S : {fset K}) (h : S -> V) : finsupp [fsfun[key] a : S => h a | default a] `<=` S. Proof. (* Goal: is_true (@fsubset K (@FinSupp.fs K V (fun a : Choice.sort K => default a) (@fsfun_of_ffun key K V S (fun a : @fset_sub_type K S => h a) (fun a : Choice.sort K => default a))) S) *) apply/fsubsetP => a; rewrite mem_finsupp unlock /=. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by case: insubP => //=; rewrite eqxx. Qed. Lemma finsupp0 : finsupp [fsfun for default] = fset0. Proof. by apply/fsetP => x; rewrite !inE mem_finsupp fsfunE eqxx. Qed. Lemma fsfun0_inj : injective default -> injective [fsfun for default]. Proof. by move=> def_inj x y; rewrite !fsfunE => /def_inj. Qed. Lemma in_finsupp0 x : x \in finsupp [fsfun for default] = false. Proof. by rewrite finsupp0 inE. Qed. End FsfunTheory. Module Import FsfunInE2. Definition inE := (inE, in_finsupp0). End FsfunInE2. Section FsfunIdTheory. Variables (K : choiceType). Implicit Types (f g : {fsfun K -> K}). Fact fsfun_comp_key : unit. Proof. exact: tt. Qed. Definition fsfun_comp g f : {fsfun _} := [fsfun[fsfun_comp_key] k in finsupp f `|` finsupp g => g (f k)]. Notation "g \o f" := (fsfun_comp g f) : fsfun_scope. Lemma fscompE g f : (g \o f)%fsfun =1 g \o f. Proof. (* Goal: @eqfun (Equality.sort (Choice.eqType K)) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) (fsfun_comp g f)) (@funcomp (Equality.sort (Choice.eqType K)) (Choice.sort K) (Choice.sort K) tt (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) g) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f)) *) move=> k; rewrite fsfun_ffun; case: insubP => //= [u _ <- //|]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite inE => /norP [kNf kNg]; rewrite !fsfun_dflt. Qed. Lemma fscomp0f : left_id [fsfun] fsfun_comp. Proof. by move=> f; apply/fsfunP=> k; rewrite fscompE /= fsfun0E. Qed. Lemma fscompA : associative fsfun_comp. Proof. by move=> f g h; apply/fsfunP => k; rewrite !fscompE /= !fscompE. Qed. Lemma fscomp_inj g f : injective f -> injective g -> injective (g \o f)%fsfun. Proof. by move=> f_inj g_inj k k'; rewrite !fscompE => /= /g_inj /f_inj. Qed. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) Definition fsinjectiveb : pred {fsfun K -> K} := [pred f | (injectiveb [ffun a : finsupp f => f (val a)]) && [forall a : finsupp f, f (val a) \in finsupp f]]. Let equivalent (Ps : seq Prop) := if Ps is P0 :: Ps then let fix aux (P : Prop) (Qs : seq Prop) := (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) if Qs is Q :: Qs then (P -> Q) /\ (aux Q Qs) else P -> P0 in aux P0 Ps else True. Lemma fsinjective_subproof f : equivalent [:: injective f ; let S := finsupp f in {in S &, injective f} /\ forall a : S, f (val a) \in S ; exists2 S : {fset K}, (finsupp f `<=` S) & {in S &, injective f} /\ forall a : S, f (val a) \in S]. Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) split => /= [f_inj|]; last split=> [[f_inj f_st]|[S fS [f_inj f_st]] a b]. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) - split=> [a b ? ?|a]; first exact: f_inj. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite mem_finsupp (inj_eq f_inj) -mem_finsupp; apply/valP. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) - by exists (finsupp f)=> //; apply: fsubset_refl. (* Goal: Bool.reflect (@ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x1) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Equality.sort (Choice.eqType K)) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) a)) (@mem (Choice.sort K) (finSetPredType K) S))))) (fsinjectiveb f) *) have Nfinsupp := contra (fsubsetP fS _). (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) wlog /andP [aS bNS] : a b / (a \in S) && (b \notin S) => [hwlog|]; last first. (* Goal: @big_rel_class_of (@finset_of K (Phant (Choice.sort K))) (@fsubset K) *) rewrite (fsfun_dflt (Nfinsupp _ bNS)) => fb_eq_a. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) by move: bNS; rewrite -fb_eq_a (f_st.[aS]). (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) have [[aS|aNS] [bS|bNS]] := (boolP (a \in S), boolP (b \in S)); first 3 last. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) - by rewrite !fsfun_dflt // ?Nfinsupp. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) - exact: f_inj. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) - by apply: hwlog; rewrite aS. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> fab; symmetry; apply: hwlog; rewrite // bS. Qed. Lemma fsinjectiveP f : reflect (injective f) (fsinjectiveb f). Proof. (* Goal: Bool.reflect (@ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x1) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Equality.sort (Choice.eqType K)) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) a)) (@mem (Choice.sort K) (finSetPredType K) S))))) (fsinjectiveb f) *) have [H1 [H2 H3]]:= fsinjective_subproof f. (* Goal: is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) a)) (@mem (Choice.sort K) (finSetPredType K) (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f))) *) (* Goal: @ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x1) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Choice.sort K) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K S a)) (@mem (Choice.sort K) (finSetPredType K) S)))) *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite /fsinjectiveb; apply: (iffP idP)=> [|]. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> /andP [/fsfun_injective_inP ? /forallP ?]; apply/H3/H2. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by move=> /H1 [/fsfun_injective_inP ? /forallP ?]; apply/andP. Qed. Lemma fsinjectivebP f : reflect (exists2 S : {fset K}, (finsupp f `<=` S) & {in S &, injective f} /\ forall a : S, f (val a) \in S) (fsinjectiveb f). Proof. (* Goal: Bool.reflect (@ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x1) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Equality.sort (Choice.eqType K)) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) a)) (@mem (Choice.sort K) (finSetPredType K) S))))) (fsinjectiveb f) *) have [H1 [H2 H3]]:= fsinjective_subproof f. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by apply: (iffP (fsinjectiveP _)) => //; by move=> /H1 /H2. Qed. End FsfunIdTheory. Definition inE := inE. Export BigEnough. Module BigEnoughFSet. Definition big_rel_fsubset_class K : big_rel_class_of (@fsubset K). Proof. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) exists fsubset (fun G => \bigcup_(g <- G) g) => [|g s|g1 g2 j] //. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite big_cons fsubsetUl. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite big_cons => h; rewrite fsubsetU // h orbT. Qed. Canonical big_enough_fset K := BigRelOf (big_rel_fsubset_class K). Ltac fset_big_enough_trans := match goal with (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) | [leq : is_true (?A `<=` ?B) |- is_true (?X `<=` ?B)] => apply: fsubset_trans leq; big_enough; olddone end. Ltac done := do [fset_big_enough_trans|BigEnough.done]. Ltac pose_big_fset K i := evar (i : {fset K}); suff : closed i; first do [move=> _; instantiate (1 := bigger_than (@fsubset K) _) in (Value of i)]. End BigEnoughFSet.
From mathcomp Require Import ssreflect ssrbool eqtype ssrfun ssrnat choice seq. From mathcomp Require Import fintype tuple bigop path. (***********************************************************************) (* Experimental library of generic sets *) (* ==================================== *) (* Contains two structures: *) (* semisetType == families of sets, without total set (e.g. {fset T}) *) (* setType == families of sets, with total set *) (* (e.g. {set T} or {SAset R^n}) *) (***********************************************************************) From mathcomp Require Import order. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Reserved Notation "x \subset y" (at level 70, y at next level). Reserved Notation "x \contains y" (at level 70, y at next level, only parsing). Reserved Notation "x \proper y" (at level 70, y at next level). Reserved Notation "x \containsproper y" (at level 70, y at next level, only parsing). Reserved Notation "x \subset y :> T" (at level 70, y at next level). Reserved Notation "x \contains y :> T" (at level 70, y at next level, only parsing). Reserved Notation "x \proper y :> T" (at level 70, y at next level). Reserved Notation "x \containsproper y :> T" (at level 70, y at next level, only parsing). Reserved Notation "\subsets y" (at level 35). Reserved Notation "\supersets y" (at level 35). Reserved Notation "\propersets y" (at level 35). Reserved Notation "\superpropersets y" (at level 35). Reserved Notation "\subsets y :> T" (at level 35, y at next level). Reserved Notation "\supersets y :> T" (at level 35, y at next level). Reserved Notation "\propersets y :> T" (at level 35, y at next level). Reserved Notation "\superpropersets y :> T" (at level 35, y at next level). Reserved Notation "x \subset y \subset z" (at level 70, y, z at next level). Reserved Notation "x \proper y \subset z" (at level 70, y, z at next level). Reserved Notation "x \subset y \proper z" (at level 70, y, z at next level). Reserved Notation "x \proper y \proper z" (at level 70, y, z at next level). Reserved Notation "x \subset y ?= 'iff' c" (at level 70, y, c at next level, format "x '[hv' \subset y '/' ?= 'iff' c ']'"). Reserved Notation "x \subset y ?= 'iff' c :> T" (at level 70, y, c at next level, format "x '[hv' \subset y '/' ?= 'iff' c :> T ']'"). Reserved Notation "~: A" (at level 35, right associativity). Reserved Notation "[ 'set' ~ a ]" (at level 0, format "[ 'set' ~ a ]"). Reserved Notation "[ 'set' a1 ; a2 ; .. ; an ]" (at level 0, a1 at level 99, format "[ 'set' a1 ; a2 ; .. ; an ]"). Delimit Scope abstract_set_scope with set. Local Open Scope abstract_set_scope. Module SET. Import Order.Theory Order.Syntax Order.Def. Fact display_set : unit -> unit. Proof. exact. Qed. Module Import SetSyntax. Notation "\sub%set" := (@le (display_set _) _) : abstract_set_scope. Notation "\super%set" := (@ge (display_set _) _) : abstract_set_scope. Notation "\proper%set" := (@lt (display_set _) _) : abstract_set_scope. Notation "\superproper%set" := (@gt (display_set _) _) : abstract_set_scope. Notation "\sub?%set" := (@leif (display_set _) _) : abstract_set_scope. Notation "\subsets y" := (\super%set y) : abstract_set_scope. Notation "\subsets y :> T" := (\subsets (y : T)) : abstract_set_scope. Notation "\supersets y" := (\sub%set y) : abstract_set_scope. Notation "\supersets y :> T" := (\supersets (y : T)) : abstract_set_scope. Notation "\propersets y" := (\superproper%set y) : abstract_set_scope. Notation "\propersets y :> T" := (\propersets (y : T)) : abstract_set_scope. Notation "\superpropersets y" := (\proper%set y) : abstract_set_scope. Notation "\superpropersets y :> T" := (\superpropersets (y : T)) : abstract_set_scope. Notation "x \subset y" := (\sub%set x y) : abstract_set_scope. Notation "x \subset y :> T" := ((x : T) \subset (y : T)) : abstract_set_scope. Notation "x \proper y" := (\proper%set x y) : abstract_set_scope. Notation "x \proper y :> T" := ((x : T) \proper (y : T)) : abstract_set_scope. Notation "x \subset y \subset z" := ((x \subset y)%set && (y \subset z)%set) : abstract_set_scope. Notation "x \proper y \subset z" := ((x \proper y)%set && (y \subset z)%set) : abstract_set_scope. Notation "x \subset y \proper z" := ((x \subset y)%set && (y \proper z)%set) : abstract_set_scope. Notation "x \proper y \proper z" := ((x \proper y)%set && (y \proper z)%set) : abstract_set_scope. Notation "x \subset y ?= 'iff' C" := (\sub?%set x y C) : abstract_set_scope. Notation "x \subset y ?= 'iff' C :> R" := ((x : R) \subset (y : R) ?= iff C) (only parsing) : abstract_set_scope. Notation set0 := (@bottom (display_set _) _). Notation setT := (@top (display_set _) _). Notation setU := (@join (display_set _) _). Notation setI := (@meet (display_set _) _). Notation setD := (@sub (display_set _) _). Notation setC := (@compl (display_set _) _). Notation "x :&: y" := (setI x y). Notation "x :|: y" := (setU x y). Notation "x :\: y" := (setD x y). Notation "~: x" := (setC x). Notation "x \subset y" := (\sub%set x y) : bool_scope. Notation "x \proper y" := (\proper%set x y) : bool_scope. End SetSyntax. Ltac EqualityPack cT xclass xT := match type of Equality.Pack with | forall sort : Type, Equality.mixin_of sort -> eqType => (* mathcomp.dev *) exact (@Equality.Pack cT xclass) | _ => (* mathcomp <= 1.7 *) exact (@Equality.Pack cT xclass xT) end. Ltac ChoicePack cT xclass xT := match type of Choice.Pack with | forall sort : Type, Choice.class_of sort -> choiceType => (* mathcomp.dev *) exact (@Choice.Pack cT xclass) | _ => (* mathcomp <= 1.7 *) exact (@Choice.Pack cT xclass xT) end. Module Semiset. Section ClassDef. Variable elementType : Type. (* Universe type *) Variable eqType_of_elementType : elementType -> eqType. Coercion eqType_of_elementType : elementType >-> eqType. Implicit Types (X Y : elementType). Structure mixin_of d (set : elementType -> (cblatticeType (display_set d))) := Mixin { memset : forall X, set X -> X -> bool; set1 : forall X, X -> set X; _ : forall X (x : X), ~~ memset set0 x; (* set0 is empty instead *) _ : forall X (x y : X), memset (set1 y) x = (x == y); _ : forall X (x : X) A, (set1 x \subset A) = (memset A x); _ : forall X (A : set X), (set0 \proper A) -> {x | memset A x} ; (* exists or sig ?? *) _ : forall X (A B : set X), {subset memset A <= memset B} -> A \subset B; _ : forall X (x : X) A B, (memset (A :|: B) x) = (memset A x) || (memset B x); (* there is no closure in a set *) funsort : elementType -> elementType -> Type; fun_of_funsort : forall X Y, funsort X Y -> X -> Y; imset : forall X Y, funsort X Y -> set X -> set Y; _ : forall X Y (f : funsort X Y) (A : set X) (y : Y), reflect (exists2 x : X, memset A x & y = fun_of_funsort f x) (memset (imset f A) y) }. Record class_of d (set : elementType -> Type) := Class { base : forall X, @Order.CBLattice.class_of (display_set d) (set X); mixin : mixin_of (fun X => Order.CBLattice.Pack (base X) (set X)) }. Local Coercion base : class_of >-> Funclass. Structure type d := Pack { sort ; _ : class_of d sort; _ : elementType -> Type }. Local Coercion sort : type >-> Funclass. Variables (set : elementType -> Type) (disp : unit) (cT : type disp). Definition class := let: Pack _ c _ as cT' := cT return class_of _ cT' in c. Definition clone disp' c of (disp = disp') & phant_id class c := @Pack disp' set c set. Let xset := let: Pack set _ _ := cT in set. Notation xclass := (class : class_of _ xset). Definition pack b0 (m0 : mixin_of (fun X=> @Order.CBLattice.Pack (display_set disp) (set X) (b0 X) (set X))) := fun bT b & (forall X, phant_id (@Order.CBLattice.class (display_set disp) (bT X)) (b X)) => fun m & phant_id m0 m => Pack (@Class disp set b m) set. End ClassDef. Section CanonicalDef. Variable elementType : Type. Variable eqType_of_elementType : elementType -> eqType. Coercion eqType_of_elementType : elementType >-> eqType. Notation type := (type eqType_of_elementType). Local Coercion base : class_of >-> Funclass. Local Coercion sort : type >-> Funclass. Variables (set : elementType -> Type) (X : elementType). Variables (disp : unit) (cT : type disp). Local Notation ddisp := (display_set disp). Let xset := let: Pack set _ _ := cT in set. Notation xclass := (@class _ eqType_of_elementType _ cT : class_of eqType_of_elementType _ xset). Definition eqType := ltac:(EqualityPack (cT X) ((@class _ eqType_of_elementType _ cT : class_of eqType_of_elementType _ xset) X) (xset X)). Definition choiceType := ltac:(ChoicePack (cT X) ((@class _ eqType_of_elementType _ cT : class_of eqType_of_elementType _ xset) X) (xset X)). Definition porderType := @Order.POrder.Pack ddisp (cT X) (xclass X) (xset X). Definition latticeType := @Order.Lattice.Pack ddisp (cT X) (xclass X) (xset X). Definition blatticeType := @Order.BLattice.Pack ddisp (cT X) (xclass X) (xset X). Definition cblatticeType := @Order.CBLattice.Pack ddisp (cT X) (xclass X) (xset X). End CanonicalDef. Module Import Exports. Coercion mixin : class_of >-> mixin_of. Coercion base : class_of >-> Funclass. Coercion sort : type >-> Funclass. Coercion eqType : type >-> Equality.type. Coercion choiceType : type >-> Choice.type. Coercion porderType : type >-> Order.POrder.type. Coercion latticeType : type >-> Order.Lattice.type. Coercion blatticeType : type >-> Order.BLattice.type. Coercion cblatticeType : type >-> Order.CBLattice.type. Canonical eqType. Canonical choiceType. Canonical porderType. Canonical latticeType. Canonical blatticeType. Canonical cblatticeType. Notation semisetType := type. Notation semisetMixin := mixin_of. Notation SemisetMixin := Mixin. Notation SemisetType set m := (@pack _ _ set _ _ m _ _ (fun=> id) _ id). Notation "[ 'semisetType' 'of' set 'for' cset ]" := (@clone _ _ set _ cset _ _ erefl id) (at level 0, format "[ 'semisetType' 'of' set 'for' cset ]") : form_scope. Notation "[ 'semisetType' 'of' set 'for' cset 'with' disp ]" := (@clone _ _ set _ cset disp _ (unit_irrelevance _ _) id) (at level 0, format "[ 'semisetType' 'of' set 'for' cset 'with' disp ]") : form_scope. Notation "[ 'semisetType' 'of' set ]" := [semisetType of set for _] (at level 0, format "[ 'semisetType' 'of' set ]") : form_scope. Notation "[ 'semisetType' 'of' set 'with' disp ]" := [semisetType of set for _ with disp] (at level 0, format "[ 'semisetType' 'of' set 'with' disp ]") : form_scope. End Exports. End Semiset. Import Semiset.Exports. Section SemisetOperations. Context {elementType : Type} {eqType_of_elementType : elementType -> eqType}. Coercion eqType_of_elementType : elementType >-> eqType. Context {disp : unit}. Section setfun. Variable (set : semisetType eqType_of_elementType disp). Definition setfun := Semiset.funsort (Semiset.class set). Definition fun_of_setfun X Y (f : setfun X Y) : X -> Y := @Semiset.fun_of_funsort _ _ _ _ (Semiset.class set) _ _ f. Coercion fun_of_setfun : setfun >-> Funclass. End setfun. Context {set : semisetType eqType_of_elementType disp}. Variable X Y : elementType. Definition memset : set X -> X -> bool := @Semiset.memset _ _ _ _ (Semiset.class set) _. Definition set1 : X -> set X := @Semiset.set1 _ _ _ _ (Semiset.class set) _. Definition imset : setfun set X Y -> set X -> set Y:= @Semiset.imset _ _ _ _ (Semiset.class set) _ _. Canonical set_predType := Eval hnf in mkPredType memset. Structure setpredType := SetPredType { setpred_sort :> Type; tosetpred : setpred_sort -> pred X; _ : {mem : setpred_sort -> mem_pred X | isMem tosetpred mem}; _ : {pred_fset : setpred_sort -> set X | forall p x, x \in pred_fset p = tosetpred p x} }. Canonical setpredType_predType (fpX : setpredType) := @PredType X (setpred_sort fpX) (@tosetpred fpX) (let: SetPredType _ _ mem _ := fpX in mem). Definition predset (fpX : setpredType) : fpX -> set X := let: SetPredType _ _ _ (exist pred_fset _) := fpX in pred_fset. End SemisetOperations. Module Import SemisetSyntax. Notation "[ 'set' x : T | P ]" := (predset (fun x : T => P%B)) (at level 0, x at level 99, only parsing) : abstract_set_scope. Notation "[ 'set' x | P ]" := [set x : _ | P] (at level 0, x, P at level 99, format "[ 'set' x | P ]") : abstract_set_scope. Notation "[ 'set' x 'in' A ]" := [set x | x \in A] (at level 0, x at level 99, format "[ 'set' x 'in' A ]") : abstract_set_scope. Notation "[ 'set' x : T 'in' A ]" := [set x : T | x \in A] (at level 0, x at level 99, only parsing) : abstract_set_scope. Notation "[ 'set' x : T | P & Q ]" := [set x : T | P && Q] (at level 0, x at level 99, only parsing) : abstract_set_scope. Notation "[ 'set' x | P & Q ]" := [set x | P && Q ] (at level 0, x, P at level 99, format "[ 'set' x | P & Q ]") : abstract_set_scope. Notation "[ 'set' x : T 'in' A | P ]" := [set x : T | x \in A & P] (at level 0, x at level 99, only parsing) : abstract_set_scope. Notation "[ 'set' x 'in' A | P ]" := [set x | x \in A & P] (at level 0, x at level 99, format "[ 'set' x 'in' A | P ]") : abstract_set_scope. Notation "[ 'set' x 'in' A | P & Q ]" := [set x in A | P && Q] (at level 0, x at level 99, format "[ 'set' x 'in' A | P & Q ]") : abstract_set_scope. Notation "[ 'set' x : T 'in' A | P & Q ]" := [set x : T in A | P && Q] (at level 0, x at level 99, only parsing) : abstract_set_scope. Notation "[ 'set' a ]" := (set1 a) (at level 0, a at level 99, format "[ 'set' a ]") : abstract_set_scope. Notation "[ 'set' a : T ]" := [set (a : T)] (at level 0, a at level 99, format "[ 'set' a : T ]") : abstract_set_scope. Notation "a |: y" := ([set a] :|: y) : abstract_set_scope. Notation "x :\ a" := (x :\: [set a]) : abstract_set_scope. Notation "[ 'set' a1 ; a2 ; .. ; an ]" := (setU .. (a1 |: [set a2]) .. [set an]). Notation "f @: A" := (imset f A) (at level 24) : abstract_set_scope. End SemisetSyntax. Module Import SemisetTheory. Section SemisetTheory. Variable elementType : Type. Variable eqType_of_elementType : elementType -> eqType. Coercion eqType_of_elementType : elementType >-> eqType. Variable disp : unit. Variable set : semisetType eqType_of_elementType disp. Section setX. Variables X : elementType. Implicit Types (x y : X) (A B C : set X). Lemma notin_set0 (x : X) : x \notin (set0 : set X). Proof. (* Goal: @eq bool (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B))) (orb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B))) *) rewrite /set1 /in_mem /= /memset. (* Goal: forall (A : @Semiset.sort elementType eqType_of_elementType disp set X) (f : @Semiset.funsort elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X Y), Bool.reflect (@ex2 (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (@Semiset.memset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X A x)) (fun x : Equality.sort (eqType_of_elementType X) => @eq (Equality.sort (eqType_of_elementType Y)) y (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x))) (@Semiset.memset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) Y (@Semiset.imset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X Y f A) y) *) case: set => [S [base [memset set1 /= H ? ? ? ? ? ? ? ? ?]] ?] /=. (* Goal: Bool.reflect (@ex2 (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (memset X A x)) (fun x : Equality.sort (eqType_of_elementType X) => @eq (Equality.sort (eqType_of_elementType Y)) y (@fun_of_setfun elementType eqType_of_elementType disp (@Semiset.Pack elementType eqType_of_elementType disp S (@Semiset.Class elementType eqType_of_elementType disp S base (@Semiset.Mixin elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (S X) (base X) (S X)) memset set1 _i_ _e_ _e1_ _s_ _i1_ _e2_ _funsort_ _fun_of_funsort_ _imset_ H)) _T_) X Y f x))) (memset Y (_imset_ X Y f A) y) *) exact: H. Qed. Lemma in_set1 x y : x \in ([set y] : set X) = (x == y). Proof. (* Goal: @eq bool (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B))) (orb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B))) *) rewrite /set1 /in_mem /= /memset. (* Goal: forall (A : @Semiset.sort elementType eqType_of_elementType disp set X) (f : @Semiset.funsort elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X Y), Bool.reflect (@ex2 (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (@Semiset.memset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X A x)) (fun x : Equality.sort (eqType_of_elementType X) => @eq (Equality.sort (eqType_of_elementType Y)) y (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x))) (@Semiset.memset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) Y (@Semiset.imset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X Y f A) y) *) case: set => [S [base [memset set1 /= ? H ? ? ? ? ? ? ? ?]] ?] /=. (* Goal: Bool.reflect (@ex2 (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (memset X A x)) (fun x : Equality.sort (eqType_of_elementType X) => @eq (Equality.sort (eqType_of_elementType Y)) y (@fun_of_setfun elementType eqType_of_elementType disp (@Semiset.Pack elementType eqType_of_elementType disp S (@Semiset.Class elementType eqType_of_elementType disp S base (@Semiset.Mixin elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (S X) (base X) (S X)) memset set1 _i_ _e_ _e1_ _s_ _i1_ _e2_ _funsort_ _fun_of_funsort_ _imset_ H)) _T_) X Y f x))) (memset Y (_imset_ X Y f A) y) *) exact: H. Qed. Lemma sub1set x A : ([set x] \subset A) = (x \in A). Proof. (* Goal: @eq bool (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B))) (orb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B))) *) rewrite /set1 /in_mem /= /memset. (* Goal: forall (A : @Semiset.sort elementType eqType_of_elementType disp set X) (f : @Semiset.funsort elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X Y), Bool.reflect (@ex2 (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (@Semiset.memset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X A x)) (fun x : Equality.sort (eqType_of_elementType X) => @eq (Equality.sort (eqType_of_elementType Y)) y (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x))) (@Semiset.memset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) Y (@Semiset.imset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X Y f A) y) *) case: set A => [S [base [memset set1 /= ? ? H ? ? ? ? ? ? ?]] ?] A /=. (* Goal: Bool.reflect (@ex2 (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (memset X A x)) (fun x : Equality.sort (eqType_of_elementType X) => @eq (Equality.sort (eqType_of_elementType Y)) y (@fun_of_setfun elementType eqType_of_elementType disp (@Semiset.Pack elementType eqType_of_elementType disp S (@Semiset.Class elementType eqType_of_elementType disp S base (@Semiset.Mixin elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (S X) (base X) (S X)) memset set1 _i_ _e_ _e1_ _s_ _i1_ _e2_ _funsort_ _fun_of_funsort_ _imset_ H)) _T_) X Y f x))) (memset Y (_imset_ X Y f A) y) *) exact: H. Qed. Lemma set_gt0_ex A : set0 \proper A -> {x | x \in A}. Proof. (* Goal: @eq bool (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B))) (orb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B))) *) rewrite /set1 /in_mem /= /memset. (* Goal: forall (A : @Semiset.sort elementType eqType_of_elementType disp set X) (f : @Semiset.funsort elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X Y), Bool.reflect (@ex2 (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (@Semiset.memset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X A x)) (fun x : Equality.sort (eqType_of_elementType X) => @eq (Equality.sort (eqType_of_elementType Y)) y (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x))) (@Semiset.memset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) Y (@Semiset.imset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X Y f A) y) *) case: set A => [S [base [memset set1 /= ? ? ? H ? ? ? ? ? ?]] ?] A /=. (* Goal: Bool.reflect (@ex2 (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (memset X A x)) (fun x : Equality.sort (eqType_of_elementType X) => @eq (Equality.sort (eqType_of_elementType Y)) y (@fun_of_setfun elementType eqType_of_elementType disp (@Semiset.Pack elementType eqType_of_elementType disp S (@Semiset.Class elementType eqType_of_elementType disp S base (@Semiset.Mixin elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (S X) (base X) (S X)) memset set1 _i_ _e_ _e1_ _s_ _i1_ _e2_ _funsort_ _fun_of_funsort_ _imset_ H)) _T_) X Y f x))) (memset Y (_imset_ X Y f A) y) *) exact: H. Qed. Lemma subsetP_subproof A B : {subset A <= B} -> A \subset B. Proof. (* Goal: @eq bool (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B))) (orb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B))) *) rewrite /set1 /in_mem /= /memset. (* Goal: forall (A : @Semiset.sort elementType eqType_of_elementType disp set X) (f : @Semiset.funsort elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X Y), Bool.reflect (@ex2 (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (@Semiset.memset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X A x)) (fun x : Equality.sort (eqType_of_elementType X) => @eq (Equality.sort (eqType_of_elementType Y)) y (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x))) (@Semiset.memset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) Y (@Semiset.imset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X Y f A) y) *) case: set A B => [S [base [memset set1 /= ? ? ? ? H ? ? ? ? ?]] ?] /=. (* Goal: Bool.reflect (@ex2 (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (memset X A x)) (fun x : Equality.sort (eqType_of_elementType X) => @eq (Equality.sort (eqType_of_elementType Y)) y (@fun_of_setfun elementType eqType_of_elementType disp (@Semiset.Pack elementType eqType_of_elementType disp S (@Semiset.Class elementType eqType_of_elementType disp S base (@Semiset.Mixin elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (S X) (base X) (S X)) memset set1 _i_ _e_ _e1_ _s_ _i1_ _e2_ _funsort_ _fun_of_funsort_ _imset_ H)) _T_) X Y f x))) (memset Y (_imset_ X Y f A) y) *) exact: H. Qed. Lemma in_setU (x : X) A B : (x \in A :|: B) = (x \in A) || (x \in B). Proof. (* Goal: @eq bool (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B))) (orb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B))) *) rewrite /set1 /in_mem /= /memset. (* Goal: forall (A : @Semiset.sort elementType eqType_of_elementType disp set X) (f : @Semiset.funsort elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X Y), Bool.reflect (@ex2 (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (@Semiset.memset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X A x)) (fun x : Equality.sort (eqType_of_elementType X) => @eq (Equality.sort (eqType_of_elementType Y)) y (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x))) (@Semiset.memset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) Y (@Semiset.imset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X Y f A) y) *) case: set A B => [S [base [memset set1 /= ? ? ? ? ? H ? ? ? ?]] ?] /=. (* Goal: Bool.reflect (@ex2 (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (memset X A x)) (fun x : Equality.sort (eqType_of_elementType X) => @eq (Equality.sort (eqType_of_elementType Y)) y (@fun_of_setfun elementType eqType_of_elementType disp (@Semiset.Pack elementType eqType_of_elementType disp S (@Semiset.Class elementType eqType_of_elementType disp S base (@Semiset.Mixin elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (S X) (base X) (S X)) memset set1 _i_ _e_ _e1_ _s_ _i1_ _e2_ _funsort_ _fun_of_funsort_ _imset_ H)) _T_) X Y f x))) (memset Y (_imset_ X Y f A) y) *) exact: H. Qed. Lemma in_set0 x : x \in (set0 : set X) = false. Proof. by rewrite (negPf (notin_set0 _)). Qed. Lemma subsetP {A B} : reflect {subset A <= B} (A <= B)%O. Proof. (* Goal: is_true (negb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType Y disp set) (@imset elementType eqType_of_elementType disp set X Y f A') (@imset elementType eqType_of_elementType disp set X Y f A))) *) apply: (iffP idP) => [sAB x xA|/subsetP_subproof//]. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by rewrite -sub1set (le_trans _ sAB) // sub1set. Qed. Lemma setP A B : A =i B <-> A = B. Proof. (* Goal: iff (@eq_mem (Equality.sort (eqType_of_elementType X)) (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A) (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B)) (@eq (@Semiset.sort elementType eqType_of_elementType disp set X) A B) *) split=> [eqAB|->//]; apply/eqP; rewrite eq_le. (* Goal: @eq bool (@eq_op (@Semiset.eqType elementType eqType_of_elementType Y disp set) (@imset elementType eqType_of_elementType disp set X Y f A) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType Y disp set))) (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))) *) gen have leAB : A B eqAB / A \subset B; last by rewrite !leAB. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by apply/subsetP => x; rewrite eqAB. Qed. Lemma set1_neq0 (x : X) : [set x] != set0 :> set X. Proof. by apply/negP=> /eqP /setP /(_ x); rewrite in_set0 in_set1 eqxx. Qed. Lemma set1_eq0 x : ([set x] == set0 :> set X) = false. Proof. by rewrite (negPf (set1_neq0 _)). Qed. Lemma set11 x : x \in ([set x] : set X). Proof. by rewrite -sub1set. Qed. Hint Resolve set11. Lemma set1_inj : injective (@set1 _ _ _ set X). Proof. (* Goal: @injective (@Semiset.sort elementType eqType_of_elementType disp set X) (Equality.sort (eqType_of_elementType X)) (@set1 elementType eqType_of_elementType disp set X) *) move=> x y /eqP; rewrite eq_le sub1set => /andP []. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by rewrite in_set1 => /eqP. Qed. Lemma set_0Vmem A : (A = set0) + {x : X | x \in A}. Proof. (* Goal: sum (@eq (@Semiset.sort elementType eqType_of_elementType disp set X) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))) (@sig (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)))) *) have [|AN0] := eqVneq A set0; [left|right] => //. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by move: AN0; rewrite -lt0x => /set_gt0_ex. Qed. Lemma set0Pn A : reflect (exists x, x \in A) (A != set0). Proof. (* Goal: forall _ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A (@set1 elementType eqType_of_elementType disp set X x)), @eq bool (orb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) (@set1 elementType eqType_of_elementType disp set X x) A) (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)))) true *) have [->|[x xA]] := set_0Vmem A; rewrite ?eqxx -?lt0x. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by constructor=> [[x]]; rewrite in_set0. (* Goal: Bool.reflect (@ex (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)))) (@lt (display_set disp) (@Order.BLattice.porderType (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) A) *) suff -> : set0 \proper A by constructor; exists x. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by move: xA; rewrite -sub1set => /(lt_le_trans _)->; rewrite ?lt0x ?set1_eq0. Qed. Lemma subset1 A x : (A \subset [set x]) = (A == [set x]) || (A == set0). Proof. (* Goal: @eq bool (@eq_op (@Semiset.eqType elementType eqType_of_elementType Y disp set) (@imset elementType eqType_of_elementType disp set X Y f A) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType Y disp set))) (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))) *) symmetry; rewrite eq_le; have [] /= := boolP (A \subset [set x]); last first. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by apply: contraNF => /eqP ->; rewrite ?le0x. (* Goal: forall _ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A (@set1 elementType eqType_of_elementType disp set X x)), @eq bool (orb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) (@set1 elementType eqType_of_elementType disp set X x) A) (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)))) true *) have [/eqP->|[y yA]] := set_0Vmem A; rewrite ?orbT // ?sub1set. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by move=> /subsetP /(_ _ yA); rewrite in_set1 => /eqP<-; rewrite yA. Qed. Lemma eq_set1 (x : X) A : (A == [set x]) = (set0 \proper A \subset [set x]). Proof. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by rewrite subset1; have [->|?] := posxP A; rewrite 1?eq_sym ?set1_eq0 ?orbF. Qed. Lemma in_setI A B (x : X) : (x \in A :&: B) = (x \in A) && (x \in B). Proof. (* Goal: @eq bool (@eq_op (@Semiset.eqType elementType eqType_of_elementType Y disp set) (@imset elementType eqType_of_elementType disp set X Y f A) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType Y disp set))) (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))) *) apply/idP/idP => [xAB|?]; last by rewrite -sub1set lexI !sub1set. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by rewrite (subsetP (leIr _ _) _ xAB) (subsetP (leIl _ _) _ xAB). Qed. Lemma set1U A x : [set x] :&: A = if x \in A then [set x] else set0. Proof. (* Goal: @eq (@Semiset.sort elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType Y disp set)) *) apply/setP => y; rewrite (fun_if (fun E => y \in E)) in_setI in_set1 in_set0. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by have [->|] := altP (y =P x); rewrite ?if_same //; case: (_ \in A). Qed. Lemma set1U_eq0 A x : ([set x] :&: A == set0) = (x \notin A). Proof. by rewrite set1U; case: (x \in A); rewrite ?set1_eq0 ?eqxx. Qed. Lemma in_setD A B x : (x \in A :\: B) = (x \notin B) && (x \in A). Proof. (* Goal: @eq bool (@eq_op (@Semiset.eqType elementType eqType_of_elementType Y disp set) (@imset elementType eqType_of_elementType disp set X Y f A) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType Y disp set))) (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))) *) apply/idP/idP => [|/andP[xNB xA]]; last first. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by rewrite -sub1set leBRL sub1set xA set1U_eq0. (* Goal: sum (@eq (@Semiset.sort elementType eqType_of_elementType disp set X) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))) (@sig (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)))) *) rewrite -sub1set leBRL sub1set => /andP [-> dxB]. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by rewrite -sub1set disj_le ?set1_eq0. Qed. Definition inE := ((in_set0, in_set1, in_setU, in_setI, in_setD), inE). Definition subset_trans B A C := (@le_trans _ _ B A C). Definition proper_trans B A C := (@lt_trans _ _ B A C). Definition sub_proper_trans B A C := (@le_lt_trans _ _ B A C). Definition proper_sub_trans B A C := (@lt_le_trans _ _ B A C). Definition proper_sub A B := (@ltW _ _ A B). Lemma properP A B : reflect (A \subset B /\ (exists2 x, x \in B & x \notin A)) (A \proper B). Proof. (* Goal: is_true (negb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType Y disp set) (@imset elementType eqType_of_elementType disp set X Y f A') (@imset elementType eqType_of_elementType disp set X Y f A))) *) apply: (iffP idP)=> [ltAB|[leAB [x xB xNA]]]. (* Goal: and (is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B)) (@ex2 (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B))) (fun x : Equality.sort (eqType_of_elementType X) => is_true (negb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A))))) *) (* Goal: is_true (@lt (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) *) rewrite ltW //; split => //; have := lt0B ltAB; rewrite lt0x. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by move => /set0Pn [x]; rewrite in_setD => /andP [xNA xB]; exists x. (* Goal: is_true (@lt (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) *) rewrite lt_neqAle leAB andbT; apply: contraTneq xNA. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by move=> /setP /(_ x) ->; rewrite xB. Qed. Lemma set1P x y : reflect (x = y) (x \in ([set y] : set X)). Proof. by rewrite in_set1; apply/eqP. Qed. Lemma subset_eqP A B : reflect (A =i B) (A \subset B \subset A)%set. Proof. (* Goal: @eq bool (@eq_op (@Semiset.eqType elementType eqType_of_elementType Y disp set) (@imset elementType eqType_of_elementType disp set X Y f A) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType Y disp set))) (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))) *) apply: (iffP andP) => [[AB BA] x|eqAB]; first by apply/idP/idP; apply: subsetP. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by split; apply/subsetP=> x; rewrite !eqAB. Qed. Lemma eqEsubset A B : (A == B) = (A \subset B) && (B \subset A). Proof. exact: eq_le. Qed. Lemma properE A B : A \proper B = (A \subset B) && ~~ (B \subset A). Proof. by case: comparableP. Qed. Lemma subEproper A B : A \subset B = (A == B) || (A \proper B). Proof. exact: le_eqVlt. Qed. Lemma eqVproper A B : A \subset B -> A = B \/ A \proper B. Proof. by rewrite subEproper => /predU1P. Qed. Lemma properEneq A B : A \proper B = (A != B) && (A \subset B). Proof. exact: lt_neqAle. Qed. Lemma proper_neq A B : A \proper B -> A != B. Proof. by rewrite properEneq; case/andP. Qed. Lemma eqEproper A B : (A == B) = (A \subset B) && ~~ (A \proper B). Proof. by case: comparableP. Qed. Lemma sub0set A : set0 \subset A. Proof. by apply/subsetP=> x; rewrite inE. Qed. Lemma subset0 A : (A \subset set0) = (A == set0). Proof. by rewrite eqEsubset sub0set andbT. Qed. Lemma proper0 A : (set0 \proper A) = (A != set0). Proof. by rewrite properE sub0set subset0. Qed. Lemma subset_neq0 A B : A \subset B -> A != set0 -> B != set0. Proof. by rewrite -!proper0 => sAB /proper_sub_trans->. Qed. Lemma setU1r x a B : x \in B -> x \in a |: B. Proof. by move=> Bx; rewrite !inE predU1r. Qed. Lemma setU1P x a B : reflect (x = a \/ x \in B) (x \in a |: B). Proof. by rewrite !inE; apply: predU1P. Qed. (* We need separate lemmas for the explicit enumerations since they *) (* associate on the left. *) Lemma set1Ul x A b : x \in A -> x \in A :|: [set b]. Proof. by move=> Ax; rewrite !inE Ax. Qed. Lemma set1Ur A b : b \in A :|: [set b]. Proof. by rewrite !inE eqxx orbT. Qed. Lemma setD1P x A b : reflect (x != b /\ x \in A) (x \in A :\ b). Proof. by rewrite !inE; apply: andP. Qed. Lemma in_setD1 x A b : (x \in A :\ b) = (x != b) && (x \in A) . Proof. by rewrite !inE. Qed. Lemma setD11 b A : (b \in A :\ b) = false. Proof. by rewrite !inE eqxx. Qed. Lemma setD1K a A : a \in A -> a |: (A :\ a) = A. Proof. by move=> Aa; apply/setP=> x; rewrite !inE; case: eqP => // ->. Qed. Lemma setU1K a B : a \notin B -> (a |: B) :\ a = B. Proof. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by move/negPf=> nBa; apply/setP=> x; rewrite !inE; case: eqP => // ->. Qed. Lemma set2P x a b : reflect (x = a \/ x = b) (x \in ([set a; b] : set X)). Proof. by rewrite !inE; apply: pred2P. Qed. Lemma in_set2 x a b : (x \in ([set a; b] : set X)) = (x == a) || (x == b). Proof. by rewrite !inE. Qed. Lemma set21 a b : a \in ([set a; b] : set X). Proof. by rewrite !inE eqxx. Qed. Lemma set22 a b : b \in ([set a; b] : set X). Proof. by rewrite !inE eqxx orbT. Qed. Lemma setUP x A B : reflect (x \in A \/ x \in B) (x \in A :|: B). Proof. by rewrite !inE; apply: orP. Qed. Lemma setUC A B : A :|: B = B :|: A. Proof. by apply/setP => x; rewrite !inE orbC. Qed. Lemma setUS A B C : A \subset B -> C :|: A \subset C :|: B. Proof. (* Goal: forall _ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B), is_true (@le (display_set disp) (@Order.Lattice.porderType (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) C A) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) C B)) *) move=> sAB; apply/subsetP=> x; rewrite !inE. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by case: (x \in C) => //; apply: (subsetP sAB). Qed. Lemma setSU A B C : A \subset B -> A :|: C \subset B :|: C. Proof. by move=> sAB; rewrite -!(setUC C) setUS. Qed. Lemma setUSS A B C D : A \subset C -> B \subset D -> A :|: B \subset C :|: D. Proof. by move=> /(setSU B) /subset_trans sAC /(setUS C)/sAC. Qed. Lemma set0U A : set0 :|: A = A. Proof. by apply/setP => x; rewrite !inE orFb. Qed. Lemma setU0 A : A :|: set0 = A. Proof. by rewrite setUC set0U. Qed. Lemma setUA A B C : A :|: (B :|: C) = A :|: B :|: C. Proof. by apply/setP => x; rewrite !inE orbA. Qed. Lemma setUCA A B C : A :|: (B :|: C) = B :|: (A :|: C). Proof. by rewrite !setUA (setUC B). Qed. Lemma setUAC A B C : A :|: B :|: C = A :|: C :|: B. Proof. by rewrite -!setUA (setUC B). Qed. Lemma setUACA A B C D : (A :|: B) :|: (C :|: D) = (A :|: C) :|: (B :|: D). Proof. by rewrite -!setUA (setUCA B). Qed. Lemma setUid A : A :|: A = A. Proof. by apply/setP=> x; rewrite inE orbb. Qed. Lemma setUUl A B C : A :|: B :|: C = (A :|: C) :|: (B :|: C). Proof. by rewrite setUA !(setUAC _ C) -(setUA _ C) setUid. Qed. Lemma setUUr A B C : A :|: (B :|: C) = (A :|: B) :|: (A :|: C). Proof. by rewrite !(setUC A) setUUl. Qed. (* intersection *) Lemma setIP x A B : reflect (x \in A /\ x \in B) (x \in A :&: B). Proof. by rewrite !inE; apply: andP. Qed. Lemma setIC A B : A :&: B = B :&: A. Proof. by apply/setP => x; rewrite !inE andbC. Qed. Lemma setIS A B C : A \subset B -> C :&: A \subset C :&: B. Proof. (* Goal: forall _ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B), is_true (@le (display_set disp) (@Order.Lattice.porderType (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) C A) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) C B)) *) move=> sAB; apply/subsetP=> x; rewrite !inE. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by case: (x \in C) => //; apply: (subsetP sAB). Qed. Lemma setSI A B C : A \subset B -> A :&: C \subset B :&: C. Proof. by move=> sAB; rewrite -!(setIC C) setIS. Qed. Lemma setISS A B C D : A \subset C -> B \subset D -> A :&: B \subset C :&: D. Proof. by move=> /(setSI B) /subset_trans sAC /(setIS C) /sAC. Qed. Lemma set0I A : set0 :&: A = set0. Proof. by apply/setP => x; rewrite !inE andFb. Qed. Lemma setI0 A : A :&: set0 = set0. Proof. by rewrite setIC set0I. Qed. Lemma setIA A B C : A :&: (B :&: C) = A :&: B :&: C. Proof. by apply/setP=> x; rewrite !inE andbA. Qed. Lemma setICA A B C : A :&: (B :&: C) = B :&: (A :&: C). Proof. by rewrite !setIA (setIC A). Qed. Lemma setIAC A B C : A :&: B :&: C = A :&: C :&: B. Proof. by rewrite -!setIA (setIC B). Qed. Lemma setIACA A B C D : (A :&: B) :&: (C :&: D) = (A :&: C) :&: (B :&: D). Proof. by rewrite -!setIA (setICA B). Qed. Lemma setIid A : A :&: A = A. Proof. by apply/setP=> x; rewrite inE andbb. Qed. Lemma setIIl A B C : A :&: B :&: C = (A :&: C) :&: (B :&: C). Proof. by rewrite setIA !(setIAC _ C) -(setIA _ C) setIid. Qed. Lemma setIIr A B C : A :&: (B :&: C) = (A :&: B) :&: (A :&: C). Proof. by rewrite !(setIC A) setIIl. Qed. (* distribute /cancel *) Lemma setIUr A B C : A :&: (B :|: C) = (A :&: B) :|: (A :&: C). Proof. by apply/setP=> x; rewrite !inE andb_orr. Qed. Lemma setIUl A B C : (A :|: B) :&: C = (A :&: C) :|: (B :&: C). Proof. by apply/setP=> x; rewrite !inE andb_orl. Qed. Lemma setUIr A B C : A :|: (B :&: C) = (A :|: B) :&: (A :|: C). Proof. by apply/setP=> x; rewrite !inE orb_andr. Qed. Lemma setUIl A B C : (A :&: B) :|: C = (A :|: C) :&: (B :|: C). Proof. by apply/setP=> x; rewrite !inE orb_andl. Qed. Lemma setUK A B : (A :|: B) :&: A = A. Proof. by apply/setP=> x; rewrite !inE orbK. Qed. Lemma setKU A B : A :&: (B :|: A) = A. Proof. by apply/setP=> x; rewrite !inE orKb. Qed. Lemma setIK A B : (A :&: B) :|: A = A. Proof. by apply/setP=> x; rewrite !inE andbK. Qed. Lemma setKI A B : A :|: (B :&: A) = A. Proof. by apply/setP=> x; rewrite !inE andKb. Qed. (* difference *) Lemma setDP A B x : reflect (x \in A /\ x \notin B) (x \in A :\: B). Proof. by rewrite inE andbC; apply: andP. Qed. Lemma setSD A B C : A \subset B -> A :\: C \subset B :\: C. Proof. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by move=> /subsetP AB; apply/subsetP => x; rewrite !inE => /andP[-> /AB]. Qed. Lemma setDS A B C : A \subset B -> C :\: B \subset C :\: A. Proof. (* Goal: forall _ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B), is_true (@le (display_set disp) (@Order.CBLattice.porderType (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) C B) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) C A)) *) move=> /subsetP AB; apply/subsetP => x; rewrite !inE => /andP[]. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by move=> /(contra (AB _)) ->. Qed. Lemma setDSS A B C D : A \subset C -> D \subset B -> A :\: B \subset C :\: D. Proof. by move=> /(setSD B) /subset_trans sAC /(setDS C) /sAC. Qed. Lemma setD0 A : A :\: set0 = A. Proof. exact: subx0. Qed. Lemma set0D A : set0 :\: A = set0. Proof. exact: sub0x. Qed. Lemma setDv A : A :\: A = set0. Proof. exact: subxx. Qed. Lemma setID A B : A :&: B :|: A :\: B = A. Proof. exact: joinIB. Qed. Lemma setDUl A B C : (A :|: B) :\: C = (A :\: C) :|: (B :\: C). Proof. exact: subUx. Qed. Lemma setDUr A B C : A :\: (B :|: C) = (A :\: B) :&: (A :\: C). Proof. exact: subxU. Qed. Lemma setDIl A B C : (A :&: B) :\: C = (A :\: C) :&: (B :\: C). Proof. exact: subIx. Qed. Lemma setIDA A B C : A :&: (B :\: C) = (A :&: B) :\: C. Proof. exact: meetxB. Qed. Lemma setIDAC A B C : (A :\: B) :&: C = (A :&: C) :\: B. Proof. exact: meetBx. Qed. Lemma setDIr A B C : A :\: (B :&: C) = (A :\: B) :|: (A :\: C). Proof. exact: subxI. Qed. Lemma setDDl A B C : (A :\: B) :\: C = A :\: (B :|: C). Proof. exact: subBx. Qed. Lemma setDDr A B C : A :\: (B :\: C) = (A :\: B) :|: (A :&: C). Proof. exact: subxB. Qed. (* other inclusions *) Lemma subsetIl A B : A :&: B \subset A. Proof. by apply/subsetP=> x; rewrite inE; case/andP. Qed. Lemma subsetIr A B : A :&: B \subset B. Proof. by apply/subsetP=> x; rewrite inE; case/andP. Qed. Lemma subsetUl A B : A \subset A :|: B. Proof. by apply/subsetP=> x; rewrite inE => ->. Qed. Lemma subsetUr A B : B \subset A :|: B. Proof. by apply/subsetP=> x; rewrite inE orbC => ->. Qed. Lemma subsetU1 x A : A \subset x |: A. Proof. exact: subsetUr. Qed. Lemma subsetDl A B : A :\: B \subset A. Proof. exact: leBx. Qed. Lemma subD1set A x : A :\ x \subset A. Proof. by rewrite subsetDl. Qed. Lemma setIidPl A B : reflect (A :&: B = A) (A \subset B). Proof. (* Goal: is_true (negb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType Y disp set) (@imset elementType eqType_of_elementType disp set X Y f A') (@imset elementType eqType_of_elementType disp set X Y f A))) *) apply: (iffP subsetP) => [sAB | <- x /setIP[] //]. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by apply/setP=> x; rewrite inE; apply/andb_idr/sAB. Qed. Arguments setIidPl {A B}. Lemma setIidPr A B : reflect (A :&: B = B) (B \subset A). Proof. by rewrite setIC; apply: setIidPl. Qed. Lemma setUidPl A B : reflect (A :|: B = A) (B \subset A). Proof. exact: join_idPr. Qed. Lemma setUidPr A B : reflect (A :|: B = B) (A \subset B). Proof. by rewrite setUC; apply: setUidPl. Qed. Lemma subIset A B C : (B \subset A) || (C \subset A) -> (B :&: C \subset A). Proof. by case/orP; apply: subset_trans; rewrite (subsetIl, subsetIr). Qed. Lemma subsetI A B C : (A \subset B :&: C) = (A \subset B) && (A \subset C). Proof. (* Goal: @eq bool (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) B (@set1 elementType eqType_of_elementType disp set X x))) (andb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) (negb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)))) *) rewrite !(sameP setIidPl eqP) setIA; have [-> //| ] := altP (A :&: B =P A). (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by apply: contraNF => /eqP <-; rewrite -setIA -setIIl setIAC. Qed. Lemma subsetIP A B C : reflect (A \subset B /\ A \subset C) (A \subset B :&: C). Proof. by rewrite subsetI; apply: andP. Qed. Lemma subsetIidl A B : (A \subset A :&: B) = (A \subset B). Proof. by rewrite subsetI lexx. Qed. Lemma subsetIidr A B : (B \subset A :&: B) = (B \subset A). Proof. by rewrite setIC subsetIidl. Qed. Lemma subUset A B C : (B :|: C \subset A) = (B \subset A) && (C \subset A). Proof. exact: leUx. Qed. Lemma subsetU A B C : (A \subset B) || (A \subset C) -> A \subset B :|: C. Proof. exact: lexU. Qed. Lemma subUsetP A B C : reflect (A \subset C /\ B \subset C) (A :|: B \subset C). Proof. by rewrite subUset; apply: andP. Qed. Lemma subDset A B C : (A :\: B \subset C) = (A \subset B :|: C). Proof. exact: leBLR. Qed. Lemma setU_eq0 A B : (A :|: B == set0) = (A == set0) && (B == set0). Proof. by rewrite -!subset0 subUset. Qed. Lemma setD_eq0 A B : (A :\: B == set0) = (A \subset B). Proof. by rewrite -subset0 subDset setU0. Qed. Lemma subsetD1 A B x : (A \subset B :\ x) = (A \subset B) && (x \notin A). Proof. (* Goal: @eq bool (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) B (@set1 elementType eqType_of_elementType disp set X x))) (andb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) (negb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)))) *) rewrite andbC; have [xA|] //= := boolP (x \in A). (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by apply: contraTF isT => /subsetP /(_ x xA); rewrite !inE eqxx. (* Goal: forall _ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A A'), is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType Y disp set) (@imset elementType eqType_of_elementType disp set X Y f A) (@imset elementType eqType_of_elementType disp set X Y f A')) *) move=> xNA; apply/subsetP/subsetP => sAB y yA. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by have:= sAB y yA; rewrite !inE => /andP[]. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by rewrite !inE sAB // andbT; apply: contraNneq xNA => <-. Qed. Lemma subsetD1P A B x : reflect (A \subset B /\ x \notin A) (A \subset B :\ x). Proof. by rewrite subsetD1; apply: andP. Qed. Lemma properD1 A x : x \in A -> A :\ x \proper A. Proof. by move=> Ax; rewrite properE subsetDl /= subsetD1 Ax andbF. Qed. Lemma properIr A B : ~~ (B \subset A) -> A :&: B \proper B. Proof. by move=> nsAB; rewrite properE subsetIr subsetI negb_and nsAB. Qed. Lemma properIl A B : ~~ (A \subset B) -> A :&: B \proper A. Proof. by move=> nsBA; rewrite properE subsetIl subsetI negb_and nsBA orbT. Qed. Lemma properUr A B : ~~ (A \subset B) -> B \proper A :|: B. Proof. by rewrite properE subsetUr subUset lexx /= andbT. Qed. Lemma properUl A B : ~~ (B \subset A) -> A \proper A :|: B. Proof. by move=> not_sBA; rewrite setUC properUr. Qed. Lemma proper1set A x : ([set x] \proper A) -> (x \in A). Proof. by move/proper_sub; rewrite sub1set. Qed. Lemma properIset A B C : (B \proper A) || (C \proper A) -> (B :&: C \proper A). Proof. by case/orP; apply: sub_proper_trans; rewrite (subsetIl, subsetIr). Qed. Lemma properI A B C : (A \proper B :&: C) -> (A \proper B) && (A \proper C). Proof. (* Goal: forall _ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A A'), is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType Y disp set) (@imset elementType eqType_of_elementType disp set X Y f A) (@imset elementType eqType_of_elementType disp set X Y f A')) *) move=> pAI; apply/andP. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by split; apply: (proper_sub_trans pAI); rewrite (subsetIl, subsetIr). Qed. Lemma properU A B C : (B :|: C \proper A) -> (B \proper A) && (C \proper A). Proof. (* Goal: forall _ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A A'), is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType Y disp set) (@imset elementType eqType_of_elementType disp set X Y f A) (@imset elementType eqType_of_elementType disp set X Y f A')) *) move=> pUA; apply/andP. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by split; apply: sub_proper_trans pUA; rewrite (subsetUr, subsetUl). Qed. End setX. Section setXY. Variables X Y : elementType. Implicit Types (x : X) (y : Y) (A : set X) (B : set Y) (f : setfun set X Y). Lemma imsetP (f : setfun set X Y) A y : reflect (exists2 x : X, x \in A & y = f x) (y \in imset f A). Proof. (* Goal: forall (_ : @prop_in2 (Equality.sort (eqType_of_elementType X)) (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A') (fun x1 x2 : Equality.sort (eqType_of_elementType X) => forall _ : @eq (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x1) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x2), @eq (Equality.sort (eqType_of_elementType X)) x1 x2) (inPhantom (@injective (Equality.sort (eqType_of_elementType Y)) (Equality.sort (eqType_of_elementType X)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f)))) (_ : is_true (@lt (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A A')), is_true (@lt (display_set disp) (@Semiset.porderType elementType eqType_of_elementType Y disp set) (@imset elementType eqType_of_elementType disp set X Y f A) (@imset elementType eqType_of_elementType disp set X Y f A')) *) move: A f; rewrite /set1 /in_mem /= /memset /imset /setfun. (* Goal: forall (A : @Semiset.sort elementType eqType_of_elementType disp set X) (f : @Semiset.funsort elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X Y), Bool.reflect (@ex2 (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (@Semiset.memset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X A x)) (fun x : Equality.sort (eqType_of_elementType X) => @eq (Equality.sort (eqType_of_elementType Y)) y (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x))) (@Semiset.memset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) Y (@Semiset.imset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X Y f A) y) *) case: set => [S [base [memset set1 /= ? ? ? ? ? ? ? ? ? H]]] ? /= A f. (* Goal: Bool.reflect (@ex2 (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (memset X A x)) (fun x : Equality.sort (eqType_of_elementType X) => @eq (Equality.sort (eqType_of_elementType Y)) y (@fun_of_setfun elementType eqType_of_elementType disp (@Semiset.Pack elementType eqType_of_elementType disp S (@Semiset.Class elementType eqType_of_elementType disp S base (@Semiset.Mixin elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (S X) (base X) (S X)) memset set1 _i_ _e_ _e1_ _s_ _i1_ _e2_ _funsort_ _fun_of_funsort_ _imset_ H)) _T_) X Y f x))) (memset Y (_imset_ X Y f A) y) *) exact: H. Qed. Lemma mem_imset f A x : x \in A -> f x \in imset f A. Proof. by move=> Dx; apply/imsetP; exists x. Qed. Lemma imset0 f : imset f set0 = set0. Proof. (* Goal: @eq (@Semiset.sort elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType Y disp set)) *) apply/setP => y; rewrite in_set0. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by apply/imsetP => [[x]]; rewrite in_set0. Qed. Lemma imset_eq0 f A : (imset f A == set0) = (A == set0). Proof. (* Goal: @eq bool (@eq_op (@Semiset.eqType elementType eqType_of_elementType Y disp set) (@imset elementType eqType_of_elementType disp set X Y f A) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType Y disp set))) (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))) *) have [->|/set_gt0_ex [x xA]] := posxP A; first by rewrite imset0 eqxx. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by apply/set0Pn; exists (f x); rewrite mem_imset. Qed. Lemma imset_set1 f x : imset f [set x] = [set f x]. Proof. (* Goal: is_true (negb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType Y disp set) (@imset elementType eqType_of_elementType disp set X Y f A') (@imset elementType eqType_of_elementType disp set X Y f A))) *) apply/setP => y. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by apply/imsetP/set1P=> [[x' /set1P-> //]| ->]; exists x; rewrite ?set11. Qed. Lemma imsetS f A A' : A \subset A' -> imset f A \subset imset f A'. Proof. (* Goal: forall _ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A A'), is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType Y disp set) (@imset elementType eqType_of_elementType disp set X Y f A) (@imset elementType eqType_of_elementType disp set X Y f A')) *) move=> leAB; apply/subsetP => y /imsetP [x xA ->]. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by rewrite mem_imset // (subsetP leAB). Qed. Lemma imset_proper f A A' : {in A' &, injective f} -> A \proper A' -> imset f A \proper imset f A'. Proof. (* Goal: forall (_ : @prop_in2 (Equality.sort (eqType_of_elementType X)) (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A') (fun x1 x2 : Equality.sort (eqType_of_elementType X) => forall _ : @eq (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x1) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x2), @eq (Equality.sort (eqType_of_elementType X)) x1 x2) (inPhantom (@injective (Equality.sort (eqType_of_elementType Y)) (Equality.sort (eqType_of_elementType X)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f)))) (_ : is_true (@lt (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A A')), is_true (@lt (display_set disp) (@Semiset.porderType elementType eqType_of_elementType Y disp set) (@imset elementType eqType_of_elementType disp set X Y f A) (@imset elementType eqType_of_elementType disp set X Y f A')) *) move=> injf /properP[sAB [x Bx nAx]]; rewrite lt_leAnge imsetS //=. (* Goal: is_true (negb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType Y disp set) (@imset elementType eqType_of_elementType disp set X Y f A') (@imset elementType eqType_of_elementType disp set X Y f A))) *) apply: contra nAx => sfBA. (* Goal: is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) have: f x \in imset f A by rewrite (subsetP sfBA) ?mem_imset. (* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *) by case/imsetP=> y Ay /injf-> //; apply: subsetP sAB y Ay. Qed. End setXY. End SemisetTheory. End SemisetTheory. Module set. Section ClassDef. Variable elementType : Type. Variable eqType_of_elementType : elementType -> eqType. Coercion eqType_of_elementType : elementType >-> eqType. Implicit Types (X Y : elementType). Record class_of d (set : elementType -> Type) := Class { base : forall X, Order.CTBLattice.class_of (display_set d) (set X); mixin : Semiset.mixin_of eqType_of_elementType (fun X => Order.CBLattice.Pack (base X) (set X)) }. Local Coercion base : class_of >-> Funclass. Definition base2 d (set : elementType -> Type) (c : class_of d set) := Semiset.Class (@mixin _ set c). Local Coercion base2 : class_of >-> Semiset.class_of. Structure type d := Pack { sort ; _ : class_of d sort; _ : elementType -> Type }. Local Coercion sort : type >-> Funclass. Variables (set : elementType -> Type) (disp : unit) (cT : type disp). Definition class := let: Pack _ c _ as cT' := cT return class_of _ cT' in c. (* Definition clone c of phant_id class c := @Pack set c set. *) Let xset := let: Pack set _ _ := cT in set. Notation xclass := (class : class_of xset). Definition pack := fun bT (b : forall X, Order.CTBLattice.class_of _ _) & (forall X, phant_id (@Order.CTBLattice.class disp (bT X)) (b X)) => fun mT m & phant_id (@Semiset.class _ eqType_of_elementType mT) (@Semiset.Class _ _ disp set b m) => Pack (@Class _ set (fun x => b x) m) set. End ClassDef. Section CanonicalDef. Variable elementType : Type. Variable eqType_of_elementType : elementType -> eqType. Coercion eqType_of_elementType : elementType >-> eqType. Notation type := (type eqType_of_elementType). Local Coercion sort : type >-> Funclass. Local Coercion base : class_of >-> Funclass. Local Coercion base2 : class_of >-> Semiset.class_of. Variables (set : elementType -> Type) (X : elementType). Variable (disp : unit) (cT : type disp). Local Notation ddisp := (display_set disp). Let xset := let: Pack set _ _ := cT in set. Notation xclass := (@class _ eqType_of_elementType _ cT : class_of eqType_of_elementType _ xset). Definition eqType := ltac:(EqualityPack (cT X) ((@class _ eqType_of_elementType _ cT : class_of eqType_of_elementType _ xset) X) (xset X)). Definition choiceType := ltac:(ChoicePack (cT X) ((@class _ eqType_of_elementType _ cT : class_of eqType_of_elementType _ xset) X) (xset X)). Definition porderType := @Order.POrder.Pack ddisp (cT X) (xclass X) (xset X). Definition latticeType := @Order.Lattice.Pack ddisp (cT X) (xclass X) (xset X). Definition blatticeType := @Order.BLattice.Pack ddisp (cT X) (xclass X) (xset X). Definition cblatticeType := @Order.CBLattice.Pack ddisp (cT X) (xclass X) (xset X). Definition ctblatticeType := @Order.CTBLattice.Pack ddisp (cT X) (xclass X) (xset X). Definition semisetType := @Semiset.Pack _ _ disp cT xclass xset. Definition semiset_ctblatticeType := @Order.CTBLattice.Pack ddisp (semisetType X) (xclass X) (xset X). End CanonicalDef. Module Import Exports. Coercion base : class_of >-> Funclass. Coercion base2 : class_of >-> Semiset.class_of. Coercion sort : type >-> Funclass. Coercion eqType : type >-> Equality.type. Coercion choiceType : type >-> Choice.type. Coercion porderType : type >-> Order.POrder.type. Coercion latticeType : type >-> Order.Lattice.type. Coercion blatticeType : type >-> Order.BLattice.type. Coercion cblatticeType : type >-> Order.CBLattice.type. Coercion ctblatticeType : type >-> Order.CTBLattice.type. Coercion semisetType : type >-> Semiset.type. Canonical eqType. Canonical choiceType. Canonical porderType. Canonical latticeType. Canonical blatticeType. Canonical cblatticeType. Canonical ctblatticeType. Canonical semisetType. Notation setType := type. Notation "[ 'setType' 'of' set ]" := (@pack _ _ set _ _ _ (fun=> id) _ _ id) (at level 0, format "[ 'setType' 'of' set ]") : form_scope. End Exports. End set. Import set.Exports. Module Import setTheory. Section setTheory. Variable elementType : Type. Variable eqType_of_elementType : elementType -> eqType. Coercion eqType_of_elementType : elementType >-> eqType. Variable disp : unit. Variable set : setType eqType_of_elementType disp. Section setX. Variables X : elementType. Implicit Types (x y : X) (A B : set X). End setX. End setTheory. End setTheory. Module Theory. Export Semiset.Exports. Export set.Exports. Export SetSyntax. Export SemisetSyntax. Export SemisetTheory. Export setTheory. End Theory. End SET.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) (** gcd. Greatest common divisor. @author Olga Caprotti and Martijn Oostdijk @version $Revision$ *) Require Import ZArith. Require Import Wf_nat. Require Import lemmas. Require Import natZ. Require Import divides. Require Import modulo. (** * Linear combinations. *) Definition LinComb (c x y : Z) := exists a : Z, (exists b : Z, c = (x * a + y * b)%Z). Definition LinCombMod (c x y : Z) (n : nat) := exists a : Z, (exists b : Z, Mod c (x * a + y * b) n). Definition ZLinCombMod (c x y n : Z) := exists a : Z, (exists b : Z, ZMod c (x * a + y * b) n). Lemma lincombmodzlincombmod : forall (c x y : Z) (n : nat), LinCombMod c x y n -> ZLinCombMod c x y (Z_of_nat n). Proof. (* Goal: forall (c x y : Z) (n : nat) (_ : LinCombMod c x y n), ZLinCombMod c x y (Z.of_nat n) *) unfold LinCombMod, ZLinCombMod in |- *. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) intros. elim H. intros z Hz. exists z. (* Goal: @ex Z (fun b : Z => ZMod c (Z.add (Z.mul x z) (Z.mul y b)) (Z.of_nat n)) *) elim Hz. intros b Hb. exists b. (* Goal: ZMod c (Z.add (Z.mul x z) (Z.mul y b)) (Z.of_nat n) *) apply modzmod. assumption. Qed. Lemma zlincombmodlincombmod : forall c x y n : Z, ZLinCombMod c x y n -> LinCombMod c x y (Zabs_nat n). Proof. (* Goal: forall (c x y n : Z) (_ : ZLinCombMod c x y n), LinCombMod c x y (Z.abs_nat n) *) unfold ZLinCombMod, LinCombMod in |- *. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) intros. elim H. intros a Ha. exists a. (* Goal: forall (x0 : Z) (_ : ZMod c (Z.add (Z.mul x a) (Z.mul y x0)) n), @ex Z (fun b : Z => Mod c (Z.add (Z.mul x a) (Z.mul y b)) (Z.abs_nat n)) *) elim Ha. intros b Hb. exists b. (* Goal: gcd x y d *) apply zmodmod. assumption. Qed. (** * Greatest common divisor. *) Definition common_div (x y : Z) (d : nat) := Divides d (Zabs_nat x) /\ Divides d (Zabs_nat y). Definition gcd (x y : Z) (d : nat) := common_div x y d /\ (forall e : nat, common_div x y e -> e <= d). Lemma gcd_unq : forall (d1 d2 : nat) (x y : Z), gcd x y d1 -> gcd x y d2 -> d1 = d2. Proof. (* Goal: forall (d : nat) (x y q r : Z) (_ : gcd x y d) (_ : @eq Z x (Z.add (Z.mul q y) r)), gcd r y d *) unfold gcd in |- *. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) intros. (* Goal: LinComb (Z.of_nat d) x y *) (* Goal: Z.le Z0 x *) (* Goal: forall _ : Z.lt x Z0, LinComb (Z.of_nat d) x y *) elim H. (* Goal: Divides e d *) elim H0. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) intros. (* Goal: @eq nat d1 d2 *) apply le_antisym. (* Goal: le e d *) apply H2. (* Goal: gcd x y d *) assumption. (* Goal: le d2 d1 *) apply H4. (* Goal: gcd x y d *) assumption. Qed. Lemma gcd_sym : forall (d : nat) (x y : Z), gcd x y d -> gcd y x d. Proof. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) unfold gcd in |- *. unfold common_div in |- *. intros. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) elim H. intros. elim H0. intros. (* Goal: and (Divides e (Z.abs_nat x)) (Divides e (Z.abs_nat y)) *) split. split. (* Goal: gcd x y d *) assumption. assumption. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) intros. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) elim H4. intros. apply H1. split. (* Goal: gcd x y d *) assumption. assumption. Qed. Lemma gcd_opp_l : forall (d : nat) (x y : Z), gcd x y d -> gcd (- x) y d. Proof. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) unfold gcd in |- *. unfold common_div in |- *. intros. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) elim H. intros. elim H0. intros. (* Goal: and (Divides e (Z.abs_nat x)) (Divides e (Z.abs_nat y)) *) split. (* Goal: and (Divides e (Z.abs_nat x)) (Divides e (Z.abs_nat y)) *) split. (* Goal: Divides d (Z.abs_nat (Z.opp y)) *) (* Goal: forall (e : nat) (_ : and (Divides e (Z.abs_nat x)) (Divides e (Z.abs_nat (Z.opp y)))), le e d *) rewrite <- abs_opp. (* Goal: gcd x y d *) assumption. (* Goal: gcd x y d *) assumption. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) intros. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) elim H4. intros. (* Goal: and (Divides e (Z.abs_nat x)) (Divides e (Z.abs_nat y)) *) apply H1. split. (* Goal: Divides e (Z.abs_nat y) *) rewrite abs_opp. (* Goal: gcd x y d *) assumption. (* Goal: gcd x y d *) assumption. Qed. Lemma gcd_opp_r : forall (d : nat) (x y : Z), gcd x y d -> gcd x (- y) d. Proof. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) unfold gcd in |- *. unfold common_div in |- *. intros. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) elim H. intros. elim H0. intros. (* Goal: and (Divides e (Z.abs_nat x)) (Divides e (Z.abs_nat y)) *) split. (* Goal: and (Divides e (Z.abs_nat x)) (Divides e (Z.abs_nat y)) *) split. (* Goal: gcd x y d *) assumption. (* Goal: Divides d (Z.abs_nat (Z.opp y)) *) (* Goal: forall (e : nat) (_ : and (Divides e (Z.abs_nat x)) (Divides e (Z.abs_nat (Z.opp y)))), le e d *) rewrite <- abs_opp. (* Goal: gcd x y d *) assumption. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) intros. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) elim H4. intros. (* Goal: and (Divides e (Z.abs_nat x)) (Divides e (Z.abs_nat y)) *) apply H1. split. (* Goal: gcd x y d *) assumption. (* Goal: Divides e (Z.abs_nat y) *) rewrite abs_opp. (* Goal: gcd x y d *) assumption. Qed. Lemma gcd_0_l : forall d : nat, d > 0 -> gcd 0 (Z_of_nat d) d. Proof. (* Goal: forall (d : nat) (x y q r : Z) (_ : gcd x y d) (_ : @eq Z x (Z.add (Z.mul q y) r)), gcd r y d *) unfold gcd in |- *. unfold common_div in |- *. (* Goal: and (Divides e (Z.abs_nat x)) (Divides e (Z.abs_nat y)) *) split. split. (* Goal: Divides d (Z.abs_nat Z0) *) (* Goal: Divides d (Z.abs_nat (Z.of_nat d)) *) (* Goal: forall (e : nat) (_ : and (Divides e (Z.abs_nat Z0)) (Divides e (Z.abs_nat (Z.of_nat d)))), le e d *) split with 0. simpl in |- *. rewrite <- mult_n_O. reflexivity. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Gt) *) (* Goal: Z.gt x Z0 *) (* Goal: gcd (Z.of_nat (Z.abs_nat x)) (Z.of_nat (Z.abs_nat y)) d *) (* Goal: Z.lt y Z0 *) (* Goal: @eq Z (Z.opp (Z.opp y)) y *) (* Goal: Z.ge x Z0 *) split with 1. simpl in |- *. rewrite <- mult_n_Sm. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Gt) *) (* Goal: Z.gt x Z0 *) (* Goal: gcd (Z.of_nat (Z.abs_nat x)) (Z.of_nat (Z.abs_nat y)) d *) (* Goal: Z.lt y Z0 *) (* Goal: @eq Z (Z.opp (Z.opp y)) y *) (* Goal: Z.ge x Z0 *) rewrite <- mult_n_O. simpl in |- *. rewrite abs_inj. reflexivity. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) intros. (* Goal: le e d *) apply div_le. (* Goal: gcd x y d *) assumption. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) elim H0. intros. (* Goal: gcd x y d *) rewrite abs_inj in H2. assumption. Qed. Lemma gcd_0_r : forall d : nat, d > 0 -> gcd (Z_of_nat d) 0 d. Proof. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) intros. apply gcd_sym. apply gcd_0_l. assumption. Qed. (** * Euclid's theorem. *) Lemma euclid_gcd1 : forall (d : nat) (x y q r : Z), gcd x y d -> x = (q * y + r)%Z -> gcd r y d. Proof. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) unfold gcd in |- *. unfold common_div in |- *. intros. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) elim H. intros. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) elim H1. intros. (* Goal: and (Divides e (Z.abs_nat x)) (Divides e (Z.abs_nat y)) *) split. (* Goal: and (Divides e (Z.abs_nat x)) (Divides e (Z.abs_nat y)) *) split. (* Goal: Divides d (Z.abs_nat r) *) (* Goal: Divides d (Z.abs_nat y) *) (* Goal: forall (e : nat) (_ : and (Divides e (Z.abs_nat r)) (Divides e (Z.abs_nat y))), le e d *) rewrite <- (abs_inj d). apply zdivdiv. (* Goal: ZDivides (Z.of_nat d) r *) (* Goal: Divides d (Z.abs_nat y) *) (* Goal: forall (e : nat) (_ : and (Divides e (Z.abs_nat r)) (Divides e (Z.abs_nat y))), le e d *) apply zdiv_plus_r with (q * y)%Z. (* Goal: @eq Z (Z.of_nat d) (Z.mul (Z.of_nat X) (Zpos xH)) *) (* Goal: forall (n : nat) (_ : and (le O (S n)) (and (lt (S n) X) (@eq nat y (Init.Nat.add (Init.Nat.mul q X) (S n))))), @ex Z (fun a : Z => @ex Z (fun b : Z => @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.of_nat X) a) (Z.mul (Z.of_nat y) b)))) *) (* Goal: gt X O *) rewrite Zmult_comm. apply zdiv_mult_compat_l. (* Goal: gcd x y d *) apply divzdiv. rewrite abs_inj. assumption. (* Goal: gcd x y d *) rewrite <- H0. apply divzdiv. rewrite abs_inj. assumption. (* Goal: gcd x y d *) assumption. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) intros. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) elim H5. intros. (* Goal: le e d *) apply H2. (* Goal: and (Divides e (Z.abs_nat x)) (Divides e (Z.abs_nat y)) *) split. (* Goal: Divides (Z.abs_nat (Z.of_nat e)) (Z.abs_nat x) *) (* Goal: Divides e (Z.abs_nat y) *) rewrite <- (abs_inj e). apply zdivdiv. (* Goal: ZDivides (Z.of_nat e) x *) (* Goal: Divides e (Z.abs_nat y) *) rewrite H0. (* Goal: ZDivides (Z.of_nat e) (Z.add (Z.mul q y) r) *) (* Goal: Divides e (Z.abs_nat y) *) apply zdiv_plus_compat. (* Goal: @eq Z (Z.of_nat d) (Z.mul (Z.of_nat X) (Zpos xH)) *) (* Goal: forall (n : nat) (_ : and (le O (S n)) (and (lt (S n) X) (@eq nat y (Init.Nat.add (Init.Nat.mul q X) (S n))))), @ex Z (fun a : Z => @ex Z (fun b : Z => @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.of_nat X) a) (Z.mul (Z.of_nat y) b)))) *) (* Goal: gt X O *) rewrite Zmult_comm. apply zdiv_mult_compat_l. (* Goal: Divides (Z.abs_nat (Z.of_nat e)) (Z.abs_nat r) *) (* Goal: Divides e (Z.abs_nat y) *) apply divzdiv. rewrite abs_inj. (* Goal: gcd x y d *) assumption. (* Goal: Divides (Z.abs_nat (Z.of_nat e)) (Z.abs_nat r) *) (* Goal: Divides e (Z.abs_nat y) *) apply divzdiv. rewrite abs_inj. (* Goal: gcd x y d *) assumption. (* Goal: gcd x y d *) assumption. Qed. Theorem euclid_gcd : forall (d1 d2 : nat) (x y q r : Z), x = (q * y + r)%Z -> gcd x y d1 -> gcd r y d2 -> d1 = d2. Proof. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) intros. (* Goal: @eq nat d1 d2 *) apply (gcd_unq d1 d2 r y). (* Goal: gcd r y d1 *) (* Goal: gcd r y d2 *) apply euclid_gcd1 with x q. (* Goal: gcd x y d *) assumption. (* Goal: gcd x y d *) assumption. (* Goal: gcd x y d *) assumption. Qed. (** * Greatest common divisor can be written as linear combination. *) Lemma gcd_lincomb_nat : forall x y d : nat, x > 0 -> gcd (Z_of_nat x) (Z_of_nat y) d -> LinComb (Z_of_nat d) (Z_of_nat x) (Z_of_nat y). Proof. (* Goal: forall (x y d : nat) (_ : gt x O) (_ : gcd (Z.of_nat x) (Z.of_nat y) d), LinComb (Z.of_nat d) (Z.of_nat x) (Z.of_nat y) *) unfold LinComb in |- *. intro x. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) apply (lt_wf_ind x). intros X IH. intros. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) elim (div_rem X y). intro q. intros. elim H1. (* Goal: forall (x : nat) (_ : and (le O x) (and (lt x X) (@eq nat y (Init.Nat.add (Init.Nat.mul q X) x)))), @ex Z (fun a : Z => @ex Z (fun b : Z => @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.of_nat X) a) (Z.mul (Z.of_nat y) b)))) *) (* Goal: gt X O *) intro r. case r. (* case r = 0 *) (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) intros. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) elim H2. intros. elim H4. intros. (* Goal: @ex Z (fun a : Z => @ex Z (fun b : Z => @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.of_nat X) a) (Z.mul (Z.of_nat y) b)))) *) (* Goal: forall (n : nat) (_ : and (le O (S n)) (and (lt (S n) X) (@eq nat y (Init.Nat.add (Init.Nat.mul q X) (S n))))), @ex Z (fun a : Z => @ex Z (fun b : Z => @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.of_nat X) a) (Z.mul (Z.of_nat y) b)))) *) (* Goal: gt X O *) rewrite <- plus_n_O in H6. (* Goal: @ex Z (fun a : Z => @ex Z (fun b : Z => @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.of_nat X) a) (Z.mul (Z.of_nat y) b)))) *) (* Goal: forall (n : nat) (_ : and (le O (S n)) (and (lt (S n) X) (@eq nat y (Init.Nat.add (Init.Nat.mul q X) (S n))))), @ex Z (fun a : Z => @ex Z (fun b : Z => @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.of_nat X) a) (Z.mul (Z.of_nat y) b)))) *) (* Goal: gt X O *) split with 1%Z. split with 0%Z. (* Goal: @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.of_nat X) (Zpos xH)) (Z.mul (Z.of_nat y) Z0)) *) (* Goal: forall (n : nat) (_ : and (le O (S n)) (and (lt (S n) X) (@eq nat y (Init.Nat.add (Init.Nat.mul q X) (S n))))), @ex Z (fun a : Z => @ex Z (fun b : Z => @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.of_nat X) a) (Z.mul (Z.of_nat y) b)))) *) (* Goal: gt X O *) rewrite <- Zmult_0_r_reverse. rewrite <- Zplus_0_r_reverse. (* Goal: @eq Z (Z.of_nat d) (Z.mul (Z.of_nat X) (Zpos xH)) *) (* Goal: forall (n : nat) (_ : and (le O (S n)) (and (lt (S n) X) (@eq nat y (Init.Nat.add (Init.Nat.mul q X) (S n))))), @ex Z (fun a : Z => @ex Z (fun b : Z => @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.of_nat X) a) (Z.mul (Z.of_nat y) b)))) *) (* Goal: gt X O *) rewrite Zmult_comm. rewrite Zmult_1_l. (* Goal: @eq Z (Z.of_nat y) (Z.of_nat (Init.Nat.add (Init.Nat.mul q X) (S r1))) *) (* Goal: gt X O *) apply Znat.inj_eq. (* Goal: @eq nat d X *) (* Goal: forall (n : nat) (_ : and (le O (S n)) (and (lt (S n) X) (@eq nat y (Init.Nat.add (Init.Nat.mul q X) (S n))))), @ex Z (fun a : Z => @ex Z (fun b : Z => @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.of_nat X) a) (Z.mul (Z.of_nat y) b)))) *) (* Goal: gt X O *) apply (euclid_gcd d X (Z_of_nat y) (Z_of_nat X) (Z_of_nat q) 0). (* Goal: gcd x y d *) rewrite <- Zplus_0_r_reverse. rewrite <- Znat.inj_mult. apply Znat.inj_eq. assumption. (* Goal: gcd x y d *) apply gcd_sym. assumption. apply gcd_0_l. assumption. (* case r > 0 *) (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) intro r1. intros. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) elim H2. intros. elim H4. intros. (* Goal: @ex Z (fun a : Z => @ex Z (fun b : Z => @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.of_nat X) a) (Z.mul (Z.of_nat y) b)))) *) (* Goal: gt X O *) elim (IH (S r1) H5 X d). (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) intro delta. intros. elim H7. intro gamma. intros. (* Goal: @ex Z (fun a : Z => @ex Z (fun b : Z => @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.of_nat X) a) (Z.mul (Z.of_nat y) b)))) *) (* Goal: gt (S r1) O *) (* Goal: gcd (Z.of_nat (S r1)) (Z.of_nat X) d *) (* Goal: gt X O *) split with (gamma - Z_of_nat q * delta)%Z. split with delta. (* Goal: @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.of_nat X) (Z.sub gamma (Z.mul (Z.of_nat q) delta))) (Z.mul (Z.of_nat y) delta)) *) (* Goal: gt (S r1) O *) (* Goal: gcd (Z.of_nat (S r1)) (Z.of_nat X) d *) (* Goal: gt X O *) rewrite H6. rewrite H8. (* Goal: @eq Z (Z.add (Z.mul (Z.of_nat (S r1)) delta) (Z.mul (Z.of_nat X) gamma)) (Z.add (Z.mul (Z.of_nat X) (Z.sub gamma (Z.mul (Z.of_nat q) delta))) (Z.mul (Z.of_nat (Init.Nat.add (Init.Nat.mul q X) (S r1))) delta)) *) (* Goal: gt (S r1) O *) (* Goal: gcd (Z.of_nat (S r1)) (Z.of_nat X) d *) (* Goal: gt X O *) unfold Zminus in |- *. rewrite Zmult_plus_distr_r. (* Goal: @eq Z (Z.add (Z.mul (Z.of_nat (S r1)) delta) (Z.mul (Z.of_nat X) gamma)) (Z.add (Z.add (Z.mul (Z.of_nat X) gamma) (Z.mul (Z.of_nat X) (Z.opp (Z.mul (Z.of_nat q) delta)))) (Z.mul (Z.of_nat (Init.Nat.add (Init.Nat.mul q X) (S r1))) delta)) *) (* Goal: gt (S r1) O *) (* Goal: gcd (Z.of_nat (S r1)) (Z.of_nat X) d *) (* Goal: gt X O *) rewrite Znat.inj_plus. rewrite Zmult_plus_distr_l. (* Goal: @eq Z (Z.add (Z.mul (Z.of_nat (S r1)) delta) (Z.mul (Z.of_nat X) gamma)) (Z.add (Z.add (Z.mul (Z.of_nat X) gamma) (Z.mul (Z.of_nat X) (Z.opp (Z.mul (Z.of_nat q) delta)))) (Z.add (Z.mul (Z.of_nat (Init.Nat.mul q X)) delta) (Z.mul (Z.of_nat (S r1)) delta))) *) (* Goal: gt (S r1) O *) (* Goal: gcd (Z.of_nat (S r1)) (Z.of_nat X) d *) (* Goal: gt X O *) rewrite Znat.inj_mult. rewrite <- Zopp_mult_distr_l_reverse. (* Goal: @eq Z (Z.add (Z.mul (Z.of_nat (S r1)) delta) (Z.mul (Z.of_nat X) gamma)) (Z.add (Z.add (Z.mul (Z.of_nat X) gamma) (Z.mul (Z.of_nat X) (Z.mul (Z.opp (Z.of_nat q)) delta))) (Z.add (Z.mul (Z.mul (Z.of_nat q) (Z.of_nat X)) delta) (Z.mul (Z.of_nat (S r1)) delta))) *) (* Goal: gt (S r1) O *) (* Goal: gcd (Z.of_nat (S r1)) (Z.of_nat X) d *) (* Goal: gt X O *) rewrite (Zmult_assoc (Z_of_nat X)). (* Goal: @eq Z (Z.add (Z.mul (Z.of_nat (S r1)) delta) (Z.mul (Z.of_nat X) gamma)) (Z.add (Z.add (Z.mul (Z.of_nat X) gamma) (Z.mul (Z.mul (Z.of_nat X) (Z.opp (Z.of_nat q))) delta)) (Z.add (Z.mul (Z.mul (Z.of_nat q) (Z.of_nat X)) delta) (Z.mul (Z.of_nat (S r1)) delta))) *) (* Goal: gt (S r1) O *) (* Goal: gcd (Z.of_nat (S r1)) (Z.of_nat X) d *) (* Goal: gt X O *) rewrite (Zmult_comm (Z_of_nat X) (- Z_of_nat q)). (* Goal: @eq Z (Z.add (Z.opp (Z.mul x alpha)) (Z.mul y beta)) (Z.add (Z.mul (Z.opp alpha) x) (Z.mul y beta)) *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) rewrite Zopp_mult_distr_l_reverse. rewrite Zopp_mult_distr_l_reverse. (* Goal: @eq Z (Z.add (Z.mul (Z.of_nat (S r1)) delta) (Z.mul (Z.of_nat X) gamma)) (Z.add (Z.add (Z.mul (Z.of_nat X) gamma) (Z.opp (Z.mul (Z.mul (Z.of_nat q) (Z.of_nat X)) delta))) (Z.add (Z.mul (Z.mul (Z.of_nat q) (Z.of_nat X)) delta) (Z.mul (Z.of_nat (S r1)) delta))) *) (* Goal: gt (S r1) O *) (* Goal: gcd (Z.of_nat (S r1)) (Z.of_nat X) d *) (* Goal: gt X O *) rewrite (Zplus_assoc_reverse (Z_of_nat X * gamma)). (* Goal: @eq Z (Z.of_nat y) (Z.add (Z.mul (Z.of_nat q) (Z.of_nat X)) (Z.of_nat (S r1))) *) (* Goal: gt X O *) rewrite <- Znat.inj_mult. (* Goal: @eq Z (Z.add (Z.mul (Z.of_nat (S r1)) delta) (Z.mul (Z.of_nat X) gamma)) (Z.add (Z.mul (Z.of_nat X) gamma) (Z.add (Z.opp (Z.mul (Z.of_nat (Init.Nat.mul q X)) delta)) (Z.add (Z.mul (Z.of_nat (Init.Nat.mul q X)) delta) (Z.mul (Z.of_nat (S r1)) delta)))) *) (* Goal: gt (S r1) O *) (* Goal: gcd (Z.of_nat (S r1)) (Z.of_nat X) d *) (* Goal: gt X O *) rewrite (Zplus_assoc (- (Z_of_nat (q * X) * delta))). (* Goal: not (@eq comparison (Z.compare Z0 Z0) Gt) *) (* Goal: Z.gt x Z0 *) (* Goal: gcd (Z.of_nat (Z.abs_nat x)) (Z.of_nat (Z.abs_nat y)) d *) (* Goal: Z.lt y Z0 *) (* Goal: @eq Z (Z.opp (Z.opp y)) y *) (* Goal: Z.ge x Z0 *) rewrite Zplus_opp_l. simpl in |- *. apply Zplus_comm. (* Goal: gt (S r1) O *) (* Goal: gcd (Z.of_nat (S r1)) (Z.of_nat X) d *) (* Goal: gt X O *) apply gt_Sn_O. apply (euclid_gcd1 d (Z_of_nat y) (Z_of_nat X) (Z_of_nat q) (Z_of_nat (S r1))). (* Goal: gcd x y d *) apply gcd_sym. assumption. (* Goal: gcd x y d *) rewrite <- Znat.inj_mult. rewrite <- Znat.inj_plus. apply Znat.inj_eq. assumption. (* Goal: gcd x y d *) assumption. Qed. Lemma gcd_lincomb_pos : forall (x y : Z) (d : nat), (x > 0)%Z -> gcd x y d -> LinComb (Z_of_nat d) x y. Proof. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) intros. (* Goal: LinComb (Z.of_nat d) x y *) elim (Zle_or_lt 0 y). (* case 0 <= y *) (* Goal: forall _ : Z.lt x Z0, LinComb (Z.of_nat d) x y *) intro. rewrite <- (inj_abs_pos x). rewrite <- (inj_abs_pos y). (* Goal: LinComb (Z.of_nat d) (Z.of_nat (Z.abs_nat x)) (Z.of_nat (Z.abs_nat y)) *) (* Goal: Z.ge y Z0 *) (* Goal: Z.ge x Z0 *) (* Goal: forall _ : Z.lt y Z0, LinComb (Z.of_nat d) x y *) apply gcd_lincomb_nat. (* Goal: gt (Z.abs_nat x) O *) (* Goal: gcd (Z.of_nat (Z.abs_nat x)) (Z.of_nat (Z.abs_nat y)) d *) (* Goal: Z.lt y Z0 *) (* Goal: @eq Z (Z.opp (Z.opp y)) y *) (* Goal: Z.ge x Z0 *) change (Zabs_nat x > Zabs_nat 0) in |- *. (* Goal: gcd x y d *) apply gtzgt. apply Zlt_le_weak. apply Zgt_lt. assumption. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Gt) *) (* Goal: Z.gt x Z0 *) (* Goal: gcd (Z.of_nat (Z.abs_nat x)) (Z.of_nat (Z.abs_nat y)) d *) (* Goal: Z.lt y Z0 *) (* Goal: @eq Z (Z.opp (Z.opp y)) y *) (* Goal: Z.ge x Z0 *) unfold Zle in |- *. simpl in |- *. discriminate. (* Goal: gcd x y d *) assumption. (* Goal: gcd x y d *) rewrite inj_abs_pos. rewrite inj_abs_pos. assumption. (* Goal: gcd x y d *) apply Zle_ge. assumption. (* Goal: gcd x y d *) apply Zle_ge. apply Zlt_le_weak. apply Zgt_lt. assumption. (* Goal: gcd x y d *) apply Zle_ge. assumption. (* Goal: gcd x y d *) apply Zle_ge. apply Zlt_le_weak. apply Zgt_lt. assumption. (* case y < 0 *) (* Goal: forall _ : Z.lt x Z0, LinComb (Z.of_nat d) x y *) intro. rewrite <- (inj_abs_pos x). (* Goal: LinComb (Z.of_nat d) (Z.of_nat (Z.abs_nat x)) y *) (* Goal: Z.ge x Z0 *) replace y with (- - y)%Z. rewrite <- (inj_abs_neg y). (* Goal: LinComb (Z.of_nat d) (Z.of_nat (Z.abs_nat x)) (Z.opp (Z.of_nat (Z.abs_nat y))) *) (* Goal: Z.lt y Z0 *) (* Goal: @eq Z (Z.opp (Z.opp y)) y *) (* Goal: Z.ge x Z0 *) elim (gcd_lincomb_nat (Zabs_nat x) (Zabs_nat y) d). (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) intro alpha. intros. elim H2. intro beta. intros. (* Goal: LinComb (Z.of_nat d) (Z.of_nat (Z.abs_nat x)) (Z.opp (Z.of_nat (Z.abs_nat y))) *) (* Goal: gt (Z.abs_nat x) O *) (* Goal: gcd (Z.of_nat (Z.abs_nat x)) (Z.of_nat (Z.abs_nat y)) d *) (* Goal: Z.lt y Z0 *) (* Goal: @eq Z (Z.opp (Z.opp y)) y *) (* Goal: Z.ge x Z0 *) split with alpha. split with (- beta)%Z. (* Goal: @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.of_nat (Z.abs_nat x)) alpha) (Z.opp (Z.mul beta (Z.opp (Z.of_nat (Z.abs_nat y)))))) *) (* Goal: gt (Z.abs_nat x) O *) (* Goal: gcd (Z.of_nat (Z.abs_nat x)) (Z.of_nat (Z.abs_nat y)) d *) (* Goal: Z.lt y Z0 *) (* Goal: @eq Z (Z.opp (Z.opp y)) y *) (* Goal: Z.ge x Z0 *) rewrite <- Zopp_mult_distr_r. rewrite (Zmult_comm (- Z_of_nat (Zabs_nat y))). (* Goal: @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.of_nat (Z.abs_nat x)) alpha) (Z.opp (Z.mul beta (Z.opp (Z.of_nat (Z.abs_nat y)))))) *) (* Goal: gt (Z.abs_nat x) O *) (* Goal: gcd (Z.of_nat (Z.abs_nat x)) (Z.of_nat (Z.abs_nat y)) d *) (* Goal: Z.lt y Z0 *) (* Goal: @eq Z (Z.opp (Z.opp y)) y *) (* Goal: Z.ge x Z0 *) rewrite <- Zopp_mult_distr_r. rewrite Zopp_involutive. rewrite (Zmult_comm beta). (* Goal: gcd x y d *) assumption. (* Goal: gt (Z.abs_nat x) O *) (* Goal: gcd (Z.of_nat (Z.abs_nat x)) (Z.of_nat (Z.abs_nat y)) d *) (* Goal: Z.lt y Z0 *) (* Goal: @eq Z (Z.opp (Z.opp y)) y *) (* Goal: Z.ge x Z0 *) change (Zabs_nat x > Zabs_nat 0) in |- *. apply gtzgt. (* Goal: gcd x y d *) apply Zlt_le_weak. apply Zgt_lt. assumption. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Gt) *) (* Goal: Z.gt x Z0 *) (* Goal: gcd (Z.of_nat (Z.abs_nat x)) (Z.of_nat (Z.abs_nat y)) d *) (* Goal: Z.lt y Z0 *) (* Goal: @eq Z (Z.opp (Z.opp y)) y *) (* Goal: Z.ge x Z0 *) unfold Zle in |- *. simpl in |- *. discriminate. (* Goal: gcd x y d *) assumption. (* Goal: gcd x y d *) rewrite inj_abs_pos. rewrite inj_abs_neg. apply gcd_opp_r. assumption. (* Goal: gcd x y d *) assumption. (* Goal: gcd x y d *) apply Zle_ge. apply Zlt_le_weak. apply Zgt_lt. assumption. (* Goal: gcd x y d *) assumption. (* Goal: @eq Z (Z.opp (Z.opp y)) y *) (* Goal: Z.ge x Z0 *) apply Zopp_involutive. (* Goal: gcd x y d *) apply Zle_ge. apply Zlt_le_weak. apply Zgt_lt. assumption. Qed. Theorem gcd_lincomb : forall (x y : Z) (d : nat), x <> 0%Z -> gcd x y d -> LinComb (Z_of_nat d) x y. Proof. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) intros. (* Goal: LinComb (Z.of_nat d) x y *) elim (Zle_or_lt 0 x). (* Goal: forall _ : Z.lt x Z0, LinComb (Z.of_nat d) x y *) intro. (* Goal: LinComb (Z.of_nat d) x y *) (* Goal: forall _ : Z.lt x Z0, LinComb (Z.of_nat d) x y *) elim (Zle_lt_or_eq 0 x). (* case 0 < x *) (* Goal: forall _ : Z.lt x Z0, LinComb (Z.of_nat d) x y *) intro. (* Goal: LinComb (Z.of_nat d) x y *) (* Goal: forall _ : @eq Z Z0 x, LinComb (Z.of_nat d) x y *) (* Goal: Z.le Z0 x *) (* Goal: forall _ : Z.lt x Z0, LinComb (Z.of_nat d) x y *) apply gcd_lincomb_pos. (* Goal: Z.gt x Z0 *) (* Goal: gcd x y d *) (* Goal: forall _ : @eq Z Z0 x, LinComb (Z.of_nat d) x y *) (* Goal: Z.le Z0 x *) (* Goal: forall _ : Z.lt x Z0, LinComb (Z.of_nat d) x y *) apply Zlt_gt. (* Goal: gcd x y d *) assumption. (* Goal: gcd x y d *) assumption. (* case 0 = x *) (* Goal: forall _ : Z.lt x Z0, LinComb (Z.of_nat d) x y *) intro. (* Goal: LinComb (Z.of_nat d) x y *) (* Goal: Z.le Z0 x *) (* Goal: forall _ : Z.lt x Z0, LinComb (Z.of_nat d) x y *) elim H. (* Goal: @eq Z x Z0 *) (* Goal: Z.le Z0 x *) (* Goal: forall _ : Z.lt x Z0, LinComb (Z.of_nat d) x y *) rewrite H2. (* Goal: @eq Z (Z.add (Z.opp (Z.mul x alpha)) (Z.mul y beta)) (Z.add (Z.opp (Z.mul x alpha)) (Z.mul y beta)) *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) reflexivity. (* Goal: gcd x y d *) assumption. (* case 0 > x *) (* Goal: forall _ : Z.lt x Z0, LinComb (Z.of_nat d) x y *) intro. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) elim (gcd_lincomb_pos (- x) y d). intro alpha. intros. (* Goal: forall _ : @eq Z (Z.of_nat d) (Z.add (Z.mul (Z.opp x) alpha) (Z.mul y beta)), LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) elim H2. intro beta. intros. (* Goal: LinComb (Z.of_nat d) x y *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) split with (- alpha)%Z. split with beta. (* Goal: @eq Z (Z.of_nat d) (Z.add (Z.mul x (Z.opp alpha)) (Z.mul y beta)) *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) rewrite H3. (* Goal: @eq Z (Z.add (Z.opp (Z.mul x alpha)) (Z.mul y beta)) (Z.add (Z.mul (Z.opp alpha) x) (Z.mul y beta)) *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) rewrite (Zmult_comm x). rewrite Zopp_mult_distr_l_reverse. rewrite Zopp_mult_distr_l_reverse. (* Goal: @eq Z (Z.add (Z.opp (Z.mul x alpha)) (Z.mul y beta)) (Z.add (Z.opp (Z.mul x alpha)) (Z.mul y beta)) *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: gcd (Z.opp x) y d *) rewrite (Zmult_comm alpha). reflexivity. (* Goal: gcd x y d *) apply Zopp_lt_gt_0. assumption. apply gcd_opp_l. assumption. Qed.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) (** modulo Modulo Arithmetic. @author Olga Caprotti and Martijn Oostdijk @version $Revision$ *) Require Import ZArith. Require Import lemmas. Require Import natZ. Require Import exp. Require Import divides. (** (Mod a b n) means (a = b (mod n)) *) Definition Mod (a b : Z) (n : nat) := exists q : Z, a = (b + Z_of_nat n * q)%Z. Lemma modpq_modp : forall (a b : Z) (p q : nat), Mod a b (p * q) -> Mod a b p. Proof. (* Goal: Mod (Z.mul (Z.of_nat n) x) Z0 n *) unfold Mod in |- *. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. (* Goal: False *) elim H. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. (* Goal: @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul (Z.of_nat p) q))) *) split with (Z_of_nat q * x)%Z. (* Goal: @eq Z a (Z.add b (Z.mul (Z.of_nat p) (Z.mul (Z.of_nat q) x))) *) rewrite (Znat.inj_mult p q) in H0. (* Goal: @eq Z (Z.mul (Z.add b (Z.mul n x)) (Zneg xH)) (Z.add (Z.mul b (Zneg xH)) (Z.mul n (Z.mul x (Zneg xH)))) *) rewrite Zmult_assoc. (* Goal: ZMod x Z0 n *) assumption. Qed. Lemma mod_refl : forall (a : Z) (n : nat), Mod a a n. Proof. (* Goal: Mod (Z.mul (Z.of_nat n) x) Z0 n *) unfold Mod in |- *. intros. (* Goal: @ex Z (fun q : Z => @eq Z a (Z.add a (Z.mul n q))) *) split with 0%Z. (* Goal: @eq Z b (Z.add b (Z.mul n Z0)) *) rewrite <- Zmult_0_r_reverse. (* Goal: ZDivides n (Z.add (Z.mul n x) Z0) *) (* Goal: forall _ : ZDivides n (Z.sub a b), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) rewrite <- Zplus_0_r_reverse. (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) reflexivity. Qed. Lemma mod_sym : forall (a b : Z) (n : nat), Mod a b n -> Mod b a n. Proof. (* Goal: Mod (Z.mul (Z.of_nat n) x) Z0 n *) unfold Mod in |- *. intros. (* Goal: False *) elim H. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. (* Goal: ZMod (Z.opp a) (Z.opp b) n *) split with (- x)%Z. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) simpl in |- *. (* Goal: ZDivides n (Z.sub a b) *) (* Goal: forall _ : ZDivides n (Z.sub a b), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) rewrite H0. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) simpl in |- *. (* Goal: ZDivides n (Z.add (Z.add (Z.mul n x) (Z.opp b)) b) *) (* Goal: forall _ : ZDivides n (Z.sub a b), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) rewrite Zplus_assoc_reverse. (* Goal: @eq Z b (Z.add b (Z.add (Z.mul n x) (Z.mul n (Z.opp x)))) *) rewrite <- Zmult_plus_distr_r. (* Goal: ZDivides n (Z.add (Z.mul n x) (Z.add b (Z.opp b))) *) (* Goal: forall _ : ZDivides n (Z.sub a b), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) rewrite Zplus_opp_r. (* Goal: @eq Z b (Z.add b (Z.mul n Z0)) *) rewrite <- Zmult_0_r_reverse. (* Goal: @eq Z b (Z.add b Z0) *) apply Zplus_0_r_reverse. Qed. Lemma mod_trans : forall (a b c : Z) (n : nat), Mod a b n -> Mod b c n -> Mod a c n. Proof. (* Goal: Mod (Z.mul (Z.of_nat n) x) Z0 n *) unfold Mod in |- *. intros. (* Goal: False *) elim H. elim H0. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. rewrite H2. rewrite H1. (* Goal: @ex Z (fun q : Z => @eq Z (Z.add a c) (Z.add (Z.add b d) (Z.mul n q))) *) split with (x + x0)%Z. (* Goal: @eq Z (Z.add (Z.add c (Z.mul n x)) (Z.mul n x0)) (Z.add c (Z.mul n (Z.add x x0))) *) rewrite Zmult_plus_distr_r. (* Goal: @eq Z (Z.add (Z.add c (Z.mul (Z.of_nat n) x)) (Z.mul (Z.of_nat n) x0)) (Z.add c (Z.add (Z.mul (Z.of_nat n) x) (Z.mul (Z.of_nat n) x0))) *) rewrite (Zplus_assoc c (Z_of_nat n * x) (Z_of_nat n * x0)). (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) reflexivity. Qed. Lemma eqmod : forall x y : Z, x = y -> forall n : nat, Mod x y n. Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. rewrite H. apply mod_refl. Qed. Lemma mod_plus_compat : forall (a b c d : Z) (n : nat), Mod a b n -> Mod c d n -> Mod (a + c) (b + d) n. Proof. (* Goal: Mod (Z.mul (Z.of_nat n) x) Z0 n *) unfold Mod in |- *. intros. (* Goal: False *) elim H. elim H0. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. split with (x + x0)%Z. (* Goal: @ex Z (fun q : Z => @eq Z (Z.mul a c) (Z.add (Z.mul b d) (Z.mul n q))) *) rewrite H1. (* Goal: @ex Z (fun q : Z => @eq Z (Z.mul a (Z.add d (Z.mul n x))) (Z.add (Z.mul b d) (Z.mul n q))) *) rewrite H2. (* Goal: @eq Z (Z.add (Z.add b (Z.mul (Z.of_nat n) x0)) (Z.add d (Z.mul (Z.of_nat n) x))) (Z.add (Z.add b d) (Z.mul (Z.of_nat n) (Z.add x x0))) *) rewrite (Zplus_assoc (b + Z_of_nat n * x0) d (Z_of_nat n * x)). (* Goal: @eq Z (Z.add (Z.add (Z.add b (Z.mul (Z.of_nat n) x0)) d) (Z.mul (Z.of_nat n) x)) (Z.add (Z.add b d) (Z.mul (Z.of_nat n) (Z.add x x0))) *) rewrite (Zplus_assoc_reverse b (Z_of_nat n * x0) d). (* Goal: @eq Z (Z.add (Z.add b (Z.add (Z.mul (Z.of_nat n) x0) d)) (Z.mul (Z.of_nat n) x)) (Z.add (Z.add b d) (Z.mul (Z.of_nat n) (Z.add x x0))) *) rewrite (Zplus_comm (Z_of_nat n * x0) d). (* Goal: @eq Z (Z.add (Z.add b (Z.add d (Z.mul n x0))) (Z.mul n x)) (Z.add (Z.add b d) (Z.mul n (Z.add x x0))) *) rewrite (Zplus_comm x x0). (* Goal: @eq Z (Z.add (Z.add b (Z.add d (Z.mul (Z.of_nat n) x0))) (Z.mul (Z.of_nat n) x)) (Z.add (Z.add b d) (Z.mul (Z.of_nat n) (Z.add x0 x))) *) rewrite (Zmult_plus_distr_r (Z_of_nat n) x0 x). (* Goal: @eq Z a (Z.add (Z.opp b) (Z.add b a)) *) rewrite Zplus_assoc. (* Goal: @eq Z a (Z.add (Z.opp b) (Z.add b a)) *) rewrite Zplus_assoc. (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) reflexivity. Qed. Lemma mod_mult_compat : forall (a b c d : Z) (n : nat), Mod a b n -> Mod c d n -> Mod (a * c) (b * d) n. Proof. (* Goal: Mod (Z.mul (Z.of_nat n) x) Z0 n *) unfold Mod in |- *. intros. (* Goal: False *) elim H. elim H0. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. rewrite H1. rewrite H2. split with (x0 * d + x * b + Z_of_nat n * x0 * x)%Z. (* Goal: @eq Z (Z.mul (Z.add b (Z.mul (Z.of_nat n) x0)) (Z.add d (Z.mul (Z.of_nat n) x))) (Z.add (Z.mul b d) (Z.mul (Z.of_nat n) (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul (Z.of_nat n) x0) x)))) *) rewrite (Zmult_plus_distr_r (b + Z_of_nat n * x0) d (Z_of_nat n * x)). (* Goal: @eq Z (Z.add (Z.add (Z.mul b d) (Z.mul (Z.mul n x0) d)) (Z.mul (Z.add b (Z.mul n x0)) (Z.mul n x))) (Z.add (Z.mul b d) (Z.mul n (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul n x0) x)))) *) rewrite Zmult_plus_distr_l. (* Goal: @eq Z (Z.add (Z.add (Z.mul b d) (Z.mul (Z.mul n x0) d)) (Z.mul (Z.add b (Z.mul n x0)) (Z.mul n x))) (Z.add (Z.mul b d) (Z.mul n (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul n x0) x)))) *) rewrite Zmult_plus_distr_l. (* Goal: @eq Z (Z.add (Z.add (Z.mul b d) (Z.mul (Z.mul (Z.of_nat n) x0) d)) (Z.add (Z.mul b (Z.mul (Z.of_nat n) x)) (Z.mul (Z.mul (Z.of_nat n) x0) (Z.mul (Z.of_nat n) x)))) (Z.add (Z.mul b d) (Z.mul (Z.of_nat n) (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul (Z.of_nat n) x0) x)))) *) rewrite (Zmult_assoc b (Z_of_nat n) x). (* Goal: @eq Z (Z.add (Z.add (Z.mul b d) (Z.mul (Z.mul (Z.of_nat n) x0) d)) (Z.add (Z.mul (Z.mul b (Z.of_nat n)) x) (Z.mul (Z.mul (Z.of_nat n) x0) (Z.mul (Z.of_nat n) x)))) (Z.add (Z.mul b d) (Z.mul (Z.of_nat n) (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul (Z.of_nat n) x0) x)))) *) rewrite (Zmult_comm b (Z_of_nat n)). (* Goal: @eq Z (Z.add (Z.add (Z.mul b d) (Z.mul (Z.mul (Z.of_nat n) x0) d)) (Z.add (Z.mul (Z.mul (Z.of_nat n) b) x) (Z.mul (Z.mul (Z.of_nat n) x0) (Z.mul (Z.of_nat n) x)))) (Z.add (Z.mul b d) (Z.mul (Z.of_nat n) (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul (Z.of_nat n) x0) x)))) *) rewrite (Zmult_assoc (Z_of_nat n * x0) (Z_of_nat n) x). (* Goal: @eq Z (Z.add (Z.add (Z.mul b d) (Z.mul (Z.mul (Z.of_nat n) x0) d)) (Z.add (Z.mul (Z.mul (Z.of_nat n) b) x) (Z.mul (Z.mul (Z.mul (Z.of_nat n) x0) (Z.of_nat n)) x))) (Z.add (Z.mul b d) (Z.mul (Z.of_nat n) (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul (Z.of_nat n) x0) x)))) *) rewrite (Zmult_assoc_reverse (Z_of_nat n) x0 (Z_of_nat n)). (* Goal: @eq Z (Z.add (Z.add (Z.mul b d) (Z.mul (Z.mul (Z.of_nat n) x0) d)) (Z.add (Z.mul (Z.mul (Z.of_nat n) b) x) (Z.mul (Z.mul (Z.of_nat n) (Z.mul x0 (Z.of_nat n))) x))) (Z.add (Z.mul b d) (Z.mul (Z.of_nat n) (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul (Z.of_nat n) x0) x)))) *) rewrite (Zmult_assoc_reverse (Z_of_nat n) (x0 * Z_of_nat n) x). (* Goal: @eq Z (Z.add (Z.add (Z.mul b d) (Z.mul (Z.mul (Z.of_nat n) x0) d)) (Z.add (Z.mul (Z.mul (Z.of_nat n) b) x) (Z.mul (Z.of_nat n) (Z.mul (Z.mul x0 (Z.of_nat n)) x)))) (Z.add (Z.mul b d) (Z.mul (Z.of_nat n) (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul (Z.of_nat n) x0) x)))) *) rewrite (Zmult_assoc_reverse (Z_of_nat n) b x). (* Goal: @eq Z (Z.add (Z.add (Z.mul b d) (Z.mul (Z.mul (Z.of_nat n) x0) d)) (Z.add (Z.mul (Z.of_nat n) (Z.mul b x)) (Z.mul (Z.of_nat n) (Z.mul (Z.mul x0 (Z.of_nat n)) x)))) (Z.add (Z.mul b d) (Z.mul (Z.of_nat n) (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul (Z.of_nat n) x0) x)))) *) rewrite <- (Zmult_plus_distr_r (Z_of_nat n) (b * x) (x0 * Z_of_nat n * x)). (* Goal: @eq Z (Z.add (Z.add (Z.mul b d) (Z.mul (Z.mul n x0) d)) (Z.mul n (Z.add (Z.mul b x) (Z.mul (Z.mul x0 n) x)))) (Z.add (Z.mul b d) (Z.mul n (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul n x0) x)))) *) rewrite (Zplus_assoc_reverse (b * d)). (* Goal: @eq Z (Z.add (Z.mul b d) (Z.add (Z.mul (Z.mul (Z.of_nat n) x0) d) (Z.mul (Z.of_nat n) (Z.add (Z.mul b x) (Z.mul (Z.mul x0 (Z.of_nat n)) x))))) (Z.add (Z.mul b d) (Z.mul (Z.of_nat n) (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul (Z.of_nat n) x0) x)))) *) rewrite (Zmult_assoc_reverse (Z_of_nat n) x0 d). rewrite <- (Zmult_plus_distr_r (Z_of_nat n) (x0 * d) (b * x + x0 * Z_of_nat n * x)) . (* Goal: @eq Z (Z.add (Z.mul b d) (Z.mul (Z.of_nat n) (Z.add (Z.mul x0 d) (Z.add (Z.mul b x) (Z.mul (Z.mul x0 (Z.of_nat n)) x))))) (Z.add (Z.mul b d) (Z.mul (Z.of_nat n) (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul (Z.of_nat n) x0) x)))) *) rewrite (Zmult_comm x0 (Z_of_nat n)). (* Goal: @eq Z a (Z.add (Z.opp b) (Z.add b a)) *) rewrite Zplus_assoc. (* Goal: @eq Z (Z.add (Z.mul b d) (Z.mul n (Z.add (Z.add (Z.mul x0 d) (Z.mul b x)) (Z.mul (Z.mul n x0) x)))) (Z.add (Z.mul b d) (Z.mul n (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul n x0) x)))) *) rewrite (Zmult_comm b x). (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) reflexivity. Qed. Lemma mod_sqr_compat : forall (a b : Z) (n : nat), Mod a b n -> Mod (a * a) (b * b) n. Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. apply mod_mult_compat. assumption. assumption. Qed. Lemma mod_exp_compat : forall (a b : Z) (n : nat), Mod a b n -> forall m : nat, Mod (Exp a m) (Exp b m) n. Proof. (* Goal: forall m : nat, Mod (Exp a m) (Zpos xH) n *) simple induction m. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) simpl in |- *. apply mod_refl. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) intros m1 IHm. simpl in |- *. (* Goal: Mod (Z.mul a (Exp a m1)) (Z.mul (Zpos xH) (Zpos xH)) n *) (* Goal: @eq Z (Z.mul (Zpos xH) (Zpos xH)) (Zpos xH) *) apply mod_mult_compat. (* Goal: ZMod x Z0 n *) assumption. assumption. Qed. Lemma moda0_exp_compat : forall (a : Z) (n : nat), n > 0 -> Mod a 0 n -> forall m : nat, m > 0 -> Mod (Exp a m) 0 n. Proof. (* Goal: forall (a : Z) (n : nat) (_ : gt n O) (_ : Mod a Z0 n) (m : nat) (_ : gt m O), Mod (Exp a m) Z0 n *) intros a n. (* Goal: forall (_ : gt n O) (_ : Mod a Z0 n) (m : nat) (_ : gt m O), Mod (Exp a m) Z0 n *) case n. (* Goal: not (ZMod x Z0 n) *) intro. (* Goal: Mod (Exp a O) Z0 (S n0) *) (* Goal: forall (n : nat) (_ : gt (S n) O), Mod (Exp a (S n)) Z0 (S n0) *) elim (lt_irrefl 0). (* Goal: ZMod x Z0 n *) assumption. (* Goal: not (ZMod x Z0 n) *) intro. (* Goal: not (ZMod x Z0 n) *) intro. (* Goal: not (ZMod x Z0 n) *) intro. (* Goal: not (ZMod x Z0 n) *) intro. (* Goal: forall _ : gt m O, Mod (Exp a m) Z0 (S n0) *) case m. (* Goal: not (ZMod x Z0 n) *) intro. (* Goal: Mod (Exp a O) Z0 (S n0) *) (* Goal: forall (n : nat) (_ : gt (S n) O), Mod (Exp a (S n)) Z0 (S n0) *) elim (lt_irrefl 0). (* Goal: ZMod x Z0 n *) assumption. (* Goal: forall (n : nat) (_ : gt (S n) O), Mod (Exp a (S n)) Z0 (S n0) *) intro m0. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. (* Goal: forall (x : Z) (_ : @eq Z a (Z.add b (Z.mul n x))), @ex Z (fun q : Z => @eq Z (Z.mul a c) (Z.add (Z.mul b d) (Z.mul n q))) *) elim H0. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. (* Goal: @ex Z (fun q : Z => @eq Z (Z.mul a (Z.add d (Z.mul n x))) (Z.add (Z.mul b d) (Z.mul n q))) *) rewrite H2. (* Goal: Mod (Exp (Z.add Z0 (Z.mul (Z.of_nat (S n0)) x)) (S m0)) Z0 (S n0) *) split with (x * Exp (Z_of_nat (S n0) * x) m0)%Z. (* Goal: @eq Z (Z.mul (Z.add b (Z.mul n x)) (Zneg xH)) (Z.add (Z.mul b (Zneg xH)) (Z.mul n (Z.mul x (Zneg xH)))) *) rewrite Zmult_assoc. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) simpl in |- *. (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) reflexivity. Qed. Lemma mod_opp_compat : forall (a b : Z) (n : nat), Mod a b n -> Mod (- a) (- b) n. Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. elim H. intros. (* Goal: ZMod (Z.opp a) (Z.opp b) n *) split with (- x)%Z. rewrite H0. (* Goal: @eq Z (Z.mul (Z.add b (Z.mul n x)) (Zneg xH)) (Z.add (Z.mul b (Zneg xH)) (Z.mul n (Z.opp x))) *) rewrite Zopp_eq_mult_neg_1. (* Goal: @eq Z (Z.mul (Z.add b (Z.mul n x)) (Zneg xH)) (Z.add (Z.mul b (Zneg xH)) (Z.mul n (Z.opp x))) *) rewrite Zopp_eq_mult_neg_1. (* Goal: @eq Z (Z.mul (Z.add b (Z.mul n x)) (Zneg xH)) (Z.add (Z.mul b (Zneg xH)) (Z.mul n (Z.opp x))) *) rewrite Zopp_eq_mult_neg_1. (* Goal: @eq Z (Z.mul (Z.add b (Z.mul n x)) (Zneg xH)) (Z.add (Z.mul b (Zneg xH)) (Z.mul n (Z.mul x (Zneg xH)))) *) rewrite Zmult_assoc. (* Goal: @eq Z (Z.mul (Z.add b (Z.mul n x)) (Zneg xH)) (Z.add (Z.mul b (Zneg xH)) (Z.mul (Z.mul n x) (Zneg xH))) *) rewrite <- Zmult_plus_distr_l. (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) reflexivity. Qed. Lemma mod_minus_compat : forall (a b c d : Z) (n : nat), Mod a b n -> Mod c d n -> Mod (a - c) (b - d) n. Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. (* Goal: @eq Z a (Z.add b (Z.sub a b)) *) unfold Zminus in |- *. (* Goal: Mod (Z.add a (Z.opp c)) (Z.add b (Z.opp d)) n *) apply mod_plus_compat. (* Goal: ZMod x Z0 n *) assumption. (* Goal: Mod (Z.opp c) (Z.opp d) n *) apply mod_opp_compat. (* Goal: ZMod x Z0 n *) assumption. Qed. Lemma mod_nx_0_n : forall (n : nat) (x : Z), Mod (Z_of_nat n * x) 0 n. Proof. (* Goal: Mod (Z.mul (Z.of_nat n) x) Z0 n *) intros. unfold Mod in |- *. (* Goal: @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) split with x. (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) simpl in |- *. reflexivity. Qed. Lemma moddivmin : forall (a b : Z) (n : nat), Mod a b n <-> Divides n (Zabs_nat (a - b)). Proof. (* Goal: forall (a b : Z) (n : nat), iff (Mod a b n) (Divides n (Z.abs_nat (Z.sub a b))) *) unfold Mod, Divides in |- *. split. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. (* Goal: False *) elim H. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. (* Goal: ZDivides n (Z.sub a b) *) (* Goal: forall _ : ZDivides n (Z.sub a b), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) rewrite H0. (* Goal: @eq Z a (Z.add b (Z.sub a b)) *) unfold Zminus in |- *. (* Goal: ZDivides n (Z.add (Z.add (Z.mul n x) (Z.opp b)) b) *) (* Goal: forall _ : ZDivides n (Z.sub a b), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) rewrite Zplus_assoc_reverse. (* Goal: @eq Z a (Z.add (Z.add b a) (Z.opp b)) *) rewrite Zplus_comm. (* Goal: ZDivides n (Z.add (Z.add (Z.mul n x) (Z.opp b)) b) *) (* Goal: forall _ : ZDivides n (Z.sub a b), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) rewrite Zplus_assoc_reverse. (* Goal: ZDivides n (Z.add (Z.mul n x) (Z.add (Z.opp b) b)) *) (* Goal: forall _ : ZDivides n (Z.sub a b), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) rewrite (Zplus_comm (- b) b). (* Goal: ZDivides n (Z.add (Z.mul n x) (Z.add b (Z.opp b))) *) (* Goal: forall _ : ZDivides n (Z.sub a b), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) rewrite Zplus_opp_r. (* Goal: ZDivides n (Z.add (Z.mul n x) Z0) *) (* Goal: forall _ : ZDivides n (Z.sub a b), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) rewrite <- Zplus_0_r_reverse. (* Goal: @ex nat (fun q : nat => @eq nat (Z.abs_nat (Z.mul (Z.of_nat n) x)) (Init.Nat.mul n q)) *) (* Goal: forall _ : @ex nat (fun q : nat => @eq nat (Z.abs_nat (Z.sub a b)) (Init.Nat.mul n q)), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul (Z.of_nat n) q))) *) split with (Zabs_nat x). (* Goal: @eq nat (Z.abs_nat (Z.mul (Z.of_nat n) x)) (Init.Nat.mul n (Z.abs_nat x)) *) (* Goal: forall _ : @ex nat (fun q : nat => @eq nat (Z.abs_nat (Z.sub a b)) (Init.Nat.mul n q)), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul (Z.of_nat n) q))) *) pattern n at 2 in |- *. (* Goal: lt (Z.abs_nat x) n *) rewrite <- (abs_inj n). (* Goal: @eq nat (Z.abs_nat (Z.mul (Z.of_nat n) x)) (Init.Nat.mul (Z.abs_nat (Z.of_nat n)) (Z.abs_nat x)) *) (* Goal: forall _ : @ex nat (fun q : nat => @eq nat (Z.abs_nat (Z.sub a b)) (Init.Nat.mul n q)), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul (Z.of_nat n) q))) *) apply abs_mult. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. elim H. intros. (* Goal: @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul (Z.of_nat n) q))) *) elim (Zle_or_lt b a). (* Goal: forall _ : Z.le b a, @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul (Z.of_nat n) q))) *) (* Goal: forall _ : Z.lt a b, @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul (Z.of_nat n) q))) *) split with (Z_of_nat x). (* Goal: @eq Z a (Z.add b (Z.opp (Z.mul (Z.of_nat x) (Z.of_nat n)))) *) rewrite <- Znat.inj_mult. (* Goal: @eq Z a (Z.add b (Z.mul n x)) *) rewrite <- H0. (* Goal: Z.lt x (Z.of_nat (Z.abs_nat n)) *) (* Goal: Mod x Z0 (Z.abs_nat n) *) rewrite inj_abs_pos. (* Goal: @eq Z a (Z.add b (Z.sub a b)) *) unfold Zminus in |- *. (* Goal: @eq Z a (Z.add (Z.opp b) (Z.add b a)) *) rewrite Zplus_assoc. (* Goal: @eq Z a (Z.add (Z.add b a) (Z.opp b)) *) rewrite Zplus_comm. (* Goal: @eq Z a (Z.add (Z.opp b) (Z.add b a)) *) rewrite Zplus_assoc. (* Goal: @eq Z a (Z.add (Z.add (Z.opp b) b) a) *) rewrite Zplus_opp_l. (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) simpl in |- *. reflexivity. (* Goal: Z.ge n Z0 *) (* Goal: Mod x Z0 (Z.abs_nat n) *) apply Zle_ge. (* Goal: @eq Z a (Z.add b (Z.sub a b)) *) replace 0%Z with (b - b)%Z. unfold Zminus in |- *. (* Goal: ZMod x Z0 n *) apply Zplus_le_compat_r. assumption. (* Goal: @eq Z a (Z.add b (Z.sub a b)) *) unfold Zminus in |- *. (* Goal: @eq Z (Z.add b (Z.opp b)) Z0 *) apply Zplus_opp_r. (* Goal: forall _ : Z.lt a b, @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul (Z.of_nat n) q))) *) split with (- Z_of_nat x)%Z. (* Goal: @eq Z a (Z.add b (Z.opp (Z.mul q n))) *) (* Goal: Z.lt n Z0 *) rewrite Zmult_comm. (* Goal: @eq Z a (Z.add b (Z.mul (Z.opp q) n)) *) (* Goal: Z.lt n Z0 *) rewrite Zopp_mult_distr_l_reverse. (* Goal: @eq Z a (Z.add b (Z.opp (Z.mul (Z.of_nat x) (Z.of_nat n)))) *) rewrite <- Znat.inj_mult. (* Goal: @eq Z a (Z.add b (Z.opp (Z.of_nat (Init.Nat.mul x n)))) *) rewrite mult_comm. (* Goal: @eq Z a (Z.add b (Z.mul n x)) *) rewrite <- H0. (* Goal: @ex Z (fun q : Z => @eq Z (Z.add b (Z.mul n x)) (Z.add b (Z.mul (Z.of_nat (Z.abs_nat n)) q))) *) rewrite inj_abs_neg. (* Goal: @eq Z (Z.add b (Z.mul n x)) (Z.add b (Z.mul n (Z.opp (Z.opp x)))) *) (* Goal: Z.lt n Z0 *) rewrite Zopp_involutive. (* Goal: @eq Z a (Z.add b (Z.sub a b)) *) unfold Zminus in |- *. (* Goal: Z.lt (Z.add a (Z.opp b)) (Z.add b (Z.opp b)) *) (* Goal: @eq Z (Z.sub b b) Z0 *) rewrite (Zplus_comm a). (* Goal: @eq Z a (Z.add (Z.opp b) (Z.add b a)) *) rewrite Zplus_assoc. (* Goal: ZDivides n (Z.add (Z.mul n x) (Z.add b (Z.opp b))) *) (* Goal: forall _ : ZDivides n (Z.sub a b), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) rewrite Zplus_opp_r. (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) simpl in |- *. reflexivity. (* Goal: @eq Z a (Z.add b (Z.sub a b)) *) replace 0%Z with (b - b)%Z. unfold Zminus in |- *. (* Goal: Z.lt (Z.add a (Z.opp b)) (Z.add b (Z.opp b)) *) (* Goal: @eq Z (Z.sub b b) Z0 *) rewrite (Zplus_comm a). rewrite (Zplus_comm b). apply Zplus_lt_compat_l. (* Goal: ZMod x Z0 n *) assumption. (* Goal: @eq Z a (Z.add b (Z.sub a b)) *) unfold Zminus in |- *. apply Zplus_opp_r. Qed. Lemma moddec : forall (a b : Z) (n : nat), Mod a b n \/ ~ Mod a b n. Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) elim (moddivmin a b n). intros. (* Goal: or (Mod a b n) (not (Mod a b n)) *) elim (divdec (Zabs_nat (a - b)) n). (* Goal: ZMod x Z0 n *) left. apply H0. assumption. (* Goal: ZMod x Z0 n *) right. intro. elim H1. apply H. assumption. Qed. Lemma mod_0not1 : forall n : nat, n > 1 -> ~ Mod 0 1 n. Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. (* Goal: not (ZMod x Z0 n) *) intro. (* Goal: False *) absurd (Divides n 1). (* Goal: not (ZMod x Z0 n) *) intro. (* Goal: False *) (* Goal: Divides n (S O) *) elim (le_not_lt n 1). (* Goal: le n (S O) *) (* Goal: lt (S O) n *) (* Goal: Divides n (S O) *) apply div_le1. (* Goal: ZMod x Z0 n *) assumption. (* Goal: ZMod x Z0 n *) assumption. (* Goal: Divides n (S O) *) elim (moddivmin 0 1 n). (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. (* Goal: Divides n (S O) *) apply H1. (* Goal: ZMod x Z0 n *) assumption. Qed. Lemma mod_exp1 : forall (a : Z) (n : nat), Mod a 1 n -> forall m : nat, Mod (Exp a m) 1 n. Proof. (* Goal: forall (a : Z) (n : nat) (_ : Mod a (Zpos xH) n) (m : nat), Mod (Exp a m) (Zpos xH) n *) intros a n H. (* Goal: forall m : nat, Mod (Exp a m) (Zpos xH) n *) simple induction m. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) simpl in |- *. (* Goal: Mod (Zpos xH) (Zpos xH) n *) (* Goal: forall (n0 : nat) (_ : Mod (Exp a n0) (Zpos xH) n), Mod (Exp a (S n0)) (Zpos xH) n *) apply mod_refl. (* Goal: forall (n0 : nat) (_ : Mod (Exp a n0) (Zpos xH) n), Mod (Exp a (S n0)) (Zpos xH) n *) intros m1 IH. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) simpl in |- *. (* Goal: Mod (Z.mul a (Exp a m1)) (Zpos xH) n *) replace 1%Z with (1 * 1)%Z. (* Goal: Mod (Z.mul a (Exp a m1)) (Z.mul (Zpos xH) (Zpos xH)) n *) (* Goal: @eq Z (Z.mul (Zpos xH) (Zpos xH)) (Zpos xH) *) apply mod_mult_compat. (* Goal: ZMod x Z0 n *) assumption. (* Goal: Mod (Exp a m1) (Zpos xH) n *) (* Goal: @eq Z (Z.mul (Zpos xH) (Zpos xH)) (Zpos xH) *) apply IH. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) simpl in |- *. (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) reflexivity. Qed. Lemma mod_repr_non_0 : forall (n : nat) (x : Z), (0 < x < Z_of_nat n)%Z -> ~ Mod x 0 n. Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. (* Goal: not (ZMod x Z0 n) *) intro. (* Goal: False *) elim H. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. (* Goal: False *) elim (moddivmin x 0 n). (* Goal: forall (_ : forall _ : Mod x Z0 n, Divides n (Z.abs_nat (Z.sub x Z0))) (_ : forall _ : Divides n (Z.abs_nat (Z.sub x Z0)), Mod x Z0 n), False *) rewrite <- Zminus_0_l_reverse. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. (* Goal: False *) elim (le_not_lt n (Zabs_nat x)). (* Goal: le n (Z.abs_nat x) *) (* Goal: lt (Z.abs_nat x) n *) apply div_le. (* Goal: lt O (Z.abs_nat x) *) (* Goal: Divides n (Z.abs_nat x) *) (* Goal: lt (Z.abs_nat x) n *) change (Zabs_nat 0 < Zabs_nat x) in |- *. (* Goal: lt (Z.abs_nat x) (Z.abs_nat (Z.of_nat n)) *) apply ltzlt. (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) unfold Zle in |- *. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) simpl in |- *. (* Goal: not (@eq comparison Lt Gt) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) discriminate. (* Goal: Z.le x n *) (* Goal: Mod x Z0 (Z.abs_nat n) *) apply Zlt_le_weak. (* Goal: ZMod x Z0 n *) assumption. (* Goal: ZMod x Z0 n *) assumption. (* Goal: Divides n (Z.abs_nat x) *) (* Goal: lt (Z.abs_nat x) n *) apply H3. (* Goal: ZMod x Z0 n *) assumption. (* Goal: lt (Z.abs_nat x) n *) rewrite <- (abs_inj n). (* Goal: lt (Z.abs_nat x) (Z.abs_nat (Z.of_nat n)) *) apply ltzlt. (* Goal: Z.le x n *) (* Goal: Mod x Z0 (Z.abs_nat n) *) apply Zlt_le_weak. (* Goal: ZMod x Z0 n *) assumption. (* Goal: Z.le Z0 (Z.of_nat n) *) (* Goal: Z.lt x (Z.of_nat n) *) change (Z_of_nat 0 <= Z_of_nat n)%Z in |- *. (* Goal: Z.le (Z.of_nat O) (Z.of_nat n) *) (* Goal: Z.lt x (Z.of_nat n) *) apply Znat.inj_le. (* Goal: le O n *) (* Goal: Z.lt x (Z.of_nat n) *) apply le_O_n. (* Goal: ZMod x Z0 n *) assumption. Qed. Lemma mod_repr_eq : forall (p : nat) (x y : Z), 0 < p -> (0 < x < Z_of_nat p)%Z -> (0 < y < Z_of_nat p)%Z -> Mod x y p -> x = y. Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. unfold Mod in H2. (* Goal: @eq Z x y *) elim H2. intros q Hq. (* Goal: @eq Z x y *) rewrite Hq in H0. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) elim H0. elim H1. intros. (* Goal: @eq Z x y *) elim (Zle_or_lt 0 q). (* Goal: not (ZMod x Z0 n) *) intro. elim (Zle_lt_or_eq 0 q). (* 0<q *) (* Goal: not (ZMod x Z0 n) *) intro. elim (Zlt_not_le 0 y). (* Goal: ZMod x Z0 n *) assumption. apply Zplus_le_reg_l with (Z_of_nat p). (* Goal: Z.le (Z.add (Z.add y (Z.mul (Z.of_nat p) (Zneg xH))) (Z.of_nat p)) (Z.add (Z.of_nat p) Z0) *) rewrite (Zplus_comm (Z_of_nat p)). (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) rewrite (Zplus_comm (Z_of_nat p)). simpl in |- *. (* Goal: Z.le x n *) (* Goal: Mod x Z0 (Z.abs_nat n) *) apply Zlt_le_weak. (* Goal: Z.lt (Z.add y (Z.of_nat p)) (Z.of_nat p) *) (* Goal: forall _ : @eq Z Z0 q, @eq Z x y *) (* Goal: Z.le Z0 q *) (* Goal: forall _ : Z.lt q Z0, @eq Z x y *) apply Zle_lt_trans with (y + Z_of_nat p * q)%Z. (* Goal: Z.le (Z.add y (Z.mul (Z.of_nat p) q)) (Z.add y (Z.mul (Z.of_nat p) (Zneg xH))) *) (* Goal: Z.le (Z.add y (Z.mul (Z.of_nat p) (Zneg xH))) Z0 *) apply Zplus_le_compat_l. pattern (Z_of_nat p) at 1 in |- *. (* Goal: (fun z : Z => Z.le z (Z.mul (Z.of_nat p) q)) (Z.of_nat p) *) (* Goal: Z.lt (Z.add y (Z.mul (Z.of_nat p) q)) (Z.of_nat p) *) (* Goal: forall _ : @eq Z Z0 q, @eq Z x y *) (* Goal: Z.le Z0 q *) (* Goal: forall _ : Z.lt q Z0, @eq Z x y *) rewrite <- Zmult_1_l with (Z_of_nat p). (* Goal: Z.le (Z.mul (Zpos xH) (Z.of_nat p)) (Z.mul (Z.of_nat p) q) *) (* Goal: Z.lt (Z.add y (Z.mul (Z.of_nat p) q)) (Z.of_nat p) *) (* Goal: forall _ : @eq Z Z0 q, @eq Z x y *) (* Goal: Z.le Z0 q *) (* Goal: forall _ : Z.lt q Z0, @eq Z x y *) rewrite (Zmult_comm 1). apply Zle_mult_l. (* Goal: Z.lt Z0 (Z.of_nat p) *) (* Goal: Z.le q (Zneg xH) *) (* Goal: Z.le (Z.add y (Z.mul (Z.of_nat p) (Zneg xH))) Z0 *) change (Z_of_nat 0 < Z_of_nat p)%Z in |- *. (* Goal: ZMod x Z0 n *) apply Znat.inj_lt. assumption. (* Goal: ZMod x Z0 n *) change (Zsucc 0 <= q)%Z in |- *. apply Zlt_le_succ. assumption. (* Goal: ZMod x Z0 n *) assumption. (* 0=q *) (* Goal: not (ZMod x Z0 n) *) intro. rewrite <- H8 in Hq. rewrite Zmult_comm in Hq. (* Goal: ZMod x Z0 n *) rewrite Zplus_comm in Hq. simpl in Hq. assumption. (* Goal: ZMod x Z0 n *) assumption. (* q<0 *) (* Goal: not (ZMod x Z0 n) *) intro. elim (Zlt_not_le 0 (y + Z_of_nat p * q)). (* Goal: ZMod x Z0 n *) assumption. apply Zle_trans with (y + Z_of_nat p * -1)%Z. (* Goal: Z.le (Z.add y (Z.mul (Z.of_nat p) q)) (Z.add y (Z.mul (Z.of_nat p) (Zneg xH))) *) (* Goal: Z.le (Z.add y (Z.mul (Z.of_nat p) (Zneg xH))) Z0 *) apply Zplus_le_compat_l. apply Zle_mult_l. (* Goal: Z.lt Z0 (Z.of_nat p) *) (* Goal: Z.le q (Zneg xH) *) (* Goal: Z.le (Z.add y (Z.mul (Z.of_nat p) (Zneg xH))) Z0 *) change (Z_of_nat 0 < Z_of_nat p)%Z in |- *. apply Znat.inj_lt. (* Goal: ZMod x Z0 n *) assumption. apply Zlt_succ_le. simpl in |- *. assumption. (* Goal: Z.le (Z.add y (Z.mul (Z.of_nat p) (Zneg xH))) Z0 *) apply Zplus_le_reg_l with (Z_of_nat p). (* Goal: Z.le (Z.add (Z.add y (Z.mul (Z.of_nat p) (Zneg xH))) (Z.of_nat p)) (Z.add (Z.of_nat p) Z0) *) rewrite (Zplus_comm (Z_of_nat p)). (* Goal: Z.le (Z.add (Z.add y (Z.mul (Z.of_nat p) (Zneg xH))) (Z.of_nat p)) (Z.add (Z.of_nat p) Z0) *) rewrite (Zplus_comm (Z_of_nat p)). (* Goal: Z.le (Z.add (Z.add y (Z.mul (Z.of_nat p) (Zneg xH))) (Z.of_nat p)) (Z.add Z0 (Z.of_nat p)) *) rewrite (Zmult_comm (Z_of_nat p)). (* Goal: Z.le (Z.add (Z.add y (Z.mul (Zneg xH) (Z.of_nat p))) (Z.of_nat p)) (Z.add Z0 (Z.of_nat p)) *) rewrite (Zopp_mult_distr_l_reverse 1). rewrite Zmult_1_l. (* Goal: ZDivides n (Z.add (Z.add (Z.mul n x) (Z.opp b)) b) *) (* Goal: forall _ : ZDivides n (Z.sub a b), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) rewrite Zplus_assoc_reverse. rewrite Zplus_opp_l. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) rewrite (Zplus_comm y 0). simpl in |- *. apply Zlt_le_weak. (* Goal: ZMod x Z0 n *) assumption. Qed. (** ZMod, same as Mod but only uses Z. *) Definition ZMod (a b n : Z) := exists q : Z, a = (b + n * q)%Z. Lemma zmodpq_modp : forall a b p q : Z, ZMod a b (p * q) -> ZMod a b p. Proof. (* Goal: ZMod (Z.mul n x) Z0 n *) unfold ZMod in |- *. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. (* Goal: False *) elim H. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. (* Goal: @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul p q))) *) split with (q * x)%Z. (* Goal: @eq Z (Z.mul (Z.add b (Z.mul n x)) (Zneg xH)) (Z.add (Z.mul b (Zneg xH)) (Z.mul n (Z.mul x (Zneg xH)))) *) rewrite Zmult_assoc. (* Goal: ZMod x Z0 n *) assumption. Qed. Lemma zmod_refl : forall a n : Z, ZMod a a n. Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) unfold ZMod in |- *. intros. (* Goal: @ex Z (fun q : Z => @eq Z a (Z.add a (Z.mul n q))) *) split with 0%Z. (* Goal: @eq Z b (Z.add b (Z.mul n Z0)) *) rewrite <- Zmult_0_r_reverse. (* Goal: ZDivides n (Z.add (Z.mul n x) Z0) *) (* Goal: forall _ : ZDivides n (Z.sub a b), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) rewrite <- Zplus_0_r_reverse. (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) reflexivity. Qed. Lemma zmod_sym : forall a b n : Z, ZMod a b n -> ZMod b a n. Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) unfold ZMod in |- *. intros. (* Goal: False *) elim H. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. (* Goal: ZMod (Z.opp a) (Z.opp b) n *) split with (- x)%Z. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) simpl in |- *. (* Goal: ZDivides n (Z.sub a b) *) (* Goal: forall _ : ZDivides n (Z.sub a b), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) rewrite H0. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) simpl in |- *. (* Goal: ZDivides n (Z.add (Z.add (Z.mul n x) (Z.opp b)) b) *) (* Goal: forall _ : ZDivides n (Z.sub a b), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) rewrite Zplus_assoc_reverse. (* Goal: @eq Z b (Z.add b (Z.add (Z.mul n x) (Z.mul n (Z.opp x)))) *) rewrite <- Zmult_plus_distr_r. (* Goal: ZDivides n (Z.add (Z.mul n x) (Z.add b (Z.opp b))) *) (* Goal: forall _ : ZDivides n (Z.sub a b), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) rewrite Zplus_opp_r. (* Goal: @eq Z b (Z.add b (Z.mul n Z0)) *) rewrite <- Zmult_0_r_reverse. (* Goal: @eq Z b (Z.add b Z0) *) apply Zplus_0_r_reverse. Qed. Lemma zmod_trans : forall a b c n : Z, ZMod a b n -> ZMod b c n -> ZMod a c n. Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) unfold ZMod in |- *. intros. (* Goal: False *) elim H. elim H0. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. rewrite H2. rewrite H1. (* Goal: @ex Z (fun q : Z => @eq Z (Z.add a c) (Z.add (Z.add b d) (Z.mul n q))) *) split with (x + x0)%Z. (* Goal: @eq Z (Z.add (Z.add c (Z.mul n x)) (Z.mul n x0)) (Z.add c (Z.mul n (Z.add x x0))) *) rewrite Zmult_plus_distr_r. (* Goal: @eq Z (Z.add (Z.add c (Z.mul n x)) (Z.mul n x0)) (Z.add c (Z.add (Z.mul n x) (Z.mul n x0))) *) rewrite (Zplus_assoc c (n * x) (n * x0)). (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) reflexivity. Qed. Lemma zeqmod : forall x y : Z, x = y -> forall n : Z, ZMod x y n. Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. rewrite H. apply zmod_refl. Qed. Lemma zmod_plus_compat : forall a b c d n : Z, ZMod a b n -> ZMod c d n -> ZMod (a + c) (b + d) n. Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) unfold ZMod in |- *. intros. (* Goal: False *) elim H. elim H0. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. split with (x + x0)%Z. (* Goal: @ex Z (fun q : Z => @eq Z (Z.mul a c) (Z.add (Z.mul b d) (Z.mul n q))) *) rewrite H1. (* Goal: @ex Z (fun q : Z => @eq Z (Z.mul a (Z.add d (Z.mul n x))) (Z.add (Z.mul b d) (Z.mul n q))) *) rewrite H2. (* Goal: @eq Z (Z.add (Z.add b (Z.mul n x0)) (Z.add d (Z.mul n x))) (Z.add (Z.add b d) (Z.mul n (Z.add x x0))) *) rewrite (Zplus_assoc (b + n * x0) d (n * x)). (* Goal: @eq Z (Z.add (Z.add (Z.add b (Z.mul n x0)) d) (Z.mul n x)) (Z.add (Z.add b d) (Z.mul n (Z.add x x0))) *) rewrite (Zplus_assoc_reverse b (n * x0) d). (* Goal: @eq Z (Z.add (Z.add b (Z.add (Z.mul n x0) d)) (Z.mul n x)) (Z.add (Z.add b d) (Z.mul n (Z.add x x0))) *) rewrite (Zplus_comm (n * x0) d). (* Goal: @eq Z (Z.add (Z.add b (Z.add d (Z.mul n x0))) (Z.mul n x)) (Z.add (Z.add b d) (Z.mul n (Z.add x x0))) *) rewrite (Zplus_comm x x0). (* Goal: @eq Z (Z.add (Z.add b (Z.add d (Z.mul n x0))) (Z.mul n x)) (Z.add (Z.add b d) (Z.mul n (Z.add x0 x))) *) rewrite (Zmult_plus_distr_r n x0 x). (* Goal: @eq Z a (Z.add (Z.opp b) (Z.add b a)) *) rewrite Zplus_assoc. (* Goal: @eq Z a (Z.add (Z.opp b) (Z.add b a)) *) rewrite Zplus_assoc. (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) reflexivity. Qed. Lemma zmod_mult_compat : forall a b c d n : Z, ZMod a b n -> ZMod c d n -> ZMod (a * c) (b * d) n. Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) unfold ZMod in |- *. intros. (* Goal: False *) elim H. elim H0. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. rewrite H1. rewrite H2. split with (x0 * d + x * b + n * x0 * x)%Z. (* Goal: @eq Z (Z.mul (Z.add b (Z.mul n x0)) (Z.add d (Z.mul n x))) (Z.add (Z.mul b d) (Z.mul n (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul n x0) x)))) *) rewrite (Zmult_plus_distr_r (b + n * x0) d (n * x)). (* Goal: @eq Z (Z.add (Z.add (Z.mul b d) (Z.mul (Z.mul n x0) d)) (Z.mul (Z.add b (Z.mul n x0)) (Z.mul n x))) (Z.add (Z.mul b d) (Z.mul n (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul n x0) x)))) *) rewrite Zmult_plus_distr_l. (* Goal: @eq Z (Z.add (Z.add (Z.mul b d) (Z.mul (Z.mul n x0) d)) (Z.mul (Z.add b (Z.mul n x0)) (Z.mul n x))) (Z.add (Z.mul b d) (Z.mul n (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul n x0) x)))) *) rewrite Zmult_plus_distr_l. (* Goal: @eq Z (Z.add (Z.add (Z.mul b d) (Z.mul (Z.mul n x0) d)) (Z.add (Z.mul b (Z.mul n x)) (Z.mul (Z.mul n x0) (Z.mul n x)))) (Z.add (Z.mul b d) (Z.mul n (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul n x0) x)))) *) rewrite (Zmult_assoc b n x). (* Goal: @eq Z (Z.add (Z.add (Z.mul b d) (Z.mul (Z.mul n x0) d)) (Z.add (Z.mul (Z.mul b n) x) (Z.mul (Z.mul n x0) (Z.mul n x)))) (Z.add (Z.mul b d) (Z.mul n (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul n x0) x)))) *) rewrite (Zmult_comm b n). (* Goal: @eq Z (Z.add (Z.add (Z.mul b d) (Z.mul (Z.mul n x0) d)) (Z.add (Z.mul (Z.mul n b) x) (Z.mul (Z.mul n x0) (Z.mul n x)))) (Z.add (Z.mul b d) (Z.mul n (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul n x0) x)))) *) rewrite (Zmult_assoc (n * x0) n x). (* Goal: @eq Z (Z.add (Z.add (Z.mul b d) (Z.mul (Z.mul n x0) d)) (Z.add (Z.mul (Z.mul n b) x) (Z.mul (Z.mul (Z.mul n x0) n) x))) (Z.add (Z.mul b d) (Z.mul n (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul n x0) x)))) *) rewrite (Zmult_assoc_reverse n x0 n). (* Goal: @eq Z (Z.add (Z.add (Z.mul b d) (Z.mul (Z.mul n x0) d)) (Z.add (Z.mul (Z.mul n b) x) (Z.mul (Z.mul n (Z.mul x0 n)) x))) (Z.add (Z.mul b d) (Z.mul n (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul n x0) x)))) *) rewrite (Zmult_assoc_reverse n (x0 * n) x). (* Goal: @eq Z (Z.add (Z.add (Z.mul b d) (Z.mul (Z.mul n x0) d)) (Z.add (Z.mul (Z.mul n b) x) (Z.mul n (Z.mul (Z.mul x0 n) x)))) (Z.add (Z.mul b d) (Z.mul n (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul n x0) x)))) *) rewrite (Zmult_assoc_reverse n b x). (* Goal: @eq Z (Z.add (Z.add (Z.mul b d) (Z.mul (Z.mul n x0) d)) (Z.add (Z.mul n (Z.mul b x)) (Z.mul n (Z.mul (Z.mul x0 n) x)))) (Z.add (Z.mul b d) (Z.mul n (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul n x0) x)))) *) rewrite <- (Zmult_plus_distr_r n (b * x) (x0 * n * x)). (* Goal: @eq Z (Z.add (Z.add (Z.mul b d) (Z.mul (Z.mul n x0) d)) (Z.mul n (Z.add (Z.mul b x) (Z.mul (Z.mul x0 n) x)))) (Z.add (Z.mul b d) (Z.mul n (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul n x0) x)))) *) rewrite (Zplus_assoc_reverse (b * d)). (* Goal: @eq Z (Z.add (Z.mul b d) (Z.add (Z.mul (Z.mul n x0) d) (Z.mul n (Z.add (Z.mul b x) (Z.mul (Z.mul x0 n) x))))) (Z.add (Z.mul b d) (Z.mul n (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul n x0) x)))) *) rewrite (Zmult_assoc_reverse n x0 d). (* Goal: @eq Z (Z.add (Z.mul b d) (Z.add (Z.mul n (Z.mul x0 d)) (Z.mul n (Z.add (Z.mul b x) (Z.mul (Z.mul x0 n) x))))) (Z.add (Z.mul b d) (Z.mul n (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul n x0) x)))) *) rewrite <- (Zmult_plus_distr_r n (x0 * d) (b * x + x0 * n * x)). (* Goal: @eq Z (Z.add (Z.mul b d) (Z.mul n (Z.add (Z.mul x0 d) (Z.add (Z.mul b x) (Z.mul (Z.mul x0 n) x))))) (Z.add (Z.mul b d) (Z.mul n (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul n x0) x)))) *) rewrite (Zmult_comm x0 n). (* Goal: @eq Z a (Z.add (Z.opp b) (Z.add b a)) *) rewrite Zplus_assoc. (* Goal: @eq Z (Z.add (Z.mul b d) (Z.mul n (Z.add (Z.add (Z.mul x0 d) (Z.mul b x)) (Z.mul (Z.mul n x0) x)))) (Z.add (Z.mul b d) (Z.mul n (Z.add (Z.add (Z.mul x0 d) (Z.mul x b)) (Z.mul (Z.mul n x0) x)))) *) rewrite (Zmult_comm b x). (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) reflexivity. Qed. Lemma zmod_sqr_compat : forall a b n : Z, ZMod a b n -> ZMod (a * a) (b * b) n. Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. apply zmod_mult_compat. assumption. assumption. Qed. Lemma zmodmod : forall a b n : Z, ZMod a b n -> Mod a b (Zabs_nat n). Proof. (* Goal: forall (a b n : Z) (_ : ZMod a b n), Mod a b (Z.abs_nat n) *) unfold ZMod, Mod in |- *. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. elim H. intros. (* Goal: ZDivides n (Z.sub a b) *) (* Goal: forall _ : ZDivides n (Z.sub a b), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) rewrite H0. (* Goal: @ex Z (fun q : Z => @eq Z (Z.add b (Z.mul n x)) (Z.add b (Z.mul (Z.of_nat (Z.abs_nat n)) q))) *) elim (Zle_or_lt 0 n). (* Goal: not (ZMod x Z0 n) *) intro. rewrite inj_abs_pos. (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) split with x. reflexivity. (* Goal: ZMod x Z0 n *) apply Zle_ge. assumption. (* Goal: not (ZMod x Z0 n) *) intro. rewrite inj_abs_neg. (* Goal: ZMod (Z.opp a) (Z.opp b) n *) split with (- x)%Z. rewrite Zopp_mult_distr_l_reverse. (* Goal: @eq Z (Z.add b (Z.mul n x)) (Z.add b (Z.mul n (Z.opp (Z.opp x)))) *) (* Goal: Z.lt n Z0 *) rewrite Zopp_mult_distr_r. rewrite Zopp_involutive. (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) reflexivity. (* Goal: ZMod x Z0 n *) assumption. Qed. Lemma modzmod : forall (a b : Z) (n : nat), Mod a b n -> ZMod a b (Z_of_nat n). Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) unfold Mod, ZMod in |- *. intros. elim H. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. rewrite H0. split with x. (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) reflexivity. Qed. Lemma absmodzmod : forall a b n : Z, Mod a b (Zabs_nat n) -> ZMod a b n. Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. (* Goal: False *) elim H. intros q Hq. (* Goal: ZMod a b n *) elim Zle_or_lt with 0%Z n. (* Goal: not (ZMod x Z0 n) *) intro. split with q. rewrite inj_abs_pos in Hq. (* Goal: ZMod x Z0 n *) assumption. apply Zle_ge. assumption. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. split with (- q)%Z. rewrite inj_abs_neg in Hq. (* Goal: @eq Z a (Z.add b (Z.opp (Z.mul q n))) *) (* Goal: Z.lt n Z0 *) rewrite Zmult_comm. rewrite Zopp_mult_distr_l_reverse. (* Goal: @eq Z a (Z.add b (Z.opp (Z.mul q n))) *) (* Goal: Z.lt n Z0 *) rewrite Zopp_mult_distr_l_reverse in Hq. rewrite Zmult_comm. (* Goal: ZMod x Z0 n *) assumption. assumption. Qed. Lemma zmod_exp_compat : forall a b n : Z, ZMod a b n -> forall m : Z, ZMod (ZExp a m) (ZExp b m) n. Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. (* Goal: ZMod (ZExp a m) (ZExp b m) n *) apply absmodzmod. (* Goal: Mod (ZExp a m) Z0 (Z.abs_nat n) *) (* Goal: Z.ge n Z0 *) rewrite expzexp. (* Goal: Mod (ZExp a m) Z0 (Z.abs_nat n) *) (* Goal: Z.ge n Z0 *) rewrite expzexp. (* Goal: Mod (Exp a (Z.abs_nat m)) (Exp b (Z.abs_nat m)) (Z.abs_nat n) *) apply mod_exp_compat. (* Goal: Mod x Z0 (Z.abs_nat n) *) apply zmodmod. (* Goal: ZMod x Z0 n *) assumption. Qed. Lemma zmoda0_exp_compat : forall a n : Z, (n > 0)%Z -> ZMod a 0 n -> forall m : Z, (m > 0)%Z -> ZMod (ZExp a m) 0 n. Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. rewrite <- (inj_abs_pos n). (* Goal: Mod (ZExp a m) Z0 (Z.abs_nat n) *) (* Goal: Z.ge n Z0 *) apply modzmod. rewrite expzexp. (* Goal: Mod (Exp a (Z.abs_nat m)) Z0 (Z.abs_nat n) *) (* Goal: Z.ge n Z0 *) apply moda0_exp_compat. (* Goal: gt (Z.abs_nat n) O *) (* Goal: Mod a Z0 (Z.abs_nat n) *) (* Goal: gt (Z.abs_nat m) O *) (* Goal: Z.ge n Z0 *) change (Zabs_nat n > Zabs_nat 0) in |- *. apply gtzgt. (* Goal: ZMod x Z0 n *) apply Zlt_le_weak. apply Zgt_lt. assumption. (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) apply Zeq_le. reflexivity. (* Goal: ZMod x Z0 n *) assumption. (* Goal: ZMod x Z0 n *) apply zmodmod. assumption. (* Goal: gt (Z.abs_nat n) (Z.abs_nat (Zpos xH)) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) change (Zabs_nat m > Zabs_nat 0) in |- *. apply gtzgt. (* Goal: ZMod x Z0 n *) apply Zlt_le_weak. apply Zgt_lt. assumption. (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) apply Zeq_le. reflexivity. (* Goal: ZMod x Z0 n *) assumption. (* Goal: ZMod x Z0 n *) apply Zle_ge. apply Zlt_le_weak. apply Zgt_lt. assumption. Qed. Lemma zmod_opp_compat : forall a b n : Z, ZMod a b n -> ZMod (- a) (- b) n. Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. elim H. intros. (* Goal: ZMod (Z.opp a) (Z.opp b) n *) split with (- x)%Z. rewrite H0. (* Goal: @eq Z (Z.mul (Z.add b (Z.mul n x)) (Zneg xH)) (Z.add (Z.mul b (Zneg xH)) (Z.mul n (Z.opp x))) *) rewrite Zopp_eq_mult_neg_1. (* Goal: @eq Z (Z.mul (Z.add b (Z.mul n x)) (Zneg xH)) (Z.add (Z.mul b (Zneg xH)) (Z.mul n (Z.opp x))) *) rewrite Zopp_eq_mult_neg_1. (* Goal: @eq Z (Z.mul (Z.add b (Z.mul n x)) (Zneg xH)) (Z.add (Z.mul b (Zneg xH)) (Z.mul n (Z.opp x))) *) rewrite Zopp_eq_mult_neg_1. (* Goal: @eq Z (Z.mul (Z.add b (Z.mul n x)) (Zneg xH)) (Z.add (Z.mul b (Zneg xH)) (Z.mul n (Z.mul x (Zneg xH)))) *) rewrite Zmult_assoc. (* Goal: @eq Z (Z.mul (Z.add b (Z.mul n x)) (Zneg xH)) (Z.add (Z.mul b (Zneg xH)) (Z.mul (Z.mul n x) (Zneg xH))) *) rewrite <- Zmult_plus_distr_l. (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) reflexivity. Qed. Lemma zmod_minus_compat : forall a b c d n : Z, ZMod a b n -> ZMod c d n -> ZMod (a - c) (b - d) n. Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. (* Goal: @eq Z a (Z.add b (Z.sub a b)) *) unfold Zminus in |- *. (* Goal: ZMod (Z.add a (Z.opp c)) (Z.add b (Z.opp d)) n *) apply zmod_plus_compat. (* Goal: ZMod x Z0 n *) assumption. (* Goal: ZMod (Z.opp c) (Z.opp d) n *) apply zmod_opp_compat. (* Goal: ZMod x Z0 n *) assumption. Qed. Lemma zmod_nx_0_n : forall n x : Z, ZMod (n * x) 0 n. Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. unfold ZMod in |- *. (* Goal: @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) split with x. (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) simpl in |- *. reflexivity. Qed. Lemma zmoddivmin : forall a b n : Z, ZMod a b n <-> ZDivides n (a - b). Proof. (* Goal: and (Z.lt Z0 x) (Z.lt x (Z.of_nat (Z.abs_nat n))) *) (* Goal: Mod x Z0 (Z.abs_nat n) *) unfold ZMod, Divides in |- *. split. (* -> *) (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. elim H. intros. (* Goal: ZDivides n (Z.sub a b) *) (* Goal: forall _ : ZDivides n (Z.sub a b), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) rewrite H0. (* Goal: @eq Z a (Z.add b (Z.sub a b)) *) unfold Zminus in |- *. (* Goal: ZDivides n (Z.add (Z.add (Z.mul n x) (Z.opp b)) b) *) (* Goal: forall _ : ZDivides n (Z.sub a b), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) rewrite Zplus_assoc_reverse. (* Goal: @eq Z a (Z.add (Z.add b a) (Z.opp b)) *) rewrite Zplus_comm. (* Goal: ZDivides n (Z.add (Z.add (Z.mul n x) (Z.opp b)) b) *) (* Goal: forall _ : ZDivides n (Z.sub a b), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) rewrite Zplus_assoc_reverse. (* Goal: ZDivides n (Z.add (Z.mul n x) (Z.add (Z.opp b) b)) *) (* Goal: forall _ : ZDivides n (Z.sub a b), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) rewrite (Zplus_comm (- b) b). (* Goal: ZDivides n (Z.add (Z.mul n x) (Z.add b (Z.opp b))) *) (* Goal: forall _ : ZDivides n (Z.sub a b), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) rewrite Zplus_opp_r. (* Goal: ZDivides n (Z.add (Z.mul n x) Z0) *) (* Goal: forall _ : ZDivides n (Z.sub a b), @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) rewrite <- Zplus_0_r_reverse. (* Goal: @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) split with x. (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) reflexivity. (* <- *) (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. elim H. intros. (* Goal: @ex Z (fun q : Z => @eq Z a (Z.add b (Z.mul n q))) *) split with x. (* Goal: @eq Z a (Z.add b (Z.mul n x)) *) rewrite <- H0. (* Goal: @eq Z a (Z.add b (Z.sub a b)) *) unfold Zminus in |- *. (* Goal: @eq Z a (Z.add (Z.opp b) (Z.add b a)) *) rewrite Zplus_assoc. (* Goal: @eq Z a (Z.add (Z.add b a) (Z.opp b)) *) rewrite Zplus_comm. (* Goal: @eq Z a (Z.add (Z.opp b) (Z.add b a)) *) rewrite Zplus_assoc. (* Goal: @eq Z a (Z.add (Z.add (Z.opp b) b) a) *) rewrite Zplus_opp_l. (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) simpl in |- *. reflexivity. Qed. Lemma zmoddec : forall a b n : Z, ZMod a b n \/ ~ ZMod a b n. Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. (* Goal: or (ZMod a b n) (not (ZMod a b n)) *) elim (zmoddivmin a b n). (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. (* Goal: or (ZMod a b n) (not (ZMod a b n)) *) elim (zdivdec (a - b) n). (* Goal: forall _ : ZDivides n (Z.sub a b), or (ZMod a b n) (not (ZMod a b n)) *) (* Goal: forall _ : not (ZDivides n (Z.sub a b)), or (ZMod a b n) (not (ZMod a b n)) *) left. (* Goal: ZMod a b n *) (* Goal: forall _ : not (ZDivides n (Z.sub a b)), or (ZMod a b n) (not (ZMod a b n)) *) apply H0. (* Goal: ZMod x Z0 n *) assumption. (* Goal: forall _ : not (ZDivides n (Z.sub a b)), or (ZMod a b n) (not (ZMod a b n)) *) right. (* Goal: not (ZMod x Z0 n) *) intro. (* Goal: False *) elim H1. (* Goal: ZDivides n (Z.sub a b) *) apply H. (* Goal: ZMod x Z0 n *) assumption. Qed. Lemma zmod_0not1 : forall n : Z, (n > 1)%Z -> ~ ZMod 0 1 n. Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. intro. (* Goal: False *) elim (mod_0not1 (Zabs_nat n)). (* Goal: gt (Z.abs_nat n) (Z.abs_nat (Zpos xH)) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) change (Zabs_nat n > Zabs_nat 1) in |- *. apply gtzgt. (* Goal: Z.le x n *) (* Goal: Mod x Z0 (Z.abs_nat n) *) apply Zlt_le_weak. apply Zlt_trans with 1%Z. (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) unfold Zlt in |- *. simpl in |- *. reflexivity. (* Goal: ZMod x Z0 n *) apply Zgt_lt. assumption. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Mod Z0 (Zpos xH) (Z.abs_nat n) *) unfold Zle in |- *. simpl in |- *. discriminate. (* Goal: ZMod x Z0 n *) assumption. (* Goal: ZMod x Z0 n *) apply zmodmod. assumption. Qed. Lemma zmod_repr_non_0 : forall n x : Z, (0 < x < n)%Z -> ~ ZMod x 0 n. Proof. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. (* Goal: not (ZMod x Z0 n) *) intro. (* Goal: False *) elim H. (* Goal: forall (_ : Z.lt Z0 x) (_ : Z.lt x n), False *) intros. (* Goal: False *) elim (mod_repr_non_0 (Zabs_nat n) x). (* Goal: and (Z.lt Z0 x) (Z.lt x (Z.of_nat (Z.abs_nat n))) *) (* Goal: Mod x Z0 (Z.abs_nat n) *) split. (* Goal: ZMod x Z0 n *) assumption. rewrite inj_abs_pos. (* Goal: ZMod x Z0 n *) assumption. apply Zle_ge. apply Zle_trans with x. (* Goal: ZMod x Z0 n *) apply Zlt_le_weak. assumption. (* Goal: ZMod x Z0 n *) apply Zlt_le_weak. assumption. (* Goal: ZMod x Z0 n *) apply zmodmod. assumption. Qed.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) (** divides. The division predicate. @author Olga Caprotti and Martijn Oostdijk @version $Revision$ *) Require Import ZArith. Require Import Wf_nat. Require Import lemmas. Require Import natZ. Require Import dec. Require Import exp. (** * Division on nat *) Definition Divides (n m : nat) : Prop := exists q : nat, m = n * q. Lemma div_refl : forall a : nat, Divides a a. Proof. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. split with 1. (* Goal: @eq nat a (Init.Nat.mul a (S O)) *) rewrite <- mult_n_Sm. (* Goal: @eq nat a (Init.Nat.add (Init.Nat.mul a O) a) *) rewrite <- mult_n_O. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Gt) *) (* Goal: Z.gt d Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) simpl in |- *. reflexivity. Qed. Lemma div_trans : forall p q r : nat, Divides p q -> Divides q r -> Divides p r. Proof. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: ZDivides a (Z.mul b c) *) elim H. (* Goal: ZDivides a (Z.add b c) *) elim H0. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: Divides a (Init.Nat.mul b c) *) unfold Divides in |- *. (* Goal: @ex nat (fun q : nat => @eq nat r (Init.Nat.mul p q)) *) split with (x0 * x). (* Goal: @eq Z (Z.add b c) (Z.mul a (Z.add x y)) *) rewrite H1. (* Goal: @eq Z (Z.add (Z.mul a x) c) (Z.mul a (Z.add x y)) *) rewrite H2. (* Goal: @eq nat (Init.Nat.mul (Init.Nat.mul a x) c) (Init.Nat.mul a (Init.Nat.mul x c)) *) rewrite mult_assoc. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) reflexivity. Qed. Lemma div_antisym : forall a b : nat, Divides a b -> Divides b a -> a = b. Proof. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. elim H. elim H0. intros x Ha y Hb. (* Goal: @eq nat a b *) rewrite Hb in Ha. (* Goal: @eq nat a b *) rewrite mult_assoc_reverse in Ha. (* Goal: @eq nat a b *) elim (mult_ppq_p0q1 a (y * x)). intro. (* Goal: @eq nat a b *) (* Goal: forall _ : @eq nat (Init.Nat.mul y x) (S O), @eq nat a b *) (* Goal: @eq nat a (Init.Nat.mul a (Init.Nat.mul y x)) *) rewrite H1 in Hb. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) simpl in Hb. rewrite H1. rewrite Hb. reflexivity. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. elim (mult_pq1_p1q1 y x H1). (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: @eq nat a b *) (* Goal: @eq nat a (Init.Nat.mul a (Init.Nat.mul y x)) *) rewrite H2 in Hb. rewrite <- mult_n_Sm in Hb. rewrite <- mult_n_O in Hb. (* Goal: @eq nat a b *) (* Goal: @eq nat a (Init.Nat.mul a (Init.Nat.mul y x)) *) simpl in Hb. symmetry in |- *. assumption. assumption. Qed. Lemma div_le1 : forall n d : nat, Divides d (S n) -> d <= S n. Proof. (* Goal: Divides a (Init.Nat.mul b c) *) unfold Divides in |- *. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: ZDivides a (Z.mul b c) *) elim H. (* Goal: forall (x : nat) (_ : @eq nat (S n0) (Init.Nat.mul d x)), @ex nat (fun q : nat => and (lt q (S (S n0))) (@eq nat (S n0) (Init.Nat.mul d q))) *) (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) intro q. (* Goal: forall _ : @eq nat (S n) (Init.Nat.mul d q), le d (S n) *) case q. (* Goal: @eq nat O (Init.Nat.mul d O) *) (* Goal: forall (_ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))) (_ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) rewrite <- (mult_n_O d). (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: @ex nat (fun q : nat => and (lt q (S (S n0))) (@eq nat (S n0) O)) *) (* Goal: forall (n : nat) (_ : @eq nat (S n0) (Init.Nat.mul (S n) q)), @ex nat (fun q : nat => and (lt q (S (S n0))) (@eq nat (S n0) (Init.Nat.mul (S n) q))) *) (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) discriminate H0. (* Goal: forall (n0 : nat) (_ : @eq nat (S n) (Init.Nat.mul d (S n0))), le d (S n) *) intro q1. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: @ex Z (fun q : Z => @eq Z (Z.mul b c) (Z.mul a q)) *) rewrite H0. (* Goal: le d (Init.Nat.mul d (S q1)) *) apply le_n_nm. Qed. Lemma div_le : forall d n : nat, 0 < n -> Divides d n -> d <= n. Proof. (* Goal: forall (d n : Z) (_ : Z.gt d Z0), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) intros d n. case n. (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intro. elim (lt_irrefl 0). assumption. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. apply div_le1. assumption. Qed. (** Divides with bounded ex quantifier. *) Definition bDivides (d n : nat) := n = 0 \/ (exists q : nat, q < S n /\ n = d * q). Lemma divbdiv : forall n d : nat, Divides d n <-> bDivides d n. Proof. (* Goal: Divides a (Init.Nat.mul b c) *) unfold Divides in |- *. (* Goal: or (bDivides d n) (not (bDivides d n)) *) unfold bDivides in |- *. (* Goal: and (Z.le Z0 Z0) (Z.lt Z0 (Z.of_nat (Z.abs_nat d))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) split. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) case n. (* Goal: forall _ : Divides (Z.abs_nat d) (Z.abs_nat x), or (ZDivides d x) (not (ZDivides d x)) *) (* Goal: forall _ : not (Divides (Z.abs_nat d) (Z.abs_nat x)), or (ZDivides d x) (not (ZDivides d x)) *) left. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) reflexivity. (* Goal: forall _ : not (Divides (Z.abs_nat d) (Z.abs_nat x)), or (ZDivides d x) (not (ZDivides d x)) *) right. (* Goal: ZDivides a (Z.mul b c) *) elim H. (* Goal: forall (x : nat) (_ : @eq nat (S n0) (Init.Nat.mul d x)), @ex nat (fun q : nat => and (lt q (S (S n0))) (@eq nat (S n0) (Init.Nat.mul d q))) *) (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) intro q. (* Goal: forall _ : @eq nat (S n0) (Init.Nat.mul d q), @ex nat (fun q : nat => and (lt q (S (S n0))) (@eq nat (S n0) (Init.Nat.mul d q))) *) (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) case d. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Gt) *) (* Goal: Z.gt d Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) simpl in |- *. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: @ex nat (fun q : nat => and (lt q (S (S n0))) (@eq nat (S n0) O)) *) (* Goal: forall (n : nat) (_ : @eq nat (S n0) (Init.Nat.mul (S n) q)), @ex nat (fun q : nat => and (lt q (S (S n0))) (@eq nat (S n0) (Init.Nat.mul (S n) q))) *) (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) discriminate H0. (* Goal: forall (n : nat) (_ : @eq nat (S n0) (Init.Nat.mul (S n) q)), @ex nat (fun q : nat => and (lt q (S (S n0))) (@eq nat (S n0) (Init.Nat.mul (S n) q))) *) (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) intro d1. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: @ex nat (fun q : nat => and (lt q (S (S n0))) (@eq nat (S n0) (Init.Nat.mul (S d1) q))) *) (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) split with q. (* Goal: and (Z.le Z0 Z0) (Z.lt Z0 (Z.of_nat (Z.abs_nat d))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) split. (* Goal: @ex Z (fun q : Z => @eq Z (Z.mul b c) (Z.mul a q)) *) rewrite H0. (* Goal: lt x N *) (* Goal: gt d O *) (* Goal: le d N *) (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) unfold lt in |- *. (* Goal: le (S q) (S (Init.Nat.mul (S d1) q)) *) (* Goal: @eq nat (S n0) (Init.Nat.mul (S d1) q) *) (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) apply le_n_S. (* Goal: le q (Init.Nat.mul (S d1) q) *) (* Goal: @eq nat (S n0) (Init.Nat.mul (S d1) q) *) (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) apply le_n_mn. (* Goal: Z.gt d Z0 *) assumption. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: ZDivides a (Z.mul b c) *) elim H. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: @ex Z (fun q : Z => @eq Z (Z.mul b c) (Z.mul a q)) *) rewrite H0. (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat (S n1) (Init.Nat.add (Init.Nat.mul q d) r))))) *) split with 0. (* Goal: @eq nat O (Init.Nat.mul d O) *) (* Goal: forall (_ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))) (_ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) rewrite <- (mult_n_O d). (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) reflexivity. (* Goal: ZDivides a (Z.mul b c) *) elim H. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: @ex Z (fun q : Z => @eq Z (Z.mul b c) (Z.mul a q)) *) rewrite H0. (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat (S n1) (Init.Nat.add (Init.Nat.mul q d) r))))) *) split with 0. (* Goal: @eq nat O (Init.Nat.mul d O) *) (* Goal: forall (_ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))) (_ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) rewrite <- (mult_n_O d). (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) reflexivity. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: ZDivides a (Z.add b c) *) elim H0. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul (S O) d) r)))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) split with x. (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) elim H2. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: Z.gt d Z0 *) assumption. Qed. (** Divides is decidable. *) Lemma bdivdec : forall n d : nat, bDivides d n \/ ~ bDivides d n. Proof. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. unfold bDivides in |- *. (* Goal: or (or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q))))) (not (or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))))) *) apply ordec. (* Goal: or (@eq nat n (Init.Nat.mul d n0)) (not (@eq nat n (Init.Nat.mul d n0))) *) apply eqdec. (* Goal: or (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))) (not (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q))))) *) apply (exdec (fun q : nat => n = d * q) (S n)). (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. apply eqdec. Qed. Lemma divdec : forall n d : nat, Divides d n \/ ~ Divides d n. Proof. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. elim (divbdiv n d). (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. elim (bdivdec n d). (* Goal: forall _ : Divides (Z.abs_nat d) (Z.abs_nat x), or (ZDivides d x) (not (ZDivides d x)) *) (* Goal: forall _ : not (Divides (Z.abs_nat d) (Z.abs_nat x)), or (ZDivides d x) (not (ZDivides d x)) *) left. apply (H0 H1). (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) right. intro. apply H1. apply (H H2). Qed. (** If d|n, then either d<sqrt(n) or the other divisor x<sqrt(n). *) Theorem sqrdivbound : forall n d : nat, Divides d n -> exists x : nat, Divides x n /\ x * x <= n /\ (x = d \/ d * x = n). Proof. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: @ex nat (fun x : nat => and (Divides x n) (and (le (Init.Nat.mul x x) n) (or (@eq nat x d) (@eq nat (Init.Nat.mul d x) n)))) *) unfold Divides in H. (* Goal: ZDivides a (Z.mul b c) *) elim H. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: @ex Z (fun q : Z => @eq Z (Z.mul b c) (Z.mul a q)) *) rewrite H0. (* Goal: @ex nat (fun x0 : nat => and (Divides x0 (Init.Nat.mul d x)) (and (le (Init.Nat.mul x0 x0) (Init.Nat.mul d x)) (or (@eq nat x0 d) (@eq nat (Init.Nat.mul d x0) (Init.Nat.mul d x))))) *) elim (sqrbound d x). (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: Divides x (Init.Nat.mul d x) *) (* Goal: and (le (Init.Nat.mul x x) (Init.Nat.mul d x)) (or (@eq nat x d) (@eq nat (Init.Nat.mul d x) (Init.Nat.mul d x))) *) split with d. (* Goal: and (Z.le Z0 Z0) (Z.lt Z0 (Z.of_nat (Z.abs_nat d))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) split. (* Goal: @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul (S O) d) r)))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) split with x. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) reflexivity. (* Goal: and (Z.le Z0 Z0) (Z.lt Z0 (Z.of_nat (Z.abs_nat d))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) split. (* Goal: Z.gt d Z0 *) assumption. (* Goal: forall _ : Divides (Z.abs_nat d) (Z.abs_nat x), or (ZDivides d x) (not (ZDivides d x)) *) (* Goal: forall _ : not (Divides (Z.abs_nat d) (Z.abs_nat x)), or (ZDivides d x) (not (ZDivides d x)) *) left. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) reflexivity. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul (S O) d) r)))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) split with x. (* Goal: and (Z.le Z0 Z0) (Z.lt Z0 (Z.of_nat (Z.abs_nat d))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) split. (* Goal: Divides x (Init.Nat.mul d x) *) (* Goal: and (le (Init.Nat.mul x x) (Init.Nat.mul d x)) (or (@eq nat x d) (@eq nat (Init.Nat.mul d x) (Init.Nat.mul d x))) *) split with d. (* Goal: @eq nat (Nat.mul (Nat.sub x0 x) d) (Init.Nat.mul d (Init.Nat.sub x0 x)) *) apply mult_comm. (* Goal: and (Z.le Z0 Z0) (Z.lt Z0 (Z.of_nat (Z.abs_nat d))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) split. (* Goal: Z.gt d Z0 *) assumption. (* Goal: forall _ : not (Divides (Z.abs_nat d) (Z.abs_nat x)), or (ZDivides d x) (not (ZDivides d x)) *) right. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) reflexivity. Qed. (** Division with remainder. *) Theorem div_rem : forall d n : nat, d > 0 -> exists q : nat, (exists r : nat, 0 <= r /\ r < d /\ n = q * d + r). Proof. (* Goal: forall (d n : Z) (_ : Z.gt d Z0), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) intros d n. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) apply (lt_wf_ind n). intros N IH. intros. (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim (le_or_lt d N). (* case d<=N *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intro. (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim (le_witness d N). intros x Hx. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) elim (IH x). intro q'. intros. elim H1. intro r'. intros. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) elim H2. intros. elim H4. intros. (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt x N *) (* Goal: lt d x *) (* Goal: lt O d *) (* Goal: not (Divides d x) *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) split with (S q'). split with r'. (* Goal: Z.gt d Z0 *) split. assumption. (* Goal: Z.gt d Z0 *) split. assumption. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Gt) *) (* Goal: Z.gt d Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) simpl in |- *. rewrite <- Hx. rewrite (plus_assoc_reverse d (q' * d)). (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) rewrite <- H6. reflexivity. (* Goal: lt x N *) (* Goal: gt d O *) (* Goal: le d N *) (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) unfold lt in |- *. apply witness_le. split with (pred d). rewrite plus_Snm_nSm. (* Goal: Z.gt d Z0 *) rewrite <- (S_pred d 0). rewrite plus_comm. assumption. assumption. (* Goal: Z.gt d Z0 *) assumption. (* Goal: Z.gt d Z0 *) assumption. (* case N<d *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intro. (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat (S n1) (Init.Nat.add (Init.Nat.mul q d) r))))) *) split with 0. split with N. (* Goal: and (Z.le Z0 Z0) (Z.lt Z0 (Z.of_nat (Z.abs_nat d))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) split. apply le_O_n. (* Goal: Z.gt d Z0 *) split. assumption. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Gt) *) (* Goal: Z.gt d Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) simpl in |- *. reflexivity. Qed. Lemma div_rem0 : forall n d q r : nat, n = q * d + r -> r < d -> Divides d n -> r = 0. Proof. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) elim H1. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: @eq nat r O *) rewrite H2 in H. (* Goal: @eq nat r O *) rewrite (mult_comm q d) in H. (* Goal: @eq nat r O *) apply (le_diff0 (d * q) (d * x)). (* Goal: le (Init.Nat.mul d x) (Init.Nat.mul d q) *) (* Goal: @eq nat (Init.Nat.mul d x) (Init.Nat.add (Init.Nat.mul d q) r) *) apply le_mult_l. (* Goal: le x q *) (* Goal: @eq nat (Init.Nat.mul d x) (Init.Nat.add (Init.Nat.mul d q) r) *) apply le_S_n. (* Goal: le (S x) (S q) *) (* Goal: @eq nat (Init.Nat.mul d x) (Init.Nat.add (Init.Nat.mul d q) r) *) change (x < S q) in |- *. (* Goal: lt x (S q) *) (* Goal: @eq nat (Init.Nat.mul d x) (Init.Nat.add (Init.Nat.mul d q) r) *) apply simpl_lt_mult_l with d. (* Goal: lt (Init.Nat.mul d x) (Init.Nat.mul d (S q)) *) (* Goal: @eq nat (Init.Nat.mul d x) (Init.Nat.add (Init.Nat.mul d q) r) *) rewrite <- (mult_n_Sm d q). (* Goal: lt (Init.Nat.mul d x) (Init.Nat.add (Init.Nat.mul d q) d) *) (* Goal: @eq nat (Init.Nat.mul d x) (Init.Nat.add (Init.Nat.mul d q) r) *) replace (d * x) with (d * q + r). (* Goal: lt (Init.Nat.add (Init.Nat.mul d q) r) (Init.Nat.add (Init.Nat.mul d q) d) *) (* Goal: @eq nat (Init.Nat.mul d x) (Init.Nat.add (Init.Nat.mul d q) r) *) apply plus_lt_compat_l. (* Goal: Z.gt d Z0 *) assumption. (* Goal: Z.gt d Z0 *) assumption. Qed. Theorem notdiv_rem : forall d n : nat, 0 < d -> ~ Divides d n -> exists q : nat, (exists r : nat, 0 < r /\ r < d /\ n = q * d + r). Proof. (* Goal: forall (d n : Z) (_ : Z.gt d Z0), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) intros d n. (* Goal: forall (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim (le_or_lt d n). (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intro. (* Goal: forall (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim (le_lt_or_eq d n). (* Goal: forall (_ : lt d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) apply (lt_wf_ind n). (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros N IH. intros. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) elim (lt_witness d N). intros. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) elim H3. intros. (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim (le_or_lt d x). (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intro. (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim (le_lt_or_eq d x). (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intro. (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim (divdec x d). (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : not (Divides d x), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim H8. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : not (Divides d x), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) rewrite H9 in H4. (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : not (Divides d x), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) rewrite plus_comm in H4. (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : not (Divides d x), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) rewrite mult_n_Sm in H4. (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) elim H2. (* Goal: Divides d N *) (* Goal: forall _ : not (Divides d x), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) split with (S x0). symmetry in |- *. (* Goal: Z.gt d Z0 *) assumption. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim (IH x). (* Goal: forall (x0 : nat) (_ : @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat x (Init.Nat.add (Init.Nat.mul x0 d) r))))), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt x N *) (* Goal: lt d x *) (* Goal: lt O d *) (* Goal: not (Divides d x) *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) intro q'. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt x N *) (* Goal: lt d x *) (* Goal: lt O d *) (* Goal: not (Divides d x) *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim H9. (* Goal: forall (x0 : nat) (_ : and (lt O x0) (and (lt x0 d) (@eq nat x (Init.Nat.add (Init.Nat.mul q' d) x0)))), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt x N *) (* Goal: lt d x *) (* Goal: lt O d *) (* Goal: not (Divides d x) *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) intro r'. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt x N *) (* Goal: lt d x *) (* Goal: lt O d *) (* Goal: not (Divides d x) *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim H10. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt x N *) (* Goal: lt d x *) (* Goal: lt O d *) (* Goal: not (Divides d x) *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim H12. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt x N *) (* Goal: lt d x *) (* Goal: lt O d *) (* Goal: not (Divides d x) *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) split with (S q'). (* Goal: @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul (S q') d) r)))) *) (* Goal: lt x N *) (* Goal: lt d x *) (* Goal: lt O d *) (* Goal: not (Divides d x) *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) split with r'. (* Goal: and (Z.le Z0 Z0) (Z.lt Z0 (Z.of_nat (Z.abs_nat d))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) split. (* Goal: Z.gt d Z0 *) assumption. (* Goal: and (Z.le Z0 Z0) (Z.lt Z0 (Z.of_nat (Z.abs_nat d))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) split. (* Goal: Z.gt d Z0 *) assumption. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Gt) *) (* Goal: Z.gt d Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) simpl in |- *. (* Goal: @eq nat N (Init.Nat.add (Init.Nat.add d (Init.Nat.mul q' d)) r') *) (* Goal: lt x N *) (* Goal: lt d x *) (* Goal: lt O d *) (* Goal: not (Divides d x) *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) rewrite plus_assoc_reverse. (* Goal: @eq nat N (Init.Nat.add d (Init.Nat.add (Init.Nat.mul q' d) r')) *) (* Goal: lt x N *) (* Goal: lt d x *) (* Goal: lt O d *) (* Goal: not (Divides d x) *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) rewrite <- H14. symmetry in |- *. (* Goal: Z.gt d Z0 *) assumption. (* Goal: @eq nat N (Nat.add d d) *) (* Goal: le d x *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) rewrite <- H4. (* Goal: lt x (Init.Nat.add d x) *) (* Goal: lt d x *) (* Goal: lt O d *) (* Goal: not (Divides d x) *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) pattern x at 1 in |- *. (* Goal: (fun n : nat => lt n (Init.Nat.add d x)) x *) (* Goal: lt d x *) (* Goal: lt O d *) (* Goal: not (Divides d x) *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) replace x with (0 + x). (* Goal: lt (Init.Nat.add O x) (Init.Nat.add d x) *) (* Goal: @eq nat (Init.Nat.add O x) x *) (* Goal: lt d x *) (* Goal: lt O d *) (* Goal: not (Divides d x) *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) apply plus_lt_compat_r. (* Goal: Z.gt d Z0 *) assumption. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Gt) *) (* Goal: Z.gt d Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) simpl in |- *. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) reflexivity. (* Goal: Z.gt d Z0 *) assumption. (* Goal: Z.gt d Z0 *) assumption. (* Goal: Z.gt d Z0 *) assumption. (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intro. (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) elim H2. (* Goal: Divides d N *) (* Goal: le d x *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) split with 2. (* Goal: @eq nat b (Nat.sub (Init.Nat.add a b) (Nat.mul x0 d)) *) rewrite mult_comm. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Gt) *) (* Goal: Z.gt d Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) simpl in |- *. (* Goal: @eq nat n (Nat.add d O) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) rewrite <- (plus_n_O d). (* Goal: @eq nat N (Nat.add d d) *) (* Goal: le d x *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) rewrite <- H4. (* Goal: @eq nat (Init.Nat.add d x) (Nat.add d d) *) (* Goal: le d x *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) rewrite H7. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) reflexivity. (* Goal: Z.gt d Z0 *) assumption. (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intro. (* Goal: Divides d n *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) split with 1. (* Goal: @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul (S O) d) r)))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) split with x. (* Goal: and (Z.le Z0 Z0) (Z.lt Z0 (Z.of_nat (Z.abs_nat d))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) split. (* Goal: Z.gt d Z0 *) assumption. (* Goal: and (Z.le Z0 Z0) (Z.lt Z0 (Z.of_nat (Z.abs_nat d))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) split. (* Goal: Z.gt d Z0 *) assumption. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Gt) *) (* Goal: Z.gt d Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) simpl in |- *. (* Goal: @eq nat n (Nat.add d O) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) rewrite <- (plus_n_O d). (* Goal: @eq nat N (Init.Nat.add d x) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) rewrite H4. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) reflexivity. (* Goal: Z.gt d Z0 *) assumption. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) elim H2. (* Goal: Divides d n *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) split with 1. (* Goal: @eq nat b (Nat.sub (Init.Nat.add a b) (Nat.mul x0 d)) *) rewrite mult_comm. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Gt) *) (* Goal: Z.gt d Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) simpl in |- *. (* Goal: @eq nat n (Nat.add d O) *) (* Goal: le d n *) (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) rewrite <- (plus_n_O d). symmetry in |- *. (* Goal: Z.gt d Z0 *) assumption. (* Goal: Z.gt d Z0 *) assumption. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) case n. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) elim H1. (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat (S n1) (Init.Nat.add (Init.Nat.mul q d) r))))) *) split with 0. (* Goal: @eq nat O (Init.Nat.mul d O) *) (* Goal: forall (n : nat) (_ : lt (S n) d) (_ : lt O d) (_ : not (Divides d (S n))), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat (S n) (Init.Nat.add (Init.Nat.mul q d) r))))) *) apply mult_n_O. (* Goal: forall (n : nat) (_ : lt (S n) d) (_ : lt O d) (_ : not (Divides d (S n))), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat (S n) (Init.Nat.add (Init.Nat.mul q d) r))))) *) intro n1. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat (S n1) (Init.Nat.add (Init.Nat.mul q d) r))))) *) split with 0. (* Goal: @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat (S n1) (Init.Nat.add (Init.Nat.mul O d) r)))) *) split with (S n1). (* Goal: and (Z.le Z0 Z0) (Z.lt Z0 (Z.of_nat (Z.abs_nat d))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) split. (* Goal: lt O (S n1) *) (* Goal: and (lt (S n1) d) (@eq nat (S n1) (Init.Nat.add (Init.Nat.mul O d) (S n1))) *) apply lt_O_Sn. (* Goal: and (Z.le Z0 Z0) (Z.lt Z0 (Z.of_nat (Z.abs_nat d))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) split. (* Goal: Z.gt d Z0 *) assumption. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Gt) *) (* Goal: Z.gt d Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) simpl in |- *. reflexivity. Qed. (** Compatibility results. *) Lemma div_plus_compat : forall a b c : nat, Divides a b -> Divides a c -> Divides a (b + c). Proof. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) elim H. intro x. intros. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) elim H0. intro y. intros. (* Goal: Divides a (Init.Nat.add b c) *) split with (x + y). (* Goal: @eq Z (Z.add b c) (Z.mul a (Z.add x y)) *) rewrite H1. rewrite H2. symmetry in |- *. (* Goal: @eq nat (Nat.mul (Init.Nat.add x y) a) (Init.Nat.add (Nat.mul x a) (Init.Nat.mul a y)) *) rewrite (mult_comm a). rewrite (mult_comm a). rewrite (mult_comm a). (* Goal: @eq nat (Nat.mul (Init.Nat.add x y) a) (Init.Nat.add (Nat.mul x a) (Nat.mul y a)) *) apply mult_plus_distr_r. Qed. Lemma div_minus_compat : forall a b d : nat, Divides d a -> Divides d b -> Divides d (a - b). Proof. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. elim H. elim H0. intros. (* Goal: Divides a (Init.Nat.mul b c) *) unfold Divides in |- *. rewrite H1. rewrite H2. (* Goal: @ex nat (fun q : nat => @eq nat (Init.Nat.sub (Nat.mul x0 d) (Init.Nat.mul d x)) (Init.Nat.mul d q)) *) rewrite (mult_comm d). (* Goal: @ex nat (fun q : nat => @eq nat (Init.Nat.sub (Nat.mul x0 d) (Init.Nat.mul d x)) (Init.Nat.mul d q)) *) rewrite (mult_comm d). (* Goal: @ex nat (fun q : nat => @eq nat (Init.Nat.sub (Nat.mul x0 d) (Nat.mul x d)) (Init.Nat.mul d q)) *) rewrite <- mult_minus_distr_r. (* Goal: @ex nat (fun q : nat => @eq nat (Nat.mul (Nat.sub x0 x) d) (Init.Nat.mul d q)) *) split with (x0 - x). (* Goal: @eq nat (Nat.mul (Nat.sub x0 x) d) (Init.Nat.mul d (Init.Nat.sub x0 x)) *) apply mult_comm. Qed. Lemma div_mult_compat_l : forall a b c : nat, Divides a b -> Divides a (b * c). Proof. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: ZDivides a (Z.mul b c) *) elim H. (* Goal: forall (x : Z) (_ : @eq Z b (Z.mul a x)), ZDivides a (Z.mul b c) *) intro x. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: Divides a (Init.Nat.mul b c) *) unfold Divides in |- *. (* Goal: @ex Z (fun q : Z => @eq Z (Z.mul b c) (Z.mul a q)) *) rewrite H0. (* Goal: @ex nat (fun q : nat => @eq nat (Init.Nat.mul (Init.Nat.mul a x) c) (Init.Nat.mul a q)) *) split with (x * c). (* Goal: @eq nat (Init.Nat.mul (Init.Nat.mul a x) c) (Init.Nat.mul a (Init.Nat.mul x c)) *) rewrite mult_assoc. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) reflexivity. Qed. Lemma div_absexp_compat : forall (b : Z) (d : nat), Divides d (Zabs_nat b) -> forall n : nat, Divides d (Zabs_nat (Exp b (S n))). Proof. (* Goal: ZDivides a (Z.mul b c) *) intros b d H. elim H. intros k Hk. simple induction n. (* Goal: Divides d (Z.abs_nat (Exp b (S O))) *) (* Goal: forall (n : nat) (_ : Divides d (Z.abs_nat (Exp b (S n)))), Divides d (Z.abs_nat (Exp b (S (S n)))) *) split with k. (* Goal: @eq nat (Z.abs_nat (Exp b (S O))) (Init.Nat.mul d k) *) (* Goal: forall (n : nat) (_ : Divides d (Z.abs_nat (Exp b (S n)))), Divides d (Z.abs_nat (Exp b (S (S n)))) *) rewrite <- Hk. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Gt) *) (* Goal: Z.gt d Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) simpl in |- *. (* Goal: Divides d (Z.abs_nat (Z.mul b (Exp b (S m)))) *) (* Goal: @eq Z (Z.mul b (Exp b (S m))) (Exp b (S (S m))) *) rewrite abs_mult. (* Goal: @eq nat b (Nat.sub (Init.Nat.add a b) (Nat.mul x0 d)) *) rewrite mult_comm. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Gt) *) (* Goal: Z.gt d Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) simpl in |- *. (* Goal: @eq nat (Nat.add (Z.abs_nat b) O) (Z.abs_nat b) *) (* Goal: forall (n : nat) (_ : Divides d (Z.abs_nat (Exp b (S n)))), Divides d (Z.abs_nat (Exp b (S (S n)))) *) rewrite <- plus_n_O. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) reflexivity. (* Goal: forall (n : nat) (_ : Divides d (Z.abs_nat (Exp b (S n)))), Divides d (Z.abs_nat (Exp b (S (S n)))) *) intros m IH. (* Goal: Divides d (Z.abs_nat (Exp b (S (S m)))) *) replace (Exp b (S (S m))) with (b * Exp b (S m))%Z. (* Goal: Divides d (Z.abs_nat (Z.mul b (Exp b (S m)))) *) (* Goal: @eq Z (Z.mul b (Exp b (S m))) (Exp b (S (S m))) *) rewrite abs_mult. (* Goal: Divides d (Init.Nat.mul (Z.abs_nat b) (Z.abs_nat (Exp b (S m)))) *) (* Goal: @eq Z (Z.mul b (Exp b (S m))) (Exp b (S (S m))) *) apply div_mult_compat_l. (* Goal: Z.gt d Z0 *) assumption. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Gt) *) (* Goal: Z.gt d Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) simpl in |- *. reflexivity. Qed. Lemma div_plus_r : forall a b d : nat, Divides d a -> Divides d (a + b) -> Divides d b. Proof. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. elim H. elim H0. intros. (* Goal: Divides d b *) split with (x - x0). (* Goal: @eq nat b (Nat.sub (Init.Nat.add a b) (Nat.mul x0 d)) *) rewrite mult_comm. (* Goal: @eq nat b (Nat.mul (Init.Nat.sub x x0) d) *) rewrite mult_minus_distr_r. (* Goal: @eq nat b (Nat.sub (Init.Nat.add a b) (Nat.mul x0 d)) *) rewrite mult_comm. (* Goal: @eq Z b (Z.sub (Z.mul d x) (Z.mul x0 d)) *) rewrite <- H1. (* Goal: @eq nat b (Nat.sub (Init.Nat.add a b) (Nat.mul x0 d)) *) rewrite mult_comm. (* Goal: @eq Z b (Z.sub (Z.add a b) (Z.mul d x0)) *) rewrite <- H2. (* Goal: @eq nat b (Nat.sub (Init.Nat.add a b) a) *) rewrite minus_plus. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) reflexivity. Qed. (** * Division on Z. *) Definition ZDivides (x y : Z) : Prop := exists q : Z, y = (x * q)%Z. Lemma zdivdiv : forall a b : Z, ZDivides a b -> Divides (Zabs_nat a) (Zabs_nat b). Proof. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: ZDivides a (Z.mul b c) *) elim H. (* Goal: forall (x : nat) (_ : @eq nat (Z.abs_nat b) (Init.Nat.mul (Z.abs_nat a) x)), ZDivides a b *) intros d Hd. (* Goal: Divides (Z.abs_nat a) (Z.abs_nat b) *) exists (Zabs_nat d). (* Goal: @eq Z (Z.of_nat (Z.abs_nat b)) (Z.of_nat (Init.Nat.mul (Z.abs_nat a) d)) *) (* Goal: Z.lt a Z0 *) (* Goal: Z.lt b Z0 *) rewrite Hd. (* Goal: @eq nat (Z.abs_nat (Z.mul a d)) (Init.Nat.mul (Z.abs_nat a) (Z.abs_nat d)) *) apply abs_mult. Qed. Lemma divzdiv : forall a b : Z, Divides (Zabs_nat a) (Zabs_nat b) -> ZDivides a b. Proof. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: ZDivides a (Z.mul b c) *) elim H. (* Goal: forall (x : nat) (_ : @eq nat (Z.abs_nat b) (Init.Nat.mul (Z.abs_nat a) x)), ZDivides a b *) intros d Hd. (* Goal: ZDivides a b *) elim (Zle_or_lt 0 a). (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) elim (Zle_or_lt 0 b). (* case 0<=b, a<=b *) (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: ZDivides a b *) exists (Z_of_nat d). (* Goal: @eq Z b (Z.mul (Z.opp (Z.of_nat (Z.abs_nat a))) (Z.opp (Z.of_nat d))) *) (* Goal: Z.lt a Z0 *) (* Goal: forall (_ : Z.lt b Z0) (_ : Z.lt a Z0), ZDivides a b *) rewrite <- (inj_abs_pos b). (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat b))) (Z.mul a (Z.opp (Z.of_nat d))) *) (* Goal: Z.lt b Z0 *) (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) rewrite <- (inj_abs_pos a). (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.mul (Z.of_nat qn) (Z.of_nat (Z.abs_nat d)))) *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) rewrite <- Znat.inj_mult. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) rewrite Hd. reflexivity. (* Goal: Z.gt d Z0 *) apply Zle_ge. assumption. (* Goal: Z.gt d Z0 *) apply Zle_ge. assumption. (* case b<0, 0<=a *) (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: ZDivides a b *) (* Goal: forall (_ : Z.lt b Z0) (_ : Z.lt a Z0), ZDivides a b *) exists (- Z_of_nat d)%Z. (* Goal: @eq Z b (Z.mul a (Z.of_nat d)) *) rewrite <- (Zopp_involutive b). (* Goal: @eq Z (Z.opp (Z.opp b)) (Z.mul (Z.opp (Z.opp a)) (Z.of_nat d)) *) rewrite <- (inj_abs_neg b). (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat b))) (Z.mul a (Z.opp (Z.of_nat d))) *) (* Goal: Z.lt b Z0 *) (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) rewrite <- (inj_abs_pos a). (* Goal: @eq Z b (Z.sub (Z.add a b) (Z.mul x0 d)) *) rewrite Zmult_comm. rewrite Zopp_mult_distr_l_reverse. rewrite Zmult_comm. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.mul (Z.of_nat qn) (Z.of_nat (Z.abs_nat d)))) *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) rewrite <- Znat.inj_mult. (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat b))) (Z.opp (Z.of_nat (Init.Nat.mul (Z.abs_nat a) d))) *) (* Goal: Z.lt a Z0 *) (* Goal: Z.lt b Z0 *) apply (f_equal (A:=Z)). (* Goal: @eq Z (Z.of_nat (Z.abs_nat b)) (Z.of_nat (Init.Nat.mul (Z.abs_nat a) d)) *) (* Goal: Z.lt a Z0 *) (* Goal: Z.lt b Z0 *) rewrite Hd. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) reflexivity. (* Goal: Z.gt d Z0 *) apply Zle_ge. assumption. (* Goal: Z.gt d Z0 *) assumption. (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) elim (Zle_or_lt 0 b). (* case 0<=b, a<0 *) (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: ZDivides a b *) (* Goal: forall (_ : Z.lt b Z0) (_ : Z.lt a Z0), ZDivides a b *) exists (- Z_of_nat d)%Z. (* Goal: @eq Z (Z.opp (Z.opp b)) (Z.mul a (Z.of_nat d)) *) rewrite <- (Zopp_involutive a). (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat b))) (Z.mul (Z.opp (Z.opp a)) (Z.of_nat d)) *) (* Goal: Z.lt b Z0 *) rewrite <- (inj_abs_neg a). (* Goal: @eq Z b (Z.mul (Z.opp (Z.of_nat (Z.abs_nat a))) (Z.opp (Z.of_nat d))) *) (* Goal: Z.lt a Z0 *) (* Goal: forall (_ : Z.lt b Z0) (_ : Z.lt a Z0), ZDivides a b *) rewrite <- (inj_abs_pos b). (* Goal: @eq Z (Z.of_nat (Z.abs_nat b)) (Z.mul (Z.opp (Z.of_nat (Z.abs_nat a))) (Z.opp (Z.of_nat d))) *) (* Goal: Z.ge b Z0 *) (* Goal: Z.lt a Z0 *) (* Goal: forall (_ : Z.lt b Z0) (_ : Z.lt a Z0), ZDivides a b *) rewrite Zmult_opp_opp. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.mul (Z.of_nat qn) (Z.of_nat (Z.abs_nat d)))) *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) rewrite <- Znat.inj_mult. (* Goal: @eq Z (Z.of_nat (Z.abs_nat b)) (Z.of_nat (Init.Nat.mul (Z.abs_nat a) d)) *) (* Goal: Z.lt a Z0 *) (* Goal: Z.lt b Z0 *) rewrite Hd. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) reflexivity. (* Goal: Z.gt d Z0 *) apply Zle_ge. assumption. (* Goal: Z.gt d Z0 *) assumption. (* case b<0, a<0 *) (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: ZDivides a b *) exists (Z_of_nat d). (* Goal: @eq Z b (Z.mul a (Z.of_nat d)) *) rewrite <- (Zopp_involutive b). (* Goal: @eq Z (Z.opp (Z.opp b)) (Z.mul a (Z.of_nat d)) *) rewrite <- (Zopp_involutive a). (* Goal: @eq Z (Z.opp (Z.opp b)) (Z.mul (Z.opp (Z.opp a)) (Z.of_nat d)) *) rewrite <- (inj_abs_neg b). (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat b))) (Z.mul (Z.opp (Z.opp a)) (Z.of_nat d)) *) (* Goal: Z.lt b Z0 *) rewrite <- (inj_abs_neg a). (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) rewrite Zopp_mult_distr_l_reverse. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.mul (Z.of_nat qn) (Z.of_nat (Z.abs_nat d)))) *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) rewrite <- Znat.inj_mult. (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat b))) (Z.opp (Z.of_nat (Init.Nat.mul (Z.abs_nat a) d))) *) (* Goal: Z.lt a Z0 *) (* Goal: Z.lt b Z0 *) apply (f_equal (A:=Z)). (* Goal: @eq Z (Z.of_nat (Z.abs_nat b)) (Z.of_nat (Init.Nat.mul (Z.abs_nat a) d)) *) (* Goal: Z.lt a Z0 *) (* Goal: Z.lt b Z0 *) rewrite Hd. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) reflexivity. (* Goal: Z.gt d Z0 *) assumption. (* Goal: Z.gt d Z0 *) assumption. Qed. Lemma zdivdec : forall x d : Z, ZDivides d x \/ ~ ZDivides d x. Proof. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: or (ZDivides d x) (not (ZDivides d x)) *) elim (divdec (Zabs_nat x) (Zabs_nat d)). (* Goal: Z.gt d Z0 *) left. apply divzdiv. assumption. (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) right. intro. apply H. apply zdivdiv. assumption. Qed. Lemma zdiv_plus_r : forall a b d : Z, ZDivides d a -> ZDivides d (a + b) -> ZDivides d b. Proof. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: ZDivides a (Z.mul b c) *) elim H. (* Goal: ZDivides a (Z.add b c) *) elim H0. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: ZDivides d b *) split with (x - x0)%Z. (* Goal: @eq Z b (Z.sub (Z.add a b) (Z.mul x0 d)) *) rewrite Zmult_comm. (* Goal: @eq Z b (Z.mul (Z.sub x x0) d) *) rewrite Zmult_minus_distr_r. (* Goal: @eq Z b (Z.sub (Z.add a b) (Z.mul x0 d)) *) rewrite Zmult_comm. (* Goal: @eq Z b (Z.sub (Z.mul d x) (Z.mul x0 d)) *) rewrite <- H1. (* Goal: @eq Z b (Z.sub (Z.add a b) (Z.mul x0 d)) *) rewrite Zmult_comm. (* Goal: @eq Z b (Z.sub (Z.add a b) (Z.mul d x0)) *) rewrite <- H2. (* Goal: @eq Z b (Z.sub (Z.add a b) a) *) rewrite Zminus_plus. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) reflexivity. Qed. Lemma zdiv_plus_compat : forall a b c : Z, ZDivides a b -> ZDivides a c -> ZDivides a (b + c). Proof. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) elim H. intro x. intros. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) elim H0. intro y. intros. (* Goal: ZDivides a (Z.add b c) *) split with (x + y)%Z. (* Goal: @eq Z (Z.add b c) (Z.mul a (Z.add x y)) *) rewrite H1. rewrite H2. symmetry in |- *. (* Goal: @eq Z (Z.mul (Z.add x y) a) (Z.add (Z.mul x a) (Z.mul a y)) *) rewrite (Zmult_comm a). rewrite (Zmult_comm a). rewrite (Zmult_comm a). (* Goal: @eq Z (Z.mul (Z.add x y) a) (Z.add (Z.mul x a) (Z.mul y a)) *) apply Zmult_plus_distr_l. Qed. Lemma zdiv_mult_compat_l : forall a b c : Z, ZDivides a b -> ZDivides a (b * c). Proof. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: ZDivides a (Z.mul b c) *) elim H. (* Goal: forall (x : Z) (_ : @eq Z b (Z.mul a x)), ZDivides a (Z.mul b c) *) intro x. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros. (* Goal: ZDivides a (Z.mul b c) *) unfold ZDivides in |- *. (* Goal: @ex Z (fun q : Z => @eq Z (Z.mul b c) (Z.mul a q)) *) rewrite H0. (* Goal: @ex Z (fun q : Z => @eq Z (Z.mul (Z.mul a x) c) (Z.mul a q)) *) split with (x * c)%Z. (* Goal: @eq Z (Z.mul (Z.mul a x) c) (Z.mul a (Z.mul x c)) *) rewrite Zmult_assoc. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) reflexivity. Qed. Theorem zdiv_rem : forall d n : Z, (d > 0)%Z -> exists q : Z, (exists r : Z, (0 <= r < d)%Z /\ n = (q * d + r)%Z). Proof. (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intros d n. intro. (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) elim (Zle_or_lt 0 n). (* case 0<=n *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intro. rewrite <- (inj_abs_pos d). rewrite <- (inj_abs_pos n). (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) elim (div_rem (Zabs_nat d) (Zabs_nat n)). (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intro qn. intros. elim H1. intro rn. intros. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) elim H2. intros. elim H4. intros. (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.of_nat (Z.abs_nat n)) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.ge n Z0 *) (* Goal: Z.ge d Z0 *) (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) split with (Z_of_nat qn). split with (Z_of_nat rn). (* Goal: and (Z.le Z0 Z0) (Z.lt Z0 (Z.of_nat (Z.abs_nat d))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) split. split. change (Z_of_nat 0 <= Z_of_nat rn)%Z in |- *. (* Goal: le O rn *) (* Goal: Z.lt (Z.of_nat rn) (Z.of_nat (Z.abs_nat d)) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) apply Znat.inj_le. apply le_O_n. (* Goal: Z.gt d Z0 *) apply Znat.inj_lt. assumption. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.mul (Z.of_nat qn) (Z.of_nat (Z.abs_nat d)))) *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) rewrite <- Znat.inj_mult. rewrite <- Znat.inj_plus. apply Znat.inj_eq. (* Goal: Z.gt d Z0 *) assumption. change (Zabs_nat d > Zabs_nat 0) in |- *. apply gtzgt. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) apply Zlt_le_weak. apply Zgt_lt. assumption. apply Zeq_le. reflexivity. (* Goal: Z.gt d Z0 *) assumption. apply Zle_ge. assumption. apply Zle_ge. (* Goal: Z.gt d Z0 *) apply Zlt_le_weak. apply Zgt_lt. assumption. (* case n<0 *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intro. rewrite <- (inj_abs_pos d). (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z n (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: Z.ge d Z0 *) replace n with (- - n)%Z. rewrite <- (inj_abs_neg n). (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) elim (div_rem (Zabs_nat d) (Zabs_nat n)). (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intro qn. intros. elim H1. intro rn. intros. (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) elim H2. intros. elim H4. intros. (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) elim (le_lt_or_eq 0 rn). (* case 0<rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intro. split with (- Z_of_nat (S qn))%Z. split with (d - Z_of_nat rn)%Z. (* Goal: and (Z.le Z0 Z0) (Z.lt Z0 (Z.of_nat (Z.abs_nat d))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) split. split. rewrite <- (inj_abs_pos d). apply Zle_minus. apply Znat.inj_le. (* Goal: Z.gt d Z0 *) apply lt_le_weak. assumption. (* Goal: Z.gt d Z0 *) apply Zle_ge. apply Zlt_le_weak. apply Zgt_lt. assumption. (* Goal: Z.lt (Z.sub d (Z.of_nat rn)) (Z.of_nat (Z.abs_nat d)) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) rewrite inj_abs_pos. apply Zplus_lt_reg_l with (Z_of_nat rn). (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.add (Z.opp (Z.of_nat (Init.Nat.mul qn (Z.abs_nat d)))) (Z.opp d)) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.ge d Z0 *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) unfold Zminus in |- *. rewrite (Zplus_comm d). (* Goal: Z.lt (Z.add (Z.of_nat rn) (Z.add (Z.opp (Z.of_nat rn)) d)) (Z.add (Z.of_nat rn) d) *) (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) rewrite (Zplus_assoc (Z_of_nat rn)). (* Goal: not (@eq comparison (Z.compare Z0 Z0) Gt) *) (* Goal: Z.gt d Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) rewrite Zplus_opp_r. simpl in |- *. change (0 + d < Z_of_nat rn + d)%Z in |- *. (* Goal: Z.lt (Z.add Z0 d) (Z.add (Z.of_nat rn) d) *) (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) rewrite Zplus_comm. rewrite (Zplus_comm (Z_of_nat rn)). apply Zplus_lt_compat_l. (* Goal: Z.gt d Z0 *) change (Z_of_nat 0 < Z_of_nat rn)%Z in |- *. apply Znat.inj_lt. assumption. (* Goal: Z.gt d Z0 *) apply Zle_ge. apply Zlt_le_weak. apply Zgt_lt. assumption. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) rewrite Znat.inj_S. unfold Zsucc in |- *. rewrite Zopp_mult_distr_l_reverse. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.mul (Z.of_nat qn) (Z.of_nat (Z.abs_nat d)))) *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) rewrite Zmult_plus_distr_l. rewrite <- Znat.inj_mult. rewrite Zmult_1_l. (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.opp (Z.add (Z.of_nat (Init.Nat.mul qn (Z.abs_nat d))) (Z.of_nat (Z.abs_nat d)))) (Z.sub d (Z.of_nat rn))) *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) rewrite (inj_abs_pos d). rewrite Zopp_plus_distr. (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.add (Z.opp (Z.of_nat (Init.Nat.mul qn (Z.abs_nat d)))) (Z.opp d)) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.ge d Z0 *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) unfold Zminus in |- *. rewrite Zplus_assoc_reverse. rewrite (Zplus_assoc (- d)). (* Goal: not (@eq comparison (Z.compare Z0 Z0) Gt) *) (* Goal: Z.gt d Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) rewrite Zplus_opp_l. simpl in |- *. rewrite <- Zopp_plus_distr. rewrite <- Znat.inj_plus. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) rewrite <- H6. reflexivity. (* Goal: Z.gt d Z0 *) apply Zle_ge. apply Zlt_le_weak. apply Zgt_lt. assumption. (* case 0=rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) intro. (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) split with (- Z_of_nat qn)%Z. split with 0%Z. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Gt) *) (* Goal: Z.gt d Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) split. split. unfold Zle in |- *. simpl in |- *. discriminate. (* Goal: Z.lt Z0 (Z.of_nat (Z.abs_nat d)) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) apply Zle_lt_trans with (Z_of_nat rn). (* Goal: le O rn *) (* Goal: Z.lt (Z.of_nat rn) (Z.of_nat (Z.abs_nat d)) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) change (Z_of_nat 0 <= Z_of_nat rn)%Z in |- *. apply Znat.inj_le. apply le_O_n. (* Goal: Z.gt d Z0 *) apply Znat.inj_lt. assumption. (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) rewrite <- Zplus_0_r_reverse. rewrite inj_abs_neg. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.mul (Z.of_nat qn) (Z.of_nat (Z.abs_nat d)))) *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) rewrite Zopp_mult_distr_l_reverse. rewrite <- Znat.inj_mult. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.of_nat (Init.Nat.mul qn (Z.abs_nat d)))) *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) rewrite <- H7 in H6. rewrite <- plus_n_O in H6. rewrite <- H6. (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: le O rn *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) rewrite inj_abs_neg. reflexivity. (* Goal: Z.gt d Z0 *) assumption. assumption. assumption. (* Goal: gt (Z.abs_nat d) O *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) change (Zabs_nat d > Zabs_nat 0) in |- *. apply gtzgt. apply Zlt_le_weak. (* Goal: Z.gt d Z0 *) apply Zgt_lt. assumption. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Gt) *) (* Goal: Z.gt d Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) unfold Zle in |- *. simpl in |- *. discriminate. (* Goal: Z.gt d Z0 *) assumption. assumption. (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.ge d Z0 *) apply Zopp_involutive. (* Goal: Z.gt d Z0 *) apply Zle_ge. apply Zlt_le_weak. apply Zgt_lt. assumption. Qed.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) (** lemmas. Some nice lemmas, mostly about le, lt, and mult. @author Olga Caprotti and Martijn Oostdijk @version $Revision$ *) Global Set Asymmetric Patterns. Require Import ZArith. Require Import EqNat. Lemma predminus1 : forall n : nat, pred n = n - 1. Proof. (* Goal: forall n : nat, or (@eq nat n O) (or (@eq nat n (S O)) (gt n (S O))) *) intro n. case n. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. reflexivity. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. intro m. rewrite <- minus_n_O. reflexivity. Qed. Lemma le_mult_l : forall p q : nat, p <= q -> forall r : nat, r * p <= r * q. Proof. (* Goal: forall (p q : nat) (_ : le p q) (r : nat), le (Init.Nat.mul p r) (Init.Nat.mul q r) *) intros p q H. (* Goal: forall (p q r : Z) (_ : Z.lt Z0 r) (_ : Z.le p q), Z.le (Z.mul r p) (Z.mul r q) *) simple induction r. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. (* Goal: le (Init.Nat.mul a c) (Init.Nat.mul a c) *) apply le_n. (* Goal: forall (n : nat) (_ : le (Init.Nat.mul p n) (Init.Nat.mul q n)), le (Init.Nat.mul p (S n)) (Init.Nat.mul q (S n)) *) intros r1 IHr1. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. (* Goal: le (Init.Nat.add (Init.Nat.mul p r1) p) (Init.Nat.add (Init.Nat.mul q r1) q) *) apply plus_le_compat. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. Qed. Lemma lt_plus_plus : forall n m p q : nat, n < m -> p < q -> n + p < m + q. Proof. (* Goal: forall (n m p q : nat) (_ : lt n m) (_ : lt p q), lt (Init.Nat.add n p) (Init.Nat.add m q) *) intros n m p q H H0. (* Goal: lt (Init.Nat.add n p) (Init.Nat.add m q) *) elim H; simpl in |- *; auto with arith. Qed. Lemma lt_mult_l : forall p q : nat, p < q -> forall r : nat, S r * p < S r * q. Proof. (* Goal: forall (p q : nat) (_ : le p q) (r : nat), le (Init.Nat.mul p r) (Init.Nat.mul q r) *) intros p q H. (* Goal: forall (p q r : Z) (_ : Z.lt Z0 r) (_ : Z.le p q), Z.le (Z.mul r p) (Z.mul r q) *) simple induction r. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. (* Goal: forall _ : @eq nat (Init.Nat.add q O) (S O), and (@eq nat (S O) (S O)) (@eq nat q (S O)) *) (* Goal: forall (n q : nat) (_ : @eq nat (Init.Nat.mul (S (S n)) q) (S O)), and (@eq nat (S (S n)) (S O)) (@eq nat q (S O)) *) rewrite <- plus_n_O. (* Goal: forall _ : @eq nat (Init.Nat.add q O) (S O), and (@eq nat (S O) (S O)) (@eq nat q (S O)) *) (* Goal: forall (n q : nat) (_ : @eq nat (Init.Nat.mul (S (S n)) q) (S O)), and (@eq nat (S (S n)) (S O)) (@eq nat q (S O)) *) rewrite <- plus_n_O. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: forall (n : nat) (_ : le (Init.Nat.mul p n) (Init.Nat.mul q n)), le (Init.Nat.mul p (S n)) (Init.Nat.mul q (S n)) *) intros r1 IHr1. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. (* Goal: lt (Init.Nat.add p (Init.Nat.add p (Init.Nat.mul r1 p))) (Init.Nat.add q (Init.Nat.add q (Init.Nat.mul r1 q))) *) apply lt_plus_plus. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. Qed. Lemma le_mult_r : forall p q : nat, p <= q -> forall r : nat, p * r <= q * r. Proof. (* Goal: forall (p q : nat) (_ : le p q) (r : nat), le (Init.Nat.mul p r) (Init.Nat.mul q r) *) intros p q H. (* Goal: forall (p q r : Z) (_ : Z.lt Z0 r) (_ : Z.le p q), Z.le (Z.mul r p) (Z.mul r q) *) simple induction r. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. (* Goal: le (Init.Nat.mul p O) (Init.Nat.mul q O) *) (* Goal: forall (n : nat) (_ : le (Init.Nat.mul p n) (Init.Nat.mul q n)), le (Init.Nat.mul p (S n)) (Init.Nat.mul q (S n)) *) rewrite <- (mult_n_O p). (* Goal: le O (Init.Nat.mul q O) *) (* Goal: forall (n : nat) (_ : le (Init.Nat.mul p n) (Init.Nat.mul q n)), le (Init.Nat.mul p (S n)) (Init.Nat.mul q (S n)) *) rewrite <- (mult_n_O q). (* Goal: le (Init.Nat.mul a c) (Init.Nat.mul a c) *) apply le_n. (* Goal: forall (n : nat) (_ : le (Init.Nat.mul p n) (Init.Nat.mul q n)), le (Init.Nat.mul p (S n)) (Init.Nat.mul q (S n)) *) intros r1 IHr1. (* Goal: le (Init.Nat.mul p (S r1)) (Init.Nat.mul q (S r1)) *) rewrite <- (mult_n_Sm p r1). (* Goal: le (Init.Nat.add (Init.Nat.mul p r1) p) (Init.Nat.mul q (S r1)) *) rewrite <- (mult_n_Sm q r1). (* Goal: le (Init.Nat.add (Init.Nat.mul p r1) p) (Init.Nat.add (Init.Nat.mul q r1) q) *) apply plus_le_compat. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. Qed. Lemma sqrbound : forall p q : nat, p * p <= p * q \/ q * q <= p * q. Proof. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: or (le (Init.Nat.mul p p) (Init.Nat.mul p q)) (le (Init.Nat.mul q q) (Init.Nat.mul p q)) *) elim (le_or_lt p q). (* Goal: forall (b : Z) (_ : @eq Z Z0 Z0), or (@eq Z Z0 Z0) (@eq Z b Z0) *) (* Goal: forall (p : positive) (b : Z) (_ : @eq Z (Z.mul (Zpos p) b) Z0), or (@eq Z (Zpos p) Z0) (@eq Z b Z0) *) (* Goal: forall (p : positive) (b : Z) (_ : @eq Z (Z.mul (Zneg p) b) Z0), or (@eq Z (Zneg p) Z0) (@eq Z b Z0) *) left. (* Goal: le (Init.Nat.mul (S b1) c) (Init.Nat.mul (S b1) d) *) (* Goal: @eq nat (Init.Nat.mul (S b1) d) (Init.Nat.add d (Init.Nat.mul b1 d)) *) (* Goal: le a (S b1) *) apply le_mult_l. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: forall _ : @eq Z Z0 Z0, or (@eq Z (Zneg p) Z0) (@eq Z Z0 Z0) *) (* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zneg p) (Zpos p0)) Z0), or (@eq Z (Zneg p) Z0) (@eq Z (Zpos p0) Z0) *) (* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zneg p) (Zneg p0)) Z0), or (@eq Z (Zneg p) Z0) (@eq Z (Zneg p0) Z0) *) right. (* Goal: le (Init.Nat.mul q q) (Init.Nat.mul p q) *) apply le_mult_r. (* Goal: le (Init.Nat.mul (S a1) c) (Init.Nat.mul (S a1) b) *) apply lt_le_weak. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. Qed. Lemma le_n_nm : forall n m : nat, n <= n * S m. Proof. (* Goal: forall (n : nat) (_ : gt n (S O)), lt n (Init.Nat.mul n n) *) simple induction n. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: le (Init.Nat.mul a c) (Init.Nat.mul a c) *) apply le_n. (* Goal: forall (n : nat) (_ : forall m : nat, le n (Init.Nat.mul n (S m))) (m : nat), le (S n) (Init.Nat.mul (S n) (S m)) *) intros n1 IHn1. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: le (S (Init.Nat.mul a c)) (S (Init.Nat.add c (Init.Nat.mul a (S c)))) *) (* Goal: le (Init.Nat.mul (S a) (S c)) (Init.Nat.mul b d) *) apply le_n_S. (* Goal: le n1 (Init.Nat.add m (Init.Nat.mul n1 (S m))) *) rewrite (plus_comm m (n1 * S m)). (* Goal: le (Init.Nat.mul a c) (Init.Nat.add (Init.Nat.mul a c) a) *) (* Goal: le (Init.Nat.mul (S a) (S c)) (Init.Nat.mul b d) *) apply le_plus_trans. (* Goal: le n1 (Init.Nat.mul n1 (S m)) *) apply IHn1. Qed. Lemma le_n_mn : forall n m : nat, n <= S m * n. Proof. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: le n (Init.Nat.mul (S m) n) *) rewrite (mult_comm (S m) n). (* Goal: le n (Nat.mul n (S m)) *) apply le_n_nm. Qed. Lemma le_n_nn : forall n : nat, n <= n * n. Proof. (* Goal: forall n : nat, or (@eq nat n O) (or (@eq nat n (S O)) (gt n (S O))) *) intro n. case n. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. apply le_n. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. intros. apply le_n_S. apply le_plus_trans. apply le_n. Qed. Lemma lt_n_nm : forall n m : nat, 0 < n -> 1 < m -> n < n * m. Proof. (* Goal: forall (n m : nat) (_ : lt O n) (_ : lt (S O) m), lt n (Init.Nat.mul n m) *) intros n m. (* Goal: or (@eq nat n O) (or (@eq nat n (S O)) (gt n (S O))) *) case n. intros. elim (lt_n_O 0). assumption. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intro n1. case m. intros. elim (lt_n_O 1). assumption. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intro m1. case m1. intros. elim (lt_irrefl 1). assumption. (* Goal: forall (n : nat) (_ : lt O (S n1)) (_ : lt (S O) (S (S n))), lt (S n1) (Init.Nat.mul (S n1) (S (S n))) *) intro m2. elim n1. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. intros. apply lt_n_S. apply lt_O_Sn. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. intros n2 IH. intros. (* Goal: lt (S m) (S (Init.Nat.add m (Init.Nat.mul m (S m)))) *) (* Goal: forall _ : @eq nat (S O) m, lt (S m) (Init.Nat.mul (S m) (S m)) *) (* Goal: le (S O) m *) apply lt_n_S. (* Goal: lt (S n2) (S (Init.Nat.add m2 (S (S (Init.Nat.add m2 (Init.Nat.mul n2 (S (S m2)))))))) *) apply lt_trans with (S (S (m2 + n2 * S (S m2)))). (* Goal: lt (S n2) (S (S (Init.Nat.add m2 (Init.Nat.mul n2 (S (S m2)))))) *) (* Goal: lt (S (S (Init.Nat.add m2 (Init.Nat.mul n2 (S (S m2)))))) (S (Init.Nat.add m2 (S (S (Init.Nat.add m2 (Init.Nat.mul n2 (S (S m2)))))))) *) apply IH. (* Goal: lt O (S p1) *) (* Goal: @eq nat (Init.Nat.mul (S p1) q) (Init.Nat.mul (S p1) (S O)) *) apply lt_O_Sn. (* Goal: lt (S m) (S (Init.Nat.add m (Init.Nat.mul m (S m)))) *) (* Goal: forall _ : @eq nat (S O) m, lt (S m) (Init.Nat.mul (S m) (S m)) *) (* Goal: le (S O) m *) apply lt_n_S. (* Goal: lt O (S p1) *) (* Goal: @eq nat (Init.Nat.mul (S p1) q) (Init.Nat.mul (S p1) (S O)) *) apply lt_O_Sn. (* Goal: lt (S m) (S (Init.Nat.add m (Init.Nat.mul m (S m)))) *) (* Goal: forall _ : @eq nat (S O) m, lt (S m) (Init.Nat.mul (S m) (S m)) *) (* Goal: le (S O) m *) apply lt_n_S. (* Goal: lt (S (Nat.add (Init.Nat.mul n2 (S (S m2))) m2)) (Init.Nat.add m2 (S (S (Nat.add (Init.Nat.mul n2 (S (S m2))) m2)))) *) rewrite (plus_comm m2). (* Goal: lt (S (Nat.add (Init.Nat.mul n2 (S (S m2))) m2)) (Init.Nat.add m2 (S (S (Nat.add (Init.Nat.mul n2 (S (S m2))) m2)))) *) rewrite (plus_comm m2). (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. (* Goal: lt (S m) (S (Init.Nat.add m (Init.Nat.mul m (S m)))) *) (* Goal: forall _ : @eq nat (S O) m, lt (S m) (Init.Nat.mul (S m) (S m)) *) (* Goal: le (S O) m *) apply lt_n_S. (* Goal: lt (Nat.add (Init.Nat.mul n2 (S (S m2))) m2) (S (Nat.add (Nat.add (Init.Nat.mul n2 (S (S m2))) m2) m2)) *) apply lt_le_trans with (S (n2 * S (S m2) + m2)). (* Goal: lt (S p2) (S (S p2)) *) apply lt_n_Sn. (* Goal: le (S (Init.Nat.mul a c)) (S (Init.Nat.add c (Init.Nat.mul a (S c)))) *) (* Goal: le (Init.Nat.mul (S a) (S c)) (Init.Nat.mul b d) *) apply le_n_S. (* Goal: le (Init.Nat.mul a c) (Init.Nat.add (Init.Nat.mul a c) a) *) (* Goal: le (Init.Nat.mul (S a) (S c)) (Init.Nat.mul b d) *) apply le_plus_trans. (* Goal: le (Init.Nat.mul a c) (Init.Nat.mul a c) *) apply le_n. Qed. Lemma sqr_ascend : forall n : nat, n > 1 -> n < n * n. Proof. (* Goal: forall (n : nat) (_ : gt n (S O)), lt n (Init.Nat.mul n n) *) simple induction n. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: lt (Init.Nat.mul (Init.Nat.pred O) (Init.Nat.pred O)) (Init.Nat.mul O O) *) (* Goal: forall (n : nat) (_ : gt (S n) (S O)), lt (Init.Nat.mul (Init.Nat.pred (S n)) (Init.Nat.pred (S n))) (Init.Nat.mul (S n) (S n)) *) elim (lt_n_O 1). (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: forall (n : nat) (_ : forall _ : gt n (S O), lt n (Init.Nat.mul n n)) (_ : gt (S n) (S O)), lt (S n) (Init.Nat.mul (S n) (S n)) *) intros m IHm. (* Goal: not (@eq Z x y) *) intro. (* Goal: lt (S m) (Init.Nat.mul (S m) (S m)) *) unfold gt in H. (* Goal: lt (S m) (Init.Nat.mul (S m) (S m)) *) unfold lt in H. (* Goal: lt (S m) (Init.Nat.mul (S m) (S m)) *) elim (le_lt_or_eq 1 m). (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. (* Goal: lt (S m) (S (Init.Nat.add m (Init.Nat.mul m (S m)))) *) (* Goal: forall _ : @eq nat (S O) m, lt (S m) (Init.Nat.mul (S m) (S m)) *) (* Goal: le (S O) m *) apply lt_n_S. (* Goal: lt m (Init.Nat.add m (Init.Nat.mul m (S m))) *) (* Goal: forall _ : @eq nat (S O) m, lt (S m) (Init.Nat.mul (S m) (S m)) *) (* Goal: le (S O) m *) rewrite <- (mult_n_Sm m m). (* Goal: lt m (Init.Nat.add m (Init.Nat.add (Init.Nat.mul m m) m)) *) (* Goal: forall _ : @eq nat (S O) m, lt (S m) (Init.Nat.mul (S m) (S m)) *) (* Goal: le (S O) m *) rewrite plus_comm. (* Goal: lt m (Init.Nat.add (Init.Nat.mul m m) m) *) (* Goal: forall _ : @eq nat (S O) m, lt (S m) (Init.Nat.mul (S m) (S m)) *) (* Goal: le (S O) m *) apply lt_plus_trans. (* Goal: lt m (Init.Nat.add (Init.Nat.mul m m) m) *) (* Goal: forall _ : @eq nat (S O) m, lt (S m) (Init.Nat.mul (S m) (S m)) *) (* Goal: le (S O) m *) apply lt_plus_trans. (* Goal: lt m (Init.Nat.mul m m) *) (* Goal: forall _ : @eq nat (S O) m, lt (S m) (Init.Nat.mul (S m) (S m)) *) (* Goal: le (S O) m *) apply IHm. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: le x y *) rewrite <- H0. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. (* Goal: forall (a b c d : nat) (_ : lt a b) (_ : lt c d), lt (Init.Nat.mul a c) (Init.Nat.mul b d) *) unfold lt in |- *. (* Goal: le x (S (Init.Nat.add x n)) *) apply le_S. (* Goal: le (Init.Nat.mul a c) (Init.Nat.mul a c) *) apply le_n. (* Goal: le (Init.Nat.add b1 c) b1 *) (* Goal: @eq nat (Init.Nat.add b1 c) (Init.Nat.add b1 c) *) apply le_S_n. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. Qed. Lemma witness_le : forall x y : nat, (exists q : nat, x + q = y) -> x <= y. Proof. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. elim H. intro q. intros. (* Goal: le x y *) rewrite <- H0. (* Goal: le x (Init.Nat.add x q) *) elim q. (* Goal: le (Init.Nat.mul a c) (Init.Nat.mul a c) *) rewrite <- plus_n_O. apply le_n. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. rewrite <- plus_n_Sm. apply le_S. assumption. Qed. Lemma le_witness : forall x y : nat, x <= y -> exists q : nat, x + q = y. Proof. (* Goal: forall (x y : nat) (_ : le x y), @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) y) *) intros x y. (* Goal: not (@eq Z x y) *) intro. (* Goal: @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) y) *) elim H. (* Goal: @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) x) *) (* Goal: forall (m : nat) (_ : le x m) (_ : @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) m)), @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) (S m)) *) split with 0. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. symmetry in |- *. (* Goal: @eq nat x (Init.Nat.add x O) *) (* Goal: forall (m : nat) (_ : le x m) (_ : @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) m)), @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) (S m)) *) apply plus_n_O. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) (S m)) *) case H1. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: @ex nat (fun q : nat => and (@eq nat (Init.Nat.add x q) y) (le (S O) q)) *) (* Goal: le (S x) y *) split with (S x0). (* Goal: @eq nat (Init.Nat.add x (S x0)) (S m) *) replace (x + S x0) with (S (x + x0)). (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. (* Goal: @eq nat (S (Init.Nat.add x x0)) (S m) *) (* Goal: @eq nat (S (Init.Nat.add x x0)) (Init.Nat.add x (S x0)) *) rewrite H2. (* Goal: @eq Z Z0 Z0 *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) reflexivity. (* Goal: @eq nat (S (Init.Nat.add x x0)) (Init.Nat.add x (S x0)) *) apply plus_n_Sm. Qed. Lemma lt_witness : forall x y : nat, x < y -> exists q : nat, x + q = y /\ 0 < q. Proof. (* Goal: forall (a b c d : nat) (_ : lt a b) (_ : lt c d), lt (Init.Nat.mul a c) (Init.Nat.mul b d) *) unfold lt in |- *. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: @ex nat (fun q : nat => and (@eq nat (Init.Nat.add x q) y) (le (S O) q)) *) elim (le_witness (S x) y). (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: @ex nat (fun q : nat => and (@eq nat (Init.Nat.add x q) y) (le (S O) q)) *) (* Goal: le (S x) y *) split with (S x0). (* Goal: forall _ : @eq nat q (S O), and (@eq nat (S O) (S O)) (@eq nat q (S O)) *) (* Goal: forall (n q : nat) (_ : @eq nat (Init.Nat.mul (S (S n)) q) (S O)), and (@eq nat (S (S n)) (S O)) (@eq nat q (S O)) *) split. (* Goal: @eq nat (Init.Nat.add x (S x0)) y *) (* Goal: le (S O) (S x0) *) (* Goal: le (S x) y *) rewrite <- plus_n_Sm. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: le (S (Init.Nat.mul a c)) (S (Init.Nat.add c (Init.Nat.mul a (S c)))) *) (* Goal: le (Init.Nat.mul (S a) (S c)) (Init.Nat.mul b d) *) apply le_n_S. (* Goal: le O x0 *) (* Goal: le (S x) y *) apply le_O_n. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. Qed. Lemma le_le_mult : forall b a c d : nat, a <= b -> c <= d -> a * c <= b * d. Proof. (* Goal: forall (b : Z) (_ : @eq Z (Z.mul (Zneg p) b) Z0), or (@eq Z (Zneg p) Z0) (@eq Z b Z0) *) simple induction b. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: le (Init.Nat.mul a c) (Init.Nat.mul O d) *) (* Goal: forall (n : nat) (_ : forall (a c d : nat) (_ : le a n) (_ : le c d), le (Init.Nat.mul a c) (Init.Nat.mul n d)) (a c d : nat) (_ : le a (S n)) (_ : le c d), le (Init.Nat.mul a c) (Init.Nat.mul (S n) d) *) replace a with 0. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. (* Goal: le (Init.Nat.mul a c) (Init.Nat.mul a c) *) apply le_n. (* Goal: @eq nat O a *) (* Goal: forall (n : nat) (_ : forall (a c d : nat) (_ : le a n) (_ : le c d), le (Init.Nat.mul a c) (Init.Nat.mul n d)) (a c d : nat) (_ : le a (S n)) (_ : le c d), le (Init.Nat.mul a c) (Init.Nat.mul (S n) d) *) apply le_n_O_eq. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: forall (n : nat) (_ : forall (a c d : nat) (_ : le a n) (_ : le c d), le (Init.Nat.mul a c) (Init.Nat.mul n d)) (a c d : nat) (_ : le a (S n)) (_ : le c d), le (Init.Nat.mul a c) (Init.Nat.mul (S n) d) *) intros b1 IHb1. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: le (Init.Nat.mul a c) (Init.Nat.add d (Init.Nat.mul b1 d)) *) elim (le_lt_or_eq a (S b1)). (* Goal: forall (a b c d : nat) (_ : lt a b) (_ : lt c d), lt (Init.Nat.mul a c) (Init.Nat.mul b d) *) unfold lt in |- *. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: le (Init.Nat.mul a c) (Init.Nat.add d (Init.Nat.mul b1 d)) *) (* Goal: forall _ : @eq nat a (S b1), le (Init.Nat.mul a c) (Init.Nat.add d (Init.Nat.mul b1 d)) *) (* Goal: le a (S b1) *) rewrite (plus_comm d (b1 * d)). (* Goal: le (Init.Nat.mul a c) (Init.Nat.add (Init.Nat.mul a c) a) *) (* Goal: le (Init.Nat.mul (S a) (S c)) (Init.Nat.mul b d) *) apply le_plus_trans. (* Goal: le (Init.Nat.mul a c) (Init.Nat.mul b1 d) *) (* Goal: forall _ : @eq nat a (S b1), le (Init.Nat.mul a c) (Init.Nat.add d (Init.Nat.mul b1 d)) *) (* Goal: le a (S b1) *) apply IHb1. (* Goal: le (Init.Nat.add b1 c) b1 *) (* Goal: @eq nat (Init.Nat.add b1 c) (Init.Nat.add b1 c) *) apply le_S_n. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: not (@eq Z x y) *) intro. (* Goal: le (Init.Nat.mul a c) (Init.Nat.add d (Init.Nat.mul b1 d)) *) (* Goal: le a (S b1) *) rewrite H1. (* Goal: le (Init.Nat.mul (S b1) c) (Init.Nat.add d (Init.Nat.mul b1 d)) *) (* Goal: le a (S b1) *) replace (d + b1 * d) with (S b1 * d). (* Goal: le (Init.Nat.mul (S b1) c) (Init.Nat.mul (S b1) d) *) (* Goal: @eq nat (Init.Nat.mul (S b1) d) (Init.Nat.add d (Init.Nat.mul b1 d)) *) (* Goal: le a (S b1) *) apply le_mult_l. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: @eq Z Z0 Z0 *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) reflexivity. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. Qed. Lemma lt_lt_mult : forall a b c d : nat, a < b -> c < d -> a * c < b * d. Proof. (* Goal: forall (a b c d : nat) (_ : lt a b) (_ : lt c d), lt (Init.Nat.mul a c) (Init.Nat.mul b d) *) unfold lt in |- *. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: le (S (Init.Nat.mul a c)) (Init.Nat.mul b d) *) apply le_trans with (S a * S c). (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. (* Goal: le (S (Init.Nat.mul a c)) (S (Init.Nat.add c (Init.Nat.mul a (S c)))) *) (* Goal: le (Init.Nat.mul (S a) (S c)) (Init.Nat.mul b d) *) apply le_n_S. (* Goal: le (Init.Nat.mul a c) (Init.Nat.add c (Init.Nat.mul a (S c))) *) (* Goal: le (Init.Nat.mul (S a) (S c)) (Init.Nat.mul b d) *) rewrite <- (mult_n_Sm a c). (* Goal: le (Init.Nat.mul a c) (Init.Nat.add c (Init.Nat.add (Init.Nat.mul a c) a)) *) (* Goal: le (Init.Nat.mul (S a) (S c)) (Init.Nat.mul b d) *) rewrite (plus_comm c (a * c + a)). (* Goal: le (Init.Nat.mul a c) (Init.Nat.add (Init.Nat.mul a c) a) *) (* Goal: le (Init.Nat.mul (S a) (S c)) (Init.Nat.mul b d) *) apply le_plus_trans. (* Goal: le (Init.Nat.mul a c) (Init.Nat.add (Init.Nat.mul a c) a) *) (* Goal: le (Init.Nat.mul (S a) (S c)) (Init.Nat.mul b d) *) apply le_plus_trans. (* Goal: le (Init.Nat.mul a c) (Init.Nat.mul a c) *) apply le_n. (* Goal: le (Init.Nat.mul (S a) (S c)) (Init.Nat.mul b d) *) apply le_le_mult. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. Qed. Lemma lt_n_nm_m_gt_1 : forall a b : nat, a < a * b -> b > 1. Proof. (* Goal: forall (a b : Z) (_ : Z.le b a), Z.le Z0 (Z.sub a b) *) intros a b. case b. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) rewrite <- (mult_n_O a). intro. elim (lt_n_O a). assumption. (* Goal: forall (n : nat) (_ : lt a (Init.Nat.mul a (S n))), gt (S n) (S O) *) intro b1. case b1. (* Goal: forall _ : lt a (Init.Nat.mul a (S O)), gt (S O) (S O) *) (* Goal: forall (n : nat) (_ : lt a (Init.Nat.mul a (S (S n)))), gt (S (S n)) (S O) *) rewrite <- (mult_n_Sm a 0). (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) rewrite <- (mult_n_O a). simpl in |- *. intro. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) elim (lt_irrefl a). assumption. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. apply gt_n_S. apply gt_Sn_O. Qed. Lemma n0n1_or_gt : forall n : nat, n = 0 \/ n = 1 \/ n > 1. Proof. (* Goal: forall n : nat, or (@eq nat n O) (or (@eq nat n (S O)) (gt n (S O))) *) intro n. case n. (* Goal: @eq Z Z0 Z0 *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) left. reflexivity. (* Goal: forall n : nat, or (@eq nat (S n) O) (or (@eq nat (S n) (S O)) (gt (S n) (S O))) *) intro n1. case n1. (* Goal: @eq Z Z0 Z0 *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) right. left. reflexivity. (* Goal: forall n : nat, or (@eq nat (S (S n)) O) (or (@eq nat (S (S n)) (S O)) (gt (S (S n)) (S O))) *) intro n2. (* Goal: forall _ : @eq Z Z0 Z0, or (@eq Z (Zneg p) Z0) (@eq Z Z0 Z0) *) (* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zneg p) (Zpos p0)) Z0), or (@eq Z (Zneg p) Z0) (@eq Z (Zpos p0) Z0) *) (* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zneg p) (Zneg p0)) Z0), or (@eq Z (Zneg p) Z0) (@eq Z (Zneg p0) Z0) *) right. right. apply gt_n_S. apply gt_Sn_O. Qed. Lemma lt_multpred_pp : forall p : nat, p > 1 -> pred p * pred p < p * p. Proof. (* Goal: not (@eq Z x y) *) intro. (* Goal: forall (q : nat) (_ : @eq nat (Init.Nat.mul p q) (S O)), and (@eq nat p (S O)) (@eq nat q (S O)) *) case p. (* Goal: not (@eq Z x y) *) intro. (* Goal: lt (Init.Nat.mul (Init.Nat.pred O) (Init.Nat.pred O)) (Init.Nat.mul O O) *) (* Goal: forall (n : nat) (_ : gt (S n) (S O)), lt (Init.Nat.mul (Init.Nat.pred (S n)) (Init.Nat.pred (S n))) (Init.Nat.mul (S n) (S n)) *) elim (lt_n_O 1). (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: forall (n q : nat) (_ : @eq nat (Init.Nat.mul (S n) q) (S O)), and (@eq nat (S n) (S O)) (@eq nat q (S O)) *) intro p1. (* Goal: forall (q : nat) (_ : @eq nat (Init.Nat.mul (S p1) q) (S O)), and (@eq nat (S p1) (S O)) (@eq nat q (S O)) *) case p1. (* Goal: not (@eq Z x y) *) intro. (* Goal: lt (Init.Nat.mul (Init.Nat.pred (S O)) (Init.Nat.pred (S O))) (Init.Nat.mul (S O) (S O)) *) (* Goal: forall (n : nat) (_ : gt (S (S n)) (S O)), lt (Init.Nat.mul (Init.Nat.pred (S (S n))) (Init.Nat.pred (S (S n)))) (Init.Nat.mul (S (S n)) (S (S n))) *) elim (lt_irrefl 1). (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: forall (n q : nat) (_ : @eq nat (Init.Nat.mul (S (S n)) q) (S O)), and (@eq nat (S (S n)) (S O)) (@eq nat q (S O)) *) intro p2. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: lt (Init.Nat.mul (Init.Nat.pred (S (S p2))) (Init.Nat.pred (S (S p2)))) (Init.Nat.mul (S (S p2)) (S (S p2))) *) apply lt_lt_mult. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. apply lt_n_Sn. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. apply lt_n_Sn. Qed. Lemma le_diff0 : forall b a c : nat, a <= b -> a = b + c -> c = 0. Proof. (* Goal: forall (b : Z) (_ : @eq Z (Z.mul (Zneg p) b) Z0), or (@eq Z (Zneg p) Z0) (@eq Z b Z0) *) simple induction b. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. intro. (* Goal: forall (c : nat) (_ : le a O) (_ : @eq nat a c), @eq nat c O *) (* Goal: forall (n : nat) (_ : forall (a c : nat) (_ : le a n) (_ : @eq nat a (Init.Nat.add n c)), @eq nat c O) (a c : nat) (_ : le a (S n)) (_ : @eq nat a (Init.Nat.add (S n) c)), @eq nat c O *) case a. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: le (Init.Nat.mul a c) (Init.Nat.mul a b) *) rewrite H0. (* Goal: @eq Z Z0 Z0 *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) reflexivity. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: @eq nat c O *) (* Goal: forall (n : nat) (_ : forall (a c : nat) (_ : le a n) (_ : @eq nat a (Init.Nat.add n c)), @eq nat c O) (a c : nat) (_ : le a (S n)) (_ : @eq nat a (Init.Nat.add (S n) c)), @eq nat c O *) elim (lt_n_O n). (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: forall (n : nat) (_ : forall (a c : nat) (_ : le a n) (_ : @eq nat a (Init.Nat.add n c)), @eq nat c O) (a c : nat) (_ : le a (S n)) (_ : @eq nat a (Init.Nat.add (S n) c)), @eq nat c O *) intros b1 IH. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: False *) rewrite H0 in H. (* Goal: @eq nat c O *) apply (IH (b1 + c) c). (* Goal: le (Init.Nat.add b1 c) b1 *) (* Goal: @eq nat (Init.Nat.add b1 c) (Init.Nat.add b1 c) *) apply le_S_n. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: @eq Z Z0 Z0 *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) reflexivity. Qed. Lemma simpl_lt_mult_l : forall a b c : nat, a * b < a * c -> b < c. Proof. (* Goal: forall (a b : Z) (_ : @eq Z (Z.mul a b) Z0), or (@eq Z a Z0) (@eq Z b Z0) *) simple induction a. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: lt b c *) (* Goal: forall (n : nat) (_ : forall (b c : nat) (_ : lt (Init.Nat.mul n b) (Init.Nat.mul n c)), lt b c) (b c : nat) (_ : lt (Init.Nat.mul (S n) b) (Init.Nat.mul (S n) c)), lt b c *) elim (lt_irrefl 0). (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: forall (n : nat) (_ : forall (b c : nat) (_ : lt O n) (_ : le (Init.Nat.mul n b) (Init.Nat.mul n c)), le b c) (b c : nat) (_ : lt O (S n)) (_ : le (Init.Nat.mul (S n) b) (Init.Nat.mul (S n) c)), le b c *) intros a1 IH. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: le b c *) elim (le_or_lt b c). (* Goal: not (@eq Z x y) *) intro. (* Goal: lt b c *) (* Goal: forall _ : lt c b, lt b c *) elim (le_lt_or_eq b c). (* Goal: not (@eq Z x y) *) intro. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: lt b c *) (* Goal: le b c *) (* Goal: forall _ : lt c b, lt b c *) rewrite H1 in H. (* Goal: lt b c *) (* Goal: le b c *) (* Goal: forall _ : lt c b, lt b c *) elim (lt_irrefl (S a1 * c)). (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: lt b c *) cut (S a1 * c <= S a1 * b). (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: lt b c *) (* Goal: le (Init.Nat.mul (S a1) c) (Init.Nat.mul (S a1) b) *) elim (le_not_lt (S a1 * c) (S a1 * b)). (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: le (Init.Nat.mul (S a1) c) (Init.Nat.mul (S a1) b) *) apply lt_le_weak. (* Goal: lt (Init.Nat.mul (S a1) c) (Init.Nat.mul (S a1) b) *) (* Goal: le (Init.Nat.mul (S a1) b) (Init.Nat.mul (S a1) c) *) apply lt_mult_l. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. Qed. Lemma simpl_le_mult_l : forall a b c : nat, 0 < a -> a * b <= a * c -> b <= c. Proof. (* Goal: forall (a b : Z) (_ : @eq Z (Z.mul a b) Z0), or (@eq Z a Z0) (@eq Z b Z0) *) simple induction a. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: le b c *) (* Goal: forall (n : nat) (_ : forall (b c : nat) (_ : lt O n) (_ : le (Init.Nat.mul n b) (Init.Nat.mul n c)), le b c) (b c : nat) (_ : lt O (S n)) (_ : le (Init.Nat.mul (S n) b) (Init.Nat.mul (S n) c)), le b c *) elim (lt_n_O 0). (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: forall (n : nat) (_ : forall (b c : nat) (_ : lt O n) (_ : le (Init.Nat.mul n b) (Init.Nat.mul n c)), le b c) (b c : nat) (_ : lt O (S n)) (_ : le (Init.Nat.mul (S n) b) (Init.Nat.mul (S n) c)), le b c *) intros a1 IH. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. (* Goal: le b c *) simpl in H0. (* Goal: le b c *) elim (le_or_lt b c). (* Goal: not (@eq Z x y) *) intro. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: not (@eq Z x y) *) intro. (* Goal: le b c *) elim (lt_not_le (S a1 * c) (S a1 * b)). (* Goal: lt (Init.Nat.mul (S a1) c) (Init.Nat.mul (S a1) b) *) (* Goal: le (Init.Nat.mul (S a1) b) (Init.Nat.mul (S a1) c) *) apply lt_mult_l. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. Qed. Lemma simpl_eq_mult_l : forall a b c : nat, 0 < a -> a * b = a * c -> b = c. Proof. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. apply le_antisym. (* Goal: le (Init.Nat.mul a c) (Init.Nat.mul a c) *) apply simpl_le_mult_l with a. assumption. rewrite H0. apply le_n. (* Goal: le (Init.Nat.mul a c) (Init.Nat.mul a c) *) apply simpl_le_mult_l with a. assumption. rewrite H0. apply le_n. Qed. Lemma mult_ppq_p0q1 : forall p q : nat, p = p * q -> p = 0 \/ q = 1. Proof. (* Goal: @eq Z Z0 Z0 *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intro p. case p. left. reflexivity. (* Goal: forall _ : @eq Z Z0 Z0, or (@eq Z (Zneg p) Z0) (@eq Z Z0 Z0) *) (* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zneg p) (Zpos p0)) Z0), or (@eq Z (Zneg p) Z0) (@eq Z (Zpos p0) Z0) *) (* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zneg p) (Zneg p0)) Z0), or (@eq Z (Zneg p) Z0) (@eq Z (Zneg p0) Z0) *) intro p1. right. (* Goal: lt O (S p1) *) (* Goal: @eq nat (Init.Nat.mul (S p1) q) (Init.Nat.mul (S p1) (S O)) *) apply simpl_eq_mult_l with (S p1). apply lt_O_Sn. (* Goal: @eq nat (Init.Nat.mul (S p1) q) (Init.Nat.mul (S p1) (S O)) *) rewrite <- H. (* Goal: forall _ : @eq nat (Init.Nat.mul (S (S p2)) (S O)) (S O), and (@eq nat (S (S p2)) (S O)) (@eq nat (S O) (S O)) *) (* Goal: forall (n : nat) (_ : @eq nat (Init.Nat.mul (S (S p2)) (S (S n))) (S O)), and (@eq nat (S (S p2)) (S O)) (@eq nat (S (S n)) (S O)) *) rewrite <- mult_n_Sm. rewrite <- mult_n_O. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. reflexivity. Qed. Lemma mult_pq1_p1q1 : forall p q : nat, p * q = 1 -> p = 1 /\ q = 1. Proof. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intro p. case p. simpl in |- *. intros. discriminate H. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intro p1. case p1. simpl in |- *. (* Goal: @eq Z Z0 Z0 *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intro q. rewrite <- plus_n_O. split. reflexivity. assumption. (* Goal: forall (n q : nat) (_ : @eq nat (Init.Nat.mul (S (S n)) q) (S O)), and (@eq nat (S (S n)) (S O)) (@eq nat q (S O)) *) intro p2. (* Goal: not (@eq Z x y) *) intro q. case q. rewrite <- mult_n_O. intro. discriminate H. (* Goal: forall (n : nat) (_ : @eq nat (Init.Nat.mul (S (S p2)) (S n)) (S O)), and (@eq nat (S (S p2)) (S O)) (@eq nat (S n) (S O)) *) intro q1. case q1. (* Goal: forall _ : @eq nat (Init.Nat.mul (S (S p2)) (S O)) (S O), and (@eq nat (S (S p2)) (S O)) (@eq nat (S O) (S O)) *) (* Goal: forall (n : nat) (_ : @eq nat (Init.Nat.mul (S (S p2)) (S (S n))) (S O)), and (@eq nat (S (S p2)) (S O)) (@eq nat (S (S n)) (S O)) *) rewrite <- mult_n_Sm. (* Goal: forall _ : @eq nat (Init.Nat.add (Init.Nat.mul (S (S p2)) O) (S (S p2))) (S O), and (@eq nat (S (S p2)) (S O)) (@eq nat (S O) (S O)) *) (* Goal: forall (n : nat) (_ : @eq nat (Init.Nat.mul (S (S p2)) (S (S n))) (S O)), and (@eq nat (S (S p2)) (S O)) (@eq nat (S (S n)) (S O)) *) rewrite <- mult_n_O. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. intro. discriminate H. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intro q2. simpl in |- *. intro. discriminate H. Qed. Lemma Zmult_ab0a0b0 : forall a b : Z, (a * b)%Z = 0%Z -> a = 0%Z \/ b = 0%Z. Proof. (* Goal: forall (a b : Z) (_ : @eq Z (Z.mul a b) Z0), or (@eq Z a Z0) (@eq Z b Z0) *) simple induction a. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. left. reflexivity. (* Goal: forall (b : Z) (_ : @eq Z (Z.mul (Zneg p) b) Z0), or (@eq Z (Zneg p) Z0) (@eq Z b Z0) *) intro p. simple induction b. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. right. reflexivity. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. intros. discriminate H. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. intros. discriminate H. (* Goal: not (@eq Z x y) *) intro. simple induction b. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. right. reflexivity. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. intros. discriminate H. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. intros. discriminate H. Qed. Lemma Zle_minus : forall a b : Z, (b <= a)%Z -> (0 <= a - b)%Z. Proof. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros a b. intros. (* Goal: Z.le Z0 (Z.sub a b) *) apply Zplus_le_reg_l with b. (* Goal: Z.le (Z.add b Z0) (Z.add b (Z.sub a b)) *) unfold Zminus in |- *. rewrite (Zplus_comm a). (* Goal: Z.le (Z.add b Z0) (Z.add b (Z.add (Z.opp b) a)) *) rewrite (Zplus_assoc b (- b)). rewrite Zplus_opp_r. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) simpl in |- *. rewrite <- Zplus_0_r_reverse. assumption. Qed. Lemma Zopp_lt_gt_0 : forall x : Z, (x < 0)%Z -> (- x > 0)%Z. Proof. (* Goal: forall (x : Z) (_ : Z.lt x Z0), Z.gt (Z.opp x) Z0 *) simple induction x. (* Goal: not (@eq Z x y) *) intro. unfold Zlt in H. simpl in H. discriminate H. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. unfold Zlt in H. simpl in H. discriminate H. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. simpl in |- *. unfold Zgt in |- *. simpl in |- *. reflexivity. Qed. Lemma Zlt_neq : forall x y : Z, (x < y)%Z -> x <> y. Proof. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. intro. (* Goal: False *) rewrite H0 in H. (* Goal: False *) elim (Zlt_irrefl y). (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. Qed. Lemma Zgt_neq : forall x y : Z, (x > y)%Z -> x <> y. Proof. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. intro. (* Goal: False *) rewrite H0 in H. (* Goal: False *) elim (Zlt_irrefl y). (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) apply Zgt_lt. assumption. Qed. Lemma S_inj : forall n m : nat, S n = S m -> n = m. (* Goal: forall (n m : nat) (_ : @eq nat (S n) (S m)), @eq nat n m *) intros n m H; injection H; trivial. Qed. Lemma Zlt_mult_l : forall p q r : Z, (0 < r)%Z -> (p < q)%Z -> (r * p < r * q)%Z. Proof. (* Goal: forall (p q r : Z) (_ : Z.lt Z0 r) (_ : Z.le p q), Z.le (Z.mul r p) (Z.mul r q) *) simple induction r. (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. elim (Zlt_irrefl 0). assumption. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. unfold Zlt in |- *. (* Goal: not (@eq comparison (Z.compare (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q)) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) rewrite (Zcompare_mult_compat p0 p q). (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. unfold Zlt in H. simpl in H. discriminate H. Qed. Lemma Zle_mult_l : forall p q r : Z, (0 < r)%Z -> (p <= q)%Z -> (r * p <= r * q)%Z. Proof. (* Goal: forall (p q r : Z) (_ : Z.lt Z0 r) (_ : Z.le p q), Z.le (Z.mul r p) (Z.mul r q) *) simple induction r. (* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. simpl in |- *. apply Zeq_le. reflexivity. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. unfold Zle in |- *. (* Goal: not (@eq comparison (Z.compare (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q)) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) rewrite (Zcompare_mult_compat p0 p q). (* Goal: not (@eq comparison (Z.compare p q) Gt) *) (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) assumption. (* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *) intros. unfold Zlt in H. simpl in H. discriminate H. Qed.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) (** pock. Pocklington's criterion. @author Olga Caprotti and Martijn Oostdijk @version $Revision$ *) Require Import Arith. Require Import ZArith. Require Import lemmas. Require Import natZ. Require Import dec. Require Import list. Require Import exp. Require Import divides. Require Import prime. Require Import modulo. Require Import gcd. Require Import modprime. Require Import order. (** For all numbers q in natlist qlist: 1 is a linear combination of a^(m*qlist/qi) and n modulo n. *) Definition allLinCombMod (a : Z) (n m : nat) (qlist : natlist) := alllist nat (fun q : nat => LinCombMod 1 (Exp a (m * multDrop q qlist) - 1) (Z_of_nat n) n) qlist. Lemma allLinCombMod_ok : forall (a : Z) (n m : nat) (qlist : natlist), allLinCombMod a n m qlist <-> (forall qi : nat, inlist nat qi qlist -> LinCombMod 1 (Exp a (m * multDrop qi qlist) - 1) (Z_of_nat n) n). Proof. (* Goal: forall _ : Z.le Z0 n, ZPrime n *) (* Goal: Z.le Z0 n *) intros. elim (alllist_ok nat (fun q : nat => LinCombMod 1 (Exp a (m * multDrop q qlist) - 1) (Z_of_nat n) n) qlist). (* Goal: forall (_ : forall (_ : alllist nat (fun q : nat => LinCombMod (Zpos xH) (Z.sub (Exp a (Init.Nat.mul m (multDrop q qlist))) (Zpos xH)) (Z.of_nat n) n) qlist) (q : nat) (_ : inlist nat q qlist), LinCombMod (Zpos xH) (Z.sub (Exp a (Init.Nat.mul m (multDrop q qlist))) (Zpos xH)) (Z.of_nat n) n) (_ : forall _ : forall (q : nat) (_ : inlist nat q qlist), LinCombMod (Zpos xH) (Z.sub (Exp a (Init.Nat.mul m (multDrop q qlist))) (Zpos xH)) (Z.of_nat n) n, alllist nat (fun q : nat => LinCombMod (Zpos xH) (Z.sub (Exp a (Init.Nat.mul m (multDrop q qlist))) (Zpos xH)) (Z.of_nat n) n) qlist), iff (allLinCombMod a n m qlist) (forall (qi : nat) (_ : inlist nat qi qlist), LinCombMod (Zpos xH) (Z.sub (Exp a (Init.Nat.mul m (multDrop qi qlist))) (Zpos xH)) (Z.of_nat n) n) *) split. (* Goal: forall _ : Z.le Z0 n, ZPrime n *) (* Goal: Z.le Z0 n *) intros. apply H. assumption. assumption. (* Goal: forall _ : Z.le Z0 n, ZPrime n *) (* Goal: Z.le Z0 n *) intros. apply H0. assumption. Qed. (** Pocklington's theorem (finally). Proves Pocklington for natural numbers. *) Theorem pocklington : forall (n q m : nat) (a : Z) (qlist : natlist), n > 1 -> n = S (q * m) -> q = product qlist -> allPrime qlist -> Mod (Exp a (pred n)) 1 n -> allLinCombMod a n m qlist -> n <= q * q -> Prime n. Proof. (* Goal: forall _ : Z.le Z0 n, ZPrime n *) (* Goal: Z.le Z0 n *) intros. (* Goal: forall _ : Z.le Z0 n, ZPrime n *) (* Goal: Z.le Z0 n *) apply primepropdiv. assumption. intro p. intros. (* Goal: forall _ : Z.le Z0 n, ZPrime n *) (* Goal: Z.le Z0 n *) elim H6. intros. elim H7. intro pdn. intros. (* Goal: gt p O *) (* Goal: Mod a Z0 p *) (* Goal: gt (Init.Nat.pred n) O *) (* Goal: Mod (Exp a (Init.Nat.pred n)) (Zpos xH) p *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) unfold gt in |- *. apply le_lt_trans with (pred p * pred p). (* Goal: Z.gt n (Zpos xH) *) apply le_trans with (q * q). assumption. (* Goal: forall _ : Z.le Z0 n, ZPrime n *) (* Goal: Z.le Z0 n *) cut (q <= pred p). intros. (* Goal: Z.gt n (Zpos xH) *) apply le_le_mult. assumption. assumption. (* Goal: Z.gt n (Zpos xH) *) apply order_le_predp with (Exp a m). assumption. (* Goal: forall _ : Z.le Z0 n, ZPrime n *) (* Goal: Z.le Z0 n *) cut (Mod (Exp (Exp a m) q) 1 p). intros. (* Goal: forall _ : Z.le Z0 n, ZPrime n *) (* Goal: Z.le Z0 n *) elim (order_ex (Exp a m) p). intro r. intros. (* Goal: forall _ : Z.le Z0 n, ZPrime n *) (* Goal: Z.le Z0 n *) elim H12. intros. elim H14. intros. elim H16. intros. (* Goal: Order (Exp a m) q p *) (* Goal: Prime p *) (* Goal: not (Mod (Exp a m) Z0 p) *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) elim (le_lt_or_eq r q). intro. (* Goal: forall _ : Z.le Z0 n, ZPrime n *) (* Goal: Z.le Z0 n *) cut (Divides r q). intros. (* Goal: forall _ : Z.le Z0 n, ZPrime n *) (* Goal: Z.le Z0 n *) elim (techlemma3 qlist r q). intro qi. intros. (* Goal: forall _ : Z.le Z0 n, ZPrime n *) (* Goal: Z.le Z0 n *) elim H21. intros. elim H23. intro rdm. intros. (* Goal: Order (Exp a m) q p *) (* Goal: lt O r *) (* Goal: lt r q *) (* Goal: Divides r q *) (* Goal: @eq nat q (product qlist) *) (* Goal: allPrime qlist *) (* Goal: Divides r q *) (* Goal: forall _ : @eq nat r q, Order (Exp a m) q p *) (* Goal: le r q *) (* Goal: Prime p *) (* Goal: not (Mod (Exp a m) Z0 p) *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) elim (allLinCombMod_ok a n m qlist). (* Goal: forall (_ : forall (_ : allLinCombMod a n m qlist) (qi : nat) (_ : inlist nat qi qlist), LinCombMod (Zpos xH) (Z.sub (Exp a (Init.Nat.mul m (multDrop qi qlist))) (Zpos xH)) (Z.of_nat n) n) (_ : forall _ : forall (qi : nat) (_ : inlist nat qi qlist), LinCombMod (Zpos xH) (Z.sub (Exp a (Init.Nat.mul m (multDrop qi qlist))) (Zpos xH)) (Z.of_nat n) n, allLinCombMod a n m qlist), Order (Exp a m) q p *) (* Goal: lt O r *) (* Goal: lt r q *) (* Goal: Divides r q *) (* Goal: @eq nat q (product qlist) *) (* Goal: allPrime qlist *) (* Goal: Divides r q *) (* Goal: forall _ : @eq nat r q, Order (Exp a m) q p *) (* Goal: le r q *) (* Goal: Prime p *) (* Goal: not (Mod (Exp a m) Z0 p) *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) intros AH1 AH2. elim (AH1 H4 qi H22). (* Goal: forall _ : Z.le Z0 n, ZPrime n *) (* Goal: Z.le Z0 n *) intro alpha. intros. elim H25. intro beta. intros. (* Goal: Z.gt n (Zpos xH) *) elim (mod_0not1 p). assumption. (* Goal: Mod Z0 (Zpos xH) p *) (* Goal: lt O r *) (* Goal: lt r q *) (* Goal: Divides r q *) (* Goal: @eq nat q (product qlist) *) (* Goal: allPrime qlist *) (* Goal: Divides r q *) (* Goal: forall _ : @eq nat r q, Order (Exp a m) q p *) (* Goal: le r q *) (* Goal: Prime p *) (* Goal: not (Mod (Exp a m) Z0 p) *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) apply mod_trans with ((1 - 1) * alpha + Z_of_nat n * beta)%Z. (* Goal: Mod Z0 (Z.add (Z.mul (Z.sub (Zpos xH) (Zpos xH)) alpha) (Z.mul (Z.of_nat n) beta)) p *) (* Goal: Mod (Z.add (Z.mul (Z.sub (Zpos xH) (Zpos xH)) alpha) (Z.mul (Z.of_nat n) beta)) (Zpos xH) p *) (* Goal: lt O r *) (* Goal: lt r q *) (* Goal: Divides r q *) (* Goal: @eq nat q (product qlist) *) (* Goal: allPrime qlist *) (* Goal: Divides r q *) (* Goal: forall _ : @eq nat r q, Order (Exp a m) q p *) (* Goal: le r q *) (* Goal: Prime p *) (* Goal: not (Mod (Exp a m) Z0 p) *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) rewrite H10. simpl in |- *. (* Goal: ZLinCombMod (Zpos xH) (Z.sub (ZExp a (Z.of_nat (Init.Nat.mul (Z.abs_nat m) (multDrop q (map Z nat Z.abs_nat qlist))))) (Zpos xH)) n n *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat m)) m *) (* Goal: Z.ge n Z0 *) (* Goal: Z.ge m Z0 *) rewrite Znat.inj_mult. (* Goal: Mod Z0 (Z.mul (Z.mul (Z.of_nat p) (Z.of_nat pdn)) beta) p *) (* Goal: Mod (Z.add (Z.mul (Z.sub (Zpos xH) (Zpos xH)) alpha) (Z.mul (Z.of_nat n) beta)) (Zpos xH) p *) (* Goal: lt O r *) (* Goal: lt r q *) (* Goal: Divides r q *) (* Goal: @eq nat q (product qlist) *) (* Goal: allPrime qlist *) (* Goal: Divides r q *) (* Goal: forall _ : @eq nat r q, Order (Exp a m) q p *) (* Goal: le r q *) (* Goal: Prime p *) (* Goal: not (Mod (Exp a m) Z0 p) *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) rewrite Zmult_assoc_reverse. (* Goal: Mod Z0 (Exp a (Init.Nat.pred n)) p *) (* Goal: Mod (Exp a (Init.Nat.pred n)) (Zpos xH) p *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) apply mod_sym. (* Goal: Mod (Z.mul (Z.of_nat p) (Z.mul (Z.of_nat pdn) beta)) Z0 p *) (* Goal: Mod (Z.add (Z.mul (Z.sub (Zpos xH) (Zpos xH)) alpha) (Z.mul (Z.of_nat n) beta)) (Zpos xH) p *) (* Goal: lt O r *) (* Goal: lt r q *) (* Goal: Divides r q *) (* Goal: @eq nat q (product qlist) *) (* Goal: allPrime qlist *) (* Goal: Divides r q *) (* Goal: forall _ : @eq nat r q, Order (Exp a m) q p *) (* Goal: le r q *) (* Goal: Prime p *) (* Goal: not (Mod (Exp a m) Z0 p) *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) apply mod_nx_0_n. apply mod_trans with ((Exp a (m * multDrop qi qlist) - 1) * alpha + Z_of_nat n * beta)%Z. (* Goal: Mod (Z.add (Z.mul (Z.sub (Zpos xH) (Zpos xH)) alpha) (Z.mul (Z.of_nat n) beta)) (Z.add (Z.mul (Z.sub (Exp a (Init.Nat.mul m (multDrop qi qlist))) (Zpos xH)) alpha) (Z.mul (Z.of_nat n) beta)) p *) (* Goal: Mod (Z.add (Z.mul (Z.sub (Exp a (Init.Nat.mul m (multDrop qi qlist))) (Zpos xH)) alpha) (Z.mul (Z.of_nat n) beta)) (Zpos xH) p *) (* Goal: lt O r *) (* Goal: lt r q *) (* Goal: Divides r q *) (* Goal: @eq nat q (product qlist) *) (* Goal: allPrime qlist *) (* Goal: Divides r q *) (* Goal: forall _ : @eq nat r q, Order (Exp a m) q p *) (* Goal: le r q *) (* Goal: Prime p *) (* Goal: not (Mod (Exp a m) Z0 p) *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) apply mod_plus_compat. apply mod_mult_compat. apply mod_minus_compat. (* Goal: Mod (Zpos xH) (Exp a (Init.Nat.mul m (multDrop qi qlist))) p *) (* Goal: Mod (Zpos xH) (Zpos xH) p *) (* Goal: Mod alpha alpha p *) (* Goal: Mod (Z.mul (Z.of_nat n) beta) (Z.mul (Z.of_nat n) beta) p *) (* Goal: Mod (Z.add (Z.mul (Z.sub (Exp a (Init.Nat.mul m (multDrop qi qlist))) (Zpos xH)) alpha) (Z.mul (Z.of_nat n) beta)) (Zpos xH) p *) (* Goal: lt O r *) (* Goal: lt r q *) (* Goal: Divides r q *) (* Goal: @eq nat q (product qlist) *) (* Goal: allPrime qlist *) (* Goal: Divides r q *) (* Goal: forall _ : @eq nat r q, Order (Exp a m) q p *) (* Goal: le r q *) (* Goal: Prime p *) (* Goal: not (Mod (Exp a m) Z0 p) *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) rewrite H24. (* Goal: Mod (Zpos xH) (Exp a (Init.Nat.mul m (Init.Nat.mul r rdm))) p *) (* Goal: Mod (Zpos xH) (Zpos xH) p *) (* Goal: Mod alpha alpha p *) (* Goal: Mod (Z.mul (Z.of_nat n) beta) (Z.mul (Z.of_nat n) beta) p *) (* Goal: Mod (Z.add (Z.mul (Z.sub (Exp a (Init.Nat.mul m (multDrop qi qlist))) (Zpos xH)) alpha) (Z.mul (Z.of_nat n) beta)) (Zpos xH) p *) (* Goal: lt O r *) (* Goal: lt r q *) (* Goal: Divides r q *) (* Goal: @eq nat q (product qlist) *) (* Goal: allPrime qlist *) (* Goal: Divides r q *) (* Goal: forall _ : @eq nat r q, Order (Exp a m) q p *) (* Goal: le r q *) (* Goal: Prime p *) (* Goal: not (Mod (Exp a m) Z0 p) *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) rewrite mult_assoc. (* Goal: Mod Z0 (Exp a (Init.Nat.pred n)) p *) (* Goal: Mod (Exp a (Init.Nat.pred n)) (Zpos xH) p *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) apply mod_sym. (* Goal: Mod (Exp a (Nat.mul m q)) (Zpos xH) p *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) rewrite exp_mult. apply mod_exp1. rewrite exp_mult. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: Mod (ZExp a (Z.sub n (Zpos xH))) (ZExp a (Z.sub n (Zpos xH))) (Z.abs_nat n) *) (* Goal: Z.ge (Z.sub n (Zpos xH)) Z0 *) (* Goal: Z.lt Z0 n *) (* Goal: Mod (ZExp a (Z.sub n (Zpos xH))) (Zpos xH) (Z.abs_nat n) *) (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) apply mod_refl. apply mod_refl. apply mod_refl. (* Goal: Z.gt n (Zpos xH) *) apply mod_sym. apply modpq_modp with pdn. rewrite <- H10. assumption. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: Divides r q *) (* Goal: forall _ : @eq nat r q, Order (Exp a m) q p *) (* Goal: le r q *) (* Goal: Prime p *) (* Goal: not (Mod (Exp a m) Z0 p) *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) apply (order_div (Exp a m) r p H14 q). (* Goal: lt O q *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: forall _ : @eq nat r q, Order (Exp a m) q p *) (* Goal: le r q *) (* Goal: Prime p *) (* Goal: not (Mod (Exp a m) Z0 p) *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) apply lt_trans with r. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: Z.gt n (Zpos xH) *) intro. rewrite <- H19. assumption. (* Goal: le r q *) (* Goal: Prime p *) (* Goal: not (Mod (Exp a m) Z0 p) *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) apply H18. (* Goal: lt O q *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: Prime p *) (* Goal: not (Mod (Exp a m) Z0 p) *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) elim (le_lt_or_eq 0 q). (* Goal: Z.gt n (Zpos xH) *) intro. assumption. (* Goal: Z.gt n (Zpos xH) *) intro. rewrite <- H19 in H5. simpl in H5. elim (le_not_lt n 0). assumption. (* Goal: Z.gt n (Zpos xH) *) apply lt_trans with 1. apply lt_O_Sn. assumption. apply le_O_n. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: not (Mod (Exp a m) Z0 p) *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) apply mod_not_exp_0. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: Z.gt n (Zpos xH) *) intro. elim (mod_0not1 p). assumption. (* Goal: Mod Z0 (Zpos xH) p *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) apply mod_trans with (Exp a (pred n)). (* Goal: Mod Z0 (Exp a (Init.Nat.pred n)) p *) (* Goal: Mod (Exp a (Init.Nat.pred n)) (Zpos xH) p *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) apply mod_sym. (* Goal: Mod (Exp a (Init.Nat.pred n)) Z0 p *) (* Goal: Mod (Exp a (Init.Nat.pred n)) (Zpos xH) p *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) apply moda0_exp_compat. (* Goal: gt p O *) (* Goal: Mod a Z0 p *) (* Goal: gt (Init.Nat.pred n) O *) (* Goal: Mod (Exp a (Init.Nat.pred n)) (Zpos xH) p *) (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) unfold gt in |- *. apply lt_trans with 1. apply lt_O_Sn. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: Z.gt n (Zpos xH) *) apply gt_pred. assumption. (* Goal: Z.gt n (Zpos xH) *) rewrite H0. simpl in |- *. rewrite mult_comm. rewrite exp_mult. assumption. (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) rewrite H0 in H3. simpl in H3. rewrite <- H0 in H3. (* Goal: Mod (Exp (Exp a m) q) (Zpos xH) p *) (* Goal: lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *) apply modpq_modp with pdn. (* Goal: Z.gt n (Zpos xH) *) rewrite <- H10. rewrite <- exp_mult. rewrite mult_comm. assumption. (* Goal: Z.gt n (Zpos xH) *) apply lt_multpred_pp. assumption. Qed. (** Below is an attempt to restate Pocklington's theorem using only numbers from Z. This will make concrete computations faster. *) (** ZallLinCombMod is equivalent to AllLinCombMod but uses Z. *) Definition ZallLinCombMod (a n m N : Z) (qlist : Zlist) := alllist Z (fun q : Z => ZLinCombMod 1 (ZExp a (m * zmultDrop q qlist) - 1) n N) qlist. Lemma ZallLinCombMod_ok : forall (a n m N : Z) (qlist : Zlist), ZallLinCombMod a n m N qlist -> forall qi : Z, inlist Z qi qlist -> ZLinCombMod 1 (ZExp a (m * zmultDrop qi qlist) - 1) n N. Proof. (* Goal: forall _ : Z.le Z0 n, ZPrime n *) (* Goal: Z.le Z0 n *) intros. elim (alllist_ok Z (fun q : Z => ZLinCombMod 1 (ZExp a (m * zmultDrop q qlist) - 1) n N) qlist). (* Goal: forall _ : Z.le Z0 n, ZPrime n *) (* Goal: Z.le Z0 n *) intros. apply H1. assumption. assumption. Qed. Lemma alllincombzalllincomb : forall (a n m : Z) (qlist : Zlist), (0 <= n)%Z -> (0 <= m)%Z -> allPos qlist -> ZallLinCombMod a n m n qlist -> allLinCombMod a (Zabs_nat n) (Zabs_nat m) (map _ _ Zabs_nat qlist). Proof. (* Goal: forall _ : Z.le Z0 n, ZPrime n *) (* Goal: Z.le Z0 n *) intros. (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) unfold ZallLinCombMod in H. elim (alllist_ok Z (fun q : Z => ZLinCombMod 1 (ZExp a (m * zmultDrop q qlist) - 1) n n) qlist). (* Goal: forall _ : Z.le Z0 n, ZPrime n *) (* Goal: Z.le Z0 n *) intros. elim (alllist_ok nat (fun q0 : nat => LinCombMod 1 (Exp a (Zabs_nat m * multDrop q0 (map _ _ Zabs_nat qlist)) - 1) (Z_of_nat (Zabs_nat n)) (Zabs_nat n)) (map _ _ Zabs_nat qlist)). (* Goal: forall _ : Z.le Z0 n, ZPrime n *) (* Goal: Z.le Z0 n *) intros. (* Goal: forall _ : Z.le Z0 n, ZPrime n *) (* Goal: Z.le Z0 n *) apply H6. intros. (* Goal: Mod (Exp a (Init.Nat.pred (Z.abs_nat n))) (ZExp a (Z.sub n (Zpos xH))) (Z.abs_nat n) *) (* Goal: Mod (ZExp a (Z.sub n (Zpos xH))) (Zpos xH) (Z.abs_nat n) *) (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) rewrite <- inj_zexp. (* Goal: ZLinCombMod (Zpos xH) (Z.sub (ZExp a (Z.of_nat (Init.Nat.mul (Z.abs_nat m) (multDrop q (map Z nat Z.abs_nat qlist))))) (Zpos xH)) n n *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat m)) m *) (* Goal: Z.ge n Z0 *) (* Goal: Z.ge m Z0 *) rewrite Znat.inj_mult. (* Goal: Mod (ZExp a (Z.of_nat (Z.abs_nat (Z.sub n (Zpos xH))))) (ZExp a (Z.sub n (Zpos xH))) (Z.abs_nat n) *) (* Goal: Z.lt Z0 n *) (* Goal: Mod (ZExp a (Z.sub n (Zpos xH))) (Zpos xH) (Z.abs_nat n) *) (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) rewrite inj_abs_pos. (* Goal: Mod (ZExp a (Z.of_nat (Z.abs_nat (Z.sub n (Zpos xH))))) (ZExp a (Z.sub n (Zpos xH))) (Z.abs_nat n) *) (* Goal: Z.lt Z0 n *) (* Goal: Mod (ZExp a (Z.sub n (Zpos xH))) (Zpos xH) (Z.abs_nat n) *) (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) rewrite inj_abs_pos. (* Goal: LinCombMod (Zpos xH) (Z.sub (ZExp a (Z.mul m (Z.of_nat (multDrop q (map Z nat Z.abs_nat qlist))))) (Zpos xH)) n (Z.abs_nat n) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.ge m Z0 *) replace m with (Z_of_nat (Zabs_nat m)). (* Goal: LinCombMod (Zpos xH) (Z.sub (ZExp a (Z.mul (Z.of_nat (Z.abs_nat m)) (Z.of_nat (multDrop q (map Z nat Z.abs_nat qlist))))) (Zpos xH)) n (Z.abs_nat n) *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat m)) m *) (* Goal: Z.ge n Z0 *) (* Goal: Z.ge m Z0 *) rewrite <- Znat.inj_mult. (* Goal: LinCombMod (Zpos xH) (Z.sub (ZExp a (Z.of_nat (Init.Nat.mul (Z.abs_nat m) (multDrop q (map Z nat Z.abs_nat qlist))))) (Zpos xH)) n (Z.abs_nat n) *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat m)) m *) (* Goal: Z.ge n Z0 *) (* Goal: Z.ge m Z0 *) apply zlincombmodlincombmod. (* Goal: ZLinCombMod (Zpos xH) (Z.sub (ZExp a (Z.of_nat (Init.Nat.mul (Z.abs_nat m) (multDrop q (map Z nat Z.abs_nat qlist))))) (Zpos xH)) n n *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat m)) m *) (* Goal: Z.ge n Z0 *) (* Goal: Z.ge m Z0 *) rewrite Znat.inj_mult. rewrite inj_abs_pos. (* Goal: ZLinCombMod (Zpos xH) (Z.sub (ZExp a (Z.mul m (Z.of_nat (multDrop q (map Z nat Z.abs_nat qlist))))) (Zpos xH)) n n *) (* Goal: Z.ge m Z0 *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat m)) m *) (* Goal: Z.ge n Z0 *) (* Goal: Z.ge m Z0 *) rewrite multdropzmultdrop. (* Goal: ZLinCombMod (Zpos xH) (Z.sub (ZExp a (Z.mul m (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat (map Z nat Z.abs_nat qlist))))) (Zpos xH)) n n *) (* Goal: Z.ge m Z0 *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat m)) m *) (* Goal: Z.ge n Z0 *) (* Goal: Z.ge m Z0 *) rewrite inj_abs_pos_list. (* Goal: ZLinCombMod (Zpos xH) (Z.sub (ZExp a (Z.mul m (zmultDrop (Z.of_nat q) qlist))) (Zpos xH)) n n *) (* Goal: allPos qlist *) (* Goal: Z.ge m Z0 *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat m)) m *) (* Goal: Z.ge n Z0 *) (* Goal: Z.ge m Z0 *) apply H3. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: inlist Z (Z.of_nat q) qlist *) (* Goal: allPos qlist *) (* Goal: Z.ge m Z0 *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat m)) m *) (* Goal: Z.ge n Z0 *) (* Goal: Z.ge m Z0 *) apply inlist_inj_abs_pos_list. (* Goal: Z.gt n (Zpos xH) *) assumption. assumption. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: Z.gt n (Zpos xH) *) apply Zle_ge. assumption. (* Goal: @eq Z (Z.of_nat (Z.abs_nat m)) m *) (* Goal: Z.ge n Z0 *) (* Goal: Z.ge m Z0 *) apply inj_abs_pos. (* Goal: Z.gt n (Zpos xH) *) apply Zle_ge. assumption. (* Goal: Z.gt n (Zpos xH) *) apply Zle_ge. assumption. (* Goal: Z.gt n (Zpos xH) *) apply Zle_ge. assumption. Qed. (** Zpocklington is equivalent to pocklington but only uses numbers in Z. *) Theorem Zpocklington : forall (n q m a : Z) (qlist : Zlist), (n > 1)%Z -> (0 <= q)%Z -> (0 <= m)%Z -> n = (q * m + 1)%Z -> q = zproduct qlist -> allZPrime qlist -> ZMod (ZExp a (n - 1)) 1 n -> ZallLinCombMod a n m n qlist -> (n <= q * q)%Z -> ZPrime n. Proof. (* Goal: forall _ : Z.le Z0 n, ZPrime n *) (* Goal: Z.le Z0 n *) intros. cut (0 <= n)%Z. intros. (* Goal: ZPrime n *) (* Goal: Z.le Z0 n *) rewrite <- (inj_abs_pos n). apply primezprime. apply (pocklington (Zabs_nat n) (Zabs_nat q) (Zabs_nat m) a (map _ _ Zabs_nat qlist)). (* Goal: Z.gt n (Zpos xH) *) change (Zabs_nat n > Zabs_nat 1) in |- *. apply gtzgt. assumption. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) (* Goal: Z.le (Zpos xH) n *) unfold Zle in |- *. simpl in |- *. discriminate. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: @eq nat (Z.abs_nat n) (S (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat m))) *) (* Goal: @eq nat (Z.abs_nat q) (product (map Z nat Z.abs_nat qlist)) *) (* Goal: allPrime (map Z nat Z.abs_nat qlist) *) (* Goal: Mod (Exp a (Init.Nat.pred (Z.abs_nat n))) (Zpos xH) (Z.abs_nat n) *) (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) rewrite H2. rewrite abs_plus_pos. rewrite abs_mult. rewrite plus_comm. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) (* Goal: Z.le (Zpos xH) n *) simpl in |- *. reflexivity. (* Goal: Z.le Z0 (Z.mul q q) *) (* Goal: Z.le n (Z.mul q q) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) apply isnat_mult. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) (* Goal: Z.le (Zpos xH) n *) unfold Zle in |- *. simpl in |- *. discriminate. (* Goal: @eq nat (Z.abs_nat q) (product (map Z nat Z.abs_nat qlist)) *) (* Goal: allPrime (map Z nat Z.abs_nat qlist) *) (* Goal: Mod (Exp a (Init.Nat.pred (Z.abs_nat n))) (Zpos xH) (Z.abs_nat n) *) (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) rewrite H3. (* Goal: @eq nat (Z.abs_nat (zproduct qlist)) (product (map Z nat Z.abs_nat qlist)) *) (* Goal: allPrime (map Z nat Z.abs_nat qlist) *) (* Goal: Mod (Exp a (Init.Nat.pred (Z.abs_nat n))) (Zpos xH) (Z.abs_nat n) *) (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) apply zproductproduct. (* Goal: Z.gt n (Zpos xH) *) apply allzprimeallprime. assumption. (* Goal: Mod (Exp a (Init.Nat.pred (Z.abs_nat n))) (Zpos xH) (Z.abs_nat n) *) (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) apply mod_trans with (ZExp a (n - 1)). (* Goal: Mod (Exp a (Init.Nat.pred (Z.abs_nat n))) (ZExp a (Z.sub n (Zpos xH))) (Z.abs_nat n) *) (* Goal: Mod (ZExp a (Z.sub n (Zpos xH))) (Zpos xH) (Z.abs_nat n) *) (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) rewrite <- inj_zexp. (* Goal: Mod (ZExp a (Z.of_nat (Init.Nat.pred (Z.abs_nat n)))) (ZExp a (Z.sub n (Zpos xH))) (Z.abs_nat n) *) (* Goal: Mod (ZExp a (Z.sub n (Zpos xH))) (Zpos xH) (Z.abs_nat n) *) (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) rewrite abs_pred_pos. (* Goal: Mod (ZExp a (Z.of_nat (Z.abs_nat (Z.sub n (Zpos xH))))) (ZExp a (Z.sub n (Zpos xH))) (Z.abs_nat n) *) (* Goal: Z.lt Z0 n *) (* Goal: Mod (ZExp a (Z.sub n (Zpos xH))) (Zpos xH) (Z.abs_nat n) *) (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) rewrite inj_abs_pos. (* Goal: Mod (ZExp a (Z.sub n (Zpos xH))) (ZExp a (Z.sub n (Zpos xH))) (Z.abs_nat n) *) (* Goal: Z.ge (Z.sub n (Zpos xH)) Z0 *) (* Goal: Z.lt Z0 n *) (* Goal: Mod (ZExp a (Z.sub n (Zpos xH))) (Zpos xH) (Z.abs_nat n) *) (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) apply mod_refl. (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) apply Zle_ge. (* Goal: Z.le Z0 (Z.sub n (Zpos xH)) *) (* Goal: Z.lt Z0 n *) (* Goal: Mod (ZExp a (Z.sub n (Zpos xH))) (Zpos xH) (Z.abs_nat n) *) (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) unfold Zminus in |- *. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) (* Goal: Z.le (Zpos xH) n *) simpl in |- *. (* Goal: Z.le Z0 (Z.add n (Zneg xH)) *) (* Goal: Z.lt Z0 n *) (* Goal: Mod (ZExp a (Z.sub n (Zpos xH))) (Zpos xH) (Z.abs_nat n) *) (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) change (0 <= 0 + n + -1)%Z in |- *. (* Goal: Z.le Z0 (Z.add (Z.add Z0 n) (Zneg xH)) *) (* Goal: Z.lt Z0 n *) (* Goal: Mod (ZExp a (Z.sub n (Zpos xH))) (Zpos xH) (Z.abs_nat n) *) (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) rewrite (Zplus_assoc_reverse 0). (* Goal: Z.le Z0 (Z.add Z0 (Z.add n (Zneg xH))) *) (* Goal: Z.lt Z0 n *) (* Goal: Mod (ZExp a (Z.sub n (Zpos xH))) (Zpos xH) (Z.abs_nat n) *) (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) rewrite Zplus_comm. (* Goal: Z.le Z0 (Z.add (Z.add n (Zneg xH)) Z0) *) (* Goal: Z.lt Z0 n *) (* Goal: Mod (ZExp a (Z.sub n (Zpos xH))) (Zpos xH) (Z.abs_nat n) *) (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) apply (Zlt_left 0 n). (* Goal: Z.lt Z0 n *) (* Goal: Mod (ZExp a (Z.sub n (Zpos xH))) (Zpos xH) (Z.abs_nat n) *) (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) apply Zlt_trans with 1%Z. (* Goal: Z.lt Z0 (Zpos xH) *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Mod (ZExp a (Z.sub n (Zpos xH))) (Zpos xH) (Z.abs_nat n) *) (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) unfold Zlt in |- *. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) (* Goal: Z.le (Zpos xH) n *) simpl in |- *. (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Mod (ZExp a (Z.sub n (Zpos xH))) (Zpos xH) (Z.abs_nat n) *) (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) reflexivity. (* Goal: Z.lt (Zpos xH) n *) apply Zgt_lt. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: Z.lt Z0 n *) (* Goal: Mod (ZExp a (Z.sub n (Zpos xH))) (Zpos xH) (Z.abs_nat n) *) (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) apply Zlt_trans with 1%Z. (* Goal: Z.lt Z0 (Zpos xH) *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Mod (ZExp a (Z.sub n (Zpos xH))) (Zpos xH) (Z.abs_nat n) *) (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) unfold Zlt in |- *. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) (* Goal: Z.le (Zpos xH) n *) simpl in |- *. (* Goal: @eq comparison Lt Lt *) (* Goal: Z.lt (Zpos xH) n *) (* Goal: Mod (ZExp a (Z.sub n (Zpos xH))) (Zpos xH) (Z.abs_nat n) *) (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) reflexivity. (* Goal: Z.lt (Zpos xH) n *) apply Zgt_lt. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: Mod (ZExp a (Z.sub n (Zpos xH))) (Zpos xH) (Z.abs_nat n) *) (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) apply zmodmod. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: allLinCombMod a (Z.abs_nat n) (Z.abs_nat m) (map Z nat Z.abs_nat qlist) *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) apply alllincombzalllincomb. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: allPos qlist *) (* Goal: ZallLinCombMod a n m n qlist *) (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) apply allzprimeallpos. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: le (Z.abs_nat n) (Init.Nat.mul (Z.abs_nat q) (Z.abs_nat q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) rewrite <- abs_mult. (* Goal: le (Z.abs_nat n) (Z.abs_nat (Z.mul q q)) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) apply lezle. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: Z.le Z0 (Z.mul q q) *) (* Goal: Z.le n (Z.mul q q) *) (* Goal: Z.ge n Z0 *) (* Goal: Z.le Z0 n *) apply isnat_mult. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: Z.gt n (Zpos xH) *) apply Zle_ge. assumption. (* Goal: Z.le Z0 n *) apply Zle_trans with 1%Z. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) (* Goal: Z.le (Zpos xH) n *) unfold Zle in |- *. simpl in |- *. discriminate. (* Goal: Z.gt n (Zpos xH) *) apply Zlt_le_weak. apply Zgt_lt. assumption. Qed.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) (** prime. The primality predicate. @author Olga Caprotti and Martijn Oostdijk @version $Revision$ *) Require Import ZArith. Require Import Wf_nat. Require Import lemmas. Require Import natZ. Require Import dec. Require Import divides. Require Import modulo. Require Import list. (** * Primality on nat *) Definition Prime (n : nat) : Prop := n > 1 /\ (forall q : nat, Divides q n -> q = 1 \/ q = n). (** Prime with bounded all quantifier. *) Definition bPrime (n : nat) := n > 1 /\ (forall q : nat, q < S n -> Divides q n -> q = 1 \/ q = n). Lemma primebprime : forall n : nat, Prime n <-> bPrime n. Proof. (* Goal: forall n : nat, iff (Prime n) (bPrime n) *) unfold Prime, bPrime in |- *. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) split. (* Goal: forall _ : True, True *) (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : alllist Z ZPrime (Cons Z a l)), alllist nat Prime (map Z nat Z.abs_nat (Cons Z a l)) *) intro. elim H. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) split. (* Goal: alllist Z ZPrime t *) assumption. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) intros. (* Goal: False *) apply H1. (* Goal: alllist Z ZPrime t *) assumption. (* Goal: forall _ : True, True *) (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : alllist Z ZPrime (Cons Z a l)), alllist nat Prime (map Z nat Z.abs_nat (Cons Z a l)) *) intro. elim H. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) split. (* Goal: alllist Z ZPrime t *) assumption. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) intros. (* Goal: False *) apply H1. (* Goal: lt x N *) (* Goal: gt x (S O) *) (* Goal: not (Prime x) *) (* Goal: gt N (S O) *) (* Goal: not (Prime N) *) unfold lt in |- *. (* Goal: le (S q) (S n) *) (* Goal: Divides q n *) apply le_n_S. (* Goal: le q n *) (* Goal: Divides q n *) apply div_le. (* Goal: alllist Z ZPrime t *) apply lt_trans with 1. apply lt_O_Sn. assumption. (* Goal: alllist Z ZPrime t *) assumption. (* Goal: alllist Z ZPrime t *) assumption. Qed. (** Prime is decidable. *) Lemma bprimedec : forall n : nat, bPrime n \/ ~ bPrime n. Proof. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) unfold bPrime in |- *. intros. (* Goal: or (and (lt (S O) n0) (Divides n0 (S (S n2)))) (not (and (lt (S O) n0) (Divides n0 (S (S n2))))) *) apply anddec. (* Goal: or (gt n (S O)) (not (gt n (S O))) *) (* Goal: or (forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)) (not (forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n))) *) apply gtdec. (* Goal: or (forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)) (not (forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n))) *) apply (alldec (fun q : nat => Divides q n -> q = 1 \/ q = n) (S n)). (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) intros. (* Goal: or (forall _ : Divides n0 n, or (@eq nat n0 (S O)) (@eq nat n0 n)) (not (forall _ : Divides n0 n, or (@eq nat n0 (S O)) (@eq nat n0 n))) *) apply impdec. (* Goal: or (Divides n0 (S (S n2))) (not (Divides n0 (S (S n2)))) *) apply divdec. (* Goal: or (or (@eq nat n0 (S O)) (@eq nat n0 n)) (not (or (@eq nat n0 (S O)) (@eq nat n0 n))) *) apply ordec. (* Goal: or (@eq nat n0 n) (not (@eq nat n0 n)) *) apply eqdec. (* Goal: or (@eq nat n0 n) (not (@eq nat n0 n)) *) apply eqdec. Qed. Lemma primedec : forall n : nat, Prime n \/ ~ Prime n. Proof. (* Goal: forall _ : True, True *) (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : alllist Z ZPrime (Cons Z a l)), alllist nat Prime (map Z nat Z.abs_nat (Cons Z a l)) *) intro. elim (primebprime n). (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) intros. elim (bprimedec n). (* Goal: forall _ : @eq Z (Z.of_nat q) (Zpos xH), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: forall _ : @eq Z (Z.of_nat q) n, or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: Z.ge (Z.of_nat q) Z0 *) (* Goal: ZDivides (Z.of_nat q) n *) left. apply (H0 H1). (* Goal: forall _ : True, True *) (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : alllist Z ZPrime (Cons Z a l)), alllist nat Prime (map Z nat Z.abs_nat (Cons Z a l)) *) right. intro. apply H1. apply (H H2). Qed. (** Non-primes n>1 have non-trivial divisors. *) Lemma nonprime_witness : forall n : nat, n > 1 -> ~ Prime n -> exists d : nat, 1 < d /\ d < n /\ Divides d n. Proof. (* Goal: forall (n : nat) (_ : gt n (S O)) (_ : not (Prime n)), @ex nat (fun d : nat => and (lt (S O) d) (and (lt d n) (Divides d n))) *) intro n. case n. (* Goal: forall _ : True, True *) (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : alllist Z ZPrime (Cons Z a l)), alllist nat Prime (map Z nat Z.abs_nat (Cons Z a l)) *) intro. elim (lt_n_O 1). assumption. (* Goal: forall _ : True, True *) (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : alllist Z ZPrime (Cons Z a l)), alllist nat Prime (map Z nat Z.abs_nat (Cons Z a l)) *) intro n1. case n1. intro. elim (lt_irrefl 1). assumption. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) intro n2. intros. elim (decDeMorgan (S (S n2)) (fun d : nat => 1 < d /\ Divides d (S (S n2)))). (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) intros. elim H2. intros. (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) (* Goal: forall _ : not (Prime x), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) (* Goal: gt N (S O) *) (* Goal: not (Prime N) *) split with x. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) elim H3. intros. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) elim H5. intros. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) split. (* Goal: alllist Z ZPrime t *) assumption. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) split. (* Goal: alllist Z ZPrime t *) assumption. (* Goal: alllist Z ZPrime t *) assumption. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) intro. apply H0. unfold Prime in |- *. split. assumption. (* Goal: forall (q : nat) (_ : Prime q) (_ : Divides q (S (S O))), gt (Init.Nat.mul q q) (S (S O)) *) intro q. case q. (* Goal: forall _ : True, True *) (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : alllist Z ZPrime (Cons Z a l)), alllist nat Prime (map Z nat Z.abs_nat (Cons Z a l)) *) intro. unfold Divides in H4. elim H4. simpl in |- *. intros. discriminate H5. (* Goal: forall _ : @eq Z (Z.of_nat q) (Zpos xH), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: forall _ : @eq Z (Z.of_nat q) n, or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: Z.ge (Z.of_nat q) Z0 *) (* Goal: ZDivides (Z.of_nat q) n *) intro q1. case q1. left. reflexivity. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) intro q2. intros. right. (* Goal: @eq nat (S (S q2)) (S (S n2)) *) (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) elim (le_lt_or_eq (S (S q2)) (S (S n2))). (* Goal: alllist Z ZPrime t *) intros. elim (H3 (S (S q2))). assumption. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) split. apply lt_n_S. apply lt_O_Sn. assumption. (* Goal: alllist Z ZPrime t *) intros. assumption. (* Goal: alllist Z ZPrime t *) apply div_le1. assumption. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) intros. apply anddec. apply ltdec. apply divdec. Qed. Lemma nonprime_sqrwitness : forall n : nat, n > 1 -> ~ Prime n -> exists d : nat, 1 < d /\ d * d <= n /\ Divides d n. Proof. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) intros. elim (nonprime_witness n). (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) intro d. intros. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) elim (sqrdivbound n d). intro d'. intros. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) elim H2. intros. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) elim H4. intros. (* Goal: Prime n *) (* Goal: gt n (S O) *) (* Goal: not (Prime n) *) elim H6. (* Goal: forall _ : True, True *) (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : alllist Z ZPrime (Cons Z a l)), alllist nat Prime (map Z nat Z.abs_nat (Cons Z a l)) *) intro. split with d'. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) split. rewrite H7. elim H1. tauto. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) split. assumption. (* Goal: lt d (Init.Nat.mul d d') *) (* Goal: and (le (Init.Nat.mul d' d') n) (Divides d' n) *) (* Goal: Divides d n *) (* Goal: gt n (S O) *) (* Goal: not (Prime n) *) rewrite H7. elim H1. tauto. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) intro. split with d'. split. apply (lt_n_nm_m_gt_1 d d'). (* Goal: lt d (Init.Nat.mul d d') *) (* Goal: and (le (Init.Nat.mul d' d') n) (Divides d' n) *) (* Goal: Divides d n *) (* Goal: gt n (S O) *) (* Goal: not (Prime n) *) rewrite H7. elim H1. tauto. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) split. assumption. (* Goal: alllist Z ZPrime t *) assumption. (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) (* Goal: gt N (S O) *) (* Goal: not (Prime N) *) elim H1. tauto. (* Goal: alllist Z ZPrime t *) assumption. (* Goal: alllist Z ZPrime t *) assumption. Qed. (** Non-primes n>1 have prime-divisors. *) Theorem nonprime_primewitness : forall n : nat, n > 1 -> ~ Prime n -> exists d : nat, 1 < d /\ d * d <= n /\ Divides d n /\ Prime d. Proof. (* Goal: forall _ : True, True *) (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : alllist Z ZPrime (Cons Z a l)), alllist nat Prime (map Z nat Z.abs_nat (Cons Z a l)) *) intro. apply (lt_wf_ind n). (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) intros N IH. intros. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) elim (nonprime_sqrwitness N). intro x. intros. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) elim H1. intros. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) elim H3. intros. (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) (* Goal: gt N (S O) *) (* Goal: not (Prime N) *) elim (primedec x). (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) intros. (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) (* Goal: forall _ : not (Prime x), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) (* Goal: gt N (S O) *) (* Goal: not (Prime N) *) split with x. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) split. assumption. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) split. assumption. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) split. assumption. (* Goal: alllist Z ZPrime t *) assumption. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) intros. elim (IH x). intros. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) elim H7. intros. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) elim H9. intros. (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) (* Goal: lt x N *) (* Goal: gt x (S O) *) (* Goal: not (Prime x) *) (* Goal: gt N (S O) *) (* Goal: not (Prime N) *) elim H11. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) intros. (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) (* Goal: lt x N *) (* Goal: gt x (S O) *) (* Goal: not (Prime x) *) (* Goal: gt N (S O) *) (* Goal: not (Prime N) *) split with x0. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) split. assumption. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) split. apply le_trans with (x * x). (* Goal: alllist Z ZPrime t *) apply le_trans with x. assumption. apply le_n_nn. assumption. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) split. apply div_trans with x. assumption. assumption. (* Goal: alllist Z ZPrime t *) assumption. (* Goal: lt x N *) (* Goal: gt x (S O) *) (* Goal: not (Prime x) *) (* Goal: gt N (S O) *) (* Goal: not (Prime N) *) unfold lt in |- *. apply le_trans with (x * x). (* Goal: alllist Z ZPrime t *) change (x < x * x) in |- *. apply sqr_ascend. assumption. (* Goal: alllist Z ZPrime t *) assumption. assumption. assumption. assumption. assumption. Qed. (** Prime(n) if all prime divisors > sqrt(n). *) Theorem primepropdiv : forall n : nat, n > 1 -> (forall q : nat, Prime q -> Divides q n -> q * q > n) -> Prime n. Proof. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) intros. elim (primedec n). (* Goal: forall _ : True, True *) (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : alllist Z ZPrime (Cons Z a l)), alllist nat Prime (map Z nat Z.abs_nat (Cons Z a l)) *) intro. assumption. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) intros. elim (nonprime_primewitness n). (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) intros. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) elim H2. intros. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) elim H4. intros. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) elim H6. intros. (* Goal: Prime n *) (* Goal: gt n (S O) *) (* Goal: not (Prime n) *) elim (le_not_lt (x * x) n). (* Goal: alllist Z ZPrime t *) assumption. (* Goal: alllist Z ZPrime t *) unfold gt in H0. apply H0. assumption. assumption. (* Goal: alllist Z ZPrime t *) assumption. (* Goal: alllist Z ZPrime t *) assumption. Qed. Lemma primediv1p : forall p n : nat, Prime p -> Divides n p -> n = 1 \/ n = p. Proof. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) intros. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) unfold Prime in H. elim H. intros. (* Goal: alllist Z ZPrime t *) apply (H2 n). assumption. Qed. (** Two is a prime. *) Lemma prime2 : Prime 2. Proof. (* Goal: Prime (S (S O)) *) apply primepropdiv. (* Goal: gt (S (S (S (S O)))) (S (S O)) *) (* Goal: forall (n : nat) (_ : Prime (S (S (S n)))) (_ : Divides (S (S (S n))) (S (S O))), gt (Init.Nat.mul (S (S (S n))) (S (S (S n)))) (S (S O)) *) auto. (* Goal: forall (q : nat) (_ : Prime q) (_ : Divides q (S (S O))), gt (Init.Nat.mul q q) (S (S O)) *) intro q. case q. (* Goal: forall _ : True, True *) (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : alllist Z ZPrime (Cons Z a l)), alllist nat Prime (map Z nat Z.abs_nat (Cons Z a l)) *) intros. elim H. intro. (* Goal: alllist Z ZPrime t *) elim (lt_n_O 1). assumption. (* Goal: forall (n : nat) (_ : Prime (S n)) (_ : Divides (S n) (S (S O))), gt (Init.Nat.mul (S n) (S n)) (S (S O)) *) intro q1. case q1. (* Goal: forall _ : True, True *) (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : alllist Z ZPrime (Cons Z a l)), alllist nat Prime (map Z nat Z.abs_nat (Cons Z a l)) *) intros. elim H. intro. (* Goal: alllist Z ZPrime t *) elim (lt_irrefl 1). assumption. (* Goal: forall (n : nat) (_ : Prime (S (S n))) (_ : Divides (S (S n)) (S (S O))), gt (Init.Nat.mul (S (S n)) (S (S n))) (S (S O)) *) intro q2. case q2. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) simpl in |- *. intros. auto. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) intro q3. simpl in |- *. intros. (* Goal: gt (S (S (S (Init.Nat.add q3 (S (S (S (Init.Nat.add q3 (S (S (S (Init.Nat.add q3 (Init.Nat.mul q3 (S (S (S q3)))))))))))))))) (S (S O)) *) repeat apply gt_n_S. apply gt_Sn_O. Qed. (** * Primality on Z *) (** ZPrime, just like Prime but uses only Z. *) Definition ZPrime (n : Z) : Prop := (n > 1)%Z /\ (forall q : Z, (q >= 0)%Z -> ZDivides q n -> q = 1%Z \/ q = n). Lemma primezprime : forall n : nat, Prime n -> ZPrime (Z_of_nat n). Proof. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) unfold Prime, ZPrime in |- *. intros. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) elim H. intros. split. (* Goal: Z.gt (Z.of_nat n) (Zpos xH) *) (* Goal: forall (q : Z) (_ : Z.ge q Z0) (_ : ZDivides q (Z.of_nat n)), or (@eq Z q (Zpos xH)) (@eq Z q (Z.of_nat n)) *) change (Z_of_nat n > Z_of_nat 1)%Z in |- *. (* Goal: alllist Z ZPrime t *) apply Znat.inj_gt. assumption. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) intros. elim (H1 (Zabs_nat q)). (* Goal: forall _ : @eq Z (Z.of_nat q) (Zpos xH), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: forall _ : @eq Z (Z.of_nat q) n, or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: Z.ge (Z.of_nat q) Z0 *) (* Goal: ZDivides (Z.of_nat q) n *) left. rewrite <- (inj_abs_pos q). rewrite H4. (* Goal: alllist Z ZPrime t *) simpl in |- *. reflexivity. assumption. (* Goal: forall _ : @eq Z (Z.of_nat q) n, or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: Z.ge (Z.of_nat q) Z0 *) (* Goal: ZDivides (Z.of_nat q) n *) right. rewrite <- (inj_abs_pos q). rewrite H4. (* Goal: alllist Z ZPrime t *) reflexivity. assumption. (* Goal: Divides (Z.abs_nat q) n *) rewrite <- (abs_inj n). (* Goal: alllist Z ZPrime t *) apply zdivdiv. assumption. Qed. Lemma zprimeprime : forall n : Z, ZPrime n -> Prime (Zabs_nat n). Proof. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) unfold ZPrime, Prime in |- *. intros. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) elim H. intros. split. (* Goal: gt (Z.abs_nat n) (S O) *) (* Goal: forall (q : nat) (_ : Divides q (Z.abs_nat n)), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) change (Zabs_nat n > Zabs_nat 1) in |- *. (* Goal: gt (Z.abs_nat n) (Z.abs_nat (Zpos xH)) *) (* Goal: forall (q : nat) (_ : Divides q (Z.abs_nat n)), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) apply gtzgt. (* Goal: Z.le Z0 h *) (* Goal: alllist Z (fun x : Z => Z.ge x Z0) t *) apply Zle_trans with 1%Z. (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : alllist Z ZPrime (Cons Z a l)), alllist nat Prime (map Z nat Z.abs_nat (Cons Z a l)) *) unfold Zle in |- *. simpl in |- *. discriminate. (* Goal: alllist Z ZPrime t *) apply Zlt_le_weak. apply Zgt_lt. assumption. (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : alllist Z ZPrime (Cons Z a l)), alllist nat Prime (map Z nat Z.abs_nat (Cons Z a l)) *) unfold Zle in |- *. simpl in |- *. discriminate. (* Goal: alllist Z ZPrime t *) assumption. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) intros. elim (H1 (Z_of_nat q)). (* Goal: forall _ : @eq Z (Z.of_nat q) (Zpos xH), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: forall _ : @eq Z (Z.of_nat q) n, or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: Z.ge (Z.of_nat q) Z0 *) (* Goal: ZDivides (Z.of_nat q) n *) left. rewrite <- (abs_inj q). rewrite H3. (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : alllist Z ZPrime (Cons Z a l)), alllist nat Prime (map Z nat Z.abs_nat (Cons Z a l)) *) simpl in |- *. reflexivity. (* Goal: forall _ : @eq Z (Z.of_nat q) n, or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: Z.ge (Z.of_nat q) Z0 *) (* Goal: ZDivides (Z.of_nat q) n *) right. rewrite <- (abs_inj q). rewrite H3. (* Goal: @eq nat (Z.abs_nat n) (Z.abs_nat n) *) (* Goal: Z.ge (Z.of_nat q) Z0 *) (* Goal: ZDivides (Z.of_nat q) n *) reflexivity. apply nat_ge_0. (* Goal: alllist Z ZPrime t *) apply divzdiv. rewrite abs_inj. assumption. Qed. Lemma zprime2 : ZPrime 2. Proof. (* Goal: ZPrime (Zpos (xO xH)) *) change (ZPrime (Z_of_nat 2)) in |- *. (* Goal: ZPrime (Z.of_nat h) *) (* Goal: alllist Z ZPrime (map nat Z Z.of_nat t) *) apply primezprime. (* Goal: Prime (S (S O)) *) exact prime2. Qed. Lemma zprime2a : ZPrime 2. Proof. (* Goal: ZPrime (Zpos (xO xH)) *) exact zprime2. Qed. (** All numbers in natlist are prime. *) Definition allPrime : natlist -> Prop := alllist nat Prime. Definition allZPrime : Zlist -> Prop := alllist Z ZPrime. Lemma allzprimeallpos : forall l : Zlist, allZPrime l -> allPos l. Proof. (* Goal: forall (l : Zlist) (_ : allZPrime l), allPos l *) unfold allZPrime, allPos in |- *. (* Goal: forall (l : Zlist) (_ : alllist Z ZPrime l), alllist nat Prime (map Z nat Z.abs_nat l) *) simple induction l. (* Goal: forall _ : True, True *) (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : alllist Z ZPrime (Cons Z a l)), alllist nat Prime (map Z nat Z.abs_nat (Cons Z a l)) *) simpl in |- *. intro. assumption. (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : alllist Z ZPrime (Cons Z a l)), alllist nat Prime (map Z nat Z.abs_nat (Cons Z a l)) *) simpl in |- *. intros h t IH H. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) elim H. intros. elim H0. intros. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) split. apply Zle_ge. apply Zle_trans with 1%Z. (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : alllist Z ZPrime (Cons Z a l)), alllist nat Prime (map Z nat Z.abs_nat (Cons Z a l)) *) unfold Zle in |- *. simpl in |- *. discriminate. (* Goal: alllist Z ZPrime t *) apply Zlt_le_weak. apply Zgt_lt. assumption. (* Goal: alllist Z ZPrime t *) apply IH. assumption. Qed. Lemma allprimeallzprime : forall l : natlist, allPrime l -> allZPrime (map _ _ Z_of_nat l). Proof. (* Goal: forall (l : Zlist) (_ : allZPrime l), allPrime (map Z nat Z.abs_nat l) *) unfold allPrime, allZPrime in |- *. (* Goal: forall (l : Zlist) (_ : alllist Z ZPrime l), alllist nat Prime (map Z nat Z.abs_nat l) *) simple induction l. (* Goal: forall _ : True, True *) (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : alllist Z ZPrime (Cons Z a l)), alllist nat Prime (map Z nat Z.abs_nat (Cons Z a l)) *) simpl in |- *. intro. assumption. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) simpl in |- *. intros h t IH H. elim H. intros. split. (* Goal: alllist Z ZPrime t *) apply primezprime. assumption. (* Goal: alllist Z ZPrime t *) apply IH. assumption. Qed. Lemma allzprimeallprime : forall l : Zlist, allZPrime l -> allPrime (map _ _ Zabs_nat l). Proof. (* Goal: forall (l : Zlist) (_ : allZPrime l), allPrime (map Z nat Z.abs_nat l) *) unfold allPrime, allZPrime in |- *. (* Goal: forall (l : Zlist) (_ : alllist Z ZPrime l), alllist nat Prime (map Z nat Z.abs_nat l) *) simple induction l. (* Goal: forall _ : True, True *) (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : alllist Z ZPrime (Cons Z a l)), alllist nat Prime (map Z nat Z.abs_nat (Cons Z a l)) *) simpl in |- *. intro. assumption. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) simpl in |- *. intros h t IH H. elim H. intros. split. (* Goal: alllist Z ZPrime t *) apply zprimeprime. assumption. (* Goal: alllist Z ZPrime t *) apply IH. assumption. Qed.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) (** list. Polymorphic lists with some operations. @author Olga Caprotti and Martijn Oostdijk @version $Revision$ *) Require Import Arith. Require Import ZArith. Require Import EqNat. Require Import dec. Require Import natZ. (** * Polymorphic lists *) Inductive list (A : Set) : Set := | Nil : list A | Cons : A -> list A -> list A. (** Length of a list *) Fixpoint length (A : Set) (l : list A) {struct l} : nat := match l with | Nil => 0 | Cons a r => S (length A r) end. Lemma length_0 : forall (A : Set) (l : list A), length A l = 0 -> l = Nil A. Proof. (* Goal: forall (A : Set) (l : list A) (n : nat) (_ : @eq nat (length A l) (S n)), @ex A (fun h : A => @ex (list A) (fun t : list A => and (@eq (list A) l (Cons A h t)) (@eq nat (length A t) n))) *) intros A l. case l. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) reflexivity. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) simpl in |- *. intros. discriminate H. Qed. Lemma length_S : forall (A : Set) (l : list A) (n : nat), length A l = S n -> exists h : A, (exists t : list A, l = Cons A h t /\ length A t = n). Proof. (* Goal: forall (A : Set) (l : list A) (n : nat) (_ : @eq nat (length A l) (S n)), @ex A (fun h : A => @ex (list A) (fun t : list A => and (@eq (list A) l (Cons A h t)) (@eq nat (length A t) n))) *) intros A l. case l. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) simpl in |- *. intros. discriminate H. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) simpl in |- *. intros h0 t0 n H. injection H. intro. (* Goal: @ex A (fun h : A => @ex (list A) (fun t : list A => and (@eq (list A) (Cons A h0 t0) (Cons A h t)) (@eq nat (length A t) n))) *) split with h0. split with t0. split. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) reflexivity. assumption. Qed. (** Map a function over a list *) Fixpoint map (A B : Set) (f : A -> B) (l : list A) {struct l} : list B := match l with | Nil => Nil B | Cons a r => Cons B (f a) (map A B f r) end. Notation Map := (map _ _) (only parsing). Lemma map_length : forall (A B : Set) (f : A -> B) (l : list A), length A l = length B (map A B f l). Proof. (* Goal: forall (q : nat) (l : Zlist) (_ : allPos l) (_ : inlist nat q (map Z nat Z.abs_nat l)), inlist Z (Z.of_nat q) l *) simple induction l. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) simpl in |- *. reflexivity. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) simpl in |- *. intros. rewrite H. reflexivity. Qed. (** Checks that all members of a list are P *) Fixpoint alllist (A : Set) (P : A -> Prop) (qlist : list A) {struct qlist} : Prop := match qlist with | Nil => True | Cons m l => P m /\ alllist A P l end. Lemma alllist_dec : forall (A : Set) (P : A -> Prop) (l : list A), (forall x : A, P x \/ ~ P x) -> alllist A P l \/ ~ alllist A P l. Proof. (* Goal: forall (q : nat) (l : Zlist) (_ : allPos l) (_ : inlist nat q (map Z nat Z.abs_nat l)), inlist Z (Z.of_nat q) l *) simple induction l. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) simpl in |- *. left. trivial. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) intros h t IH H. simpl in |- *. (* Goal: @ex A (fun q0 : A => and (or (@eq A q0 q) (exlist A (fun b : A => @eq A q0 b) l)) (P q0)) *) (* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *) elim IH. elim (H h). (* Goal: and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x)) *) (* Goal: exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t) *) left. split. assumption. assumption. (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) right. intro. apply H0. elim H2. intros. assumption. (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) right. intro. apply H0. elim H1. intros. assumption. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) assumption. Qed. (** Checks that some member of a list is P *) Fixpoint exlist (A : Set) (P : A -> Prop) (qlist : list A) {struct qlist} : Prop := match qlist with | Nil => False | Cons m l => P m \/ exlist A P l end. Lemma exlist_dec : forall (A : Set) (P : A -> Prop) (l : list A), (forall x : A, P x \/ ~ P x) -> exlist A P l \/ ~ exlist A P l. Proof. (* Goal: forall (q : nat) (l : Zlist) (_ : allPos l) (_ : inlist nat q (map Z nat Z.abs_nat l)), inlist Z (Z.of_nat q) l *) simple induction l. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) simpl in |- *. right. intro. assumption. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) intros h t IH H. simpl in |- *. (* Goal: or (or (P h) (exlist A P t)) (not (or (P h) (exlist A P t))) *) elim (H h). (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) left. left. assumption. (* Goal: @ex A (fun q0 : A => and (or (@eq A q0 q) (exlist A (fun b : A => @eq A q0 b) l)) (P q0)) *) (* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *) elim IH. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) left. right. assumption. (* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *) right. intro. elim H2. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) assumption. assumption. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) assumption. Qed. (** Membership *) Definition inlist (A : Set) (a : A) := exlist A (fun b : A => a = b). Lemma inlist_head_eq : forall (A : Set) (x y : A) (l : list A), x = y -> inlist A x (Cons A y l). Proof. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) intros. unfold inlist in |- *. simpl in |- *. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) left. assumption. Qed. Lemma inlist_head_neq : forall (A : Set) (x y : A) (l : list A), x <> y -> (inlist A x (Cons A y l) <-> inlist A x l). Proof. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) intros. unfold inlist in |- *. simpl in |- *. (* Goal: and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x)) *) (* Goal: exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t) *) split. (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros. elim H0. intro. elim H. assumption. (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros. assumption. (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros. right. assumption. Qed. Lemma inlist_tail : forall (A : Set) (x y : A) (l : list A), inlist A x l -> inlist A x (Cons A y l). Proof. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) intros. unfold inlist in |- *. simpl in |- *. right. assumption. Qed. Lemma inlist_dec : forall (A : Set) (x : A) (l : list A), (forall a b : A, a = b \/ a <> b) -> inlist A x l \/ ~ inlist A x l. Proof. (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros. unfold inlist in |- *. (* Goal: or (exlist A (fun b : A => @eq A x b) l) (not (exlist A (fun b : A => @eq A x b) l)) *) apply exlist_dec. exact (H x). Qed. (** alllist and exlist behave nicely *) Theorem alllist_ok : forall (A : Set) (P : A -> Prop) (qlist : list A), alllist A P qlist <-> (forall q : A, inlist A q qlist -> P q). Proof. (* Goal: and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x)) *) (* Goal: exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t) *) split. (* -> *) (* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *) elim qlist. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) unfold inlist in |- *. simpl in |- *. intros. elim H0. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) unfold inlist in |- *. simpl in |- *. intros q l IH H. elim H. intros. elim H2. (* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *) intro. rewrite H3. assumption. (* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *) intro. apply IH. assumption. assumption. (* <- *) (* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *) elim qlist. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) unfold inlist in |- *. simpl in |- *. intros. trivial. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) unfold inlist in |- *. simpl in |- *. intros q l IH H. split. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) apply H. left. reflexivity. (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) apply IH. intros. apply H. right. assumption. Qed. Theorem exlist_ok : forall (A : Set) (P : A -> Prop) (qlist : list A), exlist A P qlist <-> (exists q : A, inlist A q qlist /\ P q). Proof. (* Goal: and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x)) *) (* Goal: exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t) *) split. (* -> *) (* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *) elim qlist. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) unfold inlist in |- *. simpl in |- *. intros. elim H. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) unfold inlist in |- *. simpl in |- *. intros q l IH H. elim H. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intro. split with q. split. left. reflexivity. assumption. (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intro. elim IH. intros q1 Hq1. elim Hq1. intros. split with q1. (* Goal: and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x)) *) (* Goal: exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t) *) split. right. assumption. assumption. assumption. (* <- *) (* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *) elim qlist. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) unfold inlist in |- *. simpl in |- *. intros. elim H. intros. elim H0. intros. elim H1. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) unfold inlist in |- *. simpl in |- *. intros q l IH H. elim H. (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros q1 Hq1. elim Hq1. intros. elim H0. (* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *) intro. left. rewrite <- H2. assumption. (* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *) intro. right. apply IH. split with q1. split. assumption. assumption. Qed. (** * Lists of natural numbers. *) Definition natlist := list nat. (** Multiply all elements of a natlist *) Fixpoint product (qlist : natlist) : nat := match qlist with | Nil => 1 | Cons m l => m * product l end. (** Drop the first occurance of q from qlist *) Fixpoint drop (q : nat) (qlist : natlist) {struct qlist} : natlist := match qlist with | Nil => Nil nat | Cons q' l => if beq_nat q q' then l else Cons nat q' (drop q l) end. (** Multiply all elements of qlist, except for (first occurance of) q *) Definition multDrop (q : nat) (l : natlist) := product (drop q l). Lemma multdrop_cons_eq : forall (q : nat) (l : natlist), multDrop q (Cons nat q l) = product l. Proof. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) unfold multDrop in |- *. simpl in |- *. intros. elim (beq_nat_eq q q). intros. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) rewrite H. reflexivity. reflexivity. Qed. Lemma multdrop_cons_neq : forall (p q : nat) (l : natlist), p <> q -> multDrop p (Cons nat q l) = q * multDrop p l. Proof. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) unfold multDrop in |- *. simpl in |- *. intros. elim (beq_nat_neq p q). intros. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) rewrite H0. simpl in |- *. reflexivity. assumption. Qed. Lemma multdrop_mult : forall (qlist : natlist) (q : nat), inlist nat q qlist -> q * multDrop q qlist = product qlist. Proof. (* Goal: forall (q : nat) (qlist : natlist), @eq Z (Z.of_nat (multDrop q qlist)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat qlist)) *) simple induction qlist. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) simpl in |- *. intros. elim H. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) simpl in |- *. intros q1 l IH. intros. elim (eqdec q q1). (* case q=q1 *) (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intro. rewrite H0. rewrite multdrop_cons_eq. reflexivity. (* case ~q=q1 *) (* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *) intro. rewrite multdrop_cons_neq. (* Goal: @eq Z (Z.mul q (Z.mul q1 (zmultDrop q l))) (Z.mul q1 (zproduct l)) *) (* Goal: not (@eq Z q q1) *) rewrite <- (IH q). rewrite mult_assoc. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) rewrite (mult_comm q q1). rewrite mult_assoc. reflexivity. (* Goal: forall (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) unfold inlist in H. simpl in H. elim H. (* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *) intro. elim H0. assumption. (* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *) intro. assumption. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) assumption. Qed. (** * Lists of integers. *) Definition Zlist := list Z. (** allPos checks whether all members of a Zlist are non-negative. *) Definition allPos : Zlist -> Prop := alllist Z (fun x : Z => (x >= 0)%Z). (** Multiply all elements of a Zlist *) Fixpoint zproduct (l : Zlist) : Z := match l with | Nil => 1%Z | Cons x t => (x * zproduct t)%Z end. Lemma productzproduct : forall l : natlist, Z_of_nat (product l) = zproduct (map nat Z Z_of_nat l). Proof. (* Goal: forall (q : nat) (l : Zlist) (_ : allPos l) (_ : inlist nat q (map Z nat Z.abs_nat l)), inlist Z (Z.of_nat q) l *) simple induction l. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) simpl in |- *. reflexivity. (* Goal: forall (a : nat) (l : list nat) (_ : @eq (list nat) (map Z nat Z.abs_nat (map nat Z Z.of_nat l)) l), @eq (list nat) (Cons nat (Z.abs_nat (Z.of_nat a)) (map Z nat Z.abs_nat (map nat Z Z.of_nat l))) (Cons nat a l) *) intros h t IH. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) simpl in |- *. rewrite <- IH. (* Goal: @eq Z (Z.of_nat (Init.Nat.mul h (multDrop q t))) (Z.mul (Z.of_nat h) (Z.of_nat (multDrop q t))) *) (* Goal: not (@eq Z (Z.of_nat q) (Z.of_nat h)) *) (* Goal: not (@eq nat q h) *) rewrite Znat.inj_mult. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) reflexivity. Qed. Lemma zproductproduct : forall l : Zlist, Zabs_nat (zproduct l) = product (map Z nat Zabs_nat l). Proof. (* Goal: forall (q : nat) (l : Zlist) (_ : allPos l) (_ : inlist nat q (map Z nat Z.abs_nat l)), inlist Z (Z.of_nat q) l *) simple induction l. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) simpl in |- *. reflexivity. (* Goal: forall (a : nat) (l : list nat) (_ : @eq (list nat) (map Z nat Z.abs_nat (map nat Z Z.of_nat l)) l), @eq (list nat) (Cons nat (Z.abs_nat (Z.of_nat a)) (map Z nat Z.abs_nat (map nat Z Z.of_nat l))) (Cons nat a l) *) intros h t IH. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) simpl in |- *. rewrite abs_mult. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) rewrite IH. reflexivity. Qed. (** Drop an element from a Zlist *) Fixpoint zdrop (x : Z) (l : Zlist) {struct l} : Zlist := match l with | Nil => Nil Z | Cons h t => if Zeq_bool x h then t else Cons Z h (zdrop x t) end. Lemma zdrop_head_eq : forall (x y : Z) (l : Zlist), x = y -> zdrop x (Cons Z y l) = l. Proof. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) simpl in |- *. intros. elim (zeq_bool_eq x y). intros. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) rewrite H0. reflexivity. assumption. Qed. Lemma zdrop_head_neq : forall (x y : Z) (l : Zlist), x <> y -> zdrop x (Cons Z y l) = Cons Z y (zdrop x l). Proof. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) simpl in |- *. intros. elim (zeq_bool_neq x y). intros. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) rewrite H0. reflexivity. assumption. Qed. Lemma zdrop_length : forall (x : Z) (l : Zlist), inlist Z x l -> S (length Z (zdrop x l)) = length Z l. Proof. (* Goal: forall (q : nat) (l : Zlist) (_ : allPos l) (_ : inlist nat q (map Z nat Z.abs_nat l)), inlist Z (Z.of_nat q) l *) simple induction l. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) unfold inlist in |- *. simpl in |- *. intros. elim H. (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros h t IH. intros. elim (zeqdec x h). (* case x=h *) (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) intro. simpl in |- *. elim (zeq_bool_eq x h). (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros. rewrite H1. reflexivity. assumption. (* case x<>h *) (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) intro. simpl in |- *. elim (zeq_bool_neq x h). (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros. rewrite H1. simpl in |- *. rewrite IH. reflexivity. (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) elim H. intros. elim H0. assumption. intros. assumption. assumption. Qed. Lemma zdrop_neq_inlist : forall (x y : Z) (l : Zlist), x <> y -> inlist Z x l -> inlist Z x (zdrop y l). Proof. (* Goal: forall (q : nat) (l : Zlist) (_ : allPos l) (_ : inlist nat q (map Z nat Z.abs_nat l)), inlist Z (Z.of_nat q) l *) simple induction l. (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros. elim H0. (* Goal: forall (a : nat) (l : list nat) (_ : @eq (list nat) (map Z nat Z.abs_nat (map nat Z Z.of_nat l)) l), @eq (list nat) (Cons nat (Z.abs_nat (Z.of_nat a)) (map Z nat Z.abs_nat (map nat Z Z.of_nat l))) (Cons nat a l) *) intros h t IH. (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros. elim (zeqdec x h). (* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *) intro. rewrite zdrop_head_neq. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) apply inlist_head_eq. assumption. (* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *) rewrite <- H1. intro. apply H. symmetry in |- *. assumption. (* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *) intro. elim (zeqdec y h). (* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *) intro. rewrite zdrop_head_eq. (* Goal: inlist Z x t *) (* Goal: not (@eq Z x h) *) (* Goal: not (@eq Z y h) *) elim (inlist_head_neq Z x h t). (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros. apply H3. assumption. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) assumption. assumption. (* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *) intro. rewrite zdrop_head_neq. (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) elim (inlist_head_neq Z x h (zdrop y t)). intros. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) apply H4. apply IH. assumption. (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) elim (inlist_head_neq Z x h t). intros. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) apply H5. assumption. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) assumption. assumption. assumption. Qed. Lemma zdrop_inlist_weak : forall (x y : Z) (l : Zlist), inlist Z x (zdrop y l) -> inlist Z x l. Proof. (* Goal: forall (q : nat) (l : Zlist) (_ : allPos l) (_ : inlist nat q (map Z nat Z.abs_nat l)), inlist Z (Z.of_nat q) l *) simple induction l. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) unfold inlist in |- *. simpl in |- *. intro. assumption. (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros h t IH. intros. (* Goal: forall _ : inlist Z x (Cons Z h t), @eq Z (Z.mul x (zproduct (zdrop x (Cons Z h t)))) (zproduct (Cons Z h t)) *) elim (zeqdec x h). (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intro. rewrite H0. unfold inlist in |- *. simpl in |- *. left. reflexivity. (* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *) intro. elim (zeqdec y h). (* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *) intro. rewrite H1 in H. rewrite zdrop_head_eq in H. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) apply inlist_tail. assumption. reflexivity. (* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *) intro. rewrite zdrop_head_neq in H. (* Goal: forall (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) unfold inlist in H. simpl in H. elim H. (* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *) intro. elim H0. assumption. (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros. apply inlist_tail. apply IH. assumption. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) assumption. Qed. Lemma zdrop_swap : forall (x y : Z) (l : Zlist), zdrop x (zdrop y l) = zdrop y (zdrop x l). Proof. (* Goal: forall (q : nat) (l : Zlist) (_ : allPos l) (_ : inlist nat q (map Z nat Z.abs_nat l)), inlist Z (Z.of_nat q) l *) simple induction l. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) simpl in |- *. reflexivity. (* Goal: forall (a : nat) (l : list nat) (_ : @eq (list nat) (map Z nat Z.abs_nat (map nat Z Z.of_nat l)) l), @eq (list nat) (Cons nat (Z.abs_nat (Z.of_nat a)) (map Z nat Z.abs_nat (map nat Z Z.of_nat l))) (Cons nat a l) *) intros h t IH. (* Goal: forall _ : inlist Z x (Cons Z h t), @eq Z (Z.mul x (zproduct (zdrop x (Cons Z h t)))) (zproduct (Cons Z h t)) *) elim (zeqdec x h). elim (zeqdec y h). (* y=h, x=h *) (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros. rewrite H. rewrite H0. reflexivity. (* y<>h, x=h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros. (* Goal: @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *) (* Goal: forall _ : not (@eq Z x h), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *) rewrite (zdrop_head_eq x h t). (* Goal: @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y t) *) (* Goal: @eq Z x h *) (* Goal: forall _ : not (@eq Z x h), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *) rewrite (zdrop_head_neq y h t). (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) rewrite zdrop_head_eq. reflexivity. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) assumption. assumption. assumption. (* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *) elim (zeqdec y h). (* y=h, x<>h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros. (* Goal: @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *) (* Goal: forall (_ : not (@eq Z y h)) (_ : not (@eq Z x h)), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *) rewrite (zdrop_head_eq y h). (* Goal: @eq Zlist (Cons Z h (zdrop x (zdrop y t))) (zdrop y (zdrop x (Cons Z h t))) *) (* Goal: not (@eq Z x h) *) (* Goal: not (@eq Z y h) *) rewrite (zdrop_head_neq x h). (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) rewrite zdrop_head_eq. reflexivity. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) assumption. assumption. assumption. (* y<>h, x<>h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros. (* Goal: @eq Zlist (Cons Z h (zdrop x (zdrop y t))) (zdrop y (Cons Z h (zdrop x t))) *) (* Goal: not (@eq Z x h) *) (* Goal: not (@eq Z x h) *) (* Goal: not (@eq Z y h) *) rewrite (zdrop_head_neq y h). (* Goal: @eq Zlist (Cons Z h (zdrop x (zdrop y t))) (zdrop y (zdrop x (Cons Z h t))) *) (* Goal: not (@eq Z x h) *) (* Goal: not (@eq Z y h) *) rewrite (zdrop_head_neq x h). (* Goal: @eq Zlist (Cons Z h (zdrop x (zdrop y t))) (zdrop y (zdrop x (Cons Z h t))) *) (* Goal: not (@eq Z x h) *) (* Goal: not (@eq Z y h) *) rewrite (zdrop_head_neq x h). (* Goal: @eq Zlist (Cons Z h (zdrop x (zdrop y t))) (zdrop y (Cons Z h (zdrop x t))) *) (* Goal: not (@eq Z x h) *) (* Goal: not (@eq Z x h) *) (* Goal: not (@eq Z y h) *) rewrite (zdrop_head_neq y h). (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) rewrite IH. reflexivity. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) assumption. assumption. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) assumption. assumption. Qed. Lemma zdrop_inlist_swap : forall (x y : Z) (l : Zlist), inlist Z y l -> inlist Z x (zdrop y l) -> inlist Z y (zdrop x l). Proof. (* Goal: forall (q : nat) (l : Zlist) (_ : allPos l) (_ : inlist nat q (map Z nat Z.abs_nat l)), inlist Z (Z.of_nat q) l *) simple induction l. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) simpl in |- *. intro H. elim H. (* Goal: forall (a : nat) (l : list nat) (_ : @eq (list nat) (map Z nat Z.abs_nat (map nat Z Z.of_nat l)) l), @eq (list nat) (Cons nat (Z.abs_nat (Z.of_nat a)) (map Z nat Z.abs_nat (map nat Z Z.of_nat l))) (Cons nat a l) *) intros h t IH. (* Goal: forall _ : inlist Z x (Cons Z h t), @eq Z (Z.mul x (zproduct (zdrop x (Cons Z h t)))) (zproduct (Cons Z h t)) *) elim (zeqdec x h). elim (zeqdec y h). (* y=h,x=h *) (* Goal: forall (_ : not (@eq Z y h)) (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *) intros Hyh Hxh. rewrite Hyh. rewrite Hxh. (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros. assumption. (* y<>h,x=h *) (* Goal: forall (_ : not (@eq Z y h)) (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *) intros Hyh Hxh. (* Goal: forall (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *) rewrite (zdrop_head_neq y). (* Goal: forall (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (Cons Z h (zdrop y t))), inlist Z y (zdrop x (Cons Z h t)) *) (* Goal: not (@eq Z y h) *) (* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *) rewrite (zdrop_head_eq x). (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros. elim (inlist_head_neq Z y h t). (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros. apply H1. assumption. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) assumption. assumption. assumption. (* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *) elim (zeqdec y h). (* y=h,x<>h *) (* Goal: forall (_ : not (@eq Z y h)) (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *) intros Hyh Hxh. (* Goal: forall (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *) (* Goal: forall (_ : not (@eq Z y h)) (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *) rewrite (zdrop_head_eq y). (* Goal: forall (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (Cons Z h (zdrop y t))), inlist Z y (zdrop x (Cons Z h t)) *) (* Goal: not (@eq Z y h) *) rewrite (zdrop_head_neq x). (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros. apply inlist_head_eq. assumption. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) assumption. assumption. (* y<>h, x<>h *) (* Goal: forall (_ : not (@eq Z y h)) (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *) intros Hyh Hxh. (* Goal: forall (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *) rewrite (zdrop_head_neq y). (* Goal: forall (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (Cons Z h (zdrop y t))), inlist Z y (zdrop x (Cons Z h t)) *) (* Goal: not (@eq Z y h) *) rewrite (zdrop_head_neq x). (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros. elim (inlist_head_neq Z y h (zdrop x t)). (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros. apply H2. apply IH. (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) elim (inlist_head_neq Z y h t). intros. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) apply H3. assumption. assumption. (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) elim (inlist_head_neq Z x h (zdrop y t)). intros. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) apply H3. assumption. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) assumption. assumption. assumption. assumption. Qed. Lemma zdrop_product : forall (x : Z) (l : Zlist), inlist Z x l -> (x * zproduct (zdrop x l))%Z = zproduct l. Proof. (* Goal: forall (q : nat) (l : Zlist) (_ : allPos l) (_ : inlist nat q (map Z nat Z.abs_nat l)), inlist Z (Z.of_nat q) l *) simple induction l. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) simpl in |- *. intro. elim H. (* Goal: forall (a : nat) (l : list nat) (_ : @eq (list nat) (map Z nat Z.abs_nat (map nat Z Z.of_nat l)) l), @eq (list nat) (Cons nat (Z.abs_nat (Z.of_nat a)) (map Z nat Z.abs_nat (map nat Z Z.of_nat l))) (Cons nat a l) *) intros h t IH. elim (zeqdec x h). (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros. rewrite zdrop_head_eq. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) rewrite H. reflexivity. assumption. (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros. rewrite zdrop_head_neq. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) simpl in |- *. rewrite Zmult_assoc. (* Goal: @eq Z (Z.mul (Z.mul x h) (zproduct (zdrop x t))) (Z.mul h (zproduct t)) *) (* Goal: not (@eq Z x h) *) rewrite Zmult_comm with x h. (* Goal: @eq Z (Z.mul (Z.mul h x) (zproduct (zdrop x t))) (Z.mul h (zproduct t)) *) (* Goal: not (@eq Z x h) *) rewrite Zmult_assoc_reverse. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) rewrite IH. reflexivity. (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) elim inlist_head_neq with Z x h t. intros. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) apply H1. assumption. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) assumption. assumption. Qed. (** Multiply all elements except first occurance of x *) Definition zmultDrop (x : Z) (l : Zlist) := zproduct (zdrop x l). Lemma zmultdrop_cons_eq : forall (q : Z) (l : Zlist), zmultDrop q (Cons Z q l) = zproduct l. Proof. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) unfold zmultDrop in |- *. simpl in |- *. intros. elim (zeq_bool_eq q q). intros. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) rewrite H. reflexivity. reflexivity. Qed. Lemma zmultdrop_cons_neq : forall (p q : Z) (l : Zlist), p <> q -> zmultDrop p (Cons Z q l) = (q * zmultDrop p l)%Z. Proof. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) unfold zmultDrop in |- *. simpl in |- *. intros. elim (zeq_bool_neq p q). intros. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) rewrite H0. simpl in |- *. reflexivity. assumption. Qed. Lemma zmultdrop_mult : forall (qlist : Zlist) (q : Z), inlist Z q qlist -> (q * zmultDrop q qlist)%Z = zproduct qlist. Proof. (* Goal: forall (q : nat) (qlist : natlist), @eq Z (Z.of_nat (multDrop q qlist)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat qlist)) *) simple induction qlist. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) simpl in |- *. intros. elim H. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) simpl in |- *. intros q1 l IH. intros. elim (zeqdec q q1). (* case q=q1 *) (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intro. rewrite H0. rewrite zmultdrop_cons_eq. reflexivity. (* case ~q=q1 *) (* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *) intro. rewrite zmultdrop_cons_neq. (* Goal: @eq Z (Z.mul q (Z.mul q1 (zmultDrop q l))) (Z.mul q1 (zproduct l)) *) (* Goal: not (@eq Z q q1) *) rewrite <- (IH q). rewrite Zmult_assoc. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) rewrite (Zmult_comm q q1). rewrite Zmult_assoc. reflexivity. (* Goal: forall (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) unfold inlist in H. simpl in H. elim H. (* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *) intro. elim H0. assumption. (* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *) intro. assumption. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) assumption. Qed. Lemma multdropzmultdrop : forall (q : nat) (qlist : natlist), Z_of_nat (multDrop q qlist) = zmultDrop (Z_of_nat q) (map nat Z Z_of_nat qlist). Proof. (* Goal: forall (q : nat) (qlist : natlist), @eq Z (Z.of_nat (multDrop q qlist)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat qlist)) *) simple induction qlist. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) simpl in |- *. reflexivity. (* Goal: forall (a : nat) (l : list nat) (_ : @eq Z (Z.of_nat (multDrop q l)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat l))), @eq Z (Z.of_nat (multDrop q (Cons nat a l))) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat (Cons nat a l))) *) intros h t. (* Goal: forall _ : @eq Z (Z.of_nat (multDrop q t)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t)), @eq Z (Z.of_nat (multDrop q (Cons nat h t))) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat (Cons nat h t))) *) elim (eqdec q h). (* q=h *) (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) intro H. rewrite H. simpl in |- *. (* Goal: forall _ : @eq Z (Z.of_nat (multDrop h t)) (zmultDrop (Z.of_nat h) (map nat Z Z.of_nat t)), @eq Z (Z.of_nat (multDrop h (Cons nat h t))) (zmultDrop (Z.of_nat h) (Cons Z (Z.of_nat h) (map nat Z Z.of_nat t))) *) (* Goal: forall (_ : not (@eq nat q h)) (_ : @eq Z (Z.of_nat (multDrop q t)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t))), @eq Z (Z.of_nat (multDrop q (Cons nat h t))) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat (Cons nat h t))) *) rewrite multdrop_cons_eq. (* Goal: forall _ : @eq Z (Z.of_nat (multDrop h t)) (zmultDrop (Z.of_nat h) (map nat Z Z.of_nat t)), @eq Z (Z.of_nat (product t)) (zmultDrop (Z.of_nat h) (Cons Z (Z.of_nat h) (map nat Z Z.of_nat t))) *) (* Goal: forall (_ : not (@eq nat q h)) (_ : @eq Z (Z.of_nat (multDrop q t)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t))), @eq Z (Z.of_nat (multDrop q (Cons nat h t))) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat (Cons nat h t))) *) rewrite zmultdrop_cons_eq. (* Goal: forall _ : @eq Z (Z.of_nat (multDrop h t)) (zmultDrop (Z.of_nat h) (map nat Z Z.of_nat t)), @eq Z (Z.of_nat (product t)) (zproduct (map nat Z Z.of_nat t)) *) (* Goal: forall (_ : not (@eq nat q h)) (_ : @eq Z (Z.of_nat (multDrop q t)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t))), @eq Z (Z.of_nat (multDrop q (Cons nat h t))) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat (Cons nat h t))) *) rewrite productzproduct. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intro IH. reflexivity. (* ~q=h *) (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) intro H. simpl in |- *. (* Goal: forall _ : @eq Z (Z.of_nat (multDrop q t)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t)), @eq Z (Z.of_nat (multDrop q (Cons nat h t))) (zmultDrop (Z.of_nat q) (Cons Z (Z.of_nat h) (map nat Z Z.of_nat t))) *) rewrite multdrop_cons_neq. (* Goal: forall _ : @eq Z (Z.of_nat (multDrop q t)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t)), @eq Z (Z.of_nat (Init.Nat.mul h (multDrop q t))) (zmultDrop (Z.of_nat q) (Cons Z (Z.of_nat h) (map nat Z Z.of_nat t))) *) (* Goal: not (@eq nat q h) *) rewrite zmultdrop_cons_neq. (* Goal: @eq Z (Z.of_nat (Init.Nat.mul h (multDrop q t))) (Z.mul (Z.of_nat h) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t))) *) (* Goal: not (@eq Z (Z.of_nat q) (Z.of_nat h)) *) (* Goal: not (@eq nat q h) *) intro IH. rewrite <- IH. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) rewrite Znat.inj_mult. reflexivity. (* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *) intro. apply H. (* Goal: @eq nat q h *) (* Goal: not (@eq nat q h) *) rewrite <- (abs_inj q). rewrite <- (abs_inj h). (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) rewrite H0. reflexivity. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) assumption. Qed. (** Multiply all elements in list with a *) Definition mapmult (a : Z) (l : Zlist) := map Z Z (fun x : Z => (a * x)%Z) l. Lemma mapmult_image : forall (a : Z) (l : Zlist) (x : Z), inlist Z x l -> inlist Z (a * x)%Z (mapmult a l). Proof. (* Goal: forall (q : nat) (l : Zlist) (_ : allPos l) (_ : inlist nat q (map Z nat Z.abs_nat l)), inlist Z (Z.of_nat q) l *) unfold mapmult in |- *. unfold inlist in |- *. simple induction l. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) simpl in |- *. intros. assumption. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) simpl in |- *. intros h t IH. intros. elim H. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) left. rewrite H0. reflexivity. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) right. apply IH. assumption. Qed. Lemma mapmult_orig : forall (a : Z) (l : Zlist) (y : Z), inlist Z y (mapmult a l) -> exists x : Z, inlist Z x l /\ y = (a * x)%Z. Proof. (* Goal: forall (q : nat) (l : Zlist) (_ : allPos l) (_ : inlist nat q (map Z nat Z.abs_nat l)), inlist Z (Z.of_nat q) l *) unfold mapmult in |- *. unfold inlist in |- *. simple induction l. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) simpl in |- *. intros. elim H. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) simpl in |- *. intros h t IH. intros. (* Goal: forall (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) elim H. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intro. split with h. split. left. reflexivity. assumption. (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intro. elim (IH y). intros. elim H1. intros. (* Goal: and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x)) *) (* Goal: exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t) *) split with x. split. right. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) assumption. assumption. assumption. Qed. (** Lift inject_nat and absolu to natlist and Zlist. *) Lemma abs_inj_list : forall l : natlist, map _ _ Zabs_nat (map _ _ Z_of_nat l) = l. Proof. (* Goal: forall (q : nat) (l : Zlist) (_ : allPos l) (_ : inlist nat q (map Z nat Z.abs_nat l)), inlist Z (Z.of_nat q) l *) simple induction l. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) simpl in |- *. reflexivity. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) simpl in |- *. intros h t IH. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) rewrite abs_inj. rewrite IH. reflexivity. Qed. Lemma inj_abs_pos_list : forall l : Zlist, allPos l -> map _ _ Z_of_nat (map _ _ Zabs_nat l) = l. Proof. (* Goal: forall (q : nat) (l : Zlist) (_ : allPos l) (_ : inlist nat q (map Z nat Z.abs_nat l)), inlist Z (Z.of_nat q) l *) simple induction l. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) simpl in |- *. intros. reflexivity. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) simpl in |- *. intros h t IH H. elim H. intros. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) rewrite inj_abs_pos. rewrite IH. reflexivity. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) assumption. assumption. Qed. Lemma inlist_inj_abs_pos_list : forall (q : nat) (l : Zlist), allPos l -> inlist nat q (map Z nat Zabs_nat l) -> inlist Z (Z_of_nat q) l. Proof. (* Goal: forall (q : nat) (l : Zlist) (_ : allPos l) (_ : inlist nat q (map Z nat Z.abs_nat l)), inlist Z (Z.of_nat q) l *) simple induction l. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) unfold inlist in |- *. simpl in |- *. intros. assumption. (* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *) unfold inlist in |- *. unfold allPos in |- *. simpl in |- *. (* Goal: forall (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros h t IH Hp H. elim Hp. elim H. (* Goal: @eq Z h h *) (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) left. rewrite H0. rewrite inj_abs_pos. reflexivity. (* Goal: Z.ge h Z0 *) (* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *) intros. assumption. (* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *) right. apply IH. assumption. assumption. Qed.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) (** dec. Some utilities for proving decidability of predicates. @author Olga Caprotti and Martijn Oostdijk @version $Revision$ *) Require Import Arith. Require Import ZArith. Require Import EqNat. (** Checks that all nats before n are P *) Fixpoint allbefore (P : nat -> Prop) (n : nat) {struct n} : Prop := match n with | O => True | S x => allbefore P x /\ P x end. (** Checks that some nat before n is P *) Fixpoint exbefore (P : nat -> Prop) (n : nat) {struct n} : Prop := match n with | O => False | S x => exbefore P x \/ P x end. Theorem allbefore_ok : forall (P : nat -> Prop) (n : nat), (forall q : nat, q < n -> P q) <-> allbefore P n. Proof. (* Goal: not (@eq Z x y) *) intro. (* Goal: forall n m : nat, iff (@eq nat n m) (@eq bool (Nat.eqb n m) true) *) simple induction n. (* Goal: iff (@eq nat (S n1) (S m1)) (@eq bool (Nat.eqb (S n1) (S m1)) true) *) simpl in |- *. (* Goal: iff (not (@eq Z x y)) (@eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false) *) split. (* Goal: forall _ : @eq nat n0 n1, @eq nat n0 n1 *) (* Goal: forall _ : istrue (Nat.eqb (S n0) (S n1)), @eq nat (S n0) (S n1) *) tauto. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: P q *) (* Goal: forall (n : nat) (_ : iff (forall (q : nat) (_ : lt q n), P q) (allbefore P n)), iff (forall (q : nat) (_ : lt q (S n)), P q) (allbefore P (S n)) *) elim (lt_n_O q). (* Goal: @eq Z x y *) assumption. (* Goal: iff (@eq nat (S n1) (S m1)) (@eq bool (Nat.eqb (S n1) (S m1)) true) *) simpl in |- *. (* Goal: forall (n : nat) (_ : iff (@ex nat (fun q : nat => and (lt q n) (P q))) (exbefore P n)), iff (@ex nat (fun q : nat => and (lt q (S n)) (P q))) (exbefore P (S n)) *) intros m IHm. (* Goal: iff (@ex nat (fun q : nat => and (lt q (S m)) (P q))) (or (exbefore P m) (P m)) *) elim IHm. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: iff (not (@eq Z x y)) (@eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false) *) split. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: iff (not (@eq Z x y)) (@eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false) *) split. (* Goal: @eq Z x y *) apply H. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: P q *) (* Goal: P m *) (* Goal: forall (_ : and (allbefore P m) (P m)) (q : nat) (_ : lt q (S m)), P q *) apply (H1 q). (* Goal: forall n m : nat, or (lt n m) (not (lt n m)) *) unfold lt in |- *. (* Goal: le (S q) (S m) *) (* Goal: P m *) (* Goal: forall (_ : and (allbefore P m) (P m)) (q : nat) (_ : lt q (S m)), P q *) unfold lt in H2. (* Goal: le (S x) (S m) *) (* Goal: P x *) (* Goal: forall _ : P m, @ex nat (fun q : nat => and (lt q (S m)) (P q)) *) apply le_S. (* Goal: @eq Z x y *) assumption. (* Goal: P m *) (* Goal: forall (_ : and (allbefore P m) (P m)) (q : nat) (_ : lt q (S m)), P q *) apply (H1 m). (* Goal: forall n m : nat, or (lt n m) (not (lt n m)) *) unfold lt in |- *. (* Goal: le (S m) (S m) *) (* Goal: P m *) apply le_n. (* Goal: not (@eq Z x y) *) intro. (* Goal: False *) (* Goal: forall _ : not (forall (x : nat) (_ : lt x N), not (P x)), @ex nat (fun x : nat => and (lt x N) (P x)) *) elim H1. (* Goal: not (@eq Z x y) *) intro. (* Goal: not (@eq Z x y) *) intro. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: P q *) elim (le_lt_or_eq q m). (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: istrue (Nat.eqb n0 n1) *) (* Goal: forall _ : istrue (Nat.eqb (S n0) (S n1)), @eq nat (S n0) (S n1) *) apply H0. (* Goal: @eq Z x y *) assumption. (* Goal: @eq Z x y *) assumption. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: P q *) (* Goal: le q m *) rewrite H5. (* Goal: @eq Z x y *) assumption. (* Goal: le (S x) (S m) *) (* Goal: P x *) (* Goal: forall _ : P m, @ex nat (fun q : nat => and (lt q (S m)) (P q)) *) unfold lt in H4. (* Goal: le q m *) apply (le_S_n q m). (* Goal: @eq Z x y *) assumption. Qed. Theorem exbefore_ok : forall (P : nat -> Prop) (n : nat), (exists q : nat, q < n /\ P q) <-> exbefore P n. Proof. (* Goal: forall (P : forall _ : nat, Prop) (N : nat) (_ : forall n : nat, or (P n) (not (P n))), or (@ex nat (fun x : nat => and (lt x N) (P x))) (not (@ex nat (fun x : nat => and (lt x N) (P x)))) *) intro P. (* Goal: forall n m : nat, iff (@eq nat n m) (@eq bool (Nat.eqb n m) true) *) simple induction n. (* Goal: iff (@eq nat (S n1) (S m1)) (@eq bool (Nat.eqb (S n1) (S m1)) true) *) simpl in |- *. (* Goal: iff (not (@eq Z x y)) (@eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false) *) split. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: @ex nat (fun x : nat => and (lt x (S M)) (P x)) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x M) (P x))), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *) (* Goal: forall n : nat, or (P n) (not (P n)) *) elim H. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: @ex nat (fun x : nat => and (lt x O) (P x)) *) (* Goal: forall (n : nat) (_ : forall _ : not (forall (x : nat) (_ : lt x n), not (P x)), @ex nat (fun x : nat => and (lt x n) (P x))) (_ : not (forall (x : nat) (_ : lt x (S n)), not (P x))), @ex nat (fun x : nat => and (lt x (S n)) (P x)) *) elim H0. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: not (P x) *) (* Goal: forall (n : nat) (_ : forall _ : not (forall (x : nat) (_ : lt x n), not (P x)), @ex nat (fun x : nat => and (lt x n) (P x))) (_ : not (forall (x : nat) (_ : lt x (S n)), not (P x))), @ex nat (fun x : nat => and (lt x (S n)) (P x)) *) elim (lt_n_O x). (* Goal: @eq Z x y *) assumption. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: @ex nat (fun x : nat => and (lt x (S M)) (P x)) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x M) (P x))), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *) (* Goal: forall n : nat, or (P n) (not (P n)) *) elim H. (* Goal: forall (n : nat) (_ : iff (@ex nat (fun q : nat => and (lt q n) (P q))) (exbefore P n)), iff (@ex nat (fun q : nat => and (lt q (S n)) (P q))) (exbefore P (S n)) *) intros m IHm. (* Goal: iff (@eq nat (S n1) (S m1)) (@eq bool (Nat.eqb (S n1) (S m1)) true) *) simpl in |- *. (* Goal: iff (@ex nat (fun q : nat => and (lt q (S m)) (P q))) (or (exbefore P m) (P m)) *) elim IHm. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: iff (not (@eq Z x y)) (@eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false) *) split. (* Goal: not (@eq Z x y) *) intro. (* Goal: False *) (* Goal: forall _ : not (forall (x : nat) (_ : lt x N), not (P x)), @ex nat (fun x : nat => and (lt x N) (P x)) *) elim H1. (* Goal: not (@eq Z x y) *) intro. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: False *) (* Goal: forall n : nat, or (P n) (not (P n)) *) elim H2. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: or (exbefore P m) (P m) *) (* Goal: forall _ : or (exbefore P m) (P m), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *) elim (le_lt_or_eq x m). (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: forall _ : P M, or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *) (* Goal: forall _ : not (P M), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *) (* Goal: forall n : nat, or (P n) (not (P n)) *) left. (* Goal: @eq Z x y *) apply H. (* Goal: @ex nat (fun x : nat => and (lt x (S M)) (P x)) *) (* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *) (* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *) split with x. (* Goal: iff (not (@eq Z x y)) (@eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false) *) split. (* Goal: @eq Z x y *) assumption. (* Goal: @eq Z x y *) assumption. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: forall _ : not (P M), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *) (* Goal: forall n : nat, or (P n) (not (P n)) *) right. (* Goal: P m *) (* Goal: le x m *) (* Goal: forall _ : or (exbefore P m) (P m), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *) rewrite H5 in H4. (* Goal: @eq Z x y *) assumption. (* Goal: le x m *) (* Goal: forall _ : or (exbefore P m) (P m), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *) apply (le_S_n x m). (* Goal: @eq Z x y *) assumption. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: False *) (* Goal: forall _ : not (forall (x : nat) (_ : lt x N), not (P x)), @ex nat (fun x : nat => and (lt x N) (P x)) *) elim H1. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: @ex nat (fun q : nat => and (lt q (S m)) (P q)) *) (* Goal: forall _ : P m, @ex nat (fun q : nat => and (lt q (S m)) (P q)) *) case H0. (* Goal: @eq Z x y *) assumption. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: @ex nat (fun x : nat => and (lt x (S M)) (P x)) *) (* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *) (* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *) split with x. (* Goal: @eq bool true false *) (* Goal: forall (_ : forall _ : @eq comparison Lt Eq, @eq Z x y) (_ : forall _ : @eq Z x y, @eq comparison Lt Eq) (_ : not (@eq Z x y)), @eq bool false false *) (* Goal: forall (_ : forall _ : @eq comparison Gt Eq, @eq Z x y) (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : not (@eq Z x y)), @eq bool false false *) (* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false, not (@eq Z x y) *) elim H3. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: iff (not (@eq Z x y)) (@eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false) *) split. (* Goal: forall n m : nat, or (lt n m) (not (lt n m)) *) unfold lt in |- *. (* Goal: le (S x) (S m) *) (* Goal: P x *) (* Goal: forall _ : P m, @ex nat (fun q : nat => and (lt q (S m)) (P q)) *) unfold lt in H4. (* Goal: le (S x) (S m) *) (* Goal: P x *) (* Goal: forall _ : P m, @ex nat (fun q : nat => and (lt q (S m)) (P q)) *) apply le_S. (* Goal: @eq Z x y *) assumption. (* Goal: @eq Z x y *) assumption. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: @ex nat (fun q : nat => and (lt q (S m)) (P q)) *) split with m. (* Goal: iff (not (@eq Z x y)) (@eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false) *) split. (* Goal: forall n m : nat, or (lt n m) (not (lt n m)) *) unfold lt in |- *. (* Goal: le (S m) (S m) *) (* Goal: P m *) apply le_n. (* Goal: @eq Z x y *) assumption. Qed. (** some decidable relations on nat *) Lemma eqdec : forall n m : nat, n = m \/ n <> m. Proof. (* Goal: forall n m : nat, iff (@eq nat n m) (@eq bool (Nat.eqb n m) true) *) simple induction n. (* Goal: not (@eq Z x y) *) intro. (* Goal: iff (@eq nat (S n1) m) (@eq bool (Nat.eqb (S n1) m) true) *) case m. (* Goal: forall _ : P M, or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *) (* Goal: forall _ : not (P M), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *) (* Goal: forall n : nat, or (P n) (not (P n)) *) left. (* Goal: @eq bool false false *) (* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false, not (@eq Z x y) *) reflexivity. (* Goal: forall _ : not (P M), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *) (* Goal: forall n : nat, or (P n) (not (P n)) *) right. (* Goal: forall _ : @eq comparison Gt Eq, False *) (* Goal: @eq comparison Gt Eq *) discriminate. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: iff (@eq nat (S n1) m) (@eq bool (Nat.eqb (S n1) m) true) *) case m. (* Goal: forall _ : not (P M), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *) (* Goal: forall n : nat, or (P n) (not (P n)) *) right. (* Goal: forall _ : @eq comparison Gt Eq, False *) (* Goal: @eq comparison Gt Eq *) discriminate. (* Goal: forall n : nat, or (@eq nat (S n0) (S n)) (not (@eq nat (S n0) (S n))) *) intro m0. (* Goal: or (@eq nat (S n0) (S m0)) (not (@eq nat (S n0) (S m0))) *) elim (H m0). (* Goal: forall _ : P M, or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *) (* Goal: forall _ : not (P M), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *) (* Goal: forall n : nat, or (P n) (not (P n)) *) left. (* Goal: @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end true *) (* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end true, @eq Z x y *) rewrite H0. (* Goal: @eq bool false false *) (* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false, not (@eq Z x y) *) reflexivity. (* Goal: forall _ : not (P M), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *) (* Goal: forall n : nat, or (P n) (not (P n)) *) right. (* Goal: not (@eq Z x y) *) intro. (* Goal: istrue (Nat.eqb n0 n1) *) (* Goal: forall _ : istrue (Nat.eqb (S n0) (S n1)), @eq nat (S n0) (S n1) *) apply H0. (* Goal: @eq nat n0 m0 *) inversion H1. (* Goal: @eq bool false false *) (* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false, not (@eq Z x y) *) reflexivity. Qed. Lemma ledec : forall n m : nat, n <= m \/ ~ n <= m. Proof. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. elim (le_or_lt n m). (* Goal: @eq Z x y *) left. assumption. (* Goal: @eq Z x y *) right. apply lt_not_le. assumption. Qed. Lemma ltdec : forall n m : nat, n < m \/ ~ n < m. Proof. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) unfold lt in |- *. intros. apply ledec. Qed. Lemma gedec : forall n m : nat, n >= m \/ ~ n >= m. Proof. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) unfold ge in |- *. intros. apply ledec. Qed. Lemma gtdec : forall n m : nat, n > m \/ ~ n > m. Proof. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) unfold gt in |- *. intros. apply ltdec. Qed. (** relations on Z *) Lemma zeqdec : forall x y : Z, x = y \/ x <> y. Proof. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. elim (dec_eq x y). left. assumption. right. assumption. Qed. (** the connectives preserve decidability *) Lemma notdec : forall P : Prop, P \/ ~ P -> ~ P \/ ~ ~ P. Proof. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. elim H. (* Goal: not (@eq Z x y) *) right. intro. apply H1. assumption. (* Goal: @eq Z x y *) left. assumption. Qed. Lemma anddec : forall P Q : Prop, P \/ ~ P -> Q \/ ~ Q -> P /\ Q \/ ~ (P /\ Q). Proof. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. elim H. elim H0. (* Goal: iff (not (@eq Z x y)) (@eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false) *) left. split. assumption. assumption. (* Goal: not (@eq Z x y) *) right. intro. apply H1. elim H3. intros. assumption. (* Goal: not (@eq Z x y) *) right. intro. apply H1. elim H2. intros. assumption. Qed. Lemma ordec : forall P Q : Prop, P \/ ~ P -> Q \/ ~ Q -> (P \/ Q) \/ ~ (P \/ Q). Proof. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. elim H. (* Goal: @eq Z x y *) left. left. assumption. (* Goal: @ex nat (fun x : nat => and (lt x O) (P x)) *) (* Goal: forall (n : nat) (_ : forall _ : not (forall (x : nat) (_ : lt x n), not (P x)), @ex nat (fun x : nat => and (lt x n) (P x))) (_ : not (forall (x : nat) (_ : lt x (S n)), not (P x))), @ex nat (fun x : nat => and (lt x (S n)) (P x)) *) elim H0. (* Goal: @eq Z x y *) left. right. assumption. (* Goal: not (@eq Z x y) *) right. intro. elim H3. assumption. assumption. Qed. Lemma impdec : forall P Q : Prop, P \/ ~ P -> Q \/ ~ Q -> (P -> Q) \/ ~ (P -> Q). Proof. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. elim H. (* Goal: @ex nat (fun x : nat => and (lt x O) (P x)) *) (* Goal: forall (n : nat) (_ : forall _ : not (forall (x : nat) (_ : lt x n), not (P x)), @ex nat (fun x : nat => and (lt x n) (P x))) (_ : not (forall (x : nat) (_ : lt x (S n)), not (P x))), @ex nat (fun x : nat => and (lt x (S n)) (P x)) *) elim H0. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) left. intros. assumption. (* Goal: not (@eq Z x y) *) right. intro. apply H1. apply H3. assumption. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) left. intros. elim H1. assumption. Qed. Lemma iffdec : forall P Q : Prop, P \/ ~ P -> Q \/ ~ Q -> (P <-> Q) \/ ~ (P <-> Q). Proof. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) unfold iff in |- *. intros. (* Goal: or (and (forall _ : P, Q) (forall _ : Q, P)) (not (and (forall _ : P, Q) (forall _ : Q, P))) *) apply anddec. (* Goal: @eq Z x y *) apply impdec. assumption. assumption. (* Goal: @eq Z x y *) apply impdec. assumption. assumption. Qed. (** bounded quantifiers preserve decidability *) Theorem alldec : forall (P : nat -> Prop) (N : nat), (forall n : nat, P n \/ ~ P n) -> (forall x : nat, x < N -> P x) \/ ~ (forall x : nat, x < N -> P x). Proof. (* Goal: forall (P : forall _ : nat, Prop) (N : nat) (_ : forall n : nat, or (P n) (not (P n))), or (@ex nat (fun x : nat => and (lt x N) (P x))) (not (@ex nat (fun x : nat => and (lt x N) (P x)))) *) intro P. simple induction N. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) left. intros. elim (lt_n_O x). assumption. (* Goal: forall (n : nat) (_ : forall _ : forall n0 : nat, or (P n0) (not (P n0)), or (@ex nat (fun x : nat => and (lt x n) (P x))) (not (@ex nat (fun x : nat => and (lt x n) (P x))))) (_ : forall n0 : nat, or (P n0) (not (P n0))), or (@ex nat (fun x : nat => and (lt x (S n)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S n)) (P x)))) *) intros M IH decP. (* Goal: @ex nat (fun x : nat => and (lt x (S M)) (P x)) *) (* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *) elim IH. elim (decP M). (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) left. intros. unfold lt in H1. elim (le_lt_or_eq x M). intros. (* Goal: @eq Z x y *) apply H0. assumption. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. rewrite H2. assumption. (* Goal: @eq Z x y *) apply le_S_n. assumption. (* Goal: not (@eq Z x y) *) right. intro. apply H. apply H1. apply lt_n_Sn. (* Goal: not (@eq Z x y) *) right. intro. apply H. intros. apply H0. apply lt_S. assumption. (* Goal: @eq Z x y *) assumption. Qed. Theorem exdec : forall (P : nat -> Prop) (N : nat), (forall n : nat, P n \/ ~ P n) -> (exists x : nat, x < N /\ P x) \/ ~ (exists x : nat, x < N /\ P x). Proof. (* Goal: forall (P : forall _ : nat, Prop) (N : nat) (_ : forall n : nat, or (P n) (not (P n))), or (@ex nat (fun x : nat => and (lt x N) (P x))) (not (@ex nat (fun x : nat => and (lt x N) (P x)))) *) intro P. simple induction N. (* Goal: forall _ : forall n : nat, or (P n) (not (P n)), or (@ex nat (fun x : nat => and (lt x O) (P x))) (not (@ex nat (fun x : nat => and (lt x O) (P x)))) *) (* Goal: forall (n : nat) (_ : forall _ : forall n0 : nat, or (P n0) (not (P n0)), or (@ex nat (fun x : nat => and (lt x n) (P x))) (not (@ex nat (fun x : nat => and (lt x n) (P x))))) (_ : forall n0 : nat, or (P n0) (not (P n0))), or (@ex nat (fun x : nat => and (lt x (S n)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S n)) (P x)))) *) intro decP. (* Goal: not (@eq Z x y) *) right. intro. elim H. intros. elim H0. intros. elim (lt_n_O x). assumption. (* Goal: forall (n : nat) (_ : forall _ : forall n0 : nat, or (P n0) (not (P n0)), or (@ex nat (fun x : nat => and (lt x n) (P x))) (not (@ex nat (fun x : nat => and (lt x n) (P x))))) (_ : forall n0 : nat, or (P n0) (not (P n0))), or (@ex nat (fun x : nat => and (lt x (S n)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S n)) (P x)))) *) intros M IH decP. (* Goal: forall _ : P M, or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *) (* Goal: forall _ : not (P M), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *) (* Goal: forall n : nat, or (P n) (not (P n)) *) elim IH. left. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) elim H. intros. split with x. elim H0. intros. (* Goal: iff (not (@eq Z x y)) (@eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false) *) split. (* Goal: @eq Z x y *) apply lt_S. assumption. (* Goal: @eq Z x y *) assumption. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *) (* Goal: forall n : nat, or (P n) (not (P n)) *) elim (decP M). (* Goal: iff (not (@eq Z x y)) (@eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false) *) left. split with M. split. apply lt_n_Sn. (* Goal: @eq Z x y *) assumption. (* Goal: not (@eq Z x y) *) right. intro. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) elim H1. intros. elim H2. intros. (* Goal: not (P x) *) unfold lt in H3. elim (le_lt_or_eq x M). (* Goal: not (@eq Z x y) *) intro. apply H. split with x. split. assumption. (* Goal: @eq Z x y *) assumption. (* Goal: not (@eq Z x y) *) intro. apply H0. rewrite <- H5. assumption. (* Goal: @eq Z x y *) apply le_S_n. assumption. (* Goal: @eq Z x y *) assumption. Qed. (** De Morgan's law holds for decidable P if the quantifiers are bounded *) Theorem decDeMorgan : forall (N : nat) (P : nat -> Prop), (forall n : nat, P n \/ ~ P n) -> ((exists x : nat, x < N /\ P x) <-> ~ (forall x : nat, x < N -> ~ P x)). Proof. (* Goal: iff (not (@eq Z x y)) (@eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false) *) split. (* Goal: not (@eq Z x y) *) intro. (* Goal: @ex nat (fun x : nat => and (lt x O) (P x)) *) (* Goal: forall (n : nat) (_ : forall _ : not (forall (x : nat) (_ : lt x n), not (P x)), @ex nat (fun x : nat => and (lt x n) (P x))) (_ : not (forall (x : nat) (_ : lt x (S n)), not (P x))), @ex nat (fun x : nat => and (lt x (S n)) (P x)) *) elim H0. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: not (@eq Z x y) *) intro. (* Goal: False *) (* Goal: forall _ : not (forall (x : nat) (_ : lt x N), not (P x)), @ex nat (fun x : nat => and (lt x N) (P x)) *) elim H1. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: False *) (* Goal: forall _ : not (forall (x : nat) (_ : lt x N), not (P x)), @ex nat (fun x : nat => and (lt x N) (P x)) *) apply (H2 x H3 H4). (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) elim N. intros. elim H0. intros. elim (lt_n_O x). assumption. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros M IH. intros. (* Goal: @ex nat (fun x : nat => and (lt x (S M)) (P x)) *) elim (H M). (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: @ex nat (fun x : nat => and (lt x (S M)) (P x)) *) (* Goal: forall _ : not (P M), @ex nat (fun x : nat => and (lt x (S M)) (P x)) *) split with M. (* Goal: iff (not (@eq Z x y)) (@eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false) *) split. (* Goal: lt M (S M) *) (* Goal: P M *) (* Goal: forall _ : not (P M), @ex nat (fun x : nat => and (lt x (S M)) (P x)) *) apply lt_n_Sn. (* Goal: @eq Z x y *) assumption. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: @ex nat (fun x : nat => and (lt x (S M)) (P x)) *) cut (~ (forall x : nat, x < M -> ~ P x)). (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: @ex nat (fun x : nat => and (lt x (S M)) (P x)) *) (* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *) elim IH. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: @ex nat (fun x : nat => and (lt x (S M)) (P x)) *) (* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *) (* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *) split with x. (* Goal: @eq bool true false *) (* Goal: forall (_ : forall _ : @eq comparison Lt Eq, @eq Z x y) (_ : forall _ : @eq Z x y, @eq comparison Lt Eq) (_ : not (@eq Z x y)), @eq bool false false *) (* Goal: forall (_ : forall _ : @eq comparison Gt Eq, @eq Z x y) (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : not (@eq Z x y)), @eq bool false false *) (* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false, not (@eq Z x y) *) elim H3. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: iff (not (@eq Z x y)) (@eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false) *) split. (* Goal: lt x (S M) *) (* Goal: P x *) (* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *) (* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *) apply lt_S. (* Goal: @eq Z x y *) assumption. (* Goal: @eq Z x y *) assumption. (* Goal: @eq Z x y *) assumption. (* Goal: not (@eq Z x y) *) intro. (* Goal: istrue (Nat.eqb n0 n1) *) (* Goal: forall _ : istrue (Nat.eqb (S n0) (S n1)), @eq nat (S n0) (S n1) *) apply H0. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: not (P x) *) elim (le_lt_or_eq x M). (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: @eq comparison Gt Eq *) apply H2. (* Goal: @eq Z x y *) assumption. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: not (P x) *) (* Goal: le x M *) rewrite H4. (* Goal: @eq Z x y *) assumption. (* Goal: le x M *) unfold lt in H3. (* Goal: le x M *) apply le_S_n. (* Goal: @eq Z x y *) assumption. Qed. (** Some nice boolean stuff... *) Definition istrue (b : bool) := if b then True else False. Lemma beq_nat_ok : forall n m : nat, n = m <-> istrue (beq_nat n m). Proof. (* Goal: forall n m : nat, iff (@eq nat n m) (@eq bool (Nat.eqb n m) true) *) simple induction n. (* Goal: iff (@eq nat (S n1) (S m1)) (@eq bool (Nat.eqb (S n1) (S m1)) true) *) intro m. case m. simpl in |- *. tauto. simpl in |- *. split. discriminate. tauto. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. (* Goal: iff (@eq nat (S n1) (S m1)) (@eq bool (Nat.eqb (S n1) (S m1)) true) *) case m. simpl in |- *. split. discriminate. tauto. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. elim (H n1). (* Goal: iff (not (@eq Z x y)) (@eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false) *) split. (* Goal: iff (@eq nat (S n1) (S m1)) (@eq bool (Nat.eqb (S n1) (S m1)) true) *) intros. simpl in |- *. apply H0. injection H2. tauto. (* Goal: iff (@eq nat (S n1) (S m1)) (@eq bool (Nat.eqb (S n1) (S m1)) true) *) simpl in |- *. intros. rewrite (H1 H2). reflexivity. Qed. Lemma beq_nat_eq : forall n m : nat, n = m <-> beq_nat n m = true. Proof. (* Goal: forall n m : nat, iff (@eq nat n m) (@eq bool (Nat.eqb n m) true) *) simple induction n. (* Goal: not (@eq Z x y) *) intro. case m. (* Goal: iff (@eq nat (S n1) (S m1)) (@eq bool (Nat.eqb (S n1) (S m1)) true) *) simpl in |- *. split. reflexivity. reflexivity. (* Goal: not (@eq Z x y) *) simpl in |- *. split. intro. discriminate. intro. discriminate. (* Goal: iff (@eq nat (S n1) m) (@eq bool (Nat.eqb (S n1) m) true) *) intros n1 IH. intro m. case m. (* Goal: not (@eq Z x y) *) simpl in |- *. split. intro. discriminate. intro. discriminate. (* Goal: iff (@eq nat (S n1) (S m1)) (@eq bool (Nat.eqb (S n1) (S m1)) true) *) intro m1. intros. simpl in |- *. (* Goal: iff (not (@eq Z x y)) (@eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false) *) elim (IH m1). split. (* Goal: not (@eq Z x y) *) intro. injection H1. assumption. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. rewrite H0. reflexivity. assumption. Qed. Lemma beq_nat_neq : forall n m : nat, n <> m <-> beq_nat n m = false. Proof. (* Goal: forall n m : nat, iff (@eq nat n m) (@eq bool (Nat.eqb n m) true) *) simple induction n. (* Goal: not (@eq Z x y) *) intro. case m. simpl in |- *. split. (* Goal: not (@eq Z x y) *) intro. elim H. reflexivity. intro. discriminate. (* Goal: not (@eq Z x y) *) intro m1. simpl in |- *. split. reflexivity. intro. discriminate. (* Goal: iff (@eq nat (S n1) m) (@eq bool (Nat.eqb (S n1) m) true) *) intros n1 IH. intro m. case m. (* Goal: not (@eq Z x y) *) simpl in |- *. split. reflexivity. intro. discriminate. (* Goal: iff (@eq nat (S n1) (S m1)) (@eq bool (Nat.eqb (S n1) (S m1)) true) *) intro m1. simpl in |- *. (* Goal: iff (not (@eq Z x y)) (@eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false) *) elim (IH m1). split. (* Goal: not (@eq Z x y) *) intro. apply H. intro. elim H1. rewrite H2. reflexivity. (* Goal: not (@eq Z x y) *) intro. intro. elim H0. assumption. injection H2. intro. assumption. Qed. Lemma zeq_bool_eq : forall x y : Z, x = y <-> Zeq_bool x y = true. Proof. (* Goal: iff (not (@eq Z x y)) (@eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false) *) intros. elim (Zcompare_Eq_iff_eq x y). intros. unfold Zeq_bool in |- *. split. (* -> *) (* Goal: not (@eq Z x y) *) intro. rewrite H0. (* Goal: @eq Z x y *) reflexivity. assumption. (* <- *) (* Goal: not (@eq Z x y) *) intro. apply H. generalize H1. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison (Z.compare x y) Eq) (_ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false), not (@eq Z x y) *) elim (x ?= y)%Z. (* Goal: not (@eq Z x y) *) intro. reflexivity. (* Goal: not (@eq Z x y) *) intro. discriminate H2. (* Goal: not (@eq Z x y) *) intro. discriminate H2. Qed. Lemma zeq_bool_neq : forall x y : Z, x <> y <-> Zeq_bool x y = false. Proof. (* Goal: iff (not (@eq Z x y)) (@eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false) *) intros. elim (Zcompare_Eq_iff_eq x y). intros. unfold Zeq_bool in |- *. split. (* -> *) (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison (Z.compare x y) Eq) (_ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false), not (@eq Z x y) *) generalize H0. generalize H. elim (x ?= y)%Z. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. elim H3. apply H1. reflexivity. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. reflexivity. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. reflexivity. (* <- *) (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. generalize H1. generalize H0. elim (x ?= y)%Z. (* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *) intros. discriminate H3. (* Goal: not (@eq Z x y) *) intros. intro. cut (Datatypes.Lt = Datatypes.Eq). discriminate. (* Goal: @eq Z x y *) apply H2. assumption. (* Goal: not (@eq Z x y) *) intros. intro. cut (Datatypes.Gt = Datatypes.Eq). discriminate. (* Goal: @eq Z x y *) apply H2. assumption. Qed.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) (** natZ. Some lemmas about inject_nat, absolu and the relation between Z and nat in general. @author Olga Caprotti and Martijn Oostdijk @version $Revision$ *) Require Import ZArith. Require Import EqNat. Require Import lemmas. Lemma abs_opp : forall x : Z, Zabs_nat x = Zabs_nat (- x). Proof. (* Goal: forall (x : Z) (_ : not (@eq Z x Z0)), lt O (Z.abs_nat x) *) simple induction x. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. reflexivity. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. reflexivity. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. reflexivity. Qed. Lemma inj_abs_pos : forall x : Z, (x >= 0)%Z -> Z_of_nat (Zabs_nat x) = x. Proof. (* Goal: forall (x : Z) (_ : not (@eq Z x Z0)), lt O (Z.abs_nat x) *) simple induction x. (* Goal: @eq comparison Lt Lt *) reflexivity. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) intros. simpl in |- *. induction p as [p Hrecp| p Hrecp| ]. (* Goal: @eq Z (Z.of_nat (Pos.to_nat (xI p))) (Zpos (xI p)) *) (* Goal: @eq Z (Z.of_nat (Pos.to_nat (xO p))) (Zpos (xO p)) *) (* Goal: @eq Z (Z.of_nat (Pos.to_nat xH)) (Zpos xH) *) (* Goal: forall (p : positive) (_ : Z.ge (Zneg p) Z0), @eq Z (Z.of_nat (Z.abs_nat (Zneg p))) (Zneg p) *) rewrite BinInt.Zpos_xI. (* Goal: @eq Z (Z.of_nat (Pos.to_nat (xO p))) (Z.mul (Zpos (xO xH)) (Zpos p)) *) (* Goal: @eq Z (Z.of_nat (Pos.to_nat xH)) (Zpos xH) *) (* Goal: forall (p : positive) (_ : Z.ge (Zneg p) Z0), @eq Z (Z.of_nat (Z.abs_nat (Zneg p))) (Zneg p) *) rewrite <- Hrecp. (* Goal: @eq Z (Z.of_nat (Pos.to_nat (xI p))) (Z.add (Z.mul (Zpos (xO xH)) (Z.of_nat (Pos.to_nat p))) (Zpos xH)) *) (* Goal: Z.ge (Zpos p) Z0 *) (* Goal: @eq Z (Z.of_nat (Pos.to_nat (xO p))) (Zpos (xO p)) *) (* Goal: @eq Z (Z.of_nat (Pos.to_nat xH)) (Zpos xH) *) (* Goal: forall (p : positive) (_ : Z.ge (Zneg p) Z0), @eq Z (Z.of_nat (Z.abs_nat (Zneg p))) (Zneg p) *) replace (nat_of_P (xI p)) with (S (2 * nat_of_P p)). (* Goal: @eq Z (Z.of_nat (S (Init.Nat.mul (S (S O)) (Pos.to_nat p)))) (Z.add (Z.mul (Zpos (xO xH)) (Z.of_nat (Pos.to_nat p))) (Zpos xH)) *) (* Goal: @eq nat (S (Init.Nat.mul (S (S O)) (Pos.to_nat p))) (Pos.to_nat (xI p)) *) (* Goal: Z.ge (Zpos p) Z0 *) (* Goal: @eq Z (Z.of_nat (Pos.to_nat (xO p))) (Zpos (xO p)) *) (* Goal: @eq Z (Z.of_nat (Pos.to_nat xH)) (Zpos xH) *) (* Goal: forall (p : positive) (_ : Z.ge (Zneg p) Z0), @eq Z (Z.of_nat (Z.abs_nat (Zneg p))) (Zneg p) *) rewrite Znat.inj_S. (* Goal: @eq Z (Z.of_nat (Init.Nat.mul (S (S O)) (Pos.to_nat p))) (Z.mul (Zpos (xO xH)) (Z.of_nat (Pos.to_nat p))) *) (* Goal: @eq nat (Init.Nat.mul (S (S O)) (Pos.to_nat p)) (Pos.to_nat (xO p)) *) (* Goal: Z.ge (Zpos p) Z0 *) (* Goal: @eq Z (Z.of_nat (Pos.to_nat xH)) (Zpos xH) *) (* Goal: forall (p : positive) (_ : Z.ge (Zneg p) Z0), @eq Z (Z.of_nat (Z.abs_nat (Zneg p))) (Zneg p) *) rewrite Znat.inj_mult. (* Goal: @eq Z (Z.mul (Z.of_nat (S (S O))) (Z.of_nat (Pos.to_nat p))) (Z.mul (Zpos (xO xH)) (Z.of_nat (Pos.to_nat p))) *) (* Goal: @eq nat (Init.Nat.mul (S (S O)) (Pos.to_nat p)) (Pos.to_nat (xO p)) *) (* Goal: Z.ge (Zpos p) Z0 *) (* Goal: @eq Z (Z.of_nat (Pos.to_nat xH)) (Zpos xH) *) (* Goal: forall (p : positive) (_ : Z.ge (Zneg p) Z0), @eq Z (Z.of_nat (Z.abs_nat (Zneg p))) (Zneg p) *) rewrite Hrecp. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. (* Goal: @eq comparison Lt Lt *) reflexivity. (* Goal: Z.ge x (Zpos xH) *) apply Zle_ge. apply Zorder.Zle_0_pos. (* Goal: @eq nat (Init.Nat.mul (S (S O)) (Pos.to_nat p)) (Pos.to_nat (xO p)) *) (* Goal: Z.ge (Zpos p) Z0 *) (* Goal: @eq Z (Z.of_nat (Pos.to_nat xH)) (Zpos xH) *) (* Goal: forall (p : positive) (_ : Z.ge (Zneg p) Z0), @eq Z (Z.of_nat (Z.abs_nat (Zneg p))) (Zneg p) *) replace 2 with (nat_of_P 2). (* Goal: @eq nat (Pos.to_nat (Pos.mul p p0)) (Init.Nat.mul (Pos.to_nat p) (Pos.to_nat p0)) *) rewrite <- nat_of_P_mult_morphism. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. (* Goal: @eq nat (S (Pos.to_nat (xO p))) (Pos.to_nat (xI p)) *) (* Goal: @eq nat (Pos.to_nat (xO xH)) (S (S O)) *) (* Goal: Z.ge (Zpos p) Z0 *) (* Goal: @eq Z (Z.of_nat (Pos.to_nat (xO p))) (Zpos (xO p)) *) (* Goal: @eq Z (Z.of_nat (Pos.to_nat xH)) (Zpos xH) *) (* Goal: forall (p : positive) (_ : Z.ge (Zneg p) Z0), @eq Z (Z.of_nat (Z.abs_nat (Zneg p))) (Zneg p) *) rewrite <- nat_of_P_o_P_of_succ_nat_eq_succ. (* Goal: @eq nat (Pos.to_nat (Pos.of_succ_nat (Pos.to_nat (xO p)))) (Pos.to_nat (xI p)) *) (* Goal: @eq nat (Pos.to_nat (xO xH)) (S (S O)) *) (* Goal: Z.ge (Zpos p) Z0 *) (* Goal: @eq Z (Z.of_nat (Pos.to_nat (xO p))) (Zpos (xO p)) *) (* Goal: @eq Z (Z.of_nat (Pos.to_nat xH)) (Zpos xH) *) (* Goal: forall (p : positive) (_ : Z.ge (Zneg p) Z0), @eq Z (Z.of_nat (Z.abs_nat (Zneg p))) (Zneg p) *) rewrite P_of_succ_nat_o_nat_of_P_eq_succ. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. (* Goal: @eq comparison Lt Lt *) reflexivity. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. (* Goal: @eq comparison Lt Lt *) reflexivity. (* Goal: Z.ge x (Zpos xH) *) apply Zle_ge. apply Zorder.Zle_0_pos. (* Goal: @eq Z (Z.of_nat (Pos.to_nat (xO p))) (Zpos (xO p)) *) (* Goal: @eq Z (Z.of_nat (Pos.to_nat xH)) (Zpos xH) *) (* Goal: forall (p : positive) (_ : Z.ge (Zneg p) Z0), @eq Z (Z.of_nat (Z.abs_nat (Zneg p))) (Zneg p) *) rewrite BinInt.Zpos_xO. (* Goal: @eq Z (Z.of_nat (Pos.to_nat (xO p))) (Z.mul (Zpos (xO xH)) (Zpos p)) *) (* Goal: @eq Z (Z.of_nat (Pos.to_nat xH)) (Zpos xH) *) (* Goal: forall (p : positive) (_ : Z.ge (Zneg p) Z0), @eq Z (Z.of_nat (Z.abs_nat (Zneg p))) (Zneg p) *) rewrite <- Hrecp. (* Goal: @eq Z (Z.of_nat (Pos.to_nat (xO p))) (Z.mul (Zpos (xO xH)) (Z.of_nat (Pos.to_nat p))) *) (* Goal: Z.ge (Zpos p) Z0 *) (* Goal: @eq Z (Z.of_nat (Pos.to_nat xH)) (Zpos xH) *) (* Goal: forall (p : positive) (_ : Z.ge (Zneg p) Z0), @eq Z (Z.of_nat (Z.abs_nat (Zneg p))) (Zneg p) *) replace (nat_of_P (xO p)) with (2 * nat_of_P p). (* Goal: @eq Z (Z.of_nat (Init.Nat.mul (S (S O)) (Pos.to_nat p))) (Z.mul (Zpos (xO xH)) (Z.of_nat (Pos.to_nat p))) *) (* Goal: @eq nat (Init.Nat.mul (S (S O)) (Pos.to_nat p)) (Pos.to_nat (xO p)) *) (* Goal: Z.ge (Zpos p) Z0 *) (* Goal: @eq Z (Z.of_nat (Pos.to_nat xH)) (Zpos xH) *) (* Goal: forall (p : positive) (_ : Z.ge (Zneg p) Z0), @eq Z (Z.of_nat (Z.abs_nat (Zneg p))) (Zneg p) *) rewrite Znat.inj_mult. (* Goal: @eq Z (Z.mul (Z.of_nat (S (S O))) (Z.of_nat (Pos.to_nat p))) (Z.mul (Zpos (xO xH)) (Z.of_nat (Pos.to_nat p))) *) (* Goal: @eq nat (Init.Nat.mul (S (S O)) (Pos.to_nat p)) (Pos.to_nat (xO p)) *) (* Goal: Z.ge (Zpos p) Z0 *) (* Goal: @eq Z (Z.of_nat (Pos.to_nat xH)) (Zpos xH) *) (* Goal: forall (p : positive) (_ : Z.ge (Zneg p) Z0), @eq Z (Z.of_nat (Z.abs_nat (Zneg p))) (Zneg p) *) rewrite Hrecp. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. (* Goal: @eq comparison Lt Lt *) reflexivity. (* Goal: Z.ge x (Zpos xH) *) apply Zle_ge. apply Zorder.Zle_0_pos. (* Goal: @eq nat (Init.Nat.mul (S (S O)) (Pos.to_nat p)) (Pos.to_nat (xO p)) *) (* Goal: Z.ge (Zpos p) Z0 *) (* Goal: @eq Z (Z.of_nat (Pos.to_nat xH)) (Zpos xH) *) (* Goal: forall (p : positive) (_ : Z.ge (Zneg p) Z0), @eq Z (Z.of_nat (Z.abs_nat (Zneg p))) (Zneg p) *) replace 2 with (nat_of_P 2). (* Goal: @eq nat (Pos.to_nat (Pos.mul p p0)) (Init.Nat.mul (Pos.to_nat p) (Pos.to_nat p0)) *) rewrite <- nat_of_P_mult_morphism. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. (* Goal: @eq comparison Lt Lt *) reflexivity. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. (* Goal: @eq comparison Lt Lt *) reflexivity. (* Goal: Z.ge x (Zpos xH) *) apply Zle_ge. (* Goal: Z.le Z0 (Zpos p) *) (* Goal: @eq Z (Z.of_nat (Pos.to_nat xH)) (Zpos xH) *) (* Goal: forall (p : positive) (_ : Z.ge (Zneg p) Z0), @eq Z (Z.of_nat (Z.abs_nat (Zneg p))) (Zneg p) *) apply Zorder.Zle_0_pos. (* Goal: @eq comparison Lt Lt *) reflexivity. (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intros. (* Goal: lt O (Z.abs_nat Z0) *) (* Goal: forall (p : positive) (_ : not (@eq Z (Zpos p) Z0)), lt O (Z.abs_nat (Zpos p)) *) (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) elim H. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. (* Goal: @eq comparison Lt Lt *) reflexivity. Qed. Lemma inj_abs_neg : forall x : Z, (x < 0)%Z -> Z_of_nat (Zabs_nat x) = (- x)%Z. Proof. (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intros. (* Goal: @eq Z (Z.of_nat (Z.abs_nat x)) (Z.opp x) *) rewrite abs_opp. (* Goal: @eq Z (Z.of_nat (Z.abs_nat (Z.opp x))) (Z.opp x) *) apply inj_abs_pos. (* Goal: Z.ge x (Zpos xH) *) apply Zle_ge. (* Goal: Z.le Z0 (Z.opp x) *) apply Zplus_le_reg_l with x. (* Goal: Z.le (Z.add x Z0) (Z.add x (Z.opp x)) *) rewrite <- Zplus_0_r_reverse. (* Goal: Z.le x (Z.add x (Z.opp x)) *) rewrite Zplus_opp_r. (* Goal: Z.le Z0 x *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.ge x (Zpos xH) *) apply Zlt_le_weak. (* Goal: Z.lt Z0 x *) assumption. Qed. Lemma abs_inj : forall n : nat, Zabs_nat (Z_of_nat n) = n. Proof. (* Goal: forall n : nat, Z.ge (Z.of_nat n) Z0 *) simple induction n. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. reflexivity. (* Goal: forall (n : nat) (_ : @eq nat (Z.abs_nat (Z.of_nat n)) n), @eq nat (Z.abs_nat (Z.of_nat (S n))) (S n) *) intros m IH. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) rewrite <- IH. simpl in |- *. (* Goal: @eq nat (Pos.to_nat (Pos.of_succ_nat (Z.abs_nat (Z.of_nat m)))) (S (Z.abs_nat (Z.of_nat m))) *) rewrite nat_of_P_o_P_of_succ_nat_eq_succ. (* Goal: @eq comparison Lt Lt *) reflexivity. Qed. Lemma abs_mult : forall x y : Z, Zabs_nat (x * y) = Zabs_nat x * Zabs_nat y. Proof. (* Goal: forall (x : Z) (_ : not (@eq Z x Z0)), lt O (Z.abs_nat x) *) simple induction x. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. intro. reflexivity. (* Goal: forall _ : not (@eq Z Z0 Z0), lt O (Z.abs_nat Z0) *) (* Goal: forall (p : positive) (_ : not (@eq Z (Zpos p) Z0)), lt O (Z.abs_nat (Zpos p)) *) (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intro. (* Goal: forall (y : Z) (_ : Z.le Z0 (Zpos p)) (_ : Z.le Z0 y), @eq nat (Z.abs_nat (Z.add (Zpos p) y)) (Init.Nat.add (Z.abs_nat (Zpos p)) (Z.abs_nat y)) *) (* Goal: forall (p : positive) (y : Z) (_ : Z.le Z0 (Zneg p)) (_ : Z.le Z0 y), @eq nat (Z.abs_nat (Z.add (Zneg p) y)) (Init.Nat.add (Z.abs_nat (Zneg p)) (Z.abs_nat y)) *) simple induction y. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. (* Goal: @eq nat O (Init.Nat.mul (Pos.to_nat p) O) *) (* Goal: forall p0 : positive, @eq nat (Z.abs_nat (Z.mul (Zneg p) (Zpos p0))) (Init.Nat.mul (Z.abs_nat (Zneg p)) (Z.abs_nat (Zpos p0))) *) (* Goal: forall p0 : positive, @eq nat (Z.abs_nat (Z.mul (Zneg p) (Zneg p0))) (Init.Nat.mul (Z.abs_nat (Zneg p)) (Z.abs_nat (Zneg p0))) *) rewrite <- mult_n_O. (* Goal: @eq comparison Lt Lt *) reflexivity. (* Goal: forall _ : not (@eq Z Z0 Z0), lt O (Z.abs_nat Z0) *) (* Goal: forall (p : positive) (_ : not (@eq Z (Zpos p) Z0)), lt O (Z.abs_nat (Zpos p)) *) (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intro. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. (* Goal: @eq nat (Pos.to_nat (Pos.mul p p0)) (Init.Nat.mul (Pos.to_nat p) (Pos.to_nat p0)) *) rewrite <- nat_of_P_mult_morphism. (* Goal: @eq comparison Lt Lt *) reflexivity. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. (* Goal: forall _ : not (@eq Z Z0 Z0), lt O (Z.abs_nat Z0) *) (* Goal: forall (p : positive) (_ : not (@eq Z (Zpos p) Z0)), lt O (Z.abs_nat (Zpos p)) *) (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intro. (* Goal: @eq nat (Pos.to_nat (Pos.mul p p0)) (Init.Nat.mul (Pos.to_nat p) (Pos.to_nat p0)) *) rewrite <- nat_of_P_mult_morphism. (* Goal: @eq comparison Lt Lt *) reflexivity. (* Goal: forall _ : not (@eq Z Z0 Z0), lt O (Z.abs_nat Z0) *) (* Goal: forall (p : positive) (_ : not (@eq Z (Zpos p) Z0)), lt O (Z.abs_nat (Zpos p)) *) (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intro. (* Goal: forall (y : Z) (_ : Z.le Z0 (Zpos p)) (_ : Z.le Z0 y), @eq nat (Z.abs_nat (Z.add (Zpos p) y)) (Init.Nat.add (Z.abs_nat (Zpos p)) (Z.abs_nat y)) *) (* Goal: forall (p : positive) (y : Z) (_ : Z.le Z0 (Zneg p)) (_ : Z.le Z0 y), @eq nat (Z.abs_nat (Z.add (Zneg p) y)) (Init.Nat.add (Z.abs_nat (Zneg p)) (Z.abs_nat y)) *) simple induction y. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. (* Goal: @eq nat O (Init.Nat.mul (Pos.to_nat p) O) *) (* Goal: forall p0 : positive, @eq nat (Z.abs_nat (Z.mul (Zneg p) (Zpos p0))) (Init.Nat.mul (Z.abs_nat (Zneg p)) (Z.abs_nat (Zpos p0))) *) (* Goal: forall p0 : positive, @eq nat (Z.abs_nat (Z.mul (Zneg p) (Zneg p0))) (Init.Nat.mul (Z.abs_nat (Zneg p)) (Z.abs_nat (Zneg p0))) *) rewrite <- mult_n_O. (* Goal: @eq comparison Lt Lt *) reflexivity. (* Goal: forall _ : not (@eq Z Z0 Z0), lt O (Z.abs_nat Z0) *) (* Goal: forall (p : positive) (_ : not (@eq Z (Zpos p) Z0)), lt O (Z.abs_nat (Zpos p)) *) (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intro. (* Goal: @eq nat (Z.abs_nat (Z.mul (Zneg p) (Zneg p0))) (Init.Nat.mul (Z.abs_nat (Zneg p)) (Z.abs_nat (Zneg p0))) *) unfold Zabs_nat in |- *. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. (* Goal: @eq nat (Pos.to_nat (Pos.mul p p0)) (Init.Nat.mul (Pos.to_nat p) (Pos.to_nat p0)) *) rewrite <- nat_of_P_mult_morphism. (* Goal: @eq comparison Lt Lt *) reflexivity. (* Goal: forall _ : not (@eq Z Z0 Z0), lt O (Z.abs_nat Z0) *) (* Goal: forall (p : positive) (_ : not (@eq Z (Zpos p) Z0)), lt O (Z.abs_nat (Zpos p)) *) (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intro. (* Goal: @eq nat (Z.abs_nat (Z.mul (Zneg p) (Zneg p0))) (Init.Nat.mul (Z.abs_nat (Zneg p)) (Z.abs_nat (Zneg p0))) *) unfold Zabs_nat in |- *. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. (* Goal: @eq nat (Pos.to_nat (Pos.mul p p0)) (Init.Nat.mul (Pos.to_nat p) (Pos.to_nat p0)) *) rewrite <- nat_of_P_mult_morphism. (* Goal: @eq comparison Lt Lt *) reflexivity. Qed. Lemma isnat_inj_abs : forall (x : Z) (n : nat), x = Z_of_nat n -> n = Zabs_nat x. Proof. (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intros. (* Goal: @eq nat n (Z.abs_nat x) *) rewrite H. (* Goal: @eq nat (Init.Nat.sub nx ny) (Init.Nat.sub nx (Z.abs_nat (Z.of_nat ny))) *) (* Goal: le ny nx *) (* Goal: Z.le Z0 (Z.sub x y) *) (* Goal: Z.le Z0 y *) (* Goal: Z.le Z0 x *) rewrite abs_inj. (* Goal: @eq comparison Lt Lt *) reflexivity. Qed. Lemma isnat_abs_inj : forall (x : Z) (n : nat), (0 <= x)%Z -> n = Zabs_nat x -> x = Z_of_nat n. Proof. (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intros. (* Goal: @eq Z x (Z.of_nat n) *) rewrite H0. (* Goal: @eq Z x (Z.of_nat (Z.abs_nat x)) *) rewrite inj_abs_pos. (* Goal: @eq comparison Lt Lt *) reflexivity. (* Goal: Z.ge x (Zpos xH) *) apply Zle_ge. (* Goal: Z.lt Z0 x *) assumption. Qed. Lemma isnat_plus : forall x y : Z, (0 <= x)%Z -> (0 <= y)%Z -> (0 <= x + y)%Z. Proof. (* Goal: forall (x : Z) (_ : not (@eq Z x Z0)), lt O (Z.abs_nat x) *) simple induction x. simpl in |- *. intros. assumption. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) intro. simple induction y. simpl in |- *. intros. assumption. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. intros. unfold Zle in |- *. simpl in |- *. discriminate. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) intros. unfold Zle in H0. elim H0. simpl in |- *. reflexivity. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) intros. unfold Zle in H. elim H. simpl in |- *. reflexivity. Qed. Lemma isnat_mult : forall x y : Z, (0 <= x)%Z -> (0 <= y)%Z -> (0 <= x * y)%Z. Proof. (* Goal: forall (x : Z) (_ : not (@eq Z x Z0)), lt O (Z.abs_nat x) *) simple induction x. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. intros. unfold Zle in |- *. simpl in |- *. discriminate. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) intro. simple induction y. simpl in |- *. intros. unfold Zle in |- *. simpl in |- *. discriminate. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. intros. unfold Zle in |- *. simpl in |- *. discriminate. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) intros. unfold Zle in H0. elim H0. simpl in |- *. reflexivity. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) intros. unfold Zle in H. elim H. simpl in |- *. reflexivity. Qed. Lemma lezle : forall x y : Z, (0 <= x)%Z -> (0 <= y)%Z -> (x <= y)%Z -> Zabs_nat x <= Zabs_nat y. Proof. (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intros. (* Goal: gt (Z.abs_nat x) (Z.abs_nat y) *) elim (le_or_lt (Zabs_nat x) (Zabs_nat y)). (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intros. assumption. (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intros. elim (Zlt_not_le y x). (* Goal: Z.le x y *) (* Goal: Z.lt y x *) (* Goal: forall _ : lt (Z.abs_nat y) (Z.abs_nat x), gt (Z.abs_nat x) (Z.abs_nat y) *) rewrite <- (inj_abs_pos x). (* Goal: Z.le (Z.of_nat (Z.abs_nat x)) y *) (* Goal: Z.ge x Z0 *) (* Goal: Z.lt y x *) (* Goal: forall _ : lt (Z.abs_nat y) (Z.abs_nat x), gt (Z.abs_nat x) (Z.abs_nat y) *) rewrite <- (inj_abs_pos y). (* Goal: Z.lt Z0 x *) apply Znat.inj_lt. assumption. (* Goal: Z.ge x (Zpos xH) *) apply Zle_ge. assumption. (* Goal: Z.ge x (Zpos xH) *) apply Zle_ge. assumption. (* Goal: Z.lt Z0 x *) assumption. Qed. Lemma gtzgt : forall x y : Z, (0 <= x)%Z -> (0 <= y)%Z -> (x > y)%Z -> Zabs_nat x > Zabs_nat y. Proof. (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intros. (* Goal: gt (Z.abs_nat x) (Z.abs_nat y) *) elim (le_or_lt (Zabs_nat x) (Zabs_nat y)). (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intros. (* Goal: gt (Z.abs_nat x) (Z.abs_nat y) *) (* Goal: forall _ : lt (Z.abs_nat y) (Z.abs_nat x), gt (Z.abs_nat x) (Z.abs_nat y) *) elim (Zle_not_lt x y). (* Goal: Z.le x y *) (* Goal: Z.lt y x *) (* Goal: forall _ : lt (Z.abs_nat y) (Z.abs_nat x), gt (Z.abs_nat x) (Z.abs_nat y) *) rewrite <- (inj_abs_pos x). (* Goal: Z.le (Z.of_nat (Z.abs_nat x)) y *) (* Goal: Z.ge x Z0 *) (* Goal: Z.lt y x *) (* Goal: forall _ : lt (Z.abs_nat y) (Z.abs_nat x), gt (Z.abs_nat x) (Z.abs_nat y) *) rewrite <- (inj_abs_pos y). (* Goal: Z.lt Z0 x *) apply Znat.inj_le. assumption. (* Goal: Z.ge x (Zpos xH) *) apply Zle_ge. assumption. (* Goal: Z.ge x (Zpos xH) *) apply Zle_ge. assumption. (* Goal: Z.lt Z0 x *) apply Zgt_lt. assumption. (* Goal: Z.lt Z0 x *) unfold gt in |- *. intro. assumption. Qed. Lemma ltzlt : forall x y : Z, (0 <= x)%Z -> (0 <= y)%Z -> (x < y)%Z -> Zabs_nat x < Zabs_nat y. Proof. (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intros. (* Goal: lt (Z.abs_nat x) (Z.abs_nat y) *) change (Zabs_nat y > Zabs_nat x) in |- *. (* Goal: Z.lt Z0 x *) apply gtzgt. assumption. assumption. (* Goal: Z.lt Z0 x *) apply Zlt_gt. assumption. Qed. Lemma abs_plus_pos : forall x y : Z, (0 <= x)%Z -> (0 <= y)%Z -> Zabs_nat (x + y) = Zabs_nat x + Zabs_nat y. Proof. (* Goal: forall (x : Z) (_ : not (@eq Z x Z0)), lt O (Z.abs_nat x) *) simple induction x. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intros. (* Goal: @eq comparison Lt Lt *) reflexivity. (* Goal: forall _ : not (@eq Z Z0 Z0), lt O (Z.abs_nat Z0) *) (* Goal: forall (p : positive) (_ : not (@eq Z (Zpos p) Z0)), lt O (Z.abs_nat (Zpos p)) *) (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intro. (* Goal: forall (y : Z) (_ : Z.le Z0 (Zpos p)) (_ : Z.le Z0 y), @eq nat (Z.abs_nat (Z.add (Zpos p) y)) (Init.Nat.add (Z.abs_nat (Zpos p)) (Z.abs_nat y)) *) (* Goal: forall (p : positive) (y : Z) (_ : Z.le Z0 (Zneg p)) (_ : Z.le Z0 y), @eq nat (Z.abs_nat (Z.add (Zneg p) y)) (Init.Nat.add (Z.abs_nat (Zneg p)) (Z.abs_nat y)) *) simple induction y. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. (* Goal: forall (_ : Z.le Z0 (Zpos p)) (_ : Z.le Z0 Z0), @eq nat (Pos.to_nat p) (Init.Nat.add (Pos.to_nat p) O) *) (* Goal: forall (p0 : positive) (_ : Z.le Z0 (Zpos p)) (_ : Z.le Z0 (Zpos p0)), @eq nat (Z.abs_nat (Z.add (Zpos p) (Zpos p0))) (Init.Nat.add (Z.abs_nat (Zpos p)) (Z.abs_nat (Zpos p0))) *) (* Goal: forall (p0 : positive) (_ : Z.le Z0 (Zpos p)) (_ : Z.le Z0 (Zneg p0)), @eq nat (Z.abs_nat (Z.add (Zpos p) (Zneg p0))) (Init.Nat.add (Z.abs_nat (Zpos p)) (Z.abs_nat (Zneg p0))) *) (* Goal: forall (p : positive) (y : Z) (_ : Z.le Z0 (Zneg p)) (_ : Z.le Z0 y), @eq nat (Z.abs_nat (Z.add (Zneg p) y)) (Init.Nat.add (Z.abs_nat (Zneg p)) (Z.abs_nat y)) *) rewrite <- plus_n_O. (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intros. (* Goal: @eq comparison Lt Lt *) reflexivity. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intros. (* Goal: @eq nat (Pos.to_nat (Pos.add p p0)) (Init.Nat.add (Pos.to_nat p) (Pos.to_nat p0)) *) (* Goal: forall (p0 : positive) (_ : Z.le Z0 (Zpos p)) (_ : Z.le Z0 (Zneg p0)), @eq nat (Z.abs_nat (Z.add (Zpos p) (Zneg p0))) (Init.Nat.add (Z.abs_nat (Zpos p)) (Z.abs_nat (Zneg p0))) *) (* Goal: forall (p : positive) (y : Z) (_ : Z.le Z0 (Zneg p)) (_ : Z.le Z0 y), @eq nat (Z.abs_nat (Z.add (Zneg p) y)) (Init.Nat.add (Z.abs_nat (Zneg p)) (Z.abs_nat y)) *) apply nat_of_P_plus_morphism. (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intros. (* Goal: @eq nat (Z.abs_nat (Z.add (Zpos p) (Zneg p0))) (Init.Nat.add (Z.abs_nat (Zpos p)) (Z.abs_nat (Zneg p0))) *) (* Goal: forall (p : positive) (y : Z) (_ : Z.le Z0 (Zneg p)) (_ : Z.le Z0 y), @eq nat (Z.abs_nat (Z.add (Zneg p) y)) (Init.Nat.add (Z.abs_nat (Zneg p)) (Z.abs_nat y)) *) unfold Zle in H0. (* Goal: @eq nat (Z.abs_nat (Z.add (Zpos p) (Zneg p0))) (Init.Nat.add (Z.abs_nat (Zpos p)) (Z.abs_nat (Zneg p0))) *) (* Goal: forall (p : positive) (y : Z) (_ : Z.le Z0 (Zneg p)) (_ : Z.le Z0 y), @eq nat (Z.abs_nat (Z.add (Zneg p) y)) (Init.Nat.add (Z.abs_nat (Zneg p)) (Z.abs_nat y)) *) simpl in H0. (* Goal: @eq nat (Z.abs_nat (Z.add (Zpos p) (Zneg p0))) (Init.Nat.add (Z.abs_nat (Zpos p)) (Z.abs_nat (Zneg p0))) *) (* Goal: forall (p : positive) (y : Z) (_ : Z.le Z0 (Zneg p)) (_ : Z.le Z0 y), @eq nat (Z.abs_nat (Z.add (Zneg p) y)) (Init.Nat.add (Z.abs_nat (Zneg p)) (Z.abs_nat y)) *) elim H0. (* Goal: @eq comparison Lt Lt *) reflexivity. (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intros. (* Goal: @eq nat (Z.abs_nat (Z.add (Zneg p) y)) (Init.Nat.add (Z.abs_nat (Zneg p)) (Z.abs_nat y)) *) unfold Zle in H. (* Goal: @eq nat (Z.abs_nat (Z.add (Zneg p) y)) (Init.Nat.add (Z.abs_nat (Zneg p)) (Z.abs_nat y)) *) simpl in H. (* Goal: lt O (Z.abs_nat Z0) *) (* Goal: forall (p : positive) (_ : not (@eq Z (Zpos p) Z0)), lt O (Z.abs_nat (Zpos p)) *) (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) elim H. (* Goal: @eq comparison Lt Lt *) reflexivity. Qed. Lemma abs_minus_pos : forall x y : Z, (0 <= x)%Z -> (0 <= y)%Z -> (x >= y)%Z -> Zabs_nat (x - y) = Zabs_nat x - Zabs_nat y. Proof. (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intros. (* Goal: @eq nat (Z.abs_nat (Z.sub x y)) (Init.Nat.sub (Z.abs_nat x) (Z.abs_nat y)) *) elim (Z_of_nat_complete x). (* Goal: forall (x0 : nat) (_ : @eq Z x (Z.of_nat x0)), @eq nat (Z.abs_nat (Z.sub x y)) (Init.Nat.sub (Z.abs_nat x) (Z.abs_nat y)) *) (* Goal: Z.le Z0 x *) intros nx Hx. (* Goal: @eq nat (Z.abs_nat (Z.sub x y)) (Init.Nat.sub (Z.abs_nat x) (Z.abs_nat y)) *) (* Goal: Z.le Z0 x *) elim (Z_of_nat_complete y). (* Goal: forall (x0 : nat) (_ : @eq Z y (Z.of_nat x0)), @eq nat (Z.abs_nat (Z.sub x y)) (Init.Nat.sub (Z.abs_nat x) (Z.abs_nat y)) *) (* Goal: Z.le Z0 y *) (* Goal: Z.le Z0 x *) intros ny Hy. (* Goal: @eq nat (Z.abs_nat (Z.sub x y)) (Init.Nat.sub (Z.abs_nat x) (Z.abs_nat y)) *) (* Goal: Z.le Z0 y *) (* Goal: Z.le Z0 x *) elim (Z_of_nat_complete (x - y)). (* Goal: forall (x0 : nat) (_ : @eq Z (Z.sub x y) (Z.of_nat x0)), @eq nat (Z.abs_nat (Z.sub x y)) (Init.Nat.sub (Z.abs_nat x) (Z.abs_nat y)) *) (* Goal: Z.le Z0 (Z.sub x y) *) (* Goal: Z.le Z0 y *) (* Goal: Z.le Z0 x *) intros d Hd. (* Goal: @eq nat (Z.abs_nat (Z.sub x y)) (Init.Nat.sub (Z.abs_nat x) (Z.abs_nat y)) *) (* Goal: Z.le Z0 (Z.sub x y) *) (* Goal: Z.le Z0 y *) (* Goal: Z.le Z0 x *) rewrite Hx. (* Goal: @eq nat (Z.abs_nat (Z.sub (Z.of_nat nx) y)) (Init.Nat.sub (Z.abs_nat (Z.of_nat nx)) (Z.abs_nat y)) *) (* Goal: Z.le Z0 (Z.sub x y) *) (* Goal: Z.le Z0 y *) (* Goal: Z.le Z0 x *) rewrite Hy. (* Goal: @eq nat (Z.abs_nat (Z.sub (Z.of_nat nx) (Z.of_nat ny))) (Init.Nat.sub (Z.abs_nat (Z.of_nat nx)) (Z.abs_nat (Z.of_nat ny))) *) (* Goal: Z.le Z0 (Z.sub x y) *) (* Goal: Z.le Z0 y *) (* Goal: Z.le Z0 x *) rewrite <- Znat.inj_minus1. (* Goal: @eq nat (Init.Nat.sub nx ny) (Init.Nat.sub nx (Z.abs_nat (Z.of_nat ny))) *) (* Goal: le ny nx *) (* Goal: Z.le Z0 (Z.sub x y) *) (* Goal: Z.le Z0 y *) (* Goal: Z.le Z0 x *) rewrite abs_inj. (* Goal: @eq nat (Init.Nat.sub nx ny) (Init.Nat.sub nx (Z.abs_nat (Z.of_nat ny))) *) (* Goal: le ny nx *) (* Goal: Z.le Z0 (Z.sub x y) *) (* Goal: Z.le Z0 y *) (* Goal: Z.le Z0 x *) rewrite abs_inj. (* Goal: @eq nat (Init.Nat.sub nx ny) (Init.Nat.sub nx (Z.abs_nat (Z.of_nat ny))) *) (* Goal: le ny nx *) (* Goal: Z.le Z0 (Z.sub x y) *) (* Goal: Z.le Z0 y *) (* Goal: Z.le Z0 x *) rewrite abs_inj. (* Goal: @eq comparison Lt Lt *) reflexivity. (* Goal: le ny nx *) (* Goal: Z.le Z0 (Z.sub x y) *) (* Goal: Z.le Z0 y *) (* Goal: Z.le Z0 x *) rewrite (isnat_inj_abs x nx). (* Goal: le ny (Z.abs_nat x) *) (* Goal: @eq Z x (Z.of_nat nx) *) (* Goal: Z.le Z0 (Z.sub x y) *) (* Goal: Z.le Z0 y *) (* Goal: Z.le Z0 x *) rewrite (isnat_inj_abs y ny). (* Goal: le (Z.abs_nat y) (Z.abs_nat x) *) (* Goal: @eq Z y (Z.of_nat ny) *) (* Goal: @eq Z x (Z.of_nat nx) *) (* Goal: Z.le Z0 (Z.sub x y) *) (* Goal: Z.le Z0 y *) (* Goal: Z.le Z0 x *) apply lezle. (* Goal: Z.lt Z0 x *) assumption. (* Goal: Z.lt Z0 x *) assumption. (* Goal: Z.le y x *) (* Goal: Z.le Z0 y *) (* Goal: Z.le Z0 x *) apply Zge_le. (* Goal: Z.lt Z0 x *) assumption. (* Goal: Z.lt Z0 x *) assumption. (* Goal: Z.lt Z0 x *) assumption. (* Goal: Z.le Z0 (Z.sub x y) *) (* Goal: Z.le Z0 y *) (* Goal: Z.le Z0 x *) unfold Zminus in |- *. (* Goal: Z.le Z0 (Z.add x (Z.opp y)) *) (* Goal: Z.le Z0 y *) (* Goal: Z.le Z0 x *) apply Zle_left. (* Goal: Z.le y x *) (* Goal: Z.le Z0 y *) (* Goal: Z.le Z0 x *) apply Zge_le. (* Goal: Z.lt Z0 x *) assumption. (* Goal: Z.lt Z0 x *) assumption. (* Goal: Z.lt Z0 x *) assumption. Qed. Lemma abs_pred_pos : forall x : Z, (0 < x)%Z -> pred (Zabs_nat x) = Zabs_nat (x - 1). Proof. (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intros. (* Goal: @eq nat (Init.Nat.pred (Z.abs_nat x)) (Z.abs_nat (Z.sub x (Zpos xH))) *) rewrite abs_minus_pos. (* Goal: @eq nat (Init.Nat.pred (Z.abs_nat x)) (Init.Nat.sub (Z.abs_nat x) (Z.abs_nat (Zpos xH))) *) (* Goal: Z.le Z0 x *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.ge x (Zpos xH) *) replace (Zabs_nat 1) with 1. (* Goal: @eq nat (Init.Nat.pred (Z.abs_nat x)) (Init.Nat.sub (Z.abs_nat x) (S O)) *) (* Goal: @eq nat (S O) (Z.abs_nat (Zpos xH)) *) (* Goal: Z.le Z0 x *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.ge x (Zpos xH) *) rewrite predminus1. (* Goal: @eq comparison Lt Lt *) reflexivity. (* Goal: @eq comparison Lt Lt *) reflexivity. (* Goal: Z.le Z0 x *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.ge x (Zpos xH) *) apply Zlt_le_weak. (* Goal: Z.lt Z0 x *) assumption. (* Goal: Z.le Z0 (Zpos p) *) (* Goal: Z.lt Z0 (Zpos p) *) unfold Zle in |- *. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. (* Goal: not (@eq comparison Eq Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) discriminate. (* Goal: Z.ge x (Zpos xH) *) apply Zle_ge. (* Goal: Z.le (Zpos xH) x *) change (Zsucc 0 <= x)%Z in |- *. (* Goal: Z.le (Z.succ Z0) x *) apply Zlt_le_succ. (* Goal: Z.lt Z0 x *) assumption. Qed. Lemma abs_neq_lt : forall x : Z, x <> 0%Z -> 0 < Zabs_nat x. Proof. (* Goal: forall (x : Z) (_ : not (@eq Z x Z0)), lt O (Z.abs_nat x) *) simple induction x. (* Goal: @eq comparison Lt Lt *) intro. elim H. reflexivity. (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intros. change (Zabs_nat 0 < Zabs_nat (Zpos p)) in |- *. apply ltzlt. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) unfold Zle in |- *. simpl in |- *. discriminate. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) unfold Zle in |- *. simpl in |- *. discriminate. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) unfold Zlt in |- *. simpl in |- *. reflexivity. (* Goal: forall (p : positive) (_ : not (@eq Z (Zneg p) Z0)), lt O (Z.abs_nat (Zneg p)) *) intros. change (Zabs_nat 0 < Zabs_nat (Zpos p)) in |- *. apply ltzlt. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) unfold Zle in |- *. simpl in |- *. discriminate. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) unfold Zle in |- *. simpl in |- *. discriminate. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) unfold Zlt in |- *. simpl in |- *. reflexivity. Qed. Lemma nat_ge_0 : forall n : nat, (Z_of_nat n >= 0)%Z. Proof. (* Goal: forall n : nat, Z.ge (Z.of_nat n) Z0 *) simple induction n. (* Goal: not (@eq comparison (Z.compare Z0 Z0) Lt) *) (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) simpl in |- *. unfold Zge in |- *. simpl in |- *. discriminate. (* Goal: forall (n : nat) (_ : Z.ge (Z.of_nat n) Z0), Z.ge (Z.of_nat (S n)) Z0 *) intros m IHm. (* Goal: Z.ge (Z.of_nat (S m)) Z0 *) change (Z_of_nat (S m) >= Z_of_nat 0)%Z in |- *. (* Goal: Z.ge (Z.of_nat (S m)) (Z.of_nat O) *) apply Znat.inj_ge. unfold ge in |- *. (* Goal: le O (S m) *) apply le_O_n. Qed.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) (** order. The order of elements in the multgroup modulo p. @author Olga Caprotti and Martijn Oostdijk @version $Revision$ *) Require Import Arith. Require Import ZArith. Require Import Wf_nat. Require Import lemmas. Require Import natZ. Require Import dec. Require Import list. Require Import exp. Require Import divides. Require Import prime. Require Import modulo. Require Import modprime. Require Import fermat. (** (Order b q p) means the order of b is q in multgroup(Z_p). *) Definition Order (b : Z) (q p : nat) := 0 < q /\ Mod (Exp b q) 1 p /\ (forall d : nat, 0 < d -> Mod (Exp b d) 1 p -> q <= d). Lemma orderdec : forall (b : Z) (q p : nat), Order b q p \/ ~ Order b q p. Proof. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) intros. unfold Order in |- *. (* Goal: or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) apply anddec. (* Goal: or (lt O n) (not (lt O n)) *) (* Goal: or (Mod (Exp b n) (Zpos xH) p) (not (Mod (Exp b n) (Zpos xH) p)) *) apply ltdec. (* Goal: or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) apply anddec. (* Goal: or (Mod (Exp b n) (Zpos xH) p) (not (Mod (Exp b n) (Zpos xH) p)) *) apply moddec. (* Goal: or (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) (not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d)) *) elim (exdec (fun d : nat => 0 < d /\ Mod (Exp b d) 1 p) q). (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) right. intros. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) elim H. intro d. intros. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) elim H0. intros. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) elim H2. intros. (* Goal: not (Mod b Z0 p) *) intro. elim (le_not_lt q d). (* Goal: le x r *) apply H5. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) left. intros. (* Goal: le q d *) (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) elim (le_or_lt q d). (* Goal: not (Mod b Z0 p) *) intro. assumption. (* Goal: not (Mod b Z0 p) *) intro. (* Goal: le q (Init.Nat.pred p) *) elim H. (* Goal: @ex nat (fun x : nat => and (lt x X) (and (lt O x) (Mod (Exp b x) (Zpos xH) p))) *) (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) split with d. (* Goal: and (lt O (Init.Nat.pred p)) (Mod (Exp b (Init.Nat.pred p)) (Zpos xH) p) *) split. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. (* Goal: and (lt O (Init.Nat.pred p)) (Mod (Exp b (Init.Nat.pred p)) (Zpos xH) p) *) split. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. (* Goal: not (Mod b Z0 p) *) intro. (* Goal: or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) apply anddec. (* Goal: or (lt O n) (not (lt O n)) *) (* Goal: or (Mod (Exp b n) (Zpos xH) p) (not (Mod (Exp b n) (Zpos xH) p)) *) apply ltdec. (* Goal: or (Mod (Exp b n) (Zpos xH) p) (not (Mod (Exp b n) (Zpos xH) p)) *) apply moddec. Qed. Lemma order_ex1 : forall (b : Z) (p : nat), Prime p -> (exists d : nat, 0 < d /\ Mod (Exp b d) 1 p) -> exists x : nat, Order b x p. Proof. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) intros. elim H0. (* Goal: not (Mod b Z0 p) *) intro. apply (lt_wf_ind x). (* Goal: forall (n : nat) (_ : forall (m : nat) (_ : lt m n) (_ : and (lt O m) (Mod (Exp b m) (Zpos xH) p)), @ex nat (fun x : nat => Order b x p)) (_ : and (lt O n) (Mod (Exp b n) (Zpos xH) p)), @ex nat (fun x : nat => Order b x p) *) intros X IH. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) intros. (* Goal: @ex nat (fun x : nat => Order b x p) *) elim (exdec (fun m : nat => 0 < m /\ Mod (Exp b m) 1 p) X). (* Goal: not (Mod b Z0 p) *) intro. (* Goal: le X d *) (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) elim H2. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) intros. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) elim H3. intros. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) elim H5. intros. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) elim (IH x0). intros. (* Goal: @ex nat (fun x : nat => Order b x p) *) (* Goal: lt x0 X *) (* Goal: and (lt O x0) (Mod (Exp b x0) (Zpos xH) p) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x X) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), @ex nat (fun x : nat => Order b x p) *) (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) split with x1. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. (* Goal: Mod (Exp b q) (Zpos xH) p *) split. assumption. assumption. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) intros. split with X. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) elim H1. intros. (* Goal: and (lt O (Init.Nat.pred p)) (Mod (Exp b (Init.Nat.pred p)) (Zpos xH) p) *) split. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. (* Goal: and (lt O (Init.Nat.pred p)) (Mod (Exp b (Init.Nat.pred p)) (Zpos xH) p) *) split. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) intros. (* Goal: le X d *) (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) elim (le_or_lt X d). (* Goal: not (Mod b Z0 p) *) intro. assumption. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) intros. (* Goal: le X d *) (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) elim H2. (* Goal: @ex nat (fun x : nat => and (lt x X) (and (lt O x) (Mod (Exp b x) (Zpos xH) p))) *) (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) split with d. (* Goal: and (lt O (Init.Nat.pred p)) (Mod (Exp b (Init.Nat.pred p)) (Zpos xH) p) *) split. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. (* Goal: and (lt O (Init.Nat.pred p)) (Mod (Exp b (Init.Nat.pred p)) (Zpos xH) p) *) split. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. (* Goal: or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) intro. apply anddec. apply ltdec. apply moddec. Qed. Lemma order_ex : forall (b : Z) (p : nat), Prime p -> ~ Mod b 0 p -> exists x : nat, x < p /\ Order b x p. Proof. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) intros. (* Goal: le q (Init.Nat.pred p) *) elim H. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) intros. (* Goal: @ex nat (fun x : nat => and (lt x p) (Order b x p)) *) elim (order_ex1 b p H). (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) intros. (* Goal: @ex nat (fun x : nat => and (lt x p) (Order b x p)) *) (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) split with x. (* Goal: and (lt O (Init.Nat.pred p)) (Mod (Exp b (Init.Nat.pred p)) (Zpos xH) p) *) split. (* Goal: lt x p *) (* Goal: Order b x p *) (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) apply le_lt_trans with (pred p). (* Goal: Divides x y *) elim H3. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) intros. (* Goal: le x (Init.Nat.pred p) *) (* Goal: lt (Init.Nat.pred p) p *) (* Goal: Order b x p *) (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) elim H5. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) intros. (* Goal: le x (Init.Nat.pred p) *) (* Goal: lt (Init.Nat.pred p) p *) (* Goal: Order b x p *) (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) apply (H7 (pred p)). (* Goal: lt O (Init.Nat.pred p) *) (* Goal: Mod (Exp b (Init.Nat.pred p)) (Zpos xH) p *) apply lt_pred. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. (* Goal: Mod (Exp b q) (Zpos xH) p *) apply flt. assumption. assumption. (* Goal: lt (Init.Nat.pred p) p *) (* Goal: Order b x p *) (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) apply lt_pred_n_n. (* Goal: Mod (Exp b q) (Zpos xH) p *) apply lt_trans with 1. apply lt_O_Sn. assumption. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) split with (pred p). (* Goal: and (lt O (Init.Nat.pred p)) (Mod (Exp b (Init.Nat.pred p)) (Zpos xH) p) *) split. (* Goal: lt O (Init.Nat.pred p) *) (* Goal: Mod (Exp b (Init.Nat.pred p)) (Zpos xH) p *) apply lt_pred. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. (* Goal: Mod (Exp b q) (Zpos xH) p *) apply flt. assumption. assumption. Qed. Lemma order_div : forall (b : Z) (x p : nat), Order b x p -> forall y : nat, 0 < y -> Mod (Exp b y) 1 p -> Divides x y. Proof. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) intros. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) elim H. intros. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) elim H3. intros. (* Goal: not (Mod b Z0 p) *) elim (divdec y x). intro. assumption. intro. (* Goal: Divides x y *) elim (notdiv_rem x y H2 H6). (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) intro q. intros. elim H7. intro r. intros. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) elim H8. intros. elim H10. intros. (* Goal: Divides x y *) rewrite H12 in H1. (* Goal: Divides x y *) elim (lt_not_le r x). (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. (* Goal: le x r *) apply H5. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. (* Goal: Mod (Exp b r) (Zpos xH) p *) apply mod_trans with (Exp b (q * x) * Exp b r)%Z. (* Goal: Mod (Exp b r) (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) p *) (* Goal: Mod (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) (Zpos xH) p *) apply mod_trans with (Exp (Exp b x) q * Exp b r)%Z. (* Goal: Mod (Exp b r) (Z.mul (Exp (Exp b x) q) (Exp b r)) p *) (* Goal: Mod (Z.mul (Exp (Exp b x) q) (Exp b r)) (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) p *) (* Goal: Mod (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) (Zpos xH) p *) pattern (Exp b r) at 1 in |- *. (* Goal: (fun z : Z => Mod z (Z.mul (Exp (Exp b x) q) (Exp b r)) p) (Exp b r) *) (* Goal: Mod (Z.mul (Exp (Exp b x) q) (Exp b r)) (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) p *) (* Goal: Mod (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) (Zpos xH) p *) replace (Exp b r) with (1 * Exp b r)%Z. (* Goal: Mod (Z.mul (Zpos xH) (Exp b r)) (Z.mul (Exp (Exp b x) q) (Exp b r)) p *) (* Goal: @eq Z (Z.mul (Zpos xH) (Exp b r)) (Exp b r) *) (* Goal: Mod (Z.mul (Exp (Exp b x) q) (Exp b r)) (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) p *) (* Goal: Mod (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) (Zpos xH) p *) apply mod_mult_compat. (* Goal: Mod Z0 (Exp b q) p *) (* Goal: Mod (Exp b q) (Zpos xH) p *) apply mod_sym. (* Goal: Mod (Exp (Exp b x) q) (Zpos xH) p *) (* Goal: Mod (Exp b r) (Exp b r) p *) (* Goal: @eq Z (Z.mul (Zpos xH) (Exp b r)) (Exp b r) *) (* Goal: Mod (Z.mul (Exp (Exp b x) q) (Exp b r)) (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) p *) (* Goal: Mod (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) (Zpos xH) p *) apply mod_exp1. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. (* Goal: Mod (Z.mul (Exp (Exp b x) q) (Exp b r)) (Z.mul (Exp (Exp b x) q) (Exp b r)) p *) (* Goal: Mod (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) (Zpos xH) p *) apply mod_refl. (* Goal: @eq Z (Z.mul (Zpos xH) (Exp b r)) (Exp b r) *) (* Goal: Mod (Z.mul (Exp (Exp b x) q) (Exp b r)) (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) p *) (* Goal: Mod (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) (Zpos xH) p *) apply Zmult_1_l. (* Goal: Mod (Z.mul (Exp (Exp b x) q) (Exp b r)) (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) p *) (* Goal: Mod (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) (Zpos xH) p *) rewrite mult_comm. (* Goal: Mod (Z.mul (Exp (Exp b x) q) (Exp b r)) (Z.mul (Exp b (Nat.mul x q)) (Exp b r)) p *) (* Goal: Mod (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) (Zpos xH) p *) rewrite exp_mult. (* Goal: Mod (Z.mul (Exp (Exp b x) q) (Exp b r)) (Z.mul (Exp (Exp b x) q) (Exp b r)) p *) (* Goal: Mod (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) (Zpos xH) p *) apply mod_refl. (* Goal: Mod (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) (Zpos xH) p *) rewrite <- exp_plus. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. Qed. Lemma order_le_predp : forall (b : Z) (q p : nat), Prime p -> Order b q p -> q <= pred p. Proof. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) intros. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) elim H. intros. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) elim H0. intros. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) elim H4. intros. (* Goal: le q (Init.Nat.pred p) *) apply H6. (* Goal: Mod (Exp b q) (Zpos xH) p *) apply lt_pred. assumption. (* Goal: Mod (Exp b (Init.Nat.pred p)) (Zpos xH) p *) apply flt. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. (* Goal: not (Mod b Z0 p) *) intro. (* Goal: False *) elim (mod_0not1 p). (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. (* Goal: Mod Z0 (Zpos xH) p *) apply mod_trans with (Exp b q). (* Goal: Mod Z0 (Exp b q) p *) (* Goal: Mod (Exp b q) (Zpos xH) p *) apply mod_sym. (* Goal: Mod (Exp b q) Z0 p *) (* Goal: Mod (Exp b q) (Zpos xH) p *) apply moda0_exp_compat. (* Goal: gt p O *) (* Goal: Mod b Z0 p *) (* Goal: gt q O *) (* Goal: Mod (Exp b q) (Zpos xH) p *) unfold gt in |- *. (* Goal: lt O p *) (* Goal: Mod b Z0 p *) (* Goal: gt q O *) (* Goal: Mod (Exp b q) (Zpos xH) p *) unfold gt in H1. (* Goal: lt O p *) (* Goal: Mod b Z0 p *) (* Goal: gt q O *) (* Goal: Mod (Exp b q) (Zpos xH) p *) unfold lt in |- *. (* Goal: le (S O) p *) (* Goal: Mod b Z0 p *) (* Goal: gt q O *) (* Goal: Mod (Exp b q) (Zpos xH) p *) apply lt_le_weak. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. Qed.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) (** modprime. Some nice lemmas about div, mult, mod, prime, and gcd. @author Olga Caprotti and Martijn Oostdijk @version $Revision$ *) Require Import Arith. Require Import ZArith. Require Import Wf_nat. Require Import lemmas. Require Import natZ. Require Import dec. Require Import list. Require Import exp. Require Import divides. Require Import prime. Require Import modulo. Require Import gcd. Lemma prime_div_or_gcd1 : forall (p : nat) (a : Z), Prime p -> ZDivides (Z_of_nat p) a \/ gcd (Z_of_nat p) a 1. Proof. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intros. elim (zdivdec a (Z_of_nat p)). (* Goal: or (@eq nat qi qi) (exlist nat (fun b : nat => @eq nat qi b) restqs) *) (* Goal: Divides a (multDrop qi (Cons nat qi restqs)) *) left. assumption. (* Goal: or (@eq nat qj qi) (exlist nat (fun b : nat => @eq nat qj b) restqs) *) (* Goal: Divides a (multDrop qj (Cons nat qi restqs)) *) (* Goal: lt O y *) (* Goal: lt y (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: allPrime restqs *) (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) right. unfold gcd in |- *. unfold common_div in |- *. (* Goal: and (inlist nat qi (Cons nat qi restqs)) (Divides a (multDrop qi (Cons nat qi restqs))) *) split. split. (* Goal: Divides (S O) (Z.abs_nat (Z.of_nat p)) *) (* Goal: Divides (S O) (Z.abs_nat a) *) (* Goal: forall (e : nat) (_ : and (Divides e (Z.abs_nat (Z.of_nat p))) (Divides e (Z.abs_nat a))), le e (S O) *) split with p. simpl in |- *. rewrite <- plus_n_O. apply abs_inj. (* Goal: exlist nat (fun b : nat => @eq nat qi b) (Cons nat qi restqs) *) (* Goal: Divides a (multDrop qi (Cons nat qi restqs)) *) split with (Zabs_nat a). simpl in |- *. apply plus_n_O. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intros. elim H1. intros. rewrite abs_inj in H2. (* Goal: le e (S O) *) elim (primediv1p p e). (* Goal: forall _ : Divides qi a, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: forall _ : Divides qi x, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intro. rewrite H4. apply le_n. (* Goal: forall _ : Divides qi a, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: forall _ : Divides qi x, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intro. rewrite H4 in H3. elim H0. apply divzdiv. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) rewrite abs_inj. assumption. assumption. assumption. Qed. Lemma divmultgcd : forall a b c : Z, a <> 0%Z -> ZDivides a (b * c) -> gcd a b 1 -> ZDivides a c. Proof. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intros. elim (gcd_lincomb a b 1). (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intro alpha. intros. elim H2. intro beta. intros. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) elim H0. intro y. intros. (* Goal: ZDivides a c *) (* Goal: not (@eq Z a Z0) *) (* Goal: gcd a b (S O) *) split with (c * alpha + y * beta)%Z. rewrite Zmult_plus_distr_r. (* Goal: @eq Z c (Z.add (Z.mul (Z.mul a c) alpha) (Z.mul a (Z.mul y beta))) *) (* Goal: not (@eq Z a Z0) *) (* Goal: gcd a b (S O) *) rewrite Zmult_assoc. rewrite Zmult_assoc. (* Goal: @eq Z c (Z.add (Z.mul (Z.mul a c) alpha) (Z.mul (Z.mul a y) beta)) *) (* Goal: not (@eq Z a Z0) *) (* Goal: gcd a b (S O) *) rewrite <- H4. rewrite (Zmult_comm a c). rewrite (Zmult_comm b c). (* Goal: Mod (Z.mul (Z.mul b c) rc) b p *) (* Goal: Prime p *) (* Goal: not (Mod c Z0 p) *) rewrite Zmult_assoc_reverse. rewrite Zmult_assoc_reverse. (* Goal: @eq Z (Z.mul a beta) (Z.add (Z.mul a beta) (Z.add (Z.mul (Z.of_nat p) alpha) (Z.mul (Z.of_nat p) (Z.opp alpha)))) *) (* Goal: not (@eq Z (Z.of_nat p) Z0) *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: Prime p *) rewrite <- Zmult_plus_distr_r. transitivity (c * 1)%Z. (* Goal: @eq Z (Z.mul b (Zpos xH)) b *) (* Goal: Prime p *) (* Goal: not (Mod c Z0 p) *) rewrite Zmult_comm. rewrite Zmult_1_l. reflexivity. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) apply (f_equal (A:=Z)). assumption. assumption. assumption. Qed. Lemma primedivmult : forall p n m : nat, Prime p -> Divides p (n * m) -> Divides p n \/ Divides p m. Proof. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intros. elim (prime_div_or_gcd1 p (Z_of_nat n)). (* Goal: or (@eq nat qi qi) (exlist nat (fun b : nat => @eq nat qi b) restqs) *) (* Goal: Divides a (multDrop qi (Cons nat qi restqs)) *) left. rewrite <- (abs_inj p). rewrite <- (abs_inj n). (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) apply zdivdiv. assumption. (* Goal: or (@eq nat qj qi) (exlist nat (fun b : nat => @eq nat qj b) restqs) *) (* Goal: Divides a (multDrop qj (Cons nat qi restqs)) *) (* Goal: lt O y *) (* Goal: lt y (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: allPrime restqs *) (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) right. rewrite <- (abs_inj p). rewrite <- (abs_inj m). (* Goal: Divides (Z.abs_nat (Z.of_nat p)) (Z.abs_nat (Z.of_nat m)) *) (* Goal: Prime p *) apply zdivdiv. apply divmultgcd with (Z_of_nat n). (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) elim H. intros. apply Zgt_neq. (* Goal: Z.gt (Z.of_nat p) Z0 *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: Prime p *) change (Z_of_nat p > Z_of_nat 0)%Z in |- *. apply Znat.inj_gt. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) apply gt_trans with 1. assumption. unfold gt in |- *. unfold lt in |- *. apply le_n. (* Goal: ZDivides (Z.of_nat p) (Z.of_nat (Init.Nat.mul n m)) *) (* Goal: gcd (Z.of_nat p) (Z.of_nat n) (S O) *) (* Goal: Prime p *) rewrite <- Znat.inj_mult. apply divzdiv. rewrite abs_inj. rewrite abs_inj. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) assumption. assumption. assumption. Qed. Lemma mod_mult_inv_r : forall (a : Z) (p : nat), Prime p -> ~ Mod a 0 p -> exists ra : Z, Mod (a * ra) 1 p. Proof. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intros. elim (prime_div_or_gcd1 p a). (* case p divides a *) (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intro. elim H0. elim H1. intros. split with x. simpl in |- *. assumption. (* case gcd(p,a)=1 *) (* Goal: forall _ : Divides qi a, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: forall _ : Divides qi x, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intro. elim (gcd_lincomb (Z_of_nat p) a 1). (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intro alpha. intros. elim H2. intro beta. intros. (* Goal: @ex Z (fun ra : Z => Mod (Z.mul a ra) (Zpos xH) p) *) (* Goal: not (@eq Z (Z.of_nat p) Z0) *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: Prime p *) unfold Mod in |- *. split with beta. split with (- alpha)%Z. (* Goal: @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) simpl in H3. rewrite H3. (* Goal: @eq Z (Z.mul a beta) (Z.add (Z.add (Z.mul (Z.of_nat p) alpha) (Z.mul a beta)) (Z.mul (Z.of_nat p) (Z.opp alpha))) *) (* Goal: not (@eq Z (Z.of_nat p) Z0) *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: Prime p *) rewrite (Zplus_comm (Z_of_nat p * alpha)). rewrite Zplus_assoc_reverse. (* Goal: @eq Z (Z.mul a beta) (Z.add (Z.mul a beta) (Z.add (Z.mul (Z.of_nat p) alpha) (Z.mul (Z.of_nat p) (Z.opp alpha)))) *) (* Goal: not (@eq Z (Z.of_nat p) Z0) *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: Prime p *) rewrite <- Zmult_plus_distr_r. rewrite Zplus_opp_r. (* Goal: @eq nat qi qi *) (* Goal: Divides a (multDrop qi (Cons nat qi restqs)) *) rewrite <- Zmult_0_r_reverse. rewrite <- Zplus_0_r_reverse. reflexivity. (* Goal: not (@eq Z (Z.of_nat p) Z0) *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: Prime p *) apply Zgt_neq. change (Z_of_nat p > Z_of_nat 0)%Z in |- *. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) apply Znat.inj_gt. apply gt_trans with 1. elim H. intros. assumption. (* Goal: le (S O) (S O) *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: Prime p *) unfold gt in |- *. unfold lt in |- *. apply le_n. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) assumption. assumption. Qed. Lemma mod_mult_cancel_r : forall (a b c : Z) (p : nat), Prime p -> ~ Mod c 0 p -> Mod (a * c) (b * c) p -> Mod a b p. Proof. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intros. elim (mod_mult_inv_r c p). intro rc. intros. (* Goal: Mod (Z.mul (Z.mul b c) rc) b p *) (* Goal: Prime p *) (* Goal: not (Mod c Z0 p) *) apply mod_trans with (a * c * rc)%Z. rewrite Zmult_assoc_reverse. (* Goal: Mod a (Z.mul a (Z.mul c rc)) p *) (* Goal: Mod (Z.mul (Z.mul a c) rc) b p *) (* Goal: Prime p *) (* Goal: not (Mod c Z0 p) *) pattern a at 1 in |- *. replace a with (a * 1)%Z. apply mod_mult_compat. apply mod_refl. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) apply mod_sym. assumption. (* Goal: @eq Z (Z.mul b (Zpos xH)) b *) (* Goal: Prime p *) (* Goal: not (Mod c Z0 p) *) rewrite Zmult_comm. apply Zmult_1_l. (* Goal: Mod (Z.mul (Z.mul a c) rc) b p *) (* Goal: Prime p *) (* Goal: not (Mod c Z0 p) *) apply mod_trans with (b * c * rc)%Z. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) apply mod_mult_compat. assumption. apply mod_refl. rewrite Zmult_assoc_reverse. (* Goal: Mod (Z.mul b (Z.mul c rc)) (Z.mul b (Zpos xH)) p *) (* Goal: @eq Z (Z.mul b (Zpos xH)) b *) (* Goal: Prime p *) (* Goal: not (Mod c Z0 p) *) pattern b at 2 in |- *. replace b with (b * 1)%Z. apply mod_mult_compat. apply mod_refl. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) assumption. (* Goal: @eq Z (Z.mul b (Zpos xH)) b *) (* Goal: Prime p *) (* Goal: not (Mod c Z0 p) *) rewrite Zmult_comm. apply Zmult_1_l. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) assumption. assumption. Qed. Lemma mod_mult_0 : forall (p : nat) (a b : Z), Prime p -> Mod (a * b) 0 p -> Mod a 0 p \/ Mod b 0 p. Proof. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intros. (* Goal: or (Mod a Z0 p) (Mod b Z0 p) *) elim (moddivmin (a * b) 0 p). (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intros. (* Goal: or (Mod a Z0 p) (Mod b Z0 p) *) rewrite <- Zminus_0_l_reverse in H1. (* Goal: or (Mod a Z0 p) (Mod b Z0 p) *) rewrite abs_mult in H1. (* Goal: or (Mod a Z0 p) (Mod b Z0 p) *) elim (primedivmult p (Zabs_nat a) (Zabs_nat b)). (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) left. elim (moddivmin a 0 p). intros. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) apply H5. rewrite <- Zminus_0_l_reverse. assumption. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) right. elim (moddivmin b 0 p). intros. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) apply H5. rewrite <- Zminus_0_l_reverse. assumption. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) assumption. (* Goal: Divides p (Init.Nat.mul (Z.abs_nat a) (Z.abs_nat b)) *) apply H1. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) assumption. Qed. Lemma mod_not_exp_0 : forall p : nat, Prime p -> forall a : Z, ~ Mod a 0 p -> forall m : nat, ~ Mod (Exp a m) 0 p. Proof. (* Goal: forall (p : nat) (_ : Prime p) (a : Z) (_ : not (Mod a Z0 p)) (m : nat), not (Mod (Exp a m) Z0 p) *) intros p Hp a Ha. simple induction m. (* Goal: exlist nat (fun b : nat => @eq nat qi b) (Cons nat qi restqs) *) (* Goal: Divides a (multDrop qi (Cons nat qi restqs)) *) simpl in |- *. intro. elim (mod_0not1 p). (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) elim Hp. intros. assumption. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) apply mod_sym. assumption. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) simpl in |- *. intros. intro. (* Goal: False *) elim (mod_mult_0 p a (Exp a n) Hp). (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) assumption. assumption. assumption. Qed. (** This lemma simply states that: if a divides b where 0<a<b, then there is a prime factor qi of b such that a divides (b/qi). I.e. If you divide by a non-trivial divisor, then the other divisor contains a prime factor. *) Lemma techlemma3 : forall (qlist : natlist) (a b : nat), 0 < a -> a < b -> Divides a b -> b = product qlist -> allPrime qlist -> exists qi : nat, inlist nat qi qlist /\ Divides a (multDrop qi qlist). Proof. (* Goal: forall (qlist : natlist) (a b : nat) (_ : lt O a) (_ : lt a b) (_ : Divides a b) (_ : @eq nat b (product qlist)) (_ : allPrime qlist), @ex nat (fun qi : nat => and (inlist nat qi qlist) (Divides a (multDrop qi qlist))) *) simple induction qlist. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) simpl in |- *. intros. rewrite H2 in H0. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) elim (lt_not_le a 1). assumption. unfold lt in H. assumption. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intros qi restqs IH. intros. (* Goal: @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) elim (divdec a qi). (* case (Divides qi a) *) (* Goal: forall _ : Divides qi a, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: forall _ : Divides qi x, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intro. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) elim H1. intro x. intros. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) elim H4. intro y. intros. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) elim (IH y (product restqs)). intro qj. intros. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) elim H7. intros. (* Goal: @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: lt O y *) (* Goal: lt y (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: allPrime restqs *) (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) split with qj. (* Goal: and (inlist nat qi (Cons nat qi restqs)) (Divides a (multDrop qi (Cons nat qi restqs))) *) split. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) unfold inlist in |- *. simpl in |- *. right. assumption. (* Goal: Divides a (multDrop qj (Cons nat qi restqs)) *) (* Goal: lt O y *) (* Goal: lt y (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: allPrime restqs *) (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) rewrite H6. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) elim H9. intro z. intros. (* Goal: Divides (Init.Nat.mul qi y) (multDrop qj (Cons nat qi restqs)) *) (* Goal: lt O y *) (* Goal: lt y (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: allPrime restqs *) (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) elim (eqdec qi qj). (* Goal: forall _ : Divides qi a, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: forall _ : Divides qi x, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intro. rewrite H11. rewrite multdrop_cons_eq. (* Goal: Divides (Init.Nat.mul qj y) (product restqs) *) (* Goal: forall _ : not (@eq nat qi qj), Divides (Init.Nat.mul qi y) (multDrop qj (Cons nat qi restqs)) *) (* Goal: lt O y *) (* Goal: lt y (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: allPrime restqs *) (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) rewrite <- (multdrop_mult restqs qj). split with z. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) rewrite mult_assoc_reverse. rewrite H10. reflexivity. assumption. (* Goal: forall _ : Divides qi a, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: forall _ : Divides qi x, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intro. rewrite multdrop_cons_neq. (* Goal: @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) split with z. (* Goal: @eq nat (Init.Nat.mul qi (multDrop qj restqs)) (Init.Nat.mul (Init.Nat.mul qi y) z) *) (* Goal: not (@eq nat qj qi) *) (* Goal: lt O y *) (* Goal: lt y (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: allPrime restqs *) (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) rewrite mult_assoc_reverse. (* Goal: @eq nat (Init.Nat.mul qi (multDrop qj restqs)) (Init.Nat.mul qi (Init.Nat.mul y z)) *) (* Goal: not (@eq nat qj qi) *) (* Goal: lt O y *) (* Goal: lt y (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: allPrime restqs *) (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) rewrite H10. (* Goal: @eq nat qi qi *) (* Goal: Divides a (multDrop qi (Cons nat qi restqs)) *) reflexivity. (* Goal: forall _ : Divides qi a, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: forall _ : Divides qi x, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intro. elim H11. rewrite H12. reflexivity. (* Goal: forall _ : Divides qi a, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: forall _ : Divides qi x, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) elim (le_or_lt y 0). intro. (* Goal: forall _ : Divides qi a, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: forall _ : Divides qi x, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) elim (le_lt_or_eq y 0). intro. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) elim (lt_n_O y). assumption. (* Goal: forall _ : Divides qi a, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: forall _ : Divides qi x, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intro. rewrite H8 in H6. rewrite <- mult_n_O in H6. rewrite H6 in H. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) elim (lt_n_O 0). assumption. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) assumption. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) intro. assumption. (* Goal: lt y (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: allPrime restqs *) (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) apply simpl_lt_mult_l with qi. (* Goal: lt (Init.Nat.mul qi y) (Init.Nat.mul qi (product restqs)) *) (* Goal: Divides y (product restqs) *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: allPrime restqs *) (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) rewrite <- H6. (* Goal: Divides a (product restqs) *) simpl in H2. (* Goal: lt a (Init.Nat.mul qi (product restqs)) *) (* Goal: Divides y (product restqs) *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: allPrime restqs *) (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) rewrite <- H2. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) assumption. (* Goal: Divides a (product restqs) *) simpl in H2. (* Goal: Divides y (product restqs) *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: allPrime restqs *) (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) rewrite H5 in H2. (* Goal: Divides y (product restqs) *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: allPrime restqs *) (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) rewrite H6 in H2. (* Goal: Divides y (product restqs) *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: allPrime restqs *) (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) split with x. (* Goal: @eq nat (product restqs) (Init.Nat.mul y x) *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: allPrime restqs *) (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) rewrite mult_assoc_reverse in H2. (* Goal: @eq nat (product restqs) (Init.Nat.mul a z) *) (* Goal: Divides qi (Init.Nat.mul a x) *) apply simpl_eq_mult_l with qi. (* Goal: @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) unfold allPrime in H3. (* Goal: @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) simpl in H3. (* Goal: @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) elim H3. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intros. (* Goal: lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul y x)) *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: allPrime restqs *) (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) elim H7. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intros. (* Goal: lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) apply lt_trans with 1. (* Goal: lt O (S O) *) (* Goal: lt (S O) qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) apply lt_O_Sn. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) assumption. symmetry in |- *. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) assumption. (* Goal: @eq nat qi qi *) (* Goal: Divides a (multDrop qi (Cons nat qi restqs)) *) reflexivity. (* Goal: @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) unfold allPrime in H3. (* Goal: @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) simpl in H3. (* Goal: @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) elim H3. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intros. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) assumption. (* case ~(Divides qi a) *) (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intros. (* Goal: @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) split with qi. (* Goal: and (inlist nat qi (Cons nat qi restqs)) (Divides a (multDrop qi (Cons nat qi restqs))) *) split. (* Goal: inlist nat qi (Cons nat qi restqs) *) (* Goal: Divides a (multDrop qi (Cons nat qi restqs)) *) unfold inlist in |- *. (* Goal: exlist nat (fun b : nat => @eq nat qi b) (Cons nat qi restqs) *) (* Goal: Divides a (multDrop qi (Cons nat qi restqs)) *) simpl in |- *. (* Goal: or (@eq nat qi qi) (exlist nat (fun b : nat => @eq nat qi b) restqs) *) (* Goal: Divides a (multDrop qi (Cons nat qi restqs)) *) left. (* Goal: @eq nat qi qi *) (* Goal: Divides a (multDrop qi (Cons nat qi restqs)) *) elim (beq_nat_ok qi qi). (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intros. (* Goal: @eq nat qi qi *) (* Goal: Divides a (multDrop qi (Cons nat qi restqs)) *) reflexivity. (* Goal: Divides a (multDrop qi (Cons nat qi restqs)) *) rewrite multdrop_cons_eq. (* Goal: Divides a (product restqs) *) elim H1. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intros. (* Goal: Divides a (product restqs) *) simpl in H2. (* Goal: Divides a (product restqs) *) unfold Divides in |- *. (* Goal: @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) unfold allPrime in H3. (* Goal: @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) simpl in H3. (* Goal: @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) elim H3. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intros. (* Goal: @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) elim (primedivmult qi a x H6). (* Goal: forall _ : Divides qi a, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: forall _ : Divides qi x, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intro. (* Goal: @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: forall _ : Divides qi x, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) elim H4. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) assumption. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intros. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) elim H8. intro z. intros. (* Goal: @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) split with z. (* Goal: @eq nat (product restqs) (Init.Nat.mul a z) *) (* Goal: Divides qi (Init.Nat.mul a x) *) rewrite H2 in H5. (* Goal: @eq nat (product restqs) (Init.Nat.mul a z) *) (* Goal: Divides qi (Init.Nat.mul a x) *) rewrite H9 in H5. (* Goal: @eq nat (product restqs) (Init.Nat.mul a z) *) (* Goal: Divides qi (Init.Nat.mul a x) *) rewrite (mult_assoc a qi) in H5. (* Goal: @eq nat (product restqs) (Init.Nat.mul a z) *) (* Goal: Divides qi (Init.Nat.mul a x) *) rewrite (mult_comm a) in H5. (* Goal: @eq nat (product restqs) (Init.Nat.mul a z) *) (* Goal: Divides qi (Init.Nat.mul a x) *) rewrite (mult_assoc_reverse qi a) in H5. (* Goal: @eq nat (product restqs) (Init.Nat.mul a z) *) (* Goal: Divides qi (Init.Nat.mul a x) *) apply simpl_eq_mult_l with qi. (* Goal: lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) elim H6. (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) intros. (* Goal: lt O qi *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: Divides qi (Init.Nat.mul a x) *) apply lt_trans with 1. apply lt_O_Sn. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) assumption. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) assumption. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) split with (product restqs). rewrite <- H5. assumption. Qed.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) (** exp. Exponential function on Z. @author Olga Caprotti and Martijn Oostdijk @version $Revision$ *) Require Import ZArith. Require Import lemmas. Require Import natZ. (** * Exponential function with exponent in nat. *) Fixpoint Exp (a : Z) (n : nat) {struct n} : Z := match n with | O => 1%Z | S m => (a * Exp a m)%Z end. Lemma exp_0 : forall n : nat, Exp 0 (S n) = 0%Z. Proof. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) simpl in |- *. intros. reflexivity. Qed. Lemma exp_1 : forall n : nat, Exp 1 n = 1%Z. Proof. (* Goal: forall (n : nat) (a : Z), @eq Z (ZExp a (Z.of_nat n)) (Exp a n) *) simple induction n. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) simpl in |- *. reflexivity. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) simpl in |- *. intros m IH. rewrite IH. reflexivity. Qed. Lemma exp_S : forall (a : Z) (n : nat), Exp a (S n) = (a * Exp a n)%Z. Proof. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) simpl in |- *. reflexivity. Qed. Lemma exp_plus : forall (a : Z) (n m : nat), Exp a (n + m) = (Exp a n * Exp a m)%Z. Proof. (* Goal: forall (n : nat) (a : Z), @eq Z (ZExp a (Z.of_nat n)) (Exp a n) *) simple induction n. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) simpl in |- *. intros. elim (Exp a m). reflexivity. reflexivity. reflexivity. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) intros n1 IH. simpl in |- *. intros. (* Goal: @eq Z (Z.mul a (Exp a (Init.Nat.add n1 m))) (Z.mul (Z.mul a (Exp a n1)) (Exp a m)) *) rewrite (IH m). (* Goal: @eq Z (Z.mul (Z.mul a b) (Z.mul (Exp a m) (Exp b m))) (Z.mul (Z.mul (Z.mul a b) (Exp a m)) (Exp b m)) *) apply Zmult_assoc. Qed. Lemma exp_abn : forall (a b : Z) (n : nat), Exp (a * b) n = (Exp a n * Exp b n)%Z. Proof. (* Goal: forall (n : nat) (a : Z), @eq Z (ZExp a (Z.of_nat n)) (Exp a n) *) simple induction n. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) simpl in |- *. reflexivity. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) intros m IH. simpl in |- *. (* Goal: @eq Z (Z.mul (Exp a m0) (Exp a (Init.Nat.mul m m0))) (Z.mul (Exp a m0) (Exp (Exp a m) m0)) *) rewrite IH. (* Goal: @eq Z (Z.mul (Z.mul a b) (Z.mul (Exp a m) (Exp b m))) (Z.mul (Z.mul a (Exp a m)) (Z.mul b (Exp b m))) *) rewrite (Zmult_assoc (a * Exp a m) b (Exp b m)). (* Goal: @eq Z (Z.mul (Z.mul a b) (Z.mul (Exp a m) (Exp b m))) (Z.mul (Z.mul (Z.mul a (Exp a m)) b) (Exp b m)) *) rewrite (Zmult_assoc_reverse a (Exp a m) b). (* Goal: @eq Z (Z.mul (Z.mul a b) (Z.mul (Exp a m) (Exp b m))) (Z.mul (Z.mul a (Z.mul (Exp a m) b)) (Exp b m)) *) rewrite (Zmult_comm (Exp a m) b). (* Goal: @eq Z (Z.mul (Z.mul a b) (Z.mul (Exp a m) (Exp b m))) (Z.mul (Z.mul a (Z.mul b (Exp a m))) (Exp b m)) *) rewrite (Zmult_assoc a b (Exp a m)). (* Goal: @eq Z (Z.mul (Z.mul a b) (Z.mul (Exp a m) (Exp b m))) (Z.mul (Z.mul (Z.mul a b) (Exp a m)) (Exp b m)) *) apply Zmult_assoc. Qed. Lemma exp_mult : forall (a : Z) (n m : nat), Exp a (n * m) = Exp (Exp a n) m. Proof. (* Goal: forall (n : nat) (a : Z), @eq Z (ZExp a (Z.of_nat n)) (Exp a n) *) simple induction n. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) simpl in |- *. intro. rewrite exp_1. reflexivity. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) intros m IH. simpl in |- *. intros. (* Goal: @eq Z (Exp a (Init.Nat.add m0 (Init.Nat.mul m m0))) (Exp (Z.mul a (Exp a m)) m0) *) rewrite exp_plus. (* Goal: @eq Z (Z.mul (Exp a m0) (Exp a (Init.Nat.mul m m0))) (Exp (Z.mul a (Exp a m)) m0) *) rewrite exp_abn. (* Goal: @eq Z (Z.mul (Exp a m0) (Exp a (Init.Nat.mul m m0))) (Z.mul (Exp a m0) (Exp (Exp a m) m0)) *) rewrite IH. (* Goal: @eq Z (Exp a (Pos.to_nat p)) (Exp a (Pos.to_nat p)) *) reflexivity. Qed. Lemma exp_not0 : forall a : Z, a <> 0%Z -> forall m : nat, Exp a m <> 0%Z. Proof. (* Goal: forall (a : Z) (_ : not (@eq Z a Z0)) (m : nat), not (@eq Z (Exp a m) Z0) *) intros a Ha. simple induction m. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) simpl in |- *. discriminate. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) intros n IH. simpl in |- *. intro. (* Goal: False *) elim (Zmult_ab0a0b0 a (Exp a n)). (* Goal: Z.le Z0 m *) assumption. assumption. assumption. Qed. (** Convenience lemma for changing exponent. *) Lemma exp_eq : forall (n m : nat) (a : Z), n = m -> Exp a n = Exp a m. Proof. (* Goal: forall (a n m : Z) (_ : Z.le Z0 n) (_ : Z.le Z0 m), @eq Z (ZExp a (Z.mul n m)) (ZExp (ZExp a n) m) *) intros. rewrite H. reflexivity. Qed. Lemma exp_pred_succ : forall (a : Z) (n : nat), Exp a (pred (S n)) = Exp a n. Proof. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) intros. simpl in |- *. reflexivity. Qed. (** * Exponential function with exponent in Z. *) Definition ZExp (a n : Z) : Z := match n with | Z0 => 1%Z | Zpos p => Exp a (nat_of_P p) | Zneg p => Exp a (nat_of_P p) end. Lemma zexp_pred_succ : forall a x : Z, ZExp a (x + 1 - 1) = ZExp a x. Proof. (* Goal: forall a x : Z, @eq Z (ZExp a (Z.sub (Z.add x (Zpos xH)) (Zpos xH))) (ZExp a x) *) unfold Zminus in |- *. (* Goal: forall (a n m : Z) (_ : Z.le Z0 n) (_ : Z.le Z0 m), @eq Z (ZExp a (Z.mul n m)) (ZExp (ZExp a n) m) *) intros. (* Goal: @eq Z (ZExp a (Z.add (Z.add x (Zpos xH)) (Z.opp (Zpos xH)))) (ZExp a x) *) rewrite Zplus_assoc_reverse. (* Goal: @eq Z (ZExp a (Z.add x (Z.add (Zpos xH) (Z.opp (Zpos xH))))) (ZExp a x) *) rewrite Zplus_opp_r. (* Goal: @eq Z (ZExp a (Z.add x Z0)) (ZExp a x) *) rewrite <- Zplus_0_r_reverse. (* Goal: @eq Z (Exp a (Pos.to_nat p)) (Exp a (Pos.to_nat p)) *) reflexivity. Qed. (** Convenience lemma for changing exponent. *) Lemma zexp_eq : forall x y a : Z, x = y -> ZExp a x = ZExp a y. Proof. (* Goal: forall (a n m : Z) (_ : Z.le Z0 n) (_ : Z.le Z0 m), @eq Z (ZExp a (Z.mul n m)) (ZExp (ZExp a n) m) *) intros. (* Goal: @eq Z (ZExp a x) (ZExp a y) *) rewrite H. (* Goal: @eq Z (Exp a (Pos.to_nat p)) (Exp a (Pos.to_nat p)) *) reflexivity. Qed. Lemma inj_zexp : forall (n : nat) (a : Z), ZExp a (Z_of_nat n) = Exp a n. Proof. (* Goal: forall (n : nat) (a : Z), @eq Z (ZExp a (Z.of_nat n)) (Exp a n) *) simple induction n. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) simpl in |- *. reflexivity. (* Goal: forall (a n m : Z) (_ : Z.le Z0 n) (_ : Z.le Z0 m), @eq Z (ZExp a (Z.mul n m)) (ZExp (ZExp a n) m) *) intros m IH. intros. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) simpl in |- *. rewrite nat_of_P_o_P_of_succ_nat_eq_succ. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) simpl in |- *. reflexivity. Qed. Lemma expzexp : forall x a : Z, ZExp a x = Exp a (Zabs_nat x). Proof. (* Goal: forall (a n m : Z) (_ : Z.le Z0 n) (_ : Z.le Z0 m), @eq Z (ZExp a (Z.mul n m)) (ZExp (ZExp a n) m) *) intros. induction x as [| p| p]. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) simpl in |- *. reflexivity. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) simpl in |- *. reflexivity. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) simpl in |- *. reflexivity. Qed. Lemma zexp_S1 : forall a n : Z, (0 <= n)%Z -> ZExp a (n + 1) = (a * ZExp a n)%Z. Proof. (* Goal: forall (a n m : Z) (_ : Z.le Z0 n) (_ : Z.le Z0 m), @eq Z (ZExp a (Z.mul n m)) (ZExp (ZExp a n) m) *) intros. (* Goal: @eq Z (Exp a (Z.abs_nat (Z.mul n m))) (Exp (ZExp a n) (Z.abs_nat m)) *) rewrite expzexp. (* Goal: @eq Z (Exp a (Z.abs_nat (Z.mul n m))) (Exp (ZExp a n) (Z.abs_nat m)) *) rewrite expzexp. (* Goal: @eq Z (Exp a (Z.abs_nat (Z.add n m))) (Z.mul (Exp a (Z.abs_nat n)) (Exp a (Z.abs_nat m))) *) rewrite abs_plus_pos. (* Goal: @eq Z (Exp a (Init.Nat.add (Z.abs_nat n) (Z.abs_nat (Zpos xH)))) (Z.mul a (Exp a (Z.abs_nat n))) *) (* Goal: Z.le Z0 n *) (* Goal: Z.le Z0 (Zpos xH) *) rewrite plus_comm. (* Goal: @eq Z (Exp a (Nat.add (Z.abs_nat (Zpos xH)) (Z.abs_nat n))) (Z.mul a (Exp a (Z.abs_nat n))) *) (* Goal: Z.le Z0 n *) (* Goal: Z.le Z0 (Zpos xH) *) change (Exp a (S (Zabs_nat n)) = (a * Exp a (Zabs_nat n))%Z) in |- *. (* Goal: @eq Z (Exp a (S (Z.abs_nat n))) (Z.mul a (Exp a (Z.abs_nat n))) *) (* Goal: Z.le Z0 n *) (* Goal: Z.le Z0 (Zpos xH) *) apply exp_S. (* Goal: Z.le Z0 m *) assumption. (* Goal: Z.le Z0 (Zpos xH) *) unfold Zle in |- *. (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) simpl in |- *. (* Goal: not (@eq comparison Lt Gt) *) discriminate. Qed. Lemma zexp_S : forall a n : Z, (0 <= n)%Z -> ZExp a (Zsucc n) = (a * ZExp a n)%Z. Proof. (* Goal: forall (a n m : Z) (_ : Z.le Z0 n) (_ : Z.le Z0 m), @eq Z (ZExp a (Z.mul n m)) (ZExp (ZExp a n) m) *) intros. (* Goal: @eq Z (ZExp a (Z.succ n)) (Z.mul a (ZExp a n)) *) change (ZExp a (n + 1) = (a * ZExp a n)%Z) in |- *. (* Goal: @eq Z (ZExp a (Z.add n (Zpos xH))) (Z.mul a (ZExp a n)) *) apply zexp_S1. (* Goal: Z.le Z0 m *) assumption. Qed. Lemma zexp_plus : forall a n m : Z, (0 <= n)%Z -> (0 <= m)%Z -> ZExp a (n + m) = (ZExp a n * ZExp a m)%Z. Proof. (* Goal: forall (a n m : Z) (_ : Z.le Z0 n) (_ : Z.le Z0 m), @eq Z (ZExp a (Z.mul n m)) (ZExp (ZExp a n) m) *) intros. (* Goal: @eq Z (Exp a (Z.abs_nat (Z.mul n m))) (Exp (ZExp a n) (Z.abs_nat m)) *) rewrite expzexp. (* Goal: @eq Z (Exp a (Z.abs_nat (Z.mul n m))) (Exp (ZExp a n) (Z.abs_nat m)) *) rewrite expzexp. (* Goal: @eq Z (Exp a (Z.abs_nat (Z.mul n m))) (Exp (ZExp a n) (Z.abs_nat m)) *) rewrite expzexp. (* Goal: @eq Z (Exp a (Z.abs_nat (Z.add n m))) (Z.mul (Exp a (Z.abs_nat n)) (Exp a (Z.abs_nat m))) *) rewrite abs_plus_pos. (* Goal: Z.le Z0 m *) apply exp_plus. assumption. assumption. Qed. Lemma zexp_mult : forall a n m : Z, (0 <= n)%Z -> (0 <= m)%Z -> ZExp a (n * m) = ZExp (ZExp a n) m. Proof. (* Goal: forall (a n m : Z) (_ : Z.le Z0 n) (_ : Z.le Z0 m), @eq Z (ZExp a (Z.mul n m)) (ZExp (ZExp a n) m) *) intros. (* Goal: @eq Z (Exp a (Z.abs_nat (Z.mul n m))) (Exp (ZExp a n) (Z.abs_nat m)) *) rewrite expzexp. (* Goal: @eq Z (Exp a (Z.abs_nat (Z.mul n m))) (Exp (ZExp a n) (Z.abs_nat m)) *) rewrite expzexp. (* Goal: @eq Z (Exp a (Z.abs_nat (Z.mul n m))) (Exp (ZExp a n) (Z.abs_nat m)) *) rewrite expzexp. (* Goal: @eq Z (Exp a (Z.abs_nat (Z.mul n m))) (Exp (Exp a (Z.abs_nat n)) (Z.abs_nat m)) *) rewrite abs_mult. (* Goal: @eq Z (Exp a (Init.Nat.mul (Z.abs_nat n) (Z.abs_nat m))) (Exp (Exp a (Z.abs_nat n)) (Z.abs_nat m)) *) apply exp_mult. Qed.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) (** fermat. Fermat's little theorem. @author Martijn Oostdijk @version $Revision$ *) Require Import Arith. Require Import ZArith. Require Import lemmas. Require Import natZ. Require Import dec. Require Import list. Require Import exp. Require Import divides. Require Import prime. Require Import modulo. Require Import modprime. (** * No double elements modulo p. *) Definition nodoubles (p : nat) (l : Zlist) : Prop := forall x : Z, inlist Z x l -> forall y : Z, inlist Z y (zdrop x l) -> ~ Mod x y p. Lemma nodoubles_nil : forall p : nat, nodoubles p (Nil Z). Proof. (* Goal: nodoubles p (Cons Z h t) *) unfold nodoubles in |- *. simpl in |- *. intros. elim H0. Qed. Lemma nodoubles_drop : forall (p : nat) (l : Zlist) (x : Z), nodoubles p l -> nodoubles p (zdrop x l). Proof. (* Goal: nodoubles p (Cons Z h t) *) unfold nodoubles in |- *. intros. apply H. (* Goal: inlist Z z l *) (* Goal: Mod x y p *) (* Goal: inlist Z x (zdrop z l) *) (* Goal: inlist Z y (zdrop z l) *) apply zdrop_inlist_weak with x. assumption. (* Goal: inlist Z z l *) (* Goal: Mod x y p *) (* Goal: inlist Z x (zdrop z l) *) (* Goal: inlist Z y (zdrop z l) *) apply zdrop_inlist_weak with x. rewrite zdrop_swap. assumption. Qed. Lemma nodoubles_ind : forall (p : nat) (h : Z) (t : Zlist), (forall x : Z, inlist Z x t -> ~ Mod h x p) -> nodoubles p t -> nodoubles p (Cons Z h t). Proof. (* Goal: nodoubles p (Cons Z h t) *) intros. unfold nodoubles in |- *. intros. (* Goal: not (Mod x y p) *) elim (zeqdec x h). (* Goal: not (@eq Z z y) *) (* Goal: inlist Z z l *) (* Goal: and (Mod z z p) (permmod p (zdrop z (zdrop x l)) (zdrop z (zdrop y l))) *) intro. rewrite zdrop_head_eq in H2. (* Goal: not (Mod a Z0 p) *) rewrite H3. apply (H y). assumption. assumption. (* Goal: not (@eq Z z y) *) (* Goal: inlist Z z l *) (* Goal: and (Mod z z p) (permmod p (zdrop z (zdrop x l)) (zdrop z (zdrop y l))) *) intro. rewrite zdrop_head_neq in H2. (* Goal: not (Mod x y p) *) (* Goal: not (@eq Z x h) *) elim (zeqdec y h). (* Goal: not (@eq Z z y) *) (* Goal: inlist Z z l *) (* Goal: and (Mod z z p) (permmod p (zdrop z (zdrop x l)) (zdrop z (zdrop y l))) *) intro. rewrite H4. intro. elim (H x). (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) elim (inlist_head_neq Z x h t). intros. (* Goal: not (Mod a Z0 p) *) apply H6. assumption. assumption. (* Goal: not (Mod a Z0 p) *) apply mod_sym. assumption. (* Goal: not (@eq Z z y) *) (* Goal: inlist Z z l *) (* Goal: and (Mod z z p) (permmod p (zdrop z (zdrop x l)) (zdrop z (zdrop y l))) *) intro. unfold nodoubles in H0. (* Goal: not (Mod x y p) *) (* Goal: not (@eq Z x h) *) apply (H0 x). (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) elim (inlist_head_neq Z x h t). intros. (* Goal: not (Mod a Z0 p) *) apply H5. assumption. assumption. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) elim (inlist_head_neq Z y h (zdrop x t)). intros. (* Goal: not (Mod a Z0 p) *) apply H5. assumption. assumption. (* Goal: not (Mod a Z0 p) *) assumption. Qed. (** * All elements from l1 occur in l2 modulo p. *) Definition allex (p : nat) (l0 l1 : Zlist) : Prop := forall x : Z, inlist Z x l0 -> exists y : Z, inlist Z y l1 /\ Mod x y p. Lemma allex_nodoubles_drop : forall (p : nat) (l0 l1 : Zlist) (x0 x1 : Z), Prime p -> Mod x0 x1 p -> inlist Z x0 l0 -> inlist Z x1 l1 -> nodoubles p l0 -> allex p l0 l1 -> allex p (zdrop x0 l0) (zdrop x1 l1). Proof. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros. (* Goal: allex p (until (Init.Nat.pred p)) (mapmult a (until (Init.Nat.pred p))) *) unfold allex in |- *. intros x Hx. (* Goal: @ex Z (fun y : Z => and (inlist Z y (zdrop x1 l1)) (Mod x y p)) *) elim (H4 x). intros y Hy. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) elim Hy. intros. (* Goal: @ex Z (fun x1 : Z => and (inlist Z x1 l1) (and (Mod x x1 p) (permmod p (zdrop x l0) (zdrop x1 l1)))) *) (* Goal: inlist Z x l0 *) split with y. (* Goal: and (Mod x y p) (permmod p (zdrop x l0) (zdrop y l1)) *) (* Goal: inlist Z x l0 *) split. apply zdrop_neq_inlist. (* Goal: not (@eq Z z y) *) (* Goal: inlist Z z l *) (* Goal: and (Mod z z p) (permmod p (zdrop z (zdrop x l)) (zdrop z (zdrop y l))) *) intro. rewrite H7 in H6. (* Goal: False *) (* Goal: inlist Z y l1 *) (* Goal: Mod x y p *) (* Goal: inlist Z x l0 *) elim H3 with x x0. (* Goal: not (Mod a Z0 p) *) apply zdrop_inlist_weak with x0. assumption. (* Goal: not (Mod a Z0 p) *) apply zdrop_inlist_swap. assumption. assumption. (* Goal: not (Mod a Z0 p) *) apply mod_trans with x1. assumption. (* Goal: not (Mod a Z0 p) *) apply mod_sym. assumption. (* Goal: not (Mod a Z0 p) *) assumption. assumption. (* Goal: not (Mod a Z0 p) *) apply zdrop_inlist_weak with x0. assumption. Qed. (** * The list of integers between 1 and n (inclusive) *) Fixpoint until (n : nat) : Zlist := match n with | O => Nil Z | S n => Cons Z (Z_of_nat (S n)) (until n) end. Lemma until_ok : forall (n : nat) (x : Z), (0 < x <= Z_of_nat n)%Z -> inlist Z x (until n). Proof. (* Goal: forall (n p : nat) (l0 l1 : Zlist) (_ : @eq nat n (length Z l0)) (_ : @eq nat n (length Z l1)) (_ : Prime p) (_ : @eq nat (length Z l0) (length Z l1)) (_ : nodoubles p l0) (_ : allex p l0 l1), permmod p l0 l1 *) simple induction n. (* Goal: permmod p (zdrop x (Nil Z)) (zdrop y (Nil Z)) *) (* Goal: @eq nat (length Z l) O *) (* Goal: forall (n : nat) (_ : forall (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat n (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l)) (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat (S n) (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l) *) simpl in |- *. intros. elim H. intros. (* Goal: not (Mod a Z0 p) *) elim (Zle_not_lt x 0). assumption. assumption. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros m IH. intros. elim H. intros. (* Goal: inlist Z x (until (S m)) *) elim (Zle_lt_or_eq x (Z_of_nat (S m))). (* Goal: permmod p (zdrop x (Nil Z)) (zdrop y (Nil Z)) *) (* Goal: @eq nat (length Z l) O *) (* Goal: forall (n : nat) (_ : forall (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat n (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l)) (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat (S n) (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l) *) intros. unfold inlist in |- *. simpl in |- *. right. unfold inlist in IH. (* Goal: not (Mod a Z0 p) *) apply IH. split. assumption. (* Goal: not (Mod a Z0 p) *) apply Zlt_succ_le. rewrite <- Znat.inj_S. assumption. (* Goal: not (@eq Z z y) *) (* Goal: inlist Z z l *) (* Goal: and (Mod z z p) (permmod p (zdrop z (zdrop x l)) (zdrop z (zdrop y l))) *) intro. rewrite H2. unfold inlist in |- *. (* Goal: permmod p (zdrop x (Nil Z)) (zdrop y (Nil Z)) *) (* Goal: @eq nat (length Z l) O *) (* Goal: forall (n : nat) (_ : forall (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat n (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l)) (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat (S n) (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l) *) simpl in |- *. left. reflexivity. assumption. Qed. Lemma until_mod_all : forall (p : nat) (x : Z), 0 < p -> ~ Mod x 0 p -> exists y : Z, inlist Z y (until (pred p)) /\ Mod x y p. Proof. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros. (* Goal: @ex Z (fun y : Z => and (inlist Z y (until (Init.Nat.pred p))) (Mod x y p)) *) elim (zdiv_rem (Z_of_nat p) x). (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intro q. intros. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) elim H1. intro r. intros. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) elim H2. intros. elim H3. intros. (* Goal: Z.lt Z0 r *) (* Goal: Z.le r (Z.of_nat (Init.Nat.pred p)) *) (* Goal: Mod x (Z.mul a r) p *) (* Goal: Z.gt (Z.of_nat p) Z0 *) (* Goal: Prime p *) (* Goal: not (Mod a Z0 p) *) elim (Zle_lt_or_eq 0 r). (* case 0 < r *) (* Goal: not (@eq Z z y) *) (* Goal: inlist Z z l *) (* Goal: and (Mod z z p) (permmod p (zdrop z (zdrop x l)) (zdrop z (zdrop y l))) *) intro. split with r. split. (* Goal: and (Mod x y p) (permmod p (zdrop x l0) (zdrop y l1)) *) (* Goal: inlist Z x l0 *) apply until_ok. split. (* Goal: not (Mod a Z0 p) *) assumption. (* Goal: Z.le r (Z.of_nat (Init.Nat.pred p)) *) (* Goal: Mod x (Z.mul a r) p *) (* Goal: Z.gt (Z.of_nat p) Z0 *) (* Goal: Prime p *) (* Goal: not (Mod a Z0 p) *) apply Zlt_succ_le. rewrite <- Znat.inj_S. rewrite <- (S_pred p 0). (* Goal: not (Mod a Z0 p) *) assumption. assumption. (* Goal: not (Mod a Z0 p) *) split with q. rewrite Zplus_comm. rewrite Zmult_comm. assumption. (* case 0 = r *) (* Goal: @ex Z (fun x1 : Z => and (inlist Z x1 l2) (and (Mod x0 x1 p) (permmod p (zdrop x0 l0) (zdrop x1 l2)))) *) (* Goal: inlist Z x0 l0 *) intro. elim H0. split with q. (* Goal: not (Mod a Z0 p) *) rewrite H7. rewrite Zplus_comm. rewrite Zmult_comm. assumption. (* Goal: not (Mod a Z0 p) *) assumption. (* Goal: not (Mod a Z0 p) *) change (Z_of_nat p > Z_of_nat 0)%Z in |- *. apply Znat.inj_gt. assumption. Qed. Lemma until_pos : forall (n : nat) (x : Z), inlist Z x (until n) -> (0 < x)%Z. Proof. (* Goal: forall (n p : nat) (l0 l1 : Zlist) (_ : @eq nat n (length Z l0)) (_ : @eq nat n (length Z l1)) (_ : Prime p) (_ : @eq nat (length Z l0) (length Z l1)) (_ : nodoubles p l0) (_ : allex p l0 l1), permmod p l0 l1 *) simple induction n. (* Goal: permmod p (zdrop x (Nil Z)) (zdrop y (Nil Z)) *) (* Goal: @eq nat (length Z l) O *) (* Goal: forall (n : nat) (_ : forall (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat n (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l)) (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat (S n) (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l) *) unfold inlist in |- *. simpl in |- *. intros. elim H. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros m IH. intros. unfold inlist in H. simpl in H. elim H. intros. (* Goal: permmod p (zdrop x (Nil Z)) (zdrop y (Nil Z)) *) (* Goal: @eq nat (length Z l) O *) (* Goal: forall (n : nat) (_ : forall (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat n (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l)) (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat (S n) (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l) *) rewrite H0. unfold Zlt in |- *. simpl in |- *. reflexivity. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros. apply IH. assumption. Qed. Lemma until_le_n : forall (n : nat) (x : Z), inlist Z x (until n) -> (x <= Z_of_nat n)%Z. Proof. (* Goal: forall (n p : nat) (l0 l1 : Zlist) (_ : @eq nat n (length Z l0)) (_ : @eq nat n (length Z l1)) (_ : Prime p) (_ : @eq nat (length Z l0) (length Z l1)) (_ : nodoubles p l0) (_ : allex p l0 l1), permmod p l0 l1 *) simple induction n. (* Goal: permmod p (zdrop x (Nil Z)) (zdrop y (Nil Z)) *) (* Goal: @eq nat (length Z l) O *) (* Goal: forall (n : nat) (_ : forall (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat n (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l)) (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat (S n) (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l) *) unfold inlist in |- *. simpl in |- *. intros. elim H. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros m IH. intros. unfold inlist in H. simpl in H. elim H. intros. (* Goal: Mod (Z.mul ra x) (Z.mul (Z.mul a r) ra) p *) (* Goal: Z.gt (Z.of_nat p) Z0 *) (* Goal: Prime p *) (* Goal: not (Mod a Z0 p) *) rewrite H0. apply Zle_refl. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros. apply Zle_trans with (Z_of_nat m). (* Goal: not (Mod a Z0 p) *) apply IH. assumption. apply Znat.inj_le. apply le_S. apply le_n. Qed. Lemma until_not_0mod : forall (p : nat) (x : Z), 0 < p -> inlist Z x (until (pred p)) -> ~ Mod x 0 p. Proof. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros. apply mod_repr_non_0. split. (* Goal: not (Mod a Z0 p) *) apply (until_pos (pred p) x). assumption. (* Goal: Z.lt x (Z.of_nat p) *) rewrite (S_pred p 0). rewrite Znat.inj_S. (* Goal: Z.lt x (Z.succ (Z.of_nat m)) *) (* Goal: Z.le (Z.of_nat (S m)) x *) (* Goal: nodoubles p (until m) *) apply Zle_lt_succ. apply until_le_n. (* Goal: not (Mod a Z0 p) *) assumption. assumption. Qed. Lemma untiln_prod_not_0modp : forall p n : nat, 0 < n -> n < p -> Prime p -> ~ Mod (zproduct (until n)) 0 p. Proof. (* Goal: forall (n p : nat) (l0 l1 : Zlist) (_ : @eq nat n (length Z l0)) (_ : @eq nat n (length Z l1)) (_ : Prime p) (_ : @eq nat (length Z l0) (length Z l1)) (_ : nodoubles p l0) (_ : allex p l0 l1), permmod p l0 l1 *) simple induction n. (* Goal: not (Mod a Z0 p) *) intro. elim (lt_irrefl 0). assumption. (* Goal: forall (n : nat) (_ : forall (_ : lt O n) (_ : lt n p) (_ : Prime p), not (Mod (zproduct (until n)) Z0 p)) (_ : lt O (S n)) (_ : lt (S n) p) (_ : Prime p), not (Mod (zproduct (until (S n))) Z0 p) *) intros m IH H0m Hmp Hp. (* Goal: not (Mod (zproduct (until (S m))) Z0 p) *) change (~ Mod (Z_of_nat (S m) * zproduct (until m)) 0 p) in |- *. (* Goal: not (@eq Z z y) *) (* Goal: inlist Z z l *) (* Goal: and (Mod z z p) (permmod p (zdrop z (zdrop x l)) (zdrop z (zdrop y l))) *) intro. elim (mod_mult_0 p (Z_of_nat (S m)) (zproduct (until m))). (* Goal: not (@eq Z z y) *) (* Goal: inlist Z z l *) (* Goal: and (Mod z z p) (permmod p (zdrop z (zdrop x l)) (zdrop z (zdrop y l))) *) intro. elim (mod_repr_non_0 p (Z_of_nat (S m))). split. (* Goal: Z.lt Z0 (Z.of_nat (S m)) *) (* Goal: Z.lt (Z.of_nat (S m)) (Z.of_nat p) *) (* Goal: and (Z.lt Z0 x) (Z.lt x (Z.of_nat p)) *) (* Goal: Mod (Z.of_nat (S m)) x p *) (* Goal: nodoubles p (until m) *) change (Z_of_nat 0 < Z_of_nat (S m))%Z in |- *. (* Goal: not (Mod a Z0 p) *) apply Znat.inj_lt. assumption. (* Goal: not (Mod a Z0 p) *) apply Znat.inj_lt. assumption. (* Goal: not (Mod a Z0 p) *) assumption. (* Goal: not (@eq Z z y) *) (* Goal: inlist Z z l *) (* Goal: and (Mod z z p) (permmod p (zdrop z (zdrop x l)) (zdrop z (zdrop y l))) *) intro. elim (le_lt_or_eq 0 m). intro. (* Goal: not (Mod a Z0 p) *) elim IH. assumption. apply lt_trans with (S m). (* Goal: not (Mod a Z0 p) *) apply lt_n_Sn. assumption. assumption. (* Goal: not (Mod a Z0 p) *) assumption. intro. rewrite <- H1 in H. simpl in H. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) elim mod_0not1 with p. elim Hp. intros. assumption. (* Goal: not (Mod a Z0 p) *) apply mod_sym. assumption. (* Goal: not (Mod a Z0 p) *) apply le_O_n. assumption. (* Goal: not (Mod a Z0 p) *) assumption. Qed. Lemma until_prod_not_0mod : forall p : nat, Prime p -> ~ Mod (zproduct (until (pred p))) 0 p. Proof. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros. elim H. intros. (* Goal: not (Mod (zproduct (until (Init.Nat.pred p))) Z0 p) *) apply untiln_prod_not_0modp; auto with arith. Qed. Lemma until_mapmult_exp : forall (a : Z) (n : nat), zproduct (mapmult a (until n)) = (Exp a n * zproduct (until n))%Z. Proof. (* Goal: forall (n p : nat) (l0 l1 : Zlist) (_ : @eq nat n (length Z l0)) (_ : @eq nat n (length Z l1)) (_ : Prime p) (_ : @eq nat (length Z l0) (length Z l1)) (_ : nodoubles p l0) (_ : allex p l0 l1), permmod p l0 l1 *) simple induction n. (* Goal: permmod p (zdrop x (Nil Z)) (zdrop y (Nil Z)) *) (* Goal: @eq nat (length Z l) O *) (* Goal: forall (n : nat) (_ : forall (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat n (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l)) (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat (S n) (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l) *) simpl in |- *. reflexivity. (* Goal: forall (n : nat) (_ : forall (p : nat) (l0 l1 : Zlist) (_ : @eq nat n (length Z l0)) (_ : @eq nat n (length Z l1)) (_ : Prime p) (_ : @eq nat (length Z l0) (length Z l1)) (_ : nodoubles p l0) (_ : allex p l0 l1), permmod p l0 l1) (p : nat) (l0 l1 : Zlist) (_ : @eq nat (S n) (length Z l0)) (_ : @eq nat (S n) (length Z l1)) (_ : Prime p) (_ : @eq nat (length Z l0) (length Z l1)) (_ : nodoubles p l0) (_ : allex p l0 l1), permmod p l0 l1 *) intros m IH. replace (mapmult a (until (S m))) with (Cons Z (a * Z_of_nat (S m))%Z (mapmult a (until m))). (* Goal: @eq Z (zproduct (Cons Z (Z.mul a (Z.of_nat (S m))) (mapmult a (until m)))) (Z.mul (Exp a (S m)) (zproduct (until (S m)))) *) (* Goal: @eq (list Z) (Cons Z (Z.mul a (Z.of_nat (S m))) (mapmult a (until m))) (mapmult a (until (S m))) *) rewrite exp_S. replace (zproduct (Cons Z (a * Z_of_nat (S m))%Z (mapmult a (until m)))) with (a * Z_of_nat (S m) * zproduct (mapmult a (until m)))%Z. (* Goal: @eq Z (Z.mul (Z.mul a (Z.of_nat (S m))) (zproduct (mapmult a (until m)))) (Z.mul (Z.mul a (Exp a m)) (zproduct (until (S m)))) *) (* Goal: @eq Z (Z.mul (Z.mul a (Z.of_nat (S m))) (zproduct (mapmult a (until m)))) (zproduct (Cons Z (Z.mul a (Z.of_nat (S m))) (mapmult a (until m)))) *) (* Goal: @eq (list Z) (Cons Z (Z.mul a (Z.of_nat (S m))) (mapmult a (until m))) (mapmult a (until (S m))) *) rewrite IH. rewrite Zmult_assoc_reverse. (* Goal: @eq Z (Z.mul a (Z.mul (Z.of_nat (S m)) (Z.mul (Exp a m) (zproduct (until m))))) (Z.mul (Z.mul a (Exp a m)) (zproduct (until (S m)))) *) (* Goal: @eq Z (Z.mul (Z.mul a (Z.of_nat (S m))) (zproduct (mapmult a (until m)))) (zproduct (Cons Z (Z.mul a (Z.of_nat (S m))) (mapmult a (until m)))) *) (* Goal: @eq (list Z) (Cons Z (Z.mul a (Z.of_nat (S m))) (mapmult a (until m))) (mapmult a (until (S m))) *) rewrite (Zmult_assoc (Z_of_nat (S m)) (Exp a m)). (* Goal: @eq Z (Z.mul a (Z.mul (Z.mul (Z.of_nat (S m)) (Exp a m)) (zproduct (until m)))) (Z.mul (Z.mul a (Exp a m)) (zproduct (until (S m)))) *) (* Goal: @eq Z (Z.mul (Z.mul a (Z.of_nat (S m))) (zproduct (mapmult a (until m)))) (zproduct (Cons Z (Z.mul a (Z.of_nat (S m))) (mapmult a (until m)))) *) (* Goal: @eq (list Z) (Cons Z (Z.mul a (Z.of_nat (S m))) (mapmult a (until m))) (mapmult a (until (S m))) *) rewrite (Zmult_comm (Z_of_nat (S m))). (* Goal: @eq Z (Z.mul (Z.mul q (Z.of_nat p)) a) (Z.mul (Z.of_nat p) (Z.mul q a)) *) (* Goal: Z.le Z0 r *) (* Goal: Z.le r (Z.of_nat (Init.Nat.pred p)) *) (* Goal: Mod x (Z.mul a r) p *) (* Goal: Z.gt (Z.of_nat p) Z0 *) (* Goal: Prime p *) (* Goal: not (Mod a Z0 p) *) rewrite Zmult_assoc. rewrite Zmult_assoc. replace (zproduct (until (S m))) with (Z_of_nat (S m) * zproduct (until m))%Z. (* Goal: @eq nat (length Z l0) (length Z l0) *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: Prime p *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: nodoubles p l0 *) (* Goal: allex p l0 l1 *) rewrite Zmult_assoc. reflexivity. (* Goal: @eq nat (length Z l0) (length Z l0) *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: Prime p *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: nodoubles p l0 *) (* Goal: allex p l0 l1 *) reflexivity. reflexivity. reflexivity. Qed. Lemma until_mapmult_allex : forall (p : nat) (a : Z), Prime p -> ~ Mod a 0 p -> allex p (until (pred p)) (mapmult a (until (pred p))). Proof. (* Goal: allex p (until (Init.Nat.pred p)) (mapmult a (until (Init.Nat.pred p))) *) unfold allex in |- *. (* Goal: forall (p : nat) (a : Z) (_ : Prime p) (_ : not (Mod a Z0 p)) (x : Z) (_ : inlist Z x (until (Init.Nat.pred p))), @ex Z (fun y : Z => and (inlist Z y (mapmult a (until (Init.Nat.pred p)))) (Mod x y p)) *) intros p a Hprime Ha0 x Hx. elim Hprime. intros Hp Hp1. (* Goal: @ex Z (fun y : Z => and (inlist Z y (mapmult a (until (Init.Nat.pred p)))) (Mod x y p)) *) elim (mod_mult_inv_r a p). intros ra Hra. (* Goal: @ex Z (fun y : Z => and (inlist Z y (mapmult a (until (Init.Nat.pred p)))) (Mod x y p)) *) (* Goal: Prime p *) (* Goal: not (Mod a Z0 p) *) elim (zdiv_rem (Z_of_nat p) (ra * x)). intros q Hq. elim Hq. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros r Hr. elim Hr. intros. elim H. intros. (* Goal: @ex Z (fun y : Z => and (inlist Z y (mapmult a (until (Init.Nat.pred p)))) (Mod x y p)) *) (* Goal: Z.gt (Z.of_nat p) Z0 *) (* Goal: Prime p *) (* Goal: not (Mod a Z0 p) *) split with (a * r)%Z. (* Goal: and (Mod x y p) (permmod p (zdrop x l0) (zdrop y l1)) *) (* Goal: inlist Z x l0 *) split. apply mapmult_image. apply until_ok. (* Goal: not (Mod a Z0 p) *) split. elim (Zle_lt_or_eq 0 r). intro. assumption. (* Goal: not (@eq Z z y) *) (* Goal: inlist Z z l *) (* Goal: and (Mod z z p) (permmod p (zdrop z (zdrop x l)) (zdrop z (zdrop y l))) *) intro. rewrite <- H3 in H0. rewrite <- Zplus_0_r_reverse in H0. (* Goal: Z.lt Z0 r *) (* Goal: Z.le Z0 r *) (* Goal: Z.le r (Z.of_nat (Init.Nat.pred p)) *) (* Goal: Mod x (Z.mul a r) p *) (* Goal: Z.gt (Z.of_nat p) Z0 *) (* Goal: Prime p *) (* Goal: not (Mod a Z0 p) *) elim until_not_0mod with p x. (* Goal: not (Mod a Z0 p) *) apply lt_trans with 1. apply lt_n_Sn. assumption. (* Goal: not (Mod a Z0 p) *) assumption. (* Goal: not (Mod a Z0 p) *) apply mod_mult_cancel_r with (a * ra)%Z. assumption. (* Goal: not (Mod a Z0 p) *) intro. elim mod_0not1 with p. assumption. (* Goal: not (Mod a Z0 p) *) apply mod_trans with (a * ra)%Z. apply mod_sym. assumption. assumption. (* Goal: @eq Z (Z.mul (Z.mul q (Z.of_nat p)) a) (Z.mul (Z.of_nat p) (Z.mul q a)) *) (* Goal: Z.le Z0 r *) (* Goal: Z.le r (Z.of_nat (Init.Nat.pred p)) *) (* Goal: Mod x (Z.mul a r) p *) (* Goal: Z.gt (Z.of_nat p) Z0 *) (* Goal: Prime p *) (* Goal: not (Mod a Z0 p) *) rewrite (Zmult_comm a ra). rewrite Zmult_assoc. rewrite (Zmult_comm x ra). (* Goal: permmod p (zdrop x (Nil Z)) (zdrop y (Nil Z)) *) (* Goal: @eq nat (length Z l) O *) (* Goal: forall (n : nat) (_ : forall (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat n (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l)) (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat (S n) (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l) *) rewrite H0. simpl in |- *. unfold Mod in |- *. split with (q * a)%Z. simpl in |- *. (* Goal: @eq nat (length Z l0) (length Z l0) *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: Prime p *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: nodoubles p l0 *) (* Goal: allex p l0 l1 *) rewrite Zmult_assoc. rewrite (Zmult_comm q). reflexivity. (* Goal: not (Mod a Z0 p) *) assumption. apply Zlt_succ_le. (* Goal: not (Mod a Z0 p) *) rewrite <- Znat.inj_S. rewrite <- (S_pred p 1). assumption. (* Goal: not (Mod a Z0 p) *) assumption. (* Goal: not (Mod a Z0 p) *) apply mod_mult_cancel_r with ra. assumption. (* Goal: not (Mod a Z0 p) *) intro. elim mod_0not1 with p. assumption. (* Goal: Mod Z0 (Zpos xH) p *) (* Goal: Mod (Z.mul x ra) (Z.mul (Z.mul a r) ra) p *) (* Goal: Z.gt (Z.of_nat p) Z0 *) (* Goal: Prime p *) (* Goal: not (Mod a Z0 p) *) apply mod_trans with (ra * a)%Z. change (Mod (0 * a) (ra * a) p) in |- *. (* Goal: not (Mod a Z0 p) *) apply mod_mult_compat. apply mod_sym. assumption. (* Goal: not (Mod a Z0 p) *) apply mod_refl. rewrite (Zmult_comm ra a). assumption. (* Goal: Mod (Z.mul ra x) (Z.mul (Z.mul a r) ra) p *) (* Goal: Z.gt (Z.of_nat p) Z0 *) (* Goal: Prime p *) (* Goal: not (Mod a Z0 p) *) rewrite (Zmult_comm x ra). rewrite H0. (* Goal: Mod (Z.add (Z.mul q (Z.of_nat p)) r) (Z.mul (Z.mul a r) ra) p *) (* Goal: Z.gt (Z.of_nat p) Z0 *) (* Goal: Prime p *) (* Goal: not (Mod a Z0 p) *) rewrite (Zmult_comm a r). rewrite (Zmult_assoc_reverse r a ra). (* Goal: Mod (Z.add (Z.mul q (Z.of_nat p)) r) r p *) (* Goal: Mod r (Z.mul r (Z.mul a ra)) p *) (* Goal: Z.gt (Z.of_nat p) Z0 *) (* Goal: Prime p *) (* Goal: not (Mod a Z0 p) *) apply mod_trans with r. split with q. (* Goal: @eq nat (length Z l0) (length Z l0) *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: Prime p *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: nodoubles p l0 *) (* Goal: allex p l0 l1 *) rewrite Zplus_comm. rewrite Zmult_comm. reflexivity. (* Goal: Mod r (Z.mul r (Z.mul a ra)) p *) (* Goal: Z.gt (Z.of_nat p) Z0 *) (* Goal: Prime p *) (* Goal: not (Mod a Z0 p) *) pattern r at 1 in |- *. rewrite <- Zmult_1_l with r. (* Goal: Mod (Z.mul h (zproduct t)) (Z.mul x (zproduct (zdrop x l1))) p *) (* Goal: inlist Z x l1 *) rewrite (Zmult_comm 1 r). apply mod_mult_compat. (* Goal: not (Mod a Z0 p) *) apply mod_refl. apply mod_sym. assumption. (* Goal: Z.gt (Z.of_nat p) Z0 *) (* Goal: Prime p *) (* Goal: not (Mod a Z0 p) *) change (Z_of_nat p > Z_of_nat 0)%Z in |- *. apply Znat.inj_gt. (* Goal: not (Mod a Z0 p) *) apply gt_trans with 1. assumption. apply gt_Sn_n. (* Goal: not (Mod a Z0 p) *) assumption. assumption. Qed. Lemma until_nodoubles1 : forall p : nat, Prime p -> forall n : nat, n < p -> nodoubles p (until n). Proof. (* Goal: forall (n p : nat) (l0 l1 : Zlist) (_ : @eq nat n (length Z l0)) (_ : @eq nat n (length Z l1)) (_ : Prime p) (_ : @eq nat (length Z l0) (length Z l1)) (_ : nodoubles p l0) (_ : allex p l0 l1), permmod p l0 l1 *) simple induction n. (* Goal: permmod p (zdrop x (Nil Z)) (zdrop y (Nil Z)) *) (* Goal: @eq nat (length Z l) O *) (* Goal: forall (n : nat) (_ : forall (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat n (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l)) (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat (S n) (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l) *) intros. simpl in |- *. apply nodoubles_nil. (* Goal: forall (n : nat) (_ : forall _ : lt n p, nodoubles p (until n)) (_ : lt (S n) p), nodoubles p (until (S n)) *) intros m IH Hb. (* Goal: nodoubles p (until (S m)) *) change (nodoubles p (Cons Z (Z_of_nat (S m)) (until m))) in |- *. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) apply nodoubles_ind. intros. (* Goal: not (@eq Z z y) *) (* Goal: inlist Z z l *) (* Goal: and (Mod z z p) (permmod p (zdrop z (zdrop x l)) (zdrop z (zdrop y l))) *) intro. elim (Zlt_not_le x (Z_of_nat (S m))). (* Goal: Z.lt x (Z.of_nat (S m)) *) (* Goal: Z.le (Z.of_nat (S m)) x *) (* Goal: nodoubles p (until m) *) rewrite Znat.inj_S. apply Zle_lt_succ. apply until_le_n. (* Goal: not (Mod a Z0 p) *) assumption. apply Zeq_le. apply mod_repr_eq with p. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) elim H. intros. apply lt_trans with 1. apply lt_n_Sn. assumption. (* Goal: and (Mod x y p) (permmod p (zdrop x l0) (zdrop y l1)) *) (* Goal: inlist Z x l0 *) split. change (Z_of_nat 0 < Z_of_nat (S m))%Z in |- *. apply Znat.inj_lt. (* Goal: not (Mod a Z0 p) *) apply lt_O_Sn. apply Znat.inj_lt. assumption. (* Goal: not (Mod a Z0 p) *) split. apply until_pos with m. assumption. (* Goal: Z.lt x (Z.of_nat p) *) (* Goal: Mod (Z.of_nat (S m)) x p *) (* Goal: nodoubles p (until m) *) apply Zle_lt_trans with (Z_of_nat m). (* Goal: not (Mod a Z0 p) *) apply until_le_n. assumption. (* Goal: Z.lt (Z.of_nat m) (Z.of_nat p) *) (* Goal: Mod (Z.of_nat (S m)) x p *) (* Goal: nodoubles p (until m) *) apply Znat.inj_lt. apply le_lt_trans with (S m). (* Goal: not (Mod a Z0 p) *) apply le_n_Sn. assumption. (* Goal: not (Mod a Z0 p) *) assumption. (* Goal: permmod p (zdrop x l0) (zdrop y l1) *) (* Goal: inlist Z x l0 *) apply IH. apply le_lt_trans with (S m). (* Goal: not (Mod a Z0 p) *) apply le_n_Sn. assumption. Qed. Lemma until_nodoubles : forall p : nat, Prime p -> nodoubles p (until (pred p)). Proof. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros. apply until_nodoubles1. assumption. (* Goal: lt O p *) apply lt_pred_n_n. apply lt_trans with 1. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) apply lt_n_Sn. elim H. intros. assumption. Qed. (** * Permutations modulo p. *) Fixpoint permmod (p : nat) (l1 : Zlist) {struct l1} : Zlist -> Prop := fun l2 : Zlist => match l1 with | Nil => l2 = Nil Z | Cons x t => exists y : Z, inlist Z y l2 /\ Mod x y p /\ permmod p t (zdrop y l2) end. Lemma permmod_nil : forall p : nat, permmod p (Nil Z) (Nil Z). Proof. (* Goal: permmod p (zdrop x (Nil Z)) (zdrop y (Nil Z)) *) (* Goal: @eq nat (length Z l) O *) (* Goal: forall (n : nat) (_ : forall (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat n (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l)) (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat (S n) (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l) *) simpl in |- *. intro. reflexivity. Qed. Lemma permmod_drop : forall (p : nat) (x1 x2 : Z) (l1 l2 : Zlist), Mod x1 x2 p -> inlist Z x1 l1 -> inlist Z x2 l2 -> permmod p (zdrop x1 l1) (zdrop x2 l2) -> permmod p l1 l2. Proof. (* Goal: forall (l1 : Zlist) (_ : @eq nat (length Z (Nil Z)) (length Z l1)) (_ : forall (x0 : Z) (_ : inlist Z x0 (Nil Z)), @ex Z (fun x1 : Z => and (inlist Z x1 l1) (and (Mod x0 x1 p) (permmod p (zdrop x0 (Nil Z)) (zdrop x1 l1))))), permmod p (Nil Z) l1 *) (* Goal: forall (a : Z) (l : list Z) (_ : forall (l1 : Zlist) (_ : @eq nat (length Z l) (length Z l1)) (_ : forall (x0 : Z) (_ : inlist Z x0 l), @ex Z (fun x1 : Z => and (inlist Z x1 l1) (and (Mod x0 x1 p) (permmod p (zdrop x0 l) (zdrop x1 l1))))), permmod p l l1) (l1 : Zlist) (_ : @eq nat (length Z (Cons Z a l)) (length Z l1)) (_ : forall (x0 : Z) (_ : inlist Z x0 (Cons Z a l)), @ex Z (fun x1 : Z => and (inlist Z x1 l1) (and (Mod x0 x1 p) (permmod p (zdrop x0 (Cons Z a l)) (zdrop x1 l1))))), permmod p (Cons Z a l) l1 *) simple induction l1. (* Goal: permmod p (zdrop x (Nil Z)) (zdrop y (Nil Z)) *) (* Goal: @eq nat (length Z l) O *) (* Goal: forall (n : nat) (_ : forall (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat n (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l)) (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat (S n) (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l) *) simpl in |- *. intros. elim H0. (* Goal: forall (a : Z) (l : list Z) (_ : forall (l1 : Zlist) (p : nat) (_ : permmod p l l1), Mod (zproduct l) (zproduct l1) p) (l1 : Zlist) (p : nat) (_ : permmod p (Cons Z a l) l1), Mod (zproduct (Cons Z a l)) (zproduct l1) p *) intros h t IH. intros l2 Hm. (* Goal: forall (_ : inlist Z x1 (Cons Z h t)) (_ : inlist Z x2 l2) (_ : permmod p (zdrop x1 (Cons Z h t)) (zdrop x2 l2)), permmod p (Cons Z h t) l2 *) elim (zeqdec x1 h). (* Goal: permmod p (zdrop x (Nil Z)) (zdrop y (Nil Z)) *) (* Goal: @eq nat (length Z l) O *) (* Goal: forall (n : nat) (_ : forall (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat n (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l)) (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat (S n) (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l) *) intros. simpl in |- *. split with x2. (* Goal: not (Mod a Z0 p) *) split. assumption. (* Goal: not (Mod a Z0 p) *) split. rewrite <- H. assumption. (* Goal: permmod p t (zdrop x2 l2) *) (* Goal: forall (_ : not (@eq Z x1 h)) (_ : inlist Z x1 (Cons Z h t)) (_ : inlist Z x2 l2) (_ : permmod p (zdrop x1 (Cons Z h t)) (zdrop x2 l2)), permmod p (Cons Z h t) l2 *) rewrite H in H2. rewrite zdrop_head_eq in H2. (* Goal: not (Mod a Z0 p) *) assumption. reflexivity. (* Goal: not (@eq Z z y) *) (* Goal: inlist Z z l *) (* Goal: and (Mod z z p) (permmod p (zdrop z (zdrop x l)) (zdrop z (zdrop y l))) *) intro. (* Goal: permmod p (zdrop x (Cons Z h0 t0)) (zdrop y l1) *) (* Goal: inlist Z x t0 *) rewrite zdrop_head_neq. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros. elim H2. intros y Hy. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) elim Hy. intros. elim H4. intros. (* Goal: @ex Z (fun x1 : Z => and (inlist Z x1 l1) (and (Mod x x1 p) (permmod p (zdrop x l0) (zdrop x1 l1)))) *) (* Goal: inlist Z x l0 *) split with y. split. (* Goal: not (Mod a Z0 p) *) apply zdrop_inlist_weak with x2. assumption. (* Goal: not (Mod a Z0 p) *) split. assumption. (* Goal: permmod p t (zdrop y l2) *) (* Goal: not (@eq Z x1 h) *) rewrite zdrop_swap in H6. (* Goal: not (Mod a Z0 p) *) apply IH. assumption. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) elim (inlist_head_neq Z x1 h t). intros. apply H7. assumption. (* Goal: not (Mod a Z0 p) *) assumption. (* Goal: inlist Z x2 (zdrop y l2) *) (* Goal: permmod p (zdrop x1 t) (zdrop x2 (zdrop y l2)) *) (* Goal: not (@eq Z x1 h) *) elim (zeqdec x2 y). (* Goal: not (Mod a Z0 p) *) intro. rewrite H7. rewrite H7 in H3. assumption. (* Goal: not (Mod a Z0 p) *) intro. apply zdrop_neq_inlist. assumption. assumption. (* Goal: not (Mod a Z0 p) *) assumption. assumption. Qed. Lemma permmod_drop_cons : forall (p : nat) (x1 x2 : Z) (t1 l2 : Zlist), Mod x1 x2 p -> inlist Z x2 l2 -> permmod p t1 (zdrop x2 l2) -> permmod p (Cons Z x1 t1) l2. Proof. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros. apply permmod_drop with x1 x2. (* Goal: not (Mod a Z0 p) *) assumption. (* Goal: @eq nat (length Z l0) (length Z l0) *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: Prime p *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: nodoubles p l0 *) (* Goal: allex p l0 l1 *) apply inlist_head_eq. reflexivity. (* Goal: not (Mod a Z0 p) *) assumption. (* Goal: not (Mod a Z0 p) *) rewrite zdrop_head_eq. assumption. (* Goal: @eq nat (length Z l0) (length Z l0) *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: Prime p *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: nodoubles p l0 *) (* Goal: allex p l0 l1 *) reflexivity. Qed. Lemma permmod_cons_extend : forall (p : nat) (x1 x2 : Z) (l1 l2 : Zlist), permmod p l1 l2 -> Mod x1 x2 p -> permmod p (Cons Z x1 l1) (Cons Z x2 l2). Proof. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros. (* Goal: permmod p (Cons Z x1 l1) (Cons Z x2 l2) *) apply permmod_drop with x1 x2. (* Goal: not (Mod a Z0 p) *) assumption. (* Goal: @eq nat (length Z l0) (length Z l0) *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: Prime p *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: nodoubles p l0 *) (* Goal: allex p l0 l1 *) apply inlist_head_eq. reflexivity. (* Goal: @eq nat (length Z l0) (length Z l0) *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: Prime p *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: nodoubles p l0 *) (* Goal: allex p l0 l1 *) apply inlist_head_eq. reflexivity. (* Goal: permmod p (zdrop x (Cons Z h0 t0)) (zdrop h1 l1) *) (* Goal: forall _ : not (@eq Z x h0), @ex Z (fun y : Z => and (inlist Z y l1) (and (Mod x y p) (permmod p (zdrop x (Cons Z h0 t0)) (zdrop y l1)))) *) rewrite zdrop_head_eq. rewrite zdrop_head_eq. (* Goal: not (Mod a Z0 p) *) assumption. reflexivity. reflexivity. Qed. Lemma permmod_length : forall (p : nat) (l1 l2 : Zlist), permmod p l1 l2 -> length Z l1 = length Z l2. Proof. (* Goal: forall (l1 : Zlist) (_ : @eq nat (length Z (Nil Z)) (length Z l1)) (_ : forall (x0 : Z) (_ : inlist Z x0 (Nil Z)), @ex Z (fun x1 : Z => and (inlist Z x1 l1) (and (Mod x0 x1 p) (permmod p (zdrop x0 (Nil Z)) (zdrop x1 l1))))), permmod p (Nil Z) l1 *) (* Goal: forall (a : Z) (l : list Z) (_ : forall (l1 : Zlist) (_ : @eq nat (length Z l) (length Z l1)) (_ : forall (x0 : Z) (_ : inlist Z x0 l), @ex Z (fun x1 : Z => and (inlist Z x1 l1) (and (Mod x0 x1 p) (permmod p (zdrop x0 l) (zdrop x1 l1))))), permmod p l l1) (l1 : Zlist) (_ : @eq nat (length Z (Cons Z a l)) (length Z l1)) (_ : forall (x0 : Z) (_ : inlist Z x0 (Cons Z a l)), @ex Z (fun x1 : Z => and (inlist Z x1 l1) (and (Mod x0 x1 p) (permmod p (zdrop x0 (Cons Z a l)) (zdrop x1 l1))))), permmod p (Cons Z a l) l1 *) simple induction l1. (* Goal: permmod p (zdrop x (Nil Z)) (zdrop y (Nil Z)) *) (* Goal: @eq nat (length Z l) O *) (* Goal: forall (n : nat) (_ : forall (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat n (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l)) (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat (S n) (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l) *) simpl in |- *. intros. rewrite H. simpl in |- *. reflexivity. (* Goal: permmod p (zdrop x (Nil Z)) (zdrop y (Nil Z)) *) (* Goal: @eq nat (length Z l) O *) (* Goal: forall (n : nat) (_ : forall (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat n (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l)) (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat (S n) (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l) *) intros h t IH. simpl in |- *. intros. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) elim H. intros y Hy. elim Hy. intros. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) elim H1. intros. (* Goal: @eq nat (S (length Z t)) (length Z l2) *) rewrite (IH (zdrop y l2)). (* Goal: @eq nat (S (length Z (zdrop y l2))) (length Z l2) *) (* Goal: permmod p t (zdrop y l2) *) rewrite zdrop_length with y l2. (* Goal: not (Mod a Z0 p) *) reflexivity. assumption. assumption. Qed. Lemma permmod_refl : forall (p : nat) (l : Zlist), permmod p l l. Proof. (* Goal: forall (p : nat) (l : Zlist), permmod p l l *) simple induction l. (* Goal: permmod p (zdrop x (Nil Z)) (zdrop y (Nil Z)) *) (* Goal: @eq nat (length Z l) O *) (* Goal: forall (n : nat) (_ : forall (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat n (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l)) (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat (S n) (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l) *) simpl in |- *. reflexivity. (* Goal: forall (a : Z) (l : list Z) (_ : forall (l1 : Zlist) (p : nat) (_ : permmod p l l1), Mod (zproduct l) (zproduct l1) p) (l1 : Zlist) (p : nat) (_ : permmod p (Cons Z a l) l1), Mod (zproduct (Cons Z a l)) (zproduct l1) p *) intros h t IH. split with h. (* Goal: and (Mod x y p) (permmod p (zdrop x l0) (zdrop y l1)) *) (* Goal: inlist Z x l0 *) split. apply inlist_head_eq. reflexivity. (* Goal: and (Mod x y p) (permmod p (zdrop x l0) (zdrop y l1)) *) (* Goal: inlist Z x l0 *) split. apply mod_refl. (* Goal: not (Mod a Z0 p) *) rewrite zdrop_head_eq. assumption. reflexivity. Qed. Lemma permmod_sym : forall (p : nat) (l1 l2 : Zlist), permmod p l1 l2 -> permmod p l2 l1. Proof. (* Goal: forall (l1 : Zlist) (_ : @eq nat (length Z (Nil Z)) (length Z l1)) (_ : forall (x0 : Z) (_ : inlist Z x0 (Nil Z)), @ex Z (fun x1 : Z => and (inlist Z x1 l1) (and (Mod x0 x1 p) (permmod p (zdrop x0 (Nil Z)) (zdrop x1 l1))))), permmod p (Nil Z) l1 *) (* Goal: forall (a : Z) (l : list Z) (_ : forall (l1 : Zlist) (_ : @eq nat (length Z l) (length Z l1)) (_ : forall (x0 : Z) (_ : inlist Z x0 l), @ex Z (fun x1 : Z => and (inlist Z x1 l1) (and (Mod x0 x1 p) (permmod p (zdrop x0 l) (zdrop x1 l1))))), permmod p l l1) (l1 : Zlist) (_ : @eq nat (length Z (Cons Z a l)) (length Z l1)) (_ : forall (x0 : Z) (_ : inlist Z x0 (Cons Z a l)), @ex Z (fun x1 : Z => and (inlist Z x1 l1) (and (Mod x0 x1 p) (permmod p (zdrop x0 (Cons Z a l)) (zdrop x1 l1))))), permmod p (Cons Z a l) l1 *) simple induction l1. (* Goal: permmod p (zdrop x (Nil Z)) (zdrop y (Nil Z)) *) (* Goal: @eq nat (length Z l) O *) (* Goal: forall (n : nat) (_ : forall (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat n (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l)) (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat (S n) (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l) *) simpl in |- *. intros. rewrite H. apply permmod_nil. (* Goal: forall (a : Z) (l : list Z) (_ : forall (l2 : Zlist) (_ : permmod p l l2), permmod p l2 l) (l2 : Zlist) (_ : permmod p (Cons Z a l) l2), permmod p l2 (Cons Z a l) *) intros h1 t1 IH1. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros. elim H. intros y Hy. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) elim Hy. intros. elim H1. intros. (* Goal: permmod p l2 (Cons Z h1 t1) *) apply permmod_drop with y h1. (* Goal: not (Mod a Z0 p) *) apply mod_sym. assumption. (* Goal: not (Mod a Z0 p) *) assumption. (* Goal: @eq nat (length Z l0) (length Z l0) *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: Prime p *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: nodoubles p l0 *) (* Goal: allex p l0 l1 *) apply inlist_head_eq. reflexivity. (* Goal: permmod p (zdrop x (Cons Z h0 t0)) (zdrop h1 l1) *) (* Goal: forall _ : not (@eq Z x h0), @ex Z (fun y : Z => and (inlist Z y l1) (and (Mod x y p) (permmod p (zdrop x (Cons Z h0 t0)) (zdrop y l1)))) *) rewrite zdrop_head_eq. apply IH1. (* Goal: not (Mod a Z0 p) *) assumption. (* Goal: @eq nat (length Z l0) (length Z l0) *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: Prime p *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: nodoubles p l0 *) (* Goal: allex p l0 l1 *) reflexivity. Qed. Lemma permmod_product : forall (l0 l1 : Zlist) (p : nat), permmod p l0 l1 -> Mod (zproduct l0) (zproduct l1) p. Proof. (* Goal: forall (p : nat) (l0 l1 : Zlist) (_ : permmod p l0 l1) (x : Z) (_ : inlist Z x l0), @ex Z (fun y : Z => and (inlist Z y l1) (and (Mod x y p) (permmod p (zdrop x l0) (zdrop y l1)))) *) simple induction l0. (* Goal: permmod p (zdrop x (Nil Z)) (zdrop y (Nil Z)) *) (* Goal: @eq nat (length Z l) O *) (* Goal: forall (n : nat) (_ : forall (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat n (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l)) (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat (S n) (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l) *) simpl in |- *. intros. rewrite H. simpl in |- *. apply mod_refl. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros h t IH. intros. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) elim H. intros. elim H0. intros. elim H2. intros. (* Goal: permmod p (zdrop x (Nil Z)) (zdrop y (Nil Z)) *) (* Goal: @eq nat (length Z l) O *) (* Goal: forall (n : nat) (_ : forall (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat n (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l)) (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat (S n) (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l) *) simpl in |- *. rewrite <- zdrop_product with x l1. (* Goal: Mod (Z.mul h (zproduct t)) (Z.mul x (zproduct (zdrop x l1))) p *) (* Goal: inlist Z x l1 *) apply mod_mult_compat. (* Goal: not (Mod a Z0 p) *) assumption. (* Goal: not (Mod a Z0 p) *) apply IH. assumption. (* Goal: not (Mod a Z0 p) *) assumption. Qed. Lemma allex_permmod : forall (p : nat) (l0 l1 : Zlist), length Z l0 = length Z l1 -> (forall x0 : Z, inlist Z x0 l0 -> exists x1 : Z, inlist Z x1 l1 /\ Mod x0 x1 p /\ permmod p (zdrop x0 l0) (zdrop x1 l1)) -> permmod p l0 l1. Proof. (* Goal: forall (p : nat) (l0 l1 : Zlist) (_ : permmod p l0 l1) (x : Z) (_ : inlist Z x l0), @ex Z (fun y : Z => and (inlist Z y l1) (and (Mod x y p) (permmod p (zdrop x l0) (zdrop y l1)))) *) simple induction l0. (* Goal: forall (l1 : Zlist) (_ : @eq nat (length Z (Nil Z)) (length Z l1)) (_ : forall (x0 : Z) (_ : inlist Z x0 (Nil Z)), @ex Z (fun x1 : Z => and (inlist Z x1 l1) (and (Mod x0 x1 p) (permmod p (zdrop x0 (Nil Z)) (zdrop x1 l1))))), permmod p (Nil Z) l1 *) (* Goal: forall (a : Z) (l : list Z) (_ : forall (l1 : Zlist) (_ : @eq nat (length Z l) (length Z l1)) (_ : forall (x0 : Z) (_ : inlist Z x0 l), @ex Z (fun x1 : Z => and (inlist Z x1 l1) (and (Mod x0 x1 p) (permmod p (zdrop x0 l) (zdrop x1 l1))))), permmod p l l1) (l1 : Zlist) (_ : @eq nat (length Z (Cons Z a l)) (length Z l1)) (_ : forall (x0 : Z) (_ : inlist Z x0 (Cons Z a l)), @ex Z (fun x1 : Z => and (inlist Z x1 l1) (and (Mod x0 x1 p) (permmod p (zdrop x0 (Cons Z a l)) (zdrop x1 l1))))), permmod p (Cons Z a l) l1 *) simple induction l1. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros. apply permmod_nil. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros. discriminate H0. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros h0 t0 IH0. intros. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) elim (H0 h0). intro x1. intros. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) elim H1. intros. elim H3. intros. (* Goal: permmod p (Cons Z h0 t0) l1 *) (* Goal: inlist Z h0 (Cons Z h0 t0) *) rewrite zdrop_head_eq in H5. (* Goal: permmod p (Cons Z h0 t0) l1 *) (* Goal: @eq Z h0 h0 *) (* Goal: inlist Z h0 (Cons Z h0 t0) *) apply permmod_drop_cons with x1. (* Goal: not (Mod a Z0 p) *) assumption. assumption. assumption. (* Goal: @eq nat (length Z l0) (length Z l0) *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: Prime p *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: nodoubles p l0 *) (* Goal: allex p l0 l1 *) reflexivity. (* Goal: @eq nat (length Z l0) (length Z l0) *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: Prime p *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: nodoubles p l0 *) (* Goal: allex p l0 l1 *) apply inlist_head_eq. reflexivity. Qed. Lemma permmod_allex : forall (p : nat) (l0 l1 : Zlist), permmod p l0 l1 -> forall x : Z, inlist Z x l0 -> exists y : Z, inlist Z y l1 /\ Mod x y p /\ permmod p (zdrop x l0) (zdrop y l1). Proof. (* Goal: forall (p : nat) (l0 l1 : Zlist) (_ : permmod p l0 l1) (x : Z) (_ : inlist Z x l0), @ex Z (fun y : Z => and (inlist Z y l1) (and (Mod x y p) (permmod p (zdrop x l0) (zdrop y l1)))) *) simple induction l0. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros. elim H0. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros h0 t0 IH0. intros. (* Goal: @ex Z (fun y : Z => and (inlist Z y l1) (and (Mod x y p) (permmod p (zdrop x (Cons Z h0 t0)) (zdrop y l1)))) *) elim H. intros h1 Hh1. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) elim Hh1. intros. elim H2. intros. (* Goal: @ex Z (fun y : Z => and (inlist Z y l1) (and (Mod x y p) (permmod p (zdrop x (Cons Z h0 t0)) (zdrop y l1)))) *) elim (zeqdec x h0). (* Goal: not (@eq Z z y) *) (* Goal: inlist Z z l *) (* Goal: and (Mod z z p) (permmod p (zdrop z (zdrop x l)) (zdrop z (zdrop y l))) *) intro. split with h1. (* Goal: not (Mod a Z0 p) *) split. assumption. (* Goal: not (Mod a Z0 p) *) split. rewrite H5. assumption. (* Goal: not (Mod a Z0 p) *) rewrite zdrop_head_eq. assumption. assumption. (* Goal: not (@eq Z z y) *) (* Goal: inlist Z z l *) (* Goal: and (Mod z z p) (permmod p (zdrop z (zdrop x l)) (zdrop z (zdrop y l))) *) intro. elim (IH0 (zdrop h1 l1) H4 x). (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros y Hy. elim Hy. intros. elim H7. intros. (* Goal: @ex Z (fun x1 : Z => and (inlist Z x1 l1) (and (Mod x x1 p) (permmod p (zdrop x l0) (zdrop x1 l1)))) *) (* Goal: inlist Z x l0 *) split with y. (* Goal: not (Mod a Z0 p) *) split. apply zdrop_inlist_weak with h1. assumption. (* Goal: not (Mod a Z0 p) *) split. assumption. (* Goal: permmod p (zdrop x (Cons Z h0 t0)) (zdrop y l1) *) (* Goal: inlist Z x t0 *) rewrite zdrop_head_neq. split with h1. (* Goal: and (Mod x y p) (permmod p (zdrop x l0) (zdrop y l1)) *) (* Goal: inlist Z x l0 *) split. elim (zeqdec h1 y). (* Goal: not (Mod a Z0 p) *) intro. rewrite H10 in H6. rewrite H10. assumption. (* Goal: not (Mod a Z0 p) *) intro. apply zdrop_neq_inlist. assumption. assumption. (* Goal: not (Mod a Z0 p) *) split. assumption. rewrite zdrop_swap. assumption. (* Goal: not (Mod a Z0 p) *) assumption. elim (inlist_head_neq Z x h0 t0). (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros. apply H6. assumption. assumption. Qed. Lemma permmod_trans1 : forall (n p : nat) (l0 l1 l2 : Zlist), length Z l0 = n -> length Z l1 = n -> length Z l2 = n -> permmod p l0 l1 -> permmod p l1 l2 -> permmod p l0 l2. Proof. (* Goal: forall (n p : nat) (l0 l1 : Zlist) (_ : @eq nat n (length Z l0)) (_ : @eq nat n (length Z l1)) (_ : Prime p) (_ : @eq nat (length Z l0) (length Z l1)) (_ : nodoubles p l0) (_ : allex p l0 l1), permmod p l0 l1 *) simple induction n. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros. (* Goal: permmod p l0 l1 *) (* Goal: forall (n : nat) (_ : forall (p : nat) (l0 l1 : Zlist) (_ : @eq nat n (length Z l0)) (_ : @eq nat n (length Z l1)) (_ : Prime p) (_ : @eq nat (length Z l0) (length Z l1)) (_ : nodoubles p l0) (_ : allex p l0 l1), permmod p l0 l1) (p : nat) (l0 l1 : Zlist) (_ : @eq nat (S n) (length Z l0)) (_ : @eq nat (S n) (length Z l1)) (_ : Prime p) (_ : @eq nat (length Z l0) (length Z l1)) (_ : nodoubles p l0) (_ : allex p l0 l1), permmod p l0 l1 *) rewrite length_0 with Z l0. (* Goal: permmod p (Nil Z) l2 *) (* Goal: @eq nat (length Z l0) O *) (* Goal: forall (n : nat) (_ : forall (p : nat) (l0 l1 l2 : Zlist) (_ : @eq nat (length Z l0) n) (_ : @eq nat (length Z l1) n) (_ : @eq nat (length Z l2) n) (_ : permmod p l0 l1) (_ : permmod p l1 l2), permmod p l0 l2) (p : nat) (l0 l1 l2 : Zlist) (_ : @eq nat (length Z l0) (S n)) (_ : @eq nat (length Z l1) (S n)) (_ : @eq nat (length Z l2) (S n)) (_ : permmod p l0 l1) (_ : permmod p l1 l2), permmod p l0 l2 *) rewrite length_0 with Z l2. (* Goal: not (Mod a Z0 p) *) apply permmod_nil. assumption. assumption. (* Goal: forall (n : nat) (_ : forall (p : nat) (l0 l1 : Zlist) (_ : @eq nat n (length Z l0)) (_ : @eq nat n (length Z l1)) (_ : Prime p) (_ : @eq nat (length Z l0) (length Z l1)) (_ : nodoubles p l0) (_ : allex p l0 l1), permmod p l0 l1) (p : nat) (l0 l1 : Zlist) (_ : @eq nat (S n) (length Z l0)) (_ : @eq nat (S n) (length Z l1)) (_ : Prime p) (_ : @eq nat (length Z l0) (length Z l1)) (_ : nodoubles p l0) (_ : allex p l0 l1), permmod p l0 l1 *) intros m IH. (* Goal: forall (p : nat) (l0 l1 l2 : Zlist) (_ : @eq nat (length Z l0) (S m)) (_ : @eq nat (length Z l1) (S m)) (_ : @eq nat (length Z l2) (S m)) (_ : permmod p l0 l1) (_ : permmod p l1 l2), permmod p l0 l2 *) intros p l0 l1 l2 Hl0 Hl1 Hl2 H01 H12. (* Goal: permmod p l0 l1 *) apply allex_permmod. transitivity (length Z l1). (* Goal: not (Mod a Z0 p) *) apply permmod_length with p. assumption. (* Goal: not (Mod a Z0 p) *) apply permmod_length with p. assumption. (* Goal: forall (x0 : Z) (_ : inlist Z x0 l0), @ex Z (fun x1 : Z => and (inlist Z x1 l2) (and (Mod x0 x1 p) (permmod p (zdrop x0 l0) (zdrop x1 l2)))) *) intros x0 Hx0. (* Goal: @ex Z (fun x1 : Z => and (inlist Z x1 l2) (and (Mod x0 x1 p) (permmod p (zdrop x0 l0) (zdrop x1 l2)))) *) elim (permmod_allex p l0 l1 H01 x0). intros x1 H0. (* Goal: @ex Z (fun x1 : Z => and (inlist Z x1 l2) (and (Mod x0 x1 p) (permmod p (zdrop x0 l0) (zdrop x1 l2)))) *) (* Goal: inlist Z x0 l0 *) elim H0. intros Hx1 H1. elim H1. intros Hm01 Hd01. (* Goal: @ex Z (fun x1 : Z => and (inlist Z x1 l2) (and (Mod x0 x1 p) (permmod p (zdrop x0 l0) (zdrop x1 l2)))) *) (* Goal: inlist Z x0 l0 *) elim (permmod_allex p l1 l2 H12 x1). intros x2 H2. (* Goal: @ex Z (fun x1 : Z => and (inlist Z x1 l2) (and (Mod x0 x1 p) (permmod p (zdrop x0 l0) (zdrop x1 l2)))) *) (* Goal: inlist Z x1 l1 *) (* Goal: inlist Z x0 l0 *) elim H2. intros Hx2 H3. elim H3. intros Hm12 Hd12. (* Goal: @ex Z (fun x1 : Z => and (inlist Z x1 l2) (and (Mod x0 x1 p) (permmod p (zdrop x0 l0) (zdrop x1 l2)))) *) (* Goal: inlist Z x1 l1 *) (* Goal: inlist Z x0 l0 *) split with x2. (* Goal: not (Mod a Z0 p) *) split. assumption. (* Goal: not (Mod a Z0 p) *) split. apply mod_trans with x1. assumption. assumption. (* Goal: permmod p (zdrop x0 l0) (zdrop x2 l2) *) (* Goal: inlist Z x1 l1 *) (* Goal: inlist Z x0 l0 *) apply IH with (zdrop x1 l1). (* Goal: not (Mod a Z0 p) *) apply S_inj. rewrite zdrop_length. assumption. assumption. (* Goal: not (Mod a Z0 p) *) apply S_inj. rewrite zdrop_length. assumption. assumption. (* Goal: not (Mod a Z0 p) *) apply S_inj. rewrite zdrop_length. assumption. assumption. (* Goal: not (Mod a Z0 p) *) assumption. assumption. (* Goal: not (Mod a Z0 p) *) assumption. assumption. Qed. Lemma permmod_trans : forall (p : nat) (l0 l1 l2 : Zlist), permmod p l0 l1 -> permmod p l1 l2 -> permmod p l0 l2. Proof. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros. apply permmod_trans1 with (length Z l0) l1. (* Goal: @eq nat (length Z l0) (length Z l0) *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: Prime p *) (* Goal: @eq nat (length Z l0) (length Z l1) *) (* Goal: nodoubles p l0 *) (* Goal: allex p l0 l1 *) reflexivity. (* Goal: not (Mod a Z0 p) *) symmetry in |- *. apply permmod_length with p. assumption. (* Goal: @eq nat (length Z l0) (length Z l2) *) (* Goal: permmod p l0 l1 *) (* Goal: permmod p l1 l2 *) symmetry in |- *. transitivity (length Z l1). (* Goal: not (Mod a Z0 p) *) apply permmod_length with p. assumption. (* Goal: not (Mod a Z0 p) *) apply permmod_length with p. assumption. (* Goal: not (Mod a Z0 p) *) assumption. assumption. Qed. Lemma permmod_drop_drop1 : forall (n p : nat) (x y : Z) (l : Zlist), n = length Z l -> Mod x y p -> inlist Z x l -> inlist Z y l -> permmod p (zdrop x l) (zdrop y l). Proof. (* Goal: forall (n p : nat) (l0 l1 : Zlist) (_ : @eq nat n (length Z l0)) (_ : @eq nat n (length Z l1)) (_ : Prime p) (_ : @eq nat (length Z l0) (length Z l1)) (_ : nodoubles p l0) (_ : allex p l0 l1), permmod p l0 l1 *) simple induction n. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros. rewrite length_0 with Z l. (* Goal: permmod p (zdrop x (Nil Z)) (zdrop y (Nil Z)) *) (* Goal: @eq nat (length Z l) O *) (* Goal: forall (n : nat) (_ : forall (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat n (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l)) (p : nat) (x y : Z) (l : Zlist) (_ : @eq nat (S n) (length Z l)) (_ : Mod x y p) (_ : inlist Z x l) (_ : inlist Z y l), permmod p (zdrop x l) (zdrop y l) *) simpl in |- *. reflexivity. symmetry in |- *. assumption. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros m IH. intros. (* Goal: permmod p (zdrop x l) (zdrop y l) *) elim (zeqdec x y). (* Goal: not (@eq Z z y) *) (* Goal: inlist Z z l *) (* Goal: and (Mod z z p) (permmod p (zdrop z (zdrop x l)) (zdrop z (zdrop y l))) *) intro. rewrite H3. apply permmod_refl. (* Goal: not (@eq Z z y) *) (* Goal: inlist Z z l *) (* Goal: and (Mod z z p) (permmod p (zdrop z (zdrop x l)) (zdrop z (zdrop y l))) *) intro. apply allex_permmod. (* Goal: @eq nat (length Z (zdrop x l0)) (length Z (zdrop y l1)) *) (* Goal: nodoubles p (zdrop x l0) *) (* Goal: allex p (zdrop x l0) (zdrop y l1) *) (* Goal: inlist Z x l0 *) apply S_inj. (* Goal: @eq nat (length Z l0) (S (length Z (zdrop y l1))) *) (* Goal: inlist Z x l0 *) (* Goal: nodoubles p (zdrop x l0) *) (* Goal: allex p (zdrop x l0) (zdrop y l1) *) (* Goal: inlist Z x l0 *) rewrite zdrop_length. rewrite zdrop_length. (* Goal: not (Mod a Z0 p) *) reflexivity. assumption. assumption. (* Goal: forall (x0 : Z) (_ : inlist Z x0 (zdrop x l)), @ex Z (fun x1 : Z => and (inlist Z x1 (zdrop y l)) (and (Mod x0 x1 p) (permmod p (zdrop x0 (zdrop x l)) (zdrop x1 (zdrop y l))))) *) intros z Hz. (* Goal: @ex Z (fun x1 : Z => and (inlist Z x1 (zdrop y l)) (and (Mod z x1 p) (permmod p (zdrop z (zdrop x l)) (zdrop x1 (zdrop y l))))) *) elim (zeqdec y z). (* Goal: not (@eq Z z y) *) (* Goal: inlist Z z l *) (* Goal: and (Mod z z p) (permmod p (zdrop z (zdrop x l)) (zdrop z (zdrop y l))) *) intro. split with x. (* Goal: not (Mod a Z0 p) *) split. apply zdrop_neq_inlist. assumption. assumption. (* Goal: not (Mod a Z0 p) *) split. rewrite <- H4. apply mod_sym. assumption. (* Goal: permmod p (zdrop z (zdrop x l)) (zdrop x (zdrop z l)) *) (* Goal: forall _ : not (@eq Z y z), @ex Z (fun x1 : Z => and (inlist Z x1 (zdrop y l)) (and (Mod z x1 p) (permmod p (zdrop z (zdrop x l)) (zdrop x1 (zdrop y l))))) *) rewrite H4. rewrite zdrop_swap. apply permmod_refl. (* Goal: not (@eq Z z y) *) (* Goal: inlist Z z l *) (* Goal: and (Mod z z p) (permmod p (zdrop z (zdrop x l)) (zdrop z (zdrop y l))) *) intro. split with z. (* Goal: and (Mod x y p) (permmod p (zdrop x l0) (zdrop y l1)) *) (* Goal: inlist Z x l0 *) split. apply zdrop_neq_inlist. (* Goal: not (Mod a Z0 p) *) intro. apply H4. symmetry in |- *. assumption. (* Goal: inlist Z z l *) (* Goal: Mod x y p *) (* Goal: inlist Z x (zdrop z l) *) (* Goal: inlist Z y (zdrop z l) *) apply zdrop_inlist_weak with x. assumption. (* Goal: and (Mod x y p) (permmod p (zdrop x l0) (zdrop y l1)) *) (* Goal: inlist Z x l0 *) split. apply mod_refl. (* Goal: permmod p (zdrop x (zdrop z l)) (zdrop z (zdrop y l)) *) rewrite (zdrop_swap z). rewrite (zdrop_swap z). (* Goal: permmod p (zdrop x (zdrop z l)) (zdrop y (zdrop z l)) *) apply (IH p x y (zdrop z l)). (* Goal: not (Mod a Z0 p) *) apply S_inj. rewrite zdrop_length. assumption. (* Goal: inlist Z z l *) (* Goal: Mod x y p *) (* Goal: inlist Z x (zdrop z l) *) (* Goal: inlist Z y (zdrop z l) *) apply zdrop_inlist_weak with x. assumption. (* Goal: not (Mod a Z0 p) *) assumption. (* Goal: not (Mod a Z0 p) *) apply zdrop_inlist_swap. assumption. assumption. (* Goal: not (Mod a Z0 p) *) apply zdrop_neq_inlist. assumption. assumption. Qed. Lemma permmod_drop_drop : forall (p : nat) (x y : Z) (l : Zlist), Mod x y p -> inlist Z x l -> inlist Z y l -> permmod p (zdrop x l) (zdrop y l). Proof. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros. apply permmod_drop_drop1 with (length Z l). (* Goal: not (Mod a Z0 p) *) reflexivity. assumption. assumption. assumption. Qed. Lemma permmod_drop_rev : forall (p : nat) (l0 l1 : Zlist) (x0 x1 : Z), Mod x0 x1 p -> inlist Z x0 l0 -> inlist Z x1 l1 -> permmod p l0 l1 -> permmod p (zdrop x0 l0) (zdrop x1 l1). Proof. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros. elim (permmod_allex p l0 l1 H2 x0). (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros y Hy. elim Hy. intros. elim H4. intros. (* Goal: not (Mod a Z0 p) *) apply permmod_trans with (zdrop y l1). assumption. (* Goal: permmod p (zdrop y l1) (zdrop x1 l1) *) (* Goal: inlist Z x0 l0 *) apply permmod_drop_drop. (* Goal: not (Mod a Z0 p) *) apply mod_trans with x0. apply mod_sym. assumption. (* Goal: not (Mod a Z0 p) *) assumption. assumption. assumption. assumption. Qed. Lemma nodoubles_allex_permmod1 : forall (n p : nat) (l0 l1 : Zlist), n = length Z l0 -> n = length Z l1 -> Prime p -> length Z l0 = length Z l1 -> nodoubles p l0 -> allex p l0 l1 -> permmod p l0 l1. Proof. (* Goal: forall (n p : nat) (l0 l1 : Zlist) (_ : @eq nat n (length Z l0)) (_ : @eq nat n (length Z l1)) (_ : Prime p) (_ : @eq nat (length Z l0) (length Z l1)) (_ : nodoubles p l0) (_ : allex p l0 l1), permmod p l0 l1 *) simple induction n. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros. (* Goal: permmod p l0 l1 *) (* Goal: forall (n : nat) (_ : forall (p : nat) (l0 l1 : Zlist) (_ : @eq nat n (length Z l0)) (_ : @eq nat n (length Z l1)) (_ : Prime p) (_ : @eq nat (length Z l0) (length Z l1)) (_ : nodoubles p l0) (_ : allex p l0 l1), permmod p l0 l1) (p : nat) (l0 l1 : Zlist) (_ : @eq nat (S n) (length Z l0)) (_ : @eq nat (S n) (length Z l1)) (_ : Prime p) (_ : @eq nat (length Z l0) (length Z l1)) (_ : nodoubles p l0) (_ : allex p l0 l1), permmod p l0 l1 *) rewrite length_0 with Z l0. (* Goal: permmod p (Nil Z) l1 *) (* Goal: @eq nat (length Z l0) O *) (* Goal: forall (n : nat) (_ : forall (p : nat) (l0 l1 : Zlist) (_ : @eq nat n (length Z l0)) (_ : @eq nat n (length Z l1)) (_ : Prime p) (_ : @eq nat (length Z l0) (length Z l1)) (_ : nodoubles p l0) (_ : allex p l0 l1), permmod p l0 l1) (p : nat) (l0 l1 : Zlist) (_ : @eq nat (S n) (length Z l0)) (_ : @eq nat (S n) (length Z l1)) (_ : Prime p) (_ : @eq nat (length Z l0) (length Z l1)) (_ : nodoubles p l0) (_ : allex p l0 l1), permmod p l0 l1 *) rewrite length_0 with Z l1. (* Goal: permmod p (Nil Z) (Nil Z) *) (* Goal: @eq nat (length Z l1) O *) (* Goal: @eq nat (length Z l0) O *) (* Goal: forall (n : nat) (_ : forall (p : nat) (l0 l1 : Zlist) (_ : @eq nat n (length Z l0)) (_ : @eq nat n (length Z l1)) (_ : Prime p) (_ : @eq nat (length Z l0) (length Z l1)) (_ : nodoubles p l0) (_ : allex p l0 l1), permmod p l0 l1) (p : nat) (l0 l1 : Zlist) (_ : @eq nat (S n) (length Z l0)) (_ : @eq nat (S n) (length Z l1)) (_ : Prime p) (_ : @eq nat (length Z l0) (length Z l1)) (_ : nodoubles p l0) (_ : allex p l0 l1), permmod p l0 l1 *) apply permmod_nil. (* Goal: not (Mod a Z0 p) *) symmetry in |- *. assumption. symmetry in |- *. assumption. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros m IH. intros. (* Goal: permmod p l0 l1 *) apply allex_permmod. (* Goal: not (Mod a Z0 p) *) assumption. (* Goal: forall (x0 : Z) (_ : inlist Z x0 l0), @ex Z (fun x1 : Z => and (inlist Z x1 l1) (and (Mod x0 x1 p) (permmod p (zdrop x0 l0) (zdrop x1 l1)))) *) intros x Hx. elim H4 with x. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros y Hy. elim Hy. intros. (* Goal: @ex Z (fun x1 : Z => and (inlist Z x1 l1) (and (Mod x x1 p) (permmod p (zdrop x l0) (zdrop x1 l1)))) *) (* Goal: inlist Z x l0 *) split with y. (* Goal: not (Mod a Z0 p) *) split. assumption. (* Goal: not (Mod a Z0 p) *) split. assumption. (* Goal: permmod p (zdrop x l0) (zdrop y l1) *) (* Goal: inlist Z x l0 *) apply IH. (* Goal: not (Mod a Z0 p) *) apply S_inj. rewrite zdrop_length. assumption. (* Goal: not (Mod a Z0 p) *) assumption. (* Goal: not (Mod a Z0 p) *) apply S_inj. rewrite zdrop_length. assumption. (* Goal: not (Mod a Z0 p) *) assumption. (* Goal: not (Mod a Z0 p) *) assumption. (* Goal: @eq nat (length Z (zdrop x l0)) (length Z (zdrop y l1)) *) (* Goal: nodoubles p (zdrop x l0) *) (* Goal: allex p (zdrop x l0) (zdrop y l1) *) (* Goal: inlist Z x l0 *) apply S_inj. rewrite zdrop_length. (* Goal: not (Mod a Z0 p) *) rewrite zdrop_length. assumption. (* Goal: not (Mod a Z0 p) *) assumption. assumption. (* Goal: not (Mod a Z0 p) *) apply nodoubles_drop. assumption. (* Goal: allex p (zdrop x l0) (zdrop y l1) *) (* Goal: inlist Z x l0 *) apply allex_nodoubles_drop. (* Goal: not (Mod a Z0 p) *) assumption. assumption. assumption. assumption. (* Goal: not (Mod a Z0 p) *) assumption. assumption. assumption. Qed. Lemma nodoubles_allex_permmod : forall (p : nat) (l0 l1 : Zlist), Prime p -> length Z l0 = length Z l1 -> nodoubles p l0 -> allex p l0 l1 -> permmod p l0 l1. Proof. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros. apply nodoubles_allex_permmod1 with (length Z l0). (* Goal: not (Mod a Z0 p) *) reflexivity. assumption. assumption. assumption. (* Goal: not (Mod a Z0 p) *) assumption. assumption. Qed. Lemma until_mapmult_permmod : forall (p : nat) (a : Z), Prime p -> ~ Mod a 0 p -> permmod p (until (pred p)) (mapmult a (until (pred p))). Proof. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros. (* Goal: permmod p (until (Init.Nat.pred p)) (mapmult a (until (Init.Nat.pred p))) *) apply nodoubles_allex_permmod. (* Goal: not (Mod a Z0 p) *) assumption. unfold mapmult in |- *. apply map_length. (* Goal: not (Mod a Z0 p) *) apply until_nodoubles. assumption. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) unfold allex in |- *. intros. (* Goal: @ex Z (fun y : Z => and (inlist Z y (mapmult a (until (Init.Nat.pred p)))) (Mod x y p)) *) apply (until_mapmult_allex p a H H0). (* Goal: not (Mod a Z0 p) *) assumption. Qed. (** * Fermat's Little Theorem. *) Theorem flt : forall (a : Z) (p : nat), Prime p -> ~ Mod a 0 p -> Mod (Exp a (pred p)) 1 p. Proof. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), Mod (Exp a (Init.Nat.pred p)) (Zpos xH) p *) intros. apply mod_sym. (* Goal: Mod (Zpos xH) (Exp a (Init.Nat.pred p)) p *) apply mod_mult_cancel_r with (zproduct (until (pred p))). (* Goal: not (Mod a Z0 p) *) assumption. apply until_prod_not_0mod. assumption. (* Goal: Mod (Z.mul (Zpos xH) (zproduct (until (Init.Nat.pred p)))) (Z.mul (Exp a (Init.Nat.pred p)) (zproduct (until (Init.Nat.pred p)))) p *) rewrite <- until_mapmult_exp. rewrite Zmult_1_l. (* Goal: Mod (zproduct (until (Init.Nat.pred p))) (zproduct (mapmult a (until (Init.Nat.pred p)))) p *) apply permmod_product. apply until_mapmult_permmod. (* Goal: not (Mod a Z0 p) *) assumption. assumption. Qed.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Monoid_cat. Section Lemmas. Variable E : MONOID. Lemma MONOID_unit_r : forall x : E, Equal (sgroup_law _ x (monoid_unit E)) x. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup E)), @Equal (sgroup_set (monoid_sgroup E)) (sgroup_law (monoid_sgroup E) x (@monoid_unit (monoid_sgroup E) (monoid_on_def E))) x *) intros; apply (monoid_unit_r_prf E x). Qed. Lemma MONOID_unit_l : forall x : E, Equal (sgroup_law _ (monoid_unit E) x) x. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup E)), @Equal (sgroup_set (monoid_sgroup E)) (sgroup_law (monoid_sgroup E) (@monoid_unit (monoid_sgroup E) (monoid_on_def E)) x) x *) intros; apply (monoid_unit_l_prf E x). Qed. Lemma MONOID_unit_unique : forall e : E, (forall x : E, Equal (sgroup_law _ x e) x) -> (forall x : E, Equal (sgroup_law _ e x) x) -> Equal e (monoid_unit E). (* Goal: forall (e : Carrier (sgroup_set (monoid_sgroup E))) (_ : forall x : Carrier (sgroup_set (monoid_sgroup E)), @Equal (sgroup_set (monoid_sgroup E)) (sgroup_law (monoid_sgroup E) x e) x) (_ : forall x : Carrier (sgroup_set (monoid_sgroup E)), @Equal (sgroup_set (monoid_sgroup E)) (sgroup_law (monoid_sgroup E) e x) x), @Equal (sgroup_set (monoid_sgroup E)) e (@monoid_unit (monoid_sgroup E) (monoid_on_def E)) *) intros e H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup E)) e (@monoid_unit (monoid_sgroup E) (monoid_on_def E)) *) apply Trans with (sgroup_law _ e (monoid_unit E)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup E)) e (sgroup_law (monoid_sgroup E) e (@monoid_unit (monoid_sgroup E) (monoid_on_def E))) *) apply Sym. (* Goal: @Equal (sgroup_set (monoid_sgroup E)) (sgroup_law (monoid_sgroup E) e (@monoid_unit (monoid_sgroup E) (monoid_on_def E))) e *) apply MONOID_unit_r. Qed. Variable F : MONOID. Variable f : Hom E F. Lemma MONOID_hom_prop : Equal (f (monoid_unit E)) (monoid_unit F). (* Goal: @Equal (sgroup_set (monoid_sgroup F)) (@Ap (sgroup_set (monoid_sgroup E)) (sgroup_set (monoid_sgroup F)) (@sgroup_map (monoid_sgroup E) (monoid_sgroup F) (@monoid_sgroup_hom E F f)) (@monoid_unit (monoid_sgroup E) (monoid_on_def E))) (@monoid_unit (monoid_sgroup F) (monoid_on_def F)) *) apply (monoid_hom_prf f). Qed. End Lemmas. Hint Resolve MONOID_unit_r MONOID_unit_l MONOID_unit_unique MONOID_hom_prop: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Ring_cat. Require Export Group_facts. Require Export Abelian_group_facts. (** Title "Basic properties of rings." *) Section Lemmas. Variable R : RING. Lemma RING_assoc : forall x y z : R, Equal (ring_mult (ring_mult x y) z) (ring_mult x (ring_mult y z)). (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R (@ring_mult R x y) z) (@ring_mult R x (@ring_mult R y z)) *) exact (sgroup_assoc_prf (E:=R) (ring_monoid R)). Qed. Lemma RING_comp : forall x x' y y' : R, Equal x x' -> Equal y y' -> Equal (ring_mult x y) (ring_mult x' y'). (* Goal: forall (x x' y y' : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x x') (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) y y'), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R x y) (@ring_mult R x' y') *) unfold ring_mult in |- *; auto with algebra. Qed. Lemma RING_unit_r : forall x : R, Equal (ring_mult x (ring_unit R)) x. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R x (ring_unit R)) x *) exact (monoid_unit_r_prf (ring_monoid R)). Qed. Lemma RING_unit_l : forall x : R, Equal (ring_mult (ring_unit R) x) x. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R (ring_unit R) x) x *) exact (monoid_unit_l_prf (ring_monoid R)). Qed. Lemma RING_dist_r : forall x y z : R, Equal (ring_mult (sgroup_law R x y) z) (sgroup_law R (ring_mult x z) (ring_mult y z)). (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@ring_mult R x z) (@ring_mult R y z)) *) exact (ring_dist_r_prf R). Qed. Lemma RING_dist_l : forall x y z : R, Equal (ring_mult x (sgroup_law R y z)) (sgroup_law R (ring_mult x y) (ring_mult x z)). (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R x (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) y z)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@ring_mult R x y) (@ring_mult R x z)) *) exact (ring_dist_l_prf R). Qed. Hint Resolve RING_assoc RING_comp RING_unit_r RING_unit_l RING_dist_r RING_dist_l: algebra. Lemma RING_absorbant_r : forall x : R, Equal (ring_mult x (monoid_unit R)) (monoid_unit R). (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @Equal (sgroup_set (monoid_sgroup (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))))) x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) *) intros x; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (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))))) *) apply GROUP_reg_right with (ring_mult x (monoid_unit R)). apply Trans with (ring_mult x (sgroup_law R (monoid_unit R) (monoid_unit R))); (* Goal: forall (f g : Carrier (@Hom RING R R')) (_ : forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @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 R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' f))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' g))) x)), @Equal (@Hom RING R R') f g *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R x (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) y (group_inverse (abelian_group_group (ring_group R)) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) *) apply Trans with (ring_mult x (monoid_unit R)); auto with algebra. Qed. Hint Resolve RING_absorbant_r: algebra. Lemma RING_absorbant_l : forall x : R, Equal (ring_mult (monoid_unit R) x) (monoid_unit R). (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @Equal (sgroup_set (monoid_sgroup (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))))) x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) *) intros x; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (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))))) x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) *) apply GROUP_reg_right with (ring_mult (monoid_unit R) x). apply Trans with (ring_mult (sgroup_law R (monoid_unit R) (monoid_unit R)) x); (* Goal: forall (f g : Carrier (@Hom RING R R')) (_ : forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @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 R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' f))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' g))) x)), @Equal (@Hom RING R R') f g *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R (sgroup_law (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))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R)))))) x) (sgroup_law (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))))) x)) *) apply Trans with (ring_mult (monoid_unit R) x); auto with algebra. Qed. Hint Resolve RING_absorbant_l: algebra. Lemma RING_op_mult_l : forall x y : R, Equal (ring_mult (group_inverse R x) y) (group_inverse R (ring_mult x y)). (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R x (group_inverse (abelian_group_group (ring_group R)) y)) (group_inverse (abelian_group_group (ring_group R)) (@ring_mult R x y)) *) intros x y; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R x (group_inverse (abelian_group_group (ring_group R)) y)) (group_inverse (abelian_group_group (ring_group R)) (@ring_mult R x y)) *) apply Sym. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (group_inverse (abelian_group_group (ring_group R)) (@ring_mult R x y)) (@ring_mult R x (group_inverse (abelian_group_group (ring_group R)) y)) *) apply GROUP_law_inverse. apply Trans with (ring_mult (sgroup_law R x (group_inverse R x)) y); (* Goal: forall (f g : Carrier (@Hom RING R R')) (_ : forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @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 R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' f))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' g))) x)), @Equal (@Hom RING R R') f g *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) x (group_inverse (abelian_group_group (ring_group R)) x)) y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) *) apply Trans with (ring_mult (monoid_unit R) y); auto with algebra. Qed. Hint Resolve RING_op_mult_l: algebra. Lemma RING_op_mult_r : forall x y : R, Equal (ring_mult x (group_inverse R y)) (group_inverse R (ring_mult x y)). (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R x (group_inverse (abelian_group_group (ring_group R)) y)) (group_inverse (abelian_group_group (ring_group R)) (@ring_mult R x y)) *) intros x y; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R x (group_inverse (abelian_group_group (ring_group R)) y)) (group_inverse (abelian_group_group (ring_group R)) (@ring_mult R x y)) *) apply Sym. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (group_inverse (abelian_group_group (ring_group R)) (@ring_mult R x y)) (@ring_mult R x (group_inverse (abelian_group_group (ring_group R)) y)) *) apply GROUP_law_inverse. apply Trans with (ring_mult x (sgroup_law R y (group_inverse R y))); (* Goal: forall (f g : Carrier (@Hom RING R R')) (_ : forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @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 R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' f))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' g))) x)), @Equal (@Hom RING R R') f g *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R x (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) y (group_inverse (abelian_group_group (ring_group R)) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) *) apply Trans with (ring_mult x (monoid_unit R)); auto with algebra. Qed. End Lemmas. Hint Resolve RING_assoc RING_comp RING_unit_r RING_unit_l RING_dist_r RING_dist_l RING_absorbant_r RING_absorbant_l RING_op_mult_l RING_op_mult_r: algebra. Section Commutative_rings. Variable R1 : CRING. Lemma CRING_com : forall x y : R1, Equal (ring_mult x y) (ring_mult y x). (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))) (@ring_mult (cring_ring R1) x y) (@ring_mult (cring_ring R1) y x) *) exact (cring_com_prf R1). Qed. Hint Immediate CRING_com: algebra. Lemma CRING_mult4 : forall a b c d : R1, Equal (ring_mult (ring_mult a b) (ring_mult c d)) (ring_mult (ring_mult a c) (ring_mult b d)). (* Goal: forall a b c d : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) a b) (@ring_mult (cring_ring R1) c d)) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) a c) (@ring_mult (cring_ring R1) b d)) *) intros a b c d; try assumption. apply Trans with (ring_mult a (ring_mult b (ring_mult c d))); (* Goal: forall (f g : Carrier (@Hom RING R R')) (_ : forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @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 R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' f))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' g))) x)), @Equal (@Hom RING R R') f g *) auto with algebra. apply Trans with (ring_mult a (ring_mult (ring_mult b c) d)); (* Goal: forall (f g : Carrier (@Hom RING R R')) (_ : forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @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 R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' f))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' g))) x)), @Equal (@Hom RING R R') f g *) auto with algebra. apply Trans with (ring_mult a (ring_mult (ring_mult c b) d)); (* Goal: forall (f g : Carrier (@Hom RING R R')) (_ : forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @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 R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' f))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' g))) x)), @Equal (@Hom RING R R') f g *) auto with algebra. apply Trans with (ring_mult a (ring_mult c (ring_mult b d))); (* Goal: forall (f g : Carrier (@Hom RING R R')) (_ : forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @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 R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' f))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' g))) x)), @Equal (@Hom RING R R') f g *) auto with algebra. Qed. Hint Resolve CRING_mult4: algebra. Lemma CRING_mult3 : forall x y z : R1, Equal (ring_mult x (ring_mult y z)) (ring_mult y (ring_mult x z)). (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) x y) z) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) x z) y) *) intros x y z; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))) (@ring_mult (cring_ring R1) x (@ring_mult (cring_ring R1) y z)) (@ring_mult (cring_ring R1) y (@ring_mult (cring_ring R1) x z)) *) apply Trans with (ring_mult (ring_mult x y) z); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) x y) z) (@ring_mult (cring_ring R1) y (@ring_mult (cring_ring R1) x z)) *) apply Trans with (ring_mult (ring_mult y x) z); auto with algebra. Qed. Hint Resolve CRING_mult3: algebra. Lemma CRING_mult3bis : forall x y z : R1, Equal (ring_mult (ring_mult x y) z) (ring_mult (ring_mult x z) y). (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) x y) z) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) x z) y) *) intros x y z; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) x y) z) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) x z) y) *) apply Trans with (ring_mult z (ring_mult x y)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))) (@ring_mult (cring_ring R1) z (@ring_mult (cring_ring R1) x y)) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) x z) y) *) apply Trans with (ring_mult z (ring_mult y x)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))) (@ring_mult (cring_ring R1) z (@ring_mult (cring_ring R1) y x)) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) x z) y) *) apply Trans with (ring_mult y (ring_mult z x)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))) (@ring_mult (cring_ring R1) y (@ring_mult (cring_ring R1) z x)) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) x z) y) *) apply Trans with (ring_mult (ring_mult z x) y); auto with algebra. Qed. Hint Resolve CRING_mult3bis: algebra. End Commutative_rings. Hint Resolve CRING_mult4 CRING_mult3 CRING_mult3bis: algebra. Hint Immediate CRING_com: algebra. Section Hom_lemmas. Hint Resolve RING_comp: algebra. Variable R R' : RING. Variable f : Hom R R'. Lemma RING_hom_prop : forall x y : R, Equal (f (ring_mult x y)) (ring_mult (f x) (f 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 R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' f))) (ring_unit R)) (ring_unit R') *) case f; auto with algebra. Qed. Lemma RING_one_prop : Equal (f (ring_unit R)) (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 R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' f))) (ring_unit R)) (ring_unit R') *) case f; auto with algebra. Qed. Lemma RING_hom_ext : forall f g : Hom R R', (forall x : R, Equal (f x) (g x)) -> Equal f g. (* Goal: forall (f g : Carrier (@Hom RING R R')) (_ : forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @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 R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' f))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' g))) x)), @Equal (@Hom RING R R') f g *) auto with algebra. Qed. End Hom_lemmas. Hint Resolve RING_hom_prop RING_one_prop: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Sub_group. Require Export Abelian_group_cat. (** Title "Tools for building groups." *) Section Group. Variable E : Setoid. Variable genlaw : E -> E -> E. Variable e : E. Variable geninv : E -> E. Hypothesis fcomp : forall x x' y y' : E, Equal x x' -> Equal y y' -> Equal (genlaw x y) (genlaw x' y'). Hypothesis genlawassoc : forall x y z : E, Equal (genlaw (genlaw x y) z) (genlaw x (genlaw y z)). Hypothesis eunitgenlawr : forall x : E, Equal (genlaw x e) x. Hypothesis invcomp : forall x y : E, Equal x y -> Equal (geninv x) (geninv y). Hypothesis geninvr : forall x : E, Equal (genlaw x (geninv x)) e. Lemma geninvl : forall x : E, Equal (genlaw (geninv x) x) e. (* Goal: forall x : Carrier E, @Equal E (genlaw e x) x *) intros x; try assumption. (* Goal: @Equal E (genlaw (geninv x) x) e *) apply Trans with (genlaw (genlaw (geninv x) x) e); auto with algebra. apply Trans with (genlaw (genlaw (geninv x) x) (genlaw (geninv x) (geninv (geninv x)))); auto with algebra. apply Trans with (genlaw (geninv x) (genlaw x (genlaw (geninv x) (geninv (geninv x))))); auto with algebra. apply Trans with (genlaw (geninv x) (genlaw (genlaw x (geninv x)) (geninv (geninv x)))); auto with algebra. apply Trans with (genlaw (geninv x) (genlaw e (geninv (geninv x)))); auto with algebra. apply Trans with (genlaw (genlaw (geninv x) e) (geninv (geninv x))); auto with algebra. (* Goal: @Equal E (genlaw (genlaw (geninv x) e) (geninv (geninv x))) e *) apply Trans with (genlaw (geninv x) (geninv (geninv x))); auto with algebra. Qed. Hint Resolve geninvl: algebra. Lemma eunitgenlawl : forall x : E, Equal (genlaw e x) x. (* Goal: forall x : Carrier E, @Equal E (genlaw e x) x *) intros x; try assumption. (* Goal: @Equal E (genlaw e x) x *) apply Trans with (genlaw (genlaw x (geninv x)) x); auto with algebra. (* Goal: @Equal E (genlaw (genlaw x (geninv x)) x) x *) apply Trans with (genlaw x (genlaw (geninv x) x)); auto with algebra. (* Goal: @Equal E (genlaw x (genlaw (geninv x) x)) x *) apply Trans with (genlaw x e); auto with algebra. Qed. Hint Resolve eunitgenlawl: algebra. Definition f := uncurry fcomp. Lemma fassoc : associative f. (* Goal: @inverse_l E f e inv *) red in |- *. (* Goal: forall x : Carrier E, @Equal E (@Ap (cart E E) E f (@couple E E (@Ap E E inv x) x)) e *) simpl in |- *; auto with algebra. Qed. Lemma eunitr : unit_r f e. (* Goal: @inverse_l E f e inv *) red in |- *. (* Goal: forall x : Carrier E, @Equal E (@Ap (cart E E) E f (@couple E E (@Ap E E inv x) x)) e *) simpl in |- *; auto with algebra. Qed. Lemma eunitl : unit_l f e. (* Goal: @inverse_l E f e inv *) red in |- *. (* Goal: forall x : Carrier E, @Equal E (@Ap (cart E E) E f (@couple E E (@Ap E E inv x) x)) e *) simpl in |- *; auto with algebra. Qed. Definition inv := Build_Map (Ap:=geninv) invcomp. Lemma invr : inverse_r f e inv. (* Goal: @inverse_l E f e inv *) red in |- *. (* Goal: forall x : Carrier E, @Equal E (@Ap (cart E E) E f (@couple E E (@Ap E E inv x) x)) e *) simpl in |- *; auto with algebra. Qed. Lemma invl : inverse_l f e inv. (* Goal: @inverse_l E f e inv *) red in |- *. (* Goal: forall x : Carrier E, @Equal E (@Ap (cart E E) E f (@couple E E (@Ap E E inv x) x)) e *) simpl in |- *; auto with algebra. Qed. Definition sg := Build_sgroup (Build_sgroup_on fassoc). Definition m := Build_monoid (Build_monoid_on (A:=sg) (monoid_unit:=e) eunitr eunitl). Definition BUILD_GROUP : GROUP := Build_group (Build_group_on (G:=m) (group_inverse_map:=inv) invr invl). End Group. Section Abelian_group. Variable E : Setoid. Variable genlaw : E -> E -> E. Variable e : E. Variable geninv : E -> E. Hypothesis fcomp : forall x x' y y' : E, Equal x x' -> Equal y y' -> Equal (genlaw x y) (genlaw x' y'). Hypothesis genlawassoc : forall x y z : E, Equal (genlaw (genlaw x y) z) (genlaw x (genlaw y z)). Hypothesis eunitgenlawr : forall x : E, Equal (genlaw x e) x. Hypothesis invcomp : forall x y : E, Equal x y -> Equal (geninv x) (geninv y). Hypothesis geninvr : forall x : E, Equal (genlaw x (geninv x)) e. Hypothesis fcom : forall x y : E, Equal (genlaw x y) (genlaw y x). Definition G := BUILD_GROUP fcomp genlawassoc eunitgenlawr invcomp geninvr. Definition asg : abelian_sgroup. (* Goal: abelian_sgroup *) apply (Build_abelian_sgroup (abelian_sgroup_sgroup:=G)). (* Goal: abelian_sgroup_on (monoid_sgroup (group_monoid G)) *) apply (Build_abelian_sgroup_on (A:=G)). (* Goal: @commutative (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_law_map (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_on_def (monoid_sgroup (group_monoid G)))) *) abstract (red in |- *; simpl in |- *; auto with algebra). Defined. Definition BUILD_ABELIAN_GROUP : ABELIAN_GROUP := Build_abelian_group (Build_abelian_group_on (G:=G) (Build_abelian_monoid (Build_abelian_monoid_on (M:=G) asg))). End Abelian_group. Section Hom. Variable G G' : GROUP. Variable ff : G -> G'. Hypothesis ffcomp : forall x y : G, Equal x y -> Equal (ff x) (ff y). Hypothesis fflaw : forall x y : G, Equal (ff (sgroup_law _ x y)) (sgroup_law _ (ff x) (ff y)). Hypothesis ffunit : Equal (ff (monoid_unit G)) (monoid_unit G'). Definition f2 := Build_Map ffcomp. Definition fhomsg := Build_sgroup_hom (sgroup_map:=f2) fflaw. Definition BUILD_HOM_GROUP : Hom G G' := Build_monoid_hom (monoid_sgroup_hom:=fhomsg) ffunit. End Hom. Section Build_sub_group. Variable G : GROUP. Variable H : part_set G. Hypothesis Hlaw : forall x y : G, in_part x H -> in_part y H -> in_part (sgroup_law _ x y) H. Hypothesis Hunit : in_part (monoid_unit G) H. Hypothesis Hinv : forall x : G, in_part x H -> in_part (group_inverse _ x) H. Definition BUILD_SUB_GROUP : subgroup G := Build_subgroup (G:=G) (subgroup_submonoid:=Build_submonoid (G:=G) (submonoid_subsgroup:=Build_subsgroup Hlaw) Hunit) Hinv. End Build_sub_group.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Tiroirs. Require Export Parts2. Require Export Classical_Pred_Type. Require Export Compare_dec. Lemma not_injective_prop : forall (A B : Setoid) (f : MAP A B), ~ injective f -> exists x : A, (exists y : A, ~ Equal x y /\ Equal (f x) (f y)). (* Goal: forall (A B : Setoid) (f : Carrier (MAP A B)) (_ : not (@injective A B f)), @ex (Carrier A) (fun x : Carrier A => @ex (Carrier A) (fun y : Carrier A => and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y)))) *) unfold injective in |- *. (* Goal: forall (A B : Setoid) (f : Carrier (MAP A B)) (_ : not (@surjective A B f)), @ex (Carrier B) (fun y : Carrier B => not (@in_part B y (@image_map A B f))) *) intros A B f H'; try assumption. cut (ex (fun x : A => ~ (forall y : A, ~ (~ Equal x y /\ Equal (Ap f x) (Ap f y))))). (* Goal: forall _ : forall n : Carrier B, @in_part B n (@image_map A B f), False *) intros H'0; try assumption. (* Goal: @ex (Carrier A) (fun x : Carrier A => @ex (Carrier A) (fun y : Carrier A => and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y)))) *) (* Goal: @ex (Carrier A) (fun x : Carrier A => not (forall y : Carrier A, not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))) *) elim H'0; intros x E; try exact E; clear H'0. (* Goal: @ex (Carrier A) (fun x : Carrier A => @Equal B y (@Ap A B f x)) *) exists x; try assumption. (* Goal: @ex (Carrier A) (fun y : Carrier A => and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))) *) (* Goal: @ex (Carrier A) (fun x : Carrier A => not (forall y : Carrier A, not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))) *) cut (ex (fun y : A => ~ ~ (~ Equal x y /\ Equal (Ap f x) (Ap f y)))). (* Goal: forall _ : forall n : Carrier B, @in_part B n (@image_map A B f), False *) intros H'0; try assumption. (* Goal: @ex (Carrier A) (fun y : Carrier A => and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))) *) (* Goal: @ex (Carrier A) (fun y : Carrier A => not (not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))) *) (* Goal: @ex (Carrier A) (fun x : Carrier A => not (forall y : Carrier A, not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))) *) elim H'0; intros y E0; try exact E0; clear H'0. (* Goal: @ex (Carrier A) (fun y : Carrier A => and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))) *) (* Goal: @ex (Carrier A) (fun y : Carrier A => not (not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))) *) (* Goal: @ex (Carrier A) (fun x : Carrier A => not (forall y : Carrier A, not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))) *) exists y; try assumption. (* Goal: and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y)) *) (* Goal: @ex (Carrier A) (fun y : Carrier A => not (not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))) *) (* Goal: @ex (Carrier A) (fun x : Carrier A => not (forall y : Carrier A, not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))) *) apply NNPP; auto with *. apply not_all_ex_not with (P := fun y : A => ~ (~ Equal x y /\ Equal (Ap f x) (Ap f y))); (* Goal: @cardinal E A n *) auto with *. apply not_all_ex_not with (P := fun x : A => forall y : A, ~ (~ Equal x y /\ Equal (Ap f x) (Ap f y))); (* Goal: @cardinal E A n *) auto with *. (* Goal: not (@Equal E x1 x0) *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @cardinal E A n *) red in |- *. (* Goal: forall _ : forall n : Carrier B, @in_part B n (@image_map A B f), False *) intros H'0; try assumption. (* Goal: False *) apply H'. (* Goal: forall (x y : Carrier A) (_ : @Equal B (@Ap A B f x) (@Ap A B f y)), @Equal A x y *) intros x y H'1; try assumption. specialize H'0 with (n := x) (y := y); rename H'0 into H'3; try exact H'3. (* Goal: @Equal A x y *) apply NNPP; tauto. Qed. Lemma not_surjective_prop : forall (A B : Setoid) (f : MAP A B), ~ surjective f -> exists y : B, ~ in_part y (image_map f). (* Goal: forall (A B : Setoid) (f : Carrier (MAP A B)) (_ : not (@surjective A B f)), @ex (Carrier B) (fun y : Carrier B => not (@in_part B y (@image_map A B f))) *) intros A B f H'; try assumption. (* Goal: @ex (Carrier B) (fun y : Carrier B => not (@in_part B y (@image_map A B f))) *) apply not_all_ex_not with (P := fun y : B => in_part y (image_map f)). (* Goal: not (@Equal E x1 x0) *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @cardinal E A n *) red in |- *. (* Goal: forall _ : forall n : Carrier B, @in_part B n (@image_map A B f), False *) red in H'. (* Goal: forall _ : forall n : Carrier B, @in_part B n (@image_map A B f), False *) intros H'0; try assumption. (* Goal: False *) lapply H'; [ intros H'1; try exact H'1; clear H' | clear H' ]. (* Goal: not (@Equal E x1 x0) *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @cardinal E A n *) red in |- *. (* Goal: forall y : Carrier B, @ex (Carrier A) (fun x : Carrier A => @Equal B y (@Ap A B f x)) *) simpl in H'0. (* Goal: forall y : Carrier B, @ex (Carrier A) (fun x : Carrier A => @Equal B y (@Ap A B f x)) *) intros y; try assumption. (* Goal: @ex (Carrier A) (fun x : Carrier A => @Equal B y (@Ap A B f x)) *) elim (H'0 y); intros x E; elim E; intros H'1 H'2; try exact H'2; clear E. (* Goal: @ex (Carrier A) (fun x : Carrier A => @Equal B y (@Ap A B f x)) *) exists x; try assumption. Qed. Parameter image_empty : forall (E F : Setoid) (f : MAP E F) (A : part_set E), Equal A (empty E) -> Equal (image f A) (empty F). Hint Resolve image_empty: algebra. Parameter image_union : forall (E F : Setoid) (f : MAP E F) (A B : part_set E), Equal (image f (union A B)) (union (image f A) (image f B)). Hint Resolve image_union: algebra. Parameter image_single : forall (E F : Setoid) (f : MAP E F) (A : part_set E) (x : E), Equal (image f (single x)) (single (f x)). Hint Resolve image_single: algebra. Parameter union_single_in : forall (E : Setoid) (A : part_set E) (x : E), in_part x A -> Equal (union A (single x)) A. Hint Resolve union_single_in: algebra. Lemma cardinal_image_lesser : forall (E F : Setoid) (f : MAP E F) (A : part_set E) (n : nat), cardinal A n -> exists m : nat, cardinal (image f A) m /\ m <= n. (* Goal: forall (E F : Setoid) (f : Carrier (MAP E F)) (A : Carrier (part_set E)) (n : nat) (_ : @cardinal E A n), @ex nat (fun m : nat => and (@cardinal F (@image E F f A) m) (le m n)) *) intros E F f A n H'; try assumption. apply cardinal_ind2 with (P := fun (n : nat) (A : part_set E) (c : cardinal A n) => ex (fun m : nat => cardinal (image f A) m /\ m <= n)). (* Goal: forall (A : Carrier (part_set E)) (_ : @cardinal E A O), @ex nat (fun m : nat => and (@cardinal F (@image E F f A) m) (le m O)) *) (* Goal: forall (n : nat) (_ : forall (B : Carrier (part_set E)) (_ : @cardinal E B n), @ex nat (fun m : nat => and (@cardinal F (@image E F f B) m) (le m n))) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (@add_part E B x)) (_ : @cardinal E A (S n)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A) m) (le m (S n))) *) (* Goal: @cardinal E A n *) intros A0 H'0; try assumption. (* Goal: @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m O)) *) (* Goal: forall (n : nat) (_ : forall (B : Carrier (part_set E)) (_ : @cardinal E B n), @ex nat (fun m : nat => and (@cardinal F (@image E F f B) m) (le m n))) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (@add_part E B x)) (_ : @cardinal E A (S n)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A) m) (le m (S n))) *) (* Goal: @cardinal E A n *) exists 0; split; [ idtac | auto with * ]. (* Goal: @cardinal F (@image E F f A0) O *) (* Goal: forall (n : nat) (_ : forall (B : Carrier (part_set E)) (_ : @cardinal E B n), @ex nat (fun m : nat => and (@cardinal F (@image E F f B) m) (le m n))) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (@add_part E B x)) (_ : @cardinal E A (S n)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A) m) (le m (S n))) *) (* Goal: @cardinal E A n *) apply cardinal_empty; auto with *. (* Goal: forall (n : nat) (_ : forall (B : Carrier (part_set E)) (_ : @cardinal E B n), @ex nat (fun m : nat => and (@cardinal F (@image E F f B) m) (le m n))) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (@add_part E B x)) (_ : @cardinal E A (S n)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A) m) (le m (S n))) *) (* Goal: @cardinal E A n *) intros n0 H'0 A0 B x H'1 H'2 H'3; try assumption. (* Goal: @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) (* Goal: @cardinal E A n *) case (classic (in_part (f x) (image f B))). (* Goal: forall _ : not (@in_part F (@Ap E F f x) (@image E F f B)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) (* Goal: @cardinal E A n *) intros H'4; try assumption. elim (H'0 B); [ intros m E0; elim E0; intros H'7 H'8; try exact H'7; clear E0 | idtac ]. (* Goal: @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) (* Goal: @cardinal E B n0 *) (* Goal: forall _ : not (@in_part F (@Ap E F f x) (@image E F f B)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) (* Goal: @cardinal E A n *) exists m; split; [ idtac | try assumption ]. (* Goal: @cardinal F (@image E F f A0) m *) (* Goal: le m (S n0) *) (* Goal: @cardinal E B n0 *) (* Goal: forall _ : not (@in_part F (@Ap E F f x) (@image E F f B)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) (* Goal: @cardinal E A n *) apply cardinal_comp with (image f B) m; auto with *. (* Goal: @Equal (part_set E) A0 (@add_part E (@minus_part E A0 x0) x0) *) (* Goal: @cardinal E A n *) apply Sym. (* Goal: @Equal (part_set F) (@image E F f A0) (@image E F f B) *) (* Goal: le m (S n0) *) (* Goal: @cardinal E B n0 *) (* Goal: forall _ : not (@in_part F (@Ap E F f x) (@image E F f B)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) (* Goal: @cardinal E A n *) apply Trans with (image f (add_part B x)); auto with *. (* Goal: @Equal (part_set E) (full E) (@add_part E (@diff E (full E) (@single E x)) x) *) unfold add_part in |- *. (* Goal: @Equal (part_set F) (@image E F f (@union E B (@single E x))) (@union F (@image E F f B) (@single F (@Ap E F f x))) *) (* Goal: le (S m) (S n0) *) (* Goal: @cardinal E B n0 *) (* Goal: @cardinal E A n *) apply Trans with (union (image f B) (image f (single x))); auto with *. (* Goal: @Equal (part_set F) (@union F (@image E F f B) (@image E F f (@single E x))) (@image E F f B) *) (* Goal: le m (S n0) *) (* Goal: @cardinal E B n0 *) (* Goal: forall _ : not (@in_part F (@Ap E F f x) (@image E F f B)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) (* Goal: @cardinal E A n *) apply Trans with (union (image f B) (single (Ap f x))); auto with *. (* Goal: @cardinal E A n *) auto with *. (* Goal: @cardinal E A n *) apply cardinal_S with A0 x; auto with *. (* Goal: forall _ : not (@in_part F (@Ap E F f x) (@image E F f B)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) (* Goal: @cardinal E A n *) intros H'4; try assumption. elim (H'0 B); [ intros m E0; elim E0; intros H'7 H'8; try exact H'7; clear E0 | idtac ]. (* Goal: @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) (* Goal: @cardinal E B n0 *) (* Goal: @cardinal E A n *) exists (S m); split; [ try assumption | idtac ]. (* Goal: @cardinal E A n *) apply cardinal_add with (image f B) (Ap f x); auto with *. (* Goal: @Equal (part_set E) (full E) (@add_part E (@diff E (full E) (@single E x)) x) *) unfold add_part in |- *. (* Goal: @Equal (part_set F) (@image E F f A0) (@union F (@image E F f B) (@single F (@Ap E F f x))) *) (* Goal: le (S m) (S n0) *) (* Goal: @cardinal E B n0 *) (* Goal: @cardinal E A n *) unfold add_part in H'2. (* Goal: @cardinal E A n *) apply Trans with (image f (union B (single x))); auto with *. (* Goal: @Equal (part_set F) (@image E F f (@union E B (@single E x))) (@union F (@image E F f B) (@single F (@Ap E F f x))) *) (* Goal: le (S m) (S n0) *) (* Goal: @cardinal E B n0 *) (* Goal: @cardinal E A n *) apply Trans with (union (image f B) (image f (single x))); auto with *. (* Goal: @cardinal E A n *) auto with *. (* Goal: @cardinal E A n *) apply cardinal_S with A0 x; auto with *. (* Goal: @cardinal E A n *) auto with *. Qed. Lemma cardinal_image_injective : forall (E F : Setoid) (f : MAP E F) (A : part_set E) (n : nat), cardinal A n -> injective f -> cardinal (image f A) n. intros E F f A n H' H'0; try assumption. case (cardinal_image_lesser f H'). (* Goal: forall (x : Carrier E) (_ : @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))), @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n0))) *) intros x H'1; try assumption. elim H'1; intros H'2 H'3; try exact H'2; clear H'1. cut (x < n \/ x = n). (* Goal: forall _ : @in_part E x B, False *) (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) intros H'1; try assumption. elim H'1; [ intros H'4; try exact H'4; clear H'1 | intros H'4; clear H'1 ]. case (tiroirs (E:=E) (F:=F) (f:=f) (n:=n) (Chaussettes:=A) H' (m:=x) (Tiroirs:=image f A) H'2 H'4). (* Goal: @cardinal E A n *) auto with *. intros x0 H'1; try assumption. elim H'1; intros y E0; elim E0; intros H'5 H'6; try exact H'5; clear E0 H'1. red in H'0. (* Goal: @cardinal E A n *) absurd (Equal x0 y); auto with *. (* Goal: @cardinal E A n *) apply cardinal_comp with (image f A) x; auto with *. case (lt_eq_lt_dec x n). intros H'1; elim H'1; [ intros H'4; try exact H'4; clear H'1 | intros H'4; clear H'1 ]; (* Goal: @cardinal E A n *) auto with *. (* Goal: forall _ : @in_part E x B, False *) (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) intros H'1; try assumption. (* Goal: @cardinal E A n *) absurd (n < x); auto with *. Qed. Parameter not_in_part_comp_r : forall (E : Setoid) (A B : part_set E) (x : E), ~ in_part x A -> Equal A B -> ~ in_part x B. Parameter diff_single_not_in : forall (E : Setoid) (A : part_set E) (x : E), ~ in_part x (diff A (single x)). Hint Resolve diff_single_not_in: algebra. Parameter diff_el_union_single : forall (E : Setoid) (A : part_set E) (x : E), in_part x A -> Equal A (union (diff A (single x)) (single x)). Hint Resolve diff_el_union_single: algebra. Lemma cardinal_image_strict_lesser : forall (E F : Setoid) (f : MAP E F) (n : nat), cardinal (full E) n -> ~ injective f -> exists m : nat, cardinal (image_map f) m /\ m < n. (* Goal: forall (E F : Setoid) (f : Carrier (MAP E F)) (n : nat) (_ : @cardinal E (full E) n) (_ : not (@injective E F f)), @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m n)) *) intros E F f n; try assumption. (* Goal: forall (_ : @cardinal E (full E) n) (_ : not (@injective E F f)), @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m n)) *) case n. (* Goal: forall (_ : @included E B A) (_ : not (forall x : Carrier E, and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))), @ex (Carrier E) (fun x : Carrier E => and (@in_part E x A) (not (@in_part E x B))) *) intros H' H'0; try assumption. (* Goal: @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n0))) *) case (not_injective_prop H'0). (* Goal: forall (x : Carrier E) (_ : @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))), @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n0))) *) intros x H'1; try assumption. (* Goal: @cardinal E A n *) absurd (in_part x (full E)); auto with *. (* Goal: @cardinal E A n *) apply not_in_part_comp_r with (empty E); auto with *. (* Goal: @Equal (part_set E) (empty E) (full E) *) (* Goal: forall (n : nat) (_ : @cardinal E (full E) (S n)) (_ : not (@injective E F f)), @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n))) *) inversion H'. (* Goal: @cardinal E A n *) auto with *. (* Goal: forall (n : nat) (_ : @cardinal E (full E) (S n)) (_ : not (@injective E F f)), @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n))) *) intros n0 H' H'0; try assumption. (* Goal: @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n0))) *) case (not_injective_prop H'0). (* Goal: forall (x : Carrier E) (_ : @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))), @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n0))) *) intros x H'1; try assumption. (* Goal: @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n0))) *) elim H'1; intros y E0; elim E0; intros H'2 H'3; try exact H'2; clear E0 H'1. (* Goal: @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n0))) *) cut (cardinal (diff (full E) (single x)) n0). (* Goal: forall _ : @in_part E x B, False *) (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) intros H'1; try assumption. (* Goal: @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n0))) *) (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) case (cardinal_image_lesser f H'1). (* Goal: forall (x0 : nat) (_ : and (@cardinal F (@image E F f (@diff E (full E) (@single E x))) x0) (le x0 n0)), @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n0))) *) (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) intros m H'4; try assumption. (* Goal: @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n0))) *) (* Goal: @included E B0 (@minus_part E A0 x0) *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @cardinal E A n *) exists m; split; [ try assumption | idtac ]. (* Goal: @cardinal F (@image_map E F f) m *) (* Goal: lt m (S n0) *) (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) elim H'4; intros H'5 H'6; try exact H'5; clear H'4. (* Goal: @cardinal E A n *) apply cardinal_comp with (image f (diff (full E) (single x))) m; auto with *. (* Goal: @Equal (part_set F) (@image E F f (@diff E (full E) (@single E x))) (@image_map E F f) *) (* Goal: lt m (S n0) *) (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) apply included_antisym. (* Goal: @Equal (part_set F) (@image_map E F f) (full F) *) unfold image_map in |- *. (* Goal: @cardinal E A n *) apply image_included; auto with *. (* Goal: @Equal (part_set F) (@image_map E F f) (full F) *) unfold image_map in |- *. (* Goal: @included F (@image E F f (full E)) (@image E F f (@diff E (full E) (@single E x))) *) (* Goal: lt m (S n0) *) (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) unfold included in |- *. (* Goal: forall (x0 : Carrier F) (_ : @in_part F x0 (@image E F f (full E))), @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) (* Goal: lt m (S n0) *) (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) intros x0 H'4; try assumption. (* Goal: @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) (* Goal: lt m (S n0) *) (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) elim H'4. (* Goal: forall (x1 : Carrier E) (_ : and (@in_part E x1 (full E)) (@Equal F x0 (@Ap E F f x1))), @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) (* Goal: lt m (S n0) *) (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) intros x1 H'7; try assumption. (* Goal: @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) (* Goal: lt m (S n0) *) (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) case (classic (Equal x1 x)). (* Goal: forall _ : not (@Equal E x1 x), @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) (* Goal: lt m (S n0) *) (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) intros H'8; try assumption. (* Goal: @in_part E x1 (@diff E A0 (@single E x0)) *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @cardinal E A n *) simpl in |- *. (* Goal: @ex (Carrier E) (fun x1 : Carrier E => and (and True (not (@Equal E x1 x))) (@Equal F x0 (@Ap E F f x1))) *) (* Goal: forall _ : not (@Equal E x1 x), @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) (* Goal: lt m (S n0) *) (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) exists y; split; [ idtac | try assumption ]. (* Goal: and True (not (@Equal E y x)) *) (* Goal: @Equal F x0 (@Ap E F f y) *) (* Goal: forall _ : not (@Equal E x1 x), @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) (* Goal: lt m (S n0) *) (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) split; [ idtac | try assumption ]. (* Goal: @cardinal E A n *) auto with *. (* Goal: @cardinal E A n *) auto with *. (* Goal: @cardinal E A n *) apply Trans with (f x); auto with *. (* Goal: @Equal F x0 (@Ap E F f x1) *) (* Goal: lt m (S n0) *) (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) elim H'7; intros H'9 H'10; try exact H'10; clear H'7. (* Goal: @cardinal E A n *) apply Trans with (f x1); auto with *. (* Goal: forall _ : not (@Equal E x1 x), @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) (* Goal: lt m (S n0) *) (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) intros H'8; try assumption. (* Goal: @in_part E x1 (@diff E A0 (@single E x0)) *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @cardinal E A n *) simpl in |- *. (* Goal: and True (not (@Equal E y x)) *) (* Goal: @Equal F x0 (@Ap E F f y) *) (* Goal: forall _ : not (@Equal E x1 x), @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) (* Goal: lt m (S n0) *) (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) exists x1; split; [ idtac | try assumption ]. (* Goal: @cardinal E A n *) auto with *. (* Goal: @Equal F x0 (@Ap E F f x1) *) (* Goal: lt m (S n0) *) (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) elim H'7; intros H'9 H'10; try exact H'10; clear H'7. (* Goal: @cardinal E A n *) elim H'4; intros H'5 H'6; try exact H'6; clear H'4; auto with *. (* Goal: @cardinal E A n *) apply cardinal_S with (full E) x; auto with *. (* Goal: @Equal (part_set E) (full E) (@add_part E (@diff E (full E) (@single E x)) x) *) unfold add_part in |- *. (* Goal: @cardinal E A n *) auto with *. Qed. Lemma cardinal_image_equal_injective : forall (E F : Setoid) (f : MAP E F) (n : nat), cardinal (full E) n -> cardinal (image_map f) n -> injective f. (* Goal: forall (E F : Setoid) (f : Carrier (MAP E F)) (n : nat) (_ : @cardinal E (full E) n) (_ : @cardinal F (@image_map E F f) n), @injective E F f *) intros E F f n H' H'0; try assumption. (* Goal: @in_part E x A *) (* Goal: not (@in_part E x B) *) (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) apply NNPP. (* Goal: not (not (@in_part E x A)) *) (* Goal: not (@in_part E x B) *) (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) red in |- *; intros H'1; try exact H'1. (* Goal: False *) case (cardinal_image_strict_lesser H' H'1). (* Goal: forall (x : nat) (_ : and (@cardinal F (@image_map E F f) x) (lt x n)), False *) intros x H'2; elim H'2; intros H'3 H'4; try exact H'4; clear H'2. (* Goal: @cardinal E A n *) absurd (x = n); auto with *. (* Goal: not (@eq nat x n) *) (* Goal: @eq nat x n *) red in |- *; intros H'2; try exact H'2. (* Goal: @cardinal E A n *) absurd (x < n); auto with *. (* Goal: not (lt x n) *) (* Goal: @eq nat x n *) rewrite H'2. (* Goal: @cardinal E A n *) auto with *. (* Goal: @cardinal E A n *) apply cardinal_unique with (E := F) (A := image_map f); auto with *. Qed. Parameter cardinal_equal_included_equal : forall (E : Setoid) (A B : part_set E) (n : nat), cardinal A n -> cardinal B n -> included B A -> Equal B A. Parameter image_full_surjective : forall (E F : Setoid) (f : MAP E F), Equal (image_map f) (full F) -> surjective f. Hint Resolve image_full_surjective: algebra. Lemma finite_injective_surjective : forall (E F : Setoid) (f : MAP E F) (n : nat), cardinal (full E) n -> cardinal (full F) n -> injective f -> surjective f. (* Goal: forall (E F : Setoid) (f : Carrier (MAP E F)) (n : nat) (_ : @cardinal E (full E) n) (_ : @cardinal F (full F) n) (_ : @surjective E F f), @injective E F f *) intros E F f n H' H'0 H'1; try assumption. (* Goal: @surjective E F f *) generalize (cardinal_image_injective H' H'1). (* Goal: forall _ : @in_part E x B, @in_part E x A *) (* Goal: forall _ : @in_part E x A, @in_part E x B *) (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) intros H'2; try assumption. (* Goal: @cardinal E A n *) apply image_full_surjective; auto with *. (* Goal: @Equal (part_set F) (@image_map E F f) (full F) *) unfold image_map in |- *. (* Goal: @cardinal E A n *) apply cardinal_equal_included_equal with n; auto with *. Qed. Parameter surjective_image_full : forall (E F : Setoid) (f : MAP E F), surjective f -> Equal (image_map f) (full F). Hint Resolve surjective_image_full: algebra. Lemma finite_surjective_injective : forall (E F : Setoid) (f : MAP E F) (n : nat), cardinal (full E) n -> cardinal (full F) n -> surjective f -> injective f. (* Goal: forall (E F : Setoid) (f : Carrier (MAP E F)) (n : nat) (_ : @cardinal E (full E) n) (_ : @cardinal F (full F) n) (_ : @surjective E F f), @injective E F f *) intros E F f n H' H'0 H'1; try assumption. (* Goal: @cardinal E A n *) apply cardinal_image_equal_injective with n; auto with *. (* Goal: @cardinal E A n *) apply cardinal_comp with (full F) n; auto with *. (* Goal: @cardinal E A n *) apply Sym; auto with *. Qed. Lemma not_included_exist : forall (E : Setoid) (A B : part_set E), included B A -> ~ Equal B A -> exists x : E, in_part x A /\ ~ in_part x B. (* Goal: @in_part E x1 (@diff E A0 (@single E x0)) *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @cardinal E A n *) intros E A B; simpl in |- *. (* Goal: @in_part E x1 (@diff E A0 (@single E x0)) *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @cardinal E A n *) unfold eq_part in |- *; simpl in |- *. (* Goal: forall (_ : @included E B A) (_ : not (forall x : Carrier E, and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))), @ex (Carrier E) (fun x : Carrier E => and (@in_part E x A) (not (@in_part E x B))) *) intros H' H'0; try assumption. cut (ex (fun x : E => ~ ((in_part x B -> in_part x A) /\ (in_part x A -> in_part x B)))). (* Goal: forall _ : @in_part E x B, False *) (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) intros H'1; try assumption. (* Goal: @ex (Carrier E) (fun x : Carrier E => and (@in_part E x A) (not (@in_part E x B))) *) (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) elim H'1; intros x E0; try exact E0; clear H'1. (* Goal: @ex (Carrier E) (fun x : Carrier E => and (@in_part E x A) (not (@in_part E x B))) *) (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) exists x; split; [ try assumption | idtac ]. (* Goal: forall _ : @in_part E x B, False *) (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) red in E0. (* Goal: @in_part E x A *) (* Goal: not (@in_part E x B) *) (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) apply NNPP. (* Goal: not (not (@in_part E x A)) *) (* Goal: not (@in_part E x B) *) (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) red in |- *; intros H'1; try exact H'1. (* Goal: False *) (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) lapply E0; [ intros H'2; apply H'2; clear E0 | clear E0 ]. (* Goal: and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B) *) (* Goal: not (@in_part E x B) *) (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) split; [ idtac | intros H'2; try assumption ]. (* Goal: forall _ : @in_part E x B, @in_part E x A *) (* Goal: forall _ : @in_part E x A, @in_part E x B *) (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) intros H'2; try assumption. (* Goal: @cardinal E A n *) apply H'; auto with *. (* Goal: @cardinal E A n *) absurd (in_part x A); auto with *. (* Goal: not (@Equal E x1 x0) *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @cardinal E A n *) red in |- *. (* Goal: forall _ : @in_part E x B, False *) (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) red in E0. (* Goal: forall _ : @in_part E x B, False *) (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) intros H'1; try assumption. (* Goal: False *) (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) lapply E0; [ intros H'2; apply H'2; clear E0 | clear E0 ]. (* Goal: and (@in_part E x1 A0) (not (@Equal E x1 x0)) *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @cardinal E A n *) split; [ try assumption | idtac ]. (* Goal: forall _ : @in_part E x B, @in_part E x A *) (* Goal: forall _ : @in_part E x A, @in_part E x B *) (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) intros H'2; try assumption. (* Goal: @cardinal E A n *) apply H'; auto with *. (* Goal: @cardinal E A n *) auto with *. apply not_all_ex_not with (P := fun x : E => (in_part x B -> in_part x A) /\ (in_part x A -> in_part x B)); (* Goal: @cardinal E A n *) auto with *. Qed. Lemma cardinal_included : forall (E : Setoid) (A : part_set E) (n : nat), cardinal A n -> forall B : part_set E, included B A -> exists m : nat, cardinal B m /\ m <= n. (* Goal: forall (E : Setoid) (A : Carrier (part_set E)) (n : nat) (_ : @cardinal E A n) (B : Carrier (part_set E)) (_ : @included E B A), @ex nat (fun m : nat => and (@cardinal E B m) (le m n)) *) intros E A n H'; try assumption. apply cardinal_ind2 with (P := fun (n : nat) (A : part_set E) (c : cardinal A n) => forall B : part_set E, included B A -> ex (fun m : nat => cardinal B m /\ m <= n)). (* Goal: @cardinal E A n *) intros A0 H'0 B H'1; exists 0; split; [ try assumption | idtac ]; auto with *. (* Goal: @cardinal E B O *) (* Goal: forall (n : nat) (_ : forall (B : Carrier (part_set E)) (_ : @cardinal E B n) (B0 : Carrier (part_set E)) (_ : @included E B0 B), @ex nat (fun m : nat => and (@cardinal E B0 m) (le m n))) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (@add_part E B x)) (_ : @cardinal E A (S n)) (B0 : Carrier (part_set E)) (_ : @included E B0 A), @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n))) *) (* Goal: @cardinal E A n *) apply cardinal_empty. (* Goal: @Equal (part_set E) B (empty E) *) (* Goal: forall (n : nat) (_ : forall (B : Carrier (part_set E)) (_ : @cardinal E B n) (B0 : Carrier (part_set E)) (_ : @included E B0 B), @ex nat (fun m : nat => and (@cardinal E B0 m) (le m n))) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (@add_part E B x)) (_ : @cardinal E A (S n)) (B0 : Carrier (part_set E)) (_ : @included E B0 A), @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n))) *) (* Goal: @cardinal E A n *) inversion H'0. (* Goal: @cardinal E A n *) cut (included B (empty E)); auto with *. (* Goal: @cardinal E A n *) apply included_comp with B A0; auto with *. (* Goal: forall (n : nat) (_ : forall (B : Carrier (part_set E)) (_ : @cardinal E B n) (B0 : Carrier (part_set E)) (_ : @included E B0 B), @ex nat (fun m : nat => and (@cardinal E B0 m) (le m n))) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (@add_part E B x)) (_ : @cardinal E A (S n)) (B0 : Carrier (part_set E)) (_ : @included E B0 A), @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n))) *) (* Goal: @cardinal E A n *) intros n0 H'0 A0 B x H'1 H'2 H'3 B0 H'4; try assumption. (* Goal: @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n0))) *) (* Goal: @cardinal E A n *) case (classic (Equal B0 A0)); intros. (* Goal: and True (not (@Equal E y x)) *) (* Goal: @Equal F x0 (@Ap E F f y) *) (* Goal: forall _ : not (@Equal E x1 x), @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) (* Goal: lt m (S n0) *) (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) exists (S n0); split; [ idtac | try assumption ]. (* Goal: @cardinal E A n *) apply cardinal_comp with A0 (S n0); auto with *. (* Goal: @cardinal E A n *) auto with *. (* Goal: @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n0))) *) (* Goal: @cardinal E A n *) case (not_included_exist H'4 H). (* Goal: forall (x : Carrier E) (_ : and (@in_part E x A0) (not (@in_part E x B0))), @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n0))) *) (* Goal: @cardinal E A n *) intros x0 H'5; try assumption. (* Goal: @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n0))) *) (* Goal: @cardinal E A n *) elim H'5; intros H'6 H'7; try exact H'6; clear H'5. lapply (H'0 (minus_part A0 x0)); [ intros H'8; elim (H'8 B0); [ intros m E0; elim E0; intros H'11 H'12; try exact H'11; clear E0 | idtac ] (* Goal: @cardinal E A n *) | idtac ]; auto with *. (* Goal: @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n0))) *) (* Goal: @included E B0 (@minus_part E A0 x0) *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @cardinal E A n *) exists m; split; [ try assumption | idtac ]. (* Goal: @cardinal E A n *) apply le_trans with n0; auto with *. (* Goal: @in_part E x1 (@diff E A0 (@single E x0)) *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @cardinal E A n *) unfold minus_part in |- *; simpl in |- *. (* Goal: not (@Equal E x1 x0) *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @cardinal E A n *) red in |- *. (* Goal: forall (x : Carrier E) (_ : @in_part E x B0), @in_part E x (@diff E A0 (@single E x0)) *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @cardinal E A n *) intros x1 H'5; try assumption. (* Goal: @in_part E x1 (@diff E A0 (@single E x0)) *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @cardinal E A n *) simpl in |- *. (* Goal: and (@in_part E x1 A0) (not (@Equal E x1 x0)) *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @cardinal E A n *) split; [ try assumption | idtac ]. (* Goal: @cardinal E A n *) apply H'4; auto with *. (* Goal: not (@Equal E x1 x0) *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @cardinal E A n *) red in |- *. (* Goal: forall _ : @Equal E x1 x0, False *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @cardinal E A n *) intros H'9; try assumption. (* Goal: False *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @cardinal E A n *) apply H'7. (* Goal: @cardinal E A n *) apply in_part_comp_l with x1; auto with *. (* Goal: @cardinal E A n *) apply cardinal_S with A0 x0; auto with *. (* Goal: @Equal (part_set E) A0 (@add_part E (@minus_part E A0 x0) x0) *) (* Goal: @cardinal E A n *) apply Sym. (* Goal: @cardinal E A n *) apply minus_add; auto with *. (* Goal: @cardinal E A n *) auto with *. Qed. Lemma map_not_injective : forall (A B : Setoid) (f : MAP A B) (n m : nat), cardinal (full A) n -> cardinal (full B) m -> m < n -> ~ injective f. (* Goal: not (@eq nat x n) *) (* Goal: @eq nat x n *) intros A B f n m H' H'0 H'1; red in |- *; intros H'2; try exact H'2. (* Goal: False *) red in H'2. (* Goal: @cardinal E A n *) case (tiroirs (E:=A) (F:=B) (f:=f) H' H'0 H'1); auto with *. (* Goal: forall (x : Carrier A) (_ : @ex (Carrier A) (fun y : Carrier A => and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y)))), False *) intros x H'3; try assumption. elim H'3; intros y E; elim E; intros H'4 H'5; try exact H'4; clear E H'3; (* Goal: @cardinal E A n *) auto with *. Qed. Definition finite (A : Setoid) := exists n : nat, cardinal (full A) n.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Ring_cat. Require Export Operation_of_monoid. (** Title "The category of modules on a ring." *) Section Def. Variable R : RING. Section Module_def. Variable Mod : abelian_group. Variable op : operation (ring_monoid R) Mod. Definition op_lin_left := forall (a b : R) (x : Mod), Equal (op (sgroup_law R a b) x) (sgroup_law Mod (op a x) (op b x)). Definition op_lin_right := forall (a : R) (x y : Mod), Equal (op a (sgroup_law Mod x y)) (sgroup_law Mod (op a x) (op a y)). End Module_def. Record module_on (M : abelian_group) : Type := {module_op : operation (ring_monoid R) M; module_op_lin_left_prf : op_lin_left module_op; module_op_lin_right_prf : op_lin_right module_op}. Record module : Type := {module_carrier :> abelian_group; module_on_def :> module_on module_carrier}. Coercion Build_module : module_on >-> module. Definition module_mult (B : module) (a : R) (x : B) := module_op B a x. Section Hom. Variable E F : module. Definition module_hom_prop (f : E -> F) := forall (a : R) (x : E), Equal (f (module_mult a x)) (module_mult a (f x)). Record module_hom : Type := {module_monoid_hom :> monoid_hom E F; module_hom_prf : module_hom_prop module_monoid_hom}. End Hom. Definition module_hom_comp : forall E F Mod : module, module_hom F Mod -> module_hom E F -> module_hom E Mod. (* Goal: forall (E F Mod : module) (_ : module_hom F Mod) (_ : module_hom E F), module_hom E Mod *) intros E F Mod g f; try assumption. apply (Build_module_hom (E:=E) (F:=Mod) (module_monoid_hom:=monoid_hom_comp g f)). (* Goal: @module_hom_prop E Mod (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier Mod))) (@monoid_hom_comp (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g) (@module_monoid_hom E F f))))) *) unfold module_hom_prop in |- *; auto with algebra. (* Goal: forall (a b c : module) (g : Carrier (@subcat_Hom MONOID module (fun m : module => group_monoid (abelian_group_group (module_carrier m))) (fun E F : module => @Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier E) (module_carrier F)) (module_hom E F) (@module_monoid_hom E F)) b c)) (f : Carrier (@subcat_Hom MONOID module (fun m : module => group_monoid (abelian_group_group (module_carrier m))) (fun E F : module => @Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier E) (module_carrier F)) (module_hom E F) (@module_monoid_hom E F)) a b)), @Equal (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier c)))) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier c)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier a) (module_carrier c)) (module_hom a c) (@module_monoid_hom a c)) (@module_hom_comp a b c g f)) (@comp_hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier b) (module_carrier c)) (module_hom b c) (@module_monoid_hom b c)) g) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier a) (module_carrier b)) (module_hom a b) (@module_monoid_hom a b)) f)) *) simpl in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@comp_map_fun (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) (@module_mult E a x)) (@module_mult Mod a (@comp_map_fun (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) x)) *) unfold comp_map_fun in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) (@module_mult E a x))) (@module_mult Mod a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) x))) *) intros a x; try assumption. apply Trans with (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom g))) (module_mult a (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f))) x))). cut (Equal (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f))) (module_mult a x)) (module_mult a (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f))) x))). (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@module_monoid_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (@module_monoid_hom a b f)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@module_monoid_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (@module_monoid_hom a b f)))) x) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) (@module_mult E a x)) (@module_mult F a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@module_mult F a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) x))) (@module_mult Mod a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) x))) *) apply (module_hom_prf f). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@module_mult F a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) x))) (@module_mult Mod a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) x))) *) apply (module_hom_prf g). Defined. Definition module_id : forall E : module, module_hom E E. (* Goal: forall E : module, module_hom E E *) intros E; try assumption. (* Goal: module_hom E E *) apply (Build_module_hom (module_monoid_hom:=monoid_id E)). (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@module_monoid_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (@module_monoid_hom a b f)))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@module_monoid_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (@module_monoid_hom a b f)))) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@module_monoid_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (@module_monoid_hom a b f)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@module_monoid_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (@module_monoid_hom a b f)))) x) *) simpl in |- *; auto with algebra. Defined. Definition MODULE : category. apply (subcat (C:=MONOID) (C':=module) (i:=module_carrier) (homC':=fun E F : module => Build_subtype_image (E:=Hom (c:=ABELIAN_GROUP) E F) (subtype_image_carrier:=module_hom E F) (module_monoid_hom (E:=E) (F:=F))) (CompC':=module_hom_comp) (idC':=module_id)). (* Goal: forall (a b c : module) (g : Carrier (@subcat_Hom MONOID module (fun m : module => group_monoid (abelian_group_group (module_carrier m))) (fun E F : module => @Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier E) (module_carrier F)) (module_hom E F) (@module_monoid_hom E F)) b c)) (f : Carrier (@subcat_Hom MONOID module (fun m : module => group_monoid (abelian_group_group (module_carrier m))) (fun E F : module => @Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier E) (module_carrier F)) (module_hom E F) (@module_monoid_hom E F)) a b)), @Equal (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier c)))) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier c)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier a) (module_carrier c)) (module_hom a c) (@module_monoid_hom a c)) (@module_hom_comp a b c g f)) (@comp_hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier b) (module_carrier c)) (module_hom b c) (@module_monoid_hom b c)) g) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier a) (module_carrier b)) (module_hom a b) (@module_monoid_hom a b)) f)) *) simpl in |- *. (* Goal: forall a : module, @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))))) *) (* Goal: forall (a b c : module) (g : Carrier (@subcat_Hom MONOID module (fun m : module => group_monoid (abelian_group_group (module_carrier m))) (fun E F : module => @Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier E) (module_carrier F)) (module_hom E F) (@module_monoid_hom E F)) b c)) (f : Carrier (@subcat_Hom MONOID module (fun m : module => group_monoid (abelian_group_group (module_carrier m))) (fun E F : module => @Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier E) (module_carrier F)) (module_hom E F) (@module_monoid_hom E F)) a b)), @Equal (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier c)))) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier c)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier a) (module_carrier c)) (module_hom a c) (@module_monoid_hom a c)) (@module_hom_comp a b c g f)) (@comp_hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier b) (module_carrier c)) (module_hom b c) (@module_monoid_hom b c)) g) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier a) (module_carrier b)) (module_hom a b) (@module_monoid_hom a b)) f)) *) intros a; try assumption. (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@module_monoid_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (@module_monoid_hom a b f)))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@module_monoid_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (@module_monoid_hom a b f)))) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@module_monoid_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (@module_monoid_hom a b f)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@module_monoid_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (@module_monoid_hom a b f)))) x) *) auto with algebra. (* Goal: forall (a b c : module) (g : Carrier (@subcat_Hom MONOID module (fun m : module => group_monoid (abelian_group_group (module_carrier m))) (fun E F : module => @Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier E) (module_carrier F)) (module_hom E F) (@module_monoid_hom E F)) b c)) (f : Carrier (@subcat_Hom MONOID module (fun m : module => group_monoid (abelian_group_group (module_carrier m))) (fun E F : module => @Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier E) (module_carrier F)) (module_hom E F) (@module_monoid_hom E F)) a b)), @Equal (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier c)))) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier c)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier a) (module_carrier c)) (module_hom a c) (@module_monoid_hom a c)) (@module_hom_comp a b c g f)) (@comp_hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier b) (module_carrier c)) (module_hom b c) (@module_monoid_hom b c)) g) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier a) (module_carrier b)) (module_hom a b) (@module_monoid_hom a b)) f)) *) simpl in |- *. (* Goal: forall (a b c : module) (g : module_hom b c) (f : module_hom a b), @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@module_monoid_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (@module_monoid_hom a b f)))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@module_monoid_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (@module_monoid_hom a b f)))) *) intros a b c g f; try assumption. (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@module_monoid_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (@module_monoid_hom a b f)))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@module_monoid_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (@module_monoid_hom a b f)))) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@module_monoid_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (@module_monoid_hom a b f)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@module_monoid_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (@module_monoid_hom a b f)))) x) *) auto with algebra. Defined. End Def.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Automatic Coercions Import. Set Implicit Arguments. Unset Strict Implicit. Require Export Zring. Section Int_power. Variable G : GROUP. Set Strict Implicit. Unset Implicit Arguments. Definition group_square (x : G) : G := sgroup_law G x x. Set Implicit Arguments. Unset Strict Implicit. Fixpoint group_power_pos (g : G) (p : positive) {struct p} : G := match p with | xH => g | xO p' => group_square (group_power_pos g p') | xI p' => sgroup_law G (group_square (group_power_pos g p')) g end. Set Strict Implicit. Unset Implicit Arguments. Definition group_power (g : G) (z : ZZ) : G := match z with | Z0 => monoid_unit G | Zpos p => group_power_pos g p | Zneg p => group_power_pos (group_inverse G g) p end. Set Implicit Arguments. Unset Strict Implicit. End Int_power. Section Lemmas. Variable G : GROUP. Lemma group_power_zero : forall g : G, Equal (group_power G g (monoid_unit ZZ)) (monoid_unit G). (* Goal: forall g : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g (@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 G)) (monoid_on_def (group_monoid G))) *) intros g; simpl in |- *; auto with algebra. Qed. Parameter group_power_S : forall (g : G) (n : ZZ), Equal (group_power G g (sgroup_law ZZ n (ring_unit ZZ))) (sgroup_law G (group_power G g n) g). End Lemmas. Hint Resolve group_power_zero group_power_S: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Automatic Coercions Import. Set Implicit Arguments. Unset Strict Implicit. Require Export Module_util. Require Export Module_facts. Section Free_Module_def. Variable R : RING. Variable V : SET. Inductive FMd : Type := | Var : V -> FMd | Law : FMd -> FMd -> FMd | Unit : FMd | Inv : FMd -> FMd | Op : R -> FMd -> FMd. Inductive eqFMd : FMd -> FMd -> Prop := | eqFMd_Var : forall x y : V, Equal x y -> (eqFMd (Var x) (Var y):Prop) | eqFMd_law : forall x x' y y' : FMd, eqFMd x x' -> eqFMd y y' -> (eqFMd (Law x y) (Law x' y'):Prop) | eqFMd_law_assoc : forall x y z : FMd, eqFMd (Law (Law x y) z) (Law x (Law y z)):Prop | eqFMd_law0r : forall x : FMd, eqFMd (Law x Unit) x:Prop | eqFMd_inv : forall x y : FMd, eqFMd x y -> eqFMd (Inv x) (Inv y) | eqFMd_invr : forall x : FMd, eqFMd (Law x (Inv x)) Unit | eqFMd_refl : forall x : FMd, eqFMd x x:Prop | eqFMd_sym : forall x y : FMd, eqFMd x y -> (eqFMd y x:Prop) | eqFMd_trans : forall x y z : FMd, eqFMd x y -> eqFMd y z -> (eqFMd x z:Prop) | eqFMd_com : forall x y : FMd, eqFMd (Law x y) (Law y x) | eqFMd_op_comp : forall (a b : R) (x y : FMd), Equal a b -> eqFMd x y -> (eqFMd (Op a x) (Op b y):Prop) | eqFMd_oplin_l : forall (a b : R) (x : FMd), eqFMd (Op (sgroup_law R a b) x) (Law (Op a x) (Op b x)) | eqFMd_oplin_r : forall (a : R) (x y : FMd), eqFMd (Op a (Law x y)) (Law (Op a x) (Op a y)) | eqFMd_op_assoc : forall (a b : R) (x : FMd), eqFMd (Op a (Op b x)) (Op (ring_mult a b) x) | eqFMd_op_unit : forall x : FMd, eqFMd (Op (ring_unit R) x) x. Hint Resolve eqFMd_Var eqFMd_law eqFMd_law_assoc eqFMd_law0r eqFMd_invr eqFMd_refl: algebra. Hint Immediate eqFMd_sym: algebra. Lemma eqFMd_Equiv : equivalence eqFMd. (* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f x) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@comp_hom SET V FMd_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@f2 (@G FMd_set Law Unit Inv eqFMd_law eqFMd_law_assoc eqFMd_law0r eqFMd_inv eqFMd_invr) (abelian_group_group (@module_carrier R Mod)) FMd_lift_fun (fun (x0 y : FMd) (H' : eqFMd x0 y) => @eqFMd_ind (fun x1 y0 : FMd => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (x1 y0 : Carrier V) (H : @Equal V x1 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f f x1 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) f)) (fun (x1 x' y0 y' : FMd) (_ : eqFMd x1 x') (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun x')) (_ : eqFMd y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun y0) (FMd_lift_fun y')) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x1) (FMd_lift_fun x') (FMd_lift_fun y0) (FMd_lift_fun y') H0 H2) (fun x1 y0 z : FMd => @SGROUP_assoc (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x1) (FMd_lift_fun y0) (FMd_lift_fun z)) (fun x1 : FMd => @MONOID_unit_r (group_monoid (abelian_group_group (@module_carrier R Mod))) (FMd_lift_fun x1)) (fun (x1 y0 : FMd) (_ : eqFMd x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @GROUP_comp (abelian_group_group (@module_carrier R Mod)) (FMd_lift_fun x1) (FMd_lift_fun y0) H0) (fun x1 : FMd => @GROUP_inverse_r (abelian_group_group (@module_carrier R Mod)) (FMd_lift_fun x1)) (fun x1 : FMd => @Refl (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1)) (fun (x1 y0 : FMd) (_ : eqFMd x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0) H0) (fun (x1 y0 z : FMd) (_ : eqFMd x1 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) (_ : eqFMd y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun y0) (FMd_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0) (FMd_lift_fun z) H'1 H'3) (fun x1 y0 : FMd => @ABELIAN_GROUP_com (@module_carrier R Mod) (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 y0 : FMd) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : eqFMd x1 y0) (H1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @MODULE_comp R Mod a b (FMd_lift_fun x1) (FMd_lift_fun y0) H H1) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 : FMd) => @MODULE_dist_r R Mod a b (FMd_lift_fun x1)) (fun (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 y0 : FMd) => @MODULE_dist_l R Mod a (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 : FMd) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod (@ring_mult R a b) (FMd_lift_fun x1)) (@module_mult R Mod a (@module_mult R Mod b (FMd_lift_fun x1))) (@MODULE_assoc R Mod a b (FMd_lift_fun x1))) (fun x1 : FMd => @MODULE_unit_l R Mod (FMd_lift_fun x1)) x0 y H')) FMd_var) x) *) red in |- *. (* Goal: and (@transitive FMd eqFMd) (@symmetric FMd eqFMd) *) split; [ try assumption | idtac ]. (* Goal: @reflexive FMd eqFMd *) (* Goal: @partial_equivalence FMd eqFMd *) exact eqFMd_refl. (* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f x) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@comp_hom SET V FMd_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@f2 (@G FMd_set Law Unit Inv eqFMd_law eqFMd_law_assoc eqFMd_law0r eqFMd_inv eqFMd_invr) (abelian_group_group (@module_carrier R Mod)) FMd_lift_fun (fun (x0 y : FMd) (H' : eqFMd x0 y) => @eqFMd_ind (fun x1 y0 : FMd => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (x1 y0 : Carrier V) (H : @Equal V x1 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f f x1 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) f)) (fun (x1 x' y0 y' : FMd) (_ : eqFMd x1 x') (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun x')) (_ : eqFMd y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun y0) (FMd_lift_fun y')) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x1) (FMd_lift_fun x') (FMd_lift_fun y0) (FMd_lift_fun y') H0 H2) (fun x1 y0 z : FMd => @SGROUP_assoc (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x1) (FMd_lift_fun y0) (FMd_lift_fun z)) (fun x1 : FMd => @MONOID_unit_r (group_monoid (abelian_group_group (@module_carrier R Mod))) (FMd_lift_fun x1)) (fun (x1 y0 : FMd) (_ : eqFMd x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @GROUP_comp (abelian_group_group (@module_carrier R Mod)) (FMd_lift_fun x1) (FMd_lift_fun y0) H0) (fun x1 : FMd => @GROUP_inverse_r (abelian_group_group (@module_carrier R Mod)) (FMd_lift_fun x1)) (fun x1 : FMd => @Refl (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1)) (fun (x1 y0 : FMd) (_ : eqFMd x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0) H0) (fun (x1 y0 z : FMd) (_ : eqFMd x1 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) (_ : eqFMd y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun y0) (FMd_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0) (FMd_lift_fun z) H'1 H'3) (fun x1 y0 : FMd => @ABELIAN_GROUP_com (@module_carrier R Mod) (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 y0 : FMd) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : eqFMd x1 y0) (H1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @MODULE_comp R Mod a b (FMd_lift_fun x1) (FMd_lift_fun y0) H H1) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 : FMd) => @MODULE_dist_r R Mod a b (FMd_lift_fun x1)) (fun (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 y0 : FMd) => @MODULE_dist_l R Mod a (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 : FMd) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod (@ring_mult R a b) (FMd_lift_fun x1)) (@module_mult R Mod a (@module_mult R Mod b (FMd_lift_fun x1))) (@MODULE_assoc R Mod a b (FMd_lift_fun x1))) (fun x1 : FMd => @MODULE_unit_l R Mod (FMd_lift_fun x1)) x0 y H')) FMd_var) x) *) red in |- *. (* Goal: and (@transitive FMd eqFMd) (@symmetric FMd eqFMd) *) split; [ try assumption | idtac ]. (* Goal: @transitive FMd eqFMd *) (* Goal: @symmetric FMd eqFMd *) exact eqFMd_trans. (* Goal: @symmetric FMd eqFMd *) exact eqFMd_sym. Qed. Definition FMd_set := Build_Setoid eqFMd_Equiv. Definition FreeModule : MODULE R. apply (BUILD_MODULE (R:=R) (E:=FMd_set) (genlaw:=Law) (e:=Unit) (geninv:=Inv) (gen_module_op:=Op)). (* Goal: forall (x x' y y' : Carrier FMd_set) (_ : @Equal FMd_set x x') (_ : @Equal FMd_set y y'), @Equal FMd_set (Law x y) (Law x' y') *) (* Goal: forall x y z : Carrier FMd_set, @Equal FMd_set (Law (Law x y) z) (Law x (Law y z)) *) (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Law x Unit) x *) (* Goal: forall (x y : Carrier FMd_set) (_ : @Equal FMd_set x y), @Equal FMd_set (Inv x) (Inv y) *) (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Law x (Inv x)) Unit *) (* Goal: forall x y : Carrier FMd_set, @Equal FMd_set (Law x y) (Law y x) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : @Equal FMd_set x y), @Equal FMd_set (Op a x) (Op b y) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a b) x) (Law (Op a x) (Op b x)) *) (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set), @Equal FMd_set (Op a (Law x y)) (Law (Op a x) (Op a y)) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op a (Op b x)) (Op (@ring_mult R a b) x) *) (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Op (ring_unit R) x) x *) exact eqFMd_law. (* Goal: forall x y z : Carrier FMd_set, @Equal FMd_set (Law (Law x y) z) (Law x (Law y z)) *) (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Law x Unit) x *) (* Goal: forall (x y : Carrier FMd_set) (_ : @Equal FMd_set x y), @Equal FMd_set (Inv x) (Inv y) *) (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Law x (Inv x)) Unit *) (* Goal: forall x y : Carrier FMd_set, @Equal FMd_set (Law x y) (Law y x) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : @Equal FMd_set x y), @Equal FMd_set (Op a x) (Op b y) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a b) x) (Law (Op a x) (Op b x)) *) (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set), @Equal FMd_set (Op a (Law x y)) (Law (Op a x) (Op a y)) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op a (Op b x)) (Op (@ring_mult R a b) x) *) (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Op (ring_unit R) x) x *) exact eqFMd_law_assoc. (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Law x Unit) x *) (* Goal: forall (x y : Carrier FMd_set) (_ : @Equal FMd_set x y), @Equal FMd_set (Inv x) (Inv y) *) (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Law x (Inv x)) Unit *) (* Goal: forall x y : Carrier FMd_set, @Equal FMd_set (Law x y) (Law y x) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : @Equal FMd_set x y), @Equal FMd_set (Op a x) (Op b y) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a b) x) (Law (Op a x) (Op b x)) *) (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set), @Equal FMd_set (Op a (Law x y)) (Law (Op a x) (Op a y)) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op a (Op b x)) (Op (@ring_mult R a b) x) *) (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Op (ring_unit R) x) x *) exact eqFMd_law0r. (* Goal: forall (x y : Carrier FMd_set) (_ : @Equal FMd_set x y), @Equal FMd_set (Inv x) (Inv y) *) (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Law x (Inv x)) Unit *) (* Goal: forall x y : Carrier FMd_set, @Equal FMd_set (Law x y) (Law y x) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : @Equal FMd_set x y), @Equal FMd_set (Op a x) (Op b y) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a b) x) (Law (Op a x) (Op b x)) *) (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set), @Equal FMd_set (Op a (Law x y)) (Law (Op a x) (Op a y)) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op a (Op b x)) (Op (@ring_mult R a b) x) *) (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Op (ring_unit R) x) x *) exact eqFMd_inv. (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Law x (Inv x)) Unit *) (* Goal: forall x y : Carrier FMd_set, @Equal FMd_set (Law x y) (Law y x) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : @Equal FMd_set x y), @Equal FMd_set (Op a x) (Op b y) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a b) x) (Law (Op a x) (Op b x)) *) (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set), @Equal FMd_set (Op a (Law x y)) (Law (Op a x) (Op a y)) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op a (Op b x)) (Op (@ring_mult R a b) x) *) (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Op (ring_unit R) x) x *) exact eqFMd_invr. (* Goal: forall x y : Carrier FMd_set, @Equal FMd_set (Law x y) (Law y x) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : @Equal FMd_set x y), @Equal FMd_set (Op a x) (Op b y) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a b) x) (Law (Op a x) (Op b x)) *) (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set), @Equal FMd_set (Op a (Law x y)) (Law (Op a x) (Op a y)) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op a (Op b x)) (Op (@ring_mult R a b) x) *) (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Op (ring_unit R) x) x *) exact eqFMd_com. (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : @Equal FMd_set x y), @Equal FMd_set (Op a x) (Op b y) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a b) x) (Law (Op a x) (Op b x)) *) (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set), @Equal FMd_set (Op a (Law x y)) (Law (Op a x) (Op a y)) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op a (Op b x)) (Op (@ring_mult R a b) x) *) (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Op (ring_unit R) x) x *) exact eqFMd_op_comp. (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a b) x) (Law (Op a x) (Op b x)) *) (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set), @Equal FMd_set (Op a (Law x y)) (Law (Op a x) (Op a y)) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op a (Op b x)) (Op (@ring_mult R a b) x) *) (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Op (ring_unit R) x) x *) exact eqFMd_oplin_l. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set), @Equal FMd_set (Op a (Law x y)) (Law (Op a x) (Op a y)) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op a (Op b x)) (Op (@ring_mult R a b) x) *) (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Op (ring_unit R) x) x *) exact eqFMd_oplin_r. (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op a (Op b x)) (Op (@ring_mult R a b) x) *) (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Op (ring_unit R) x) x *) exact eqFMd_op_assoc. (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Op (ring_unit R) x) x *) exact eqFMd_op_unit. Defined. Section Universal_prop. Variable Mod : MODULE R. Variable f : Hom V Mod. Fixpoint FMd_lift_fun (p : FreeModule) : Mod := match p with | Var v => f v | Law p1 p2 => sgroup_law Mod (FMd_lift_fun p1) (FMd_lift_fun p2) | Unit => monoid_unit Mod | Inv p1 => group_inverse Mod (FMd_lift_fun p1) | Op a p1 => module_mult a (FMd_lift_fun p1) end. Definition FMd_lift : Hom FreeModule Mod. apply (BUILD_HOM_MODULE (R:=R) (Mod:=FreeModule) (Mod':=Mod) (ff:=FMd_lift_fun)). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule))))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x) (FMd_lift_fun y) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))) x y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x) (FMd_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod))))) *) (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (@module_mult R FreeModule a x)) (@module_mult R Mod a (FMd_lift_fun x)) *) intros x y H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x) (FMd_lift_fun y) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))) x y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x) (FMd_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod))))) *) (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (@module_mult R FreeModule a x)) (@module_mult R Mod a (FMd_lift_fun x)) *) elim H'; simpl in |- *; auto with algebra. (* Goal: forall (x y z : FMd) (_ : eqFMd x y) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x) (FMd_lift_fun y)) (_ : eqFMd y z) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun y) (FMd_lift_fun z)), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x) (FMd_lift_fun z) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))) x y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x) (FMd_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod))))) *) (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (@module_mult R FreeModule a x)) (@module_mult R Mod a (FMd_lift_fun x)) *) intros x0 y0 z H'0 H'1 H'2 H'3; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x0) (FMd_lift_fun z) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))) x y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x) (FMd_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod))))) *) (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (@module_mult R FreeModule a x)) (@module_mult R Mod a (FMd_lift_fun x)) *) apply Trans with (FMd_lift_fun y0); auto with algebra. (* Goal: forall (x y : Carrier V) (_ : @Equal V x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule))))) (Var x) (Var y) *) simpl in |- *; auto with algebra. (* Goal: forall (x y : Carrier V) (_ : @Equal V x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule))))) (Var x) (Var y) *) simpl in |- *; auto with algebra. (* Goal: forall (x y : Carrier V) (_ : @Equal V x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule))))) (Var x) (Var y) *) simpl in |- *; auto with algebra. Defined. Definition FMd_var : Hom V FreeModule. (* Goal: Carrier (@Hom SET V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))) *) apply (Build_Map (A:=V) (B:=FreeModule) (Ap:=Var)). (* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f x) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@comp_hom SET V FMd_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@f2 (@G FMd_set Law Unit Inv eqFMd_law eqFMd_law_assoc eqFMd_law0r eqFMd_inv eqFMd_invr) (abelian_group_group (@module_carrier R Mod)) FMd_lift_fun (fun (x0 y : FMd) (H' : eqFMd x0 y) => @eqFMd_ind (fun x1 y0 : FMd => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (x1 y0 : Carrier V) (H : @Equal V x1 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f f x1 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) f)) (fun (x1 x' y0 y' : FMd) (_ : eqFMd x1 x') (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun x')) (_ : eqFMd y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun y0) (FMd_lift_fun y')) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x1) (FMd_lift_fun x') (FMd_lift_fun y0) (FMd_lift_fun y') H0 H2) (fun x1 y0 z : FMd => @SGROUP_assoc (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x1) (FMd_lift_fun y0) (FMd_lift_fun z)) (fun x1 : FMd => @MONOID_unit_r (group_monoid (abelian_group_group (@module_carrier R Mod))) (FMd_lift_fun x1)) (fun (x1 y0 : FMd) (_ : eqFMd x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @GROUP_comp (abelian_group_group (@module_carrier R Mod)) (FMd_lift_fun x1) (FMd_lift_fun y0) H0) (fun x1 : FMd => @GROUP_inverse_r (abelian_group_group (@module_carrier R Mod)) (FMd_lift_fun x1)) (fun x1 : FMd => @Refl (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1)) (fun (x1 y0 : FMd) (_ : eqFMd x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0) H0) (fun (x1 y0 z : FMd) (_ : eqFMd x1 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) (_ : eqFMd y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun y0) (FMd_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0) (FMd_lift_fun z) H'1 H'3) (fun x1 y0 : FMd => @ABELIAN_GROUP_com (@module_carrier R Mod) (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 y0 : FMd) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : eqFMd x1 y0) (H1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @MODULE_comp R Mod a b (FMd_lift_fun x1) (FMd_lift_fun y0) H H1) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 : FMd) => @MODULE_dist_r R Mod a b (FMd_lift_fun x1)) (fun (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 y0 : FMd) => @MODULE_dist_l R Mod a (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 : FMd) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod (@ring_mult R a b) (FMd_lift_fun x1)) (@module_mult R Mod a (@module_mult R Mod b (FMd_lift_fun x1))) (@MODULE_assoc R Mod a b (FMd_lift_fun x1))) (fun x1 : FMd => @MODULE_unit_l R Mod (FMd_lift_fun x1)) x0 y H')) FMd_var) x) *) red in |- *. (* Goal: forall (x y : Carrier V) (_ : @Equal V x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule))))) (Var x) (Var y) *) simpl in |- *; auto with algebra. Defined. Lemma FMd_comp_prop : Equal f (comp_hom (FMd_lift:Hom (FreeModule:SET) Mod) FMd_var). (* Goal: forall x : Carrier V, (let (Carrier, Equal, _) as s return (relation (Carrier s)) := sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) in Equal) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f x) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@comp_hom SET V FMd_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@f2 (@G FMd_set Law Unit Inv eqFMd_law eqFMd_law_assoc eqFMd_law0r eqFMd_inv eqFMd_invr) (abelian_group_group (@module_carrier R Mod)) FMd_lift_fun (fun (x0 y : FMd) (H' : eqFMd x0 y) => @eqFMd_ind (fun x1 y0 : FMd => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (x1 y0 : Carrier V) (H : @Equal V x1 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f f x1 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) f)) (fun (x1 x' y0 y' : FMd) (_ : eqFMd x1 x') (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun x')) (_ : eqFMd y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun y0) (FMd_lift_fun y')) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x1) (FMd_lift_fun x') (FMd_lift_fun y0) (FMd_lift_fun y') H0 H2) (fun x1 y0 z : FMd => @SGROUP_assoc (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x1) (FMd_lift_fun y0) (FMd_lift_fun z)) (fun x1 : FMd => @MONOID_unit_r (group_monoid (abelian_group_group (@module_carrier R Mod))) (FMd_lift_fun x1)) (fun (x1 y0 : FMd) (_ : eqFMd x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @GROUP_comp (abelian_group_group (@module_carrier R Mod)) (FMd_lift_fun x1) (FMd_lift_fun y0) H0) (fun x1 : FMd => @GROUP_inverse_r (abelian_group_group (@module_carrier R Mod)) (FMd_lift_fun x1)) (fun x1 : FMd => @Refl (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1)) (fun (x1 y0 : FMd) (_ : eqFMd x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0) H0) (fun (x1 y0 z : FMd) (_ : eqFMd x1 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) (_ : eqFMd y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun y0) (FMd_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0) (FMd_lift_fun z) H'1 H'3) (fun x1 y0 : FMd => @ABELIAN_GROUP_com (@module_carrier R Mod) (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 y0 : FMd) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : eqFMd x1 y0) (H1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @MODULE_comp R Mod a b (FMd_lift_fun x1) (FMd_lift_fun y0) H H1) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 : FMd) => @MODULE_dist_r R Mod a b (FMd_lift_fun x1)) (fun (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 y0 : FMd) => @MODULE_dist_l R Mod a (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 : FMd) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod (@ring_mult R a b) (FMd_lift_fun x1)) (@module_mult R Mod a (@module_mult R Mod b (FMd_lift_fun x1))) (@MODULE_assoc R Mod a b (FMd_lift_fun x1))) (fun x1 : FMd => @MODULE_unit_l R Mod (FMd_lift_fun x1)) x0 y H')) FMd_var) x) *) simpl in |- *. (* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f x) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@comp_hom SET V FMd_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@f2 (@G FMd_set Law Unit Inv eqFMd_law eqFMd_law_assoc eqFMd_law0r eqFMd_inv eqFMd_invr) (abelian_group_group (@module_carrier R Mod)) FMd_lift_fun (fun (x0 y : FMd) (H' : eqFMd x0 y) => @eqFMd_ind (fun x1 y0 : FMd => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (x1 y0 : Carrier V) (H : @Equal V x1 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f f x1 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) f)) (fun (x1 x' y0 y' : FMd) (_ : eqFMd x1 x') (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun x')) (_ : eqFMd y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun y0) (FMd_lift_fun y')) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x1) (FMd_lift_fun x') (FMd_lift_fun y0) (FMd_lift_fun y') H0 H2) (fun x1 y0 z : FMd => @SGROUP_assoc (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x1) (FMd_lift_fun y0) (FMd_lift_fun z)) (fun x1 : FMd => @MONOID_unit_r (group_monoid (abelian_group_group (@module_carrier R Mod))) (FMd_lift_fun x1)) (fun (x1 y0 : FMd) (_ : eqFMd x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @GROUP_comp (abelian_group_group (@module_carrier R Mod)) (FMd_lift_fun x1) (FMd_lift_fun y0) H0) (fun x1 : FMd => @GROUP_inverse_r (abelian_group_group (@module_carrier R Mod)) (FMd_lift_fun x1)) (fun x1 : FMd => @Refl (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1)) (fun (x1 y0 : FMd) (_ : eqFMd x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0) H0) (fun (x1 y0 z : FMd) (_ : eqFMd x1 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) (_ : eqFMd y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun y0) (FMd_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0) (FMd_lift_fun z) H'1 H'3) (fun x1 y0 : FMd => @ABELIAN_GROUP_com (@module_carrier R Mod) (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 y0 : FMd) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : eqFMd x1 y0) (H1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @MODULE_comp R Mod a b (FMd_lift_fun x1) (FMd_lift_fun y0) H H1) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 : FMd) => @MODULE_dist_r R Mod a b (FMd_lift_fun x1)) (fun (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 y0 : FMd) => @MODULE_dist_l R Mod a (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 : FMd) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod (@ring_mult R a b) (FMd_lift_fun x1)) (@module_mult R Mod a (@module_mult R Mod b (FMd_lift_fun x1))) (@MODULE_assoc R Mod a b (FMd_lift_fun x1))) (fun x1 : FMd => @MODULE_unit_l R Mod (FMd_lift_fun x1)) x0 y H')) FMd_var) x) *) red in |- *. (* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f x) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@comp_hom SET V FMd_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@f2 (@G FMd_set Law Unit Inv eqFMd_law eqFMd_law_assoc eqFMd_law0r eqFMd_inv eqFMd_invr) (abelian_group_group (@module_carrier R Mod)) FMd_lift_fun (fun (x0 y : FMd) (H' : eqFMd x0 y) => @eqFMd_ind (fun x1 y0 : FMd => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (x1 y0 : Carrier V) (H : @Equal V x1 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f f x1 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) f)) (fun (x1 x' y0 y' : FMd) (_ : eqFMd x1 x') (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun x')) (_ : eqFMd y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun y0) (FMd_lift_fun y')) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x1) (FMd_lift_fun x') (FMd_lift_fun y0) (FMd_lift_fun y') H0 H2) (fun x1 y0 z : FMd => @SGROUP_assoc (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x1) (FMd_lift_fun y0) (FMd_lift_fun z)) (fun x1 : FMd => @MONOID_unit_r (group_monoid (abelian_group_group (@module_carrier R Mod))) (FMd_lift_fun x1)) (fun (x1 y0 : FMd) (_ : eqFMd x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @GROUP_comp (abelian_group_group (@module_carrier R Mod)) (FMd_lift_fun x1) (FMd_lift_fun y0) H0) (fun x1 : FMd => @GROUP_inverse_r (abelian_group_group (@module_carrier R Mod)) (FMd_lift_fun x1)) (fun x1 : FMd => @Refl (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1)) (fun (x1 y0 : FMd) (_ : eqFMd x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0) H0) (fun (x1 y0 z : FMd) (_ : eqFMd x1 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) (_ : eqFMd y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun y0) (FMd_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0) (FMd_lift_fun z) H'1 H'3) (fun x1 y0 : FMd => @ABELIAN_GROUP_com (@module_carrier R Mod) (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 y0 : FMd) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : eqFMd x1 y0) (H1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @MODULE_comp R Mod a b (FMd_lift_fun x1) (FMd_lift_fun y0) H H1) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 : FMd) => @MODULE_dist_r R Mod a b (FMd_lift_fun x1)) (fun (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 y0 : FMd) => @MODULE_dist_l R Mod a (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 : FMd) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod (@ring_mult R a b) (FMd_lift_fun x1)) (@module_mult R Mod a (@module_mult R Mod b (FMd_lift_fun x1))) (@MODULE_assoc R Mod a b (FMd_lift_fun x1))) (fun x1 : FMd => @MODULE_unit_l R Mod (FMd_lift_fun x1)) x0 y H')) FMd_var) x) *) red in |- *. (* Goal: forall x : Carrier V, (let (Carrier, Equal, _) as s return (relation (Carrier s)) := sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) in Equal) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f x) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@comp_hom SET V FMd_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@f2 (@G FMd_set Law Unit Inv eqFMd_law eqFMd_law_assoc eqFMd_law0r eqFMd_inv eqFMd_invr) (abelian_group_group (@module_carrier R Mod)) FMd_lift_fun (fun (x0 y : FMd) (H' : eqFMd x0 y) => @eqFMd_ind (fun x1 y0 : FMd => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (x1 y0 : Carrier V) (H : @Equal V x1 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f f x1 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) f)) (fun (x1 x' y0 y' : FMd) (_ : eqFMd x1 x') (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun x')) (_ : eqFMd y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun y0) (FMd_lift_fun y')) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x1) (FMd_lift_fun x') (FMd_lift_fun y0) (FMd_lift_fun y') H0 H2) (fun x1 y0 z : FMd => @SGROUP_assoc (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x1) (FMd_lift_fun y0) (FMd_lift_fun z)) (fun x1 : FMd => @MONOID_unit_r (group_monoid (abelian_group_group (@module_carrier R Mod))) (FMd_lift_fun x1)) (fun (x1 y0 : FMd) (_ : eqFMd x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @GROUP_comp (abelian_group_group (@module_carrier R Mod)) (FMd_lift_fun x1) (FMd_lift_fun y0) H0) (fun x1 : FMd => @GROUP_inverse_r (abelian_group_group (@module_carrier R Mod)) (FMd_lift_fun x1)) (fun x1 : FMd => @Refl (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1)) (fun (x1 y0 : FMd) (_ : eqFMd x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0) H0) (fun (x1 y0 z : FMd) (_ : eqFMd x1 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) (_ : eqFMd y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun y0) (FMd_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0) (FMd_lift_fun z) H'1 H'3) (fun x1 y0 : FMd => @ABELIAN_GROUP_com (@module_carrier R Mod) (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 y0 : FMd) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : eqFMd x1 y0) (H1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @MODULE_comp R Mod a b (FMd_lift_fun x1) (FMd_lift_fun y0) H H1) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 : FMd) => @MODULE_dist_r R Mod a b (FMd_lift_fun x1)) (fun (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 y0 : FMd) => @MODULE_dist_l R Mod a (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 : FMd) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod (@ring_mult R a b) (FMd_lift_fun x1)) (@module_mult R Mod a (@module_mult R Mod b (FMd_lift_fun x1))) (@MODULE_assoc R Mod a b (FMd_lift_fun x1))) (fun x1 : FMd => @MODULE_unit_l R Mod (FMd_lift_fun x1)) x0 y H')) FMd_var) x) *) simpl in |- *. (* Goal: forall x : Carrier V, (let (Carrier, Equal, _) as s return (relation (Carrier s)) := sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) in Equal) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f x) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f x) *) intros x; try assumption. (* Goal: (let (Carrier, Equal, _) as s return (relation (Carrier s)) := sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) in Equal) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f x) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f x) *) exact (Refl (f x)). Qed. End Universal_prop. End Free_Module_def. Hint Resolve FMd_comp_prop: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Sgroup_cat. (** Title "The category of monoids." *) Section Unit. Variable E : SET. Variable f : law_of_composition E. Variable e : E. Definition unit_r := forall x : E, Equal (f (couple x e)) x. Definition unit_l := forall x : E, Equal (f (couple e x)) x. End Unit. Record monoid_on (A : sgroup) : Type := {monoid_unit : A; monoid_unit_r_prf : unit_r (sgroup_law_map A) monoid_unit; monoid_unit_l_prf : unit_l (sgroup_law_map A) monoid_unit}. Record monoid : Type := {monoid_sgroup :> sgroup; monoid_on_def :> monoid_on monoid_sgroup}. Coercion Build_monoid : monoid_on >-> monoid. Section Hom. Variable E F : monoid. Definition monoid_hom_prop (f : E -> F) := Equal (f (monoid_unit E)) (monoid_unit F). Record monoid_hom : Type := {monoid_sgroup_hom :> sgroup_hom E F; monoid_hom_prf : monoid_hom_prop monoid_sgroup_hom}. End Hom. Definition monoid_hom_comp : forall E F G : monoid, monoid_hom F G -> monoid_hom E F -> monoid_hom E G. (* Goal: forall (E F G : monoid) (_ : monoid_hom F G) (_ : monoid_hom E F), monoid_hom E G *) intros E F G g f; try assumption. apply (Build_monoid_hom (E:=E) (F:=G) (monoid_sgroup_hom:=sgroup_hom_comp g f)). (* Goal: @monoid_hom_prop E G (@Ap (sgroup_set (monoid_sgroup E)) (sgroup_set (monoid_sgroup G)) (@sgroup_map (monoid_sgroup E) (monoid_sgroup G) (@sgroup_hom_comp (monoid_sgroup E) (monoid_sgroup F) (monoid_sgroup G) (@monoid_sgroup_hom F G g) (@monoid_sgroup_hom E F f)))) *) unfold monoid_hom_prop in |- *; auto with algebra. (* Goal: forall (a b c : monoid) (g : Carrier (@subcat_Hom SGROUP monoid monoid_sgroup (fun E F : monoid => @Build_subtype_image (@Hom SGROUP (monoid_sgroup E) (monoid_sgroup F)) (monoid_hom E F) (@monoid_sgroup_hom E F)) b c)) (f : Carrier (@subcat_Hom SGROUP monoid monoid_sgroup (fun E F : monoid => @Build_subtype_image (@Hom SGROUP (monoid_sgroup E) (monoid_sgroup F)) (monoid_hom E F) (@monoid_sgroup_hom E F)) a b)), @Equal (@Hom SGROUP (monoid_sgroup a) (monoid_sgroup c)) (@subtype_image_inj (@Hom SGROUP (monoid_sgroup a) (monoid_sgroup c)) (@Build_subtype_image (@Hom SGROUP (monoid_sgroup a) (monoid_sgroup c)) (monoid_hom a c) (@monoid_sgroup_hom a c)) (@monoid_hom_comp a b c g f)) (@comp_hom SGROUP (monoid_sgroup a) (monoid_sgroup b) (monoid_sgroup c) (@subtype_image_inj (@Hom SGROUP (monoid_sgroup b) (monoid_sgroup c)) (@Build_subtype_image (@Hom SGROUP (monoid_sgroup b) (monoid_sgroup c)) (monoid_hom b c) (@monoid_sgroup_hom b c)) g) (@subtype_image_inj (@Hom SGROUP (monoid_sgroup a) (monoid_sgroup b)) (@Build_subtype_image (@Hom SGROUP (monoid_sgroup a) (monoid_sgroup b)) (monoid_hom a b) (@monoid_sgroup_hom a b)) f)) *) simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup G)) (@comp_map_fun (sgroup_set (monoid_sgroup E)) (sgroup_set (monoid_sgroup F)) (sgroup_set (monoid_sgroup G)) (@sgroup_map (monoid_sgroup F) (monoid_sgroup G) (@monoid_sgroup_hom F G g)) (@sgroup_map (monoid_sgroup E) (monoid_sgroup F) (@monoid_sgroup_hom E F f)) (@monoid_unit (monoid_sgroup E) (monoid_on_def E))) (@monoid_unit (monoid_sgroup G) (monoid_on_def G)) *) unfold comp_map_fun in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup G)) (@Ap (sgroup_set (monoid_sgroup F)) (sgroup_set (monoid_sgroup G)) (@sgroup_map (monoid_sgroup F) (monoid_sgroup G) (@monoid_sgroup_hom F G g)) (@Ap (sgroup_set (monoid_sgroup E)) (sgroup_set (monoid_sgroup F)) (@sgroup_map (monoid_sgroup E) (monoid_sgroup F) (@monoid_sgroup_hom E F f)) (@monoid_unit (monoid_sgroup E) (monoid_on_def E)))) (@monoid_unit (monoid_sgroup G) (monoid_on_def G)) *) apply Trans with (Ap (sgroup_map g) (monoid_unit F)); auto with algebra. cut (Equal (Ap (sgroup_map (monoid_sgroup_hom f)) (monoid_unit E)) (monoid_unit F)). (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup a)), @Equal (sgroup_set (monoid_sgroup c)) (@Ap (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup c)) (@comp_map_map (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup b)) (sgroup_set (monoid_sgroup c)) (@sgroup_map (monoid_sgroup b) (monoid_sgroup c) (@monoid_sgroup_hom b c g)) (@sgroup_map (monoid_sgroup a) (monoid_sgroup b) (@monoid_sgroup_hom a b f))) x) (@Ap (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup c)) (@comp_map_map (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup b)) (sgroup_set (monoid_sgroup c)) (@sgroup_map (monoid_sgroup b) (monoid_sgroup c) (@monoid_sgroup_hom b c g)) (@sgroup_map (monoid_sgroup a) (monoid_sgroup b) (@monoid_sgroup_hom a b f))) x) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup F)) (@Ap (sgroup_set (monoid_sgroup E)) (sgroup_set (monoid_sgroup F)) (@sgroup_map (monoid_sgroup E) (monoid_sgroup F) (@monoid_sgroup_hom E F f)) (@monoid_unit (monoid_sgroup E) (monoid_on_def E))) (@monoid_unit (monoid_sgroup F) (monoid_on_def F)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup G)) (@Ap (sgroup_set (monoid_sgroup F)) (sgroup_set (monoid_sgroup G)) (@sgroup_map (monoid_sgroup F) (monoid_sgroup G) (@monoid_sgroup_hom F G g)) (@monoid_unit (monoid_sgroup F) (monoid_on_def F))) (@monoid_unit (monoid_sgroup G) (monoid_on_def G)) *) apply (monoid_hom_prf f). (* Goal: @Equal (sgroup_set (monoid_sgroup G)) (@Ap (sgroup_set (monoid_sgroup F)) (sgroup_set (monoid_sgroup G)) (@sgroup_map (monoid_sgroup F) (monoid_sgroup G) (@monoid_sgroup_hom F G g)) (@monoid_unit (monoid_sgroup F) (monoid_on_def F))) (@monoid_unit (monoid_sgroup G) (monoid_on_def G)) *) apply (monoid_hom_prf g). Defined. Definition monoid_id : forall E : monoid, monoid_hom E E. (* Goal: forall E : monoid, monoid_hom E E *) intros E; try assumption. (* Goal: monoid_hom E E *) apply (Build_monoid_hom (monoid_sgroup_hom:=sgroup_id E)). (* Goal: @Map_eq (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup c)) (@comp_map_map (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup b)) (sgroup_set (monoid_sgroup c)) (@sgroup_map (monoid_sgroup b) (monoid_sgroup c) (@monoid_sgroup_hom b c g)) (@sgroup_map (monoid_sgroup a) (monoid_sgroup b) (@monoid_sgroup_hom a b f))) (@comp_map_map (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup b)) (sgroup_set (monoid_sgroup c)) (@sgroup_map (monoid_sgroup b) (monoid_sgroup c) (@monoid_sgroup_hom b c g)) (@sgroup_map (monoid_sgroup a) (monoid_sgroup b) (@monoid_sgroup_hom a b f))) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup a)), @Equal (sgroup_set (monoid_sgroup c)) (@Ap (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup c)) (@comp_map_map (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup b)) (sgroup_set (monoid_sgroup c)) (@sgroup_map (monoid_sgroup b) (monoid_sgroup c) (@monoid_sgroup_hom b c g)) (@sgroup_map (monoid_sgroup a) (monoid_sgroup b) (@monoid_sgroup_hom a b f))) x) (@Ap (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup c)) (@comp_map_map (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup b)) (sgroup_set (monoid_sgroup c)) (@sgroup_map (monoid_sgroup b) (monoid_sgroup c) (@monoid_sgroup_hom b c g)) (@sgroup_map (monoid_sgroup a) (monoid_sgroup b) (@monoid_sgroup_hom a b f))) x) *) simpl in |- *; auto with algebra. Defined. Definition MONOID : category. apply (subcat (C:=SGROUP) (C':=monoid) (i:=monoid_sgroup) (homC':=fun E F : monoid => Build_subtype_image (E:=Hom (c:=SGROUP) E F) (subtype_image_carrier:=monoid_hom E F) (monoid_sgroup_hom (E:=E) (F:=F))) (CompC':=monoid_hom_comp) (idC':=monoid_id)). (* Goal: forall (a b c : monoid) (g : Carrier (@subcat_Hom SGROUP monoid monoid_sgroup (fun E F : monoid => @Build_subtype_image (@Hom SGROUP (monoid_sgroup E) (monoid_sgroup F)) (monoid_hom E F) (@monoid_sgroup_hom E F)) b c)) (f : Carrier (@subcat_Hom SGROUP monoid monoid_sgroup (fun E F : monoid => @Build_subtype_image (@Hom SGROUP (monoid_sgroup E) (monoid_sgroup F)) (monoid_hom E F) (@monoid_sgroup_hom E F)) a b)), @Equal (@Hom SGROUP (monoid_sgroup a) (monoid_sgroup c)) (@subtype_image_inj (@Hom SGROUP (monoid_sgroup a) (monoid_sgroup c)) (@Build_subtype_image (@Hom SGROUP (monoid_sgroup a) (monoid_sgroup c)) (monoid_hom a c) (@monoid_sgroup_hom a c)) (@monoid_hom_comp a b c g f)) (@comp_hom SGROUP (monoid_sgroup a) (monoid_sgroup b) (monoid_sgroup c) (@subtype_image_inj (@Hom SGROUP (monoid_sgroup b) (monoid_sgroup c)) (@Build_subtype_image (@Hom SGROUP (monoid_sgroup b) (monoid_sgroup c)) (monoid_hom b c) (@monoid_sgroup_hom b c)) g) (@subtype_image_inj (@Hom SGROUP (monoid_sgroup a) (monoid_sgroup b)) (@Build_subtype_image (@Hom SGROUP (monoid_sgroup a) (monoid_sgroup b)) (monoid_hom a b) (@monoid_sgroup_hom a b)) f)) *) simpl in |- *. (* Goal: forall a : monoid, @Map_eq (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup a)) (Id (sgroup_set (monoid_sgroup a))) (Id (sgroup_set (monoid_sgroup a))) *) (* Goal: forall (a b c : monoid) (g : Carrier (@subcat_Hom SGROUP monoid monoid_sgroup (fun E F : monoid => @Build_subtype_image (@Hom SGROUP (monoid_sgroup E) (monoid_sgroup F)) (monoid_hom E F) (@monoid_sgroup_hom E F)) b c)) (f : Carrier (@subcat_Hom SGROUP monoid monoid_sgroup (fun E F : monoid => @Build_subtype_image (@Hom SGROUP (monoid_sgroup E) (monoid_sgroup F)) (monoid_hom E F) (@monoid_sgroup_hom E F)) a b)), @Equal (@Hom SGROUP (monoid_sgroup a) (monoid_sgroup c)) (@subtype_image_inj (@Hom SGROUP (monoid_sgroup a) (monoid_sgroup c)) (@Build_subtype_image (@Hom SGROUP (monoid_sgroup a) (monoid_sgroup c)) (monoid_hom a c) (@monoid_sgroup_hom a c)) (@monoid_hom_comp a b c g f)) (@comp_hom SGROUP (monoid_sgroup a) (monoid_sgroup b) (monoid_sgroup c) (@subtype_image_inj (@Hom SGROUP (monoid_sgroup b) (monoid_sgroup c)) (@Build_subtype_image (@Hom SGROUP (monoid_sgroup b) (monoid_sgroup c)) (monoid_hom b c) (@monoid_sgroup_hom b c)) g) (@subtype_image_inj (@Hom SGROUP (monoid_sgroup a) (monoid_sgroup b)) (@Build_subtype_image (@Hom SGROUP (monoid_sgroup a) (monoid_sgroup b)) (monoid_hom a b) (@monoid_sgroup_hom a b)) f)) *) intros a; try assumption. (* Goal: @Map_eq (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup c)) (@comp_map_map (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup b)) (sgroup_set (monoid_sgroup c)) (@sgroup_map (monoid_sgroup b) (monoid_sgroup c) (@monoid_sgroup_hom b c g)) (@sgroup_map (monoid_sgroup a) (monoid_sgroup b) (@monoid_sgroup_hom a b f))) (@comp_map_map (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup b)) (sgroup_set (monoid_sgroup c)) (@sgroup_map (monoid_sgroup b) (monoid_sgroup c) (@monoid_sgroup_hom b c g)) (@sgroup_map (monoid_sgroup a) (monoid_sgroup b) (@monoid_sgroup_hom a b f))) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup a)), @Equal (sgroup_set (monoid_sgroup c)) (@Ap (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup c)) (@comp_map_map (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup b)) (sgroup_set (monoid_sgroup c)) (@sgroup_map (monoid_sgroup b) (monoid_sgroup c) (@monoid_sgroup_hom b c g)) (@sgroup_map (monoid_sgroup a) (monoid_sgroup b) (@monoid_sgroup_hom a b f))) x) (@Ap (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup c)) (@comp_map_map (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup b)) (sgroup_set (monoid_sgroup c)) (@sgroup_map (monoid_sgroup b) (monoid_sgroup c) (@monoid_sgroup_hom b c g)) (@sgroup_map (monoid_sgroup a) (monoid_sgroup b) (@monoid_sgroup_hom a b f))) x) *) auto with algebra. (* Goal: forall (a b c : monoid) (g : Carrier (@subcat_Hom SGROUP monoid monoid_sgroup (fun E F : monoid => @Build_subtype_image (@Hom SGROUP (monoid_sgroup E) (monoid_sgroup F)) (monoid_hom E F) (@monoid_sgroup_hom E F)) b c)) (f : Carrier (@subcat_Hom SGROUP monoid monoid_sgroup (fun E F : monoid => @Build_subtype_image (@Hom SGROUP (monoid_sgroup E) (monoid_sgroup F)) (monoid_hom E F) (@monoid_sgroup_hom E F)) a b)), @Equal (@Hom SGROUP (monoid_sgroup a) (monoid_sgroup c)) (@subtype_image_inj (@Hom SGROUP (monoid_sgroup a) (monoid_sgroup c)) (@Build_subtype_image (@Hom SGROUP (monoid_sgroup a) (monoid_sgroup c)) (monoid_hom a c) (@monoid_sgroup_hom a c)) (@monoid_hom_comp a b c g f)) (@comp_hom SGROUP (monoid_sgroup a) (monoid_sgroup b) (monoid_sgroup c) (@subtype_image_inj (@Hom SGROUP (monoid_sgroup b) (monoid_sgroup c)) (@Build_subtype_image (@Hom SGROUP (monoid_sgroup b) (monoid_sgroup c)) (monoid_hom b c) (@monoid_sgroup_hom b c)) g) (@subtype_image_inj (@Hom SGROUP (monoid_sgroup a) (monoid_sgroup b)) (@Build_subtype_image (@Hom SGROUP (monoid_sgroup a) (monoid_sgroup b)) (monoid_hom a b) (@monoid_sgroup_hom a b)) f)) *) simpl in |- *. (* Goal: forall (a b c : monoid) (g : monoid_hom b c) (f : monoid_hom a b), @Map_eq (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup c)) (@comp_map_map (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup b)) (sgroup_set (monoid_sgroup c)) (@sgroup_map (monoid_sgroup b) (monoid_sgroup c) (@monoid_sgroup_hom b c g)) (@sgroup_map (monoid_sgroup a) (monoid_sgroup b) (@monoid_sgroup_hom a b f))) (@comp_map_map (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup b)) (sgroup_set (monoid_sgroup c)) (@sgroup_map (monoid_sgroup b) (monoid_sgroup c) (@monoid_sgroup_hom b c g)) (@sgroup_map (monoid_sgroup a) (monoid_sgroup b) (@monoid_sgroup_hom a b f))) *) intros a b c g f; try assumption. (* Goal: @Map_eq (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup c)) (@comp_map_map (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup b)) (sgroup_set (monoid_sgroup c)) (@sgroup_map (monoid_sgroup b) (monoid_sgroup c) (@monoid_sgroup_hom b c g)) (@sgroup_map (monoid_sgroup a) (monoid_sgroup b) (@monoid_sgroup_hom a b f))) (@comp_map_map (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup b)) (sgroup_set (monoid_sgroup c)) (@sgroup_map (monoid_sgroup b) (monoid_sgroup c) (@monoid_sgroup_hom b c g)) (@sgroup_map (monoid_sgroup a) (monoid_sgroup b) (@monoid_sgroup_hom a b f))) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup a)), @Equal (sgroup_set (monoid_sgroup c)) (@Ap (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup c)) (@comp_map_map (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup b)) (sgroup_set (monoid_sgroup c)) (@sgroup_map (monoid_sgroup b) (monoid_sgroup c) (@monoid_sgroup_hom b c g)) (@sgroup_map (monoid_sgroup a) (monoid_sgroup b) (@monoid_sgroup_hom a b f))) x) (@Ap (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup c)) (@comp_map_map (sgroup_set (monoid_sgroup a)) (sgroup_set (monoid_sgroup b)) (sgroup_set (monoid_sgroup c)) (@sgroup_map (monoid_sgroup b) (monoid_sgroup c) (@monoid_sgroup_hom b c g)) (@sgroup_map (monoid_sgroup a) (monoid_sgroup b) (@monoid_sgroup_hom a b f))) x) *) auto with algebra. Defined.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Categories. (** Title "The category of sets." *) Section Def. Lemma comp_map_map_compatible : forall E F G : Setoid, fun2_compatible (comp_map_map (E:=E) (F:=F) (G:=G)). (* Goal: forall E F G : Setoid, @fun2_compatible (MAP F G) (MAP E F) (MAP E G) (@comp_map_map E F G) *) intros E F G; red in |- *. (* Goal: forall (x x' : Carrier (MAP F G)) (y y' : Carrier (MAP E F)) (_ : @Equal (MAP F G) x x') (_ : @Equal (MAP E F) y y'), @Equal (MAP E G) (@comp_map_map E F G x y) (@comp_map_map E F G x' y') *) auto with algebra. Qed. Definition SET : category. apply (Build_category (Ob:=Setoid) (Hom:=MAP) (Hom_comp:=fun E F G : Setoid => uncurry (comp_map_map_compatible (E:=E) (F:=F) (G:=G))) (Hom_id:=Id)); red in |- *; simpl in |- *; unfold Map_eq in |- *; (* Goal: forall (x x' : Carrier (MAP F G)) (y y' : Carrier (MAP E F)) (_ : @Equal (MAP F G) x x') (_ : @Equal (MAP E F) y y'), @Equal (MAP E G) (@comp_map_map E F G x y) (@comp_map_map E F G x' y') *) auto with algebra. Defined. End Def.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Fpart2. Section tiroirs_def. Variable E F : Setoid. Variable f : MAP E F. Lemma diff_add_part2 : forall (E : Setoid) (A : part_set E) (x : E), in_part x A -> Equal A (add_part (diff A (single x)) x). (* Goal: forall (E : Setoid) (A : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x A), @Equal (part_set E) A (@add_part E (@diff E A (@single E x)) x) *) intros E0 A x H'; try assumption. (* Goal: @Equal (part_set E0) A (@add_part E0 (@diff E0 A (@single E0 x)) x) *) apply in_eq_part. (* Goal: forall (x0 : Carrier E0) (_ : @in_part E0 x0 (@add_part E0 (@diff E0 A (@single E0 x)) x)), @in_part E0 x0 A *) intros x0 H'0; try assumption. (* Goal: @in_part E0 x0 A *) elim (classic (Equal x x0)); intros. (* Goal: @in_part E x1 (@single E x) *) (* Goal: not (@in_part E x1 (@single E x)) *) (* Goal: @Equal F (@Ap E F f x) (@Ap E F f x1) *) (* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *) apply in_part_trans_eq with x; auto with *. (* Goal: @in_part E0 x0 A *) cut (in_part x0 (diff A (single x))). (* Goal: forall _ : @in_part E0 x0 (@diff E0 A (@single E0 x)), @in_part E0 x0 (@add_part E0 (@diff E0 A (@single E0 x)) x) *) (* Goal: @in_part E0 x0 (@diff E0 A (@single E0 x)) *) (* Goal: forall (x0 : Carrier E0) (_ : @in_part E0 x0 (@add_part E0 (@diff E0 A (@single E0 x)) x)), @in_part E0 x0 A *) unfold add_part in |- *; auto with *. (* Goal: @in_part E0 x0 (@diff E0 A (@single E0 x)) *) (* Goal: forall (x0 : Carrier E0) (_ : @in_part E0 x0 (@add_part E0 (@diff E0 A (@single E0 x)) x)), @in_part E0 x0 A *) apply in_diff; auto with *. (* Goal: forall (x0 : Carrier E0) (_ : @in_part E0 x0 (@add_part E0 (@diff E0 A (@single E0 x)) x)), @in_part E0 x0 A *) intros x0 H'0; try assumption. (* Goal: @in_part E0 x0 A *) elim (classic (Equal x x0)); intros. (* Goal: @in_part E x1 (@single E x) *) (* Goal: not (@in_part E x1 (@single E x)) *) (* Goal: @Equal F (@Ap E F f x) (@Ap E F f x1) *) (* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *) apply in_part_trans_eq with x; auto with *. (* Goal: @in_part E0 x0 A *) cut (in_part x0 (diff A (single x))). (* Goal: forall _ : @in_part E0 x0 (@diff E0 A (@single E0 x)), @in_part E0 x0 A *) (* Goal: @in_part E0 x0 (@diff E0 A (@single E0 x)) *) intros H'1; try assumption. (* Goal: @in_part E0 x0 A *) (* Goal: @in_part E0 x0 (@diff E0 A (@single E0 x)) *) apply diff_in_l with (single x). (* Goal: @eq nat (S n2) (S n2) *) auto with *. (* Goal: @in_part E0 x0 (@diff E0 A (@single E0 x)) *) unfold add_part in H'0. (* Goal: @in_part E0 x0 (@diff E0 A (@single E0 x)) *) elim (in_part_union H'0); intros. (* Goal: @eq nat (S n2) (S n2) *) auto with *. (* Goal: @eq nat (S n2) (S n2) *) absurd (Equal x x0); auto with *. Qed. Hint Resolve diff_add_part2: algebra. Lemma cardinal_minus_part : forall (B : part_set F) (x : F) (n : nat), cardinal B (S n) -> in_part x B -> cardinal (diff B (single x)) n. (* Goal: forall (B : Carrier (part_set F)) (x : Carrier F) (n : nat) (_ : @cardinal F B (S n)) (_ : @in_part F x B), @cardinal F (@diff F B (@single F x)) n *) intros B x n H' H'0; try assumption. (* Goal: @eq nat (S n2) (S n2) *) apply cardinal_S with B x; auto with *. (* Goal: not (@in_part F (@Ap E F f x1) (@single F (@Ap E F f x))) *) (* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *) unfold not in |- *; intros. (* Goal: False *) cut (~ in_part x (single x)). (* Goal: @eq nat (S n2) (S n2) *) unfold not in |- *; auto with *. (* Goal: @eq nat (S n2) (S n2) *) apply diff_in_r with B; auto with *. Qed. Hint Resolve cardinal_minus_part: algebra. Lemma tiroirs : forall (n : nat) (Chaussettes : part_set E), cardinal Chaussettes n -> forall (m : nat) (Tiroirs : part_set F), cardinal Tiroirs m -> m < n -> (forall x : E, in_part x Chaussettes -> in_part (f x) Tiroirs) -> exists x : E, (exists y : E, ~ Equal x y /\ Equal (f x) (f y)). (* Goal: forall (n : nat) (Chaussettes : Carrier (part_set E)) (_ : @cardinal E Chaussettes n) (m : nat) (Tiroirs : Carrier (part_set F)) (_ : @cardinal F Tiroirs m) (_ : lt m n) (_ : forall (x : Carrier E) (_ : @in_part E x Chaussettes), @in_part F (@Ap E F f x) Tiroirs), @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))) *) simple induction n. (* Goal: forall (Chaussettes : Carrier (part_set E)) (_ : @cardinal E Chaussettes O) (m : nat) (Tiroirs : Carrier (part_set F)) (_ : @cardinal F Tiroirs m) (_ : lt m O) (_ : forall (x : Carrier E) (_ : @in_part E x Chaussettes), @in_part F (@Ap E F f x) Tiroirs), @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))) *) (* Goal: forall (n : nat) (_ : forall (Chaussettes : Carrier (part_set E)) (_ : @cardinal E Chaussettes n) (m : nat) (Tiroirs : Carrier (part_set F)) (_ : @cardinal F Tiroirs m) (_ : lt m n) (_ : forall (x : Carrier E) (_ : @in_part E x Chaussettes), @in_part F (@Ap E F f x) Tiroirs), @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y))))) (Chaussettes : Carrier (part_set E)) (_ : @cardinal E Chaussettes (S n)) (m : nat) (Tiroirs : Carrier (part_set F)) (_ : @cardinal F Tiroirs m) (_ : lt m (S n)) (_ : forall (x : Carrier E) (_ : @in_part E x Chaussettes), @in_part F (@Ap E F f x) Tiroirs), @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))) *) intros Chaussettes H' m Tiroirs H'0 H'1; try assumption. (* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *) inversion H'1. (* Goal: forall (n : nat) (_ : forall (Chaussettes : Carrier (part_set E)) (_ : @cardinal E Chaussettes n) (m : nat) (Tiroirs : Carrier (part_set F)) (_ : @cardinal F Tiroirs m) (_ : lt m n) (_ : forall (x : Carrier E) (_ : @in_part E x Chaussettes), @in_part F (@Ap E F f x) Tiroirs), @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y))))) (Chaussettes : Carrier (part_set E)) (_ : @cardinal E Chaussettes (S n)) (m : nat) (Tiroirs : Carrier (part_set F)) (_ : @cardinal F Tiroirs m) (_ : lt m (S n)) (_ : forall (x : Carrier E) (_ : @in_part E x Chaussettes), @in_part F (@Ap E F f x) Tiroirs), @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))) *) intros n0 H' Chaussettes H'0 m Tiroirs H'1 H'2 H'3; try assumption. (* Goal: @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))) *) inversion H'0. elim (classic (ex (fun y : E => ~ Equal x y /\ Equal (Ap f x) (Ap f y)))); intros. (* Goal: @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))) *) (* Goal: @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))) *) exists x; try assumption. (* Goal: @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))) *) cut (exists m0 : nat, m = S m0). (* Goal: forall _ : @in_part F (@Ap E F f x) Tiroirs, @ex nat (fun m0 : nat => @eq nat O (S m0)) *) (* Goal: @in_part F (@Ap E F f x) Tiroirs *) (* Goal: @ex nat (fun m0 : nat => @eq nat (S n2) (S m0)) *) intros H'4; try assumption. (* Goal: @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))) *) (* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *) case H'4; clear H'4; intros. (* Goal: @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))) *) (* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *) apply H' with (diff Chaussettes (single x)) x0 (diff Tiroirs (single (f x))). (* Goal: @cardinal E (@diff E Chaussettes (@single E x)) n0 *) (* Goal: @cardinal F (@diff F Tiroirs (@single F (@Ap E F f x))) x0 *) (* Goal: lt x0 n0 *) (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (@diff E Chaussettes (@single E x))), @in_part F (@Ap E F f x0) (@diff F Tiroirs (@single F (@Ap E F f x))) *) (* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *) apply cardinal_S with Chaussettes x. (* Goal: not (@in_part F (@Ap E F f x1) (@single F (@Ap E F f x))) *) (* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *) unfold not in |- *; intros. (* Goal: @eq nat (S n2) (S n2) *) absurd (~ in_part x (single x)); auto with *. (* Goal: @eq nat (S n2) (S n2) *) apply diff_in_r with Chaussettes; auto with *. (* Goal: @eq nat (S n2) (S n2) *) auto with *. (* Goal: @Equal (part_set E) Chaussettes (@add_part E (@diff E Chaussettes (@single E x)) x) *) (* Goal: @cardinal E Chaussettes (S n0) *) (* Goal: @cardinal F (@diff F Tiroirs (@single F (@Ap E F f x))) x0 *) (* Goal: lt x0 n0 *) (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (@diff E Chaussettes (@single E x))), @in_part F (@Ap E F f x0) (@diff F Tiroirs (@single F (@Ap E F f x))) *) (* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *) apply diff_add_part2. (* Goal: @eq nat (S n2) (S n2) *) apply in_part_comp_r with (add_part B x); auto with *. (* Goal: @eq nat (S n2) (S n2) *) auto with *. (* Goal: @cardinal F (@diff F Tiroirs (@single F (@Ap E F f x))) x0 *) (* Goal: lt x0 n0 *) (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (@diff E Chaussettes (@single E x))), @in_part F (@Ap E F f x0) (@diff F Tiroirs (@single F (@Ap E F f x))) *) (* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *) apply cardinal_minus_part. (* Goal: @eq nat (S n2) (S n2) *) rewrite <- H5; auto with *. (* Goal: @eq nat (S n2) (S n2) *) apply H'3; auto with *. (* Goal: @in_part E x Chaussettes *) (* Goal: lt x0 n0 *) (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (@diff E Chaussettes (@single E x))), @in_part F (@Ap E F f x0) (@diff F Tiroirs (@single F (@Ap E F f x))) *) (* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *) apply in_part_comp_r with (add_part B x). (* Goal: @eq nat (S n2) (S n2) *) auto with *. (* Goal: @eq nat (S n2) (S n2) *) auto with *. (* Goal: @eq nat (S n2) (S n2) *) rewrite H5 in H'2; auto with *. (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (@diff E Chaussettes (@single E x))), @in_part F (@Ap E F f x0) (@diff F Tiroirs (@single F (@Ap E F f x))) *) (* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *) intros x1 H'4; try assumption. (* Goal: @in_part F (@Ap E F f x1) (@diff F Tiroirs (@single F (@Ap E F f x))) *) (* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *) apply in_diff. (* Goal: @eq nat (S n2) (S n2) *) apply H'3; auto with *. (* Goal: @eq nat (S n2) (S n2) *) apply diff_in_l with (single x); auto with *. (* Goal: not (@in_part F (@Ap E F f x1) (@single F (@Ap E F f x))) *) (* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *) unfold not in |- *; intros. (* Goal: False *) (* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *) unfold not in H4. (* Goal: False *) (* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *) apply H4. (* Goal: @ex (Carrier E) (fun y : Carrier E => and (forall _ : @Equal E x y, False) (@Equal F (@Ap E F f x) (@Ap E F f y))) *) (* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *) exists x1; try assumption. (* Goal: and (forall _ : @Equal E x x1, False) (@Equal F (@Ap E F f x) (@Ap E F f x1)) *) (* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *) split. (* Goal: forall _ : @Equal E x x1, False *) (* Goal: @Equal F (@Ap E F f x) (@Ap E F f x1) *) (* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *) intros H'5; try assumption. (* Goal: False *) (* Goal: @Equal F (@Ap E F f x) (@Ap E F f x1) *) (* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *) cut (~ in_part x1 (single x)). (* Goal: forall _ : not (@in_part E x1 (@single E x)), False *) (* Goal: not (@in_part E x1 (@single E x)) *) (* Goal: @Equal F (@Ap E F f x) (@Ap E F f x1) *) (* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *) intro. (* Goal: False *) (* Goal: not (@in_part E x1 (@single E x)) *) (* Goal: @Equal F (@Ap E F f x) (@Ap E F f x1) *) (* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *) apply H7. (* Goal: @in_part E x1 (@single E x) *) (* Goal: not (@in_part E x1 (@single E x)) *) (* Goal: @Equal F (@Ap E F f x) (@Ap E F f x1) *) (* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *) apply in_part_trans_eq with x; auto with *. (* Goal: @eq nat (S n2) (S n2) *) apply diff_in_r with Chaussettes; auto with *. (* Goal: @eq nat (S n2) (S n2) *) auto with *. (* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *) inversion H'1. (* Goal: @ex nat (fun m0 : nat => @eq nat O (S m0)) *) (* Goal: @ex nat (fun m0 : nat => @eq nat (S n2) (S m0)) *) cut (in_part (f x) Tiroirs). (* Goal: forall _ : @in_part F (@Ap E F f x) Tiroirs, @ex nat (fun m0 : nat => @eq nat O (S m0)) *) (* Goal: @in_part F (@Ap E F f x) Tiroirs *) (* Goal: @ex nat (fun m0 : nat => @eq nat (S n2) (S m0)) *) intros H'4; try assumption. (* Goal: @eq nat (S n2) (S n2) *) absurd (in_part (f x) (empty F)); auto with *. (* Goal: @eq nat (S n2) (S n2) *) apply in_part_comp_r with Tiroirs; auto with *. (* Goal: @in_part F (@Ap E F f x) Tiroirs *) (* Goal: @ex nat (fun m0 : nat => @eq nat (S n2) (S m0)) *) apply H'3. (* Goal: @eq nat (S n2) (S n2) *) apply in_part_comp_r with (add_part B x); auto with *. (* Goal: @ex nat (fun m0 : nat => @eq nat (S n2) (S m0)) *) exists n2; try assumption. (* Goal: @eq nat (S n2) (S n2) *) auto with *. Qed. End tiroirs_def.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Integral_domain_cat. Require Export Ring_facts. Require Export Classical_Prop. (** Title "Basic properties of integral domains." *) Section Lemmas. Variable R : INTEGRAL_DOMAIN. Lemma INTEGRAL_DOMAIN_prop_rev : forall x y : R, ~ Equal x (monoid_unit R) -> ~ Equal y (monoid_unit R) -> ~ Equal (ring_mult x y) (monoid_unit R). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) *) exact (idomain_prf R). Qed. Lemma INTEGRAL_DOMAIN_prop : forall x y : R, Equal (ring_mult x y) (monoid_unit R) -> Equal x (monoid_unit R) \/ Equal y (monoid_unit R). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))), or (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) *) intros x y H'; try assumption. (* Goal: or (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) *) generalize (INTEGRAL_DOMAIN_prop_rev (x:=x) (y:=y)). (* Goal: forall _ : forall (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))), or (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) *) apply NNPP; tauto. Qed. Lemma INTEGRAL_DOMAIN_mult_l : forall x y : R, ~ Equal (ring_mult x y) (monoid_unit R) -> ~ Equal x (monoid_unit R). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) *) unfold not in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) intros x y H' H'0; try assumption. (* Goal: False *) absurd (Equal (ring_mult x y) (monoid_unit R)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) apply Trans with (ring_mult (monoid_unit R) y); auto with algebra. Qed. Lemma INTEGRAL_DOMAIN_mult_r : forall x y : R, ~ Equal (ring_mult x y) (monoid_unit R) -> ~ Equal y (monoid_unit R). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) *) unfold not in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) intros x y H' H'0; try assumption. (* Goal: False *) absurd (Equal (ring_mult x y) (monoid_unit R)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) apply Trans with (ring_mult x (monoid_unit R)); auto with algebra. Qed. Lemma INTEGRAL_DOMAIN_mult_n0_r : forall x y : R, Equal (ring_mult x y) (monoid_unit R) -> ~ Equal y (monoid_unit R) -> Equal x (monoid_unit R). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) intros x y H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) intuition. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) elim (INTEGRAL_DOMAIN_prop (x:=x) (y:=y)); auto with algebra. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))), or (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x y) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) z (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) intros H'1; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) absurd (Equal y (monoid_unit R)); auto with algebra. Qed. Lemma INTEGRAL_DOMAIN_mult_n0_l : forall x y : R, Equal (ring_mult x y) (monoid_unit R) -> ~ Equal x (monoid_unit R) -> Equal y (monoid_unit R). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) intros x y H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) elim (INTEGRAL_DOMAIN_prop (x:=x) (y:=y)); auto with algebra. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))), or (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x y) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) z (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) intros H'1; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) absurd (Equal x (monoid_unit R)); auto with algebra. Qed. Hint Resolve INTEGRAL_DOMAIN_prop INTEGRAL_DOMAIN_prop_rev INTEGRAL_DOMAIN_mult_l INTEGRAL_DOMAIN_mult_r INTEGRAL_DOMAIN_mult_n0_l INTEGRAL_DOMAIN_mult_n0_r: algebra. Lemma INTEGRAL_DOMAIN_simpl_r : forall x y z : R, ~ Equal z (monoid_unit R) -> Equal (ring_mult x z) (ring_mult y z) -> Equal x y. (* Goal: forall (x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) z (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z x) (@ring_mult (cring_ring (idomain_ring R)) z y)), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x y *) intros x y z H' H'0; try assumption. cut (Equal (ring_mult (sgroup_law R x (group_inverse R y)) z) (monoid_unit R)). (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))), or (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x y) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) z (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) intros H'1; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x y *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) cut (Equal (sgroup_law R x (group_inverse R y)) (monoid_unit R)). (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x y *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) intros H'2; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x y *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) apply GROUP_reg_right with (group_inverse R y); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) y (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) apply Trans with (monoid_unit R); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y)) z) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) apply INTEGRAL_DOMAIN_mult_n0_r with z; auto with algebra. apply Trans with (sgroup_law R (ring_mult x z) (ring_mult (group_inverse R y) z)); auto with algebra. apply Trans with (sgroup_law R (ring_mult x z) (group_inverse R (ring_mult y z))); auto with algebra. apply Trans with (sgroup_law R (ring_mult x z) (group_inverse R (ring_mult x z))); auto with algebra. Qed. Lemma INTEGRAL_DOMAIN_simpl_l : forall x y z : R, ~ Equal z (monoid_unit R) -> Equal (ring_mult z x) (ring_mult z y) -> Equal x y. (* Goal: forall (x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) z (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z x) (@ring_mult (cring_ring (idomain_ring R)) z y)), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x y *) intros x y z H' H'0; try assumption. cut (Equal (ring_mult z (sgroup_law R x (group_inverse R y))) (monoid_unit R)). (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))), or (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x y) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) z (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) intros H'1; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x y *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) cut (Equal (sgroup_law R x (group_inverse R y)) (monoid_unit R)). (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x y *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) intros H'2; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x y *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) apply GROUP_reg_right with (group_inverse R y); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) y (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) apply Trans with (monoid_unit R); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) apply INTEGRAL_DOMAIN_mult_n0_l with z; auto with algebra. apply Trans with (sgroup_law R (ring_mult z x) (ring_mult z (group_inverse R y))); auto with algebra. apply Trans with (sgroup_law R (ring_mult z x) (group_inverse R (ring_mult z y))); auto with algebra. apply Trans with (sgroup_law R (ring_mult z x) (group_inverse R (ring_mult z x))); auto with algebra. Qed. Lemma INTEGRAL_DOMAIN_mult_eq_r : forall x y z : R, Equal (ring_mult x z) (ring_mult y z) -> Equal x y \/ Equal z (monoid_unit R). (* Goal: forall (x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z x) (@ring_mult (cring_ring (idomain_ring R)) z y)), or (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x y) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) z (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) *) intros x y z H'; try assumption. cut (Equal (ring_mult (sgroup_law R x (group_inverse R y)) z) (monoid_unit R)). (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))), or (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x y) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) z (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) intros H'0; try assumption. elim (INTEGRAL_DOMAIN_prop (x:=sgroup_law R x (group_inverse R y)) (y:=z)); auto with algebra. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))), or (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x y) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) z (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) intros H'1; try assumption. (* Goal: or (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x y) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) z (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) left; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x y *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) apply GROUP_reg_right with (group_inverse R y); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) y (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) apply Trans with (monoid_unit R); auto with algebra. apply Trans with (sgroup_law R (ring_mult x z) (ring_mult (group_inverse R y) z)); auto with algebra. apply Trans with (sgroup_law R (ring_mult x z) (group_inverse R (ring_mult y z))); auto with algebra. apply Trans with (sgroup_law R (ring_mult x z) (group_inverse R (ring_mult x z))); auto with algebra. Qed. Lemma INTEGRAL_DOMAIN_mult_eq_l : forall x y z : R, Equal (ring_mult z x) (ring_mult z y) -> Equal x y \/ Equal z (monoid_unit R). (* Goal: forall (x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z x) (@ring_mult (cring_ring (idomain_ring R)) z y)), or (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x y) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) z (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) *) intros x y z H'; try assumption. cut (Equal (ring_mult z (sgroup_law R x (group_inverse R y))) (monoid_unit R)). (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))), or (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x y) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) z (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) intros H'0; try assumption. elim (INTEGRAL_DOMAIN_prop (x:=z) (y:=sgroup_law R x (group_inverse R y))); auto with algebra. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))), or (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x y) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) z (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) intros H'1; try assumption. (* Goal: or (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x y) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) z (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) left; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) x y *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) apply GROUP_reg_right with (group_inverse R y); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) y (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) z (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) x (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) apply Trans with (monoid_unit R); auto with algebra. apply Trans with (sgroup_law R (ring_mult z x) (ring_mult z (group_inverse R y))); auto with algebra. apply Trans with (sgroup_law R (ring_mult z x) (group_inverse R (ring_mult z y))); auto with algebra. apply Trans with (sgroup_law R (ring_mult z x) (group_inverse R (ring_mult z x))); auto with algebra. Qed. End Lemmas. Hint Resolve INTEGRAL_DOMAIN_prop INTEGRAL_DOMAIN_prop_rev INTEGRAL_DOMAIN_mult_l INTEGRAL_DOMAIN_mult_r INTEGRAL_DOMAIN_mult_n0_l INTEGRAL_DOMAIN_mult_n0_r: algebra. Hint Resolve INTEGRAL_DOMAIN_simpl_r INTEGRAL_DOMAIN_simpl_l: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Field_cat. Require Export Ring_facts. (** Title "Basic properties of fields." *) Section Lemmas1. Variable K : FIELD. Definition field_inverse (x : K) : K := Ap (field_inverse_map K) x. Definition field_div (x y : K) : K := ring_mult x (field_inverse y). Lemma FIELD_inverse_r : forall x : K, ~ Equal x (monoid_unit K) -> Equal (ring_mult x (field_inverse x)) (ring_unit K). (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (field_inverse x)) (ring_unit (field_ring K)) *) exact (field_inverse_r_prf K). Qed. Lemma FIELD_inverse_l : forall x : K, ~ Equal x (monoid_unit K) -> Equal (ring_mult (field_inverse x) x) (ring_unit K). (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (field_inverse x) x) (ring_unit (field_ring K)) *) exact (field_inverse_l_prf K). Qed. Lemma FIELD_unit_non_zero : ~ Equal (ring_unit K) (monoid_unit K). (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (ring_unit (field_ring K)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K))))))) *) exact (field_unit_non_zero K). Qed. Lemma FIELD_comp : forall x x' : K, Equal x x' -> Equal (field_inverse x) (field_inverse x'). (* Goal: forall (x x' : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x x'), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse x) (field_inverse x') *) unfold field_inverse in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) auto with algebra. Qed. Hint Resolve FIELD_comp FIELD_inverse_r FIELD_inverse_l FIELD_unit_non_zero: algebra. Lemma FIELD_unit_inverse : Equal (field_inverse (ring_unit K)) (ring_unit K). apply Trans with (ring_mult (field_inverse (ring_unit K)) (ring_unit K)); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) auto with algebra. Qed. Hint Resolve FIELD_unit_inverse: algebra. Lemma FIELD_reg_left : forall x y z : K, ~ Equal x (monoid_unit K) -> Equal (ring_mult x y) (ring_mult x z) -> Equal y z. (* Goal: forall (x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) z (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x (field_inverse y)) (field_inverse z)) (@ring_mult (field_ring K) x (field_inverse (@ring_mult (field_ring K) z y))) *) intros x y z H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y z *) apply Trans with (ring_mult (ring_unit K) y). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (ring_unit (field_ring K)) y) z *) apply Trans with (ring_mult (ring_mult (field_inverse x) x) y). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) apply Sym; auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) (field_inverse x) x) y) z *) apply Trans with (ring_mult (field_inverse x) (ring_mult x y)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (field_inverse x) (@ring_mult (field_ring K) x y)) z *) apply Trans with (ring_mult (field_inverse x) (ring_mult x z)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (field_inverse x) (@ring_mult (field_ring K) x z)) z *) apply Trans with (ring_mult (ring_mult (field_inverse x) x) z). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) apply Trans with (ring_mult (ring_unit K) z); auto with algebra. Qed. Lemma FIELD_reg_right : forall x y z : K, ~ Equal x (monoid_unit K) -> Equal (ring_mult y x) (ring_mult z x) -> Equal y z. (* Goal: forall (x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) z (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x (field_inverse y)) (field_inverse z)) (@ring_mult (field_ring K) x (field_inverse (@ring_mult (field_ring K) z y))) *) intros x y z H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y z *) apply Trans with (ring_mult y (ring_unit K)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) y (ring_unit (field_ring K))) z *) apply Trans with (ring_mult y (ring_mult x (field_inverse x))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) apply Sym; auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) y (@ring_mult (field_ring K) x (field_inverse x))) z *) apply Trans with (ring_mult (ring_mult y x) (field_inverse x)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) y x) (field_inverse x)) z *) apply Trans with (ring_mult (ring_mult z x) (field_inverse x)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) z x) (field_inverse x)) z *) apply Trans with (ring_mult z (ring_mult x (field_inverse x))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) z (@ring_mult (field_ring K) x (field_inverse x))) z *) apply Trans with (ring_mult z (ring_unit K)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) auto with algebra. Qed. Lemma FIELD_inverse_non_zero : forall x : K, ~ Equal x (monoid_unit K) -> ~ Equal (field_inverse x) (monoid_unit K). (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K))))))) *) intuition. (* Goal: False *) apply FIELD_unit_non_zero. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) apply Trans with (ring_mult (field_inverse x) x:K); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) apply Sym; auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) apply Trans with (ring_mult (monoid_unit K) x:K); auto with algebra. Qed. Hint Resolve FIELD_inverse_non_zero: algebra. Lemma FIELD_inverse_inverse : forall x : K, ~ Equal x (monoid_unit K) -> Equal (field_inverse (field_inverse x)) x. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (field_inverse x)) x *) intros x H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) apply FIELD_reg_right with (field_inverse x); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) apply Trans with (ring_unit K:K); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) apply Sym; auto with algebra. Qed. Hint Resolve FIELD_inverse_inverse: algebra. Lemma FIELD_integral_domain_l : forall x y : K, ~ Equal (ring_mult x y) (monoid_unit K) -> ~ Equal x (monoid_unit K). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K))))))) *) unfold not in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (@ring_mult (field_ring K) x (field_inverse y))) (@ring_mult (field_ring K) y (field_inverse x)) *) intros x y H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) absurd (Equal (ring_mult x y) (monoid_unit K)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) apply Trans with (ring_mult (monoid_unit K) y:K); auto with algebra. Qed. Lemma FIELD_integral_domain_r : forall x y : K, ~ Equal (ring_mult x y) (monoid_unit K) -> ~ Equal y (monoid_unit K). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K))))))) *) unfold not in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (@ring_mult (field_ring K) x (field_inverse y))) (@ring_mult (field_ring K) y (field_inverse x)) *) intros x y H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) absurd (Equal (ring_mult x y) (monoid_unit K)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) apply Trans with (ring_mult x (monoid_unit K):K); auto with algebra. Qed. Lemma FIELD_law_inverse : forall x y : K, Equal (ring_mult x y) (ring_unit K) -> Equal (field_inverse x) y. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x (field_inverse y)) y) x *) intros x y H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse x) y *) apply FIELD_reg_left with x. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) apply FIELD_integral_domain_l with y; auto with algebra. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K))))))) *) intuition. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) absurd (Equal (ring_unit K) (monoid_unit K)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) apply Trans with (ring_mult x y:K); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) apply Trans with (ring_unit K:K); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (field_inverse x)) (ring_unit (field_ring K)) *) apply FIELD_inverse_r. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K))))))) *) intuition. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) absurd (Equal (ring_unit K) (monoid_unit K)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) apply Trans with (ring_mult x y:K); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) apply Trans with (ring_mult (monoid_unit K) y:K); auto with algebra. Qed. Lemma FIELD_inverse_law : forall x y : K, ~ Equal x (monoid_unit K) -> ~ Equal y (monoid_unit K) -> Equal (field_inverse (ring_mult x y)) (ring_mult (field_inverse y) (field_inverse x)). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (@ring_mult (field_ring K) x (field_inverse y))) (@ring_mult (field_ring K) y (field_inverse x)) *) intros x y H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (@ring_mult (field_ring K) x y)) (@ring_mult (field_ring K) (field_inverse y) (field_inverse x)) *) apply FIELD_law_inverse. apply Trans with (ring_mult x (ring_mult y (ring_mult (field_inverse y) (field_inverse x))) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) :K); auto with algebra. apply Trans with (ring_mult x (ring_mult (ring_mult y (field_inverse y)) (field_inverse x)) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) :K); auto with algebra. apply Trans with (ring_mult x (ring_mult (ring_unit K) (field_inverse x)):K); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) apply Trans with (ring_mult x (field_inverse x):K); auto with algebra. Qed. Hint Resolve FIELD_inverse_law: algebra. Lemma FIELD_x_div_x : forall x : K, ~ Equal x (monoid_unit K) -> Equal (field_div x x) (ring_unit K). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) unfold field_div in |- *; auto with algebra. Qed. Hint Resolve FIELD_x_div_x: algebra. Lemma FIELD_simpl_r : forall x y : K, ~ Equal y (monoid_unit K) -> Equal (ring_mult (field_div x y) y) x. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (field_div x y)) (field_div y x) *) unfold field_div in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x (field_inverse y)) y) x *) intros x y H'; try assumption. apply Trans with (ring_mult x (ring_mult (field_inverse y) y):K); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) apply Trans with (ring_mult x (ring_unit K):K); auto with algebra. Qed. Hint Resolve FIELD_simpl_r: algebra. Lemma FIELD_one_div_x : forall x : K, ~ Equal x (monoid_unit K) -> Equal (field_div (ring_unit K) x) (field_inverse x). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) unfold field_div in |- *; auto with algebra. Qed. Hint Resolve FIELD_one_div_x: algebra. Lemma FIELD_one_div_xy : forall x y : K, ~ Equal x (monoid_unit K) -> ~ Equal y (monoid_unit K) -> Equal (field_div (ring_unit K) (ring_mult x y)) (ring_mult (field_div (ring_unit K) y) (field_div (ring_unit K) x)). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (field_div x y)) (field_div y x) *) unfold field_div in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (@ring_mult (field_ring K) x (field_inverse y))) (@ring_mult (field_ring K) y (field_inverse x)) *) intros x y H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) apply Trans with (field_inverse (ring_mult x y):K); auto with algebra. apply Trans with (ring_mult (field_inverse y) (field_inverse x):K); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) auto with algebra. Qed. Hint Resolve FIELD_one_div_xy: algebra. Lemma FIELD_one_div_div : forall x y : K, ~ Equal x (monoid_unit K) -> ~ Equal y (monoid_unit K) -> Equal (field_div (ring_unit K) (field_div x y)) (field_div y x). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (field_div x y)) (field_div y x) *) unfold field_div in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (@ring_mult (field_ring K) x (field_inverse y))) (@ring_mult (field_ring K) y (field_inverse x)) *) intros x y H' H'0; try assumption. apply Trans with (field_inverse (ring_mult x (field_inverse y)):K); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) auto with algebra. apply Trans with (ring_mult (field_inverse (field_inverse y)) (field_inverse x):K); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) auto with algebra. Qed. Hint Resolve FIELD_one_div_div: algebra. Lemma FIELD_div_div : forall x y z : K, ~ Equal y (monoid_unit K) -> ~ Equal z (monoid_unit K) -> Equal (field_div x (field_div y z)) (field_div (ring_mult x z) y). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (field_div x y)) (field_div y x) *) unfold field_div in |- *. (* Goal: forall (x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) z (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x (field_inverse y)) (field_inverse z)) (@ring_mult (field_ring K) x (field_inverse (@ring_mult (field_ring K) z y))) *) intros x y z H' H'0; try assumption. apply Trans with (ring_mult x (ring_mult (field_inverse (field_inverse z)) (field_inverse y)) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) :K); auto with algebra. apply Trans with (ring_mult x (ring_mult z (field_inverse y)):K); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) auto with algebra. Qed. Hint Resolve FIELD_div_div: algebra. Comments "Normalisation.". Lemma FIELD_mult_div_l : forall x y z : K, Equal (ring_mult x (field_div y z)) (field_div (ring_mult x y) z). (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (field_div y z)) (field_div (@ring_mult (field_ring K) x y) z) *) intros x y z; try assumption. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (field_div x y)) (field_div y x) *) unfold field_div in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) auto with algebra. Qed. Hint Resolve FIELD_mult_div_l: algebra. Lemma FIELD_div_div2 : forall x y z : K, ~ Equal y (monoid_unit K) -> ~ Equal z (monoid_unit K) -> Equal (field_div (field_div x y) z) (field_div x (ring_mult z y)). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (field_div x y)) (field_div y x) *) unfold field_div in |- *. (* Goal: forall (x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) z (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x (field_inverse y)) (field_inverse z)) (@ring_mult (field_ring K) x (field_inverse (@ring_mult (field_ring K) z y))) *) intros x y z H' H'0; try assumption. apply Trans with (ring_mult x (ring_mult (field_inverse y) (field_inverse z)):K); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) apply Sym; auto with algebra. Qed. Lemma FIELD_inv_div : forall x y : K, ~ Equal x (monoid_unit K) -> ~ Equal y (monoid_unit K) -> Equal (field_inverse (field_div x y)) (field_div y x). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (field_div x y)) (field_div y x) *) unfold field_div in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (@ring_mult (field_ring K) x (field_inverse y))) (@ring_mult (field_ring K) y (field_inverse x)) *) intros x y H' H'0; try assumption. apply Trans with (ring_mult (field_inverse (field_inverse y)) (field_inverse x):K); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) auto with algebra. Qed. End Lemmas1. Hint Resolve FIELD_inverse_r FIELD_inverse_l FIELD_unit_non_zero FIELD_comp FIELD_unit_inverse FIELD_reg_left FIELD_reg_right FIELD_inverse_non_zero FIELD_inverse_inverse FIELD_integral_domain_l FIELD_integral_domain_r FIELD_law_inverse FIELD_inverse_law FIELD_x_div_x FIELD_simpl_r FIELD_one_div_x FIELD_one_div_xy FIELD_one_div_div FIELD_div_div FIELD_mult_div_l FIELD_div_div2 FIELD_inv_div: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Group_kernel. Require Export Free_group. Section Generated_group_def. Variable G : GROUP. Variable A : part_set G. Definition generated_group : subgroup G := coKer (FG_lift (inj_part A)). End Generated_group_def. Lemma generated_group_minimal : forall (G : GROUP) (A : part_set G) (H : subgroup G), included A H -> included (generated_group A) H. (* Goal: forall (G : Ob GROUP) (A : Carrier (part_set (sgroup_set (monoid_sgroup (group_monoid G))))), @included (sgroup_set (monoid_sgroup (group_monoid G))) A (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@generated_group G A)))) *) unfold included in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Var (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) A x H'))) *) simpl in |- *. (* Goal: forall (G : group) (A : Predicate (sgroup_set (monoid_sgroup (group_monoid G)))) (H : subgroup G) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x A), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @ex (FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (fun x0 : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) x0)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) intros G A H H' x H'0; try assumption. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) elim H'0; intros x0; clear H'0. (* Goal: forall _ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) x0)), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) generalize x; clear x. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) x0))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) elim x0. (* Goal: forall (c : Carrier (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Var (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) c)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (f0 : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f0))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Law (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f f0)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Inv (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) intros c; try assumption. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Var (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) c)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (f0 : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f0))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Law (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f f0)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Inv (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) elim c. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Var (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) A x H'))) *) simpl in |- *. intros y subtype_prf x H'0; elim H'0; intros H'1 H'2; try exact H'2; clear H'0. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (f0 : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f0))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Law (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f f0)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Inv (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) apply in_part_comp_l with y; auto with algebra. (* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (f0 : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f0))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Law (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f f0)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Inv (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) intros f H'0 f0 H'1 x H'2; elim H'2; intros H'3 H'4; try exact H'4; clear H'2. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Inv (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) simpl in H'4. apply in_part_comp_l with (sgroup_law G (FG_lift_fun (inj_part A) f) (FG_lift_fun (inj_part A) f0)); (* Goal: True *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Var (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) A x H'))) *) simpl in |- *. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Inv (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) intros x H'0; elim H'0; intros H'1 H'2; try exact H'2; clear H'0. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Inv (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) apply in_part_comp_l with (monoid_unit G); auto with algebra. (* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Inv (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) intros f H'0 x H'1; try assumption. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) elim H'1; intros H'2 H'3; simpl in H'3; clear H'1. apply in_part_comp_l with (group_inverse G (FG_lift_fun (inj_part A) f)); (* Goal: True *) auto with algebra. Qed. Lemma generated_group_prop_included : forall (G : GROUP) (A : part_set G), included A (generated_group A). (* Goal: forall (G : Ob GROUP) (A : Carrier (part_set (sgroup_set (monoid_sgroup (group_monoid G))))), @included (sgroup_set (monoid_sgroup (group_monoid G))) A (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@generated_group G A)))) *) unfold included in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Var (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) A x H'))) *) simpl in |- *. (* Goal: forall (G : group) (A : Predicate (sgroup_set (monoid_sgroup (group_monoid G)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x A), @ex (FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (fun x0 : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) x0))) *) intros G A x H'; try assumption. exists (Var (V:=A) (Build_subtype (E:=G) (P:=A) (subtype_elt:=x) H')); split; [ idtac | try assumption ]. (* Goal: True *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Var (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) A x H'))) *) simpl in |- *. (* Goal: True *) auto with algebra. Qed. Lemma generated_group_prop : forall (G : GROUP) (A : part_set G) (y : G), in_part y (generated_group A) -> exists x : FG A, Equal y (FG_lift (inj_part A) x). (* Goal: True *) simpl in |- *; auto with algebra. (* Goal: forall (G : Ob GROUP) (A : Carrier (part_set (sgroup_set (monoid_sgroup (group_monoid G))))) (y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @ex (FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (fun x : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) => @Equal (sgroup_set (monoid_sgroup (group_monoid G))) y (@Ap (sgroup_set (monoid_sgroup (group_monoid (FreeGroup (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (FreeGroup (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (FreeGroup (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)))) (group_monoid G) (@FG_lift (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A)))) x))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) y (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@generated_group G A)))) *) intros G A y H'; try assumption. (* Goal: @ex (FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (fun x : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) => @Equal (sgroup_set (monoid_sgroup (group_monoid G))) y (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) x)) *) elim H'; intros x E; elim E; intros H'0 H'1; try exact H'1; clear E H'. (* Goal: @ex (FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (fun x : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) => @Equal (sgroup_set (monoid_sgroup (group_monoid G))) y (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) x)) *) exists x; try assumption. Qed. Lemma generated_group_prop_rev : forall (G : GROUP) (A : part_set G) (y : G), (exists x : FG A, Equal y (FG_lift (inj_part A) x)) -> in_part y (generated_group A). (* Goal: forall (G : Ob GROUP) (A : Carrier (part_set (sgroup_set (monoid_sgroup (group_monoid G))))) (y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @ex (FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (fun x : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) => @Equal (sgroup_set (monoid_sgroup (group_monoid G))) y (@Ap (sgroup_set (monoid_sgroup (group_monoid (FreeGroup (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (FreeGroup (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (FreeGroup (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)))) (group_monoid G) (@FG_lift (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A)))) x))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) y (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@generated_group G A)))) *) intros G A y H'; try assumption. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) y (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@generated_group G A)))) *) elim H'; intros x E; try exact E; clear H'. (* Goal: True *) simpl in |- *; auto with algebra. (* Goal: @ex (FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (fun x : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) y (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) x))) *) exists x; split; [ idtac | try assumption ]. (* Goal: True *) auto with algebra. Qed. Hint Resolve generated_group_minimal generated_group_prop_included generated_group_prop_rev: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Fpart. Require Export Inter. Require Export Arith. Section fparts2_def. Variable E : Setoid. Definition disjoint (A B : part_set E) := Equal (inter A B) (empty E). Lemma disjoint_comp : forall A A' B B' : part_set E, Equal A A' -> Equal B B' -> disjoint A B -> disjoint A' B'. (* Goal: forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : disjoint A B) (_ : @in_part E x A), not (@in_part E x B) *) unfold disjoint in |- *. (* Goal: forall (A A' B B' : Carrier (part_set E)) (_ : @Equal (part_set E) A A') (_ : @Equal (part_set E) B B') (_ : @Equal (part_set E) (@inter E A B) (empty E)), @Equal (part_set E) (@inter E A' B') (empty E) *) intros A A' B B' H' H'0 H'1; try assumption. (* Goal: @Equal (part_set E) (@inter E A' B') (empty E) *) apply Trans with (inter A B). (* Goal: @cardinal E B0 n *) auto with *. (* Goal: @cardinal E B0 n *) auto with *. Qed. Lemma empty_not_in : forall A : part_set E, Equal A (empty E) -> forall x : E, ~ in_part x A. (* Goal: forall (A : Carrier (part_set E)) (_ : @Equal (part_set E) A (empty E)) (x : Carrier E), not (@in_part E x A) *) intros A; case A; intros a pa; simpl in |- *. (* Goal: forall (_ : @eq_part E (@Build_Predicate E a pa) (empty E)) (x : Carrier E), not (a x) *) unfold eq_part, empty in |- *; simpl in |- *. (* Goal: forall (x : Carrier E) (_ : b x) (_ : not (a x)), and (b x) (not (a x)) *) intuition. (* Goal: forall (A B : Carrier (part_set E)) (a b c : nat) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : @cardinal E (@inter E A B) c), @cardinal E (@union E A B) (Init.Nat.sub (Init.Nat.add a b) c) *) intros. (* Goal: @cardinal E B0 n *) elim (H x); auto with *. Qed. Lemma disjoint_inclus : forall A B C : part_set E, included A B -> disjoint B C -> disjoint A C. (* Goal: forall (A B C : Carrier (part_set E)) (_ : @included E A B) (_ : disjoint B C), disjoint A C *) unfold included, disjoint in |- *. (* Goal: forall (A B C : Carrier (part_set E)) (_ : forall (x : Carrier E) (_ : @in_part E x A), @in_part E x B) (_ : @Equal (part_set E) (@inter E B C) (empty E)), @Equal (part_set E) (@inter E A C) (empty E) *) intros A B C H' H'0; try assumption. (* Goal: @Equal (part_set E) (@inter E A (@diff E B A)) (empty E) *) apply not_in_empty. (* Goal: forall (A B : Carrier (part_set E)) (a b c : nat) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : @cardinal E (@inter E A B) c), @cardinal E (@union E A B) (Init.Nat.sub (Init.Nat.add a b) c) *) unfold not in |- *; intros. (* Goal: False *) cut (in_part x (inter B C)). (* Goal: forall _ : @in_part E x (@inter E B C), False *) (* Goal: @in_part E x (@inter E B C) *) generalize (empty_not_in (A:=inter B C) H'0). (* Goal: forall (A B : Carrier (part_set E)) (a b c : nat) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : @cardinal E (@inter E A B) c), @cardinal E (@union E A B) (Init.Nat.sub (Init.Nat.add a b) c) *) unfold not in |- *; intros. (* Goal: False *) (* Goal: @in_part E x (@inter E B C) *) apply H0 with (x := x). (* Goal: @cardinal E B0 n *) auto with *. (* Goal: @cardinal E B0 n *) auto with *. (* Goal: @in_part E x (@inter E B C) *) apply in_part_inter. (* Goal: @in_part E x B *) (* Goal: @in_part E x C *) apply H'. (* Goal: @in_part E x A *) (* Goal: @in_part E x C *) apply in_part_inter_l with C. (* Goal: @cardinal E B0 n *) auto with *. (* Goal: @in_part E x C *) apply in_part_inter_r with A. (* Goal: @cardinal E B0 n *) auto with *. Qed. Lemma included_add_part : forall (A : part_set E) (x : E), included A (add_part A x). (* Goal: forall (A : Carrier (part_set E)) (x : Carrier E), @included E A (@add_part E A x) *) intros A x; red in |- *. (* Goal: forall (A B0 B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B0)) (_ : @Equal (part_set E) A (@add_part E B0 x)) (_ : not (@in_part E x B)), @Equal (part_set E) (@inter E B0 B) (@inter E A B) *) unfold add_part in |- *. (* Goal: @cardinal E B0 n *) auto with *. Qed. Hint Resolve included_add_part: algebra. Lemma union_not_in : forall (A B : part_set E) (x : E), ~ in_part x A -> ~ in_part x B -> ~ in_part x (union A B). (* Goal: forall (A B : Carrier (part_set E)) (a b c : nat) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : @cardinal E (@inter E A B) c), @cardinal E (@union E A B) (Init.Nat.sub (Init.Nat.add a b) c) *) unfold not in |- *; intros. (* Goal: False *) cut (in_part x A \/ in_part x B). (* Goal: forall _ : @in_part E x (@diff E (empty E) A), @in_part E x (empty E) *) (* Goal: forall (x : Carrier E) (_ : @in_part E x (empty E)), @in_part E x (@diff E (empty E) A) *) intros H'; try assumption. (* Goal: forall (x : Carrier E) (_ : b x) (_ : not (a x)), and (b x) (not (a x)) *) intuition. (* Goal: @cardinal E B0 n *) auto with *. Qed. Hint Resolve union_not_in: algebra. Lemma disjoint_not_in_r : forall (A B : part_set E) (x : E), disjoint A B -> in_part x A -> ~ in_part x B. (* Goal: forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : disjoint A B) (_ : @in_part E x A), not (@in_part E x B) *) unfold disjoint in |- *. (* Goal: forall (A B : Carrier (part_set E)) (a b c : nat) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : @cardinal E (@inter E A B) c), @cardinal E (@union E A B) (Init.Nat.sub (Init.Nat.add a b) c) *) unfold not in |- *; intros. (* Goal: False *) cut (in_part x (empty E)). (* Goal: @cardinal E B0 n *) auto with *. (* Goal: @in_part E x (empty E) *) apply in_part_comp_r with (inter A B). (* Goal: @cardinal E B0 n *) auto with *. (* Goal: @cardinal E B0 n *) auto with *. Qed. Lemma cardinal_union_disjoint : forall (a b : nat) (A B : part_set E), cardinal A a -> cardinal B b -> disjoint A B -> cardinal (union A B) (a + b). (* Goal: forall (a b : nat) (A B : Carrier (part_set E)) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : disjoint A B), @cardinal E (@union E A B) (Init.Nat.add a b) *) simple induction a. (* Goal: forall (A B : Carrier (part_set E)) (a b c : nat) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : @cardinal E (@inter E A B) c), @cardinal E (@union E A B) (Init.Nat.sub (Init.Nat.add a b) c) *) intros. (* Goal: @cardinal E B0 n *) apply cardinal_comp_l with (union (empty E) B); auto with *. (* Goal: @cardinal E B0 n *) apply union_comp; auto with *. (* Goal: @Equal (part_set E) (empty E) (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) apply Sym. (* Goal: @cardinal E B0 n *) auto with *. (* Goal: @cardinal E B0 n *) apply cardinal_comp_l with B; auto with *. (* Goal: forall (A B : Carrier (part_set E)) (a b c : nat) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : @cardinal E (@inter E A B) c), @cardinal E (@union E A B) (Init.Nat.sub (Init.Nat.add a b) c) *) intros. (* Goal: @ex nat (fun b : nat => @ex nat (fun c : nat => and (@cardinal E (@diff E A B) b) (and (@cardinal E (@inter E A B) c) (@eq nat (S n) (Init.Nat.add b c))))) *) inversion H0. (* Goal: and (@cardinal E (@diff E A B) O) (and (@cardinal E (@inter E A B) O) (@eq nat O (Init.Nat.add O O))) *) (* Goal: @ex nat (fun b : nat => @ex nat (fun c : nat => and (@cardinal E (@diff E A B) b) (and (@cardinal E (@inter E A B) c) (@eq nat (S n) (Init.Nat.add b c))))) *) simpl in |- *. (* Goal: @cardinal E B0 n *) apply cardinal_add with (union B0 B) x; auto with *. (* Goal: @cardinal E B0 n *) apply H; auto with *. (* Goal: @cardinal E B0 n *) apply disjoint_inclus with (add_part B0 x); auto with *. (* Goal: @cardinal E B0 n *) apply disjoint_comp with A B; auto with *. (* Goal: @cardinal E B0 n *) apply union_not_in; auto with *. (* Goal: @cardinal E B0 n *) apply disjoint_not_in_r with A; auto with *. (* Goal: @cardinal E B0 n *) apply in_part_comp_r with (add_part B0 x); auto with *. (* Goal: @cardinal E B0 n *) apply Trans with (union (add_part B0 x) B); auto with *. (* Goal: forall (A B0 B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B0)) (_ : @Equal (part_set E) A (@add_part E B0 x)) (_ : not (@in_part E x B)), @Equal (part_set E) (@inter E B0 B) (@inter E A B) *) unfold add_part in |- *. (* Goal: @cardinal E B0 n *) apply Trans with (union B0 (union (single x) B)); auto with *. (* Goal: @cardinal E B0 n *) apply Trans with (union B0 (union B (single x))); auto with *. Qed. Hint Resolve cardinal_union_disjoint: algebra. Lemma in_eq_part : forall A B : part_set E, (forall x : E, in_part x A -> in_part x B) -> (forall x : E, in_part x B -> in_part x A) -> Equal A B. (* Goal: forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x A) (_ : not (@in_part E x B)), @in_part E x (@diff E A B) *) intros A B. (* Goal: and (@cardinal E (@diff E A B) O) (and (@cardinal E (@inter E A B) O) (@eq nat O (Init.Nat.add O O))) *) (* Goal: @ex nat (fun b : nat => @ex nat (fun c : nat => and (@cardinal E (@diff E A B) b) (and (@cardinal E (@inter E A B) c) (@eq nat (S n) (Init.Nat.add b c))))) *) case A; case B; simpl in |- *. (* Goal: forall (Pred_fun : forall _ : Carrier E, Prop) (_ : @pred_compatible E Pred_fun) (Pred_fun0 : forall _ : Carrier E, Prop) (_ : @pred_compatible E Pred_fun0) (x : Carrier E) (_ : Pred_fun0 x) (_ : not (Pred_fun x)), and (Pred_fun0 x) (not (Pred_fun x)) *) intros a pa b pb. (* Goal: and (@cardinal E (@diff E A B) O) (and (@cardinal E (@inter E A B) O) (@eq nat O (Init.Nat.add O O))) *) (* Goal: @ex nat (fun b : nat => @ex nat (fun c : nat => and (@cardinal E (@diff E A B) b) (and (@cardinal E (@inter E A B) c) (@eq nat (S n) (Init.Nat.add b c))))) *) unfold eq_part in |- *; simpl in |- *. (* Goal: forall (x : Carrier E) (_ : b x) (_ : not (a x)), and (b x) (not (a x)) *) intuition. Qed. Lemma diff_in_l : forall (A B : part_set E) (x : E), in_part x (diff A B) -> in_part x A. (* Goal: forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x A) (_ : not (@in_part E x B)), @in_part E x (@diff E A B) *) intros A B. (* Goal: and (@cardinal E (@diff E A B) O) (and (@cardinal E (@inter E A B) O) (@eq nat O (Init.Nat.add O O))) *) (* Goal: @ex nat (fun b : nat => @ex nat (fun c : nat => and (@cardinal E (@diff E A B) b) (and (@cardinal E (@inter E A B) c) (@eq nat (S n) (Init.Nat.add b c))))) *) case A; case B; simpl in |- *. (* Goal: forall (Pred_fun : forall _ : Carrier E, Prop) (_ : @pred_compatible E Pred_fun) (Pred_fun0 : forall _ : Carrier E, Prop) (_ : @pred_compatible E Pred_fun0) (x : Carrier E) (_ : Pred_fun0 x) (_ : not (Pred_fun x)), and (Pred_fun0 x) (not (Pred_fun x)) *) intros a pa b pb. (* Goal: and (@cardinal E (@diff E A B) O) (and (@cardinal E (@inter E A B) O) (@eq nat O (Init.Nat.add O O))) *) (* Goal: @ex nat (fun b : nat => @ex nat (fun c : nat => and (@cardinal E (@diff E A B) b) (and (@cardinal E (@inter E A B) c) (@eq nat (S n) (Init.Nat.add b c))))) *) unfold eq_part in |- *; simpl in |- *. (* Goal: forall (x : Carrier E) (_ : b x) (_ : not (a x)), and (b x) (not (a x)) *) intuition. Qed. Lemma diff_in_r : forall (A B : part_set E) (x : E), in_part x (diff A B) -> ~ in_part x B. (* Goal: forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x A) (_ : not (@in_part E x B)), @in_part E x (@diff E A B) *) intros A B. (* Goal: and (@cardinal E (@diff E A B) O) (and (@cardinal E (@inter E A B) O) (@eq nat O (Init.Nat.add O O))) *) (* Goal: @ex nat (fun b : nat => @ex nat (fun c : nat => and (@cardinal E (@diff E A B) b) (and (@cardinal E (@inter E A B) c) (@eq nat (S n) (Init.Nat.add b c))))) *) case A; case B; simpl in |- *. (* Goal: forall (Pred_fun : forall _ : Carrier E, Prop) (_ : @pred_compatible E Pred_fun) (Pred_fun0 : forall _ : Carrier E, Prop) (_ : @pred_compatible E Pred_fun0) (x : Carrier E) (_ : Pred_fun0 x) (_ : not (Pred_fun x)), and (Pred_fun0 x) (not (Pred_fun x)) *) intros a pa b pb. (* Goal: and (@cardinal E (@diff E A B) O) (and (@cardinal E (@inter E A B) O) (@eq nat O (Init.Nat.add O O))) *) (* Goal: @ex nat (fun b : nat => @ex nat (fun c : nat => and (@cardinal E (@diff E A B) b) (and (@cardinal E (@inter E A B) c) (@eq nat (S n) (Init.Nat.add b c))))) *) unfold eq_part in |- *; simpl in |- *. (* Goal: forall (x : Carrier E) (_ : b x) (_ : not (a x)), and (b x) (not (a x)) *) intuition. Qed. Lemma in_diff : forall (A B : part_set E) (x : E), in_part x A -> ~ in_part x B -> in_part x (diff A B). (* Goal: forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x A) (_ : not (@in_part E x B)), @in_part E x (@diff E A B) *) intros A B. (* Goal: and (@cardinal E (@diff E A B) O) (and (@cardinal E (@inter E A B) O) (@eq nat O (Init.Nat.add O O))) *) (* Goal: @ex nat (fun b : nat => @ex nat (fun c : nat => and (@cardinal E (@diff E A B) b) (and (@cardinal E (@inter E A B) c) (@eq nat (S n) (Init.Nat.add b c))))) *) case A; case B; simpl in |- *. (* Goal: forall (Pred_fun : forall _ : Carrier E, Prop) (_ : @pred_compatible E Pred_fun) (Pred_fun0 : forall _ : Carrier E, Prop) (_ : @pred_compatible E Pred_fun0) (x : Carrier E) (_ : Pred_fun0 x) (_ : not (Pred_fun x)), and (Pred_fun0 x) (not (Pred_fun x)) *) intros a pa b pb. (* Goal: and (@cardinal E (@diff E A B) O) (and (@cardinal E (@inter E A B) O) (@eq nat O (Init.Nat.add O O))) *) (* Goal: @ex nat (fun b : nat => @ex nat (fun c : nat => and (@cardinal E (@diff E A B) b) (and (@cardinal E (@inter E A B) c) (@eq nat (S n) (Init.Nat.add b c))))) *) unfold eq_part in |- *; simpl in |- *. (* Goal: forall (x : Carrier E) (_ : b x) (_ : not (a x)), and (b x) (not (a x)) *) intuition. Qed. Hint Resolve in_diff: algebra. Lemma union_diff : forall A B : part_set E, Equal (union A (diff B A)) (union A B). (* Goal: forall A B : Carrier (part_set E), @Equal (part_set E) (@inter E A (@diff E B A)) (empty E) *) intros A B; try assumption. (* Goal: @Equal (part_set E) (@inter E (@single E x) B) (empty E) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) apply in_eq_part. (* Goal: forall (x : Carrier E) (_ : @in_part E x (empty E)), @in_part E x (@inter E (empty E) A) *) intros x H'; try assumption. (* Goal: @in_part E x (@union E A (@diff E B A)) *) elim (in_part_union H'). (* Goal: @cardinal E B0 n *) auto with *. (* Goal: forall _ : @in_part E x B, @in_part E x (@union E A (@diff E B A)) *) intros H'0; try assumption. (* Goal: @in_part E x (@union E A B) *) (* Goal: forall (x : Carrier E) (_ : @in_part E x (@union E A B)), @in_part E x (@union E A (@diff E B A)) *) cut (in_part x B). (* Goal: @cardinal E B0 n *) auto with *. (* Goal: @in_part E x B *) (* Goal: forall (x : Carrier E) (_ : @in_part E x (@union E A B)), @in_part E x (@union E A (@diff E B A)) *) exact (diff_in_l H'0). (* Goal: forall (x : Carrier E) (_ : @in_part E x (empty E)), @in_part E x (@inter E (empty E) A) *) intros x H'; try assumption. (* Goal: @in_part E x (@union E A (@diff E B A)) *) elim (in_part_union H'). (* Goal: @cardinal E B0 n *) auto with *. (* Goal: forall _ : @in_part E x B, @in_part E x (@union E A (@diff E B A)) *) intros H'0; try assumption. (* Goal: @in_part E x (@union E A (@diff E B A)) *) elim (classic (in_part x A)). (* Goal: @cardinal E B0 n *) auto with *. (* Goal: forall _ : not (@in_part E x A), @in_part E x (@union E A (@diff E B A)) *) intros H'1; try assumption. (* Goal: @in_part E x (@union E A (@diff E B A)) *) cut (in_part x (diff B A)). (* Goal: @cardinal E B0 n *) auto with *. (* Goal: @cardinal E B0 n *) auto with *. Qed. Hint Resolve union_diff: algebra. Lemma disjoint_diff : forall A B : part_set E, disjoint A (diff B A). (* Goal: forall A B : Carrier (part_set E), disjoint A (@diff E B A) *) red in |- *. (* Goal: forall A B : Carrier (part_set E), @Equal (part_set E) (@inter E A (@diff E B A)) (empty E) *) intros A B; try assumption. (* Goal: @Equal (part_set E) (@inter E A (@diff E B A)) (empty E) *) apply not_in_empty. (* Goal: forall x : Carrier E, not (@in_part E x (@inter E A (@diff E B A))) *) intros x; red in |- *; intros H'; try exact H'. (* Goal: False *) absurd (in_part x A). (* Goal: not (@in_part E x A) *) (* Goal: @in_part E x A *) apply diff_in_r with B. (* Goal: @cardinal E B0 n *) auto with *. (* Goal: @cardinal E B0 n *) apply in_part_inter_r with A; auto with *. (* Goal: @cardinal E B0 n *) apply in_part_inter_l with (diff B A); auto with *. Qed. Hint Resolve disjoint_diff: algebra. Lemma cardinal_union : forall (a b : nat) (A B : part_set E), cardinal A a -> cardinal (diff B A) b -> cardinal (union A B) (a + b). (* Goal: forall (A B : Carrier (part_set E)) (a b c : nat) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : @cardinal E (@inter E A B) c), @cardinal E (@union E A B) (Init.Nat.sub (Init.Nat.add a b) c) *) intros. (* Goal: @cardinal E B0 n *) apply cardinal_comp_l with (union A (diff B A)); auto with *. Qed. Hint Resolve cardinal_union: algebra. Lemma empty_diff : forall A : part_set E, Equal (diff (empty E) A) (empty E). (* Goal: forall A : Carrier (part_set E), @Equal (part_set E) (@inter E (empty E) A) (empty E) *) intros A; try assumption. (* Goal: @Equal (part_set E) (@inter E (@single E x) B) (empty E) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) apply in_eq_part. (* Goal: forall (x : Carrier E) (_ : @in_part E x (@diff E (empty E) A)), @in_part E x (empty E) *) (* Goal: forall (x : Carrier E) (_ : @in_part E x (empty E)), @in_part E x (@diff E (empty E) A) *) intro. (* Goal: forall _ : @in_part E x (@diff E (empty E) A), @in_part E x (empty E) *) (* Goal: forall (x : Carrier E) (_ : @in_part E x (empty E)), @in_part E x (@diff E (empty E) A) *) intros H'; try assumption. (* Goal: @cardinal E B0 n *) apply diff_in_l with A; auto with *. (* Goal: forall (x : Carrier E) (_ : @in_part E x (empty E)), @in_part E x (@inter E (empty E) A) *) intros x H'; try assumption. (* Goal: @cardinal E B0 n *) absurd (in_part x (empty E)); auto with *. Qed. Hint Resolve empty_diff: algebra. Lemma empty_inter : forall A : part_set E, Equal (inter (empty E) A) (empty E). (* Goal: forall A : Carrier (part_set E), @Equal (part_set E) (@inter E (empty E) A) (empty E) *) intros A; try assumption. (* Goal: @Equal (part_set E) (@inter E (@single E x) B) (empty E) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) apply in_eq_part. (* Goal: forall (x : Carrier E) (_ : @in_part E x (empty E)), @in_part E x (@inter E (empty E) A) *) intros x H'; try assumption. (* Goal: @cardinal E B0 n *) apply in_part_inter_l with A; auto with *. (* Goal: forall (x : Carrier E) (_ : @in_part E x (empty E)), @in_part E x (@inter E (empty E) A) *) intros x H'; try assumption. (* Goal: @cardinal E B0 n *) absurd (in_part x (empty E)); auto with *. Qed. Hint Resolve empty_inter: algebra. Lemma in_part_trans_eq : forall (A : part_set E) (x y : E), in_part x A -> Equal y x -> in_part y A. (* Goal: and (@cardinal E (@diff E A B) O) (and (@cardinal E (@inter E A B) O) (@eq nat O (Init.Nat.add O O))) *) (* Goal: @ex nat (fun b : nat => @ex nat (fun c : nat => and (@cardinal E (@diff E A B) b) (and (@cardinal E (@inter E A B) c) (@eq nat (S n) (Init.Nat.add b c))))) *) intros A; case A; simpl in |- *. (* Goal: forall (Pred_fun : forall _ : Carrier E, Prop) (_ : @pred_compatible E Pred_fun) (x y : Carrier E) (_ : Pred_fun x) (_ : @Equal E y x), Pred_fun y *) intros a pa. (* Goal: forall (x y : Carrier E) (_ : a x) (_ : @Equal E y x), a y *) intros x y H' H'0; try assumption. (* Goal: @cardinal E B0 n *) apply pa with x; auto with *. Qed. Lemma diff_add_part : forall (A B0 B : part_set E) (x : E), ~ in_part x B0 -> Equal A (add_part B0 x) -> in_part x B -> Equal (diff B0 B) (diff A B). (* Goal: forall (A B0 B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B0)) (_ : @Equal (part_set E) A (@union E B0 (@single E x))) (_ : not (@in_part E x B)), @Equal (part_set E) (@inter E B0 B) (@inter E A B) *) intros A B0 B x H' H'0 H'1; try assumption. (* Goal: @Equal (part_set E) (@inter E (@single E x) B) (empty E) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) apply in_eq_part. (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) intros x0 H'2; try assumption. (* Goal: @in_part E x0 (@diff E A B) *) apply in_diff. (* Goal: @in_part E x0 A *) (* Goal: not (@in_part E x0 B) *) (* Goal: forall (x : Carrier E) (_ : @in_part E x (@diff E A B)), @in_part E x (@diff E B0 B) *) apply in_part_comp_r with (add_part B0 x). (* Goal: @in_part E x0 (@add_part E B0 x) *) (* Goal: @Equal (part_set E) (@add_part E B0 x) A *) (* Goal: not (@in_part E x0 B) *) (* Goal: forall (x : Carrier E) (_ : @in_part E x (@diff E A B)), @in_part E x (@diff E B0 B) *) cut (in_part x0 B0). (* Goal: forall (A B0 B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B0)) (_ : @Equal (part_set E) A (@add_part E B0 x)) (_ : not (@in_part E x B)), @Equal (part_set E) (@inter E B0 B) (@inter E A B) *) unfold add_part in |- *. (* Goal: @cardinal E B0 n *) auto with *. (* Goal: @cardinal E B0 n *) apply diff_in_l with B; auto with *. (* Goal: @cardinal E B0 n *) auto with *. (* Goal: @cardinal E B0 n *) apply diff_in_r with B0; auto with *. (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) intros x0 H'2; try assumption. (* Goal: not (@in_part E x0 B) *) elim (classic (Equal x0 x)). (* Goal: forall _ : @Equal E x x0, @in_part E x0 (empty E) *) (* Goal: @Equal E x x0 *) (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) intros H'3; try assumption. (* Goal: @cardinal E B0 n *) absurd (in_part x B); auto with *. (* Goal: not (@in_part E x B) *) (* Goal: forall _ : not (@Equal E x0 x), @in_part E x0 (@diff E B0 B) *) cut (in_part x (diff A B)). (* Goal: forall _ : @in_part E x0 (@single E x), @in_part E x0 B0 *) (* Goal: not (@in_part E x0 B) *) intros H'4; try assumption. (* Goal: @cardinal E B0 n *) apply diff_in_r with A; auto with *. (* Goal: @cardinal E B0 n *) apply in_part_trans_eq with x0; auto with *. (* Goal: forall _ : @Equal E x x0, @in_part E x0 (empty E) *) (* Goal: @Equal E x x0 *) (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) intros H'3; try assumption. (* Goal: @in_part E x0 (@diff E A B) *) apply in_diff. (* Goal: @cardinal E B0 n *) apply add_part_in_el_diff with x; auto with *. (* Goal: @cardinal E B0 n *) apply in_part_comp_r with A; auto with *. (* Goal: @cardinal E B0 n *) apply diff_in_l with B; auto with *. (* Goal: @cardinal E B0 n *) apply diff_in_r with A; auto with *. Qed. Lemma diff_not_in : forall (A B : part_set E) (x : E), ~ in_part x A -> ~ in_part x (diff A B). (* Goal: forall (A B : Carrier (part_set E)) (a b c : nat) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : @cardinal E (@inter E A B) c), @cardinal E (@union E A B) (Init.Nat.sub (Init.Nat.add a b) c) *) unfold not in |- *; intros. (* Goal: False *) apply H. (* Goal: @cardinal E B0 n *) apply diff_in_l with B; auto with *. Qed. Hint Resolve diff_not_in: algebra. Lemma inter_not_in : forall (A B : part_set E) (x : E), ~ in_part x A -> ~ in_part x (inter A B). (* Goal: forall (A B : Carrier (part_set E)) (a b c : nat) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : @cardinal E (@inter E A B) c), @cardinal E (@union E A B) (Init.Nat.sub (Init.Nat.add a b) c) *) unfold not in |- *; intros. (* Goal: False *) apply H. (* Goal: @cardinal E B0 n *) apply in_part_inter_l with B; auto with *. Qed. Hint Resolve inter_not_in: algebra. (* OK *) Lemma inter_add_part : forall (A B0 B : part_set E) (x : E), ~ in_part x B0 -> Equal A (add_part B0 x) -> in_part x B -> Equal (inter A B) (add_part (inter B0 B) x). (* Goal: forall (A B0 B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B0)) (_ : @Equal (part_set E) A (@add_part E B0 x)) (_ : not (@in_part E x B)), @Equal (part_set E) (@inter E B0 B) (@inter E A B) *) unfold add_part in |- *. (* Goal: forall (A B0 B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B0)) (_ : @Equal (part_set E) A (@union E B0 (@single E x))) (_ : not (@in_part E x B)), @Equal (part_set E) (@inter E B0 B) (@inter E A B) *) intros A B0 B x H' H'0 H'1; try assumption. (* Goal: @Equal (part_set E) (@inter E B0 B) (@inter E A B) *) apply Trans with (inter (union B0 (single x)) B). (* Goal: @cardinal E B0 n *) auto with *. (* Goal: @Equal (part_set E) (@inter E B0 B) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) apply Trans with (union (inter B0 B) (inter (single x) B)). (* Goal: @cardinal E B0 n *) auto with *. (* Goal: @cardinal E B0 n *) apply union_comp; auto with *. (* Goal: @Equal (part_set E) (@inter E (@single E x) B) (empty E) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) apply in_eq_part. (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) intros x0 H'2; try assumption. (* Goal: @cardinal E B0 n *) apply in_part_inter_l with B; auto with *. (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) intros x0 H'2; try assumption. (* Goal: @cardinal E B0 n *) apply in_part_inter; auto with *. (* Goal: @cardinal E B0 n *) apply in_part_trans_eq with x; auto with *. Qed. Hint Resolve inter_add_part: algebra. Lemma diff_add_part_not_in : forall (A B0 B : part_set E) (x : E), ~ in_part x B0 -> Equal A (add_part B0 x) -> ~ in_part x B -> Equal (diff A B) (add_part (diff B0 B) x). (* Goal: forall (A B0 B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B0)) (_ : @Equal (part_set E) A (@union E B0 (@single E x))) (_ : not (@in_part E x B)), @Equal (part_set E) (@inter E B0 B) (@inter E A B) *) intros A B0 B x H' H'0 H'1; try assumption. (* Goal: @Equal (part_set E) (@inter E (@single E x) B) (empty E) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) apply in_eq_part. (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) intros x0 H'2; try assumption. (* Goal: not (@in_part E x0 B) *) elim (classic (Equal x0 x)). (* Goal: forall _ : @Equal E x x0, @in_part E x0 (empty E) *) (* Goal: @Equal E x x0 *) (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) intros H'3; try assumption. (* Goal: @cardinal E B0 n *) apply in_part_trans_eq with x; auto with *. (* Goal: forall _ : @Equal E x x0, @in_part E x0 (empty E) *) (* Goal: @Equal E x x0 *) (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) intros H'3; try assumption. (* Goal: forall (A B0 B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B0)) (_ : @Equal (part_set E) A (@add_part E B0 x)) (_ : not (@in_part E x B)), @Equal (part_set E) (@inter E B0 B) (@inter E A B) *) unfold add_part in |- *. (* Goal: @in_part E x0 (@union E B0 (@single E x)) *) (* Goal: not (@in_part E x0 B) *) apply in_part_union_or. (* Goal: or (@in_part E x0 B0) (@in_part E x0 (@single E x)) *) (* Goal: not (@in_part E x0 B) *) left. (* Goal: @in_part E x0 (@diff E A B) *) apply in_diff. (* Goal: @cardinal E B0 n *) apply add_part_in_el_diff with x; auto with *. (* Goal: @cardinal E B0 n *) apply in_part_comp_r with A; auto with *. (* Goal: @cardinal E B0 n *) apply diff_in_l with B; auto with *. (* Goal: @cardinal E B0 n *) apply diff_in_r with A; auto with *. (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) intros x0 H'2; try assumption. (* Goal: @in_part E x0 (@diff E A B) *) apply in_diff. (* Goal: @cardinal E B0 n *) apply in_part_comp_r with (add_part B0 x); auto with *. (* Goal: not (@in_part E x0 B) *) elim (classic (Equal x0 x)). (* Goal: forall _ : @Equal E x x0, @in_part E x0 (empty E) *) (* Goal: @Equal E x x0 *) (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) intros H'3; try assumption. (* Goal: @cardinal E B0 n *) apply in_part_trans_eq with x; auto with *. (* Goal: forall _ : @Equal E x x0, @in_part E x0 (empty E) *) (* Goal: @Equal E x x0 *) (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) intros H'3; try assumption. (* Goal: forall (A B0 B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B0)) (_ : @Equal (part_set E) A (@add_part E B0 x)) (_ : not (@in_part E x B)), @Equal (part_set E) (@inter E B0 B) (@inter E A B) *) unfold add_part in |- *. (* Goal: @in_part E x0 (@union E B0 (@single E x)) *) (* Goal: not (@in_part E x0 B) *) apply in_part_union_or. (* Goal: or (@in_part E x0 B0) (@in_part E x0 (@single E x)) *) (* Goal: not (@in_part E x0 B) *) left. (* Goal: @in_part E x0 B0 *) (* Goal: not (@in_part E x0 B) *) unfold add_part in H'2. (* Goal: @in_part E x0 B0 *) (* Goal: not (@in_part E x0 B) *) elim (in_part_union H'2). (* Goal: forall _ : @in_part E x0 (@single E x), @in_part E x0 B0 *) (* Goal: not (@in_part E x0 B) *) intros H'4; try assumption. (* Goal: @cardinal E B0 n *) apply diff_in_l with B; auto with *. (* Goal: forall _ : @in_part E x0 (@single E x), @in_part E x0 B0 *) (* Goal: not (@in_part E x0 B) *) intros H'4; try assumption. (* Goal: @cardinal E B0 n *) absurd (in_part x0 (single x)); auto with *. (* Goal: not (@in_part E x0 B) *) elim (classic (Equal x0 x)). (* Goal: forall _ : @Equal E x x0, @in_part E x0 (empty E) *) (* Goal: @Equal E x x0 *) (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) intros H'3; try assumption. (* Goal: forall (A B : Carrier (part_set E)) (a b c : nat) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : @cardinal E (@inter E A B) c), @cardinal E (@union E A B) (Init.Nat.sub (Init.Nat.add a b) c) *) unfold not in |- *; intros. (* Goal: False *) (* Goal: @in_part E x0 B *) (* Goal: @Equal E x x0 *) (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) unfold not in H'1. (* Goal: False *) (* Goal: @in_part E x0 B *) (* Goal: @Equal E x x0 *) (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) apply H'1. (* Goal: @cardinal E B0 n *) apply in_part_trans_eq with x0; auto with *. (* Goal: forall _ : @Equal E x x0, @in_part E x0 (empty E) *) (* Goal: @Equal E x x0 *) (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) intros H'3; try assumption. (* Goal: @cardinal E B0 n *) apply diff_in_r with B0; auto with *. (* Goal: @cardinal E B0 n *) apply add_part_in_el_diff with x; auto with *. Qed. Hint Resolve diff_add_part_not_in: algebra. Lemma inter_add_part_not_in : forall (A B0 B : part_set E) (x : E), ~ in_part x B0 -> Equal A (add_part B0 x) -> ~ in_part x B -> Equal (inter B0 B) (inter A B). (* Goal: forall (A B0 B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B0)) (_ : @Equal (part_set E) A (@add_part E B0 x)) (_ : not (@in_part E x B)), @Equal (part_set E) (@inter E B0 B) (@inter E A B) *) unfold add_part in |- *. (* Goal: forall (A B0 B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B0)) (_ : @Equal (part_set E) A (@union E B0 (@single E x))) (_ : not (@in_part E x B)), @Equal (part_set E) (@inter E B0 B) (@inter E A B) *) intros A B0 B x H' H'0 H'1; try assumption. (* Goal: @Equal (part_set E) (@inter E B0 B) (@inter E A B) *) apply Trans with (inter (union B0 (single x)) B). (* Goal: @cardinal E B0 n *) auto with *. (* Goal: @Equal (part_set E) (@inter E B0 B) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) apply Trans with (union (inter B0 B) (inter (single x) B)). (* Goal: @Equal (part_set E) (@inter E B0 B) (@union E (@inter E B0 B) (@inter E (@single E x) B)) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) apply Trans with (union (inter B0 B) (empty E)). (* Goal: @cardinal E B0 n *) auto with *. (* Goal: @cardinal E B0 n *) apply union_comp; auto with *. (* Goal: @Equal (part_set E) (empty E) (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) apply Sym. (* Goal: @Equal (part_set E) (@inter E (@single E x) B) (empty E) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) apply in_eq_part. (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) intros x0 H'2; try assumption. (* Goal: @in_part E x0 (empty E) *) (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) cut (Equal x x0). (* Goal: forall _ : @Equal E x x0, @in_part E x0 (empty E) *) (* Goal: @Equal E x x0 *) (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) intros H'3; try assumption. (* Goal: @in_part E x0 (empty E) *) (* Goal: @Equal E x x0 *) (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) absurd (in_part x0 B). (* Goal: forall (x : Carrier E) (_ : @in_part E x (@diff E (empty E) A)), @in_part E x (empty E) *) (* Goal: forall (x : Carrier E) (_ : @in_part E x (empty E)), @in_part E x (@diff E (empty E) A) *) unfold not in |- *; intro. (* Goal: False *) (* Goal: @in_part E x0 B *) (* Goal: @Equal E x x0 *) (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) unfold not in H'1. (* Goal: False *) (* Goal: @in_part E x0 B *) (* Goal: @Equal E x x0 *) (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) apply H'1. (* Goal: @cardinal E B0 n *) apply in_part_trans_eq with x0; auto with *. (* Goal: @in_part E x0 B *) (* Goal: @Equal E x x0 *) (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) apply in_part_inter_r with (single x). (* Goal: @cardinal E B0 n *) auto with *. (* Goal: @Equal E x x0 *) (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) cut (in_part x0 (single x)). (* Goal: @cardinal E B0 n *) auto with *. (* Goal: @in_part E x0 (@single E x) *) (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) apply in_part_inter_l with B. (* Goal: @cardinal E B0 n *) auto with *. (* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (empty E)), @in_part E x0 (@inter E (@single E x) B) *) (* Goal: @Equal (part_set E) (@union E (@inter E B0 B) (@inter E (@single E x) B)) (@inter E (@union E B0 (@single E x)) B) *) (* Goal: @Equal (part_set E) (@inter E (@union E B0 (@single E x)) B) (@inter E A B) *) intros x0 H'2; try assumption. (* Goal: @cardinal E B0 n *) absurd (in_part x0 (empty E)); auto with *. (* Goal: @cardinal E B0 n *) auto with *. (* Goal: @cardinal E B0 n *) auto with *. Qed. Lemma cardinal_diff : forall (a : nat) (A B : part_set E), cardinal A a -> exists b : nat, (exists c : nat, cardinal (diff A B) b /\ cardinal (inter A B) c /\ a = b + c). (* Goal: forall (A B : Carrier (part_set E)) (a b c : nat) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : @cardinal E (@inter E A B) c), @cardinal E (@union E A B) (Init.Nat.sub (Init.Nat.add a b) c) *) simple induction a; intros. (* Goal: forall (A B : Carrier (part_set E)) (a b c : nat) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : @cardinal E (@inter E A B) c), @cardinal E (@union E A B) (Init.Nat.sub (Init.Nat.add a b) c) *) exists 0; intros. (* Goal: forall (A B : Carrier (part_set E)) (a b c : nat) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : @cardinal E (@inter E A B) c), @cardinal E (@union E A B) (Init.Nat.sub (Init.Nat.add a b) c) *) exists 0; intros. (* Goal: and (@cardinal E (@diff E A B) O) (and (@cardinal E (@inter E A B) O) (@eq nat O (Init.Nat.add O O))) *) (* Goal: @ex nat (fun b : nat => @ex nat (fun c : nat => and (@cardinal E (@diff E A B) b) (and (@cardinal E (@inter E A B) c) (@eq nat (S n) (Init.Nat.add b c))))) *) simpl in |- *. (* Goal: and (@cardinal E (@inter E A B) x1) (@eq nat (S n) (Init.Nat.add (S x0) x1)) *) (* Goal: @cardinal E B0 n *) split. (* Goal: @cardinal E (@inter E A B) O *) (* Goal: @eq nat O O *) (* Goal: @ex nat (fun b : nat => @ex nat (fun c : nat => and (@cardinal E (@diff E A B) b) (and (@cardinal E (@inter E A B) c) (@eq nat (S n) (Init.Nat.add b c))))) *) apply cardinal_empty. (* Goal: @cardinal E B0 n *) apply Trans with (diff (empty E) B); auto with *. (* Goal: and (@cardinal E (@inter E A B) x1) (@eq nat (S n) (Init.Nat.add (S x0) x1)) *) (* Goal: @cardinal E B0 n *) split. (* Goal: @cardinal E (@inter E A B) O *) (* Goal: @eq nat O O *) (* Goal: @ex nat (fun b : nat => @ex nat (fun c : nat => and (@cardinal E (@diff E A B) b) (and (@cardinal E (@inter E A B) c) (@eq nat (S n) (Init.Nat.add b c))))) *) apply cardinal_empty. (* Goal: @cardinal E B0 n *) apply Trans with (inter (empty E) B); auto with *. (* Goal: @cardinal E B0 n *) auto with *. (* Goal: @ex nat (fun b : nat => @ex nat (fun c : nat => and (@cardinal E (@diff E A B) b) (and (@cardinal E (@inter E A B) c) (@eq nat (S n) (Init.Nat.add b c))))) *) inversion H0. (* Goal: forall (A B : Carrier (part_set E)) (a b c : nat) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : @cardinal E (@inter E A B) c), @cardinal E (@union E A B) (Init.Nat.sub (Init.Nat.add a b) c) *) elim (H B0 B); intros. (* Goal: forall (A B : Carrier (part_set E)) (a b c : nat) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : @cardinal E (@inter E A B) c), @cardinal E (@union E A B) (Init.Nat.sub (Init.Nat.add a b) c) *) case H6; clear H6; intros. (* Goal: forall (A B : Carrier (part_set E)) (a b c : nat) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : @cardinal E (@inter E A B) c), @cardinal E (@union E A B) (Init.Nat.sub (Init.Nat.add a b) c) *) case H6; clear H6; intros. (* Goal: forall (A B : Carrier (part_set E)) (a b c : nat) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : @cardinal E (@inter E A B) c), @cardinal E (@union E A B) (Init.Nat.sub (Init.Nat.add a b) c) *) case H7; clear H7; intros. (* Goal: forall (A B : Carrier (part_set E)) (a b c : nat) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : @cardinal E (@inter E A B) c), @cardinal E (@union E A B) (Init.Nat.sub (Init.Nat.add a b) c) *) case (classic (in_part x B)); intros. (* Goal: @ex nat (fun b : nat => @ex nat (fun c : nat => and (@cardinal E (@diff E A B) b) (and (@cardinal E (@inter E A B) c) (@eq nat (S n) (Init.Nat.add b c))))) *) (* Goal: @ex nat (fun b : nat => @ex nat (fun c : nat => and (@cardinal E (@diff E A B) b) (and (@cardinal E (@inter E A B) c) (@eq nat (S n) (Init.Nat.add b c))))) *) (* Goal: @cardinal E B0 n *) exists x0. (* Goal: @ex nat (fun c : nat => and (@cardinal E (@diff E A B) x0) (and (@cardinal E (@inter E A B) c) (@eq nat (S n) (Init.Nat.add x0 c)))) *) (* Goal: @ex nat (fun b : nat => @ex nat (fun c : nat => and (@cardinal E (@diff E A B) b) (and (@cardinal E (@inter E A B) c) (@eq nat (S n) (Init.Nat.add b c))))) *) (* Goal: @cardinal E B0 n *) exists (S x1). (* Goal: and (@cardinal E (@inter E A B) x1) (@eq nat (S n) (Init.Nat.add (S x0) x1)) *) (* Goal: @cardinal E B0 n *) split. (* Goal: @cardinal E B0 n *) apply cardinal_comp_l with (diff B0 B); auto with *. (* Goal: @cardinal E B0 n *) apply diff_add_part with x; auto with *. (* Goal: and (@cardinal E (@inter E A B) x1) (@eq nat (S n) (Init.Nat.add (S x0) x1)) *) (* Goal: @cardinal E B0 n *) split. (* Goal: @cardinal E B0 n *) apply cardinal_add with (inter B0 B) x; auto with *. (* Goal: @eq nat (S n) (Init.Nat.add x0 (S x1)) *) (* Goal: @ex nat (fun b : nat => @ex nat (fun c : nat => and (@cardinal E (@diff E A B) b) (and (@cardinal E (@inter E A B) c) (@eq nat (S n) (Init.Nat.add b c))))) *) (* Goal: @cardinal E B0 n *) rewrite H8. (* Goal: @cardinal E B0 n *) auto with *. (* Goal: @ex nat (fun b : nat => @ex nat (fun c : nat => and (@cardinal E (@diff E A B) b) (and (@cardinal E (@inter E A B) c) (@eq nat (S n) (Init.Nat.add b c))))) *) (* Goal: @cardinal E B0 n *) exists (S x0). (* Goal: @ex nat (fun c : nat => and (@cardinal E (@diff E A B) (S x0)) (and (@cardinal E (@inter E A B) c) (@eq nat (S n) (Init.Nat.add (S x0) c)))) *) (* Goal: @cardinal E B0 n *) exists x1. (* Goal: and (@cardinal E (@inter E A B) x1) (@eq nat (S n) (Init.Nat.add (S x0) x1)) *) (* Goal: @cardinal E B0 n *) split. (* Goal: @cardinal E B0 n *) apply cardinal_add with (diff B0 B) x; auto with *. (* Goal: and (@cardinal E (@inter E A B) x1) (@eq nat (S n) (Init.Nat.add (S x0) x1)) *) (* Goal: @cardinal E B0 n *) split. (* Goal: @cardinal E B0 n *) apply cardinal_comp_l with (inter B0 B); auto with *. (* Goal: @cardinal E B0 n *) apply inter_add_part_not_in with x; auto with *. (* Goal: @cardinal E B0 n *) rewrite H8; auto with *. (* Goal: @cardinal E B0 n *) auto with *. Qed. Lemma cardinal_union_inter : forall (A B : part_set E) (a b c : nat), cardinal A a -> cardinal B b -> cardinal (inter A B) c -> cardinal (union A B) (a + b - c). (* Goal: forall (A B : Carrier (part_set E)) (a b c : nat) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : @cardinal E (@inter E A B) c), @cardinal E (@union E A B) (Init.Nat.sub (Init.Nat.add a b) c) *) intros. (* Goal: forall (A B : Carrier (part_set E)) (a b c : nat) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : @cardinal E (@inter E A B) c), @cardinal E (@union E A B) (Init.Nat.sub (Init.Nat.add a b) c) *) case (cardinal_diff A H0); intros. (* Goal: forall (A B : Carrier (part_set E)) (a b c : nat) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : @cardinal E (@inter E A B) c), @cardinal E (@union E A B) (Init.Nat.sub (Init.Nat.add a b) c) *) case H2; clear H2; intros. (* Goal: forall (A B : Carrier (part_set E)) (a b c : nat) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : @cardinal E (@inter E A B) c), @cardinal E (@union E A B) (Init.Nat.sub (Init.Nat.add a b) c) *) case H2; clear H2; intros. (* Goal: forall (A B : Carrier (part_set E)) (a b c : nat) (_ : @cardinal E A a) (_ : @cardinal E B b) (_ : @cardinal E (@inter E A B) c), @cardinal E (@union E A B) (Init.Nat.sub (Init.Nat.add a b) c) *) case H3; clear H3; intros. (* Goal: @cardinal E B0 n *) apply cardinal_comp with (union A (diff B A)) (a + x); auto with *. (* Goal: @eq nat (Init.Nat.add a x) (Init.Nat.sub (Init.Nat.add a b) c) *) rewrite H4. (* Goal: @eq nat (Init.Nat.add a x) (Init.Nat.sub (Init.Nat.add a (Init.Nat.add x x0)) c) *) replace c with x0. (* Goal: @eq nat (Init.Nat.add a x) (Init.Nat.sub (Init.Nat.add a (Init.Nat.add x x0)) x0) *) (* Goal: @eq nat x0 c *) rewrite plus_assoc. (* Goal: @cardinal E B0 n *) replace (a + x + x0) with (x0 + (a + x)); auto with *. (* Goal: @cardinal E B0 n *) apply (cardinal_unique H3); auto with *. (* Goal: @cardinal E B0 n *) apply cardinal_comp_l with (inter A B); auto with *. Qed. Hint Resolve cardinal_union_inter: algebra. End fparts2_def.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Group_util. Require Export Abelian_group_facts. (** Title "The abelian group of morphisms from a group to an abelian group." *) Section Def. Variable G : GROUP. Variable G' : ABELIAN_GROUP. Definition group_hom_law : forall f g : Hom G G', Hom G G'. (* Goal: forall (_ : Carrier (@Hom GROUP G (abelian_group_group G'))) (_ : Carrier (@Hom GROUP G (abelian_group_group G'))), Carrier (@Hom GROUP G (abelian_group_group G')) *) intros f0 g. apply (BUILD_HOM_GROUP (G:=G) (G':=G') (ff:=fun x : G => sgroup_law G' (f0 x) (g x))). (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) *) auto with algebra. (* Goal: forall x y : Carrier (@Hom GROUP G (abelian_group_group G')), @Equal (@Hom GROUP G (abelian_group_group G')) (group_hom_law x y) (group_hom_law y x) *) intros x y; try assumption. apply Trans with (sgroup_law G' (sgroup_law G' (Ap (sgroup_map (monoid_sgroup_hom f0)) x) (Ap (sgroup_map (monoid_sgroup_hom f0)) y)) (sgroup_law G' (Ap (sgroup_map (monoid_sgroup_hom g)) x) (Ap (sgroup_map (monoid_sgroup_hom g)) y))); (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) *) auto with algebra. apply Trans with (sgroup_law G' (monoid_unit G') (monoid_unit G')); (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) *) auto with algebra. Defined. Definition group_hom_unit : Hom G G'. (* Goal: Carrier (@Hom GROUP G (abelian_group_group G')) *) apply (BUILD_HOM_GROUP (G:=G) (G':=G') (ff:=fun x : G => monoid_unit G')). (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) *) auto with algebra. (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) *) auto with algebra. (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) *) auto with algebra. Defined. Definition group_hom_inv : forall f : Hom G G', Hom G G'. (* Goal: forall _ : Carrier (@Hom GROUP G (abelian_group_group G')), Carrier (@Hom GROUP G (abelian_group_group G')) *) intros f0. apply (BUILD_HOM_GROUP (G:=G) (G':=G') (ff:=fun x : G => group_inverse G' (f0 x))). (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) *) auto with algebra. (* Goal: forall x y : Carrier (@Hom GROUP G (abelian_group_group G')), @Equal (@Hom GROUP G (abelian_group_group G')) (group_hom_law x y) (group_hom_law y x) *) intros x y; try assumption. apply Trans with (Ap (sgroup_map (monoid_sgroup_hom f0)) (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) *) (group_inverse G (sgroup_law G x y))); auto with algebra. apply Trans with (Ap (sgroup_map (monoid_sgroup_hom f0)) (sgroup_law G (group_inverse G y) (group_inverse G x))); (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) *) auto with algebra. apply Trans with (sgroup_law G' (Ap (sgroup_map (monoid_sgroup_hom f0)) (group_inverse G y)) (Ap (sgroup_map (monoid_sgroup_hom f0)) (group_inverse G x))); (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) *) auto with algebra. apply Trans with (sgroup_law G' (Ap (sgroup_map (monoid_sgroup_hom f0)) (group_inverse G x)) (Ap (sgroup_map (monoid_sgroup_hom f0)) (group_inverse G y))); (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) *) auto with algebra. apply Trans with (Ap (sgroup_map (monoid_sgroup_hom f0)) (group_inverse G (monoid_unit G))); (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) *) auto with algebra. apply Trans with (Ap (sgroup_map (monoid_sgroup_hom f0)) (monoid_unit G)); (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) *) auto with algebra. Defined. Definition group_hom : ABELIAN_GROUP. apply (BUILD_ABELIAN_GROUP (E:=Hom G G') (genlaw:=group_hom_law) (e:=group_hom_unit) (geninv:=group_hom_inv)). (* Goal: forall (x x' y y' : Carrier (@Hom GROUP G (abelian_group_group G'))) (_ : @Equal (@Hom GROUP G (abelian_group_group G')) x x') (_ : @Equal (@Hom GROUP G (abelian_group_group G')) y y'), @Equal (@Hom GROUP G (abelian_group_group G')) (group_hom_law x y) (group_hom_law x' y') *) (* Goal: forall x y z : Carrier (@Hom GROUP G (abelian_group_group G')), @Equal (@Hom GROUP G (abelian_group_group G')) (group_hom_law (group_hom_law x y) z) (group_hom_law x (group_hom_law y z)) *) (* Goal: forall x : Carrier (@Hom GROUP G (abelian_group_group G')), @Equal (@Hom GROUP G (abelian_group_group G')) (group_hom_law x group_hom_unit) x *) (* Goal: forall (x y : Carrier (@Hom GROUP G (abelian_group_group G'))) (_ : @Equal (@Hom GROUP G (abelian_group_group G')) x y), @Equal (@Hom GROUP G (abelian_group_group G')) (group_hom_inv x) (group_hom_inv y) *) (* Goal: forall x : Carrier (@Hom GROUP G (abelian_group_group G')), @Equal (@Hom GROUP G (abelian_group_group G')) (group_hom_law x (group_hom_inv x)) group_hom_unit *) (* Goal: forall x y : Carrier (@Hom GROUP G (abelian_group_group G')), @Equal (@Hom GROUP G (abelian_group_group G')) (group_hom_law x y) (group_hom_law y x) *) intros x x' y y' H' H'0; try assumption. (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1)) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x1 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))))) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1)) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x1 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))))) x0) *) simpl in |- *. (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (fun (x0 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))))) (@f2 G (abelian_group_group G') (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) (fun (x0 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))))) *) red in |- *. (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1)) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x1 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))))) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1)) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x1 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))))) x0) *) simpl in |- *. (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) *) auto with algebra. (* Goal: forall x y z : Carrier (@Hom GROUP G (abelian_group_group G')), @Equal (@Hom GROUP G (abelian_group_group G')) (group_hom_law (group_hom_law x y) z) (group_hom_law x (group_hom_law y z)) *) (* Goal: forall x : Carrier (@Hom GROUP G (abelian_group_group G')), @Equal (@Hom GROUP G (abelian_group_group G')) (group_hom_law x group_hom_unit) x *) (* Goal: forall (x y : Carrier (@Hom GROUP G (abelian_group_group G'))) (_ : @Equal (@Hom GROUP G (abelian_group_group G')) x y), @Equal (@Hom GROUP G (abelian_group_group G')) (group_hom_inv x) (group_hom_inv y) *) (* Goal: forall x : Carrier (@Hom GROUP G (abelian_group_group G')), @Equal (@Hom GROUP G (abelian_group_group G')) (group_hom_law x (group_hom_inv x)) group_hom_unit *) (* Goal: forall x y : Carrier (@Hom GROUP G (abelian_group_group G')), @Equal (@Hom GROUP G (abelian_group_group G')) (group_hom_law x y) (group_hom_law y x) *) intros x y z; try assumption. (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1)) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x1 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))))) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1)) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x1 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))))) x0) *) simpl in |- *. (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (fun (x0 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))))) (@f2 G (abelian_group_group G') (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) (fun (x0 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))))) *) red in |- *. (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1)) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x1 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))))) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1)) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x1 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))))) x0) *) simpl in |- *. (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) *) auto with algebra. (* Goal: forall x : Carrier (@Hom GROUP G (abelian_group_group G')), @Equal (@Hom GROUP G (abelian_group_group G')) (group_hom_law x (group_hom_inv x)) group_hom_unit *) (* Goal: forall x y : Carrier (@Hom GROUP G (abelian_group_group G')), @Equal (@Hom GROUP G (abelian_group_group G')) (group_hom_law x y) (group_hom_law y x) *) intros x; try assumption. (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1)) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x1 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))))) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1)) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x1 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))))) x0) *) simpl in |- *. (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (fun (x0 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))))) (@f2 G (abelian_group_group G') (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) (fun (x0 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))))) *) red in |- *. (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1)) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x1 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))))) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1)) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x1 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))))) x0) *) simpl in |- *. (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) *) auto with algebra. (* Goal: forall (x y : Carrier (@Hom GROUP G (abelian_group_group G'))) (_ : @Equal (@Hom GROUP G (abelian_group_group G')) x y), @Equal (@Hom GROUP G (abelian_group_group G')) (group_hom_inv x) (group_hom_inv y) *) (* Goal: forall x : Carrier (@Hom GROUP G (abelian_group_group G')), @Equal (@Hom GROUP G (abelian_group_group G')) (group_hom_law x (group_hom_inv x)) group_hom_unit *) (* Goal: forall x y : Carrier (@Hom GROUP G (abelian_group_group G')), @Equal (@Hom GROUP G (abelian_group_group G')) (group_hom_law x y) (group_hom_law y x) *) intros x y H'; try assumption. (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1)) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x1 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))))) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1)) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x1 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))))) x0) *) simpl in |- *. (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (fun (x0 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))))) (@f2 G (abelian_group_group G') (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) (fun (x0 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))))) *) red in |- *. (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1)) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x1 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))))) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1)) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x1 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))))) x0) *) simpl in |- *. (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) *) auto with algebra. (* Goal: forall x : Carrier (@Hom GROUP G (abelian_group_group G')), @Equal (@Hom GROUP G (abelian_group_group G')) (group_hom_law x (group_hom_inv x)) group_hom_unit *) (* Goal: forall x y : Carrier (@Hom GROUP G (abelian_group_group G')), @Equal (@Hom GROUP G (abelian_group_group G')) (group_hom_law x y) (group_hom_law y x) *) intros x; try assumption. (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1)) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x1 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))))) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1)) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x1 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))))) x0) *) simpl in |- *. (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (fun (x0 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))))) (@f2 G (abelian_group_group G') (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) (fun (x0 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))))) *) red in |- *. (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1)) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x1 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))))) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1)) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x1 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))))) x0) *) simpl in |- *. (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) *) auto with algebra. (* Goal: forall x y : Carrier (@Hom GROUP G (abelian_group_group G')), @Equal (@Hom GROUP G (abelian_group_group G')) (group_hom_law x y) (group_hom_law y x) *) intros x y; try assumption. (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1)) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x1 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))))) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1)) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x1 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))))) x0) *) simpl in |- *. (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (fun (x0 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))))) (@f2 G (abelian_group_group G') (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) (fun (x0 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))))) *) red in |- *. (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1)) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x1 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))))) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@f2 G (abelian_group_group G') (fun x1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1)) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x1 y0) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) y0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) y0) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)))) (@Ap_comp (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x1 y0 H (@Refl (MAP (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G'))))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)))))) x0) *) simpl in |- *. (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) *) auto with algebra. Defined. Lemma group_hom_law_prop : forall (f g : group_hom) (x : G), Equal (sgroup_law _ f g x) (sgroup_law _ (f x) (g x)). (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) *) simpl in |- *; auto with algebra. Qed. Lemma group_hom_unit_prop : forall x : G, Equal (monoid_unit group_hom x) (monoid_unit G'). (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) *) simpl in |- *; auto with algebra. Qed. Lemma group_hom_inv_prop : forall (f : group_hom) (x : G), Equal (group_inverse group_hom f x) (group_inverse G' (f x)). (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) y)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G')))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid (abelian_group_group G'))) (@monoid_sgroup_hom (group_monoid G) (group_monoid (abelian_group_group G')) x)) x0)) *) simpl in |- *; auto with algebra. Qed. End Def. Hint Resolve group_hom_law_prop group_hom_unit_prop group_hom_inv_prop: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Automatic Coercions Import. Set Implicit Arguments. Unset Strict Implicit. Require Export Module_cat. Require Export Abelian_group_facts. Section Lemmas. Variable R : RING. Variable Mod : MODULE R. Lemma MODULE_comp : forall (a b : R) (x y : Mod), Equal a b -> Equal x y -> Equal (module_mult a x) (module_mult b y). (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod a x) (@module_mult R Mod b y) *) intros a b x y H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod a x) (@module_mult R Mod b y) *) apply Trans with (module_mult a y); unfold module_mult in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@Ap (sgroup_set (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))))) (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))))) (@sgroup_map (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))))) (@monoid_sgroup_hom (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))) (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (@module_op R (@module_carrier R Mod) (@module_on_def R Mod)))) a) y) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@Ap (sgroup_set (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))))) (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))))) (@sgroup_map (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))))) (@monoid_sgroup_hom (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))) (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (@module_op R (@module_carrier R Mod) (@module_on_def R Mod)))) b) y) *) apply Ap_comp; auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@Ap (sgroup_set (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))))) (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))))) (@sgroup_map (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))))) (@monoid_sgroup_hom (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))) (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (@module_op R (@module_carrier R Mod) (@module_on_def R Mod)))) a) y) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@Ap (sgroup_set (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))))) (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))))) (@sgroup_map (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))))) (@monoid_sgroup_hom (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))) (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (@module_op R (@module_carrier R Mod) (@module_on_def R Mod)))) b) y) *) apply Ap_comp; auto with algebra. Qed. Lemma MODULE_assoc : forall (a b : R) (x : Mod), Equal (module_mult (ring_mult a b) x) (module_mult a (module_mult b x)). (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod (@ring_mult R a b) x) (@module_mult R Mod a (@module_mult R Mod b x)) *) exact (operation_assoc (module_op Mod)). Qed. Lemma MODULE_dist_r : forall (a b : R) (x : Mod), Equal (module_mult (sgroup_law R a b) x) (sgroup_law Mod (module_mult a x) (module_mult b x)). (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a b) x) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@module_mult R Mod a x) (@module_mult R Mod b x)) *) exact (module_op_lin_left_prf Mod). Qed. Lemma MODULE_dist_l : forall (a : R) (x y : Mod), Equal (module_mult a (sgroup_law Mod x y)) (sgroup_law Mod (module_mult a x) (module_mult a y)). (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) x y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@module_mult R Mod a x) (@module_mult R Mod a y)) *) exact (module_op_lin_right_prf Mod). Qed. Lemma MODULE_unit_l : forall x : Mod, Equal (module_mult (ring_unit R) x) x. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod (ring_unit R) x) x *) exact (operation_unit (module_op Mod)). Qed. Hint Resolve MODULE_comp MODULE_dist_r MODULE_dist_l MODULE_assoc MODULE_unit_l: algebra. Lemma MODULE_absorbant_l : forall x : Mod, Equal (module_mult (monoid_unit R) x) (monoid_unit Mod). (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod))))) *) intros x; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod))))) *) apply GROUP_reg_left with (module_mult (monoid_unit R) x); auto with algebra. apply Trans with (module_mult (sgroup_law R (monoid_unit R) (monoid_unit R)) x); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a (group_inverse (abelian_group_group (ring_group R)) a)) x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod))))) *) apply Trans with (module_mult (monoid_unit R) x); auto with algebra. Qed. Lemma MODULE_absorbant_r : forall a : R, Equal (module_mult a (monoid_unit Mod)) (monoid_unit Mod). (* Goal: forall a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod a (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod))))) *) intros a; try assumption. apply GROUP_reg_left with (module_mult a (monoid_unit (module_carrier Mod))); auto with algebra. apply Trans with (module_mult a (sgroup_law Mod (monoid_unit Mod) (monoid_unit Mod))); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) x (group_inverse (abelian_group_group (@module_carrier R Mod)) x))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod))))) *) apply Trans with (module_mult a (monoid_unit Mod)); auto with algebra. Qed. Lemma MODULE_mult_op_r : forall (a : R) (x : Mod), Equal (module_mult a (group_inverse Mod x)) (group_inverse Mod (module_mult a x)). (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod (group_inverse (abelian_group_group (ring_group R)) a) x) (group_inverse (abelian_group_group (@module_carrier R Mod)) (@module_mult R Mod a x)) *) intros a x; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod (group_inverse (abelian_group_group (ring_group R)) a) x) (group_inverse (abelian_group_group (@module_carrier R Mod)) (@module_mult R Mod a x)) *) apply Sym. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (group_inverse (abelian_group_group (@module_carrier R Mod)) (@module_mult R Mod a x)) (@module_mult R Mod (group_inverse (abelian_group_group (ring_group R)) a) x) *) apply GROUP_law_inverse. apply Trans with (module_mult a (sgroup_law Mod x (group_inverse Mod x))); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) x (group_inverse (abelian_group_group (@module_carrier R Mod)) x))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod))))) *) apply Trans with (module_mult a (monoid_unit Mod)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod a (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod))))) *) apply MODULE_absorbant_r. Qed. Lemma MODULE_mult_op_l : forall (a : R) (x : Mod), Equal (module_mult (group_inverse R a) x) (group_inverse Mod (module_mult a x)). (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod (group_inverse (abelian_group_group (ring_group R)) a) x) (group_inverse (abelian_group_group (@module_carrier R Mod)) (@module_mult R Mod a x)) *) intros a x; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod (group_inverse (abelian_group_group (ring_group R)) a) x) (group_inverse (abelian_group_group (@module_carrier R Mod)) (@module_mult R Mod a x)) *) apply Sym. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (group_inverse (abelian_group_group (@module_carrier R Mod)) (@module_mult R Mod a x)) (@module_mult R Mod (group_inverse (abelian_group_group (ring_group R)) a) x) *) apply GROUP_law_inverse. apply Trans with (module_mult (sgroup_law R a (group_inverse R a)) x); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a (group_inverse (abelian_group_group (ring_group R)) a)) x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod))))) *) apply Trans with (module_mult (monoid_unit R) x); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod))))) *) apply MODULE_absorbant_l. Qed. Variable Mod' : MODULE R. Variable f : Hom Mod Mod'. Lemma MODULE_hom_prop : forall (a : R) (x : Mod), Equal (f (module_mult a x)) (module_mult a (f x)). (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod'))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod'))) (@module_monoid_hom R Mod Mod' f))) (@module_mult R Mod a x)) (@module_mult R Mod' a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod'))) (@module_monoid_hom R Mod Mod' f))) x)) *) case f; auto with algebra. Qed. End Lemmas. Hint Resolve MODULE_comp MODULE_assoc MODULE_dist_r MODULE_dist_l MODULE_unit_l MODULE_absorbant_l MODULE_absorbant_r MODULE_mult_op_l MODULE_mult_op_r MODULE_hom_prop: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Automatic Coercions Import. Set Implicit Arguments. Unset Strict Implicit. Require Export Field_facts. Require Export Cfield_cat. (** Title "Basic properties of commutative fields." *) Section Lemmas1. Variable K : CFIELD. Lemma CFIELD_com : forall x y : K, Equal (ring_mult x y) (ring_mult y x). (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) x y) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) y x) *) exact (cring_com_prf K). Qed. Hint Immediate CFIELD_com: algebra. Lemma CFIELD_inverse_law2 : forall x y : K, ~ Equal x (monoid_unit K) -> ~ Equal y (monoid_unit K) -> Equal (field_inverse (ring_mult x y)) (ring_mult (field_inverse x) (field_inverse y)). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)))))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)))))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)))))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)))))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)))))))) (@field_inverse (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) x y)) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) (@field_inverse (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)) x) (@field_inverse (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)) y)) *) intros x y H' H'0; try assumption. apply Trans with (ring_mult (field_inverse y) (field_inverse x):K); (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) y (@field_inverse (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)) z)) x) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) y x) (@field_inverse (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)) z)) *) auto with algebra. Qed. Hint Resolve CFIELD_inverse_law2: algebra. Lemma CFIELD_simpl_l : forall x y : K, ~ Equal y (monoid_unit K) -> Equal (ring_mult y (field_div x y)) x. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)))))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)))))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) y (@field_div (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)) x y)) x *) intros x y H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) y (@field_div (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)) x y)) x *) apply Trans with (ring_mult (field_div x y) y:K); auto with algebra. Qed. Hint Resolve CFIELD_simpl_l: algebra. Comments "Normalisation.". Lemma CFIELD_mult4 : forall a b c d : K, Equal (ring_mult (ring_mult a b) (ring_mult c d)) (ring_mult (ring_mult a c) (ring_mult b d)). (* Goal: forall a b c d : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) a b) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) c d)) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) a c) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) b d)) *) exact (CRING_mult4 (R1:=K)). Qed. Hint Resolve CRING_mult4: algebra. Lemma CFIELD_mult3 : forall x y z : K, Equal (ring_mult x (ring_mult y z)) (ring_mult y (ring_mult x z)). (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) x (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) y z)) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) y (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) x z)) *) exact (CRING_mult3 (R1:=K)). Qed. Hint Resolve CFIELD_mult3: algebra. Lemma CFIELD_mult3bis : forall x y z : K, Equal (ring_mult (ring_mult x y) z) (ring_mult (ring_mult x z) y). (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) x y) z) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) x z) y) *) exact (CRING_mult3bis (R1:=K)). Qed. Hint Resolve CFIELD_mult3bis: algebra. Lemma CFIELD_mult_div_r : forall x y z : K, Equal (ring_mult (field_div y z) x) (field_div (ring_mult y x) z). (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) (@field_div (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)) y z) x) (@field_div (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) y x) z) *) unfold field_div in |- *. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) y (@field_inverse (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)) z)) x) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K))) y x) (@field_inverse (@Build_field (cring_ring (cfield_ring K)) (cfield_on_def K)) z)) *) auto with algebra. Qed. End Lemmas1. Hint Resolve CFIELD_inverse_law2 CFIELD_simpl_l CFIELD_mult4 CFIELD_mult3 CFIELD_mult3bis CFIELD_mult_div_r: algebra. Hint Immediate CFIELD_com: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Sgroup_facts. Require Export Parts. Section Def. Variable G : SGROUP. Section Sub_sgroup. Variable H : part_set G. Hypothesis Hprop : forall x y : G, in_part x H -> in_part y H -> in_part (sgroup_law _ x y) H. Definition subsgroup_law : law_of_composition H. (* Goal: Carrier (law_of_composition (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H))) *) unfold law_of_composition in |- *. apply (Build_Map (A:=cart (set_of_subtype_image (part H)) (set_of_subtype_image (part H))) (B:=H) (Ap:=fun x : cart (set_of_subtype_image (part H)) (set_of_subtype_image (part H)) => Build_subtype (Hprop (subtype_prf (proj1 x)) (subtype_prf (proj2 x))))). (* Goal: @injective (sgroup_set (@sgroup_of_subsgroup G H)) (sgroup_set G) (@sgroup_map (@sgroup_of_subsgroup G H) G inj_subsgroup) *) red in |- *. (* Goal: forall x y z : @subtype (sgroup_set G) H, @Equal (sgroup_set G) (@subtype_elt (sgroup_set G) H (@Build_subtype (sgroup_set G) H (sgroup_law G (sgroup_law G (@subtype_elt (sgroup_set G) H x) (@subtype_elt (sgroup_set G) H y)) (@subtype_elt (sgroup_set G) H z)) (@Hprop (sgroup_law G (@subtype_elt (sgroup_set G) H x) (@subtype_elt (sgroup_set G) H y)) (@subtype_elt (sgroup_set G) H z) (@Hprop (@subtype_elt (sgroup_set G) H x) (@subtype_elt (sgroup_set G) H y) (@subtype_prf (sgroup_set G) H x) (@subtype_prf (sgroup_set G) H y)) (@subtype_prf (sgroup_set G) H z)))) (@subtype_elt (sgroup_set G) H (@Build_subtype (sgroup_set G) H (sgroup_law G (@subtype_elt (sgroup_set G) H x) (sgroup_law G (@subtype_elt (sgroup_set G) H y) (@subtype_elt (sgroup_set G) H z))) (@Hprop (@subtype_elt (sgroup_set G) H x) (sgroup_law G (@subtype_elt (sgroup_set G) H y) (@subtype_elt (sgroup_set G) H z)) (@subtype_prf (sgroup_set G) H x) (@Hprop (@subtype_elt (sgroup_set G) H y) (@subtype_elt (sgroup_set G) H z) (@subtype_prf (sgroup_set G) H y) (@subtype_prf (sgroup_set G) H z))))) *) simpl in |- *. (* Goal: forall (x y : cart_type (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H))) (_ : and (@subtype_image_equal (sgroup_set G) (@subtype (sgroup_set G) H) (@subtype_elt (sgroup_set G) H) (@cart_l (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x) (@cart_l (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)) (@subtype_image_equal (sgroup_set G) (@subtype (sgroup_set G) H) (@subtype_elt (sgroup_set G) H) (@cart_r (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x) (@cart_r (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y))), @Equal (sgroup_set G) (sgroup_law G (@subtype_elt (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_elt (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x))) (sgroup_law G (@subtype_elt (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)) (@subtype_elt (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y))) *) unfold cart_eq, subtype_image_equal in |- *. (* Goal: forall x y z : @subtype (sgroup_set G) H, @Equal (sgroup_set G) (@subtype_elt (sgroup_set G) H (@Build_subtype (sgroup_set G) H (sgroup_law G (sgroup_law G (@subtype_elt (sgroup_set G) H x) (@subtype_elt (sgroup_set G) H y)) (@subtype_elt (sgroup_set G) H z)) (@Hprop (sgroup_law G (@subtype_elt (sgroup_set G) H x) (@subtype_elt (sgroup_set G) H y)) (@subtype_elt (sgroup_set G) H z) (@Hprop (@subtype_elt (sgroup_set G) H x) (@subtype_elt (sgroup_set G) H y) (@subtype_prf (sgroup_set G) H x) (@subtype_prf (sgroup_set G) H y)) (@subtype_prf (sgroup_set G) H z)))) (@subtype_elt (sgroup_set G) H (@Build_subtype (sgroup_set G) H (sgroup_law G (@subtype_elt (sgroup_set G) H x) (sgroup_law G (@subtype_elt (sgroup_set G) H y) (@subtype_elt (sgroup_set G) H z))) (@Hprop (@subtype_elt (sgroup_set G) H x) (sgroup_law G (@subtype_elt (sgroup_set G) H y) (@subtype_elt (sgroup_set G) H z)) (@subtype_prf (sgroup_set G) H x) (@Hprop (@subtype_elt (sgroup_set G) H y) (@subtype_elt (sgroup_set G) H z) (@subtype_prf (sgroup_set G) H y) (@subtype_prf (sgroup_set G) H z))))) *) simpl in |- *. (* Goal: forall (x y : cart_type (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H))) (_ : and (@subtype_image_equal (sgroup_set G) (@subtype (sgroup_set G) H) (@subtype_elt (sgroup_set G) H) (@cart_l (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x) (@cart_l (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)) (@subtype_image_equal (sgroup_set G) (@subtype (sgroup_set G) H) (@subtype_elt (sgroup_set G) H) (@cart_r (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x) (@cart_r (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y))), @Equal (sgroup_set G) (sgroup_law G (@subtype_elt (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_elt (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x))) (sgroup_law G (@subtype_elt (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)) (@subtype_elt (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y))) *) unfold cart_eq, subtype_image_equal in |- *. (* Goal: forall (x y : cart_type (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H))) (_ : and (@Equal (sgroup_set G) (@subtype_elt (sgroup_set G) H (@cart_l (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_elt (sgroup_set G) H (@cart_l (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y))) (@Equal (sgroup_set G) (@subtype_elt (sgroup_set G) H (@cart_r (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_elt (sgroup_set G) H (@cart_r (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)))), @Equal (sgroup_set G) (sgroup_law G (@subtype_elt (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_elt (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x))) (sgroup_law G (@subtype_elt (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)) (@subtype_elt (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y))) *) intuition. Defined. Definition subsgroup_sgroup : sgroup. (* Goal: sgroup *) apply (Build_sgroup (sgroup_set:=H)). (* Goal: sgroup_on (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) *) apply (Build_sgroup_on (E:=H) (sgroup_law_map:=subsgroup_law)). (* Goal: @injective (sgroup_set (@sgroup_of_subsgroup G H)) (sgroup_set G) (@sgroup_map (@sgroup_of_subsgroup G H) G inj_subsgroup) *) red in |- *. (* Goal: forall x y z : @subtype (sgroup_set G) H, @Equal (sgroup_set G) (@subtype_elt (sgroup_set G) H (@Build_subtype (sgroup_set G) H (sgroup_law G (sgroup_law G (@subtype_elt (sgroup_set G) H x) (@subtype_elt (sgroup_set G) H y)) (@subtype_elt (sgroup_set G) H z)) (@Hprop (sgroup_law G (@subtype_elt (sgroup_set G) H x) (@subtype_elt (sgroup_set G) H y)) (@subtype_elt (sgroup_set G) H z) (@Hprop (@subtype_elt (sgroup_set G) H x) (@subtype_elt (sgroup_set G) H y) (@subtype_prf (sgroup_set G) H x) (@subtype_prf (sgroup_set G) H y)) (@subtype_prf (sgroup_set G) H z)))) (@subtype_elt (sgroup_set G) H (@Build_subtype (sgroup_set G) H (sgroup_law G (@subtype_elt (sgroup_set G) H x) (sgroup_law G (@subtype_elt (sgroup_set G) H y) (@subtype_elt (sgroup_set G) H z))) (@Hprop (@subtype_elt (sgroup_set G) H x) (sgroup_law G (@subtype_elt (sgroup_set G) H y) (@subtype_elt (sgroup_set G) H z)) (@subtype_prf (sgroup_set G) H x) (@Hprop (@subtype_elt (sgroup_set G) H y) (@subtype_elt (sgroup_set G) H z) (@subtype_prf (sgroup_set G) H y) (@subtype_prf (sgroup_set G) H z))))) *) simpl in |- *. (* Goal: forall x y z : @subtype (sgroup_set G) H, @subtype_image_equal (sgroup_set G) (@subtype (sgroup_set G) H) (@subtype_elt (sgroup_set G) H) (@Build_subtype (sgroup_set G) H (sgroup_law G (sgroup_law G (@subtype_elt (sgroup_set G) H x) (@subtype_elt (sgroup_set G) H y)) (@subtype_elt (sgroup_set G) H z)) (@Hprop (sgroup_law G (@subtype_elt (sgroup_set G) H x) (@subtype_elt (sgroup_set G) H y)) (@subtype_elt (sgroup_set G) H z) (@Hprop (@subtype_elt (sgroup_set G) H x) (@subtype_elt (sgroup_set G) H y) (@subtype_prf (sgroup_set G) H x) (@subtype_prf (sgroup_set G) H y)) (@subtype_prf (sgroup_set G) H z))) (@Build_subtype (sgroup_set G) H (sgroup_law G (@subtype_elt (sgroup_set G) H x) (sgroup_law G (@subtype_elt (sgroup_set G) H y) (@subtype_elt (sgroup_set G) H z))) (@Hprop (@subtype_elt (sgroup_set G) H x) (sgroup_law G (@subtype_elt (sgroup_set G) H y) (@subtype_elt (sgroup_set G) H z)) (@subtype_prf (sgroup_set G) H x) (@Hprop (@subtype_elt (sgroup_set G) H y) (@subtype_elt (sgroup_set G) H z) (@subtype_prf (sgroup_set G) H y) (@subtype_prf (sgroup_set G) H z)))) *) unfold subtype_image_equal in |- *. (* Goal: forall x y z : @subtype (sgroup_set G) H, @Equal (sgroup_set G) (@subtype_elt (sgroup_set G) H (@Build_subtype (sgroup_set G) H (sgroup_law G (sgroup_law G (@subtype_elt (sgroup_set G) H x) (@subtype_elt (sgroup_set G) H y)) (@subtype_elt (sgroup_set G) H z)) (@Hprop (sgroup_law G (@subtype_elt (sgroup_set G) H x) (@subtype_elt (sgroup_set G) H y)) (@subtype_elt (sgroup_set G) H z) (@Hprop (@subtype_elt (sgroup_set G) H x) (@subtype_elt (sgroup_set G) H y) (@subtype_prf (sgroup_set G) H x) (@subtype_prf (sgroup_set G) H y)) (@subtype_prf (sgroup_set G) H z)))) (@subtype_elt (sgroup_set G) H (@Build_subtype (sgroup_set G) H (sgroup_law G (@subtype_elt (sgroup_set G) H x) (sgroup_law G (@subtype_elt (sgroup_set G) H y) (@subtype_elt (sgroup_set G) H z))) (@Hprop (@subtype_elt (sgroup_set G) H x) (sgroup_law G (@subtype_elt (sgroup_set G) H y) (@subtype_elt (sgroup_set G) H z)) (@subtype_prf (sgroup_set G) H x) (@Hprop (@subtype_elt (sgroup_set G) H y) (@subtype_elt (sgroup_set G) H z) (@subtype_prf (sgroup_set G) H y) (@subtype_prf (sgroup_set G) H z))))) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (@sgroup_of_subsgroup G H))) (_ : @Equal (sgroup_set G) (@Ap (sgroup_set (@sgroup_of_subsgroup G H)) (sgroup_set G) (@sgroup_map (@sgroup_of_subsgroup G H) G inj_subsgroup) x) (@Ap (sgroup_set (@sgroup_of_subsgroup G H)) (sgroup_set G) (@sgroup_map (@sgroup_of_subsgroup G H) G inj_subsgroup) y)), @Equal (sgroup_set (@sgroup_of_subsgroup G H)) x y *) auto with algebra. Defined. End Sub_sgroup. Record subsgroup : Type := {subsgroup_part : Predicate G; subsgroup_prop : forall x y : G, in_part x subsgroup_part -> in_part y subsgroup_part -> in_part (sgroup_law _ x y) subsgroup_part}. Definition sgroup_of_subsgroup (H : subsgroup) := subsgroup_sgroup (subsgroup_prop (s:=H)). End Def. Coercion sgroup_of_subsgroup : subsgroup >-> sgroup. Coercion subsgroup_part : subsgroup >-> Predicate. Section Injection. Variable G : SGROUP. Variable H : subsgroup G. Lemma subsgroup_in_prop : forall x y : G, in_part x H -> in_part y H -> in_part (sgroup_law _ x y) H. (* Goal: forall (x y : Carrier (sgroup_set G)) (_ : @in_part (sgroup_set G) x (@subsgroup_part G H)) (_ : @in_part (sgroup_set G) y (@subsgroup_part G H)), @in_part (sgroup_set G) (sgroup_law G x y) (@subsgroup_part G H) *) intros x y H' H'0; try assumption. (* Goal: forall (x y : Carrier (sgroup_set (@sgroup_of_subsgroup G H))) (_ : @Equal (sgroup_set G) (@Ap (sgroup_set (@sgroup_of_subsgroup G H)) (sgroup_set G) (@sgroup_map (@sgroup_of_subsgroup G H) G inj_subsgroup) x) (@Ap (sgroup_set (@sgroup_of_subsgroup G H)) (sgroup_set G) (@sgroup_map (@sgroup_of_subsgroup G H) G inj_subsgroup) y)), @Equal (sgroup_set (@sgroup_of_subsgroup G H)) x y *) apply (subsgroup_prop (G:=G) (s:=H)); auto with algebra. Qed. Definition inj_subsgroup : Hom (H:SGROUP) G. (* Goal: Carrier (@Hom SGROUP (@sgroup_of_subsgroup G H : Ob SGROUP) G) *) apply (Build_sgroup_hom (E:=H) (F:=G) (sgroup_map:=inj_part H)). (* Goal: @injective (sgroup_set (@sgroup_of_subsgroup G H)) (sgroup_set G) (@sgroup_map (@sgroup_of_subsgroup G H) G inj_subsgroup) *) red in |- *. (* Goal: forall (x y : Carrier (sgroup_set (@sgroup_of_subsgroup G H))) (_ : @Equal (sgroup_set G) (@Ap (sgroup_set (@sgroup_of_subsgroup G H)) (sgroup_set G) (@sgroup_map (@sgroup_of_subsgroup G H) G inj_subsgroup) x) (@Ap (sgroup_set (@sgroup_of_subsgroup G H)) (sgroup_set G) (@sgroup_map (@sgroup_of_subsgroup G H) G inj_subsgroup) y)), @Equal (sgroup_set (@sgroup_of_subsgroup G H)) x y *) auto with algebra. Defined. Lemma inj_subgroup_injective : injective inj_subsgroup. (* Goal: @injective (sgroup_set (@sgroup_of_subsgroup G H)) (sgroup_set G) (@sgroup_map (@sgroup_of_subsgroup G H) G inj_subsgroup) *) red in |- *. (* Goal: forall (x y : Carrier (sgroup_set (@sgroup_of_subsgroup G H))) (_ : @Equal (sgroup_set G) (@Ap (sgroup_set (@sgroup_of_subsgroup G H)) (sgroup_set G) (@sgroup_map (@sgroup_of_subsgroup G H) G inj_subsgroup) x) (@Ap (sgroup_set (@sgroup_of_subsgroup G H)) (sgroup_set G) (@sgroup_map (@sgroup_of_subsgroup G H) G inj_subsgroup) y)), @Equal (sgroup_set (@sgroup_of_subsgroup G H)) x y *) auto with algebra. Qed. End Injection. Hint Resolve subsgroup_in_prop inj_subgroup_injective: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Union. (** Title "Intersection of two parts." *) Section Inter1. Variable E : Setoid. Definition inter : part_set E -> part_set E -> part_set E. (* Goal: forall (_ : Carrier (part_set E)) (_ : Carrier (part_set E)), Carrier (part_set E) *) intros A B. (* Goal: Carrier (part_set E) *) apply (Build_Predicate (Pred_fun:=fun x : E => in_part x A /\ in_part x B)). (* Goal: @pred_compatible E (fun x : Carrier E => and (@in_part E x A) (@in_part E x B)) *) red in |- *. (* Goal: forall (x y : Carrier E) (_ : and (@in_part E x A) (@in_part E x B)) (_ : @Equal E y x), and (@in_part E y A) (@in_part E y B) *) intros x y H' H'0; try assumption. (* Goal: and (@in_part E y A) (@in_part E y B) *) elim H'; intros H'1 H'2; try exact H'1; clear H'. (* Goal: and (@in_part E y A) (@in_part E y B) *) split; [ try assumption | idtac ]. (* Goal: @in_part E y B *) apply in_part_comp_l with x; auto with algebra. (* Goal: @in_part E y B *) apply in_part_comp_l with x; auto with algebra. Defined. Lemma included_inter_l : forall A B : part_set E, included (inter A B) A. (* Goal: forall (A B C : Carrier (part_set E)) (_ : @included E A C) (_ : @included E B C), @included E (inter A B) C *) unfold included in |- *; simpl in |- *; intuition. Qed. Lemma included_inter_r : forall A B : part_set E, included (inter A B) B. (* Goal: forall (A B C : Carrier (part_set E)) (_ : @included E A C) (_ : @included E B C), @included E (inter A B) C *) unfold included in |- *; simpl in |- *; intuition. Qed. Lemma in_part_inter_l : forall (A B : part_set E) (x : E), in_part x (inter A B) -> in_part x A. (* Goal: forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)), not (@in_part E x (inter A B)) *) simpl in |- *; intuition. Qed. Lemma in_part_inter_r : forall (A B : part_set E) (x : E), in_part x (inter A B) -> in_part x B. (* Goal: forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)), not (@in_part E x (inter A B)) *) simpl in |- *; intuition. Qed. Lemma in_part_inter : forall (A B : part_set E) (x : E), in_part x A -> in_part x B -> in_part x (inter A B). (* Goal: forall A B : Carrier (part_set E), @Equal (part_set E) (inter A B) (inter B A) *) simpl in |- *. intuition. Qed. Lemma inter_not_in_l : forall (A B : part_set E) (x : E), ~ in_part x A -> ~ in_part x (inter A B). (* Goal: forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)), not (@in_part E x (inter A B)) *) simpl in |- *; intuition. Qed. Lemma inter_not_in_r : forall (A B : part_set E) (x : E), ~ in_part x B -> ~ in_part x (inter A B). (* Goal: forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)), not (@in_part E x (inter A B)) *) simpl in |- *; intuition. Qed. Lemma included2_inter : forall A B C : part_set E, included A C -> included B C -> included (inter A B) C. (* Goal: forall (A B C : Carrier (part_set E)) (_ : @included E A C) (_ : @included E B C), @included E (inter A B) C *) unfold included in |- *; simpl in |- *; intuition. Qed. Lemma inter_comp : forall A A' B B' : part_set E, Equal A A' -> Equal B B' -> Equal (inter A B) (inter A' B'). (* Goal: forall A B : Carrier (part_set E), @Equal (part_set E) (inter A B) (inter B A) *) unfold inter in |- *; simpl in |- *. (* Goal: forall A B : Carrier (part_set E), @Equal (part_set E) (inter A B) (inter B A) *) unfold eq_part in |- *; simpl in |- *. (* Goal: forall (A A' B B' : Predicate E) (_ : forall x : Carrier E, and (forall _ : @in_part E x A, @in_part E x A') (forall _ : @in_part E x A', @in_part E x A)) (_ : forall x : Carrier E, and (forall _ : @in_part E x B, @in_part E x B') (forall _ : @in_part E x B', @in_part E x B)) (x : Carrier E), and (forall _ : and (@in_part E x A) (@in_part E x B), and (@in_part E x A') (@in_part E x B')) (forall _ : and (@in_part E x A') (@in_part E x B'), and (@in_part E x A) (@in_part E x B)) *) intros A A' B B' H' H'0 x. (* Goal: and (forall _ : and (@in_part E x A) (@in_part E x B), and (@in_part E x A') (@in_part E x B')) (forall _ : and (@in_part E x A') (@in_part E x B'), and (@in_part E x A) (@in_part E x B)) *) generalize (H' x) (H'0 x); tauto. Qed. Lemma inter_assoc : forall A B C : part_set E, Equal (inter A (inter B C)) (inter (inter A B) C). (* Goal: forall A B : Carrier (part_set E), @Equal (part_set E) (inter A B) (inter B A) *) simpl in |- *. unfold eq_part in |- *. simpl in |- *. (* Goal: forall (A B : Predicate E) (x : Carrier E), and (forall _ : and (@in_part E x A) (@in_part E x B), and (@in_part E x B) (@in_part E x A)) (forall _ : and (@in_part E x B) (@in_part E x A), and (@in_part E x A) (@in_part E x B)) *) tauto. Qed. Lemma inter_com : forall A B : part_set E, Equal (inter A B) (inter B A). (* Goal: forall A B : Carrier (part_set E), @Equal (part_set E) (inter A B) (inter B A) *) simpl in |- *. unfold eq_part in |- *; simpl in |- *. (* Goal: forall (A B : Predicate E) (x : Carrier E), and (forall _ : and (@in_part E x A) (@in_part E x B), and (@in_part E x B) (@in_part E x A)) (forall _ : and (@in_part E x B) (@in_part E x A), and (@in_part E x A) (@in_part E x B)) *) tauto. Qed. Parameter inter_union_dist_r : forall A B C : part_set E, Equal (inter (union A B) C) (union (inter A C) (inter B C)). Parameter inter_union_dist_l : forall A B C : part_set E, Equal (inter A (union B C)) (union (inter A B) (inter A C)). End Inter1. Hint Resolve included_inter_l included_inter_r in_part_inter_l in_part_inter_r in_part_inter included2_inter inter_comp inter_assoc inter_not_in_l inter_not_in_r inter_union_dist_r inter_union_dist_l: algebra. Hint Immediate inter_com: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Global Set Automatic Coercions Import. Global Set Asymmetric Patterns. Set Implicit Arguments. Unset Strict Implicit. (** Title "Sets, relations, maps" *) Section Sets1. Comments "Basically, algebraic structures are sets, in which we talk about elements, belonging, equality," "applications, equivalence relations, quotient sets, etc". Comments "Types in Coq are not well-suited to represent sets, because they cannot be quotiented". Comments "We will define sets in Coq as types with an equivalence relation". Comments "First, we need some definitions on binary relations on types:". Section Relations. Variable E : Type. Definition relation (E : Type) := E -> E -> Prop. Definition app_rel (R : relation E) (x y : E) := R x y. Definition reflexive (R : relation E) : Prop := forall x : E, app_rel R x x. Definition symmetric (R : relation E) : Prop := forall x y : E, app_rel R x y -> app_rel R y x. Definition transitive (R : relation E) : Prop := forall x y z : E, app_rel R x y -> app_rel R y z -> app_rel R x z. Comments "A partial equivalence on" E " is a relation which is transitive and symmetric:". Definition partial_equivalence (R : relation E) : Prop := transitive R /\ symmetric R. Comments "An equivalence relation is reflexive, symmetric and transitive:". Definition equivalence (R : relation E) : Prop := reflexive R /\ partial_equivalence R. Comments "Some immediate properties:". Lemma equiv_refl : forall R : relation E, equivalence R -> reflexive R. (* Goal: forall (R : relation E) (_ : equivalence R), reflexive R *) compute in |- *. tauto. Qed. Lemma equiv_sym : forall R : relation E, equivalence R -> symmetric R. (* Goal: forall (R : forall (_ : E) (_ : E), Prop) (_ : and (forall x : E, R x x) (and (forall (x y z : E) (_ : R x y) (_ : R y z), R x z) (forall (x y : E) (_ : R x y), R y x))) (x : E), R x x *) compute in |- *; tauto. Qed. Lemma equiv_trans : forall R : relation E, equivalence R -> transitive R. (* Goal: forall (R : forall (_ : E) (_ : E), Prop) (_ : and (forall x : E, R x x) (and (forall (x y z : E) (_ : R x y) (_ : R y z), R x z) (forall (x y : E) (_ : R x y), R y x))) (x : E), R x x *) compute in |- *; tauto. Qed. End Relations. Hint Unfold reflexive transitive symmetric partial_equivalence equivalence: algebra. Hint Resolve equiv_refl equiv_sym equiv_trans: algebra. Comments "Then we define a dedicated structure to represent sets:". Record Setoid : Type := {Carrier :> Type; Equal : relation Carrier; Prf_equiv :> equivalence Equal}. Hint Resolve Prf_equiv: algebra. Comments "A set is then given by a type (for its elements), a binary relation" "and a proof that this relation is an equivalence relation". Comments "We will write" (Equal x y) "for the equality of two elements of a set". Lemma Refl : forall (E : Setoid) (x : E), Equal x x. (* Goal: forall (E : Setoid) (x y z : Carrier E) (_ : @Equal E x y) (_ : @Equal E y z), @Equal E x z *) intros E; try assumption. (* Goal: forall x : Carrier E, @Equal E x x *) cut (reflexive (Equal (s:=E))); auto with algebra. Qed. Lemma Sym : forall (E : Setoid) (x y : E), Equal x y -> Equal y x. (* Goal: forall (E : Setoid) (x y z : Carrier E) (_ : @Equal E x y) (_ : @Equal E y z), @Equal E x z *) intros E; try assumption. (* Goal: forall (x y : Carrier E) (_ : @Equal E x y), @Equal E y x *) cut (symmetric (Equal (s:=E))); auto with algebra. Qed. Lemma Trans : forall (E : Setoid) (x y z : E), Equal x y -> Equal y z -> Equal x z. (* Goal: forall (E : Setoid) (x y z : Carrier E) (_ : @Equal E x y) (_ : @Equal E y z), @Equal E x z *) intros E; try assumption. (* Goal: forall (x y z : Carrier E) (_ : @Equal E x y) (_ : @Equal E y z), @Equal E x z *) cut (transitive (Equal (s:=E))); auto with algebra. Qed. Hint Resolve Refl: algebra. Hint Immediate Sym: algebra. Comments "Every type in Coq can be seen as a set, with the Leibnitz equality:". Let eqT_equiv : forall A : Type, equivalence (eq (A:=A)). (* Goal: forall A : Setoid, Carrier (MAP A A) *) intros A; try assumption. (* Goal: @surjective A A (Id A) *) red in |- *. (* Goal: and (@injective A B f) (@surjective A B f) *) split; [ try assumption | idtac ]. (* Goal: @surjective A A (Id A) *) red in |- *. (* Goal: forall (x y : A) (_ : @app_rel A (@eq A) x y), @app_rel A (@eq A) y x *) unfold app_rel in |- *; auto with algebra. (* Goal: @surjective A A (Id A) *) red in |- *. (* Goal: and (@injective A B f) (@surjective A B f) *) split; [ try assumption | idtac ]. (* Goal: @surjective A A (Id A) *) red in |- *. (* Goal: forall (x y : A) (_ : @app_rel A (@eq A) x y), @app_rel A (@eq A) y x *) unfold app_rel in |- *; auto with algebra. (* Goal: forall (x y z : A) (_ : @eq A x y) (_ : @eq A y z), @eq A x z *) (* Goal: @symmetric A (@eq A) *) intros x y z H' H'0; try assumption. (* Goal: @eq A x z *) (* Goal: @symmetric A (@eq A) *) rewrite H'; auto with algebra. (* Goal: @surjective A A (Id A) *) red in |- *. (* Goal: forall (x y : A) (_ : @app_rel A (@eq A) x y), @app_rel A (@eq A) y x *) unfold app_rel in |- *; auto with algebra. Qed. Definition Leibnitz_set (A : Type) : Setoid := Build_Setoid (eqT_equiv A). Lemma Leibnitz_set_prop : forall (A : Type) (x y : Leibnitz_set A), Equal x y -> x = y. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) auto with algebra. Qed. Lemma Leibnitz_set_prop_rev : forall (A : Type) (x y : Leibnitz_set A), x = y -> Equal x y. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) auto with algebra. Qed. Section Quotient1. Comments "We can now define quotient sets, using equivalence relations on sets". Comments "A binary relation on a set is a binary relation on its carrier, which is compatible with equality:". Variable E : Setoid. Definition rel_compatible (R : relation E) : Prop := forall x x' y y' : E, Equal x x' -> Equal y y' -> app_rel R x y -> app_rel R x' y'. Record Relation : Type := {Rel_fun :> relation E; Rel_compatible_prf : rel_compatible Rel_fun}. Lemma Rel_comp : forall (R : Relation) (x x' y y' : E), Equal x x' -> Equal y y' -> app_rel R x y -> app_rel R x' y'. (* Goal: forall (R : Relation) (x x' y y' : Carrier E) (_ : @Equal E x x') (_ : @Equal E y y') (_ : @app_rel (Carrier E) (Rel_fun R) x y), @app_rel (Carrier E) (Rel_fun R) x' y' *) intros R; try assumption. (* Goal: forall (x x' y y' : Carrier E) (_ : @Equal E x x') (_ : @Equal E y y') (_ : @app_rel (Carrier E) (Rel_fun R) x y), @app_rel (Carrier E) (Rel_fun R) x' y' *) exact (Rel_compatible_prf (r:=R)). Qed. Hint Resolve Rel_comp: algebra. Variable R : Relation. Hypothesis R_equiv : equivalence R. Set Strict Implicit. Unset Implicit Arguments. Definition quotient : Setoid := Build_Setoid R_equiv. Set Implicit Arguments. Unset Strict Implicit. End Quotient1. Section Maps1. Comments "Maps between two sets are functions which are compatible with equalities:". Section Maps1_1. Variable A B : Setoid. Definition fun_compatible (f : A -> B) : Prop := forall x y : A, Equal x y -> Equal (f x) (f y). Record Map : Type := {Ap :> A -> B; Map_compatible_prf :> fun_compatible Ap:Prop}. Comments "Two maps are equal when they have the same values:". Definition Map_eq (f g : Map) : Prop := forall x : A, Equal (f x) (g x). Let Map_eq_equiv : equivalence Map_eq. (* Goal: @surjective A A (Id A) *) red in |- *. (* Goal: and (@injective A B f) (@surjective A B f) *) split; [ try assumption | idtac ]. (* Goal: @surjective A A (Id A) *) red in |- *. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) unfold Map_eq, app_rel in |- *; simpl in |- *; auto with algebra. (* Goal: @surjective A A (Id A) *) red in |- *. (* Goal: and (@injective A B f) (@surjective A B f) *) split; [ try assumption | idtac ]. (* Goal: @surjective A A (Id A) *) red in |- *. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) unfold Map_eq, app_rel in |- *; simpl in |- *; auto with algebra. (* Goal: forall (x y z : Map) (_ : forall x0 : Carrier A, @Equal B (Ap x x0) (Ap y x0)) (_ : forall x0 : Carrier A, @Equal B (Ap y x0) (Ap z x0)) (x0 : Carrier A), @Equal B (Ap x x0) (Ap z x0) *) (* Goal: @symmetric Map Map_eq *) intros x y z H' H'0 x0; try assumption. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) apply Trans with (y x0); auto with algebra. (* Goal: @surjective A A (Id A) *) red in |- *. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) unfold Map_eq, app_rel in |- *; simpl in |- *; auto with algebra. Qed. Definition MAP : Setoid := Build_Setoid Map_eq_equiv. Comments "We note" (MAP A B) "the set of maps between" A "and" B. End Maps1_1. Comments "Some immediate properties of maps:". Lemma Ap_comp : forall (A B : Setoid) (f g : MAP A B) (x y : A), Equal x y -> Equal f g -> Equal (f x) (g y). (* Goal: forall (A B : Setoid) (f g : Carrier (MAP A B)) (x y : Carrier A) (_ : @Equal A x y) (_ : @Equal (MAP A B) f g), @Equal B (@Ap A B f x) (@Ap A B g y) *) intros A B f g x y H' H'0; try assumption. (* Goal: @Equal B (@Ap A B f x) (@Ap A B g y) *) apply Trans with (f y). (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) apply (Map_compatible_prf f); auto with algebra. (* Goal: Rel_fun' x x *) simpl in H'0. (* Goal: @Equal B (@Ap A B f y) (@Ap A B g y) *) unfold Map_eq in H'0. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) auto with algebra. Qed. Hint Resolve Ap_comp: algebra. Lemma map_ext : forall (A B : Setoid) (f g : MAP A B), (forall x : A, Equal (f x) (g x)) -> Equal f g. (* Goal: @Equal (quotient E R p) y (@Ap E (quotient E R p) (surj_set_quo E R p) y) *) simpl in |- *. (* Goal: forall (A B : Setoid) (f g : Map A B) (_ : forall x : Carrier A, @Equal B (@Ap A B f x) (@Ap A B g x)), @Map_eq A B f g *) unfold Map_eq in |- *. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) auto with algebra. Qed. Hint Resolve map_ext: algebra. Section Maps1_2. Comments "We define now injections, surjections and bijections.". Variable A B : Setoid. Definition injective (f : MAP A B) : Prop := forall x y : A, Equal (f x) (f y) -> Equal x y. Definition surjective (f : MAP A B) : Prop := forall y : B, exists x : A, Equal y (f x). Definition bijective (f : MAP A B) : Prop := injective f /\ surjective f. End Maps1_2. Comments "These definitions are coherent with equality of maps:". Lemma injective_comp : forall (A B : Setoid) (f f' : MAP A B), injective f -> Equal f f' -> injective f'. (* Goal: forall (A B C : Setoid) (f : Carrier (MAP A B)) (g : Carrier (MAP B C)) (_ : @injective A C (@comp_map_map A B C g f)), @injective A B f *) unfold injective in |- *. (* Goal: forall (A B : Setoid) (f f' : Carrier (MAP A B)) (_ : forall (x y : Carrier A) (_ : @Equal B (@Ap A B f x) (@Ap A B f y)), @Equal A x y) (_ : @Equal (MAP A B) f f') (x y : Carrier A) (_ : @Equal B (@Ap A B f' x) (@Ap A B f' y)), @Equal A x y *) intros A B f f' H' H'0 x y H'1; try assumption. (* Goal: @Equal A x y *) apply H'. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) apply Trans with (Ap f' x); auto with algebra. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) apply Trans with (Ap f' y); auto with algebra. Qed. Lemma surjective_comp : forall (A B : Setoid) (f f' : MAP A B), surjective f -> Equal f f' -> surjective f'. (* Goal: forall (A B C : Setoid) (f : Carrier (MAP A B)) (g : Carrier (MAP B C)) (_ : @surjective A C (@comp_map_map A B C g f)), @surjective B C g *) unfold surjective in |- *. (* Goal: forall (A B : Setoid) (f f' : Carrier (MAP A B)) (_ : forall y : Carrier B, @ex (Carrier A) (fun x : Carrier A => @Equal B y (@Ap A B f x))) (_ : @Equal (MAP A B) f f') (y : Carrier B), @ex (Carrier A) (fun x : Carrier A => @Equal B y (@Ap A B f' x)) *) intros A B f f' H' H'0 y; try assumption. (* Goal: @ex (Carrier B) (fun x : Carrier B => @Equal C y (@Ap B C g x)) *) elim (H' y); intros x E; try exact E. (* Goal: @ex (Carrier A) (fun x : Carrier A => @Equal B y (@Ap A B f' x)) *) exists x; try assumption. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) apply Trans with (Ap f x); auto with algebra. Qed. Lemma bijective_comp : forall (A B : Setoid) (f f' : MAP A B), bijective f -> Equal f f' -> bijective f'. (* Goal: @bijective A B f *) unfold bijective in |- *. (* Goal: forall (A B : Setoid) (f f' : Carrier (MAP A B)) (_ : and (@injective A B f) (@surjective A B f)) (_ : @Equal (MAP A B) f f'), and (@injective A B f') (@surjective A B f') *) intros A B f f' H' H'0; try assumption. (* Goal: and (@injective A B f) (@surjective A B f) *) split; [ try assumption | idtac ]. (* Goal: @injective A B f' *) (* Goal: @surjective A B f' *) elim H'; intros H'1 H'2; try exact H'1; clear H'. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) apply injective_comp with (f := f); auto with algebra. (* Goal: @surjective A B f' *) elim H'; intros H'1 H'2; try exact H'2; clear H'. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) apply surjective_comp with (f := f); auto with algebra. Qed. Comments "Trivialities:". Lemma bijective_injective : forall (A B : Setoid) (f : MAP A B), bijective f -> injective f. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) intros A B f H'; red in H'; auto with algebra. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) elim H'; auto with algebra. Qed. Hint Resolve bijective_injective: algebra. Lemma bijective_surjective : forall (A B : Setoid) (f : MAP A B), bijective f -> surjective f. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) intros A B f H'; red in H'; auto with algebra. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) elim H'; auto with algebra. Qed. Hint Resolve bijective_surjective: algebra. Set Strict Implicit. Unset Implicit Arguments. Definition surj_set_quo : forall (E : Setoid) (R : Relation E) (p : equivalence R), MAP E (quotient E R p). (* Goal: forall (E : Setoid) (R : Relation E) (p : @equivalence (Carrier E) (@Rel_fun E R)), @surjective E (quotient E R p) (surj_set_quo E R p) *) intros E R p; try assumption. (* Goal: Carrier (MAP E (quotient E R p)) *) apply (Build_Map (A:=E) (B:=quotient E R p) (Ap:=fun x : E => x)). (* Goal: @fun_compatible E (quotient E R p) (fun x : Carrier E => x) *) generalize p; clear p. (* Goal: forall p : @equivalence (Carrier E) (@Rel_fun E R), @fun_compatible E (quotient E R p) (fun x : Carrier E => x) *) elim R. (* Goal: forall (Rel_fun0 : relation (Carrier E)) (Rel_compatible_prf : @rel_compatible E Rel_fun0) (p : @equivalence (Carrier E) (@Rel_fun E (@Build_Relation E Rel_fun0 Rel_compatible_prf))), @fun_compatible E (quotient E (@Build_Relation E Rel_fun0 Rel_compatible_prf) p) (fun x : Carrier E => x) *) intros Rel_fun' Rel_compatible_prf0 p; try assumption. (* Goal: @surjective A A (Id A) *) red in |- *. (* Goal: forall (x y : Carrier E) (_ : @Equal E x y), @Equal (quotient E (@Build_Relation E Rel_fun' Rel_compatible_prf0) p) x y *) red in Rel_compatible_prf0. (* Goal: forall (x y : Carrier E) (_ : @Equal E x y), @Equal (quotient E (@Build_Relation E Rel_fun' Rel_compatible_prf0) p) x y *) intros x y H'; try assumption. (* Goal: @Equal (quotient E R p) y (@Ap E (quotient E R p) (surj_set_quo E R p) y) *) simpl in |- *. (* Goal: Rel_fun' x y *) unfold app_rel in Rel_compatible_prf0. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) apply Rel_compatible_prf0 with (x := x) (y := x); auto with algebra. (* Goal: @Rel_fun E R y y *) elim p. (* Goal: forall (_ : @reflexive (Carrier E) (@Rel_fun E (@Build_Relation E Rel_fun' Rel_compatible_prf0))) (_ : @partial_equivalence (Carrier E) (@Rel_fun E (@Build_Relation E Rel_fun' Rel_compatible_prf0))), Rel_fun' x x *) intros H'0 H'1; try assumption. (* Goal: Rel_fun' x x *) simpl in H'0. (* Goal: Rel_fun' x x *) red in H'0. (* Goal: Rel_fun' x x *) unfold app_rel in H'0. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) auto with algebra. Defined. Set Implicit Arguments. Unset Strict Implicit. Lemma surj_set_quo_surjective : forall (E : Setoid) (R : Relation E) (p : equivalence R), surjective (surj_set_quo E R p). (* Goal: forall (E : Setoid) (R : Relation E) (p : @equivalence (Carrier E) (@Rel_fun E R)), @surjective E (quotient E R p) (surj_set_quo E R p) *) intros E R p; try assumption. (* Goal: @surjective A A (Id A) *) red in |- *. (* Goal: forall y : Carrier (quotient E R p), @ex (Carrier E) (fun x : Carrier E => @Equal (quotient E R p) y (@Ap E (quotient E R p) (surj_set_quo E R p) x)) *) intros y; exists y; try assumption. (* Goal: @Equal (quotient E R p) y (@Ap E (quotient E R p) (surj_set_quo E R p) y) *) simpl in |- *. (* Goal: @Rel_fun E R y y *) elim p. (* Goal: forall (_ : @reflexive (Carrier E) (@Rel_fun E R)) (_ : @partial_equivalence (Carrier E) (@Rel_fun E R)), @Rel_fun E R y y *) intros H'; red in H'. (* Goal: forall _ : @partial_equivalence (Carrier E) (@Rel_fun E R), @Rel_fun E R y y *) unfold app_rel in H'. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) auto with algebra. Qed. Section Maps1_3. Comments "We define the composition of maps:". Variable E F G : Setoid. Variable g : MAP F G. Variable f : MAP E F. Comments "First, we define the composition of the functions associated to two maps:" f "and" g. Definition comp_map_fun (x : E) := g (f x). Comments "Then, we proof that the result is compatible with equality:". Lemma comp_map_fun_compatible : fun_compatible comp_map_fun. (* Goal: @surjective A A (Id A) *) red in |- *. (* Goal: @Equal C (@comp_map_fun A B C g f x) (@comp_map_fun A B C g f y) *) unfold comp_map_fun in |- *. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) auto with algebra. Qed. Comments "With this result, we can build the composed map:". Definition comp_map_map : MAP E G := Build_Map comp_map_fun_compatible. End Maps1_3. Comments "We note" (comp_map_map g f) "the composition of" g "and" f. Comments "Composition is compatible with equality of maps:". Lemma comp_map_comp : forall (A B C : Setoid) (f f' : MAP A B) (g g' : MAP B C), Equal f f' -> Equal g g' -> Equal (comp_map_map g f) (comp_map_map g' f'). (* Goal: @Equal (quotient E R p) y (@Ap E (quotient E R p) (surj_set_quo E R p) y) *) unfold comp_map_map in |- *; simpl in |- *. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) unfold Map_eq in |- *; simpl in |- *; auto with algebra. (* Goal: @Equal C (@comp_map_fun A B C g f x) (@comp_map_fun A B C g f y) *) unfold comp_map_fun in |- *. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) auto with algebra. Qed. Hint Resolve comp_map_comp: algebra. Comments "Composition is associative:". Lemma comp_map_assoc : forall (A B C D : Setoid) (f : MAP A B) (g : MAP B C) (h : MAP C D), Equal (comp_map_map h (comp_map_map g f)) (comp_map_map (comp_map_map h g) f). (* Goal: @Equal (quotient E R p) y (@Ap E (quotient E R p) (surj_set_quo E R p) y) *) unfold comp_map_map in |- *; simpl in |- *. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) unfold Map_eq in |- *; simpl in |- *; auto with algebra. Qed. Hint Resolve comp_map_assoc: algebra. Comments "We define now the identity map:". Definition Id : forall A : Setoid, MAP A A. (* Goal: forall A : Setoid, Carrier (MAP A A) *) intros A; try assumption. (* Goal: Carrier (MAP A A) *) apply (Build_Map (A:=A) (B:=A) (Ap:=fun x : A => x)). (* Goal: @surjective A A (Id A) *) red in |- *. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) auto with algebra. Defined. Comments "Identity map is a unit element for composition:". Lemma Id_unit_r : forall (A B : Setoid) (f : MAP A B), Equal (comp_map_map f (Id A)) f. (* Goal: @Equal (quotient E R p) y (@Ap E (quotient E R p) (surj_set_quo E R p) y) *) unfold comp_map_map in |- *; simpl in |- *. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) unfold Map_eq in |- *; simpl in |- *; auto with algebra. Qed. Hint Resolve Id_unit_r: algebra. Lemma Id_unit_l : forall (A B : Setoid) (f : MAP A B), Equal (comp_map_map (Id B) f) f. (* Goal: @Equal (quotient E R p) y (@Ap E (quotient E R p) (surj_set_quo E R p) y) *) unfold comp_map_map in |- *; simpl in |- *. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) unfold Map_eq in |- *; simpl in |- *; auto with algebra. Qed. Hint Resolve Id_unit_l: algebra. Lemma Id_is_bijective : forall A : Setoid, bijective (Id A). (* Goal: @surjective A A (Id A) *) intros A; red in |- *. (* Goal: and (@injective A A (Id A)) (@surjective A A (Id A)) *) split; [ red in |- * | idtac ]. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) simpl in |- *; auto with algebra. (* Goal: @surjective A A (Id A) *) red in |- *. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) intros y; exists y; try assumption; auto with algebra. Qed. Hint Resolve Id_is_bijective: algebra. Comments "Some properties of composition:". Lemma comp_injective : forall (A B C : Setoid) (f : MAP A B) (g : MAP B C), injective (comp_map_map g f) -> injective f. (* Goal: forall (A B C : Setoid) (f : Carrier (MAP A B)) (g : Carrier (MAP B C)) (_ : @injective A C (@comp_map_map A B C g f)), @injective A B f *) unfold injective in |- *. (* Goal: forall (A B C : Setoid) (f : Carrier (MAP A B)) (g : Carrier (MAP B C)) (_ : forall (x y : Carrier A) (_ : @Equal C (@Ap A C (@comp_map_map A B C g f) x) (@Ap A C (@comp_map_map A B C g f) y)), @Equal A x y) (x y : Carrier A) (_ : @Equal B (@Ap A B f x) (@Ap A B f y)), @Equal A x y *) intros A B C f g H' x y H'0; try assumption. (* Goal: @Equal A x y *) apply H'. (* Goal: @Equal (quotient E R p) y (@Ap E (quotient E R p) (surj_set_quo E R p) y) *) unfold comp_map_map in |- *; simpl in |- *. (* Goal: @Equal C (@comp_map_fun A B C g f x) (@comp_map_fun A B C g f y) *) unfold comp_map_fun in |- *. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) auto with algebra. Qed. Hint Resolve comp_injective: algebra. Lemma comp_surjective : forall (A B C : Setoid) (f : MAP A B) (g : MAP B C), surjective (comp_map_map g f) -> surjective g. (* Goal: forall (A B C : Setoid) (f : Carrier (MAP A B)) (g : Carrier (MAP B C)) (_ : @surjective A C (@comp_map_map A B C g f)), @surjective B C g *) unfold surjective in |- *. (* Goal: forall (A B C : Setoid) (f : Carrier (MAP A B)) (g : Carrier (MAP B C)) (_ : forall y : Carrier C, @ex (Carrier A) (fun x : Carrier A => @Equal C y (@Ap A C (@comp_map_map A B C g f) x))) (y : Carrier C), @ex (Carrier B) (fun x : Carrier B => @Equal C y (@Ap B C g x)) *) intros A B C f g H' y; try assumption. (* Goal: @ex (Carrier B) (fun x : Carrier B => @Equal C y (@Ap B C g x)) *) elim (H' y); intros x E; try exact E. (* Goal: @ex (Carrier B) (fun x : Carrier B => @Equal C y (@Ap B C g x)) *) simpl in E. (* Goal: @ex (Carrier B) (fun x : Carrier B => @Equal C y (@Ap B C g x)) *) unfold comp_map_fun in E. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) exists (Ap f x); try assumption; auto with algebra. Qed. Lemma comp_is_id_then_bijective : forall (A B : Setoid) (f : MAP A B) (g : MAP B A), Equal (comp_map_map g f) (Id A) -> Equal (comp_map_map f g) (Id B) -> bijective f. (* Goal: forall (A B : Setoid) (f : Carrier (MAP A B)) (g : Carrier (MAP B A)) (_ : @Equal (MAP A A) (@comp_map_map A B A g f) (Id A)) (_ : @Equal (MAP B B) (@comp_map_map B A B f g) (Id B)), @bijective A B f *) intros A B f g H' H'0; try assumption. (* Goal: @bijective A B f *) unfold bijective in |- *. (* Goal: and (@injective A B f) (@surjective A B f) *) split; [ try assumption | idtac ]. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) apply comp_injective with A g; auto with algebra. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) apply injective_comp with (f := Id A); auto with algebra. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) apply comp_surjective with B g; auto with algebra. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) apply surjective_comp with (f := Id B); auto with algebra. Qed. Lemma comp_is_id_then_injective : forall (A B : Setoid) (f : MAP A B) (g : MAP B A), Equal (comp_map_map g f) (Id A) -> injective f. (* Goal: forall (A B : Setoid) (f : Carrier (MAP A B)) (g : Carrier (MAP B A)) (_ : @Equal (MAP B B) (@comp_map_map B A B f g) (Id B)), @surjective A B f *) intros A B f g H'; try assumption. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) apply comp_injective with A g; auto with algebra. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) apply injective_comp with (f := Id A); auto with algebra. Qed. Lemma comp_is_id_then_surjective : forall (A B : Setoid) (f : MAP A B) (g : MAP B A), Equal (comp_map_map f g) (Id B) -> surjective f. (* Goal: forall (A B : Setoid) (f : Carrier (MAP A B)) (g : Carrier (MAP B A)) (_ : @Equal (MAP B B) (@comp_map_map B A B f g) (Id B)), @surjective A B f *) intros A B f g H'; try assumption. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) apply comp_surjective with B g; auto with algebra. (* Goal: @Equal C (@Ap B C g (@Ap A B f x)) (@Ap B C g (@Ap A B f y)) *) apply surjective_comp with (f := Id B); auto with algebra. Qed. End Maps1. End Sets1. Hint Immediate Sym: algebra. Hint Unfold reflexive transitive symmetric partial_equivalence equivalence: algebra. Hint Resolve equiv_refl equiv_sym equiv_trans Prf_equiv Refl Rel_comp Ap_comp map_ext bijective_injective bijective_surjective surj_set_quo_surjective comp_map_comp comp_map_assoc Id_unit_r Id_unit_l Id_is_bijective comp_injective: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Module_util. Require Export Sub_module. Require Export Group_kernel. (** Title "Kernel and image of a module homomorphism." *) Section Def. Variable R : RING. Variable Mod Mod2 : MODULE R. Variable f : Hom Mod Mod2. Definition Ker : submodule Mod. (* Goal: @submodule R Mod *) apply (Build_submodule (R:=R) (M:=Mod) (submodule_subgroup:=Ker f)). (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) x) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod2)) (@submodule_subgroup R Mod2 coKer)))) *) simpl in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))))) (_ : @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) x0)))), @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@module_mult R Mod2 a x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) x0))) *) intros a x H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) (@module_mult R Mod a x)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod2))))) *) apply Trans with (module_mult a (f x)); auto with algebra. apply Trans with (module_mult a (monoid_unit (module_carrier Mod2))); (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod2)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod Ker)))) *) auto with algebra. Defined. Definition coKer : submodule Mod2. (* Goal: @submodule R Mod2 *) apply (Build_submodule (R:=R) (M:=Mod2) (submodule_subgroup:=coKer f)). (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) x) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod2)) (@submodule_subgroup R Mod2 coKer)))) *) simpl in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))))) (_ : @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) x0)))), @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@module_mult R Mod2 a x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) x0))) *) intros a x H'; try assumption. (* Goal: @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@module_mult R Mod2 a x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) x0))) *) elim H'; intros x0 E; elim E; intros H'0 H'1; try exact H'1; clear E H'. (* Goal: @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@module_mult R Mod2 a x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) x0))) *) exists (module_mult a x0); split; [ try assumption | idtac ]. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@module_mult R Mod2 a x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) (@module_mult R Mod a x0)) *) apply Trans with (module_mult a (f x0)); auto with algebra. Defined. Lemma Ker_prop : forall x : Mod, in_part x Ker -> Equal (f x) (monoid_unit Mod2). (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod2)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod Ker)))) *) auto with algebra. Qed. Lemma Ker_prop_rev : forall x : Mod, Equal (f x) (monoid_unit Mod2) -> in_part x Ker. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod2)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod Ker)))) *) auto with algebra. Qed. Lemma coKer_prop : forall x : Mod, in_part (f x) coKer. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) x) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod2)) (@submodule_subgroup R Mod2 coKer)))) *) simpl in |- *. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod2)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod Ker)))) *) intros x; exists x; split; [ idtac | try assumption ]; auto with algebra. Qed. End Def. Hint Resolve Ker_prop coKer_prop: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Abelian_group_cat. (** Title "The categories of abelian rings." *) Section Objects. Definition dist_r (E : SET) (f g : law_of_composition E) := forall x y z : E, Equal (f (couple (g (couple x y)) z)) (g (couple (f (couple x z)) (f (couple y z)))). Definition dist_l (E : SET) (f g : law_of_composition E) := forall x y z : E, Equal (f (couple x (g (couple y z)))) (g (couple (f (couple x y)) (f (couple x z)))). Record ring_on (R : abelian_group) : Type := {ring_mult_sgroup : sgroup_on R; ring_mult_monoid : monoid_on ring_mult_sgroup; ring_monoid :> monoid_on ring_mult_monoid; ring_dist_r_prf : dist_r (sgroup_law_map ring_mult_sgroup) (sgroup_law_map R); ring_dist_l_prf : dist_l (sgroup_law_map ring_mult_sgroup) (sgroup_law_map R)}. Record ring : Type := {ring_group :> abelian_group; ring_on_def :> ring_on ring_group}. Coercion Build_ring : ring_on >-> ring. Definition ring_mult (R : ring) (x y : R) : R := sgroup_law_map (ring_mult_sgroup R) (couple x y). Definition ring_unit (R : ring) : R := monoid_unit (ring_monoid R). Record cring_on (R : ring) : Type := {cring_com_prf : commutative (sgroup_law_map (ring_mult_monoid R))}. Record cring : Type := {cring_ring :> ring; cring_on_def :> cring_on cring_ring}. Coercion Build_cring : cring_on >-> cring. Definition cring_monoid : cring -> abelian_monoid. (* Goal: forall _ : cring, abelian_monoid *) intros R; try assumption. (* Goal: abelian_monoid *) apply (Build_abelian_monoid (abelian_monoid_monoid:=ring_monoid R)). (* Goal: abelian_monoid_on (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R)))))) (@ring_mult_sgroup (ring_group (cring_ring R)) (ring_on_def (cring_ring R)))) (@ring_mult_monoid (ring_group (cring_ring R)) (ring_on_def (cring_ring R))))) (@ring_monoid (ring_group (cring_ring R)) (ring_on_def (cring_ring R)))) *) apply (Build_abelian_monoid_on (M:=ring_monoid R)). (* Goal: abelian_sgroup_on (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R)))))) (@ring_mult_sgroup (ring_group (cring_ring R)) (ring_on_def (cring_ring R)))) (@ring_mult_monoid (ring_group (cring_ring R)) (ring_on_def (cring_ring R))))) (@ring_monoid (ring_group (cring_ring R)) (ring_on_def (cring_ring R))))) *) apply (Build_abelian_sgroup_on (A:=ring_monoid R)). (* Goal: @commutative (sgroup_set (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R)))))) (@ring_mult_sgroup (ring_group (cring_ring R)) (ring_on_def (cring_ring R)))) (@ring_mult_monoid (ring_group (cring_ring R)) (ring_on_def (cring_ring R))))) (@ring_monoid (ring_group (cring_ring R)) (ring_on_def (cring_ring R)))))) (@sgroup_law_map (sgroup_set (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R)))))) (@ring_mult_sgroup (ring_group (cring_ring R)) (ring_on_def (cring_ring R)))) (@ring_mult_monoid (ring_group (cring_ring R)) (ring_on_def (cring_ring R))))) (@ring_monoid (ring_group (cring_ring R)) (ring_on_def (cring_ring R)))))) (sgroup_on_def (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R)))))) (@ring_mult_sgroup (ring_group (cring_ring R)) (ring_on_def (cring_ring R)))) (@ring_mult_monoid (ring_group (cring_ring R)) (ring_on_def (cring_ring R))))) (@ring_monoid (ring_group (cring_ring R)) (ring_on_def (cring_ring R))))))) *) exact (cring_com_prf R). Defined. End Objects. Section Hom. Variable E F : ring. Definition ring_mult_hom_unit_prop (f : Map E F) := Equal (f (ring_unit E)) (ring_unit F). Definition ring_mult_hom_prop (f : Map E F) := forall x y : E, Equal (f (ring_mult x y)) (ring_mult (f x) (f y)). Record ring_hom : Type := {ring_plus_hom :> monoid_hom E F; ring_mult_hom_unit : ring_mult_hom_unit_prop ring_plus_hom; ring_mult_hom_prf : ring_mult_hom_prop ring_plus_hom}. End Hom. Definition ring_hom_comp : forall E F G : ring, ring_hom F G -> ring_hom E F -> ring_hom E G. (* Goal: forall (E F G : ring) (_ : ring_hom F G) (_ : ring_hom E F), ring_hom E G *) intros E F G g f; try assumption. (* Goal: ring_hom E G *) apply (Build_ring_hom (ring_plus_hom:=monoid_hom_comp g f)). (* Goal: @ring_mult_hom_unit_prop E G (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group G))) (@monoid_hom_comp (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g) (@ring_plus_hom E F f)))) *) (* Goal: @ring_mult_hom_prop E G (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group G))) (@monoid_hom_comp (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g) (@ring_plus_hom E F f)))) *) unfold ring_mult_hom_unit_prop in |- *; auto with algebra. (* Goal: forall (a b c : ring) (g : Carrier (@subcat_Hom ABELIAN_GROUP ring ring_group (fun E F : ring => @Build_subtype_image (@Hom ABELIAN_GROUP (ring_group E) (ring_group F)) (ring_hom E F) (@ring_plus_hom E F)) b c)) (f : Carrier (@subcat_Hom ABELIAN_GROUP ring ring_group (fun E F : ring => @Build_subtype_image (@Hom ABELIAN_GROUP (ring_group E) (ring_group F)) (ring_hom E F) (@ring_plus_hom E F)) a b)), @Equal (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (ring_hom a c) (@ring_plus_hom a c)) (@ring_hom_comp a b c g f)) (@comp_hom ABELIAN_GROUP (ring_group a) (ring_group b) (ring_group c) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group b) (ring_group c)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group b) (ring_group c)) (ring_hom b c) (@ring_plus_hom b c)) g) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group a) (ring_group b)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group a) (ring_group b)) (ring_hom a b) (@ring_plus_hom a b)) f)) *) simpl in |- *. (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@comp_map_fun (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) (@ring_mult E x y)) (@ring_mult G (@comp_map_fun (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) x) (@comp_map_fun (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) y)) *) unfold comp_map_fun in |- *. apply Trans with (Ap (sgroup_map (monoid_sgroup_hom (ring_plus_hom g))) (ring_unit F)); (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) x) *) auto with algebra. cut (Equal (Ap (sgroup_map (monoid_sgroup_hom (ring_plus_hom f))) (ring_unit E)) (ring_unit F)). (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) x) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) (ring_unit E)) (ring_unit F) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (ring_unit F)) (ring_unit G) *) (* Goal: @ring_mult_hom_prop E G (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group G))) (@monoid_hom_comp (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g) (@ring_plus_hom E F f)))) *) apply (ring_mult_hom_unit f). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (ring_unit F)) (ring_unit G) *) (* Goal: @ring_mult_hom_prop E G (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group G))) (@monoid_hom_comp (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g) (@ring_plus_hom E F f)))) *) apply (ring_mult_hom_unit g). (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) x) *) unfold ring_mult_hom_prop in |- *; auto with algebra. (* Goal: forall (a b c : ring) (g : Carrier (@subcat_Hom ABELIAN_GROUP ring ring_group (fun E F : ring => @Build_subtype_image (@Hom ABELIAN_GROUP (ring_group E) (ring_group F)) (ring_hom E F) (@ring_plus_hom E F)) b c)) (f : Carrier (@subcat_Hom ABELIAN_GROUP ring ring_group (fun E F : ring => @Build_subtype_image (@Hom ABELIAN_GROUP (ring_group E) (ring_group F)) (ring_hom E F) (@ring_plus_hom E F)) a b)), @Equal (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (ring_hom a c) (@ring_plus_hom a c)) (@ring_hom_comp a b c g f)) (@comp_hom ABELIAN_GROUP (ring_group a) (ring_group b) (ring_group c) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group b) (ring_group c)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group b) (ring_group c)) (ring_hom b c) (@ring_plus_hom b c)) g) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group a) (ring_group b)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group a) (ring_group b)) (ring_hom a b) (@ring_plus_hom a b)) f)) *) simpl in |- *. (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@comp_map_fun (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) (@ring_mult E x y)) (@ring_mult G (@comp_map_fun (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) x) (@comp_map_fun (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) y)) *) unfold comp_map_fun in |- *. (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) (@ring_mult E x y))) (@ring_mult G (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) x)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) y))) *) intros x y; try assumption. apply Trans with (Ap (sgroup_map (monoid_sgroup_hom (ring_plus_hom g))) (ring_mult (Ap (sgroup_map (monoid_sgroup_hom (ring_plus_hom f))) x) (Ap (sgroup_map (monoid_sgroup_hom (ring_plus_hom f))) y))); (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) x) *) auto with algebra. cut (Equal (Ap (sgroup_map (monoid_sgroup_hom (ring_plus_hom f))) (ring_mult x y)) (ring_mult (Ap (sgroup_map (monoid_sgroup_hom (ring_plus_hom f))) x) (Ap (sgroup_map (monoid_sgroup_hom (ring_plus_hom f))) y))). (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) x) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) (@ring_mult E x y)) (@ring_mult F (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@ring_mult F (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) y))) (@ring_mult G (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) x)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) y))) *) apply (ring_mult_hom_prf f). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@ring_mult F (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) y))) (@ring_mult G (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) x)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) y))) *) apply (ring_mult_hom_prf g). Defined. Definition ring_id : forall E : ring, ring_hom E E. (* Goal: forall E : ring, ring_hom E E *) intros E; try assumption. (* Goal: ring_hom E E *) apply (Build_ring_hom (ring_plus_hom:=monoid_id E)). (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) x) *) simpl in |- *; auto with algebra. (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) x) *) simpl in |- *; auto with algebra. Defined. Definition RING : category. apply (subcat (C:=ABELIAN_GROUP) (C':=ring) (i:=ring_group) (homC':=fun E F : ring => Build_subtype_image (E:=Hom (c:=ABELIAN_GROUP) E F) (subtype_image_carrier:=ring_hom E F) (ring_plus_hom (E:=E) (F:=F))) (CompC':=ring_hom_comp) (idC':=ring_id)). (* Goal: forall (a b c : ring) (g : Carrier (@subcat_Hom ABELIAN_GROUP ring ring_group (fun E F : ring => @Build_subtype_image (@Hom ABELIAN_GROUP (ring_group E) (ring_group F)) (ring_hom E F) (@ring_plus_hom E F)) b c)) (f : Carrier (@subcat_Hom ABELIAN_GROUP ring ring_group (fun E F : ring => @Build_subtype_image (@Hom ABELIAN_GROUP (ring_group E) (ring_group F)) (ring_hom E F) (@ring_plus_hom E F)) a b)), @Equal (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (ring_hom a c) (@ring_plus_hom a c)) (@ring_hom_comp a b c g f)) (@comp_hom ABELIAN_GROUP (ring_group a) (ring_group b) (ring_group c) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group b) (ring_group c)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group b) (ring_group c)) (ring_hom b c) (@ring_plus_hom b c)) g) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group a) (ring_group b)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group a) (ring_group b)) (ring_hom a b) (@ring_plus_hom a b)) f)) *) simpl in |- *. (* Goal: forall a : ring, @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))))) *) (* Goal: forall (a b c : ring) (g : Carrier (@subcat_Hom ABELIAN_GROUP ring ring_group (fun E F : ring => @Build_subtype_image (@Hom ABELIAN_GROUP (ring_group E) (ring_group F)) (ring_hom E F) (@ring_plus_hom E F)) b c)) (f : Carrier (@subcat_Hom ABELIAN_GROUP ring ring_group (fun E F : ring => @Build_subtype_image (@Hom ABELIAN_GROUP (ring_group E) (ring_group F)) (ring_hom E F) (@ring_plus_hom E F)) a b)), @Equal (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (ring_hom a c) (@ring_plus_hom a c)) (@ring_hom_comp a b c g f)) (@comp_hom ABELIAN_GROUP (ring_group a) (ring_group b) (ring_group c) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group b) (ring_group c)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group b) (ring_group c)) (ring_hom b c) (@ring_plus_hom b c)) g) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group a) (ring_group b)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group a) (ring_group b)) (ring_hom a b) (@ring_plus_hom a b)) f)) *) intros a; try assumption. (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) x) *) auto with algebra. (* Goal: forall (a b c : ring) (g : Carrier (@subcat_Hom ABELIAN_GROUP ring ring_group (fun E F : ring => @Build_subtype_image (@Hom ABELIAN_GROUP (ring_group E) (ring_group F)) (ring_hom E F) (@ring_plus_hom E F)) b c)) (f : Carrier (@subcat_Hom ABELIAN_GROUP ring ring_group (fun E F : ring => @Build_subtype_image (@Hom ABELIAN_GROUP (ring_group E) (ring_group F)) (ring_hom E F) (@ring_plus_hom E F)) a b)), @Equal (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (ring_hom a c) (@ring_plus_hom a c)) (@ring_hom_comp a b c g f)) (@comp_hom ABELIAN_GROUP (ring_group a) (ring_group b) (ring_group c) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group b) (ring_group c)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group b) (ring_group c)) (ring_hom b c) (@ring_plus_hom b c)) g) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group a) (ring_group b)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group a) (ring_group b)) (ring_hom a b) (@ring_plus_hom a b)) f)) *) simpl in |- *. (* Goal: forall (a b c : ring) (g : ring_hom b c) (f : ring_hom a b), @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) *) intros a b c g f; try assumption. (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) x) *) auto with algebra. Defined. Definition CRING := full_subcat (C:=RING) (C':=cring) cring_ring.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Group_cat. Require Export Sgroup_facts. Require Export Monoid_facts. Section Lemmas. Variable G : GROUP. Lemma GROUP_comp : forall x x' : G, Equal x x' -> Equal (group_inverse _ x) (group_inverse _ x'). (* Goal: forall (x x' : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x x'), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G x) (group_inverse G x') *) unfold group_inverse in |- *. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) auto with algebra. Qed. Lemma GROUP_inverse_r : forall x : G, Equal (sgroup_law _ x (group_inverse _ x)) (monoid_unit G). (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) intros; apply (group_inverse_r_prf G x); auto with algebra. Qed. Lemma GROUP_inverse_l : forall x : G, Equal (sgroup_law _ (group_inverse _ x) x) (monoid_unit G). (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) intros; apply (group_inverse_l_prf G x); auto with algebra. Qed. Hint Resolve GROUP_comp GROUP_inverse_r GROUP_inverse_l: algebra. Lemma GROUP_unit_inverse : Equal (group_inverse _ (monoid_unit G)) (monoid_unit G). apply Trans with (sgroup_law _ (group_inverse _ (monoid_unit G)) (monoid_unit G)); (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) auto with algebra. Qed. Lemma GROUP_reg_left : forall x y z : G, Equal (sgroup_law _ x y) (sgroup_law _ x z) -> Equal y z. (* Goal: forall (x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) y x) (sgroup_law (monoid_sgroup (group_monoid G)) z x)), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) y z *) intros x y z H'; try assumption. apply Trans with (sgroup_law _ (sgroup_law _ (group_inverse _ x) x) y); (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) auto with algebra. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) apply Trans with (sgroup_law _ (monoid_unit G) y); auto with algebra. apply Trans with (sgroup_law _ (group_inverse _ x) (sgroup_law _ x y)); (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) auto with algebra. apply Trans with (sgroup_law _ (group_inverse _ x) (sgroup_law _ x z)); (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) auto with algebra. apply Trans with (sgroup_law _ (sgroup_law _ (group_inverse _ x) x) z); (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) auto with algebra. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) apply Trans with (sgroup_law _ (monoid_unit G) z); auto with algebra. Qed. Lemma GROUP_reg_right : forall x y z : G, Equal (sgroup_law _ y x) (sgroup_law _ z x) -> Equal y z. (* Goal: forall (x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) y x) (sgroup_law (monoid_sgroup (group_monoid G)) z x)), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) y z *) intros x y z H'; try assumption. apply Trans with (sgroup_law _ y (sgroup_law _ x (group_inverse _ x))); (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) auto with algebra. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) apply Trans with (sgroup_law _ y (monoid_unit G)); auto with algebra. apply Trans with (sgroup_law _ (sgroup_law _ y x) (group_inverse _ x)); (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) auto with algebra. apply Trans with (sgroup_law _ (sgroup_law _ z x) (group_inverse _ x)); (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) auto with algebra. apply Trans with (sgroup_law _ z (sgroup_law _ x (group_inverse _ x))); (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) auto with algebra. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) apply Trans with (sgroup_law _ z (monoid_unit G)); auto with algebra. Qed. Lemma GROUP_inverse_inverse : forall x : G, Equal (group_inverse _ (group_inverse _ x)) x. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (group_inverse G x)) (group_inverse F (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) x)) *) intros x; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G (group_inverse G x)) x *) apply GROUP_reg_right with (group_inverse _ x). (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) apply Trans with (monoid_unit G); auto with algebra. Qed. Lemma GROUP_law_inverse : forall x y : G, Equal (sgroup_law _ x y) (monoid_unit G) -> Equal (group_inverse _ x) y. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G x) y *) intros x y H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G x) y *) apply GROUP_reg_left with x. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) apply Trans with (monoid_unit G); auto with algebra. Qed. Lemma GROUP_inverse_law : forall x y : G, Equal (group_inverse _ (sgroup_law _ x y)) (sgroup_law _ (group_inverse _ y) (group_inverse _ x)). (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x y)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)) *) intros x y; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (group_inverse F (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) x)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (group_inverse G x)) *) apply GROUP_law_inverse. apply Trans with (sgroup_law G x (sgroup_law G y (sgroup_law G (group_inverse _ y) (group_inverse _ x)))); (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) auto with algebra. apply Trans with (sgroup_law G x (sgroup_law G (sgroup_law G y (group_inverse _ y)) (group_inverse _ x))); (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) auto with algebra. apply Trans with (sgroup_law G x (sgroup_law G (monoid_unit G) (group_inverse _ x))); (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) auto with algebra. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) apply Trans with (sgroup_law G x (group_inverse _ x)); auto with algebra. Qed. End Lemmas. Section Lemmas2. Variable G F : GROUP. Variable f : Hom G F. Lemma GROUP_hom_prop : forall x : G, Equal (f (group_inverse _ x)) (group_inverse _ (f x)). (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (group_inverse G x)) (group_inverse F (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) x)) *) intros x; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (group_inverse G x)) (group_inverse F (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) x)) *) apply Sym. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (group_inverse F (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) x)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (group_inverse G x)) *) apply GROUP_law_inverse. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) apply Trans with (f (sgroup_law _ x (group_inverse _ x))); auto with algebra. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) apply Trans with (f (monoid_unit G)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) cut (Equal (sgroup_law G x (group_inverse _ x)) (monoid_unit G)). (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid F))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid F))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid F)) (@monoid_sgroup_hom (group_monoid G) (group_monoid F) f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) apply GROUP_inverse_r. Qed. End Lemmas2. Hint Resolve GROUP_comp GROUP_inverse_r GROUP_inverse_l GROUP_unit_inverse GROUP_reg_left GROUP_reg_right GROUP_inverse_inverse GROUP_law_inverse GROUP_inverse_law: algebra. Hint Resolve GROUP_hom_prop: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Cfield_facts. Section Def. Variable R : CFIELD. Record Ctype : Type := {real :> R; imag : R}. Definition Cadd (z z' : Ctype) : Ctype := Build_Ctype (sgroup_law R (real z) (real z')) (sgroup_law R (imag z) (imag z')). Definition Cmult (z z' : Ctype) : Ctype := Build_Ctype (sgroup_law R (ring_mult (real z) (real z')) (group_inverse R (ring_mult (imag z) (imag z')))) (sgroup_law R (ring_mult (real z) (imag z')) (ring_mult (imag z) (real z'))). Definition Copp (z : Ctype) : Ctype := Build_Ctype (group_inverse R (real z)) (group_inverse R (imag z)). Definition Cone : Ctype := Build_Ctype (ring_unit R) (monoid_unit R). Definition Czero : Ctype := Build_Ctype (monoid_unit R) (monoid_unit R). Definition Ceq (z z' : Ctype) := Equal (real z) (real z') /\ Equal (imag z) (imag z'). Definition Cset : Setoid. (* Goal: Setoid *) apply (Build_Setoid (Carrier:=Ctype) (Equal:=Ceq)). (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (ring_unit (cring_ring (cfield_ring R))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))))) *) red in |- *. (* Goal: and (@transitive Ctype Ceq) (@symmetric Ctype Ceq) *) split; [ red in |- * | red in |- * ]. (* Goal: forall x : Ctype, @app_rel Ctype Ceq x x *) (* Goal: and (@transitive Ctype Ceq) (@symmetric Ctype Ceq) *) intros x; red in |- *; red in |- *; auto with algebra. (* Goal: and (@transitive Ctype Ceq) (@symmetric Ctype Ceq) *) split; [ red in |- * | red in |- * ]. (* Goal: forall (x y : Ctype) (_ : @app_rel Ctype Ceq x y), @app_rel Ctype Ceq y x *) unfold app_rel, Ceq in |- *. (* Goal: forall (x y z : Ctype) (_ : and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real x) (real y)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag x) (imag y))) (_ : and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real y) (real z)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag y) (imag z))), and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real x) (real z)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag x) (imag z)) *) (* Goal: forall (x y : Ctype) (_ : @app_rel Ctype Ceq x y), @app_rel Ctype Ceq y x *) intros x y z H' H'0; split; [ try assumption | idtac ]. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real x) (real z) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag x) (imag z) *) (* Goal: forall (x y : Ctype) (_ : @app_rel Ctype Ceq x y), @app_rel Ctype Ceq y x *) apply Trans with (real y); intuition. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag x) (imag z) *) (* Goal: forall (x y : Ctype) (_ : @app_rel Ctype Ceq x y), @app_rel Ctype Ceq y x *) apply Trans with (imag y); intuition. (* Goal: forall (x y : Ctype) (_ : @app_rel Ctype Ceq x y), @app_rel Ctype Ceq y x *) unfold app_rel, Ceq in |- *. (* Goal: forall (x y : Ctype) (_ : and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real x) (real y)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag x) (imag y))), and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real y) (real x)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag y) (imag x)) *) intuition. Defined. Require Export Ring_util. Lemma Build_Ctype_comp : forall x x' y y' : R, Equal x x' -> Equal y y' -> Equal (s:=Cset) (Build_Ctype x y) (Build_Ctype x' y'). (* Goal: forall (x x' y y' : Carrier Cset) (_ : @Equal Cset x x') (_ : @Equal Cset y y'), @Equal Cset (Build_Ctype (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real x) (real y)) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (imag x) (imag y)))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real x) (imag y)) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (imag x) (real y)))) (Build_Ctype (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real x') (real y')) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (imag x') (imag y')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real x') (imag y')) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (imag x') (real y')))) *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cmult x y) z) (Cmult x (Cmult y z)) *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult x Cone) x *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult Cone x) x *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult x (Cadd y z)) (Cadd (Cmult x y) (Cmult x z)) *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cadd x y) z) (Cadd (Cmult x z) (Cmult y z)) *) intros x x' y y' H' H'0; try assumption. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: Ceq (Build_Ctype x y) (Build_Ctype x' y') *) red in |- *; auto with algebra. Qed. Hint Resolve Build_Ctype_comp: algebra. Lemma real_comp : forall x x' : Cset, Equal x x' -> Equal (real x) (real x'). (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: not (Ceq (ring_unit Cring) Czero) *) unfold Ceq in |- *. (* Goal: forall (x x' : Ctype) (_ : and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real x) (real x')) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag x) (imag x'))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (real x) (real x') *) intros x x' H'; elim H'; intros H'0 H'1; try exact H'0; clear H'. Qed. Hint Resolve real_comp: algebra. Lemma imag_comp : forall x x' : Cset, Equal x x' -> Equal (imag x) (imag x'). (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: not (Ceq (ring_unit Cring) Czero) *) unfold Ceq in |- *. (* Goal: forall (x x' : Ctype) (_ : and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real x) (real x')) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag x) (imag x'))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (imag x) (imag x') *) intros x x' H'; elim H'; intros H'0 H'1; try exact H'1; clear H'. Qed. Hint Resolve imag_comp: algebra. Lemma Build_Ctype_comp2 : forall x x' y y' : R, Equal x x' -> Equal y y' -> Ceq (Build_Ctype x y) (Build_Ctype x' y'). (* Goal: forall (x x' y y' : Carrier Cset) (_ : @Equal Cset x x') (_ : @Equal Cset y y'), @Equal Cset (Build_Ctype (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real x) (real y)) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (imag x) (imag y)))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real x) (imag y)) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (imag x) (real y)))) (Build_Ctype (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real x') (real y')) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (imag x') (imag y')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real x') (imag y')) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (imag x') (real y')))) *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cmult x y) z) (Cmult x (Cmult y z)) *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult x Cone) x *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult Cone x) x *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult x (Cadd y z)) (Cadd (Cmult x y) (Cmult x z)) *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cadd x y) z) (Cadd (Cmult x z) (Cmult y z)) *) intros x x' y y' H' H'0; try assumption. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: Ceq (Build_Ctype x y) (Build_Ctype x' y') *) red in |- *; auto with algebra. Qed. Hint Resolve Build_Ctype_comp2: algebra. Definition Cring : RING. apply (BUILD_RING (E:=Cset) (ringplus:=Cadd) (ringmult:=Cmult) (zero:=Czero) (un:=Cone) (ringopp:=Copp)). (* Goal: forall x y : Carrier Cset, @Equal Cset (Cadd x y) (Cadd y x) *) (* Goal: forall (x x' y y' : Carrier Cset) (_ : @Equal Cset x x') (_ : @Equal Cset y y'), @Equal Cset (Cmult x y) (Cmult x' y') *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cmult x y) z) (Cmult x (Cmult y z)) *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult x Cone) x *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult Cone x) x *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult x (Cadd y z)) (Cadd (Cmult x y) (Cmult x z)) *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cadd x y) z) (Cadd (Cmult x z) (Cmult y z)) *) unfold Cadd in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: forall x y : Carrier Cset, @Equal Cset (Cadd x y) (Cadd y x) *) (* Goal: forall (x x' y y' : Carrier Cset) (_ : @Equal Cset x x') (_ : @Equal Cset y y'), @Equal Cset (Cmult x y) (Cmult x' y') *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cmult x y) z) (Cmult x (Cmult y z)) *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult x Cone) x *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult Cone x) x *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult x (Cadd y z)) (Cadd (Cmult x y) (Cmult x z)) *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cadd x y) z) (Cadd (Cmult x z) (Cmult y z)) *) unfold Cadd in |- *. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: forall x : Carrier Cset, @Equal Cset (Cadd x Czero) x *) (* Goal: forall (x y : Carrier Cset) (_ : @Equal Cset x y), @Equal Cset (Copp x) (Copp y) *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cadd x (Copp x)) Czero *) (* Goal: forall x y : Carrier Cset, @Equal Cset (Cadd x y) (Cadd y x) *) (* Goal: forall (x x' y y' : Carrier Cset) (_ : @Equal Cset x x') (_ : @Equal Cset y y'), @Equal Cset (Cmult x y) (Cmult x' y') *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cmult x y) z) (Cmult x (Cmult y z)) *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult x Cone) x *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult Cone x) x *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult x (Cadd y z)) (Cadd (Cmult x y) (Cmult x z)) *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cadd x y) z) (Cadd (Cmult x z) (Cmult y z)) *) unfold Cadd, Czero in |- *. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (ring_unit (cring_ring (cfield_ring R))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))))) *) intros x; red in |- *. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: forall (x y : Carrier Cset) (_ : @Equal Cset x y), @Equal Cset (Copp x) (Copp y) *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cadd x (Copp x)) Czero *) (* Goal: forall x y : Carrier Cset, @Equal Cset (Cadd x y) (Cadd y x) *) (* Goal: forall (x x' y y' : Carrier Cset) (_ : @Equal Cset x x') (_ : @Equal Cset y y'), @Equal Cset (Cmult x y) (Cmult x' y') *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cmult x y) z) (Cmult x (Cmult y z)) *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult x Cone) x *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult Cone x) x *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult x (Cadd y z)) (Cadd (Cmult x y) (Cmult x z)) *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cadd x y) z) (Cadd (Cmult x z) (Cmult y z)) *) unfold Copp in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: forall x : Carrier Cset, @Equal Cset (Cadd x (Copp x)) Czero *) (* Goal: forall x y : Carrier Cset, @Equal Cset (Cadd x y) (Cadd y x) *) (* Goal: forall (x x' y y' : Carrier Cset) (_ : @Equal Cset x x') (_ : @Equal Cset y y'), @Equal Cset (Cmult x y) (Cmult x' y') *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cmult x y) z) (Cmult x (Cmult y z)) *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult x Cone) x *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult Cone x) x *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult x (Cadd y z)) (Cadd (Cmult x y) (Cmult x z)) *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cadd x y) z) (Cadd (Cmult x z) (Cmult y z)) *) unfold Cadd, Czero, Copp in |- *. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: forall x y : Carrier Cset, @Equal Cset (Cadd x y) (Cadd y x) *) (* Goal: forall (x x' y y' : Carrier Cset) (_ : @Equal Cset x x') (_ : @Equal Cset y y'), @Equal Cset (Cmult x y) (Cmult x' y') *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cmult x y) z) (Cmult x (Cmult y z)) *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult x Cone) x *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult Cone x) x *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult x (Cadd y z)) (Cadd (Cmult x y) (Cmult x z)) *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cadd x y) z) (Cadd (Cmult x z) (Cmult y z)) *) unfold Cadd in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cmult x y) z) (Cmult x (Cmult y z)) *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult x Cone) x *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult Cone x) x *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult x (Cadd y z)) (Cadd (Cmult x y) (Cmult x z)) *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cadd x y) z) (Cadd (Cmult x z) (Cmult y z)) *) unfold Cmult in |- *. (* Goal: forall (x x' y y' : Carrier Cset) (_ : @Equal Cset x x') (_ : @Equal Cset y y'), @Equal Cset (Build_Ctype (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real x) (real y)) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (imag x) (imag y)))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real x) (imag y)) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (imag x) (real y)))) (Build_Ctype (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real x') (real y')) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (imag x') (imag y')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real x') (imag y')) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (imag x') (real y')))) *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cmult x y) z) (Cmult x (Cmult y z)) *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult x Cone) x *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult Cone x) x *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult x (Cadd y z)) (Cadd (Cmult x y) (Cmult x z)) *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cadd x y) z) (Cadd (Cmult x z) (Cmult y z)) *) intros x x' y y' H' H'0; try assumption. (* Goal: @Equal Cset (Build_Ctype (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real x) (real y)) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (imag x) (imag y)))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real x) (imag y)) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (imag x) (real y)))) (Build_Ctype (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real x') (real y')) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (imag x') (imag y')))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real x') (imag y')) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (imag x') (real y')))) *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cmult x y) z) (Cmult x (Cmult y z)) *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult x Cone) x *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult Cone x) x *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult x (Cadd y z)) (Cadd (Cmult x y) (Cmult x z)) *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cadd x y) z) (Cadd (Cmult x z) (Cmult y z)) *) apply Build_Ctype_comp. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cmult x y) z) (Cmult x (Cmult y z)) *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult x Cone) x *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult Cone x) x *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult x (Cadd y z)) (Cadd (Cmult x y) (Cmult x z)) *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cadd x y) z) (Cadd (Cmult x z) (Cmult y z)) *) unfold Cmult in |- *. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: forall x y z : Ctype, Ceq (Build_Ctype (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real y)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (imag y)))) (real z)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (imag y)) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (real y))) (imag z)))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real y)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (imag y)))) (imag z)) (@ring_mult (cring_ring (cfield_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (imag y)) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (real y))) (real z)))) (Build_Ctype (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real y) (real z)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag y) (imag z))))) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real y) (imag z)) (@ring_mult (cring_ring (cfield_ring R)) (imag y) (real z)))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real y) (imag z)) (@ring_mult (cring_ring (cfield_ring R)) (imag y) (real z)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real y) (real z)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag y) (imag z))))))) *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult x Cone) x *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult Cone x) x *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult x (Cadd y z)) (Cadd (Cmult x y) (Cmult x z)) *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cadd x y) z) (Cadd (Cmult x z) (Cmult y z)) *) intros x y z; try assumption. (* Goal: Ceq (Build_Ctype (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real y)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (imag y)))) (real z)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (imag y)) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (real y))) (imag z)))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real y)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (imag y)))) (imag z)) (@ring_mult (cring_ring (cfield_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (imag y)) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (real y))) (real z)))) (Build_Ctype (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real y) (real z)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag y) (imag z))))) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real y) (imag z)) (@ring_mult (cring_ring (cfield_ring R)) (imag y) (real z)))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real y) (imag z)) (@ring_mult (cring_ring (cfield_ring R)) (imag y) (real z)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real y) (real z)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag y) (imag z))))))) *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult x Cone) x *) (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult Cone x) x *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult x (Cadd y z)) (Cadd (Cmult x y) (Cmult x z)) *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cadd x y) z) (Cadd (Cmult x z) (Cmult y z)) *) apply Build_Ctype_comp2. apply Trans with (sgroup_law R (sgroup_law R (ring_mult (ring_mult x y) z) (ring_mult (group_inverse R (ring_mult (imag x) (imag y))) z)) (group_inverse R (sgroup_law R (ring_mult (ring_mult x (imag y)) (imag z)) (ring_mult (ring_mult (imag x) y) (imag z))))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (sgroup_law R (ring_mult x (ring_mult y z)) (ring_mult x (group_inverse R (ring_mult (imag y) (imag z))))) (group_inverse R (sgroup_law R (ring_mult (imag x) (ring_mult y (imag z))) (ring_mult (imag x) (ring_mult (imag y) z))))). apply Trans with (sgroup_law R (ring_mult (ring_mult x y) z) (sgroup_law R (ring_mult (group_inverse R (ring_mult (imag x) (imag y))) z) (group_inverse R (sgroup_law R (ring_mult (ring_mult x (imag y)) (imag z)) (ring_mult (ring_mult (imag x) y) (imag z)))))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult x (ring_mult y z)) (sgroup_law R (ring_mult x (group_inverse R (ring_mult (imag y) (imag z)))) (group_inverse R (sgroup_law R (ring_mult (imag x) (ring_mult y (imag z))) (ring_mult (imag x) (ring_mult (imag y) z)))))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i i)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r (@ring_mult (cring_ring (cfield_ring R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i))))))) (@ring_mult (cring_ring (cfield_ring R)) i (@ring_mult (cring_ring (cfield_ring R)) r (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i)))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) *) apply SGROUP_comp. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult (group_inverse R (ring_mult (imag x) (imag y))) z) (sgroup_law R (group_inverse R (ring_mult (ring_mult (imag x) y) (imag z))) (group_inverse R (ring_mult (ring_mult x (imag y)) (imag z))))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult x (group_inverse R (ring_mult (imag y) (imag z)))) (sgroup_law R (group_inverse R (ring_mult (imag x) (ring_mult (imag y) z))) (group_inverse R (ring_mult (imag x) (ring_mult y (imag z)))))). apply Trans with (sgroup_law R (group_inverse R (ring_mult (ring_mult x (imag y)) (imag z))) (sgroup_law R (ring_mult (group_inverse R (ring_mult (imag x) (imag y))) z) (group_inverse R (ring_mult (ring_mult (imag x) y) (imag z))))). apply Trans with (sgroup_law R (ring_mult (group_inverse R (ring_mult (imag x) (imag y))) z) (sgroup_law R (group_inverse R (ring_mult (ring_mult x (imag y)) (imag z))) (group_inverse R (ring_mult (ring_mult (imag x) y) (imag z))))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (group_inverse R (ring_mult (ring_mult x (imag y)) (imag z))) (sgroup_law R (ring_mult (group_inverse R (ring_mult (imag x) (imag y))) z) (group_inverse R (ring_mult (ring_mult (imag x) y) (imag z))))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i i)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r (@ring_mult (cring_ring (cfield_ring R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i))))))) (@ring_mult (cring_ring (cfield_ring R)) i (@ring_mult (cring_ring (cfield_ring R)) r (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i)))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) *) apply SGROUP_comp. apply Trans with (ring_mult (group_inverse R (ring_mult x (imag y))) (imag z)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (ring_mult (ring_mult x (group_inverse R (imag y))) (imag z)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (ring_mult x (ring_mult (group_inverse R (imag y)) (imag z))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i i)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r (@ring_mult (cring_ring (cfield_ring R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i))))))) (@ring_mult (cring_ring (cfield_ring R)) i (@ring_mult (cring_ring (cfield_ring R)) r (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i)))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) *) apply SGROUP_comp. apply Trans with (group_inverse R (ring_mult (ring_mult (imag x) (imag y)) z)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (sgroup_law R (ring_mult (ring_mult x y) (imag z)) (ring_mult (group_inverse R (ring_mult (imag x) (imag y))) (imag z))) (sgroup_law R (ring_mult (ring_mult x (imag y)) z) (ring_mult (ring_mult (imag x) y) z))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (sgroup_law R (ring_mult x (ring_mult y (imag z))) (ring_mult x (ring_mult (imag y) z))) (sgroup_law R (ring_mult (imag x) (ring_mult y z)) (ring_mult (imag x) (group_inverse R (ring_mult (imag y) (imag z)))))). apply Trans with (sgroup_law R (ring_mult (ring_mult x y) (imag z)) (sgroup_law R (ring_mult (group_inverse R (ring_mult (imag x) (imag y))) (imag z)) (sgroup_law R (ring_mult (ring_mult x (imag y)) z) (ring_mult (ring_mult (imag x) y) z)))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult x (ring_mult y (imag z))) (sgroup_law R (ring_mult x (ring_mult (imag y) z)) (sgroup_law R (ring_mult (imag x) (ring_mult y z)) (ring_mult (imag x) (group_inverse R (ring_mult (imag y) (imag z))))))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i i)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r (@ring_mult (cring_ring (cfield_ring R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i))))))) (@ring_mult (cring_ring (cfield_ring R)) i (@ring_mult (cring_ring (cfield_ring R)) r (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i)))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) *) apply SGROUP_comp. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult (ring_mult x (imag y)) z) (sgroup_law R (ring_mult (group_inverse R (ring_mult (imag x) (imag y))) (imag z)) (ring_mult (ring_mult (imag x) y) z))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i i)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r (@ring_mult (cring_ring (cfield_ring R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i))))))) (@ring_mult (cring_ring (cfield_ring R)) i (@ring_mult (cring_ring (cfield_ring R)) r (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i)))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) *) apply SGROUP_comp. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult (ring_mult (imag x) y) z) (ring_mult (group_inverse R (ring_mult (imag x) (imag y))) (imag z))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i i)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r (@ring_mult (cring_ring (cfield_ring R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i))))))) (@ring_mult (cring_ring (cfield_ring R)) i (@ring_mult (cring_ring (cfield_ring R)) r (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i)))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) *) apply SGROUP_comp. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (group_inverse R (ring_mult (ring_mult (imag x) (imag y)) (imag z))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (group_inverse R (ring_mult (imag x) (ring_mult (imag y) (imag z)))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult Cone x) x *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult x (Cadd y z)) (Cadd (Cmult x y) (Cmult x z)) *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cadd x y) z) (Cadd (Cmult x z) (Cmult y z)) *) unfold Cmult, Cone in |- *. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) intros x; try assumption. (* Goal: forall _ : not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (real x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (imag x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))))), and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real x) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)))))))) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)))))))))) (ring_unit (cring_ring (cfield_ring R)))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)))))))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real x) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x))))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))))) *) elim x. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: not (Ceq (ring_unit Cring) Czero) *) unfold Ceq in |- *. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: forall real imag : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))), and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (ring_unit (cring_ring (cfield_ring R))) real) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) imag))) real) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (ring_unit (cring_ring (cfield_ring R))) imag) (@ring_mult (cring_ring (cfield_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) real)) imag) *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult x (Cadd y z)) (Cadd (Cmult x y) (Cmult x z)) *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cadd x y) z) (Cadd (Cmult x z) (Cmult y z)) *) intros real0 imag0; split; [ try assumption | idtac ]. apply Trans with (sgroup_law R real0 (group_inverse R (monoid_unit R))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) apply Trans with (sgroup_law R real0 (monoid_unit R)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) apply Trans with (sgroup_law R (monoid_unit R) imag0); auto with algebra. (* Goal: forall x : Carrier Cset, @Equal Cset (Cmult Cone x) x *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult x (Cadd y z)) (Cadd (Cmult x y) (Cmult x z)) *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cadd x y) z) (Cadd (Cmult x z) (Cmult y z)) *) unfold Cmult, Cone in |- *. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) intros x; try assumption. (* Goal: forall _ : not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (real x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (imag x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))))), and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real x) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)))))))) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)))))))))) (ring_unit (cring_ring (cfield_ring R)))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)))))))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real x) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x))))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))))) *) elim x. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: not (Ceq (ring_unit Cring) Czero) *) unfold Ceq in |- *. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: forall real imag : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))), and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (ring_unit (cring_ring (cfield_ring R))) real) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) imag))) real) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (ring_unit (cring_ring (cfield_ring R))) imag) (@ring_mult (cring_ring (cfield_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) real)) imag) *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult x (Cadd y z)) (Cadd (Cmult x y) (Cmult x z)) *) (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cadd x y) z) (Cadd (Cmult x z) (Cmult y z)) *) intros real0 imag0; split; [ try assumption | idtac ]. apply Trans with (sgroup_law R real0 (group_inverse R (monoid_unit R))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) apply Trans with (sgroup_law R real0 (monoid_unit R)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) apply Trans with (sgroup_law R imag0 (monoid_unit R)); auto with algebra. (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cadd x y) z) (Cadd (Cmult x z) (Cmult y z)) *) unfold Cmult, Cadd in |- *. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: not (Ceq (ring_unit Cring) Czero) *) unfold Ceq in |- *. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: forall x y z : Ctype, and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (real x) (real y)) (real z)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (imag x) (imag y)) (imag z)))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real z)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (imag z)))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real y) (real z)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag y) (imag z)))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (real x) (real y)) (imag z)) (@ring_mult (cring_ring (cfield_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (imag x) (imag y)) (real z))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (imag z)) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (real z))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real y) (imag z)) (@ring_mult (cring_ring (cfield_ring R)) (imag y) (real z))))) *) intros x y z; split; [ try assumption | idtac ]. apply Trans with (sgroup_law R (sgroup_law R (ring_mult x y) (ring_mult x z)) (group_inverse R (ring_mult (imag x) (sgroup_law R (imag y) (imag z))))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult x y) (sgroup_law R (ring_mult x z) (group_inverse R (ring_mult (imag x) (sgroup_law R (imag y) (imag z)))))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult x y) (sgroup_law R (group_inverse R (ring_mult (imag x) (imag y))) (sgroup_law R (ring_mult x z) (group_inverse R (ring_mult (imag x) (imag z)))))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i i)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r (@ring_mult (cring_ring (cfield_ring R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i))))))) (@ring_mult (cring_ring (cfield_ring R)) i (@ring_mult (cring_ring (cfield_ring R)) r (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i)))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) *) apply SGROUP_comp. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult x z) (ring_mult (group_inverse R (imag x)) (sgroup_law R (imag y) (imag z)))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult x z) (sgroup_law R (ring_mult (group_inverse R (imag x)) (imag y)) (ring_mult (group_inverse R (imag x)) (imag z)))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult (group_inverse R (imag x)) (imag y)) (sgroup_law R (ring_mult x z) (ring_mult (group_inverse R (imag x)) (imag z)))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (sgroup_law R (ring_mult x (imag y)) (ring_mult x (imag z))) (sgroup_law R (ring_mult (imag x) y) (ring_mult (imag x) z))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult x (imag y)) (sgroup_law R (ring_mult x (imag z)) (sgroup_law R (ring_mult (imag x) y) (ring_mult (imag x) z)))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult x (imag y)) (sgroup_law R (ring_mult (imag x) y) (sgroup_law R (ring_mult x (imag z)) (ring_mult (imag x) z)))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i i)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r (@ring_mult (cring_ring (cfield_ring R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i))))))) (@ring_mult (cring_ring (cfield_ring R)) i (@ring_mult (cring_ring (cfield_ring R)) r (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i)))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) *) apply SGROUP_comp. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: forall x y z : Carrier Cset, @Equal Cset (Cmult (Cadd x y) z) (Cadd (Cmult x z) (Cmult y z)) *) unfold Cmult, Cadd in |- *. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: not (Ceq (ring_unit Cring) Czero) *) unfold Ceq in |- *. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: forall x y z : Ctype, and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (real x) (real y)) (real z)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (imag x) (imag y)) (imag z)))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real z)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (imag z)))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real y) (real z)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag y) (imag z)))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (real x) (real y)) (imag z)) (@ring_mult (cring_ring (cfield_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (imag x) (imag y)) (real z))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (imag z)) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (real z))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real y) (imag z)) (@ring_mult (cring_ring (cfield_ring R)) (imag y) (real z))))) *) intros x y z; split; [ try assumption | idtac ]. apply Trans with (sgroup_law R (sgroup_law R (ring_mult x z) (ring_mult y z)) (group_inverse R (sgroup_law R (ring_mult (imag x) (imag z)) (ring_mult (imag y) (imag z))))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult x z) (sgroup_law R (ring_mult y z) (group_inverse R (sgroup_law R (ring_mult (imag x) (imag z)) (ring_mult (imag y) (imag z)))))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult x z) (sgroup_law R (group_inverse R (ring_mult (imag x) (imag z))) (sgroup_law R (ring_mult y z) (group_inverse R (ring_mult (imag y) (imag z)))))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i i)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r (@ring_mult (cring_ring (cfield_ring R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i))))))) (@ring_mult (cring_ring (cfield_ring R)) i (@ring_mult (cring_ring (cfield_ring R)) r (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i)))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) *) apply SGROUP_comp. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult y z) (sgroup_law R (group_inverse R (ring_mult (imag y) (imag z))) (group_inverse R (ring_mult (imag x) (imag z))))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult y z) (sgroup_law R (group_inverse R (ring_mult (imag x) (imag z))) (group_inverse R (ring_mult (imag y) (imag z))))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (sgroup_law R (ring_mult x (imag z)) (ring_mult y (imag z))) (sgroup_law R (ring_mult (imag x) z) (ring_mult (imag y) z))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult x (imag z)) (sgroup_law R (ring_mult y (imag z)) (sgroup_law R (ring_mult (imag x) z) (ring_mult (imag y) z)))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult x (imag z)) (sgroup_law R (ring_mult (imag x) z) (sgroup_law R (ring_mult y (imag z)) (ring_mult (imag y) z)))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i i)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r (@ring_mult (cring_ring (cfield_ring R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i))))))) (@ring_mult (cring_ring (cfield_ring R)) i (@ring_mult (cring_ring (cfield_ring R)) r (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i)))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) *) apply SGROUP_comp. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. Defined. Definition Ccring : CRING. (* Goal: Ob CRING *) apply (Build_cring (cring_ring:=Cring)). (* Goal: cring_on Cring *) apply (Build_cring_on (R:=Cring)). (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (ring_unit (cring_ring (cfield_ring R))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))))) *) red in |- *. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) unfold Cmult, Ceq in |- *; simpl in |- *. (* Goal: forall x y : Ctype, and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real y)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (imag y)))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real y) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag y) (imag x))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (imag y)) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (real y))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real y) (imag x)) (@ring_mult (cring_ring (cfield_ring R)) (imag y) (real x)))) *) intros x y; split; [ try assumption | idtac ]. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult (imag y) x) (ring_mult y (imag x))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) apply SGROUP_comp; auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (imag y)) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (imag y) (real x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (real y)) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real y) (imag x)) *) exact (CRING_com (R1:=R) x (imag y)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (real y)) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real y) (imag x)) *) exact (CRING_com (R1:=R) (imag x) y). Defined. Definition conjugate (z : Ctype) : Ctype := Build_Ctype (real z) (group_inverse R (imag z)). Definition CdivR (z : Ctype) (r : R) : Ctype := Build_Ctype (field_div (real z) r) (field_div (imag z) r). Definition Cinv (z : Ctype) : Ctype := CdivR (conjugate z) (Cmult z (conjugate z)). Definition Cinv_map : MAP Ccring Ccring. (* Goal: Carrier (MAP (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) apply (Build_Map (A:=Ccring) (B:=Ccring) (Ap:=Cinv)). (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (ring_unit (cring_ring (cfield_ring R))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))))) *) red in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (Cinv x) (Cinv y) *) unfold Cinv in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (CdivR (conjugate x) (real (Cmult x (conjugate x)))) (CdivR (conjugate y) (real (Cmult y (conjugate y)))) *) unfold CdivR in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (Build_Ctype (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (real (conjugate x)) (real (Cmult x (conjugate x)))) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (imag (conjugate x)) (real (Cmult x (conjugate x))))) (Build_Ctype (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (real (conjugate y)) (real (Cmult y (conjugate y)))) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (imag (conjugate y)) (real (Cmult y (conjugate y))))) *) unfold conjugate in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (Build_Ctype (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (real (Build_Ctype (real x) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (imag x)))) (real (Cmult x (Build_Ctype (real x) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (imag x)))))) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (imag (Build_Ctype (real x) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (imag x)))) (real (Cmult x (Build_Ctype (real x) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (imag x))))))) (Build_Ctype (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (real (Build_Ctype (real y) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (imag y)))) (real (Cmult y (Build_Ctype (real y) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (imag y)))))) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (imag (Build_Ctype (real y) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (imag y)))) (real (Cmult y (Build_Ctype (real y) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (imag y))))))) *) intros x y H'; try assumption. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) unfold Ceq in |- *; simpl in |- *. (* Goal: and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (real x) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)))))) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (real y) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real y) (real y)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag y) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag y))))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)))))) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real y) (real y)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag y) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag y))))))) *) simpl in H'. (* Goal: and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (real x) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)))))) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (real y) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real y) (real y)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag y) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag y))))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)))))) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real y) (real y)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag y) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag y))))))) *) red in H'. (* Goal: False *) elim H'; intros H'0 H'1; try exact H'0; clear H'. (* Goal: and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (real x) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)))))) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (real y) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real y) (real y)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag y) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag y))))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)))))) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real y) (real y)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag y) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag y))))))) *) split; [ try assumption | idtac ]. (* Goal: forall _ : not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (real x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (imag x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))))), and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (real x) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x))))))) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x))))))))) (ring_unit (cring_ring (cfield_ring R)))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x))))))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (real x) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))))) *) unfold field_div in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i r)) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) *) apply RING_comp. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)))))) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real y) (real y)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag y) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag y)))))) *) apply FIELD_comp. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i i)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r (@ring_mult (cring_ring (cfield_ring R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i))))))) (@ring_mult (cring_ring (cfield_ring R)) i (@ring_mult (cring_ring (cfield_ring R)) r (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i)))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) *) apply SGROUP_comp. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: forall _ : not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (real x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (imag x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))))), and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (real x) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x))))))) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x))))))))) (ring_unit (cring_ring (cfield_ring R)))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x))))))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (real x) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))))) *) unfold field_div in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i r)) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) *) apply RING_comp. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)))))) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real y) (real y)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag y) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag y)))))) *) apply FIELD_comp. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i i)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r (@ring_mult (cring_ring (cfield_ring R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i))))))) (@ring_mult (cring_ring (cfield_ring R)) i (@ring_mult (cring_ring (cfield_ring R)) r (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i)))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) *) apply SGROUP_comp. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. Defined. Hypothesis sum_of_square : forall x y : R, Equal (sgroup_law R (ring_mult x x) (ring_mult y y)) (monoid_unit R) -> Equal x (monoid_unit R) /\ Equal y (monoid_unit R). Lemma C_inv_r : forall x : Ccring, ~ Equal x (monoid_unit Ccring) -> Equal (ring_mult x (Ap Cinv_map x)) (ring_unit Ccring). (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) intros x; try assumption. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) unfold Ceq in |- *; simpl in |- *. (* Goal: forall _ : not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (real x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (imag x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))))), and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (real x) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x))))))) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x))))))))) (ring_unit (cring_ring (cfield_ring R)))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x))))))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (real x) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))))) *) unfold field_div in |- *. (* Goal: forall _ : not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (real x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (imag x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))))), and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real x) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)))))))) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)))))))))) (ring_unit (cring_ring (cfield_ring R)))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)))))))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real x) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x))))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))))) *) elim x. (* Goal: forall (real0 imag0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))))) (_ : not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (real (Build_Ctype real0 imag0)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (imag (Build_Ctype real0 imag0)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))))))), and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real (Build_Ctype real0 imag0)) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real (Build_Ctype real0 imag0)) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real (Build_Ctype real0 imag0)) (real (Build_Ctype real0 imag0))) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag (Build_Ctype real0 imag0)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag (Build_Ctype real0 imag0))))))))) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag (Build_Ctype real0 imag0)) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag (Build_Ctype real0 imag0))) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real (Build_Ctype real0 imag0)) (real (Build_Ctype real0 imag0))) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag (Build_Ctype real0 imag0)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag (Build_Ctype real0 imag0))))))))))) (ring_unit (cring_ring (cfield_ring R)))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real (Build_Ctype real0 imag0)) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag (Build_Ctype real0 imag0))) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real (Build_Ctype real0 imag0)) (real (Build_Ctype real0 imag0))) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag (Build_Ctype real0 imag0)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag (Build_Ctype real0 imag0))))))))) (@ring_mult (cring_ring (cfield_ring R)) (imag (Build_Ctype real0 imag0)) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (real (Build_Ctype real0 imag0)) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real (Build_Ctype real0 imag0)) (real (Build_Ctype real0 imag0))) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag (Build_Ctype real0 imag0)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag (Build_Ctype real0 imag0)))))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))))) *) intros r i; try assumption. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (real x) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)))))) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (real y) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real y) (real y)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag y) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag y))))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real x) (real x)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag x) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag x)))))) (@field_div (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) (real y) (real y)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) (imag y) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (imag y))))))) *) intros H'; split; [ try assumption | idtac ]. apply Trans with (sgroup_law R (ring_mult (ring_mult r r) (field_inverse (sgroup_law R (ring_mult r r) (group_inverse R (ring_mult i (group_inverse R i)))))) (group_inverse R (ring_mult (ring_mult i (group_inverse R i)) (field_inverse (sgroup_law R (ring_mult r r) (group_inverse R (ring_mult i (group_inverse R i)))))))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law (Build_field R) (ring_mult (ring_mult r r) (field_inverse (sgroup_law (Build_field R) (ring_mult r r) (group_inverse (Build_field R) (ring_mult i (group_inverse (Build_field R) i)))))) (ring_mult (group_inverse (Build_field R) (ring_mult i (group_inverse (Build_field R) i))) (field_inverse (sgroup_law (Build_field R) (ring_mult r r) (group_inverse (Build_field R) (ring_mult i (group_inverse (Build_field R) i))))))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (ring_mult (sgroup_law (Build_field R) (ring_mult r r) (group_inverse (Build_field R) (ring_mult i (group_inverse (Build_field R) i)))) (field_inverse (sgroup_law (Build_field R) (ring_mult r r) (group_inverse (Build_field R) (ring_mult i (group_inverse (Build_field R) i)))))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))))) (ring_unit (cring_ring (cfield_ring R))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r (@ring_mult (cring_ring (cfield_ring R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i))))))) (@ring_mult (cring_ring (cfield_ring R)) i (@ring_mult (cring_ring (cfield_ring R)) r (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i)))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) *) apply (FIELD_inverse_r (K:=R)). (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (ring_unit (cring_ring (cfield_ring R))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))))) *) red in |- *. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))), False *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r (@ring_mult (cring_ring (cfield_ring R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i))))))) (@ring_mult (cring_ring (cfield_ring R)) i (@ring_mult (cring_ring (cfield_ring R)) r (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i)))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) *) intros H'0; try assumption. cut (Equal (sgroup_law (Build_field R) (ring_mult r r) (ring_mult i i)) (monoid_unit (Build_field R))). (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i i)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))), False *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i i)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r (@ring_mult (cring_ring (cfield_ring R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i))))))) (@ring_mult (cring_ring (cfield_ring R)) i (@ring_mult (cring_ring (cfield_ring R)) r (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i)))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) *) intros H'1; try assumption. absurd (Equal r (monoid_unit R) /\ Equal i (monoid_unit R)); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law (Build_field R) (ring_mult r r) (group_inverse (Build_field R) (ring_mult i (group_inverse (Build_field R) i)))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i i)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r (@ring_mult (cring_ring (cfield_ring R)) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i))))))) (@ring_mult (cring_ring (cfield_ring R)) i (@ring_mult (cring_ring (cfield_ring R)) r (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (@ring_mult (cring_ring (cfield_ring R)) r r) (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) (@ring_mult (cring_ring (cfield_ring R)) i (group_inverse (abelian_group_group (ring_group (cring_ring (cfield_ring R)))) i)))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) *) apply SGROUP_comp. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (group_inverse (Build_field R) (group_inverse (Build_field R) (ring_mult i i))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult (ring_mult r (group_inverse R i)) (field_inverse (sgroup_law R (ring_mult r r) (group_inverse R (ring_mult i (group_inverse R i)))))) (ring_mult (ring_mult i r) (field_inverse (sgroup_law R (ring_mult r r) (group_inverse R (ring_mult i (group_inverse R i))))))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (ring_mult (sgroup_law (Build_field R) (ring_mult r (group_inverse (Build_field R) i)) (ring_mult i r)) (field_inverse (sgroup_law R (ring_mult r r) (group_inverse R (ring_mult i (group_inverse R i)))))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (ring_mult (monoid_unit R) (field_inverse (sgroup_law R (ring_mult r r) (group_inverse R (ring_mult i (group_inverse R i)))))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i r)) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (@field_inverse (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) r r) (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) (@ring_mult (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))) i (group_inverse (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R))))) i)))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) *) apply RING_comp. apply Trans with (sgroup_law (Build_field R) (group_inverse (Build_field R) (ring_mult r i)) (ring_mult i r)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. apply Trans with (sgroup_law (Build_field R) (group_inverse (Build_field R) (ring_mult i r)) (ring_mult i r)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. Qed. Definition C_field_on : field_on Ccring. (* Goal: field_on (cring_ring Ccring) *) apply (Build_field_on (R:=Ccring) (field_inverse_map:=Cinv_map)). (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) exact C_inv_r. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) intros x H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) apply Trans with (ring_mult x (Ap Cinv_map x)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) apply C_inv_r; auto with algebra. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: not (Ceq (ring_unit Cring) Czero) *) unfold Ceq in |- *. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (real (ring_unit Cring)) (real Czero)) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring (@Build_field (cring_ring (cfield_ring R)) (cfield_on_def R)))))))) (imag (ring_unit Cring)) (imag Czero))) *) simpl in |- *. (* Goal: not (and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (ring_unit (cring_ring (cfield_ring R))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))))) *) red in |- *. (* Goal: forall _ : and (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (ring_unit (cring_ring (cfield_ring R))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (cfield_ring R)))))))), False *) intros H'; try assumption. (* Goal: False *) elim H'; intros H'0 H'1; try exact H'0; clear H'. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x) x) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (@ring_mult (cring_ring Ccring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) Cinv_map x)) (ring_unit (cring_ring Ccring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring)))))) (ring_unit (cring_ring Ccring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Ccring))))))) *) absurd (Equal (ring_unit R) (monoid_unit R)); auto with algebra. Defined. Definition CC : CFIELD := Build_cfield C_field_on. End Def.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Sub_group. Require Export Module_facts. Require Export Module_util. Require Export Monoid_util. Require Export Group_util. Section Def. Variable R : RING. Variable M : MODULE R. Section Sub_module. Variable N : subgroup M. Hypothesis Nop : forall (a : R) (x : M), in_part x N -> in_part (module_mult a x) N. Let Na : ABELIAN_GROUP. apply (BUILD_ABELIAN_GROUP (E:=N) (genlaw:=sgroup_law N) (e:= monoid_unit N) (geninv:=group_inverse_map N)); (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) y)), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) x y *) auto with algebra. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x')) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y')) => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) *) simpl in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) x0 x') (H0 : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) y0 y') => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)))) *) unfold subtype_image_equal in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x')) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y')) => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) y)), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) x y *) auto with algebra. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x')) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y')) => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) *) simpl in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) x0 x') (H0 : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) y0 y') => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)))) *) unfold subtype_image_equal in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x')) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y')) => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) y)), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) x y *) auto with algebra. Defined. Let endofun : R -> Endo_SET Na. (* Goal: forall _ : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), Carrier (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na))))))) *) intros a; try assumption. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x')) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y')) => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) *) simpl in |- *. apply (Build_Map (A:=N) (B:=N) (Ap:=fun x : N => Build_subtype (Nop a (subtype_prf x)))). (* Goal: @injective (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) *) red in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x')) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y')) => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) *) simpl in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) x0 x') (H0 : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) y0 y') => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)))) *) unfold subtype_image_equal in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x')) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y')) => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) y)), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) x y *) auto with algebra. Defined. Definition submodule_op : operation (ring_monoid R) Na. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x')) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y')) => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) *) simpl in |- *. (* Goal: monoid_hom (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R))) (Endo_SET (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))))) *) apply (BUILD_HOM_MONOID (G:=ring_monoid R) (G':=Endo_SET N) (ff:=endofun)). (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x')) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y')) => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) *) simpl in |- *. (* Goal: @injective (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) *) intros x y H'; red in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x')) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y')) => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) *) simpl in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) x0 x') (H0 : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) y0 y') => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)))) *) unfold subtype_image_equal in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x')) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y')) => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) y)), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) x y *) auto with algebra. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x')) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y')) => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) *) simpl in |- *. (* Goal: @injective (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) *) intros x y; red in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x')) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y')) => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) *) simpl in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) x0 x') (H0 : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) y0 y') => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)))) *) unfold subtype_image_equal in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x')) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y')) => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) *) simpl in |- *. (* Goal: forall x0 : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@module_mult R M (sgroup_law (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) x y) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0)) (@module_mult R M x (@module_mult R M y (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) (endofun (@monoid_unit (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_on_def (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))))) (@monoid_unit (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) *) intros x0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@module_mult R M (sgroup_law (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) x y) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0)) (@module_mult R M x (@module_mult R M y (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) (endofun (@monoid_unit (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_on_def (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))))) (@monoid_unit (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) *) exact (MODULE_assoc x y (subtype_elt x0)). (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x')) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y')) => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) *) simpl in |- *. (* Goal: @injective (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) *) red in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x')) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y')) => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) *) simpl in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) x0 x') (H0 : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) y0 y') => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)))) *) unfold subtype_image_equal in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x')) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y')) => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) *) simpl in |- *. (* Goal: forall x : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@module_mult R M (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) *) intros x; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@module_mult R M (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) *) exact (MODULE_unit_l (subtype_elt x)). Defined. Definition submodule_module : module R. (* Goal: module R *) apply (Build_module (R:=R) (module_carrier:=Na)). (* Goal: module_on R Na *) apply (Build_module_on (R:=R) (M:=Na) (module_op:=submodule_op)). (* Goal: @injective (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) *) red in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x')) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y')) => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) *) simpl in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) x0 x') (H0 : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) y0 y') => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)))) *) unfold subtype_image_equal in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x')) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y')) => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) y)), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) x y *) auto with algebra. (* Goal: @injective (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) *) red in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x')) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y')) => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) *) simpl in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) x0 x') (H0 : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) y0 y') => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)))) *) unfold subtype_image_equal in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x')) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y')) => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) y)), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) x y *) auto with algebra. Defined. End Sub_module. Record submodule : Type := {submodule_subgroup : subgroup M; submodule_prop : forall (a : R) (x : M), in_part x submodule_subgroup -> in_part (module_mult a x) submodule_subgroup}. Definition module_of_submodule (N : submodule) := submodule_module (submodule_prop (s:=N)). End Def. Coercion module_of_submodule : submodule >-> module. Coercion submodule_subgroup : submodule >-> subgroup. Section Injection. Variable R : RING. Variable M : MODULE R. Variable N : submodule M. Lemma submodule_in_prop : forall (a : R) (x : M), in_part x N -> in_part (module_mult a x) N. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) (@submodule_subgroup R M N))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@module_mult R M a x) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) (@submodule_subgroup R M N)))) *) intros a x H'; try assumption. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) y)), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) x y *) apply (submodule_prop (R:=R) (M:=M) (s:=N)); auto with algebra. Qed. Definition inj_submodule : Hom (N:MODULE R) M. apply (BUILD_HOM_MODULE (R:=R) (Mod:=N:MODULE R) (Mod':=M) (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) y)), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) x y *) (ff:=fun x : N => subtype_elt x)); auto with algebra. Defined. Lemma inj_submodule_injective : injective inj_submodule. (* Goal: @injective (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) *) red in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) y)), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) x y *) auto with algebra. Qed. End Injection. Hint Resolve submodule_in_prop inj_submodule_injective: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Group_util. Require Export Monoid_util. Require Export Ring_cat. (** Title "Tools for building rings." *) Section Ring. Variable E : Setoid. Variable ringplus : E -> E -> E. Variable ringmult : E -> E -> E. Variable zero : E. Variable un : E. Variable ringopp : E -> E. Hypothesis ringpluscomp : forall x x' y y' : E, Equal x x' -> Equal y y' -> Equal (ringplus x y) (ringplus x' y'). Hypothesis ringplusassoc : forall x y z : E, Equal (ringplus (ringplus x y) z) (ringplus x (ringplus y z)). Hypothesis zerounitringplusr : forall x : E, Equal (ringplus x zero) x. Hypothesis oppcomp : forall x y : E, Equal x y -> Equal (ringopp x) (ringopp y). Hypothesis ringoppr : forall x : E, Equal (ringplus x (ringopp x)) zero. Hypothesis ringpluscom : forall x y : E, Equal (ringplus x y) (ringplus y x). Hypothesis ringmultcomp : forall x x' y y' : E, Equal x x' -> Equal y y' -> Equal (ringmult x y) (ringmult x' y'). Hypothesis ringmultassoc : forall x y z : E, Equal (ringmult (ringmult x y) z) (ringmult x (ringmult y z)). Hypothesis ununitringmultr : forall x : E, Equal (ringmult x un) x. Hypothesis ununitlringmult : forall x : E, Equal (ringmult un x) x. Hypothesis ringdistl : forall x y z : E, Equal (ringmult x (ringplus y z)) (ringplus (ringmult x y) (ringmult x z)). Hypothesis ringdistr : forall x y z : E, Equal (ringmult (ringplus x y) z) (ringplus (ringmult x z) (ringmult y z)). Definition G := BUILD_ABELIAN_GROUP ringpluscomp ringplusassoc zerounitringplusr oppcomp ringoppr ringpluscom. Definition M := BUILD_MONOID ringmultcomp ringmultassoc ununitringmultr ununitlringmult. Definition BUILD_RING : RING. (* Goal: Ob RING *) apply (Build_ring (ring_group:=G)). (* Goal: ring_on G *) apply (Build_ring_on (R:=G) (ring_mult_sgroup:=M) (ring_mult_monoid:=M) M). abstract (red in |- *; simpl in |- *; intros x y z; apply Trans with (ringmult (ringplus x y) z); auto with algebra). (* Goal: @dist_l (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (@sgroup_law_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (sgroup_on_def (monoid_sgroup M))) (@sgroup_law_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (sgroup_on_def (monoid_sgroup (group_monoid (abelian_group_group G))))) *) abstract (red in |- *; simpl in |- *; auto with algebra). Defined. End Ring. Section Hom. Variable Ring1 Ring2 : ring. Variable ff : Ring1 -> Ring2. Hypothesis ffcomp : forall x y : Ring1, Equal x y -> Equal (ff x) (ff y). Hypothesis ffplus : forall x y : Ring1, Equal (ff (sgroup_law Ring1 x y)) (sgroup_law Ring2 (ff x) (ff y)). Hypothesis ffzero : Equal (ff (monoid_unit Ring1)) (monoid_unit Ring2). Hypothesis ffmult : forall x y : Ring1, Equal (ff (ring_mult x y)) (ring_mult (ff x) (ff y)). Hypothesis ffone : Equal (ff (ring_unit Ring1)) (ring_unit Ring2). Definition BUILD_HOM_RING : Hom (Ring1:RING) (Ring2:RING). apply (Build_ring_hom (E:=Ring1) (F:=Ring2) (ring_plus_hom:=BUILD_HOM_GROUP ffcomp ffplus ffzero)); (* Goal: @dist_l (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (@sgroup_law_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (sgroup_on_def (monoid_sgroup M))) (@sgroup_law_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (sgroup_on_def (monoid_sgroup (group_monoid (abelian_group_group G))))) *) abstract (red in |- *; simpl in |- *; auto with algebra). Defined. End Hom.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Automatic Coercions Import. Set Implicit Arguments. Unset Strict Implicit. Require Export Zring. Require Export Fraction_field. (* Check fraction_cfield. *) Lemma Z_one_diff_zero : ~ Equal (ring_unit ZZ) (monoid_unit ZZ). (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (ring_unit (cring_ring (idomain_ring ZZ))) (@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)))))))) *) simpl in |- *. (* Goal: not (@eq Z (ring_unit Zr_aux) Z0) *) unfold not in |- *; intros. (* Goal: False *) inversion H. Qed. Definition Q := fraction_cfield Z_one_diff_zero Zzero_dec.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Monoid_kernel. Require Export Free_monoid. Section Generated_monoid_def. Variable M : MONOID. Variable A : part_set M. Definition generated_monoid : submonoid M := image_monoid_hom (FM_lift (inj_part A)). End Generated_monoid_def. Lemma generated_monoid_minimal : forall (M : MONOID) (A : part_set M) (H : submonoid M), included A H -> included (generated_monoid A) H. (* Goal: forall (M : Ob MONOID) (A : Carrier (part_set (sgroup_set (monoid_sgroup M)))), @included (sgroup_set (monoid_sgroup M)) A (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M (@generated_monoid M A))) *) unfold included in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (@Var (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) (@Build_subtype (sgroup_set (monoid_sgroup M)) A x H'))) *) simpl in |- *. (* Goal: forall (M : monoid) (A : Predicate (sgroup_set (monoid_sgroup M))) (H : submonoid M) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : @in_part (sgroup_set (monoid_sgroup M)) x A), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H))) (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : @ex (FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (fun x0 : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) => and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) x0)))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *) intros M A H H' x H'0; try assumption. (* Goal: @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *) elim H'0; intros x0; clear H'0. (* Goal: forall _ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) x0)), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *) generalize x; clear x. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) x0))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *) elim x0. (* Goal: forall (c : Carrier (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (@Var (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) c)))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *) (* Goal: forall (f : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) f))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H))) (f0 : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) f0))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H))) (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (@Law (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) f f0)))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)))))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *) intros c; try assumption. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (@Var (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) c)))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *) (* Goal: forall (f : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) f))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H))) (f0 : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) f0))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H))) (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (@Law (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) f f0)))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)))))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *) elim c. (* Goal: @Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (@Var (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) (@Build_subtype (sgroup_set (monoid_sgroup M)) A x H'))) *) simpl in |- *. intros y subtype_prf x H'0; elim H'0; intros H'1 H'2; try exact H'2; clear H'0. (* Goal: @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *) (* Goal: forall (f : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) f))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H))) (f0 : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) f0))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H))) (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (@Law (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) f f0)))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)))))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *) apply in_part_comp_l with y; auto with algebra. (* Goal: forall (f : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) f))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H))) (f0 : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) f0))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H))) (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (@Law (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) f f0)))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)))))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *) intros f H'0 f0 H'1 x H'2; elim H'2; intros H'3 H'4; try exact H'4; clear H'2. (* Goal: @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)))))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *) simpl in H'4. apply in_part_comp_l with (sgroup_law M (FM_lift_fun (inj_part A) f) (FM_lift_fun (inj_part A) f0)); (* Goal: True *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (@Var (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) (@Build_subtype (sgroup_set (monoid_sgroup M)) A x H'))) *) simpl in |- *. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@monoid_unit (monoid_sgroup M) (monoid_on_def M)))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *) intros x H'0; elim H'0; intros H'1 H'2; try exact H'2; clear H'0. (* Goal: @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *) apply in_part_comp_l with (monoid_unit M); auto with algebra. Qed. Lemma generated_monoid_prop_included : forall (M : MONOID) (A : part_set M), included A (generated_monoid A). (* Goal: forall (M : Ob MONOID) (A : Carrier (part_set (sgroup_set (monoid_sgroup M)))), @included (sgroup_set (monoid_sgroup M)) A (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M (@generated_monoid M A))) *) unfold included in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (@Var (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) (@Build_subtype (sgroup_set (monoid_sgroup M)) A x H'))) *) simpl in |- *. (* Goal: forall (M : monoid) (A : Predicate (sgroup_set (monoid_sgroup M))) (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : @in_part (sgroup_set (monoid_sgroup M)) x A), @ex (FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (fun x0 : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) => and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) x0))) *) intros M A x H'; try assumption. exists (Var (V:=A) (Build_subtype (E:=M) (P:=A) (subtype_elt:=x) H')); split; [ idtac | try assumption ]. (* Goal: True *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (@Var (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) (@Build_subtype (sgroup_set (monoid_sgroup M)) A x H'))) *) simpl in |- *. (* Goal: True *) auto with algebra. Qed. Lemma generated_monoid_prop : forall (M : MONOID) (A : part_set M) (y : M), in_part y (generated_monoid A) -> exists x : FM A, Equal y (FM_lift (inj_part A) x). (* Goal: True *) simpl in |- *; auto with algebra. (* Goal: forall (M : Ob MONOID) (A : Carrier (part_set (sgroup_set (monoid_sgroup M)))) (y : Carrier (sgroup_set (monoid_sgroup M))) (_ : @ex (FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (fun x : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) => @Equal (sgroup_set (monoid_sgroup M)) y (@Ap (sgroup_set (monoid_sgroup (FreeMonoid (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))))) (sgroup_set (monoid_sgroup M)) (@sgroup_map (monoid_sgroup (FreeMonoid (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)))) (monoid_sgroup M) (@monoid_sgroup_hom (FreeMonoid (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) M (@FM_lift (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A)))) x))), @in_part (sgroup_set (monoid_sgroup M)) y (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M (@generated_monoid M A))) *) intros M A y H'; try assumption. (* Goal: @ex (FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (fun x : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) => @Equal (sgroup_set (monoid_sgroup M)) y (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) x)) *) elim H'; intros x E; elim E; intros H'0 H'1; try exact H'1; clear E H'. (* Goal: @ex (FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (fun x : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) => @Equal (sgroup_set (monoid_sgroup M)) y (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) x)) *) exists x; try assumption. Qed. Lemma generated_monoid_prop_rev : forall (M : MONOID) (A : part_set M) (y : M), (exists x : FM A, Equal y (FM_lift (inj_part A) x)) -> in_part y (generated_monoid A). (* Goal: forall (M : Ob MONOID) (A : Carrier (part_set (sgroup_set (monoid_sgroup M)))) (y : Carrier (sgroup_set (monoid_sgroup M))) (_ : @ex (FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (fun x : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) => @Equal (sgroup_set (monoid_sgroup M)) y (@Ap (sgroup_set (monoid_sgroup (FreeMonoid (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))))) (sgroup_set (monoid_sgroup M)) (@sgroup_map (monoid_sgroup (FreeMonoid (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)))) (monoid_sgroup M) (@monoid_sgroup_hom (FreeMonoid (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) M (@FM_lift (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A)))) x))), @in_part (sgroup_set (monoid_sgroup M)) y (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M (@generated_monoid M A))) *) intros M A y H'; try assumption. (* Goal: @in_part (sgroup_set (monoid_sgroup M)) y (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M (@generated_monoid M A))) *) elim H'; intros x E; try exact E; clear H'. (* Goal: True *) simpl in |- *; auto with algebra. (* Goal: @ex (FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (fun x : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) => and True (@Equal (sgroup_set (monoid_sgroup M)) y (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) x))) *) exists x; split; [ idtac | try assumption ]. (* Goal: True *) auto with algebra. Qed. Hint Resolve generated_monoid_minimal generated_monoid_prop_included generated_monoid_prop_rev: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Monoid_util. Require Export Parts2. Section Image_hom. Variable M M' : MONOID. Variable f : Hom M M'. Definition image_monoid_hom : submonoid M'. (* Goal: submonoid M' *) apply (BUILD_SUB_MONOID (G:=M') (H:=image_map f)). (* Goal: forall (y : Carrier (sgroup_set (monoid_sgroup M'))) (_ : @in_part (sgroup_set (monoid_sgroup M')) y (@subsgroup_part (monoid_sgroup M') (@submonoid_subsgroup M' image_monoid_hom))), @ex (Carrier (sgroup_set (monoid_sgroup M))) (fun x : Carrier (sgroup_set (monoid_sgroup M)) => @Equal (sgroup_set (monoid_sgroup M')) y (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup M')) (@sgroup_map (monoid_sgroup M) (monoid_sgroup M') (@monoid_sgroup_hom M M' f)) x)) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup M'))) (_ : @ex (Carrier (sgroup_set (monoid_sgroup M))) (fun x0 : Carrier (sgroup_set (monoid_sgroup M)) => and True (@Equal (sgroup_set (monoid_sgroup M')) x (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup M')) (@sgroup_map (monoid_sgroup M) (monoid_sgroup M') (@monoid_sgroup_hom M M' f)) x0)))) (_ : @ex (Carrier (sgroup_set (monoid_sgroup M))) (fun x0 : Carrier (sgroup_set (monoid_sgroup M)) => and True (@Equal (sgroup_set (monoid_sgroup M')) y (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup M')) (@sgroup_map (monoid_sgroup M) (monoid_sgroup M') (@monoid_sgroup_hom M M' f)) x0)))), @ex (Carrier (sgroup_set (monoid_sgroup M))) (fun x0 : Carrier (sgroup_set (monoid_sgroup M)) => and True (@Equal (sgroup_set (monoid_sgroup M')) (sgroup_law (monoid_sgroup M') x y) (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup M')) (@sgroup_map (monoid_sgroup M) (monoid_sgroup M') (@monoid_sgroup_hom M M' f)) x0))) *) (* Goal: @in_part (sgroup_set (monoid_sgroup M')) (@monoid_unit (monoid_sgroup M') (monoid_on_def M')) (@image_map (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup M')) (@sgroup_map (monoid_sgroup M) (monoid_sgroup M') (@monoid_sgroup_hom M M' f))) *) intros x y H' H'0; try assumption. (* Goal: @ex (Carrier (sgroup_set (monoid_sgroup M))) (fun x0 : Carrier (sgroup_set (monoid_sgroup M)) => and True (@Equal (sgroup_set (monoid_sgroup M')) (sgroup_law (monoid_sgroup M') x y) (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup M')) (@sgroup_map (monoid_sgroup M) (monoid_sgroup M') (@monoid_sgroup_hom M M' f)) x0))) *) (* Goal: @in_part (sgroup_set (monoid_sgroup M')) (@monoid_unit (monoid_sgroup M') (monoid_on_def M')) (@image_map (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup M')) (@sgroup_map (monoid_sgroup M) (monoid_sgroup M') (@monoid_sgroup_hom M M' f))) *) elim H'0; intros x0 E; elim E; intros H'1 H'2; try exact H'1; clear E H'0. (* Goal: @ex (Carrier (sgroup_set (monoid_sgroup M))) (fun x0 : Carrier (sgroup_set (monoid_sgroup M)) => and True (@Equal (sgroup_set (monoid_sgroup M')) (sgroup_law (monoid_sgroup M') x y) (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup M')) (@sgroup_map (monoid_sgroup M) (monoid_sgroup M') (@monoid_sgroup_hom M M' f)) x0))) *) (* Goal: @in_part (sgroup_set (monoid_sgroup M')) (@monoid_unit (monoid_sgroup M') (monoid_on_def M')) (@image_map (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup M')) (@sgroup_map (monoid_sgroup M) (monoid_sgroup M') (@monoid_sgroup_hom M M' f))) *) elim H'; intros x1 E; elim E; intros H'0 H'3; try exact H'0; clear E H'. (* Goal: @ex (Carrier (sgroup_set (monoid_sgroup M))) (fun x0 : Carrier (sgroup_set (monoid_sgroup M)) => and True (@Equal (sgroup_set (monoid_sgroup M')) (sgroup_law (monoid_sgroup M') x y) (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup M')) (@sgroup_map (monoid_sgroup M) (monoid_sgroup M') (@monoid_sgroup_hom M M' f)) x0))) *) (* Goal: @in_part (sgroup_set (monoid_sgroup M')) (@monoid_unit (monoid_sgroup M') (monoid_on_def M')) (@image_map (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup M')) (@sgroup_map (monoid_sgroup M) (monoid_sgroup M') (@monoid_sgroup_hom M M' f))) *) exists (sgroup_law M x1 x0); split; [ try assumption | idtac ]. apply Trans with (sgroup_law M' (Ap (sgroup_map (monoid_sgroup_hom f)) x1) (Ap (sgroup_map (monoid_sgroup_hom f)) x0)); (* Goal: @Equal (sgroup_set (monoid_sgroup M')) (@monoid_unit (monoid_sgroup M') (monoid_on_def M')) (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup M')) (@sgroup_map (monoid_sgroup M) (monoid_sgroup M') (@monoid_sgroup_hom M M' f)) (@monoid_unit (monoid_sgroup M) (monoid_on_def M))) *) auto with algebra. (* Goal: forall (y : Carrier (sgroup_set (monoid_sgroup M'))) (_ : @in_part (sgroup_set (monoid_sgroup M')) y (@subsgroup_part (monoid_sgroup M') (@submonoid_subsgroup M' image_monoid_hom))), @ex (Carrier (sgroup_set (monoid_sgroup M))) (fun x : Carrier (sgroup_set (monoid_sgroup M)) => @Equal (sgroup_set (monoid_sgroup M')) y (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup M')) (@sgroup_map (monoid_sgroup M) (monoid_sgroup M') (@monoid_sgroup_hom M M' f)) x)) *) simpl in |- *. (* Goal: @ex (Carrier (sgroup_set (monoid_sgroup M))) (fun x : Carrier (sgroup_set (monoid_sgroup M)) => and True (@Equal (sgroup_set (monoid_sgroup M')) (@monoid_unit (monoid_sgroup M') (monoid_on_def M')) (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup M')) (@sgroup_map (monoid_sgroup M) (monoid_sgroup M') (@monoid_sgroup_hom M M' f)) x))) *) exists (monoid_unit M); split; [ try assumption | idtac ]. (* Goal: @Equal (sgroup_set (monoid_sgroup M')) (@monoid_unit (monoid_sgroup M') (monoid_on_def M')) (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup M')) (@sgroup_map (monoid_sgroup M) (monoid_sgroup M') (@monoid_sgroup_hom M M' f)) (@monoid_unit (monoid_sgroup M) (monoid_on_def M))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup M')) (@monoid_unit (monoid_sgroup M') (monoid_on_def M')) (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup M')) (@sgroup_map (monoid_sgroup M) (monoid_sgroup M') (@monoid_sgroup_hom M M' f)) (@monoid_unit (monoid_sgroup M) (monoid_on_def M))) *) auto with algebra. Defined. Lemma image_monoid_prop : forall x : M, in_part (f x) image_monoid_hom. (* Goal: forall (y : Carrier (sgroup_set (monoid_sgroup M'))) (_ : @in_part (sgroup_set (monoid_sgroup M')) y (@subsgroup_part (monoid_sgroup M') (@submonoid_subsgroup M' image_monoid_hom))), @ex (Carrier (sgroup_set (monoid_sgroup M))) (fun x : Carrier (sgroup_set (monoid_sgroup M)) => @Equal (sgroup_set (monoid_sgroup M')) y (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup M')) (@sgroup_map (monoid_sgroup M) (monoid_sgroup M') (@monoid_sgroup_hom M M' f)) x)) *) simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup M')) (@monoid_unit (monoid_sgroup M') (monoid_on_def M')) (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup M')) (@sgroup_map (monoid_sgroup M) (monoid_sgroup M') (@monoid_sgroup_hom M M' f)) (@monoid_unit (monoid_sgroup M) (monoid_on_def M))) *) intros x; exists x; split; [ try assumption | idtac ]; auto with algebra. Qed. Lemma image_monoid_prop_rev : forall y : M', in_part y image_monoid_hom -> exists x : M, Equal y (f x). (* Goal: forall (y : Carrier (sgroup_set (monoid_sgroup M'))) (_ : @in_part (sgroup_set (monoid_sgroup M')) y (@subsgroup_part (monoid_sgroup M') (@submonoid_subsgroup M' image_monoid_hom))), @ex (Carrier (sgroup_set (monoid_sgroup M))) (fun x : Carrier (sgroup_set (monoid_sgroup M)) => @Equal (sgroup_set (monoid_sgroup M')) y (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup M')) (@sgroup_map (monoid_sgroup M) (monoid_sgroup M') (@monoid_sgroup_hom M M' f)) x)) *) simpl in |- *. (* Goal: forall (y : Carrier (sgroup_set (monoid_sgroup M'))) (_ : @ex (Carrier (sgroup_set (monoid_sgroup M))) (fun x : Carrier (sgroup_set (monoid_sgroup M)) => and True (@Equal (sgroup_set (monoid_sgroup M')) y (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup M')) (@sgroup_map (monoid_sgroup M) (monoid_sgroup M') (@monoid_sgroup_hom M M' f)) x)))), @ex (Carrier (sgroup_set (monoid_sgroup M))) (fun x : Carrier (sgroup_set (monoid_sgroup M)) => @Equal (sgroup_set (monoid_sgroup M')) y (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup M')) (@sgroup_map (monoid_sgroup M) (monoid_sgroup M') (@monoid_sgroup_hom M M' f)) x)) *) intros y H'; try assumption. (* Goal: @ex (Carrier (sgroup_set (monoid_sgroup M))) (fun x : Carrier (sgroup_set (monoid_sgroup M)) => @Equal (sgroup_set (monoid_sgroup M')) y (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup M')) (@sgroup_map (monoid_sgroup M) (monoid_sgroup M') (@monoid_sgroup_hom M M' f)) x)) *) elim H'; intros x E; elim E; intros H'0 H'1; try exact H'0; clear E H'. (* Goal: @ex (Carrier (sgroup_set (monoid_sgroup M))) (fun x : Carrier (sgroup_set (monoid_sgroup M)) => @Equal (sgroup_set (monoid_sgroup M')) y (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup M')) (@sgroup_map (monoid_sgroup M) (monoid_sgroup M') (@monoid_sgroup_hom M M' f)) x)) *) exists x; try assumption. Qed. End Image_hom. Hint Resolve image_monoid_prop image_monoid_prop: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Parts. (** Title "Difference of two parts." *) Section Diff. Variable E : Setoid. Definition diff : part_set E -> part_set E -> part_set E. (* Goal: forall (_ : Carrier (part_set E)) (_ : Carrier (part_set E)), Carrier (part_set E) *) intros A B. (* Goal: Carrier (part_set E) *) apply (Build_Predicate (Pred_fun:=fun x : E => in_part x A /\ ~ in_part x B)). (* Goal: not (@in_part E x B) *) red in |- *. (* Goal: forall (x y : Carrier E) (_ : and (@in_part E x A) (not (@in_part E x B))) (_ : @Equal E y x), and (@in_part E y A) (not (@in_part E y B)) *) intros x y H' H'0; try assumption. (* Goal: and (@in_part E y A) (not (@in_part E y B)) *) elim H'; intros H'1 H'2; try exact H'1; clear H'. (* Goal: and (@in_part E y A) (not (@in_part E y B)) *) split; [ try assumption | idtac ]. (* Goal: @in_part E y A *) (* Goal: not (@in_part E y B) *) apply in_part_comp_l with x; auto with algebra. (* Goal: not (@in_part E x B) *) red in |- *. (* Goal: forall _ : @in_part E y B, False *) intros H'; try assumption. (* Goal: False *) (* Goal: forall _ : and (@in_part E x A') (not (@in_part E x B')), and (@in_part E x A) (not (@in_part E x B)) *) absurd (in_part x B); auto with algebra. (* Goal: @in_part E x B *) apply in_part_comp_l with y; auto with algebra. Defined. Lemma diff_comp : forall A A' B B' : part_set E, Equal A A' -> Equal B B' -> Equal (diff A B) (diff A' B'). (* Goal: forall (A A' B B' : Carrier (part_set E)) (_ : @Equal (part_set E) A A') (_ : @Equal (part_set E) B B'), @Equal (part_set E) (diff A B) (diff A' B') *) intros A A' B B'; try assumption. (* Goal: forall (_ : @Equal (part_set E) A A') (_ : @Equal (part_set E) B B'), @Equal (part_set E) (diff A B) (diff A' B') *) unfold diff in |- *; simpl in |- *. (* Goal: forall (_ : @eq_part E A A') (_ : @eq_part E B B'), @eq_part E (@Build_Predicate E (fun x : Carrier E => and (@in_part E x A) (not (@in_part E x B))) (fun (x y : Carrier E) (H' : and (@in_part E x A) (not (@in_part E x B))) (H'0 : @Equal E y x) => @and_ind (@in_part E x A) (not (@in_part E x B)) (and (@in_part E y A) (not (@in_part E y B))) (fun (H'1 : @in_part E x A) (H'2 : not (@in_part E x B)) => @conj (@in_part E y A) (not (@in_part E y B)) (@in_part_comp_l E A x y H'1 H'0) (fun H'3 : @in_part E y B => False_ind False (H'2 (@in_part_comp_l E B y x H'3 (@Sym E y x H'0))))) H')) (@Build_Predicate E (fun x : Carrier E => and (@in_part E x A') (not (@in_part E x B'))) (fun (x y : Carrier E) (H' : and (@in_part E x A') (not (@in_part E x B'))) (H'0 : @Equal E y x) => @and_ind (@in_part E x A') (not (@in_part E x B')) (and (@in_part E y A') (not (@in_part E y B'))) (fun (H'1 : @in_part E x A') (H'2 : not (@in_part E x B')) => @conj (@in_part E y A') (not (@in_part E y B')) (@in_part_comp_l E A' x y H'1 H'0) (fun H'3 : @in_part E y B' => False_ind False (H'2 (@in_part_comp_l E B' y x H'3 (@Sym E y x H'0))))) H')) *) unfold eq_part in |- *; simpl in |- *. intros H' H'0 x; split; [ intros H'1; split; [ try assumption | idtac ] | idtac ]. elim (H' x); intros H'3 H'4; lapply H'3; [ intros H'5; try exact H'5; clear H'3 | clear H'3 ]. (* Goal: @in_part E x A *) (* Goal: not (@in_part E x B') *) (* Goal: forall _ : and (@in_part E x A') (not (@in_part E x B')), and (@in_part E x A) (not (@in_part E x B)) *) elim H'1; intros H'2 H'3; try exact H'2; clear H'1. (* Goal: not (@in_part E x B) *) red in |- *. (* Goal: forall _ : @in_part E x B, False *) intros H'2; try assumption. (* Goal: False *) (* Goal: forall _ : and (@in_part E x A') (not (@in_part E x B')), and (@in_part E x A) (not (@in_part E x B)) *) absurd (in_part x B); auto with algebra. (* Goal: not (@in_part E x B') *) (* Goal: @in_part E x B' *) elim H'1; intros H'3 H'4; try exact H'4; clear H'1. elim (H'0 x); intros H'4 H'5; lapply H'5; [ intros H'6; try exact H'6; clear H'5 | clear H'5 ]. (* Goal: @in_part E x B' *) (* Goal: forall _ : and (@in_part E x A') (not (@in_part E x B')), and (@in_part E x A) (not (@in_part E x B)) *) auto with algebra. (* Goal: and (@in_part E y A) (not (@in_part E y B)) *) intros H'1; split; [ try assumption | idtac ]. elim (H' x); intros H'3 H'4; lapply H'4; [ intros H'5; try exact H'5; clear H'4 | clear H'4 ]. (* Goal: @in_part E x A' *) (* Goal: not (@in_part E x B) *) elim H'1; intros H'2 H'4; try exact H'2; clear H'1. (* Goal: not (@in_part E x B) *) red in |- *. (* Goal: forall _ : @in_part E x B, False *) intros H'2; try assumption. (* Goal: @in_part E x B' *) (* Goal: forall _ : and (@in_part E x A') (not (@in_part E x B')), and (@in_part E x A) (not (@in_part E x B)) *) absurd (in_part x B'); auto with algebra. (* Goal: not (@in_part E x B') *) (* Goal: @in_part E x B' *) elim H'1; intros H'3 H'4; try exact H'4; clear H'1. elim (H'0 x); intros H'4 H'5; lapply H'4; [ intros H'6; try exact H'6; clear H'4 | clear H'4 ]. (* Goal: @in_part E x B *) try exact H'2. Qed. End Diff. Hint Resolve diff_comp: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Sub_monoid. Require Export Group_facts. Section Def. Variable G : GROUP. Section Sub_group. Variable H : submonoid G. Hypothesis Hinv : forall x : G, in_part x H -> in_part (group_inverse _ x) H. Definition subgroup_inv : MAP H H. apply (Build_Map (A:=H) (B:=H) (Ap:=fun x : H => Build_subtype (Hinv (subtype_prf x)))). (* Goal: @injective (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H)))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (@group_of_subgroup G H))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (@group_of_subgroup G H)) (group_monoid G) inj_subgroup)) *) red in |- *. (* Goal: forall x : @subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subsgroup_prop (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H) (group_inverse G (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x) (@Hinv (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@submonoid_prop (group_monoid G) H))) *) simpl in |- *. (* Goal: forall x : @subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)), @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid G))) (@subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subsgroup_prop (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H) (group_inverse G (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x) (@Hinv (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@submonoid_prop (group_monoid G) H)) *) unfold subtype_image_equal in |- *. (* Goal: forall x : @subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subsgroup_prop (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H) (group_inverse G (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x) (@Hinv (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@submonoid_prop (group_monoid G) H))) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H)))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (@group_of_subgroup G H))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (@group_of_subgroup G H)) (group_monoid G) inj_subgroup)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H)))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (@group_of_subgroup G H))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (@group_of_subgroup G H)) (group_monoid G) inj_subgroup)) y)), @Equal (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H)))) x y *) auto with algebra. Defined. Definition subgroup_group : group. (* Goal: group *) apply (Build_group (group_monoid:=H)). (* Goal: group_on (@monoid_of_submonoid (group_monoid G) H) *) apply (Build_group_on (G:=H) (group_inverse_map:=subgroup_inv)). (* Goal: @injective (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H)))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (@group_of_subgroup G H))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (@group_of_subgroup G H)) (group_monoid G) inj_subgroup)) *) red in |- *. (* Goal: forall x : @subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subsgroup_prop (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H) (group_inverse G (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x) (@Hinv (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@submonoid_prop (group_monoid G) H))) *) simpl in |- *. (* Goal: forall x : @subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)), @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid G))) (@subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subsgroup_prop (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H) (group_inverse G (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x) (@Hinv (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@submonoid_prop (group_monoid G) H)) *) unfold subtype_image_equal in |- *. (* Goal: forall x : @subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subsgroup_prop (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H) (group_inverse G (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x) (@Hinv (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@submonoid_prop (group_monoid G) H))) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H)))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (@group_of_subgroup G H))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (@group_of_subgroup G H)) (group_monoid G) inj_subgroup)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H)))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (@group_of_subgroup G H))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (@group_of_subgroup G H)) (group_monoid G) inj_subgroup)) y)), @Equal (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H)))) x y *) auto with algebra. (* Goal: @injective (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H)))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (@group_of_subgroup G H))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (@group_of_subgroup G H)) (group_monoid G) inj_subgroup)) *) red in |- *. (* Goal: forall x : @subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subsgroup_prop (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H) (group_inverse G (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x) (@Hinv (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@submonoid_prop (group_monoid G) H))) *) simpl in |- *. (* Goal: forall x : @subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)), @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid G))) (@subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subsgroup_prop (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H) (group_inverse G (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x) (@Hinv (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@submonoid_prop (group_monoid G) H)) *) unfold subtype_image_equal in |- *. (* Goal: forall x : @subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subsgroup_prop (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H) (group_inverse G (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x) (@Hinv (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) x)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) H)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@submonoid_prop (group_monoid G) H))) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H)))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (@group_of_subgroup G H))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (@group_of_subgroup G H)) (group_monoid G) inj_subgroup)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H)))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (@group_of_subgroup G H))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (@group_of_subgroup G H)) (group_monoid G) inj_subgroup)) y)), @Equal (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H)))) x y *) auto with algebra. Defined. End Sub_group. Record subgroup : Type := {subgroup_submonoid : submonoid G; subgroup_prop : forall x : G, in_part x subgroup_submonoid -> in_part (group_inverse _ x) subgroup_submonoid}. Definition group_of_subgroup (H : subgroup) := subgroup_group (subgroup_prop (s:=H)). End Def. Coercion group_of_subgroup : subgroup >-> group. Coercion subgroup_submonoid : subgroup >-> submonoid. Section Injection. Variable G : GROUP. Variable H : subgroup G. Lemma subgroup_in_prop : forall x : G, in_part x H -> in_part (group_inverse _ x) H. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G x) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) intros x H'; try assumption. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H)))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (@group_of_subgroup G H))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (@group_of_subgroup G H)) (group_monoid G) inj_subgroup)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H)))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (@group_of_subgroup G H))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (@group_of_subgroup G H)) (group_monoid G) inj_subgroup)) y)), @Equal (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H)))) x y *) apply (subgroup_prop (G:=G) (s:=H)); auto with algebra. Qed. Definition inj_subgroup : Hom (H:GROUP) G. (* Goal: Carrier (@Hom GROUP (@group_of_subgroup G H : Ob GROUP) G) *) apply (Build_monoid_hom (E:=H) (F:=G) (monoid_sgroup_hom:=inj_subsgroup H)). (* Goal: @injective (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H)))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (@group_of_subgroup G H))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (@group_of_subgroup G H)) (group_monoid G) inj_subgroup)) *) red in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H)))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (@group_of_subgroup G H))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (@group_of_subgroup G H)) (group_monoid G) inj_subgroup)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H)))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (@group_of_subgroup G H))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (@group_of_subgroup G H)) (group_monoid G) inj_subgroup)) y)), @Equal (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H)))) x y *) auto with algebra. Defined. Lemma inj_subgroup_injective : injective inj_subgroup. (* Goal: @injective (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H)))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (@group_of_subgroup G H))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (@group_of_subgroup G H)) (group_monoid G) inj_subgroup)) *) red in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H)))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (@group_of_subgroup G H))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (@group_of_subgroup G H)) (group_monoid G) inj_subgroup)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H)))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (@group_of_subgroup G H))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (@group_of_subgroup G H)) (group_monoid G) inj_subgroup)) y)), @Equal (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G H)))) x y *) auto with algebra. Qed. End Injection. Hint Resolve subgroup_in_prop inj_subgroup_injective: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Group_kernel. (** Title "Factorisation of a group homomorphism: G -> G/Kerf -> coKerf -> G'." *) Section Def. Variable G G' : GROUP. Variable f : Hom G G'. Definition surj_group_quo_ker : Hom G (group_quo G (Ker f) (kernel_normal (G:=G) (G':=G') (f:=f))) := group_quo_surj (kernel_normal (f:=f)). Lemma surj_group_quo_ker_surjective : surjective surj_group_quo_ker. (* Goal: @surjective (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@sgroup_map (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))) (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f)))) (@monoid_sgroup_hom (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))) (group_monoid (@group_of_subgroup G' (@coKer G G' f))) bij_group_quo_ker_coKer)) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@f2 (@group_of_subgroup G' (@coKer G G' f)) G' (fun x0 : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) => @subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) x0) (fun (x0 y : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) x0 y) => H)) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@group_quo_set G (@Ker G G' f) (@kernel_normal G G' f)) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (@f2 (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (@group_of_subgroup G' (@coKer G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => @Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@coKer_prop G G' f x0)) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @GROUP_reg_right G' (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (@Refl (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0)) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@GROUP_hom_prop G G' f y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x0 (group_inverse G y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) H' (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@GROUP_inverse_r G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)))))))) (@f2 G (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => x0) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y) => @in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y)) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (@submonoid_in_prop (group_monoid G) (@Build_submonoid (group_monoid G) (@Build_subsgroup (monoid_sgroup (group_monoid G)) (@kernel_part G G' f) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H'0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x1 y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x1 y0) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) H'0 H'1) (@MONOID_unit_l (group_monoid G') (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))))))) (@MONOID_hom_prop (group_monoid G) (group_monoid G') f))) (@GROUP_inverse_r G x0)) (@SGROUP_comp (monoid_sgroup (group_monoid G)) x0 x0 (group_inverse G y) (group_inverse G x0) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x0) (@GROUP_comp G y x0 (@Sym (sgroup_set (monoid_sgroup (group_monoid G))) x0 y H'))))))) x) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@coKer_prop G G' f x)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@coKer_prop G G' f y))), @group_quo_eq G (@Ker G G' f) x y *) (* Goal: @surjective (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@sgroup_map (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))) (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f)))) (@monoid_sgroup_hom (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))) (group_monoid (@group_of_subgroup G' (@coKer G G' f))) bij_group_quo_ker_coKer)) *) unfold group_quo_eq, subtype_image_equal in |- *. (* Goal: forall y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (fun x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G x)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@Ker G G' f))))) *) intros y; exists y; try assumption. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@f2 (@group_of_subgroup G' (@coKer G G' f)) G' (fun x0 : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) => @subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) x0) (fun (x0 y : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) x0 y) => H)) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@group_quo_set G (@Ker G G' f) (@kernel_normal G G' f)) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (@f2 (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (@group_of_subgroup G' (@coKer G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => @Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@coKer_prop G G' f x0)) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @GROUP_reg_right G' (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (@Refl (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0)) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@GROUP_hom_prop G G' f y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x0 (group_inverse G y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) H' (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@GROUP_inverse_r G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)))))))) (@f2 G (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => x0) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y) => @in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y)) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (@submonoid_in_prop (group_monoid G) (@Build_submonoid (group_monoid G) (@Build_subsgroup (monoid_sgroup (group_monoid G)) (@kernel_part G G' f) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H'0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x1 y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x1 y0) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) H'0 H'1) (@MONOID_unit_l (group_monoid G') (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))))))) (@MONOID_hom_prop (group_monoid G) (group_monoid G') f))) (@GROUP_inverse_r G x0)) (@SGROUP_comp (monoid_sgroup (group_monoid G)) x0 x0 (group_inverse G y) (group_inverse G x0) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x0) (@GROUP_comp G y x0 (@Sym (sgroup_set (monoid_sgroup (group_monoid G))) x0 y H'))))))) x) *) simpl in |- *. apply Trans with (Ap (sgroup_map (monoid_sgroup_hom f)) (monoid_unit G)); (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) *) auto with algebra. Qed. Definition inj_coKer_group : Hom (coKer f:GROUP) G'. (* Goal: Carrier (@Hom GROUP (@group_of_subgroup G' (@coKer G G' f) : Ob GROUP) G') *) apply (BUILD_HOM_GROUP (G:=coKer f) (G':=G') (ff:=inj_part (coKer f))). (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@f2 (@group_of_subgroup G' (@coKer G G' f)) G' (fun x0 : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) => @subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) x0) (fun (x0 y : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) x0 y) => H)) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@group_quo_set G (@Ker G G' f) (@kernel_normal G G' f)) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (@f2 (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (@group_of_subgroup G' (@coKer G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => @Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@coKer_prop G G' f x0)) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @GROUP_reg_right G' (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (@Refl (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0)) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@GROUP_hom_prop G G' f y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x0 (group_inverse G y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) H' (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@GROUP_inverse_r G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)))))))) (@f2 G (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => x0) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y) => @in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y)) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (@submonoid_in_prop (group_monoid G) (@Build_submonoid (group_monoid G) (@Build_subsgroup (monoid_sgroup (group_monoid G)) (@kernel_part G G' f) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H'0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x1 y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x1 y0) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) H'0 H'1) (@MONOID_unit_l (group_monoid G') (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))))))) (@MONOID_hom_prop (group_monoid G) (group_monoid G') f))) (@GROUP_inverse_r G x0)) (@SGROUP_comp (monoid_sgroup (group_monoid G)) x0 x0 (group_inverse G y) (group_inverse G x0) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x0) (@GROUP_comp G y x0 (@Sym (sgroup_set (monoid_sgroup (group_monoid G))) x0 y H'))))))) x) *) simpl in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) *) auto with algebra. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@f2 (@group_of_subgroup G' (@coKer G G' f)) G' (fun x0 : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) => @subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) x0) (fun (x0 y : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) x0 y) => H)) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@group_quo_set G (@Ker G G' f) (@kernel_normal G G' f)) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (@f2 (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (@group_of_subgroup G' (@coKer G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => @Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@coKer_prop G G' f x0)) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @GROUP_reg_right G' (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (@Refl (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0)) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@GROUP_hom_prop G G' f y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x0 (group_inverse G y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) H' (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@GROUP_inverse_r G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)))))))) (@f2 G (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => x0) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y) => @in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y)) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (@submonoid_in_prop (group_monoid G) (@Build_submonoid (group_monoid G) (@Build_subsgroup (monoid_sgroup (group_monoid G)) (@kernel_part G G' f) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H'0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x1 y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x1 y0) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) H'0 H'1) (@MONOID_unit_l (group_monoid G') (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))))))) (@MONOID_hom_prop (group_monoid G) (group_monoid G') f))) (@GROUP_inverse_r G x0)) (@SGROUP_comp (monoid_sgroup (group_monoid G)) x0 x0 (group_inverse G y) (group_inverse G x0) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x0) (@GROUP_comp G y x0 (@Sym (sgroup_set (monoid_sgroup (group_monoid G))) x0 y H'))))))) x) *) simpl in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) *) auto with algebra. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@f2 (@group_of_subgroup G' (@coKer G G' f)) G' (fun x0 : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) => @subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) x0) (fun (x0 y : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) x0 y) => H)) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@group_quo_set G (@Ker G G' f) (@kernel_normal G G' f)) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (@f2 (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (@group_of_subgroup G' (@coKer G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => @Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@coKer_prop G G' f x0)) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @GROUP_reg_right G' (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (@Refl (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0)) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@GROUP_hom_prop G G' f y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x0 (group_inverse G y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) H' (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@GROUP_inverse_r G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)))))))) (@f2 G (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => x0) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y) => @in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y)) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (@submonoid_in_prop (group_monoid G) (@Build_submonoid (group_monoid G) (@Build_subsgroup (monoid_sgroup (group_monoid G)) (@kernel_part G G' f) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H'0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x1 y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x1 y0) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) H'0 H'1) (@MONOID_unit_l (group_monoid G') (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))))))) (@MONOID_hom_prop (group_monoid G) (group_monoid G') f))) (@GROUP_inverse_r G x0)) (@SGROUP_comp (monoid_sgroup (group_monoid G)) x0 x0 (group_inverse G y) (group_inverse G x0) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x0) (@GROUP_comp G y x0 (@Sym (sgroup_set (monoid_sgroup (group_monoid G))) x0 y H'))))))) x) *) simpl in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) *) auto with algebra. Defined. Lemma inj_coKer_group_injective : injective inj_coKer_group. (* Goal: @injective (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f)))) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid (@group_of_subgroup G' (@coKer G G' f))) (group_monoid G') inj_coKer_group)) *) exact (inj_part_injective (E:=G') (A:=coKer f)). Qed. Definition bij_group_quo_ker_coKer : Hom (group_quo G (Ker f) (kernel_normal (G:=G) (G':=G') (f:=f)):GROUP) (coKer f). apply (BUILD_HOM_GROUP (G:=group_quo G (Ker f) (kernel_normal (G:=G) (G':=G') (f:=f))) (G':=coKer f) (ff:=fun x : G => Build_subtype (P:=image (sgroup_map (monoid_sgroup_hom f)) (full G)) (subtype_elt:=f x) (coKer_prop f x))). (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@f2 (@group_of_subgroup G' (@coKer G G' f)) G' (fun x0 : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) => @subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) x0) (fun (x0 y : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) x0 y) => H)) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@group_quo_set G (@Ker G G' f) (@kernel_normal G G' f)) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (@f2 (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (@group_of_subgroup G' (@coKer G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => @Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@coKer_prop G G' f x0)) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @GROUP_reg_right G' (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (@Refl (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0)) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@GROUP_hom_prop G G' f y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x0 (group_inverse G y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) H' (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@GROUP_inverse_r G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)))))))) (@f2 G (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => x0) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y) => @in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y)) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (@submonoid_in_prop (group_monoid G) (@Build_submonoid (group_monoid G) (@Build_subsgroup (monoid_sgroup (group_monoid G)) (@kernel_part G G' f) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H'0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x1 y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x1 y0) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) H'0 H'1) (@MONOID_unit_l (group_monoid G') (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))))))) (@MONOID_hom_prop (group_monoid G) (group_monoid G') f))) (@GROUP_inverse_r G x0)) (@SGROUP_comp (monoid_sgroup (group_monoid G)) x0 x0 (group_inverse G y) (group_inverse G x0) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x0) (@GROUP_comp G y x0 (@Sym (sgroup_set (monoid_sgroup (group_monoid G))) x0 y H'))))))) x) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@coKer_prop G G' f x)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@coKer_prop G G' f y))), @group_quo_eq G (@Ker G G' f) x y *) (* Goal: @surjective (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@sgroup_map (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))) (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f)))) (@monoid_sgroup_hom (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))) (group_monoid (@group_of_subgroup G' (@coKer G G' f))) bij_group_quo_ker_coKer)) *) unfold group_quo_eq, subtype_image_equal in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@f2 (@group_of_subgroup G' (@coKer G G' f)) G' (fun x0 : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) => @subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) x0) (fun (x0 y : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) x0 y) => H)) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@group_quo_set G (@Ker G G' f) (@kernel_normal G G' f)) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (@f2 (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (@group_of_subgroup G' (@coKer G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => @Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@coKer_prop G G' f x0)) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @GROUP_reg_right G' (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (@Refl (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0)) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@GROUP_hom_prop G G' f y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x0 (group_inverse G y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) H' (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@GROUP_inverse_r G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)))))))) (@f2 G (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => x0) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y) => @in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y)) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (@submonoid_in_prop (group_monoid G) (@Build_submonoid (group_monoid G) (@Build_subsgroup (monoid_sgroup (group_monoid G)) (@kernel_part G G' f) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H'0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x1 y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x1 y0) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) H'0 H'1) (@MONOID_unit_l (group_monoid G') (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))))))) (@MONOID_hom_prop (group_monoid G) (group_monoid G') f))) (@GROUP_inverse_r G x0)) (@SGROUP_comp (monoid_sgroup (group_monoid G)) x0 x0 (group_inverse G y) (group_inverse G x0) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x0) (@GROUP_comp G y x0 (@Sym (sgroup_set (monoid_sgroup (group_monoid G))) x0 y H'))))))) x) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) *) (* Goal: @surjective (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@sgroup_map (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))) (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f)))) (@monoid_sgroup_hom (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))) (group_monoid (@group_of_subgroup G' (@coKer G G' f))) bij_group_quo_ker_coKer)) *) intros x y H'; try assumption. apply GROUP_reg_right with (group_inverse _ (Ap (sgroup_map (monoid_sgroup_hom f)) y)); (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) *) auto with algebra. apply Trans with (sgroup_law G' (Ap (sgroup_map (monoid_sgroup_hom f)) x) (Ap (sgroup_map (monoid_sgroup_hom f)) (group_inverse G y))); (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) *) auto with algebra. apply Trans with (Ap (sgroup_map (monoid_sgroup_hom f)) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) *) (sgroup_law G x (group_inverse G y))); auto with algebra. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) *) apply Trans with (monoid_unit G'); auto with algebra. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@f2 (@group_of_subgroup G' (@coKer G G' f)) G' (fun x0 : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) => @subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) x0) (fun (x0 y : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) x0 y) => H)) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@group_quo_set G (@Ker G G' f) (@kernel_normal G G' f)) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (@f2 (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (@group_of_subgroup G' (@coKer G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => @Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@coKer_prop G G' f x0)) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @GROUP_reg_right G' (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (@Refl (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0)) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@GROUP_hom_prop G G' f y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x0 (group_inverse G y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) H' (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@GROUP_inverse_r G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)))))))) (@f2 G (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => x0) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y) => @in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y)) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (@submonoid_in_prop (group_monoid G) (@Build_submonoid (group_monoid G) (@Build_subsgroup (monoid_sgroup (group_monoid G)) (@kernel_part G G' f) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H'0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x1 y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x1 y0) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) H'0 H'1) (@MONOID_unit_l (group_monoid G') (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))))))) (@MONOID_hom_prop (group_monoid G) (group_monoid G') f))) (@GROUP_inverse_r G x0)) (@SGROUP_comp (monoid_sgroup (group_monoid G)) x0 x0 (group_inverse G y) (group_inverse G x0) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x0) (@GROUP_comp G y x0 (@Sym (sgroup_set (monoid_sgroup (group_monoid G))) x0 y H'))))))) x) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@coKer_prop G G' f x)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@coKer_prop G G' f y))), @group_quo_eq G (@Ker G G' f) x y *) (* Goal: @surjective (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@sgroup_map (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))) (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f)))) (@monoid_sgroup_hom (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))) (group_monoid (@group_of_subgroup G' (@coKer G G' f))) bij_group_quo_ker_coKer)) *) unfold group_quo_eq, subtype_image_equal in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@f2 (@group_of_subgroup G' (@coKer G G' f)) G' (fun x0 : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) => @subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) x0) (fun (x0 y : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) x0 y) => H)) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@group_quo_set G (@Ker G G' f) (@kernel_normal G G' f)) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (@f2 (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (@group_of_subgroup G' (@coKer G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => @Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@coKer_prop G G' f x0)) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @GROUP_reg_right G' (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (@Refl (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0)) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@GROUP_hom_prop G G' f y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x0 (group_inverse G y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) H' (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@GROUP_inverse_r G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)))))))) (@f2 G (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => x0) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y) => @in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y)) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (@submonoid_in_prop (group_monoid G) (@Build_submonoid (group_monoid G) (@Build_subsgroup (monoid_sgroup (group_monoid G)) (@kernel_part G G' f) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H'0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x1 y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x1 y0) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) H'0 H'1) (@MONOID_unit_l (group_monoid G') (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))))))) (@MONOID_hom_prop (group_monoid G) (group_monoid G') f))) (@GROUP_inverse_r G x0)) (@SGROUP_comp (monoid_sgroup (group_monoid G)) x0 x0 (group_inverse G y) (group_inverse G x0) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x0) (@GROUP_comp G y x0 (@Sym (sgroup_set (monoid_sgroup (group_monoid G))) x0 y H'))))))) x) *) simpl in |- *. (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (@sg (@group_quo_set G (@Ker G G' f) (@kernel_normal G G' f)) (fun x0 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid G)) x0 y0) (fun (x0 x' y0 y' : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (H'0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) y0 (group_inverse G y'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (sgroup_law (monoid_sgroup (group_monoid G)) y0 (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x' y')))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x' y'))) (@normal_com_in G (@Ker G G' f) (@kernel_normal G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) y0 (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x' y'))) x0 (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y0 (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y') (group_inverse G x'))) x0) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y0 (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x' y'))) x0) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y0 (group_inverse G y')) (group_inverse G x')) x0) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y0 (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y') (group_inverse G x'))) x0) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y0 (group_inverse G y')) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G x') x0)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y0 (group_inverse G y')) (group_inverse G x')) x0) (@subsgroup_in_prop (monoid_sgroup (group_monoid G)) (@Build_subsgroup (monoid_sgroup (group_monoid G)) (@kernel_part G G' f) (fun (x1 y1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (H'2 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x1 y1)) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y1)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x1 y1) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y1)) (sgroup_law (monoid_sgroup (group_monoid G')) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) H'1 H'2) (@MONOID_unit_l (group_monoid G') (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))))))) (sgroup_law (monoid_sgroup (group_monoid G)) y0 (group_inverse G y')) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G x') x0) H'0 (@normal_com_in G (@Ker G G' f) (@kernel_normal G G' f) x0 (group_inverse G x') H')) (@SGROUP_assoc (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y0 (group_inverse G y')) (group_inverse G x') x0)) (@SGROUP_comp (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y0 (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y') (group_inverse G x'))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y0 (group_inverse G y')) (group_inverse G x')) x0 x0 (@Sym (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y0 (group_inverse G y')) (group_inverse G x')) (sgroup_law (monoid_sgroup (group_monoid G)) y0 (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y') (group_inverse G x'))) (@SGROUP_assoc (monoid_sgroup (group_monoid G)) y0 (group_inverse G y') (group_inverse G x'))) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x0))) (@SGROUP_comp (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y0 (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x' y'))) (sgroup_law (monoid_sgroup (group_monoid G)) y0 (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y') (group_inverse G x'))) x0 x0 (@SGROUP_comp (monoid_sgroup (group_monoid G)) y0 y0 (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x' y')) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y') (group_inverse G x')) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) y0) (@GROUP_inverse_law G x' y')) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x0)))) (@SGROUP_assoc (monoid_sgroup (group_monoid G)) x0 y0 (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x' y')))) (fun x0 y0 z : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => @in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0) z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) y0 z)) (group_inverse G x0))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0) z) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x0 (sgroup_law (monoid_sgroup (group_monoid G)) y0 z)))) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0) z) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (group_inverse G y0)) (group_inverse G x0))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0) z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) y0 z)) (group_inverse G x0))) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (sgroup_law (monoid_sgroup (group_monoid G)) y0 z)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0)))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0) z) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (group_inverse G y0)) (group_inverse G x0))) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y0 z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0))))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (sgroup_law (monoid_sgroup (group_monoid G)) y0 z)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0)))) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (sgroup_law (monoid_sgroup (group_monoid G)) y0 (sgroup_law (monoid_sgroup (group_monoid G)) z (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0)))))) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y0 z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0))))) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (sgroup_law (monoid_sgroup (group_monoid G)) y0 (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) z (group_inverse G z)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0))))) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (sgroup_law (monoid_sgroup (group_monoid G)) y0 (sgroup_law (monoid_sgroup (group_monoid G)) z (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0)))))) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (sgroup_law (monoid_sgroup (group_monoid G)) y0 (sgroup_law (monoid_sgroup (group_monoid G)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0))))) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (sgroup_law (monoid_sgroup (group_monoid G)) y0 (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) z (group_inverse G z)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0))))) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (sgroup_law (monoid_sgroup (group_monoid G)) y0 (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0)))) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (sgroup_law (monoid_sgroup (group_monoid G)) y0 (sgroup_law (monoid_sgroup (group_monoid G)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0))))) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0))) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (sgroup_law (monoid_sgroup (group_monoid G)) y0 (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0)))) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0))) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0))) (@submonoid_in_prop (group_monoid G) (@Build_submonoid (group_monoid G) (@Build_subsgroup (monoid_sgroup (group_monoid G)) (@kernel_part G G' f) (fun (x1 y1 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (H'0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x1 y1)) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y1)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x1 y1) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y1)) (sgroup_law (monoid_sgroup (group_monoid G')) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) H' H'0) (@MONOID_unit_l (group_monoid G') (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))))))) (@MONOID_hom_prop (group_monoid G) (group_monoid G') f))) (@GROUP_inverse_r G (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0))) (@SGROUP_comp (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0) (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0)) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0)) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0)) (@Sym (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0)) (@GROUP_inverse_law G x0 y0)))) (@Sym (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0))) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (sgroup_law (monoid_sgroup (group_monoid G)) y0 (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0)))) (@SGROUP_assoc (monoid_sgroup (group_monoid G)) x0 y0 (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0))))) (@SGROUP_comp (monoid_sgroup (group_monoid G)) x0 x0 (sgroup_law (monoid_sgroup (group_monoid G)) y0 (sgroup_law (monoid_sgroup (group_monoid G)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0)))) (sgroup_law (monoid_sgroup (group_monoid G)) y0 (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0))) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x0) (@SGROUP_comp (monoid_sgroup (group_monoid G)) y0 y0 (sgroup_law (monoid_sgroup (group_monoid G)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0)) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) y0) (@MONOID_unit_l (group_monoid G) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0)))))) (@SGROUP_comp (monoid_sgroup (group_monoid G)) x0 x0 (sgroup_law (monoid_sgroup (group_monoid G)) y0 (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) z (group_inverse G z)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0)))) (sgroup_law (monoid_sgroup (group_monoid G)) y0 (sgroup_law (monoid_sgroup (group_monoid G)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0)))) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x0) (@SGROUP_comp (monoid_sgroup (group_monoid G)) y0 y0 (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) z (group_inverse G z)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0))) (sgroup_law (monoid_sgroup (group_monoid G)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0))) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) y0) (@SGROUP_comp (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) z (group_inverse G z)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0)) (@GROUP_inverse_r G z) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0))))))) (@SGROUP_comp (monoid_sgroup (group_monoid G)) x0 x0 (sgroup_law (monoid_sgroup (group_monoid G)) y0 (sgroup_law (monoid_sgroup (group_monoid G)) z (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0))))) (sgroup_law (monoid_sgroup (group_monoid G)) y0 (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) z (group_inverse G z)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0)))) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x0) (@SGROUP_comp (monoid_sgroup (group_monoid G)) y0 y0 (sgroup_law (monoid_sgroup (group_monoid G)) z (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0)))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) z (group_inverse G z)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0))) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) y0) (@Sym (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) z (group_inverse G z)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0))) (sgroup_law (monoid_sgroup (group_monoid G)) z (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0)))) (@SGROUP_assoc (monoid_sgroup (group_monoid G)) z (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0))))))) (@SGROUP_comp (monoid_sgroup (group_monoid G)) x0 x0 (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y0 z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0)))) (sgroup_law (monoid_sgroup (group_monoid G)) y0 (sgroup_law (monoid_sgroup (group_monoid G)) z (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0))))) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x0) (@SGROUP_assoc (monoid_sgroup (group_monoid G)) y0 z (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0)))))) (@SGROUP_assoc (monoid_sgroup (group_monoid G)) x0 (sgroup_law (monoid_sgroup (group_monoid G)) y0 z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0))))) (@SGROUP_comp (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0) z) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (sgroup_law (monoid_sgroup (group_monoid G)) y0 z)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (group_inverse G y0)) (group_inverse G x0)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y0) (group_inverse G x0))) (@SGROUP_assoc (monoid_sgroup (group_monoid G)) x0 y0 z) (@SGROUP_assoc (monoid_sgroup (group_monoid G)) (group_inverse G z) (group_inverse G y0) (group_inverse G x0)))) (@SGROUP_comp (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0) z) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0) z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) y0 z)) (group_inverse G x0)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (group_inverse G y0)) (group_inverse G x0)) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0) z)) (@SGROUP_comp (monoid_sgroup (group_monoid G)) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) y0 z)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (group_inverse G y0)) (group_inverse G x0) (group_inverse G x0) (@GROUP_inverse_law G y0 z) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G x0))))) (@SGROUP_comp (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0) z) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0) z) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x0 (sgroup_law (monoid_sgroup (group_monoid G)) y0 z))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) y0 z)) (group_inverse G x0)) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0) z)) (@GROUP_inverse_law G x0 (sgroup_law (monoid_sgroup (group_monoid G)) y0 z))))) x y)) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (@monoid_unit (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))) (monoid_on_def (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))))) (@coKer_prop G G' f (@monoid_unit (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))) (monoid_on_def (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))))) (@monoid_unit (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f)))) (monoid_on_def (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) *) intros x y; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (@sg (@group_quo_set G (@Ker G G' f) (@kernel_normal G G' f)) (fun x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => sgroup_law (monoid_sgroup (group_monoid G)) x y) (fun (x x' y y' : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (H'0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G y'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x' y')))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x' y'))) (@normal_com_in G (@Ker G G' f) (@kernel_normal G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x' y'))) x (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y') (group_inverse G x'))) x) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x' y'))) x) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G y')) (group_inverse G x')) x) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y') (group_inverse G x'))) x) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G y')) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G x') x)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G y')) (group_inverse G x')) x) (@subsgroup_in_prop (monoid_sgroup (group_monoid G)) (@Build_subsgroup (monoid_sgroup (group_monoid G)) (@kernel_part G G' f) (fun (x0 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (H'2 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x0 y0) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) H'1 H'2) (@MONOID_unit_l (group_monoid G') (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))))))) (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G y')) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G x') x) H'0 (@normal_com_in G (@Ker G G' f) (@kernel_normal G G' f) x (group_inverse G x') H')) (@SGROUP_assoc (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G y')) (group_inverse G x') x)) (@SGROUP_comp (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y') (group_inverse G x'))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G y')) (group_inverse G x')) x x (@Sym (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G y')) (group_inverse G x')) (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y') (group_inverse G x'))) (@SGROUP_assoc (monoid_sgroup (group_monoid G)) y (group_inverse G y') (group_inverse G x'))) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x))) (@SGROUP_comp (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x' y'))) (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y') (group_inverse G x'))) x x (@SGROUP_comp (monoid_sgroup (group_monoid G)) y y (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x' y')) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y') (group_inverse G x')) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) y) (@GROUP_inverse_law G x' y')) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x)))) (@SGROUP_assoc (monoid_sgroup (group_monoid G)) x y (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x' y')))) (fun x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => @in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) y z)) (group_inverse G x))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)))) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (group_inverse G y)) (group_inverse G x))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) y z)) (group_inverse G x))) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (group_inverse G y)) (group_inverse G x))) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)))) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) z (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)))))) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))))) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) z (group_inverse G z)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))))) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) z (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)))))) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))))) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) z (group_inverse G z)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))))) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)))) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))))) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)))) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x y))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x y))) (@submonoid_in_prop (group_monoid G) (@Build_submonoid (group_monoid G) (@Build_subsgroup (monoid_sgroup (group_monoid G)) (@kernel_part G G' f) (fun (x0 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (H'0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x0 y0) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) H' H'0) (@MONOID_unit_l (group_monoid G') (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))))))) (@MONOID_hom_prop (group_monoid G) (group_monoid G') f))) (@GROUP_inverse_r G (sgroup_law (monoid_sgroup (group_monoid G)) x y))) (@SGROUP_comp (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x y)) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x y)) (@Sym (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x y)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)) (@GROUP_inverse_law G x y)))) (@Sym (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)))) (@SGROUP_assoc (monoid_sgroup (group_monoid G)) x y (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))))) (@SGROUP_comp (monoid_sgroup (group_monoid G)) x x (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)))) (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x) (@SGROUP_comp (monoid_sgroup (group_monoid G)) y y (sgroup_law (monoid_sgroup (group_monoid G)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) y) (@MONOID_unit_l (group_monoid G) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)))))) (@SGROUP_comp (monoid_sgroup (group_monoid G)) x x (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) z (group_inverse G z)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)))) (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)))) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x) (@SGROUP_comp (monoid_sgroup (group_monoid G)) y y (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) z (group_inverse G z)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))) (sgroup_law (monoid_sgroup (group_monoid G)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) y) (@SGROUP_comp (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) z (group_inverse G z)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)) (@GROUP_inverse_r G z) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))))))) (@SGROUP_comp (monoid_sgroup (group_monoid G)) x x (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) z (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))))) (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) z (group_inverse G z)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)))) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x) (@SGROUP_comp (monoid_sgroup (group_monoid G)) y y (sgroup_law (monoid_sgroup (group_monoid G)) z (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) z (group_inverse G z)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) y) (@Sym (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) z (group_inverse G z)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))) (sgroup_law (monoid_sgroup (group_monoid G)) z (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)))) (@SGROUP_assoc (monoid_sgroup (group_monoid G)) z (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))))))) (@SGROUP_comp (monoid_sgroup (group_monoid G)) x x (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)))) (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) z (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))))) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x) (@SGROUP_assoc (monoid_sgroup (group_monoid G)) y z (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)))))) (@SGROUP_assoc (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))))) (@SGROUP_comp (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (group_inverse G y)) (group_inverse G x)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))) (@SGROUP_assoc (monoid_sgroup (group_monoid G)) x y z) (@SGROUP_assoc (monoid_sgroup (group_monoid G)) (group_inverse G z) (group_inverse G y) (group_inverse G x)))) (@SGROUP_comp (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) y z)) (group_inverse G x)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (group_inverse G y)) (group_inverse G x)) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z)) (@SGROUP_comp (monoid_sgroup (group_monoid G)) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) y z)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (group_inverse G y)) (group_inverse G x) (group_inverse G x) (@GROUP_inverse_law G y z) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G x))))) (@SGROUP_comp (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) y z)) (group_inverse G x)) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z)) (@GROUP_inverse_law G x (sgroup_law (monoid_sgroup (group_monoid G)) y z))))) x y)) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (@monoid_unit (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))) (monoid_on_def (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))))) (@coKer_prop G G' f (@monoid_unit (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))) (monoid_on_def (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))))) (@monoid_unit (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f)))) (monoid_on_def (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) *) exact (SGROUP_hom_prop f x y). (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@f2 (@group_of_subgroup G' (@coKer G G' f)) G' (fun x0 : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) => @subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) x0) (fun (x0 y : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) x0 y) => H)) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@group_quo_set G (@Ker G G' f) (@kernel_normal G G' f)) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (@f2 (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (@group_of_subgroup G' (@coKer G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => @Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@coKer_prop G G' f x0)) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @GROUP_reg_right G' (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (@Refl (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0)) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@GROUP_hom_prop G G' f y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x0 (group_inverse G y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) H' (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@GROUP_inverse_r G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)))))))) (@f2 G (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => x0) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y) => @in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y)) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (@submonoid_in_prop (group_monoid G) (@Build_submonoid (group_monoid G) (@Build_subsgroup (monoid_sgroup (group_monoid G)) (@kernel_part G G' f) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H'0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x1 y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x1 y0) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) H'0 H'1) (@MONOID_unit_l (group_monoid G') (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))))))) (@MONOID_hom_prop (group_monoid G) (group_monoid G') f))) (@GROUP_inverse_r G x0)) (@SGROUP_comp (monoid_sgroup (group_monoid G)) x0 x0 (group_inverse G y) (group_inverse G x0) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x0) (@GROUP_comp G y x0 (@Sym (sgroup_set (monoid_sgroup (group_monoid G))) x0 y H'))))))) x) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@coKer_prop G G' f x)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@coKer_prop G G' f y))), @group_quo_eq G (@Ker G G' f) x y *) (* Goal: @surjective (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@sgroup_map (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))) (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f)))) (@monoid_sgroup_hom (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))) (group_monoid (@group_of_subgroup G' (@coKer G G' f))) bij_group_quo_ker_coKer)) *) unfold group_quo_eq, subtype_image_equal in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@f2 (@group_of_subgroup G' (@coKer G G' f)) G' (fun x0 : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) => @subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) x0) (fun (x0 y : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) x0 y) => H)) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@group_quo_set G (@Ker G G' f) (@kernel_normal G G' f)) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (@f2 (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (@group_of_subgroup G' (@coKer G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => @Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@coKer_prop G G' f x0)) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @GROUP_reg_right G' (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (@Refl (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0)) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@GROUP_hom_prop G G' f y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x0 (group_inverse G y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) H' (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@GROUP_inverse_r G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)))))))) (@f2 G (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => x0) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y) => @in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y)) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (@submonoid_in_prop (group_monoid G) (@Build_submonoid (group_monoid G) (@Build_subsgroup (monoid_sgroup (group_monoid G)) (@kernel_part G G' f) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H'0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x1 y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x1 y0) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) H'0 H'1) (@MONOID_unit_l (group_monoid G') (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))))))) (@MONOID_hom_prop (group_monoid G) (group_monoid G') f))) (@GROUP_inverse_r G x0)) (@SGROUP_comp (monoid_sgroup (group_monoid G)) x0 x0 (group_inverse G y) (group_inverse G x0) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x0) (@GROUP_comp G y x0 (@Sym (sgroup_set (monoid_sgroup (group_monoid G))) x0 y H'))))))) x) *) simpl in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) *) auto with algebra. Defined. Lemma bij_group_quo_ker_coKer_bijective : bijective bij_group_quo_ker_coKer. (* Goal: @surjective (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@sgroup_map (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))) (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f)))) (@monoid_sgroup_hom (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))) (group_monoid (@group_of_subgroup G' (@coKer G G' f))) bij_group_quo_ker_coKer)) *) red in |- *. (* Goal: and (@injective (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@sgroup_map (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))) (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f)))) (@monoid_sgroup_hom (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))) (group_monoid (@group_of_subgroup G' (@coKer G G' f))) bij_group_quo_ker_coKer))) (@surjective (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@sgroup_map (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))) (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f)))) (@monoid_sgroup_hom (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))) (group_monoid (@group_of_subgroup G' (@coKer G G' f))) bij_group_quo_ker_coKer))) *) split; [ try assumption | idtac ]. (* Goal: @surjective (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@sgroup_map (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))) (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f)))) (@monoid_sgroup_hom (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))) (group_monoid (@group_of_subgroup G' (@coKer G G' f))) bij_group_quo_ker_coKer)) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@f2 (@group_of_subgroup G' (@coKer G G' f)) G' (fun x0 : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) => @subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) x0) (fun (x0 y : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) x0 y) => H)) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@group_quo_set G (@Ker G G' f) (@kernel_normal G G' f)) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (@f2 (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (@group_of_subgroup G' (@coKer G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => @Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@coKer_prop G G' f x0)) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @GROUP_reg_right G' (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (@Refl (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0)) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@GROUP_hom_prop G G' f y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x0 (group_inverse G y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) H' (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@GROUP_inverse_r G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)))))))) (@f2 G (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => x0) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y) => @in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y)) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (@submonoid_in_prop (group_monoid G) (@Build_submonoid (group_monoid G) (@Build_subsgroup (monoid_sgroup (group_monoid G)) (@kernel_part G G' f) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H'0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x1 y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x1 y0) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) H'0 H'1) (@MONOID_unit_l (group_monoid G') (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))))))) (@MONOID_hom_prop (group_monoid G) (group_monoid G') f))) (@GROUP_inverse_r G x0)) (@SGROUP_comp (monoid_sgroup (group_monoid G)) x0 x0 (group_inverse G y) (group_inverse G x0) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x0) (@GROUP_comp G y x0 (@Sym (sgroup_set (monoid_sgroup (group_monoid G))) x0 y H'))))))) x) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@coKer_prop G G' f x)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@coKer_prop G G' f y))), @group_quo_eq G (@Ker G G' f) x y *) (* Goal: @surjective (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@sgroup_map (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))) (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f)))) (@monoid_sgroup_hom (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))) (group_monoid (@group_of_subgroup G' (@coKer G G' f))) bij_group_quo_ker_coKer)) *) unfold group_quo_eq, subtype_image_equal in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@f2 (@group_of_subgroup G' (@coKer G G' f)) G' (fun x0 : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) => @subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) x0) (fun (x0 y : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) x0 y) => H)) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@group_quo_set G (@Ker G G' f) (@kernel_normal G G' f)) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (@f2 (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (@group_of_subgroup G' (@coKer G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => @Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@coKer_prop G G' f x0)) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @GROUP_reg_right G' (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (@Refl (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0)) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@GROUP_hom_prop G G' f y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x0 (group_inverse G y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) H' (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@GROUP_inverse_r G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)))))))) (@f2 G (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => x0) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y) => @in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y)) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (@submonoid_in_prop (group_monoid G) (@Build_submonoid (group_monoid G) (@Build_subsgroup (monoid_sgroup (group_monoid G)) (@kernel_part G G' f) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H'0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x1 y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x1 y0) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) H'0 H'1) (@MONOID_unit_l (group_monoid G') (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))))))) (@MONOID_hom_prop (group_monoid G) (group_monoid G') f))) (@GROUP_inverse_r G x0)) (@SGROUP_comp (monoid_sgroup (group_monoid G)) x0 x0 (group_inverse G y) (group_inverse G x0) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x0) (@GROUP_comp G y x0 (@Sym (sgroup_set (monoid_sgroup (group_monoid G))) x0 y H'))))))) x) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) *) (* Goal: @surjective (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@sgroup_map (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))) (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f)))) (@monoid_sgroup_hom (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))) (group_monoid (@group_of_subgroup G' (@coKer G G' f))) bij_group_quo_ker_coKer)) *) intros x y H'; try assumption. apply Trans with (sgroup_law G' (Ap (sgroup_map (monoid_sgroup_hom f)) x) (Ap (sgroup_map (monoid_sgroup_hom f)) (group_inverse G y))); (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) *) auto with algebra. apply Trans with (sgroup_law G' (Ap (sgroup_map (monoid_sgroup_hom f)) x) (group_inverse _ (Ap (sgroup_map (monoid_sgroup_hom f)) y))); (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) *) auto with algebra. apply Trans with (sgroup_law G' (Ap (sgroup_map (monoid_sgroup_hom f)) x) (group_inverse _ (Ap (sgroup_map (monoid_sgroup_hom f)) x))); (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) *) auto with algebra. (* Goal: @surjective (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@sgroup_map (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))) (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f)))) (@monoid_sgroup_hom (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))) (group_monoid (@group_of_subgroup G' (@coKer G G' f))) bij_group_quo_ker_coKer)) *) red in |- *. (* Goal: forall y : Carrier (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))), @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))))) (fun x : Carrier (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) => @Equal (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) y (@Ap (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@sgroup_map (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))) (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f)))) (@monoid_sgroup_hom (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))) (group_monoid (@group_of_subgroup G' (@coKer G G' f))) bij_group_quo_ker_coKer)) x)) *) intros y; try assumption. (* Goal: @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))))) (fun x : Carrier (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) => @Equal (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) y (@Ap (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@sgroup_map (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))) (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f)))) (@monoid_sgroup_hom (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))) (group_monoid (@group_of_subgroup G' (@coKer G G' f))) bij_group_quo_ker_coKer)) x)) *) elim y. (* Goal: forall (subtype_elt : Carrier (sgroup_set (monoid_sgroup (group_monoid G')))) (subtype_prf : @Pred_fun (sgroup_set (monoid_sgroup (group_monoid G'))) (@subsgroup_part (monoid_sgroup (group_monoid G')) (@submonoid_subsgroup (group_monoid G') (@subgroup_submonoid G' (@coKer G G' f)))) subtype_elt), @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))))) (fun x : Carrier (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) => @Equal (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@subsgroup_part (monoid_sgroup (group_monoid G')) (@submonoid_subsgroup (group_monoid G') (@subgroup_submonoid G' (@coKer G G' f)))) subtype_elt subtype_prf) (@Ap (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@sgroup_map (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))) (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f)))) (@monoid_sgroup_hom (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))) (group_monoid (@group_of_subgroup G' (@coKer G G' f))) bij_group_quo_ker_coKer)) x)) *) intros y' subtype_prf; try assumption. (* Goal: @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))))) (fun x : Carrier (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) => @Equal (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@subsgroup_part (monoid_sgroup (group_monoid G')) (@submonoid_subsgroup (group_monoid G') (@subgroup_submonoid G' (@coKer G G' f)))) y' subtype_prf) (@Ap (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@sgroup_map (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))) (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f)))) (@monoid_sgroup_hom (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))) (group_monoid (@group_of_subgroup G' (@coKer G G' f))) bij_group_quo_ker_coKer)) x)) *) elim subtype_prf. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and (@in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid G'))) y' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x))), @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))))) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) => @Equal (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@subsgroup_part (monoid_sgroup (group_monoid G')) (@submonoid_subsgroup (group_monoid G') (@subgroup_submonoid G' (@coKer G G' f)))) y' subtype_prf) (@Ap (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@sgroup_map (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))) (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f)))) (@monoid_sgroup_hom (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))) (group_monoid (@group_of_subgroup G' (@coKer G G' f))) bij_group_quo_ker_coKer)) x0)) *) intros x H'; try assumption. (* Goal: @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))))) (fun x : Carrier (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) => @Equal (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@subsgroup_part (monoid_sgroup (group_monoid G')) (@submonoid_subsgroup (group_monoid G') (@subgroup_submonoid G' (@coKer G G' f)))) y' subtype_prf) (@Ap (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@sgroup_map (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))) (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f)))) (@monoid_sgroup_hom (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))) (group_monoid (@group_of_subgroup G' (@coKer G G' f))) bij_group_quo_ker_coKer)) x)) *) elim H'; intros H'0 H'1; try exact H'0; clear H'. (* Goal: @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))))) (fun x : Carrier (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) => @Equal (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@subsgroup_part (monoid_sgroup (group_monoid G')) (@submonoid_subsgroup (group_monoid G') (@subgroup_submonoid G' (@coKer G G' f)))) y' subtype_prf) (@Ap (sgroup_set (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))))) (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f))))) (@sgroup_map (monoid_sgroup (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f)))) (monoid_sgroup (group_monoid (@group_of_subgroup G' (@coKer G G' f)))) (@monoid_sgroup_hom (group_monoid (group_quo G (@Ker G G' f) (@kernel_normal G G' f))) (group_monoid (@group_of_subgroup G' (@coKer G G' f))) bij_group_quo_ker_coKer)) x)) *) exists x; try assumption. Qed. Theorem factor_group_hom : Equal f (comp_hom inj_coKer_group (comp_hom bij_group_quo_ker_coKer surj_group_quo_ker)). (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@f2 (@group_of_subgroup G' (@coKer G G' f)) G' (fun x0 : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) => @subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) x0) (fun (x0 y : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) x0 y) => H)) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@group_quo_set G (@Ker G G' f) (@kernel_normal G G' f)) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (@f2 (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (@group_of_subgroup G' (@coKer G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => @Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@coKer_prop G G' f x0)) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @GROUP_reg_right G' (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (@Refl (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0)) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@GROUP_hom_prop G G' f y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x0 (group_inverse G y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) H' (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@GROUP_inverse_r G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)))))))) (@f2 G (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => x0) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y) => @in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y)) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (@submonoid_in_prop (group_monoid G) (@Build_submonoid (group_monoid G) (@Build_subsgroup (monoid_sgroup (group_monoid G)) (@kernel_part G G' f) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H'0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x1 y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x1 y0) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) H'0 H'1) (@MONOID_unit_l (group_monoid G') (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))))))) (@MONOID_hom_prop (group_monoid G) (group_monoid G') f))) (@GROUP_inverse_r G x0)) (@SGROUP_comp (monoid_sgroup (group_monoid G)) x0 x0 (group_inverse G y) (group_inverse G x0) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x0) (@GROUP_comp G y x0 (@Sym (sgroup_set (monoid_sgroup (group_monoid G))) x0 y H'))))))) x) *) simpl in |- *. (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@f2 (@group_of_subgroup G' (@coKer G G' f)) G' (fun x : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) => @subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) x) (fun (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) x y) => H)) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@group_quo_set G (@Ker G G' f) (@kernel_normal G G' f)) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (@f2 (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (@group_of_subgroup G' (@coKer G G' f)) (fun x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => @Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@coKer_prop G G' f x)) (fun (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @GROUP_reg_right G' (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (@Refl (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x)) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@GROUP_hom_prop G G' f y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x (group_inverse G y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) H' (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@GROUP_inverse_r G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)))))))) (@f2 G (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (fun x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => x) (fun (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x y) => @in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G y)) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@submonoid_in_prop (group_monoid G) (@Build_submonoid (group_monoid G) (@Build_subsgroup (monoid_sgroup (group_monoid G)) (@kernel_part G G' f) (fun (x0 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H'0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x0 y0) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) H'0 H'1) (@MONOID_unit_l (group_monoid G') (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))))))) (@MONOID_hom_prop (group_monoid G) (group_monoid G') f))) (@GROUP_inverse_r G x)) (@SGROUP_comp (monoid_sgroup (group_monoid G)) x x (group_inverse G y) (group_inverse G x) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x) (@GROUP_comp G y x (@Sym (sgroup_set (monoid_sgroup (group_monoid G))) x y H'))))))) *) unfold Map_eq in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@f2 (@group_of_subgroup G' (@coKer G G' f)) G' (fun x0 : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) => @subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) x0) (fun (x0 y : @subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) x0 y) => H)) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid G))) (@group_quo_set G (@Ker G G' f) (@kernel_normal G G' f)) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G'))) (@part (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))))) (@f2 (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (@group_of_subgroup G' (@coKer G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => @Build_subtype (sgroup_set (monoid_sgroup (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@coKer_prop G G' f x0)) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @GROUP_reg_right G' (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (@Refl (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0)) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y)) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@GROUP_hom_prop G G' f y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G y))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x0 (group_inverse G y))) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) H' (@Sym (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@GROUP_inverse_r G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)))))))) (@f2 G (group_quo G (@Ker G G' f) (@kernel_normal G G' f)) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => x0) (fun (x0 y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H' : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x0 y) => @in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G y)) (@in_part_comp_l (sgroup_set (monoid_sgroup (group_monoid G))) (@kernel_part G G' f) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x0 (group_inverse G x0)) (@submonoid_in_prop (group_monoid G) (@Build_submonoid (group_monoid G) (@Build_subsgroup (monoid_sgroup (group_monoid G)) (@kernel_part G G' f) (fun (x1 y0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (H'0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) => @Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x1 y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_hom_prop (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f) x1 y0) (@Trans (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0)) (sgroup_law (monoid_sgroup (group_monoid G')) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@SGROUP_comp (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x1) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y0) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) H'0 H'1) (@MONOID_unit_l (group_monoid G') (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))))))) (@MONOID_hom_prop (group_monoid G) (group_monoid G') f))) (@GROUP_inverse_r G x0)) (@SGROUP_comp (monoid_sgroup (group_monoid G)) x0 x0 (group_inverse G y) (group_inverse G x0) (@Refl (sgroup_set (monoid_sgroup (group_monoid G))) x0) (@GROUP_comp G y x0 (@Sym (sgroup_set (monoid_sgroup (group_monoid G))) x0 y H'))))))) x) *) simpl in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) *) auto with algebra. Qed. End Def. Hint Resolve factor_group_hom bij_group_quo_ker_coKer_bijective inj_coKer_group_injective surj_group_quo_ker_surjective: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Subcat. Require Export Set_cat. (** Title "The category of semi-groups." *) Definition law_of_composition (E : SET) := Hom (cart E E:SET) E. Definition associative (E : SET) (f : law_of_composition E) := forall x y z : E, Equal (f (couple (f (couple x y)) z)) (f (couple x (f (couple y z)))). Record sgroup_on (E : SET) : Type := {sgroup_law_map : law_of_composition E; sgroup_assoc_prf : associative sgroup_law_map}. Record sgroup : Type := {sgroup_set :> Setoid; sgroup_on_def :> sgroup_on sgroup_set}. Coercion Build_sgroup : sgroup_on >-> sgroup. Set Strict Implicit. Unset Implicit Arguments. Definition sgroup_law (E : sgroup) : E -> E -> E := fun x y : E:Setoid => sgroup_law_map E (couple x y). Set Implicit Arguments. Unset Strict Implicit. Section Hom. Variable E F : sgroup. Definition sgroup_hom_prop (f : Hom (E:SET) F) := forall x y : E, Equal (f (sgroup_law _ x y)) (sgroup_law _ (f x) (f y)). Record sgroup_hom : Type := {sgroup_map :> Map E F; sgroup_hom_prf : sgroup_hom_prop sgroup_map}. End Hom. Definition sgroup_hom_comp : forall E F G : sgroup, sgroup_hom F G -> sgroup_hom E F -> sgroup_hom E G. (* Goal: forall (E F G : sgroup) (_ : sgroup_hom F G) (_ : sgroup_hom E F), sgroup_hom E G *) intros E F G g f; try assumption. (* Goal: sgroup_hom E G *) apply (Build_sgroup_hom (sgroup_map:=comp_map_map g f)). (* Goal: @sgroup_hom_prop E G (@comp_map_map (sgroup_set E) (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@sgroup_map E F f)) *) unfold sgroup_hom_prop in |- *; auto with algebra. (* Goal: forall (a b c : sgroup) (g : Carrier (@subcat_Hom SET sgroup sgroup_set (fun E F : sgroup => @Build_subtype_image (MAP (sgroup_set E) (sgroup_set F)) (sgroup_hom E F) (@sgroup_map E F)) b c)) (f : Carrier (@subcat_Hom SET sgroup sgroup_set (fun E F : sgroup => @Build_subtype_image (MAP (sgroup_set E) (sgroup_set F)) (sgroup_hom E F) (@sgroup_map E F)) a b)), @Equal (@Hom SET (sgroup_set a) (sgroup_set c)) (@subtype_image_inj (@Hom SET (sgroup_set a) (sgroup_set c)) (@Build_subtype_image (MAP (sgroup_set a) (sgroup_set c)) (sgroup_hom a c) (@sgroup_map a c)) (@sgroup_hom_comp a b c g f)) (@comp_hom SET (sgroup_set a) (sgroup_set b) (sgroup_set c) (@subtype_image_inj (@Hom SET (sgroup_set b) (sgroup_set c)) (@Build_subtype_image (MAP (sgroup_set b) (sgroup_set c)) (sgroup_hom b c) (@sgroup_map b c)) g) (@subtype_image_inj (@Hom SET (sgroup_set a) (sgroup_set b)) (@Build_subtype_image (MAP (sgroup_set a) (sgroup_set b)) (sgroup_hom a b) (@sgroup_map a b)) f)) *) simpl in |- *. (* Goal: forall x y : Carrier (sgroup_set E), @Equal (sgroup_set G) (@comp_map_fun (sgroup_set E) (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@sgroup_map E F f) (sgroup_law E x y)) (sgroup_law G (@comp_map_fun (sgroup_set E) (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@sgroup_map E F f) x) (@comp_map_fun (sgroup_set E) (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@sgroup_map E F f) y)) *) unfold comp_map_fun in |- *. (* Goal: forall x y : Carrier (sgroup_set E), @Equal (sgroup_set G) (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) (sgroup_law E x y))) (sgroup_law G (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x)) (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y))) *) intros x y; try assumption. apply Trans with (Ap (sgroup_map g) (sgroup_law _ (Ap (sgroup_map f) x) (Ap (sgroup_map f) y))); (* Goal: forall x : Carrier (sgroup_set a), @Equal (sgroup_set c) (@Ap (sgroup_set a) (sgroup_set c) (@comp_map_map (sgroup_set a) (sgroup_set b) (sgroup_set c) (@sgroup_map b c g) (@sgroup_map a b f)) x) (@Ap (sgroup_set a) (sgroup_set c) (@comp_hom SET (sgroup_set a) (sgroup_set b) (sgroup_set c) (@sgroup_map b c g) (@sgroup_map a b f)) x) *) auto with algebra. cut (Equal (Ap (sgroup_map f) (sgroup_law _ x y)) (sgroup_law _ (Ap (sgroup_map f) x) (Ap (sgroup_map f) y))). (* Goal: forall x : Carrier (sgroup_set a), @Equal (sgroup_set c) (@Ap (sgroup_set a) (sgroup_set c) (@comp_map_map (sgroup_set a) (sgroup_set b) (sgroup_set c) (@sgroup_map b c g) (@sgroup_map a b f)) x) (@Ap (sgroup_set a) (sgroup_set c) (@comp_hom SET (sgroup_set a) (sgroup_set b) (sgroup_set c) (@sgroup_map b c g) (@sgroup_map a b f)) x) *) auto with algebra. (* Goal: @Equal (sgroup_set F) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) (sgroup_law E x y)) (sgroup_law F (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y)) *) (* Goal: @Equal (sgroup_set G) (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (sgroup_law F (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y))) (sgroup_law G (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x)) (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y))) *) apply (sgroup_hom_prf f). (* Goal: @Equal (sgroup_set G) (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (sgroup_law F (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y))) (sgroup_law G (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x)) (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y))) *) apply (sgroup_hom_prf g). Defined. Definition sgroup_id : forall E : sgroup, sgroup_hom E E. (* Goal: forall E : sgroup, sgroup_hom E E *) intros E; try assumption. (* Goal: sgroup_hom E E *) apply (Build_sgroup_hom (sgroup_map:=Id E)). (* Goal: @Map_eq (sgroup_set a) (sgroup_set c) (@comp_map_map (sgroup_set a) (sgroup_set b) (sgroup_set c) (@sgroup_map b c g) (@sgroup_map a b f)) (@comp_hom SET (sgroup_set a) (sgroup_set b) (sgroup_set c) (@sgroup_map b c g) (@sgroup_map a b f)) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set a), @Equal (sgroup_set c) (@Ap (sgroup_set a) (sgroup_set c) (@comp_map_map (sgroup_set a) (sgroup_set b) (sgroup_set c) (@sgroup_map b c g) (@sgroup_map a b f)) x) (@Ap (sgroup_set a) (sgroup_set c) (@comp_hom SET (sgroup_set a) (sgroup_set b) (sgroup_set c) (@sgroup_map b c g) (@sgroup_map a b f)) x) *) simpl in |- *; auto with algebra. Defined. Definition SGROUP : category. apply (subcat (C:=SET) (C':=sgroup) (i:=sgroup_set) (homC':=fun E F : sgroup => Build_subtype_image (E:=MAP E F) (subtype_image_carrier:=sgroup_hom E F) (sgroup_map (E:=E) (F:=F))) (CompC':=sgroup_hom_comp) (idC':=sgroup_id)). (* Goal: forall (a b c : sgroup) (g : Carrier (@subcat_Hom SET sgroup sgroup_set (fun E F : sgroup => @Build_subtype_image (MAP (sgroup_set E) (sgroup_set F)) (sgroup_hom E F) (@sgroup_map E F)) b c)) (f : Carrier (@subcat_Hom SET sgroup sgroup_set (fun E F : sgroup => @Build_subtype_image (MAP (sgroup_set E) (sgroup_set F)) (sgroup_hom E F) (@sgroup_map E F)) a b)), @Equal (@Hom SET (sgroup_set a) (sgroup_set c)) (@subtype_image_inj (@Hom SET (sgroup_set a) (sgroup_set c)) (@Build_subtype_image (MAP (sgroup_set a) (sgroup_set c)) (sgroup_hom a c) (@sgroup_map a c)) (@sgroup_hom_comp a b c g f)) (@comp_hom SET (sgroup_set a) (sgroup_set b) (sgroup_set c) (@subtype_image_inj (@Hom SET (sgroup_set b) (sgroup_set c)) (@Build_subtype_image (MAP (sgroup_set b) (sgroup_set c)) (sgroup_hom b c) (@sgroup_map b c)) g) (@subtype_image_inj (@Hom SET (sgroup_set a) (sgroup_set b)) (@Build_subtype_image (MAP (sgroup_set a) (sgroup_set b)) (sgroup_hom a b) (@sgroup_map a b)) f)) *) simpl in |- *. (* Goal: forall a : sgroup, @Map_eq (sgroup_set a) (sgroup_set a) (Id (sgroup_set a)) (Id (sgroup_set a)) *) (* Goal: forall (a b c : sgroup) (g : Carrier (@subcat_Hom SET sgroup sgroup_set (fun E F : sgroup => @Build_subtype_image (MAP (sgroup_set E) (sgroup_set F)) (sgroup_hom E F) (@sgroup_map E F)) b c)) (f : Carrier (@subcat_Hom SET sgroup sgroup_set (fun E F : sgroup => @Build_subtype_image (MAP (sgroup_set E) (sgroup_set F)) (sgroup_hom E F) (@sgroup_map E F)) a b)), @Equal (@Hom SET (sgroup_set a) (sgroup_set c)) (@subtype_image_inj (@Hom SET (sgroup_set a) (sgroup_set c)) (@Build_subtype_image (MAP (sgroup_set a) (sgroup_set c)) (sgroup_hom a c) (@sgroup_map a c)) (@sgroup_hom_comp a b c g f)) (@comp_hom SET (sgroup_set a) (sgroup_set b) (sgroup_set c) (@subtype_image_inj (@Hom SET (sgroup_set b) (sgroup_set c)) (@Build_subtype_image (MAP (sgroup_set b) (sgroup_set c)) (sgroup_hom b c) (@sgroup_map b c)) g) (@subtype_image_inj (@Hom SET (sgroup_set a) (sgroup_set b)) (@Build_subtype_image (MAP (sgroup_set a) (sgroup_set b)) (sgroup_hom a b) (@sgroup_map a b)) f)) *) intros a; try assumption. (* Goal: @Map_eq (sgroup_set a) (sgroup_set c) (@comp_map_map (sgroup_set a) (sgroup_set b) (sgroup_set c) (@sgroup_map b c g) (@sgroup_map a b f)) (@comp_hom SET (sgroup_set a) (sgroup_set b) (sgroup_set c) (@sgroup_map b c g) (@sgroup_map a b f)) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set a), @Equal (sgroup_set c) (@Ap (sgroup_set a) (sgroup_set c) (@comp_map_map (sgroup_set a) (sgroup_set b) (sgroup_set c) (@sgroup_map b c g) (@sgroup_map a b f)) x) (@Ap (sgroup_set a) (sgroup_set c) (@comp_hom SET (sgroup_set a) (sgroup_set b) (sgroup_set c) (@sgroup_map b c g) (@sgroup_map a b f)) x) *) auto with algebra. (* Goal: forall (a b c : sgroup) (g : Carrier (@subcat_Hom SET sgroup sgroup_set (fun E F : sgroup => @Build_subtype_image (MAP (sgroup_set E) (sgroup_set F)) (sgroup_hom E F) (@sgroup_map E F)) b c)) (f : Carrier (@subcat_Hom SET sgroup sgroup_set (fun E F : sgroup => @Build_subtype_image (MAP (sgroup_set E) (sgroup_set F)) (sgroup_hom E F) (@sgroup_map E F)) a b)), @Equal (@Hom SET (sgroup_set a) (sgroup_set c)) (@subtype_image_inj (@Hom SET (sgroup_set a) (sgroup_set c)) (@Build_subtype_image (MAP (sgroup_set a) (sgroup_set c)) (sgroup_hom a c) (@sgroup_map a c)) (@sgroup_hom_comp a b c g f)) (@comp_hom SET (sgroup_set a) (sgroup_set b) (sgroup_set c) (@subtype_image_inj (@Hom SET (sgroup_set b) (sgroup_set c)) (@Build_subtype_image (MAP (sgroup_set b) (sgroup_set c)) (sgroup_hom b c) (@sgroup_map b c)) g) (@subtype_image_inj (@Hom SET (sgroup_set a) (sgroup_set b)) (@Build_subtype_image (MAP (sgroup_set a) (sgroup_set b)) (sgroup_hom a b) (@sgroup_map a b)) f)) *) simpl in |- *. (* Goal: forall (a b c : sgroup) (g : sgroup_hom b c) (f : sgroup_hom a b), @Map_eq (sgroup_set a) (sgroup_set c) (@comp_map_map (sgroup_set a) (sgroup_set b) (sgroup_set c) (@sgroup_map b c g) (@sgroup_map a b f)) (@comp_hom SET (sgroup_set a) (sgroup_set b) (sgroup_set c) (@sgroup_map b c g) (@sgroup_map a b f)) *) intros a b c g f; try assumption. (* Goal: @Map_eq (sgroup_set a) (sgroup_set c) (@comp_map_map (sgroup_set a) (sgroup_set b) (sgroup_set c) (@sgroup_map b c g) (@sgroup_map a b f)) (@comp_hom SET (sgroup_set a) (sgroup_set b) (sgroup_set c) (@sgroup_map b c g) (@sgroup_map a b f)) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set a), @Equal (sgroup_set c) (@Ap (sgroup_set a) (sgroup_set c) (@comp_map_map (sgroup_set a) (sgroup_set b) (sgroup_set c) (@sgroup_map b c g) (@sgroup_map a b f)) x) (@Ap (sgroup_set a) (sgroup_set c) (@comp_hom SET (sgroup_set a) (sgroup_set b) (sgroup_set c) (@sgroup_map b c g) (@sgroup_map a b f)) x) *) auto with algebra. Defined.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Automatic Coercions Import. Set Implicit Arguments. Unset Strict Implicit. Require Export Z_group. (** Title "Facts about powers." *) Section Lemmas. Variable G : GROUP. Lemma Z_to_group_nat_eq_pos : forall (n : Z) (g : G), Equal (Z_to_group_nat_fun g n) (Z_to_group_fun g n). (* Goal: forall (n : Z) (g : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g n) (@Z_to_group_fun G g n) *) intros n g; try assumption. apply Trans with (Ap (sgroup_map (monoid_sgroup_hom (Z_to_group_nat g))) n); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g (Zpos p)) (group_inverse G (group_power G g (Zneg p))) *) (* Goal: @eq Z (Z.mul (Zpos p) (Zpos p0)) (Z.opp (Z.opp (Z.mul (Zpos p) (Zpos p0)))) *) (* Goal: @eq Z (Z.opp (Z.mul (Zpos p) (Zpos p0))) (Z.mul (Zpos p) (Zneg p0)) *) (* Goal: @eq Z (Z.opp (Z.mul (Zpos p) (Zneg p0))) (Z.mul (Zneg p) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) apply Sym. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_fun G g n) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group_nat G g))) n) *) apply Z_to_group_fun_eq. Qed. Hint Resolve Z_to_group_nat_eq_pos: algebra. Lemma Zopp1 : forall n : Z, (n < 0)%Z -> (- n > 0)%Z. (* Goal: forall (n : Z) (_ : Z.gt n Z0), Z.lt (Z.opp n) Z0 *) simple induction n. (* Goal: forall _ : Z.gt Z0 Z0, Z.lt (Z.opp Z0) Z0 *) (* Goal: forall (p : positive) (_ : Z.gt (Zpos p) Z0), Z.lt (Z.opp (Zpos p)) Z0 *) (* Goal: forall (p : positive) (_ : Z.gt (Zneg p) Z0), Z.lt (Z.opp (Zneg p)) Z0 *) intros H'; try assumption. (* Goal: Z.lt (Z.opp Z0) Z0 *) (* Goal: forall (p : positive) (_ : Z.gt (Zpos p) Z0), Z.lt (Z.opp (Zpos p)) Z0 *) (* Goal: forall (p : positive) (_ : Z.gt (Zneg p) Z0), Z.lt (Z.opp (Zneg p)) Z0 *) inversion H'. (* Goal: forall (p : positive) (_ : Z.gt (Zneg p) Z0), Z.lt (Z.opp (Zneg p)) Z0 *) intros p H'; try assumption. (* Goal: Z.lt (Z.opp (Zneg p)) Z0 *) replace 0%Z with (- (0))%Z. (* Goal: Z.gt (Z.opp (Zneg p)) (Z.opp Z0) *) (* Goal: @eq Z (Z.opp Z0) Z0 *) apply Zlt_gt; auto with algebra. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. (* Goal: forall (p : positive) (_ : Z.gt (Zneg p) Z0), Z.lt (Z.opp (Zneg p)) Z0 *) intros p H'; try assumption. (* Goal: Z.lt (Z.opp (Zneg p)) Z0 *) replace 0%Z with (- (0))%Z. (* Goal: Z.gt (Z.opp (Zneg p)) (Z.opp Z0) *) (* Goal: @eq Z (Z.opp Z0) Z0 *) apply Zlt_gt; auto with algebra. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. Qed. Hint Resolve Zopp1: algebra. Lemma Zopp2 : forall n : Z, (n > 0)%Z -> (- n < 0)%Z. (* Goal: forall (n : Z) (_ : Z.gt n Z0), Z.lt (Z.opp n) Z0 *) simple induction n. (* Goal: forall _ : Z.gt Z0 Z0, Z.lt (Z.opp Z0) Z0 *) (* Goal: forall (p : positive) (_ : Z.gt (Zpos p) Z0), Z.lt (Z.opp (Zpos p)) Z0 *) (* Goal: forall (p : positive) (_ : Z.gt (Zneg p) Z0), Z.lt (Z.opp (Zneg p)) Z0 *) intros H'; try assumption. (* Goal: Z.lt (Z.opp Z0) Z0 *) (* Goal: forall (p : positive) (_ : Z.gt (Zpos p) Z0), Z.lt (Z.opp (Zpos p)) Z0 *) (* Goal: forall (p : positive) (_ : Z.gt (Zneg p) Z0), Z.lt (Z.opp (Zneg p)) Z0 *) inversion H'. (* Goal: forall (p : positive) (_ : Z.gt (Zneg p) Z0), Z.lt (Z.opp (Zneg p)) Z0 *) intros p H'; try assumption. (* Goal: Z.lt (Z.opp (Zneg p)) Z0 *) replace 0%Z with (- (0))%Z. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) apply Zgt_lt; auto with algebra. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. (* Goal: forall (p : positive) (_ : Z.gt (Zneg p) Z0), Z.lt (Z.opp (Zneg p)) Z0 *) intros p H'; try assumption. (* Goal: Z.lt (Z.opp (Zneg p)) Z0 *) replace 0%Z with (- (0))%Z. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) apply Zgt_lt; auto with algebra. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. Qed. Hint Resolve Zopp2: algebra. Lemma pos_abs_comp : forall (x : Z) (p p' : (x > 0)%Z), pos_abs p = pos_abs p'. (* Goal: forall (x : Z) (p p' : Z.gt x Z0), @eq positive (@pos_abs x p) (@pos_abs x p') *) intros x; try assumption. (* Goal: forall p p' : Z.gt x Z0, @eq positive (@pos_abs x p) (@pos_abs x p') *) elim x. (* Goal: forall p p' : Z.gt Z0 Z0, @eq positive (@pos_abs Z0 p) (@pos_abs Z0 p') *) (* Goal: forall (p : positive) (p0 p' : Z.gt (Zpos p) Z0), @eq positive (@pos_abs (Zpos p) p0) (@pos_abs (Zpos p) p') *) (* Goal: forall (p : positive) (p0 p' : Z.gt (Zneg p) Z0), @eq positive (@pos_abs (Zneg p) p0) (@pos_abs (Zneg p) p') *) intros p p'; try assumption. (* Goal: @eq positive (@pos_abs (Zneg p) p0) (@pos_abs (Zneg p) p') *) red in p'. (* Goal: @eq positive (@pos_abs Z0 p) (@pos_abs Z0 p') *) (* Goal: forall (p : positive) (p0 p' : Z.gt (Zpos p) Z0), @eq positive (@pos_abs (Zpos p) p0) (@pos_abs (Zpos p) p') *) (* Goal: forall (p : positive) (p0 p' : Z.gt (Zneg p) Z0), @eq positive (@pos_abs (Zneg p) p0) (@pos_abs (Zneg p) p') *) inversion p. (* Goal: forall (p : positive) (p0 p' : Z.gt (Zpos p) Z0), @eq positive (@pos_abs (Zpos p) p0) (@pos_abs (Zpos p) p') *) (* Goal: forall (p : positive) (p0 p' : Z.gt (Zneg p) Z0), @eq positive (@pos_abs (Zneg p) p0) (@pos_abs (Zneg p) p') *) intros p p0 p'; simpl in |- *. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. (* Goal: forall (p : positive) (p0 p' : Z.gt (Zneg p) Z0), @eq positive (@pos_abs (Zneg p) p0) (@pos_abs (Zneg p) p') *) intros p p0 p'; try assumption. (* Goal: @eq positive (@pos_abs (Zneg p) p0) (@pos_abs (Zneg p) p') *) red in p'. (* Goal: @eq positive (@pos_abs (Zneg p) p0) (@pos_abs (Zneg p) p') *) simpl in p'. (* Goal: @eq positive (@pos_abs (Zneg p) p0) (@pos_abs (Zneg p) p') *) inversion p'. Qed. Hint Resolve Zl2 Zl1 Zl3 nat_to_group_inverse: algebra. Lemma nat_to_group_comp : forall (r r' : G) (n : nat), Equal r r' -> Equal (nat_to_group r n) (nat_to_group r' n). (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) simple induction n; simpl in |- *; auto with algebra. Qed. Hint Resolve nat_to_group_comp: algebra. Lemma Z_to_group_nat_fun_comp : forall (r r' : G) (n : Z), Equal r r' -> Equal (Z_to_group_nat_fun r n) (Z_to_group_nat_fun r' n). (* Goal: forall (r r' : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (n : Z) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) r r'), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G r n) (@Z_to_group_nat_fun G r' n) *) intros r r' n H'; try assumption. (* Goal: forall p : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul n (Zneg p))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) (Zneg p)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) elim n. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) apply Trans with (monoid_unit G); auto with algebra. (* Goal: forall p : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul Z0 (Zneg p))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g Z0) (Zneg p)) *) (* Goal: forall p p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul (Zpos p) (Zneg p0))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zpos p)) (Zneg p0)) *) (* Goal: forall p p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul (Zneg p) (Zneg p0))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zneg p)) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) intros p; try assumption. apply Trans with (nat_to_group r (nat_of_P (pos_abs (ax3 p)))); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. apply Trans with (nat_to_group r' (nat_of_P (pos_abs (ax3 p)))); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. (* Goal: forall p : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul Z0 (Zneg p))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g Z0) (Zneg p)) *) (* Goal: forall p p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul (Zpos p) (Zneg p0))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zpos p)) (Zneg p0)) *) (* Goal: forall p p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul (Zneg p) (Zneg p0))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zneg p)) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) intros p; try assumption. apply Trans with (group_inverse G (nat_to_group r (nat_of_P (pos_abs (ax3 p))))); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. apply Trans with (group_inverse G (nat_to_group r' (nat_of_P (pos_abs (ax3 p))))); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. Qed. Hint Resolve Z_to_group_nat_fun_comp: algebra. Lemma Z_to_group_nat_neg : forall (p : positive) (r : G), Equal (Z_to_group_nat_fun r (Zneg p)) (Z_to_group_nat_fun (group_inverse G r) (Zpos p)). (* Goal: forall (p : positive) (r : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G r (Zpos p)) (@Z_to_group_nat_fun G (group_inverse G r) (Zneg p)) *) intros p r; try assumption. apply Trans with (group_inverse G (nat_to_group r (nat_of_P (pos_abs (ax3 p))))); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. apply Trans with (nat_to_group (group_inverse G r) (nat_of_P (pos_abs (ax3 p)))); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. Qed. Hint Resolve Z_to_group_nat_neg: algebra. Lemma Z_to_group_nat_inv : forall (n : Z) (r : G), Equal (Z_to_group_nat_fun r (- n)%Z) (Z_to_group_nat_fun (group_inverse G r) n). (* Goal: forall (n : Z) (r : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G r (Z.opp n)) (@Z_to_group_nat_fun G (group_inverse G r) n) *) simple induction n; simpl in |- *. (* Goal: forall r : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G r Z0) (@Z_to_group_nat_fun G (group_inverse G r) Z0) *) (* Goal: forall (p : positive) (r : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G r (Zneg p)) (@Z_to_group_nat_fun G (group_inverse G r) (Zpos p)) *) (* Goal: forall (p : positive) (r : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G r (Zpos p)) (@Z_to_group_nat_fun G (group_inverse G r) (Zneg p)) *) intros r; try assumption. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) apply Trans with (monoid_unit G); auto with algebra. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. (* Goal: forall (p : positive) (r : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G r (Zpos p)) (@Z_to_group_nat_fun G (group_inverse G r) (Zneg p)) *) intros p r; try assumption. apply Trans with (Z_to_group_nat_fun (group_inverse G (group_inverse G r)) (Zpos p)); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. Qed. Hint Resolve Z_to_group_nat_inv: algebra. Lemma nat_to_group_mult : forall (r : G) (n m : nat), Equal (nat_to_group r (n * m)) (nat_to_group (nat_to_group r n) m). (* Goal: forall (r : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (n m : nat), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@nat_to_group G r (Init.Nat.mul n m)) (@nat_to_group G (@nat_to_group G r n) m) *) simple induction m; simpl in |- *. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) rewrite mult_comm; simpl in |- *; auto with algebra. (* Goal: forall (n : nat) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@nat_to_group G (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) n) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (@nat_to_group G (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) n) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) intros n0 H'; try assumption. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) rewrite mult_comm; simpl in |- *; auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G g))) (@ring_mult (cring_ring (idomain_ring ZZ)) n m)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G g))) n)))) m) *) simpl in |- *. apply Trans with (sgroup_law G (nat_to_group r n) (nat_to_group r (n0 * n))); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. apply Trans with (sgroup_law G (nat_to_group r (n0 * n)) (nat_to_group r n)); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) apply SGROUP_comp; auto with algebra. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) rewrite mult_comm; simpl in |- *; auto with algebra. Qed. Hint Resolve nat_to_group_mult: algebra. Lemma nat_to_group_unit : forall n : nat, Equal (nat_to_group (monoid_unit G) n) (monoid_unit G). (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) simple induction n; simpl in |- *; auto with algebra. (* Goal: forall (n : nat) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@nat_to_group G (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) n) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (@nat_to_group G (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) n) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) intros n0 H'; try assumption. apply Trans with (sgroup_law G (monoid_unit G) (monoid_unit G)); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. Qed. Hint Resolve nat_to_group_unit: algebra. Lemma Z_to_group_nat_unit : forall n : Z, Equal (Z_to_group_nat_fun (monoid_unit G) n) (monoid_unit G). (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) simple induction n; simpl in |- *; auto with algebra. (* Goal: forall p : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul Z0 (Zneg p))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g Z0) (Zneg p)) *) (* Goal: forall p p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul (Zpos p) (Zneg p0))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zpos p)) (Zneg p0)) *) (* Goal: forall p p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul (Zneg p) (Zneg p0))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zneg p)) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) intros p; try assumption. apply Trans with (nat_to_group (monoid_unit G) (nat_of_P (pos_abs (ax3 p)))); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. (* Goal: forall p : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul Z0 (Zneg p))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g Z0) (Zneg p)) *) (* Goal: forall p p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul (Zpos p) (Zneg p0))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zpos p)) (Zneg p0)) *) (* Goal: forall p p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul (Zneg p) (Zneg p0))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zneg p)) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) intros p; try assumption. apply Trans with (group_inverse G (nat_to_group (monoid_unit G) (nat_of_P (pos_abs (ax3 p))))); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) apply Trans with (group_inverse G (monoid_unit G)); auto with algebra. Qed. Hint Resolve Z_to_group_nat_unit: algebra. Lemma group_power_plus : forall (g : G) (n m : ZZ), Equal (group_power G g (sgroup_law ZZ n m)) (sgroup_law G (group_power G g n) (group_power G g m)). (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) unfold group_power in |- *; auto with algebra. Qed. Hint Resolve group_power_plus: algebra. Lemma group_power_S : forall (g : G) (n : ZZ), Equal (group_power G g (sgroup_law ZZ n (ring_unit ZZ))) (sgroup_law G (group_power G g n) g). (* Goal: forall (g : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (n m : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g (@ring_mult (cring_ring (idomain_ring ZZ)) n m)) (group_power G (group_power G g n) m) *) unfold group_power in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G g))) (@ring_mult (cring_ring (idomain_ring ZZ)) n m)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G g))) n)))) m) *) simpl in |- *. (* Goal: forall (g : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (n : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G g))) (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))) n)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G (group_inverse G g)))) n) *) intros g n; try assumption. apply Trans with (sgroup_law G (Z_to_group_fun g n) (Z_to_group_fun g (ring_unit Zr))); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. Qed. Hint Resolve group_power_S: algebra. Lemma group_power_0 : forall g : G, Equal (group_power G g (monoid_unit ZZ)) (monoid_unit G). (* Goal: forall (g : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (n m : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g (@ring_mult (cring_ring (idomain_ring ZZ)) n m)) (group_power G (group_power G g n) m) *) unfold group_power in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G g))) (@ring_mult (cring_ring (idomain_ring ZZ)) n m)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G g))) n)))) m) *) simpl in |- *. (* Goal: forall g : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g (ring_unit (cring_ring (idomain_ring ZZ)))) g *) intros g; try assumption. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) apply Trans with (Z_to_group_nat_fun g 0%Z); auto with algebra. Qed. Hint Resolve group_power_0: algebra. Lemma group_power_1 : forall g : G, Equal (group_power G g (ring_unit ZZ)) g. (* Goal: forall g : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g (ring_unit (cring_ring (idomain_ring ZZ)))) g *) intros g; try assumption. apply Trans with (group_power G g (sgroup_law ZZ (monoid_unit ZZ) (ring_unit ZZ))); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. Qed. Hint Resolve group_power_1: algebra. Lemma group_power_inv : forall (g : G) (n : ZZ), Equal (group_power G g (group_inverse ZZ n)) (group_power G (group_inverse G g) n). (* Goal: forall (g : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (n m : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g (@ring_mult (cring_ring (idomain_ring ZZ)) n m)) (group_power G (group_power G g n) m) *) unfold group_power in |- *. (* Goal: forall (g : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (n : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G g))) (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))) n)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G (group_inverse G g)))) n) *) intros g n; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G g))) (@ring_mult (cring_ring (idomain_ring ZZ)) n m)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G g))) n)))) m) *) simpl in |- *. apply Trans with (Z_to_group_nat_fun g (group_inverse ZZ n)); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. apply Trans with (Z_to_group_nat_fun (group_inverse G g) n); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. Qed. Hint Resolve group_power_inv: algebra. Lemma Z_group_nat_fun_mult_pos : forall (p q : positive) (g : G), Equal (Z_to_group_nat_fun g (Zpos p * Zpos q)%Z) (Z_to_group_nat_fun (Z_to_group_nat_fun g (Zpos p)) (Zpos q)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G g))) (@ring_mult (cring_ring (idomain_ring ZZ)) n m)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G g))) n)))) m) *) simpl in |- *. (* Goal: forall (p q : positive) (g : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Zpos (Pos.mul p q))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zpos p)) (Zpos q)) *) intros p q g; try assumption. apply Trans with (nat_to_group g (nat_of_P (pos_abs (ax3 ((fun (x : positive) (_ : positive -> positive) (y : positive) => (x * y)%positive) p (fun y : positive => y) q))))); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. apply Trans with (nat_to_group (Z_to_group_nat_fun g (Zpos p)) (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) (nat_of_P (pos_abs (ax3 q)))); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G g))) (@ring_mult (cring_ring (idomain_ring ZZ)) n m)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G g))) n)))) m) *) simpl in |- *. rewrite (fun (x y : positive) (_ : positive -> positive) => nat_of_P_mult_morphism x y). apply Trans with (nat_to_group (nat_to_group g (nat_of_P p)) (nat_of_P q)); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. Qed. Hint Resolve Z_group_nat_fun_mult_pos: algebra. Lemma group_power_mult : forall (g : G) (n m : ZZ), Equal (group_power G g (ring_mult n m)) (group_power G (group_power G g n) m). (* Goal: forall (g : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (n m : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g (@ring_mult (cring_ring (idomain_ring ZZ)) n m)) (group_power G (group_power G g n) m) *) unfold group_power in |- *. (* Goal: forall (g : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (n m : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G g))) (@ring_mult (cring_ring (idomain_ring ZZ)) n m)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G g))) n)))) m) *) intros g n m; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G g))) (@ring_mult (cring_ring (idomain_ring ZZ)) n m)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G g))) n)))) m) *) simpl in |- *. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) apply Trans with (Z_to_group_nat_fun g (ring_mult n m)); auto with algebra. apply Trans with (Z_to_group_nat_fun (Z_to_group_nat_fun g n) m); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G g))) (@ring_mult (cring_ring (idomain_ring ZZ)) n m)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G g))) n)))) m) *) unfold ring_mult in |- *; simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul n m)) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) elim m. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul n Z0)) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) Z0) *) (* Goal: forall p : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul n (Zpos p))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) (Zpos p)) *) (* Goal: forall p : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul n (Zneg p))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) (Zneg p)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) rewrite Zmult_0_r. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) apply Trans with (monoid_unit G); auto with algebra. (* Goal: forall p : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul n (Zneg p))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) (Zneg p)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) elim n. (* Goal: forall p : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul Z0 (Zneg p))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g Z0) (Zneg p)) *) (* Goal: forall p p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul (Zpos p) (Zneg p0))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zpos p)) (Zneg p0)) *) (* Goal: forall p p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul (Zneg p) (Zneg p0))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zneg p)) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) intros p; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul Z0 (Zneg p))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g Z0) (Zneg p)) *) (* Goal: forall p p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul (Zpos p) (Zneg p0))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zpos p)) (Zneg p0)) *) (* Goal: forall p p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul (Zneg p) (Zneg p0))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zneg p)) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) rewrite Zmult_0_l. apply Trans with (Z_to_group_nat_fun (monoid_unit G) (Zpos p)); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. (* Goal: forall p p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul (Zneg p) (Zneg p0))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zneg p)) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) intros p p0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul (Zneg p) (Zpos p0))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zneg p)) (Zpos p0)) *) (* Goal: forall p : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul n (Zneg p))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) (Zneg p)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) replace (Zneg p * Zpos p0)%Z with (- (Zpos p * Zpos p0))%Z. apply Trans with (Z_to_group_nat_fun (group_inverse G g) (Zpos p * Zpos p0)%Z); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. apply Trans with (Z_to_group_nat_fun (Z_to_group_nat_fun (group_inverse G g) (Zpos p)) (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) (Zpos p0)); auto with algebra. (* Goal: @eq Z (Z.opp (Z.mul (Zpos p) (Zpos p0))) (Z.mul (Zneg p) (Zpos p0)) *) (* Goal: forall p : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul n (Zneg p))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) (Zneg p)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) rewrite <- Zopp_mult_distr_l_reverse. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. (* Goal: forall p : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul n (Zneg p))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) (Zneg p)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) elim n. (* Goal: forall p : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul Z0 (Zneg p))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g Z0) (Zneg p)) *) (* Goal: forall p p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul (Zpos p) (Zneg p0))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zpos p)) (Zneg p0)) *) (* Goal: forall p p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul (Zneg p) (Zneg p0))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zneg p)) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) intros p; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul Z0 (Zneg p))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g Z0) (Zneg p)) *) (* Goal: forall p p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul (Zpos p) (Zneg p0))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zpos p)) (Zneg p0)) *) (* Goal: forall p p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul (Zneg p) (Zneg p0))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zneg p)) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) rewrite Zmult_0_l. apply Trans with (Z_to_group_nat_fun (monoid_unit G) (Zneg p)); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. (* Goal: forall p p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul (Zneg p) (Zneg p0))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zneg p)) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) intros p p0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.opp (Z.mul (Zpos p) (Zneg p0)))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zneg p)) (Zneg p0)) *) (* Goal: @eq Z (Z.opp (Z.mul (Zpos p) (Zneg p0))) (Z.mul (Zneg p) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) replace (Zpos p * Zneg p0)%Z with (- (Zpos p * Zpos p0))%Z. apply Trans with (Z_to_group_nat_fun (group_inverse G g) (Zpos p * Zpos p0)%Z); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. apply Trans with (Z_to_group_nat_fun (group_inverse G (Z_to_group_nat_fun g (Zpos p))) (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) (Zpos p0)); auto with algebra. apply Trans with (Z_to_group_nat_fun (Z_to_group_nat_fun (group_inverse G g) (Zpos p)) (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) (Zpos p0)); auto with algebra. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) apply Z_to_group_nat_fun_comp; auto with algebra. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) apply Trans with (Z_to_group_nat_fun g (Zneg p)); auto with algebra. (* Goal: @eq Z (Z.opp (Z.mul (Zpos p) (Zpos p0))) (Z.mul (Zpos p) (Zneg p0)) *) (* Goal: forall p p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul (Zneg p) (Zneg p0))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zneg p)) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) replace (Zpos p) with (- Zneg p)%Z. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. (* Goal: forall p p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul (Zneg p) (Zneg p0))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zneg p)) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) intros p p0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.mul (Zneg p) (Zneg p0))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zneg p)) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) replace (Zneg p * Zneg p0)%Z with (- (Zpos p * Zneg p0))%Z. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.opp (Z.mul (Zpos p) (Zneg p0)))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zneg p)) (Zneg p0)) *) (* Goal: @eq Z (Z.opp (Z.mul (Zpos p) (Zneg p0))) (Z.mul (Zneg p) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) replace (Zpos p * Zneg p0)%Z with (- (Zpos p * Zpos p0))%Z. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G g (Z.opp (Z.opp (Z.mul (Zpos p) (Zpos p0))))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g (Zneg p)) (Zneg p0)) *) (* Goal: @eq Z (Z.opp (Z.mul (Zpos p) (Zpos p0))) (Z.mul (Zpos p) (Zneg p0)) *) (* Goal: @eq Z (Z.opp (Z.mul (Zpos p) (Zneg p0))) (Z.mul (Zneg p) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) replace (- - (Zpos p * Zpos p0))%Z with (Zpos p * Zpos p0)%Z. apply Trans with (Z_to_group_nat_fun (Z_to_group_nat_fun g (Zpos p)) (Zpos p0)); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. apply Trans with (Z_to_group_nat_fun (group_inverse G (Z_to_group_nat_fun g (Zneg p))) (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) (Zpos p0)); auto with algebra. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) apply Z_to_group_nat_fun_comp; auto with algebra. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) apply Trans with (group_power G g (Zpos p)); auto with algebra. apply Trans with (group_inverse G (group_power G g (Zneg p))); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g (Zpos p)) (group_inverse G (group_power G g (Zneg p))) *) (* Goal: @eq Z (Z.mul (Zpos p) (Zpos p0)) (Z.opp (Z.opp (Z.mul (Zpos p) (Zpos p0)))) *) (* Goal: @eq Z (Z.opp (Z.mul (Zpos p) (Zpos p0))) (Z.mul (Zpos p) (Zneg p0)) *) (* Goal: @eq Z (Z.opp (Z.mul (Zpos p) (Zneg p0))) (Z.mul (Zneg p) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) apply Sym. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G (group_power G g (Zneg p))) (group_power G g (Zpos p)) *) (* Goal: @eq Z (Z.mul (Zpos p) (Zpos p0)) (Z.opp (Z.opp (Z.mul (Zpos p) (Zpos p0)))) *) (* Goal: @eq Z (Z.opp (Z.mul (Zpos p) (Zpos p0))) (Z.mul (Zpos p) (Zneg p0)) *) (* Goal: @eq Z (Z.opp (Z.mul (Zpos p) (Zneg p0))) (Z.mul (Zneg p) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) apply GROUP_law_inverse. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) apply Trans with (group_power G g (Zneg p + Zpos p)%Z); auto with algebra. (* Goal: @eq Z (Z.opp (Z.mul (Zpos p) (Zneg p0))) (Z.mul (Zneg p) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) replace (Zneg p) with (- Zpos p)%Z. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g (Z.add (Z.opp (Zpos p)) (Zpos p))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @eq Z (Z.mul (Zpos p) (Zpos p0)) (Z.opp (Z.opp (Z.mul (Zpos p) (Zpos p0)))) *) (* Goal: @eq Z (Z.opp (Z.mul (Zpos p) (Zpos p0))) (Z.mul (Zpos p) (Zneg p0)) *) (* Goal: @eq Z (Z.opp (Z.mul (Zpos p) (Zneg p0))) (Z.mul (Zneg p) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) rewrite Zplus_opp_l. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) rewrite Zopp_involutive; auto with algebra. (* Goal: @eq Z (Z.opp (Z.mul (Zpos p) (Zpos p0))) (Z.mul (Zpos p) (Zneg p0)) *) (* Goal: @eq Z (Z.opp (Z.mul (Zpos p) (Zneg p0))) (Z.mul (Zneg p) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) replace (Zneg p0) with (- Zpos p0)%Z. (* Goal: @eq Z (Z.opp (Z.mul (Zpos p) (Zpos p0))) (Z.mul (Zpos p) (Z.opp (Zpos p0))) *) (* Goal: @eq Z (Z.opp (Zpos p0)) (Zneg p0) *) (* Goal: @eq Z (Z.opp (Z.mul (Zpos p) (Zneg p0))) (Z.mul (Zneg p) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) replace (Zpos p * - Zpos p0)%Z with (- Zpos p0 * Zpos p)%Z. (* Goal: @eq Z (Z.opp (Z.mul (Zpos p) (Zneg p0))) (Z.mul (Z.opp (Zpos p)) (Zneg p0)) *) (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) rewrite Zopp_mult_distr_l_reverse. (* Goal: @eq Z (Z.mul (Z.opp (Zpos p0)) (Zpos p)) (Z.mul (Zpos p) (Z.opp (Zpos p0))) *) (* Goal: @eq Z (Z.opp (Zpos p0)) (Zneg p0) *) (* Goal: @eq Z (Z.opp (Z.mul (Zpos p) (Zneg p0))) (Z.mul (Zneg p) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) rewrite Zmult_comm. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. (* Goal: @eq Z (Z.mul (Z.opp (Zpos p0)) (Zpos p)) (Z.mul (Zpos p) (Z.opp (Zpos p0))) *) (* Goal: @eq Z (Z.opp (Zpos p0)) (Zneg p0) *) (* Goal: @eq Z (Z.opp (Z.mul (Zpos p) (Zneg p0))) (Z.mul (Zneg p) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) rewrite Zmult_comm. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. (* Goal: @eq Z (Z.opp (Z.mul (Zpos p) (Zneg p0))) (Z.mul (Zneg p) (Zneg p0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) replace (Zneg p) with (- Zpos p)%Z. (* Goal: @eq Z (Z.opp (Z.mul (Zpos p) (Zneg p0))) (Z.mul (Z.opp (Zpos p)) (Zneg p0)) *) (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) rewrite Zopp_mult_distr_l_reverse. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. apply Trans with (Z_to_group_nat_fun (Z_to_group_fun g n) m); (* Goal: @eq Z (Z.opp (Zpos p)) (Zneg p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Z_to_group_nat_fun G (@Z_to_group_nat_fun G g n) m) (@Z_to_group_fun G (@Z_to_group_fun G g n) m) *) auto with algebra. Qed. Hint Resolve group_power_mult: algebra. End Lemmas. Hint Resolve group_power_plus group_power_S group_power_0 group_power_1 group_power_inv group_power_mult: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Monoid_cat. (** Title "The monoid of maps of a set into itself." *) Section Def. Variable E : SET. Definition endo_comp : law_of_composition (Hom E E). (* Goal: Carrier (law_of_composition (@Hom SET E E)) *) unfold law_of_composition in |- *. apply (Build_Map (Ap:=fun x : cart (Hom E E) (Hom E E) => comp_map_map (proj1 x) (proj2 x))). (* Goal: @unit_l (sgroup_set Endo_SET_sgroup) (@sgroup_law_map (sgroup_set Endo_SET_sgroup) (sgroup_on_def Endo_SET_sgroup)) (Id E) *) red in |- *. (* Goal: forall (x y : Carrier (cart (@Hom SET E E) (@Hom SET E E))) (_ : @Equal (cart (@Hom SET E E) (@Hom SET E E)) x y), @Equal (MAP E E) (@comp_map_map E E E (@proj1 (@Hom SET E E) (@Hom SET E E) x) (@proj2 (@Hom SET E E) (@Hom SET E E) x)) (@comp_map_map E E E (@proj1 (@Hom SET E E) (@Hom SET E E) y) (@proj2 (@Hom SET E E) (@Hom SET E E) y)) *) auto with algebra. Defined. Definition Endo_SET_sgroup : SGROUP. (* Goal: Ob SGROUP *) apply (Build_sgroup (sgroup_set:=Hom E E)). (* Goal: sgroup_on (@Hom SET E E) *) apply (Build_sgroup_on (E:=Hom E E) (sgroup_law_map:=endo_comp)). (* Goal: @unit_l (sgroup_set Endo_SET_sgroup) (@sgroup_law_map (sgroup_set Endo_SET_sgroup) (sgroup_on_def Endo_SET_sgroup)) (Id E) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set Endo_SET_sgroup), @Equal (sgroup_set Endo_SET_sgroup) (@Ap (cart (sgroup_set Endo_SET_sgroup) (sgroup_set Endo_SET_sgroup)) (sgroup_set Endo_SET_sgroup) (@sgroup_law_map (sgroup_set Endo_SET_sgroup) (sgroup_on_def Endo_SET_sgroup)) (@couple (sgroup_set Endo_SET_sgroup) (sgroup_set Endo_SET_sgroup) (Id E) x)) x *) simpl in |- *. (* Goal: forall (x y : Carrier (cart (@Hom SET E E) (@Hom SET E E))) (_ : @Equal (cart (@Hom SET E E) (@Hom SET E E)) x y), @Equal (MAP E E) (@comp_map_map E E E (@proj1 (@Hom SET E E) (@Hom SET E E) x) (@proj2 (@Hom SET E E) (@Hom SET E E) x)) (@comp_map_map E E E (@proj1 (@Hom SET E E) (@Hom SET E E) y) (@proj2 (@Hom SET E E) (@Hom SET E E) y)) *) unfold Map_eq in |- *; auto with algebra. Defined. Definition Endo_SET : MONOID. (* Goal: Ob MONOID *) apply (Build_monoid (monoid_sgroup:=Endo_SET_sgroup)). (* Goal: monoid_on Endo_SET_sgroup *) apply (Build_monoid_on (A:=Endo_SET_sgroup) (monoid_unit:=Id E)). (* Goal: @unit_l (sgroup_set Endo_SET_sgroup) (@sgroup_law_map (sgroup_set Endo_SET_sgroup) (sgroup_on_def Endo_SET_sgroup)) (Id E) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set Endo_SET_sgroup), @Equal (sgroup_set Endo_SET_sgroup) (@Ap (cart (sgroup_set Endo_SET_sgroup) (sgroup_set Endo_SET_sgroup)) (sgroup_set Endo_SET_sgroup) (@sgroup_law_map (sgroup_set Endo_SET_sgroup) (sgroup_on_def Endo_SET_sgroup)) (@couple (sgroup_set Endo_SET_sgroup) (sgroup_set Endo_SET_sgroup) (Id E) x)) x *) simpl in |- *. (* Goal: forall (x y : Carrier (cart (@Hom SET E E) (@Hom SET E E))) (_ : @Equal (cart (@Hom SET E E) (@Hom SET E E)) x y), @Equal (MAP E E) (@comp_map_map E E E (@proj1 (@Hom SET E E) (@Hom SET E E) x) (@proj2 (@Hom SET E E) (@Hom SET E E) x)) (@comp_map_map E E E (@proj1 (@Hom SET E E) (@Hom SET E E) y) (@proj2 (@Hom SET E E) (@Hom SET E E) y)) *) unfold Map_eq in |- *; auto with algebra. (* Goal: @unit_l (sgroup_set Endo_SET_sgroup) (@sgroup_law_map (sgroup_set Endo_SET_sgroup) (sgroup_on_def Endo_SET_sgroup)) (Id E) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set Endo_SET_sgroup), @Equal (sgroup_set Endo_SET_sgroup) (@Ap (cart (sgroup_set Endo_SET_sgroup) (sgroup_set Endo_SET_sgroup)) (sgroup_set Endo_SET_sgroup) (@sgroup_law_map (sgroup_set Endo_SET_sgroup) (sgroup_on_def Endo_SET_sgroup)) (@couple (sgroup_set Endo_SET_sgroup) (sgroup_set Endo_SET_sgroup) (Id E) x)) x *) simpl in |- *. (* Goal: forall (x y : Carrier (cart (@Hom SET E E) (@Hom SET E E))) (_ : @Equal (cart (@Hom SET E E) (@Hom SET E E)) x y), @Equal (MAP E E) (@comp_map_map E E E (@proj1 (@Hom SET E E) (@Hom SET E E) x) (@proj2 (@Hom SET E E) (@Hom SET E E) x)) (@comp_map_map E E E (@proj1 (@Hom SET E E) (@Hom SET E E) y) (@proj2 (@Hom SET E E) (@Hom SET E E) y)) *) unfold Map_eq in |- *; auto with algebra. Defined. End Def.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Parts. (** Title "Singletons." *) Section Single1. Variable E : Setoid. Definition single : E -> part_set E. (* Goal: forall _ : Carrier E, Carrier (part_set E) *) intros x. (* Goal: Carrier (part_set E) *) apply (Build_Predicate (Pred_fun:=fun y : E => Equal y x)). (* Goal: @pred_compatible E (fun y : Carrier E => @Equal E y x) *) red in |- *. (* Goal: forall (x0 y : Carrier E) (_ : @Equal E x0 x) (_ : @Equal E y x0), @Equal E y x *) intros x0 y H' H'0; try assumption. (* Goal: @Equal E y x *) apply Trans with x0; auto with algebra. Defined. Lemma in_single : forall x : E, in_part x (single x). (* Goal: forall (x y : Carrier E) (_ : @in_part E y (single x)), @Equal E y x *) simpl in |- *; auto with algebra. Qed. Hint Resolve in_single: algebra. Lemma single_law : forall x y : E, Equal x y -> Equal (single x) (single y). (* Goal: forall (x y : Carrier E) (_ : @Equal E x y), @Equal (part_set E) (single x) (single y) *) unfold single in |- *; simpl in |- *. (* Goal: forall (x y : Carrier E) (_ : @Equal E x y), @eq_part E (@Build_Predicate E (fun y0 : Carrier E => @Equal E y0 x) (fun (x0 y0 : Carrier E) (H' : @Equal E x0 x) (H'0 : @Equal E y0 x0) => @Trans E y0 x0 x H'0 H')) (@Build_Predicate E (fun y0 : Carrier E => @Equal E y0 y) (fun (x0 y0 : Carrier E) (H' : @Equal E x0 y) (H'0 : @Equal E y0 x0) => @Trans E y0 x0 y H'0 H')) *) unfold eq_part in |- *; simpl in |- *. (* Goal: forall (x y : Carrier E) (_ : @Equal E x y) (x0 : Carrier E), and (forall _ : @Equal E x0 x, @Equal E x0 y) (forall _ : @Equal E x0 y, @Equal E x0 x) *) intros x y H' x0; split; [ intros H'0; try assumption | idtac ]. (* Goal: @Equal E x0 y *) (* Goal: forall _ : @Equal E x0 y, @Equal E x0 x *) apply Trans with x; auto with algebra. (* Goal: forall _ : @Equal E x0 y, @Equal E x0 x *) intros H'0; try assumption. (* Goal: @Equal E x0 x *) apply Trans with y; auto with algebra. Qed. Hint Resolve single_law: algebra. Lemma single_prop : forall x y : E, Equal y x -> in_part y (single x). (* Goal: forall (x y : Carrier E) (_ : @in_part E y (single x)), @Equal E y x *) simpl in |- *; auto with algebra. Qed. Hint Immediate single_prop: algebra. Lemma single_prop_rev : forall x y : E, in_part y (single x) -> Equal y x. (* Goal: forall (x y : Carrier E) (_ : @in_part E y (single x)), @Equal E y x *) simpl in |- *; auto with algebra. Qed. Hint Immediate single_prop_rev: algebra. Lemma single_simpl : forall x y : E, Equal (single x) (single y) -> Equal x y. (* Goal: forall (x y : Carrier E) (_ : @Equal (part_set E) (single x) (single y)), @Equal E x y *) simpl in |- *. (* Goal: forall (x y : Carrier E) (_ : @Equal (part_set E) (single x) (single y)), @Equal E x y *) unfold eq_part, single in |- *; simpl in |- *. (* Goal: forall (x y : Carrier E) (_ : forall x0 : Carrier E, and (forall _ : @Equal E x0 x, @Equal E x0 y) (forall _ : @Equal E x0 y, @Equal E x0 x)), @Equal E x y *) intros x y H'; try assumption. (* Goal: @Equal E x y *) elim (H' x); auto with algebra. Qed. End Single1. Hint Resolve single_law in_single: algebra. Hint Immediate single_prop: algebra. Hint Immediate single_prop_rev: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Automatic Coercions Import. Set Implicit Arguments. Unset Strict Implicit. Require Export Algebra. Require Export Ring_util. Section Lemmas. Variable R : CRING. Variable A : algebra R. Lemma ALGEBRA_comp : forall x x' y y' : A, Equal x x' -> Equal y y' -> Equal (algebra_mult x y) (algebra_mult x' y'). (* Goal: forall (x x' y y' : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) x x') (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) y y'), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@algebra_mult R A x y) (@algebra_mult R A x' y') *) intros x x' y y' H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@algebra_mult R A x (@module_mult (cring_ring R) (@algebra_carrier R A) a y)) (@module_mult (cring_ring R) (@algebra_carrier R A) a (@algebra_mult R A x y)) *) unfold algebra_mult in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@algebra_carrier R A) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)) (@algebra_bilinear_map R (@algebra_carrier R A) (@algebra_on_def R A))))) x)))) y) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@algebra_carrier R A) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)) (@algebra_bilinear_map R (@algebra_carrier R A) (@algebra_on_def R A))))) x')))) y') *) apply Ap_comp. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) auto with algebra. apply (Ap_comp (B:=Hom_module (algebra_carrier A) (algebra_carrier A)) (f:=algebra_bilinear_map (algebra_on_def A)) (g:=algebra_bilinear_map (algebra_on_def A)) H'). (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) auto with algebra. Qed. Lemma ALGEBRA_lin_right : forall x y z : A, Equal (algebra_mult x (sgroup_law A y z)) (sgroup_law A (algebra_mult x y) (algebra_mult x z)). (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@algebra_mult R A x (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) y z)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (@algebra_mult R A x y) (@algebra_mult R A x z)) *) intros x y z; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@algebra_mult R A x (@module_mult (cring_ring R) (@algebra_carrier R A) a y)) (@module_mult (cring_ring R) (@algebra_carrier R A) a (@algebra_mult R A x y)) *) unfold algebra_mult in |- *. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) auto with algebra. Qed. Parameter ALGEBRA_lin_left : forall x y z : A, Equal (algebra_mult (sgroup_law A x y) z) (sgroup_law A (algebra_mult x z) (algebra_mult y z)). Lemma ALGEBRA_mult_lin_right : forall (x y : A) (a : R), Equal (algebra_mult x (module_mult a y)) (module_mult a (algebra_mult x y)). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))))) (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@algebra_mult R A x (@module_mult (cring_ring R) (@algebra_carrier R A) a y)) (@module_mult (cring_ring R) (@algebra_carrier R A) a (@algebra_mult R A x y)) *) intros x y a; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@algebra_mult R A x (@module_mult (cring_ring R) (@algebra_carrier R A) a y)) (@module_mult (cring_ring R) (@algebra_carrier R A) a (@algebra_mult R A x y)) *) unfold algebra_mult in |- *. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) auto with algebra. Qed. Parameter ALGEBRA_mult_lin_left : forall (x y : A) (a : R), Equal (algebra_mult (module_mult a x) y) (module_mult a (algebra_mult x y)). End Lemmas. Hint Resolve ALGEBRA_comp ALGEBRA_lin_right ALGEBRA_lin_left ALGEBRA_mult_lin_right ALGEBRA_mult_lin_left: algebra. Section Lemmas2. Variable R : CRING. Variable A : ring_algebra R. Lemma RING_ALGEBRA_assoc : forall x y z : A, Equal (algebra_mult (algebra_mult x y) z) (algebra_mult x (algebra_mult y z)). (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (@algebra_mult R (@ring_algebra_algebra R A) x y) z) (@algebra_mult R (@ring_algebra_algebra R A) x (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) exact (ring_algebra_assoc A). Qed. Lemma RING_ALGEBRA_unit_l : forall x : A, Equal (algebra_mult (ring_algebra_unit A) x) x. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (@ring_algebra_unit R (@ring_algebra_algebra R A) (@ring_algebra_on_def R A)) x) x *) exact (ring_algebra_unit_l A). Qed. Lemma RING_ALGEBRA_unit_r : forall x : A, Equal (algebra_mult x (ring_algebra_unit A)) x. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x (@ring_algebra_unit R (@ring_algebra_algebra R A) (@ring_algebra_on_def R A))) x *) exact (ring_algebra_unit_r A). Qed. End Lemmas2. Hint Resolve RING_ALGEBRA_assoc RING_ALGEBRA_unit_l RING_ALGEBRA_unit_r: algebra. Section Ring_algebra_as_ring. Variable R : CRING. Variable A : ring_algebra R. Definition ring_algebra_ring : ring. apply (BUILD_RING (E:=A) (ringplus:=sgroup_law A) (ringmult:=algebra_mult (R:=R) (A:=A)) (zero:=monoid_unit A) (un:=ring_algebra_unit A) (ringopp:=group_inverse A)). (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) auto with algebra. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) auto with algebra. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) auto with algebra. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) auto with algebra. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) auto with algebra. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) auto with algebra. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) auto with algebra. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) auto with algebra. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) auto with algebra. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) auto with algebra. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) auto with algebra. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) auto with algebra. Defined. End Ring_algebra_as_ring. Coercion ring_algebra_ring : ring_algebra >-> ring.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Endo_set. (** Title "Operation of a monoid on a set." *) Section Def. Variable M : MONOID. Variable S : SET. Definition operation := Hom M (Endo_SET S). Variable op : operation. Lemma operation_assoc : forall (x y : M) (s : S), Equal (op (sgroup_law _ x y) s) (op x (op y s)). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup M))) (s : Carrier S), @Equal S (@Ap S S (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup (Endo_SET S))) (@sgroup_map (monoid_sgroup M) (monoid_sgroup (Endo_SET S)) (@monoid_sgroup_hom M (Endo_SET S) op)) (sgroup_law (monoid_sgroup M) x y)) s) (@Ap S S (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup (Endo_SET S))) (@sgroup_map (monoid_sgroup M) (monoid_sgroup (Endo_SET S)) (@monoid_sgroup_hom M (Endo_SET S) op)) x) (@Ap S S (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup (Endo_SET S))) (@sgroup_map (monoid_sgroup M) (monoid_sgroup (Endo_SET S)) (@monoid_sgroup_hom M (Endo_SET S) op)) y) s)) *) intros x y s; try assumption. apply Trans with (Ap (sgroup_law (Endo_SET S) (Ap (sgroup_map (monoid_sgroup_hom op)) x) (Ap (sgroup_map (monoid_sgroup_hom op)) y)) s); (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET S))) (@monoid_unit (monoid_sgroup (Endo_SET S)) (monoid_on_def (Endo_SET S))) (Id S) *) auto with algebra. (* Goal: @Equal S (@Ap S S (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup (Endo_SET S))) (@sgroup_map (monoid_sgroup M) (monoid_sgroup (Endo_SET S)) (@monoid_sgroup_hom M (Endo_SET S) op)) (sgroup_law (monoid_sgroup M) x y)) s) (@Ap S S (sgroup_law (monoid_sgroup (Endo_SET S)) (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup (Endo_SET S))) (@sgroup_map (monoid_sgroup M) (monoid_sgroup (Endo_SET S)) (@monoid_sgroup_hom M (Endo_SET S) op)) x) (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup (Endo_SET S))) (@sgroup_map (monoid_sgroup M) (monoid_sgroup (Endo_SET S)) (@monoid_sgroup_hom M (Endo_SET S) op)) y)) s) *) cut (Equal (op (sgroup_law _ x y)) (sgroup_law (Endo_SET S) (op x) (op y))). (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET S))) (@monoid_unit (monoid_sgroup (Endo_SET S)) (monoid_on_def (Endo_SET S))) (Id S) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET S))) (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup (Endo_SET S))) (@sgroup_map (monoid_sgroup M) (monoid_sgroup (Endo_SET S)) (@monoid_sgroup_hom M (Endo_SET S) op)) (sgroup_law (monoid_sgroup M) x y)) (sgroup_law (monoid_sgroup (Endo_SET S)) (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup (Endo_SET S))) (@sgroup_map (monoid_sgroup M) (monoid_sgroup (Endo_SET S)) (@monoid_sgroup_hom M (Endo_SET S) op)) x) (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup (Endo_SET S))) (@sgroup_map (monoid_sgroup M) (monoid_sgroup (Endo_SET S)) (@monoid_sgroup_hom M (Endo_SET S) op)) y)) *) apply (sgroup_hom_prf op). Qed. Lemma operation_unit : forall s : S, Equal (op (monoid_unit M) s) s. (* Goal: forall s : Carrier S, @Equal S (@Ap S S (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup (Endo_SET S))) (@sgroup_map (monoid_sgroup M) (monoid_sgroup (Endo_SET S)) (@monoid_sgroup_hom M (Endo_SET S) op)) (@monoid_unit (monoid_sgroup M) (monoid_on_def M))) s) s *) intros s; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET S))) (@monoid_unit (monoid_sgroup (Endo_SET S)) (monoid_on_def (Endo_SET S))) (Id S) *) apply Trans with (Id S s); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET S))) (@monoid_unit (monoid_sgroup (Endo_SET S)) (monoid_on_def (Endo_SET S))) (Id S) *) cut (Equal (op (monoid_unit M)) (Id S)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET S))) (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup (Endo_SET S))) (@sgroup_map (monoid_sgroup M) (monoid_sgroup (Endo_SET S)) (@monoid_sgroup_hom M (Endo_SET S) op)) (@monoid_unit (monoid_sgroup M) (monoid_on_def M))) (Id S) *) apply Trans with (monoid_unit (Endo_SET S)). (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET S))) (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup (Endo_SET S))) (@sgroup_map (monoid_sgroup M) (monoid_sgroup (Endo_SET S)) (@monoid_sgroup_hom M (Endo_SET S) op)) (@monoid_unit (monoid_sgroup M) (monoid_on_def M))) (@monoid_unit (monoid_sgroup (Endo_SET S)) (monoid_on_def (Endo_SET S))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET S))) (@monoid_unit (monoid_sgroup (Endo_SET S)) (monoid_on_def (Endo_SET S))) (Id S) *) generalize (monoid_hom_prf op). (* Goal: forall _ : @monoid_hom_prop M (Endo_SET S) (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup (Endo_SET S))) (@sgroup_map (monoid_sgroup M) (monoid_sgroup (Endo_SET S)) (@monoid_sgroup_hom M (Endo_SET S) op))), @Equal (sgroup_set (monoid_sgroup (Endo_SET S))) (@Ap (sgroup_set (monoid_sgroup M)) (sgroup_set (monoid_sgroup (Endo_SET S))) (@sgroup_map (monoid_sgroup M) (monoid_sgroup (Endo_SET S)) (@monoid_sgroup_hom M (Endo_SET S) op)) (@monoid_unit (monoid_sgroup M) (monoid_on_def M))) (@monoid_unit (monoid_sgroup (Endo_SET S)) (monoid_on_def (Endo_SET S))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET S))) (@monoid_unit (monoid_sgroup (Endo_SET S)) (monoid_on_def (Endo_SET S))) (Id S) *) unfold monoid_hom_prop in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET S))) (@monoid_unit (monoid_sgroup (Endo_SET S)) (monoid_on_def (Endo_SET S))) (Id S) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET S))) (@monoid_unit (monoid_sgroup (Endo_SET S)) (monoid_on_def (Endo_SET S))) (Id S) *) auto with algebra. Qed. End Def. Hint Resolve operation_assoc operation_unit: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Parts. (** Title "Union of two parts.".*) Section Union1. Variable E : Setoid. Definition union : part_set E -> part_set E -> part_set E. (* Goal: forall (_ : Carrier (part_set E)) (_ : Carrier (part_set E)), Carrier (part_set E) *) intros A B. (* Goal: Carrier (part_set E) *) apply (Build_Predicate (Pred_fun:=fun x : E => in_part x A \/ in_part x B)). (* Goal: @pred_compatible E (fun x : Carrier E => or (@in_part E x A) (@in_part E x B)) *) red in |- *. (* Goal: forall (x y : Carrier E) (_ : or (@in_part E x A) (@in_part E x B)) (_ : @Equal E y x), or (@in_part E y A) (@in_part E y B) *) intros x y H' H'0; try assumption. (* Goal: or (@in_part E y A) (@in_part E y B) *) elim H'; [ intros H'1; try exact H'1; clear H' | intros H'1; clear H' ]. (* Goal: or (@in_part E x A) (@in_part E x B) *) (* Goal: or (@in_part E x A) (@in_part E x B) *) left; try assumption. (* Goal: @in_part E y B *) apply in_part_comp_l with x; auto with algebra. (* Goal: or (@in_part E x A) (@in_part E x B) *) right; try assumption. (* Goal: @in_part E y B *) apply in_part_comp_l with x; auto with algebra. Defined. Lemma included_union_l : forall A B : part_set E, included A (union A B). (* Goal: forall (A B C : Carrier (part_set E)) (_ : @included E A C) (_ : @included E B C), @included E (union A B) C *) unfold included in |- *; simpl in |- *; intuition. Qed. Lemma included_union_r : forall A B : part_set E, included B (union A B). (* Goal: forall (A B C : Carrier (part_set E)) (_ : @included E A C) (_ : @included E B C), @included E (union A B) C *) unfold included in |- *; simpl in |- *; intuition. Qed. Lemma in_part_union_l : forall (A B : part_set E) (x : E), in_part x A -> in_part x (union A B). (* Goal: forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x B), @in_part E x (union A B) *) simpl in |- *; intuition. Qed. Lemma in_part_union_r : forall (A B : part_set E) (x : E), in_part x B -> in_part x (union A B). (* Goal: forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x B), @in_part E x (union A B) *) simpl in |- *; intuition. Qed. Parameter in_part_union_or : forall (A B : part_set E) (x : E), in_part x A \/ in_part x B -> in_part x (union A B). Lemma in_part_union : forall (A B : part_set E) (x : E), in_part x (union A B) -> in_part x A \/ in_part x B. (* Goal: forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x (union A B)), or (@in_part E x A) (@in_part E x B) *) intros A B x; try assumption. (* Goal: forall _ : @in_part E x (union A B), or (@in_part E x A) (@in_part E x B) *) unfold union in |- *; intuition. Qed. Lemma union_not_in_l : forall (A B : part_set E) (x : E), in_part x (union A B) -> ~ in_part x A -> in_part x B. (* Goal: forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x B), @in_part E x (union A B) *) unfold union in |- *; simpl in |- *; intuition. Qed. Lemma included2_union : forall A B C : part_set E, included A C -> included B C -> included (union A B) C. (* Goal: forall (A B C : Carrier (part_set E)) (_ : @included E A C) (_ : @included E B C), @included E (union A B) C *) unfold included in |- *; simpl in |- *; intuition. Qed. Lemma union_comp : forall A A' B B' : part_set E, Equal A A' -> Equal B B' -> Equal (union A B) (union A' B'). (* Goal: forall A B : Carrier (part_set E), @Equal (part_set E) (union A B) (union B A) *) unfold union in |- *; simpl in |- *. (* Goal: forall A B : Predicate E, @eq_part E (@Build_Predicate E (fun x : Carrier E => or (@in_part E x A) (@in_part E x B)) (fun (x y : Carrier E) (H' : or (@in_part E x A) (@in_part E x B)) (H'0 : @Equal E y x) => @or_ind (@in_part E x A) (@in_part E x B) (or (@in_part E y A) (@in_part E y B)) (fun H'1 : @in_part E x A => @or_introl (@in_part E y A) (@in_part E y B) (@in_part_comp_l E A x y H'1 H'0)) (fun H'1 : @in_part E x B => @or_intror (@in_part E y A) (@in_part E y B) (@in_part_comp_l E B x y H'1 H'0)) H')) (@Build_Predicate E (fun x : Carrier E => or (@in_part E x B) (@in_part E x A)) (fun (x y : Carrier E) (H' : or (@in_part E x B) (@in_part E x A)) (H'0 : @Equal E y x) => @or_ind (@in_part E x B) (@in_part E x A) (or (@in_part E y B) (@in_part E y A)) (fun H'1 : @in_part E x B => @or_introl (@in_part E y B) (@in_part E y A) (@in_part_comp_l E B x y H'1 H'0)) (fun H'1 : @in_part E x A => @or_intror (@in_part E y B) (@in_part E y A) (@in_part_comp_l E A x y H'1 H'0)) H')) *) unfold eq_part in |- *; simpl in |- *. (* Goal: forall (A A' B B' : Predicate E) (_ : forall x : Carrier E, and (forall _ : @in_part E x A, @in_part E x A') (forall _ : @in_part E x A', @in_part E x A)) (_ : forall x : Carrier E, and (forall _ : @in_part E x B, @in_part E x B') (forall _ : @in_part E x B', @in_part E x B)) (x : Carrier E), and (forall _ : or (@in_part E x A) (@in_part E x B), or (@in_part E x A') (@in_part E x B')) (forall _ : or (@in_part E x A') (@in_part E x B'), or (@in_part E x A) (@in_part E x B)) *) intros A A' B B' H' H'0 x; split; [ intros H'1; try assumption | idtac ]. (* Goal: or (@in_part E x A) (@in_part E x B) *) elim H'1; [ intros H'2; try exact H'2; clear H'1 | intros H'2; clear H'1 ]. (* Goal: or (@in_part E x A) (@in_part E x B) *) (* Goal: or (@in_part E x A) (@in_part E x B) *) left; try assumption. elim (H' x); intros H'3 H'4; lapply H'3; [ intros H'5; try exact H'5; clear H'3 | clear H'3 ]. (* Goal: @in_part E x B' *) auto with algebra. (* Goal: or (@in_part E x A) (@in_part E x B) *) right; try assumption. elim (H'0 x); intros H'3 H'4; lapply H'3; [ intros H'5; try exact H'5; clear H'3 | clear H'3 ]. (* Goal: @in_part E x B' *) auto with algebra. (* Goal: forall _ : or (@in_part E x A') (@in_part E x B'), or (@in_part E x A) (@in_part E x B) *) intros H'1; try assumption. (* Goal: or (@in_part E x A) (@in_part E x B) *) elim H'1; [ intros H'2; try exact H'2; clear H'1 | intros H'2; clear H'1 ]. (* Goal: or (@in_part E x A) (@in_part E x B) *) (* Goal: or (@in_part E x A) (@in_part E x B) *) left; try assumption. elim (H' x); intros H'3 H'4; lapply H'4; [ intros H'5; try exact H'5; clear H'4 | clear H'4 ]. (* Goal: @in_part E x B' *) auto with algebra. (* Goal: or (@in_part E x A) (@in_part E x B) *) right; try assumption. elim (H'0 x); intros H'3 H'4; lapply H'4; [ intros H'5; try exact H'5; clear H'4 | clear H'4 ]. (* Goal: @in_part E x B' *) auto with algebra. Qed. Lemma union_assoc : forall A B C : part_set E, Equal (union A (union B C)) (union (union A B) C). (* Goal: forall A B : Carrier (part_set E), @Equal (part_set E) (union A B) (union B A) *) unfold union in |- *; simpl in |- *. (* Goal: forall A B : Predicate E, @eq_part E (@Build_Predicate E (fun x : Carrier E => or (@in_part E x A) (@in_part E x B)) (fun (x y : Carrier E) (H' : or (@in_part E x A) (@in_part E x B)) (H'0 : @Equal E y x) => @or_ind (@in_part E x A) (@in_part E x B) (or (@in_part E y A) (@in_part E y B)) (fun H'1 : @in_part E x A => @or_introl (@in_part E y A) (@in_part E y B) (@in_part_comp_l E A x y H'1 H'0)) (fun H'1 : @in_part E x B => @or_intror (@in_part E y A) (@in_part E y B) (@in_part_comp_l E B x y H'1 H'0)) H')) (@Build_Predicate E (fun x : Carrier E => or (@in_part E x B) (@in_part E x A)) (fun (x y : Carrier E) (H' : or (@in_part E x B) (@in_part E x A)) (H'0 : @Equal E y x) => @or_ind (@in_part E x B) (@in_part E x A) (or (@in_part E y B) (@in_part E y A)) (fun H'1 : @in_part E x B => @or_introl (@in_part E y B) (@in_part E y A) (@in_part_comp_l E B x y H'1 H'0)) (fun H'1 : @in_part E x A => @or_intror (@in_part E y B) (@in_part E y A) (@in_part_comp_l E A x y H'1 H'0)) H')) *) unfold eq_part in |- *; simpl in |- *. (* Goal: forall (A B C : Predicate E) (x : Carrier E), and (forall _ : or (@in_part E x A) (or (@in_part E x B) (@in_part E x C)), or (or (@in_part E x A) (@in_part E x B)) (@in_part E x C)) (forall _ : or (or (@in_part E x A) (@in_part E x B)) (@in_part E x C), or (@in_part E x A) (or (@in_part E x B) (@in_part E x C))) *) intros A B C x; split; [ try assumption | idtac ]. (* Goal: forall _ : or (@in_part E x B) (@in_part E x A), or (@in_part E x A) (@in_part E x B) *) intuition. (* Goal: forall _ : or (@in_part E x B) (@in_part E x A), or (@in_part E x A) (@in_part E x B) *) intuition. Qed. Lemma union_com : forall A B : part_set E, Equal (union A B) (union B A). (* Goal: forall A B : Carrier (part_set E), @Equal (part_set E) (union A B) (union B A) *) unfold union in |- *; simpl in |- *. (* Goal: forall A B : Predicate E, @eq_part E (@Build_Predicate E (fun x : Carrier E => or (@in_part E x A) (@in_part E x B)) (fun (x y : Carrier E) (H' : or (@in_part E x A) (@in_part E x B)) (H'0 : @Equal E y x) => @or_ind (@in_part E x A) (@in_part E x B) (or (@in_part E y A) (@in_part E y B)) (fun H'1 : @in_part E x A => @or_introl (@in_part E y A) (@in_part E y B) (@in_part_comp_l E A x y H'1 H'0)) (fun H'1 : @in_part E x B => @or_intror (@in_part E y A) (@in_part E y B) (@in_part_comp_l E B x y H'1 H'0)) H')) (@Build_Predicate E (fun x : Carrier E => or (@in_part E x B) (@in_part E x A)) (fun (x y : Carrier E) (H' : or (@in_part E x B) (@in_part E x A)) (H'0 : @Equal E y x) => @or_ind (@in_part E x B) (@in_part E x A) (or (@in_part E y B) (@in_part E y A)) (fun H'1 : @in_part E x B => @or_introl (@in_part E y B) (@in_part E y A) (@in_part_comp_l E B x y H'1 H'0)) (fun H'1 : @in_part E x A => @or_intror (@in_part E y B) (@in_part E y A) (@in_part_comp_l E A x y H'1 H'0)) H')) *) unfold eq_part in |- *; simpl in |- *. (* Goal: forall (A B : Predicate E) (x : Carrier E), and (forall _ : or (@in_part E x A) (@in_part E x B), or (@in_part E x B) (@in_part E x A)) (forall _ : or (@in_part E x B) (@in_part E x A), or (@in_part E x A) (@in_part E x B)) *) intros A B x; split; [ try assumption | idtac ]. (* Goal: forall _ : or (@in_part E x B) (@in_part E x A), or (@in_part E x A) (@in_part E x B) *) intuition. (* Goal: forall _ : or (@in_part E x B) (@in_part E x A), or (@in_part E x A) (@in_part E x B) *) intuition. Qed. Parameter union_empty_l : forall A : part_set E, Equal (union (empty E) A) A. Parameter union_empty_r : forall A : part_set E, Equal (union A (empty E)) A. End Union1. Hint Resolve included_union_l included_union_r in_part_union_l in_part_union_r included2_union union_comp union_assoc union_empty_l union_empty_r: algebra. Hint Immediate union_com: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Automatic Coercions Import. Set Implicit Arguments. Unset Strict Implicit. Require Export Integral_domain_facts. Require Export Cfield_cat. Require Export Abelian_group_facts. Require Export Ring_util. (** Title "The field of fractions of an integral domain" "with decidable equality." *) Section Def. Variable R : INTEGRAL_DOMAIN. Variable diff10 : ~ Equal (ring_unit R) (monoid_unit R). Set Strict Implicit. Unset Implicit Arguments. Record fraction : Type := {num : R; den : R; den_prf : ~ Equal den (monoid_unit R)}. Set Implicit Arguments. Unset Strict Implicit. Hint Resolve den_prf: algebra. Definition eqfraction (x y : fraction) := Equal (ring_mult (num x) (den y)) (ring_mult (num y) (den x)). Lemma eqfraction_refl : reflexive eqfraction. (* Goal: @fun_compatible (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) invfraction_fun *) red in |- *. (* Goal: @fun_compatible (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) invfraction_fun *) intros x; red in |- *. (* Goal: @fun_compatible (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) invfraction_fun *) red in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. Qed. Definition fraction0 := Build_fraction (monoid_unit R) (ring_unit R) diff10. Lemma eqfraction0 : forall x : fraction, eqfraction x fraction0 -> Equal (num x) (monoid_unit R). (* Goal: forall (x : fraction) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (ring_unit (cring_ring (idomain_ring R)))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den x)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x) (num match zero_dec (num x) with | left e => x | right n => Build_fraction (den x) (num x) n end)) (ring_unit (cring_ring (idomain_ring R)))) (@ring_mult (cring_ring (idomain_ring R)) (ring_unit (cring_ring (idomain_ring R))) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den match zero_dec (num x) with | left e => x | right n => Build_fraction (den x) (num x) n end))) *) intros x; try assumption. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))), eqfraction x fraction0 *) case x; unfold eqfraction, fraction0 in |- *; simpl in |- *. (* Goal: forall (num den : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) den (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) num (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) num (ring_unit (cring_ring (idomain_ring R)))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) den) *) intros numer denom H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (ring_mult numer (ring_unit R)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (ring_mult (monoid_unit R) denom); auto with algebra. Qed. Lemma eqfraction_num0 : forall x : fraction, Equal (num x) (monoid_unit R) -> eqfraction x fraction0. (* Goal: forall (x : fraction) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (ring_unit (cring_ring (idomain_ring R)))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den x)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x) (num match zero_dec (num x) with | left e => x | right n => Build_fraction (den x) (num x) n end)) (ring_unit (cring_ring (idomain_ring R)))) (@ring_mult (cring_ring (idomain_ring R)) (ring_unit (cring_ring (idomain_ring R))) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den match zero_dec (num x) with | left e => x | right n => Build_fraction (den x) (num x) n end))) *) intros x; try assumption. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))), eqfraction x fraction0 *) case x; unfold eqfraction, fraction0 in |- *; simpl in |- *. (* Goal: forall (num den : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) den (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) num (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) num (ring_unit (cring_ring (idomain_ring R)))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) den) *) intros numer denom H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with numer; auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (monoid_unit R); auto with algebra. Qed. Lemma eqfraction_sym : symmetric eqfraction. (* Goal: @fun_compatible (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) invfraction_fun *) red in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) unfold app_rel, eqfraction in |- *; auto with algebra. Qed. Lemma eqfraction_trans : transitive eqfraction. (* Goal: @fun_compatible (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) invfraction_fun *) red in |- *. (* Goal: forall (x y z : fraction) (_ : @app_rel fraction eqfraction x y) (_ : @app_rel fraction eqfraction y z), @app_rel fraction eqfraction x z *) unfold app_rel, eqfraction in |- *. (* Goal: forall (x y z : fraction) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den y))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den x)) *) intros x y z H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den x)) *) apply INTEGRAL_DOMAIN_simpl_l with (den y). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (den y) (@ring_mult (cring_ring (idomain_ring R)) (num x) (den z))) (@ring_mult (cring_ring (idomain_ring R)) (den y) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den x))) *) apply Trans with (ring_mult (ring_mult (den y) (num x)) (den z)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (den y) (num x)) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (den y) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den x))) *) apply Trans with (ring_mult (ring_mult (num x) (den y)) (den z)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x) (den y)) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (den y) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den x))) *) apply Trans with (ring_mult (ring_mult (num y) (den x)) (den z)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x)) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (den y) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den x))) *) apply Trans with (ring_mult (ring_mult (den x) (num y)) (den z)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (den x) (num y)) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (den y) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den x))) *) apply Trans with (ring_mult (den x) (ring_mult (num y) (den z))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (den x) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den z))) (@ring_mult (cring_ring (idomain_ring R)) (den y) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den x))) *) apply Trans with (ring_mult (den x) (ring_mult (num z) (den y))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (den x) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den y))) (@ring_mult (cring_ring (idomain_ring R)) (den y) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den x))) *) apply Trans with (ring_mult (ring_mult (den x) (num z)) (den y)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. apply Trans with (ring_mult (ring_mult (num z) (den x)) (den y)); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. Qed. Definition fraction_set : SET. (* Goal: Ob SET *) apply (Build_Setoid (Carrier:=fraction) (Equal:=eqfraction)). (* Goal: @fun_compatible (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) invfraction_fun *) red in |- *. (* Goal: and (@transitive fraction eqfraction) (@symmetric fraction eqfraction) *) split; [ try assumption | idtac ]. (* Goal: @reflexive fraction eqfraction *) (* Goal: @partial_equivalence fraction eqfraction *) exact eqfraction_refl. (* Goal: @fun_compatible (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) invfraction_fun *) red in |- *. (* Goal: and (@transitive fraction eqfraction) (@symmetric fraction eqfraction) *) split; [ try assumption | idtac ]. (* Goal: @transitive fraction eqfraction *) (* Goal: @symmetric fraction eqfraction *) exact eqfraction_trans. (* Goal: @symmetric fraction eqfraction *) exact eqfraction_sym. Defined. Definition addfraction_fun (x y : fraction_set) : fraction_set := Build_fraction (sgroup_law R (ring_mult (num x) (den y)) (ring_mult (num y) (den x))) (ring_mult (den x) (den y)) (INTEGRAL_DOMAIN_prop_rev (den_prf x) (den_prf y)). Definition opfraction_fun (x : fraction_set) : fraction_set := Build_fraction (group_inverse R (num x)) (den x) (den_prf x). Definition multfraction_fun (x y : fraction_set) : fraction_set := Build_fraction (ring_mult (num x) (num y)) (ring_mult (den x) (den y)) (INTEGRAL_DOMAIN_prop_rev (den_prf x) (den_prf y)). Definition fraction1 : fraction_set := Build_fraction (ring_unit R) (ring_unit R) diff10. Lemma addfraction_law_l : forall x x' y : fraction_set, Equal x x' -> Equal (addfraction_fun x y) (addfraction_fun x' y). (* Goal: forall x y : Carrier fraction_set, @Equal fraction_set (addfraction_fun x y) (addfraction_fun y x) *) unfold addfraction_fun in |- *; simpl in |- *. (* Goal: not (eqfraction (ring_unit fract_field_ring_aux) fraction0) *) unfold eqfraction in |- *; simpl in |- *. (* Goal: forall (x x' y : fraction) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (den x')) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den x))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x))) (@ring_mult (cring_ring (idomain_ring R)) (den x') (den y))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x'))) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y))) *) intros x x' y H'; try assumption. apply Trans with (ring_mult (ring_mult (sgroup_law R (ring_mult (num x) (den y)) (ring_mult (num y) (den x))) (den x')) (den y)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. apply Trans with (ring_mult (ring_mult (sgroup_law R (ring_mult (num x') (den y)) (ring_mult (num y) (den x'))) (den x)) (den y)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x))) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y)))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y)) (den z))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (@ring_mult (cring_ring (idomain_ring R)) (den y) (den z))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den y))) (den x))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y)) (den z))) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (addfraction_fun x fraction0) x *) (* Goal: forall (x y : Carrier fraction_set) (_ : @Equal fraction_set x y), @Equal fraction_set (opfraction_fun x) (opfraction_fun y) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (addfraction_fun x (opfraction_fun x)) fraction0 *) (* Goal: forall x y : Carrier fraction_set, @Equal fraction_set (addfraction_fun x y) (addfraction_fun y x) *) (* Goal: forall (x x' y y' : Carrier fraction_set) (_ : @Equal fraction_set x x') (_ : @Equal fraction_set y y'), @Equal fraction_set (multfraction_fun x y) (multfraction_fun x' y') *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (multfraction_fun x y) z) (multfraction_fun x (multfraction_fun y z)) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (multfraction_fun x fraction1) x *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (multfraction_fun fraction1 x) x *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun x (addfraction_fun y z)) (addfraction_fun (multfraction_fun x y) (multfraction_fun x z)) *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (addfraction_fun x y) z) (addfraction_fun (multfraction_fun x z) (multfraction_fun y z)) *) apply RING_comp. apply Trans with (sgroup_law R (ring_mult (ring_mult (num x) (den y)) (den x')) (ring_mult (ring_mult (num y) (den x)) (den x'))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult (ring_mult (num x') (den y)) (den x)) (ring_mult (ring_mult (num y) (den x')) (den x))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x)) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y)))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den z)) (den x)) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den y)) (den x))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den z)) (den x)) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den y)) (den x))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den y))) (den x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y)) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y)) (den z)) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (addfraction_fun x fraction0) x *) (* Goal: forall (x y : Carrier fraction_set) (_ : @Equal fraction_set x y), @Equal fraction_set (opfraction_fun x) (opfraction_fun y) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (addfraction_fun x (opfraction_fun x)) fraction0 *) (* Goal: forall x y : Carrier fraction_set, @Equal fraction_set (addfraction_fun x y) (addfraction_fun y x) *) (* Goal: forall (x x' y y' : Carrier fraction_set) (_ : @Equal fraction_set x x') (_ : @Equal fraction_set y y'), @Equal fraction_set (multfraction_fun x y) (multfraction_fun x' y') *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (multfraction_fun x y) z) (multfraction_fun x (multfraction_fun y z)) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (multfraction_fun x fraction1) x *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (multfraction_fun fraction1 x) x *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun x (addfraction_fun y z)) (addfraction_fun (multfraction_fun x y) (multfraction_fun x z)) *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (addfraction_fun x y) z) (addfraction_fun (multfraction_fun x z) (multfraction_fun y z)) *) apply SGROUP_comp. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x) (den y)) (den x')) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (den x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x)) (den x')) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x')) (den x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (den x)) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x')) (den x))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x'))) (den x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (den y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x'))) (den x)) (den y)) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x'))) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y))) *) apply Trans with (ring_mult (ring_mult (den y) (num x)) (den x')). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (den y) (num x)) (den x')) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (den x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x)) (den x')) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x')) (den x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (den x)) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x')) (den x))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x'))) (den x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (den y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x'))) (den x)) (den y)) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x'))) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y))) *) apply Trans with (ring_mult (ring_mult (den y) (num x')) (den x)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (den y) (num x)) (den x')) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (den y) (num x')) (den x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (den y) (num x')) (den x)) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (den x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x)) (den x')) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x')) (den x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (den x)) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x')) (den x))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x'))) (den x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (den y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x'))) (den x)) (den y)) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x'))) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y))) *) apply Trans with (ring_mult (den y) (ring_mult (num x) (den x'))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (den y) (@ring_mult (cring_ring (idomain_ring R)) (num x) (den x'))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (den y) (num x')) (den x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (den y) (num x')) (den x)) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (den x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x)) (den x')) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x')) (den x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (den x)) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x')) (den x))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x'))) (den x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (den y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x'))) (den x)) (den y)) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x'))) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y))) *) apply Trans with (ring_mult (den y) (ring_mult (num x') (den x))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x)) (den x')) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x')) (den x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (den x)) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x')) (den x))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x'))) (den x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (den y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x'))) (den x)) (den y)) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x'))) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y))) *) apply Trans with (ring_mult (num y) (ring_mult (den x) (den x'))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num y) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den x'))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x')) (den x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (den x)) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x')) (den x))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x'))) (den x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (den y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x'))) (den x)) (den y)) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x'))) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y))) *) apply Trans with (ring_mult (num y) (ring_mult (den x') (den x))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. Qed. Lemma addfraction_fun_com : forall x y : fraction_set, Equal (addfraction_fun x y) (addfraction_fun y x). (* Goal: forall x y : Carrier fraction_set, @Equal fraction_set (addfraction_fun x y) (addfraction_fun y x) *) unfold addfraction_fun in |- *; simpl in |- *. (* Goal: not (eqfraction (ring_unit fract_field_ring_aux) fraction0) *) unfold eqfraction in |- *; simpl in |- *. (* Goal: forall (x y : fraction) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num match zero_dec (num x) with | left e => x | right n => Build_fraction (den x) (num x) n end) (den match zero_dec (num y) with | left e => y | right n => Build_fraction (den y) (num y) n end)) (@ring_mult (cring_ring (idomain_ring R)) (num match zero_dec (num y) with | left e => y | right n => Build_fraction (den y) (num y) n end) (den match zero_dec (num x) with | left e => x | right n => Build_fraction (den x) (num x) n end)) *) intros x y; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply RING_comp; auto with algebra. Qed. Lemma addfraction_law_r : forall x y y' : fraction_set, Equal y y' -> Equal (addfraction_fun x y) (addfraction_fun x y'). (* Goal: forall (x y y' : Carrier fraction_set) (_ : @Equal fraction_set y y'), @Equal fraction_set (addfraction_fun x y) (addfraction_fun x y') *) intros x y y' H'; try assumption. (* Goal: @Equal fraction_set (addfraction_fun x y) (addfraction_fun x y') *) apply Trans with (addfraction_fun y x). (* Goal: @Equal fraction_set (addfraction_fun y' x) (addfraction_fun x y') *) apply addfraction_fun_com. (* Goal: @Equal fraction_set (addfraction_fun y x) (addfraction_fun x y') *) apply Trans with (addfraction_fun y' x). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply addfraction_law_l; auto with algebra. (* Goal: @Equal fraction_set (addfraction_fun y' x) (addfraction_fun x y') *) apply addfraction_fun_com. Qed. Lemma addfraction_law : fun2_compatible addfraction_fun. (* Goal: @fun_compatible (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) invfraction_fun *) red in |- *. (* Goal: forall (x x' y y' : fraction) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (den x')) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den x))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den y')) (@ring_mult (cring_ring (idomain_ring R)) (num y') (den y))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x) (num y)) (@ring_mult (cring_ring (idomain_ring R)) (den x') (den y'))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x') (num y')) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y))) *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (multfraction_fun x y) z) (multfraction_fun x (multfraction_fun y z)) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (multfraction_fun x fraction1) x *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (multfraction_fun fraction1 x) x *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun x (addfraction_fun y z)) (addfraction_fun (multfraction_fun x y) (multfraction_fun x z)) *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (addfraction_fun x y) z) (addfraction_fun (multfraction_fun x z) (multfraction_fun y z)) *) intros x x' y y' H' H'0; try assumption. (* Goal: @Equal fraction_set (addfraction_fun x y) (addfraction_fun x' y') *) apply Trans with (addfraction_fun x' y). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply addfraction_law_l; auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply addfraction_law_r; auto with algebra. Qed. Lemma multfraction_dist_l : forall x y z : fraction_set, Equal (multfraction_fun x (addfraction_fun y z)) (addfraction_fun (multfraction_fun x y) (multfraction_fun x z)). (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) simpl in |- *. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) unfold multfraction_fun, eqfraction in |- *; simpl in |- *. (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (addfraction_fun x y) z) (addfraction_fun (multfraction_fun x z) (multfraction_fun y z)) *) intros x y z; try assumption. apply Trans with (ring_mult (ring_mult (num x) (sgroup_law R (ring_mult (num y) (den z)) (ring_mult (num z) (den y)))) (ring_mult (den x) (ring_mult (den y) (ring_mult (den x) (den z))))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. apply Trans with (ring_mult (ring_mult (ring_mult (num x) (sgroup_law R (ring_mult (num y) (den z)) (ring_mult (num z) (den y)))) (den x)) (ring_mult (den y) (ring_mult (den x) (den z)))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x))) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y)))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y)) (den z))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (@ring_mult (cring_ring (idomain_ring R)) (den y) (den z))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den y))) (den x))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y)) (den z))) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (addfraction_fun x fraction0) x *) (* Goal: forall (x y : Carrier fraction_set) (_ : @Equal fraction_set x y), @Equal fraction_set (opfraction_fun x) (opfraction_fun y) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (addfraction_fun x (opfraction_fun x)) fraction0 *) (* Goal: forall x y : Carrier fraction_set, @Equal fraction_set (addfraction_fun x y) (addfraction_fun y x) *) (* Goal: forall (x x' y y' : Carrier fraction_set) (_ : @Equal fraction_set x x') (_ : @Equal fraction_set y y'), @Equal fraction_set (multfraction_fun x y) (multfraction_fun x' y') *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (multfraction_fun x y) z) (multfraction_fun x (multfraction_fun y z)) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (multfraction_fun x fraction1) x *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (multfraction_fun fraction1 x) x *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun x (addfraction_fun y z)) (addfraction_fun (multfraction_fun x y) (multfraction_fun x z)) *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (addfraction_fun x y) z) (addfraction_fun (multfraction_fun x z) (multfraction_fun y z)) *) apply RING_comp. apply Trans with (ring_mult (sgroup_law R (ring_mult (num x) (ring_mult (num y) (den z))) (ring_mult (num x) (ring_mult (num z) (den y)))) (den x)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult (ring_mult (num x) (ring_mult (num y) (den z))) (den x)) (ring_mult (ring_mult (num x) (ring_mult (num z) (den y))) (den x))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x)) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y)))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den z)) (den x)) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den y)) (den x))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den z)) (den x)) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den y)) (den x))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den y))) (den x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y)) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y)) (den z)) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (addfraction_fun x fraction0) x *) (* Goal: forall (x y : Carrier fraction_set) (_ : @Equal fraction_set x y), @Equal fraction_set (opfraction_fun x) (opfraction_fun y) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (addfraction_fun x (opfraction_fun x)) fraction0 *) (* Goal: forall x y : Carrier fraction_set, @Equal fraction_set (addfraction_fun x y) (addfraction_fun y x) *) (* Goal: forall (x x' y y' : Carrier fraction_set) (_ : @Equal fraction_set x x') (_ : @Equal fraction_set y y'), @Equal fraction_set (multfraction_fun x y) (multfraction_fun x' y') *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (multfraction_fun x y) z) (multfraction_fun x (multfraction_fun y z)) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (multfraction_fun x fraction1) x *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (multfraction_fun fraction1 x) x *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun x (addfraction_fun y z)) (addfraction_fun (multfraction_fun x y) (multfraction_fun x z)) *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (addfraction_fun x y) z) (addfraction_fun (multfraction_fun x z) (multfraction_fun y z)) *) apply SGROUP_comp. apply Trans with (ring_mult (ring_mult (ring_mult (num x) (num y)) (den z)) (den x)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. apply Trans with (ring_mult (ring_mult (num x) (num y)) (ring_mult (den z) (den x))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. apply Trans with (ring_mult (ring_mult (ring_mult (num x) (num z)) (den y)) (den x)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. apply Trans with (ring_mult (ring_mult (num x) (num z)) (ring_mult (den y) (den x))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. Qed. Lemma multfraction_com : forall x y : fraction_set, Equal (multfraction_fun x y) (multfraction_fun y x). (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) unfold multfraction_fun, eqfraction in |- *; simpl in |- *; auto with algebra. Qed. Definition fract_field_ring_aux : RING. apply (BUILD_RING (E:=fraction_set) (ringplus:=addfraction_fun) (ringmult:=multfraction_fun) (zero:=fraction0) (un:=fraction1) (ringopp:=opfraction_fun)). (* Goal: forall (x x' y y' : Carrier fraction_set) (_ : @Equal fraction_set x x') (_ : @Equal fraction_set y y'), @Equal fraction_set (addfraction_fun x y) (addfraction_fun x' y') *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (addfraction_fun (addfraction_fun x y) z) (addfraction_fun x (addfraction_fun y z)) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (addfraction_fun x fraction0) x *) (* Goal: forall (x y : Carrier fraction_set) (_ : @Equal fraction_set x y), @Equal fraction_set (opfraction_fun x) (opfraction_fun y) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (addfraction_fun x (opfraction_fun x)) fraction0 *) (* Goal: forall x y : Carrier fraction_set, @Equal fraction_set (addfraction_fun x y) (addfraction_fun y x) *) (* Goal: forall (x x' y y' : Carrier fraction_set) (_ : @Equal fraction_set x x') (_ : @Equal fraction_set y y'), @Equal fraction_set (multfraction_fun x y) (multfraction_fun x' y') *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (multfraction_fun x y) z) (multfraction_fun x (multfraction_fun y z)) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (multfraction_fun x fraction1) x *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (multfraction_fun fraction1 x) x *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun x (addfraction_fun y z)) (addfraction_fun (multfraction_fun x y) (multfraction_fun x z)) *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (addfraction_fun x y) z) (addfraction_fun (multfraction_fun x z) (multfraction_fun y z)) *) exact addfraction_law. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) simpl in |- *. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) unfold addfraction_fun, eqfraction in |- *; simpl in |- *. (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (addfraction_fun x y) z) (addfraction_fun (multfraction_fun x z) (multfraction_fun y z)) *) intros x y z; try assumption. apply Trans with (ring_mult (sgroup_law R (ring_mult (sgroup_law R (ring_mult (num x) (den y)) (ring_mult (num y) (den x))) (den z)) (ring_mult (num z) (ring_mult (den x) (den y)))) (ring_mult (ring_mult (den x) (den y)) (den z))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x))) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y)))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y)) (den z))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (@ring_mult (cring_ring (idomain_ring R)) (den y) (den z))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den y))) (den x))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y)) (den z))) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (addfraction_fun x fraction0) x *) (* Goal: forall (x y : Carrier fraction_set) (_ : @Equal fraction_set x y), @Equal fraction_set (opfraction_fun x) (opfraction_fun y) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (addfraction_fun x (opfraction_fun x)) fraction0 *) (* Goal: forall x y : Carrier fraction_set, @Equal fraction_set (addfraction_fun x y) (addfraction_fun y x) *) (* Goal: forall (x x' y y' : Carrier fraction_set) (_ : @Equal fraction_set x x') (_ : @Equal fraction_set y y'), @Equal fraction_set (multfraction_fun x y) (multfraction_fun x' y') *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (multfraction_fun x y) z) (multfraction_fun x (multfraction_fun y z)) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (multfraction_fun x fraction1) x *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (multfraction_fun fraction1 x) x *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun x (addfraction_fun y z)) (addfraction_fun (multfraction_fun x y) (multfraction_fun x z)) *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (addfraction_fun x y) z) (addfraction_fun (multfraction_fun x z) (multfraction_fun y z)) *) apply RING_comp. apply Trans with (sgroup_law R (sgroup_law R (ring_mult (ring_mult (num x) (den y)) (den z)) (ring_mult (ring_mult (num y) (den x)) (den z))) (ring_mult (num z) (ring_mult (den x) (den y)))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult (ring_mult (num x) (den y)) (den z)) (sgroup_law R (ring_mult (ring_mult (num y) (den x)) (den z)) (ring_mult (num z) (ring_mult (den x) (den y))))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x)) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y)))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den z)) (den x)) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den y)) (den x))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den z)) (den x)) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den y)) (den x))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den y))) (den x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y)) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y)) (den z)) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (addfraction_fun x fraction0) x *) (* Goal: forall (x y : Carrier fraction_set) (_ : @Equal fraction_set x y), @Equal fraction_set (opfraction_fun x) (opfraction_fun y) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (addfraction_fun x (opfraction_fun x)) fraction0 *) (* Goal: forall x y : Carrier fraction_set, @Equal fraction_set (addfraction_fun x y) (addfraction_fun y x) *) (* Goal: forall (x x' y y' : Carrier fraction_set) (_ : @Equal fraction_set x x') (_ : @Equal fraction_set y y'), @Equal fraction_set (multfraction_fun x y) (multfraction_fun x' y') *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (multfraction_fun x y) z) (multfraction_fun x (multfraction_fun y z)) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (multfraction_fun x fraction1) x *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (multfraction_fun fraction1 x) x *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun x (addfraction_fun y z)) (addfraction_fun (multfraction_fun x y) (multfraction_fun x z)) *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (addfraction_fun x y) z) (addfraction_fun (multfraction_fun x z) (multfraction_fun y z)) *) apply SGROUP_comp. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. apply Trans with (sgroup_law R (ring_mult (ring_mult (num y) (den z)) (den x)) (ring_mult (ring_mult (num z) (den y)) (den x))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x)) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y)))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den z)) (den x)) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den y)) (den x))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den z)) (den x)) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den y)) (den x))) (@ring_mult (cring_ring (idomain_ring R)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (num z) (den y))) (den x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y)) (den z)) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y)) (den z)) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (addfraction_fun x fraction0) x *) (* Goal: forall (x y : Carrier fraction_set) (_ : @Equal fraction_set x y), @Equal fraction_set (opfraction_fun x) (opfraction_fun y) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (addfraction_fun x (opfraction_fun x)) fraction0 *) (* Goal: forall x y : Carrier fraction_set, @Equal fraction_set (addfraction_fun x y) (addfraction_fun y x) *) (* Goal: forall (x x' y y' : Carrier fraction_set) (_ : @Equal fraction_set x x') (_ : @Equal fraction_set y y'), @Equal fraction_set (multfraction_fun x y) (multfraction_fun x' y') *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (multfraction_fun x y) z) (multfraction_fun x (multfraction_fun y z)) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (multfraction_fun x fraction1) x *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (multfraction_fun fraction1 x) x *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun x (addfraction_fun y z)) (addfraction_fun (multfraction_fun x y) (multfraction_fun x z)) *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (addfraction_fun x y) z) (addfraction_fun (multfraction_fun x z) (multfraction_fun y z)) *) apply SGROUP_comp. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. apply Trans with (ring_mult (num z) (ring_mult (den y) (den x))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) simpl in |- *. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) unfold addfraction_fun, eqfraction in |- *; simpl in |- *. (* Goal: forall (x : fraction) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (ring_unit (cring_ring (idomain_ring R)))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den x)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x) (num match zero_dec (num x) with | left e => x | right n => Build_fraction (den x) (num x) n end)) (ring_unit (cring_ring (idomain_ring R)))) (@ring_mult (cring_ring (idomain_ring R)) (ring_unit (cring_ring (idomain_ring R))) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den match zero_dec (num x) with | left e => x | right n => Build_fraction (den x) (num x) n end))) *) intros x; try assumption. apply Trans with (ring_mult (sgroup_law R (num x) (monoid_unit R)) (den x)); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) simpl in |- *. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) unfold opfraction_fun, eqfraction in |- *; simpl in |- *. (* Goal: forall (x y : fraction) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) (num x)) (den y)) (@ring_mult (cring_ring (idomain_ring R)) (group_inverse (abelian_group_group (ring_group (cring_ring (idomain_ring R)))) (num y)) (den x)) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (addfraction_fun x (opfraction_fun x)) fraction0 *) (* Goal: forall x y : Carrier fraction_set, @Equal fraction_set (addfraction_fun x y) (addfraction_fun y x) *) (* Goal: forall (x x' y y' : Carrier fraction_set) (_ : @Equal fraction_set x x') (_ : @Equal fraction_set y y'), @Equal fraction_set (multfraction_fun x y) (multfraction_fun x' y') *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (multfraction_fun x y) z) (multfraction_fun x (multfraction_fun y z)) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (multfraction_fun x fraction1) x *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (multfraction_fun fraction1 x) x *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun x (addfraction_fun y z)) (addfraction_fun (multfraction_fun x y) (multfraction_fun x z)) *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (addfraction_fun x y) z) (addfraction_fun (multfraction_fun x z) (multfraction_fun y z)) *) intros x y H'; try assumption. apply Trans with (group_inverse R (ring_mult (num x) (den y))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. apply Trans with (group_inverse R (ring_mult (num y) (den x))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) simpl in |- *. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) unfold addfraction_fun, opfraction_fun, eqfraction in |- *; simpl in |- *. (* Goal: forall (x : fraction) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (ring_unit (cring_ring (idomain_ring R)))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den x)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x) (num match zero_dec (num x) with | left e => x | right n => Build_fraction (den x) (num x) n end)) (ring_unit (cring_ring (idomain_ring R)))) (@ring_mult (cring_ring (idomain_ring R)) (ring_unit (cring_ring (idomain_ring R))) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den match zero_dec (num x) with | left e => x | right n => Build_fraction (den x) (num x) n end))) *) intros x; try assumption. apply Trans with (sgroup_law R (ring_mult (num x) (den x)) (ring_mult (group_inverse R (num x)) (den x))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. apply Trans with (ring_mult (sgroup_law R (num x) (group_inverse R (num x))) (den x)); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (ring_mult (monoid_unit R) (den x)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (monoid_unit R); auto with algebra. (* Goal: forall x y : Carrier fraction_set, @Equal fraction_set (addfraction_fun x y) (addfraction_fun y x) *) (* Goal: forall (x x' y y' : Carrier fraction_set) (_ : @Equal fraction_set x x') (_ : @Equal fraction_set y y'), @Equal fraction_set (multfraction_fun x y) (multfraction_fun x' y') *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (multfraction_fun x y) z) (multfraction_fun x (multfraction_fun y z)) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (multfraction_fun x fraction1) x *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (multfraction_fun fraction1 x) x *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun x (addfraction_fun y z)) (addfraction_fun (multfraction_fun x y) (multfraction_fun x z)) *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (addfraction_fun x y) z) (addfraction_fun (multfraction_fun x z) (multfraction_fun y z)) *) exact addfraction_fun_com. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) simpl in |- *. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) unfold multfraction_fun, eqfraction in |- *; simpl in |- *. (* Goal: forall (x x' y y' : fraction) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (den x')) (@ring_mult (cring_ring (idomain_ring R)) (num x') (den x))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den y')) (@ring_mult (cring_ring (idomain_ring R)) (num y') (den y))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x) (num y)) (@ring_mult (cring_ring (idomain_ring R)) (den x') (den y'))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x') (num y')) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y))) *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (multfraction_fun x y) z) (multfraction_fun x (multfraction_fun y z)) *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (multfraction_fun x fraction1) x *) (* Goal: forall x : Carrier fraction_set, @Equal fraction_set (multfraction_fun fraction1 x) x *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun x (addfraction_fun y z)) (addfraction_fun (multfraction_fun x y) (multfraction_fun x z)) *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (addfraction_fun x y) z) (addfraction_fun (multfraction_fun x z) (multfraction_fun y z)) *) intros x x' y y' H' H'0; try assumption. apply Trans with (ring_mult (ring_mult (num x) (den x')) (ring_mult (num y) (den y'))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. apply Trans with (ring_mult (ring_mult (num x') (den x)) (ring_mult (num y') (den y))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) simpl in |- *. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) unfold multfraction_fun, eqfraction in |- *; simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) simpl in |- *. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) unfold multfraction_fun, eqfraction in |- *; simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: forall (x : fraction) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (ring_unit (cring_ring (idomain_ring R)))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den x)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x) (num match zero_dec (num x) with | left e => x | right n => Build_fraction (den x) (num x) n end)) (ring_unit (cring_ring (idomain_ring R)))) (@ring_mult (cring_ring (idomain_ring R)) (ring_unit (cring_ring (idomain_ring R))) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den match zero_dec (num x) with | left e => x | right n => Build_fraction (den x) (num x) n end))) *) intros x; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (multfraction_fun x fraction1); auto with algebra. (* Goal: @Equal fraction_set (multfraction_fun z y) (multfraction_fun y z) *) apply multfraction_com. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) unfold multfraction_fun, eqfraction in |- *; simpl in |- *. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) unfold multfraction_fun, eqfraction in |- *; simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun x (addfraction_fun y z)) (addfraction_fun (multfraction_fun x y) (multfraction_fun x z)) *) (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (addfraction_fun x y) z) (addfraction_fun (multfraction_fun x z) (multfraction_fun y z)) *) exact multfraction_dist_l. (* Goal: forall x y z : Carrier fraction_set, @Equal fraction_set (multfraction_fun (addfraction_fun x y) z) (addfraction_fun (multfraction_fun x z) (multfraction_fun y z)) *) intros x y z; try assumption. apply Trans with (multfraction_fun z (addfraction_fun x y)); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal fraction_set (multfraction_fun z y) (multfraction_fun y z) *) apply multfraction_com. apply Trans with (addfraction_fun (multfraction_fun z x) (multfraction_fun z y)); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal fraction_set (multfraction_fun z (addfraction_fun x y)) (addfraction_fun (multfraction_fun z x) (multfraction_fun z y)) *) (* Goal: @Equal fraction_set (addfraction_fun (multfraction_fun z x) (multfraction_fun z y)) (addfraction_fun (multfraction_fun x z) (multfraction_fun y z)) *) apply multfraction_dist_l. (* Goal: @Equal fraction_set (addfraction_fun (multfraction_fun z x) (multfraction_fun z y)) (addfraction_fun (multfraction_fun x z) (multfraction_fun y z)) *) apply addfraction_law. (* Goal: @Equal fraction_set (multfraction_fun z y) (multfraction_fun y z) *) apply multfraction_com. (* Goal: @Equal fraction_set (multfraction_fun z y) (multfraction_fun y z) *) apply multfraction_com. Defined. Definition fract_field_ring : CRING. (* Goal: Ob CRING *) apply (Build_cring (cring_ring:=fract_field_ring_aux)). (* Goal: cring_on fract_field_ring_aux *) apply (Build_cring_on (R:=fract_field_ring_aux)). (* Goal: @commutative (sgroup_set (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group fract_field_ring_aux))))) (@ring_mult_sgroup (ring_group fract_field_ring_aux) (ring_on_def fract_field_ring_aux))) (@ring_mult_monoid (ring_group fract_field_ring_aux) (ring_on_def fract_field_ring_aux))))) (@sgroup_law_map (sgroup_set (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group fract_field_ring_aux))))) (@ring_mult_sgroup (ring_group fract_field_ring_aux) (ring_on_def fract_field_ring_aux))) (@ring_mult_monoid (ring_group fract_field_ring_aux) (ring_on_def fract_field_ring_aux))))) (sgroup_on_def (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group fract_field_ring_aux))))) (@ring_mult_sgroup (ring_group fract_field_ring_aux) (ring_on_def fract_field_ring_aux))) (@ring_mult_monoid (ring_group fract_field_ring_aux) (ring_on_def fract_field_ring_aux)))))) *) exact multfraction_com. Defined. Variable zero_dec : forall x : R, {Equal x (monoid_unit R)} + {~ Equal x (monoid_unit R)}. Definition invfraction_fun : fract_field_ring -> fract_field_ring := fun x : fraction_set => match zero_dec (num x) with | left _ => x | right n => Build_fraction (den x) (num x) n end. Definition invfraction : MAP fract_field_ring fract_field_ring. apply (Build_Map (A:=fract_field_ring) (B:=fract_field_ring) (Ap:=invfraction_fun)). (* Goal: @fun_compatible (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) invfraction_fun *) red in |- *. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) simpl in |- *. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) unfold invfraction_fun, eqfraction in |- *; simpl in |- *. (* Goal: forall (x y : fraction) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num match zero_dec (num x) with | left e => x | right n => Build_fraction (den x) (num x) n end) (den match zero_dec (num y) with | left e => y | right n => Build_fraction (den y) (num y) n end)) (@ring_mult (cring_ring (idomain_ring R)) (num match zero_dec (num y) with | left e => y | right n => Build_fraction (den y) (num y) n end) (den match zero_dec (num x) with | left e => x | right n => Build_fraction (den x) (num x) n end)) *) intros x y; try assumption. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (den x)), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num match zero_dec (num x) with | left e => x | right n => Build_fraction (den x) (num x) n end) (den match zero_dec (num y) with | left e => y | right n => Build_fraction (den y) (num y) n end)) (@ring_mult (cring_ring (idomain_ring R)) (num match zero_dec (num y) with | left e => y | right n => Build_fraction (den y) (num y) n end) (den match zero_dec (num x) with | left e => x | right n => Build_fraction (den x) (num x) n end)) *) case (zero_dec (num x)); intros. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den match zero_dec (num y) with | left e => y | right n => Build_fraction (den y) (num y) n end)) (@ring_mult (cring_ring (idomain_ring R)) (num match zero_dec (num y) with | left e => y | right n => Build_fraction (den y) (num y) n end) (den (Build_fraction (den x) (num x) n))) *) case (zero_dec (num y)); intros. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (num y)) (@ring_mult (cring_ring (idomain_ring R)) (den y) (den x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den match zero_dec (num y) with | left e => y | right n => Build_fraction (den y) (num y) n end)) (@ring_mult (cring_ring (idomain_ring R)) (num match zero_dec (num y) with | left e => y | right n => Build_fraction (den y) (num y) n end) (den (Build_fraction (den x) (num x) n))) *) cut (Equal (den x) (monoid_unit R)). (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (ring_unit (cring_ring (idomain_ring R))) (ring_unit (cring_ring (idomain_ring R)))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (ring_unit (cring_ring (idomain_ring R)))), False *) intros H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (num y)) (@ring_mult (cring_ring (idomain_ring R)) (den y) (den x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den match zero_dec (num y) with | left e => y | right n => Build_fraction (den y) (num y) n end)) (@ring_mult (cring_ring (idomain_ring R)) (num match zero_dec (num y) with | left e => y | right n => Build_fraction (den y) (num y) n end) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (ring_mult (monoid_unit R) (num y)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (monoid_unit R); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (ring_mult (den y) (monoid_unit R)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply INTEGRAL_DOMAIN_mult_n0_l with (num y); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (ring_mult (num x) (den y)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (ring_mult (monoid_unit R) (den y)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den match zero_dec (num y) with | left e => y | right n => Build_fraction (den y) (num y) n end)) (@ring_mult (cring_ring (idomain_ring R)) (num match zero_dec (num y) with | left e => y | right n => Build_fraction (den y) (num y) n end) (den (Build_fraction (den x) (num x) n))) *) case (zero_dec (num y)); intros. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) cut (Equal (den y) (monoid_unit R)). (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (ring_unit (cring_ring (idomain_ring R))) (ring_unit (cring_ring (idomain_ring R)))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (ring_unit (cring_ring (idomain_ring R)))), False *) intros H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den y)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (ring_mult (monoid_unit R) (num x)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (monoid_unit R); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (ring_mult (den x) (monoid_unit R)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply INTEGRAL_DOMAIN_mult_n0_l with (num x); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (ring_mult (num y) (den x)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (ring_mult (monoid_unit R) (den x)); auto with algebra. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (ring_mult (num y) (den x)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (ring_mult (num x) (den y)); auto with algebra. Defined. Let ff_inr_r : forall x : fract_field_ring, ~ Equal x (monoid_unit fract_field_ring) -> Equal (ring_mult x (Ap invfraction x)) (ring_unit fract_field_ring). (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) simpl in |- *. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) unfold invfraction_fun, eqfraction in |- *; simpl in |- *. (* Goal: forall (x : fraction) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (ring_unit (cring_ring (idomain_ring R)))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den x)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x) (num match zero_dec (num x) with | left e => x | right n => Build_fraction (den x) (num x) n end)) (ring_unit (cring_ring (idomain_ring R)))) (@ring_mult (cring_ring (idomain_ring R)) (ring_unit (cring_ring (idomain_ring R))) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den match zero_dec (num x) with | left e => x | right n => Build_fraction (den x) (num x) n end))) *) intros x; try assumption. (* Goal: forall _ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num x) (ring_unit (cring_ring (idomain_ring R)))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den x))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x) (num match zero_dec (num x) with | left e => x | right n => Build_fraction (den x) (num x) n end)) (ring_unit (cring_ring (idomain_ring R)))) (@ring_mult (cring_ring (idomain_ring R)) (ring_unit (cring_ring (idomain_ring R))) (@ring_mult (cring_ring (idomain_ring R)) (den x) (den match zero_dec (num x) with | left e => x | right n => Build_fraction (den x) (num x) n end))) *) case (zero_dec (num x)); simpl in |- *; intros. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) absurd (Equal (num x) (monoid_unit R)); auto with algebra. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x) (den x)) (ring_unit (cring_ring (idomain_ring R)))) (@ring_mult (cring_ring (idomain_ring R)) (ring_unit (cring_ring (idomain_ring R))) (@ring_mult (cring_ring (idomain_ring R)) (den x) (num x))) *) intuition. (* Goal: False *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@ring_mult (cring_ring (idomain_ring R)) (num x) (den x)) (ring_unit (cring_ring (idomain_ring R)))) (@ring_mult (cring_ring (idomain_ring R)) (ring_unit (cring_ring (idomain_ring R))) (@ring_mult (cring_ring (idomain_ring R)) (den x) (num x))) *) apply H. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (num x); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (monoid_unit R); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (ring_mult (num x) (den x)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (ring_mult (den x) (num x)); auto with algebra. Qed. Hint Resolve ff_inr_r: algebra. Let ff_field_on : field_on fract_field_ring. (* Goal: field_on (cring_ring fract_field_ring) *) apply (Build_field_on (R:=fract_field_ring) (field_inverse_map:=invfraction)). (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (@ring_mult (cring_ring fract_field_ring) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) invfraction x)) (ring_unit (cring_ring fract_field_ring)) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (@ring_mult (cring_ring fract_field_ring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) invfraction x) x) (ring_unit (cring_ring fract_field_ring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) exact ff_inr_r. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (@ring_mult (cring_ring fract_field_ring) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) invfraction x) x) (ring_unit (cring_ring fract_field_ring)) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) intros x H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (ring_mult x (Ap invfraction x)); auto with algebra. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring)))))) (ring_unit (cring_ring fract_field_ring)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring fract_field_ring))))))) *) simpl in |- *. (* Goal: not (eqfraction (ring_unit fract_field_ring_aux) fraction0) *) unfold eqfraction in |- *; simpl in |- *. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (ring_unit (cring_ring (idomain_ring R))) (ring_unit (cring_ring (idomain_ring R)))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (ring_unit (cring_ring (idomain_ring R))))) *) unfold not in |- *. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (ring_unit (cring_ring (idomain_ring R))) (ring_unit (cring_ring (idomain_ring R)))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (ring_unit (cring_ring (idomain_ring R)))), False *) intros H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) absurd (Equal (ring_unit R:R) (monoid_unit R)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (ring_mult (ring_unit R) (ring_unit R)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (num x)) (@ring_mult (cring_ring (idomain_ring R)) (num y) (num x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (den y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring R))))))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den x) (num x) n)) (den (Build_fraction (den y) (num y) n0))) (@ring_mult (cring_ring (idomain_ring R)) (num (Build_fraction (den y) (num y) n0)) (den (Build_fraction (den x) (num x) n))) *) apply Trans with (ring_mult (monoid_unit R) (ring_unit R)); auto with algebra. Defined. Definition fraction_cfield := Build_cfield ff_field_on. End Def.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Cartesian. (** Title "Categories." *) Comments "Some basic category theory.". Section Category_def. Section Category_def1. Variable Ob : Type. Variable Hom : Ob -> Ob -> Setoid. Variable Hom_comp : forall a b c : Ob, MAP (cart (Hom b c) (Hom a b)) (Hom a c). Variable Hom_id : forall a : Ob, Hom a a. Definition Hom_comp_assoc := forall (a b c d : Ob) (f : Hom a b) (g : Hom b c) (h : Hom c d), Equal (Hom_comp a b d (couple (Hom_comp b c d (couple h g)) f)) (Hom_comp a c d (couple h (Hom_comp a b c (couple g f)))). Definition Hom_comp_unit_l := forall (a b : Ob) (f : Hom a b), Equal (Hom_comp a b b (couple (Hom_id b) f)) f. Definition Hom_comp_unit_r := forall (a b : Ob) (f : Hom a b), Equal (Hom_comp a a b (couple f (Hom_id a))) f. End Category_def1. Record category : Type := {Ob :> Type; Hom : Ob -> Ob -> Setoid; Hom_comp : forall a b c : Ob, MAP (cart (Hom b c) (Hom a b)) (Hom a c); Hom_id : forall a : Ob, Hom a a; Hom_comp_assoc_prf : Hom_comp_assoc Hom_comp; Hom_comp_unit_l_prf : Hom_comp_unit_l Hom_comp Hom_id; Hom_comp_unit_r_prf : Hom_comp_unit_r Hom_comp Hom_id}. Section Category_comp. Variable C : category. Definition comp_hom (a b c : C) (g : Hom b c) (f : Hom a b) := Hom_comp a b c (couple g f). Lemma comp_hom_compatible : forall (a b c : C) (x x' : Hom b c) (y y' : Hom a b), Equal x x' -> Equal y y' -> Equal (comp_hom x y) (comp_hom x' y'). (* Goal: forall (a b c : Ob C) (x x' : Carrier (@Hom C b c)) (y y' : Carrier (@Hom C a b)) (_ : @Equal (@Hom C b c) x x') (_ : @Equal (@Hom C a b) y y'), @Equal (@Hom C a c) (@comp_hom a b c x y) (@comp_hom a b c x' y') *) intros a b c x x' y y' H' H'0; try assumption. (* Goal: @Equal (@Hom C a c) (@comp_hom a b c x y) (@comp_hom a b c x' y') *) unfold comp_hom in |- *; auto with algebra. Qed. Lemma comp_hom_assoc : forall (a b c d : C) (f : Hom a b) (g : Hom b c) (h : Hom c d), Equal (comp_hom (comp_hom h g) f) (comp_hom h (comp_hom g f)). (* Goal: forall (a b c d : Ob C) (f : Carrier (@Hom C a b)) (g : Carrier (@Hom C b c)) (h : Carrier (@Hom C c d)), @Equal (@Hom C a d) (@comp_hom a b d (@comp_hom b c d h g) f) (@comp_hom a c d h (@comp_hom a b c g f)) *) exact (Hom_comp_assoc_prf (c:=C)). Qed. Lemma comp_hom_unit_l : forall (a b : C) (f : Hom a b), Equal (comp_hom (Hom_id b) f) f. (* Goal: forall (a b : Ob C) (f : Carrier (@Hom C a b)), @Equal (@Hom C a b) (@comp_hom a b b (@Hom_id C b) f) f *) exact (Hom_comp_unit_l_prf (c:=C)). Qed. Lemma comp_hom_unit_r : forall (a b : C) (f : Hom a b), Equal (comp_hom f (Hom_id a)) f. (* Goal: forall (a b : Ob C) (f : Carrier (@Hom C a b)), @Equal (@Hom C a b) (@comp_hom a a b f (@Hom_id C a)) f *) exact (Hom_comp_unit_r_prf (c:=C)). Qed. End Category_comp. Hint Resolve comp_hom_compatible comp_hom_assoc comp_hom_unit_l comp_hom_unit_r: algebra. Section Full_subcat_def. Variable C : category. Variable C' : Type. Variable i : C' -> C. Definition fsubcat_Hom (a b : C') := Hom (i a) (i b). Definition fsubcat_Hom_comp : forall a b c : C', MAP (cart (fsubcat_Hom b c) (fsubcat_Hom a b)) (fsubcat_Hom a c). (* Goal: forall a b c : C', Carrier (MAP (cart (fsubcat_Hom b c) (fsubcat_Hom a b)) (fsubcat_Hom a c)) *) intros a b c; try assumption. (* Goal: Carrier (MAP (cart (fsubcat_Hom b c) (fsubcat_Hom a b)) (fsubcat_Hom a c)) *) exact (Hom_comp (i a) (i b) (i c)). Defined. Definition fsubcat_Hom_id (a : C') := Hom_id (i a). Definition full_subcat : category. apply (Build_category (Ob:=C') (Hom:=fsubcat_Hom) (Hom_comp:=fsubcat_Hom_comp) (Hom_id:=fsubcat_Hom_id)). (* Goal: @Hom_comp_unit_r C' fsubcat_Hom fsubcat_Hom_comp fsubcat_Hom_id *) red in |- *. (* Goal: forall (a b c d : C') (f : Carrier (fsubcat_Hom a b)) (g : Carrier (fsubcat_Hom b c)) (h : Carrier (fsubcat_Hom c d)), @Equal (fsubcat_Hom a d) (@Ap (cart (fsubcat_Hom b d) (fsubcat_Hom a b)) (fsubcat_Hom a d) (fsubcat_Hom_comp a b d) (@couple (fsubcat_Hom b d) (fsubcat_Hom a b) (@Ap (cart (fsubcat_Hom c d) (fsubcat_Hom b c)) (fsubcat_Hom b d) (fsubcat_Hom_comp b c d) (@couple (fsubcat_Hom c d) (fsubcat_Hom b c) h g)) f)) (@Ap (cart (fsubcat_Hom c d) (fsubcat_Hom a c)) (fsubcat_Hom a d) (fsubcat_Hom_comp a c d) (@couple (fsubcat_Hom c d) (fsubcat_Hom a c) h (@Ap (cart (fsubcat_Hom b c) (fsubcat_Hom a b)) (fsubcat_Hom a c) (fsubcat_Hom_comp a b c) (@couple (fsubcat_Hom b c) (fsubcat_Hom a b) g f)))) *) (* Goal: @Hom_comp_unit_l C' fsubcat_Hom fsubcat_Hom_comp fsubcat_Hom_id *) (* Goal: @Hom_comp_unit_r C' fsubcat_Hom fsubcat_Hom_comp fsubcat_Hom_id *) unfold fsubcat_Hom, fsubcat_Hom_comp in |- *; simpl in |- *. (* Goal: forall (a b c d : C') (f : Carrier (@Hom C (i a) (i b))) (g : Carrier (@Hom C (i b) (i c))) (h : Carrier (@Hom C (i c) (i d))), @Equal (@Hom C (i a) (i d)) (@Ap (cart (@Hom C (i b) (i d)) (@Hom C (i a) (i b))) (@Hom C (i a) (i d)) (@Hom_comp C (i a) (i b) (i d)) (@couple (@Hom C (i b) (i d)) (@Hom C (i a) (i b)) (@Ap (cart (@Hom C (i c) (i d)) (@Hom C (i b) (i c))) (@Hom C (i b) (i d)) (@Hom_comp C (i b) (i c) (i d)) (@couple (@Hom C (i c) (i d)) (@Hom C (i b) (i c)) h g)) f)) (@Ap (cart (@Hom C (i c) (i d)) (@Hom C (i a) (i c))) (@Hom C (i a) (i d)) (@Hom_comp C (i a) (i c) (i d)) (@couple (@Hom C (i c) (i d)) (@Hom C (i a) (i c)) h (@Ap (cart (@Hom C (i b) (i c)) (@Hom C (i a) (i b))) (@Hom C (i a) (i c)) (@Hom_comp C (i a) (i b) (i c)) (@couple (@Hom C (i b) (i c)) (@Hom C (i a) (i b)) g f)))) *) (* Goal: @Hom_comp_unit_l C' fsubcat_Hom fsubcat_Hom_comp fsubcat_Hom_id *) (* Goal: @Hom_comp_unit_r C' fsubcat_Hom fsubcat_Hom_comp fsubcat_Hom_id *) intros a b c d f g h; try assumption. (* Goal: @Equal (@Hom C (i a) (i d)) (@Ap (cart (@Hom C (i b) (i d)) (@Hom C (i a) (i b))) (@Hom C (i a) (i d)) (@Hom_comp C (i a) (i b) (i d)) (@couple (@Hom C (i b) (i d)) (@Hom C (i a) (i b)) (@Ap (cart (@Hom C (i c) (i d)) (@Hom C (i b) (i c))) (@Hom C (i b) (i d)) (@Hom_comp C (i b) (i c) (i d)) (@couple (@Hom C (i c) (i d)) (@Hom C (i b) (i c)) h g)) f)) (@Ap (cart (@Hom C (i c) (i d)) (@Hom C (i a) (i c))) (@Hom C (i a) (i d)) (@Hom_comp C (i a) (i c) (i d)) (@couple (@Hom C (i c) (i d)) (@Hom C (i a) (i c)) h (@Ap (cart (@Hom C (i b) (i c)) (@Hom C (i a) (i b))) (@Hom C (i a) (i c)) (@Hom_comp C (i a) (i b) (i c)) (@couple (@Hom C (i b) (i c)) (@Hom C (i a) (i b)) g f)))) *) (* Goal: @Hom_comp_unit_l C' fsubcat_Hom fsubcat_Hom_comp fsubcat_Hom_id *) (* Goal: @Hom_comp_unit_r C' fsubcat_Hom fsubcat_Hom_comp fsubcat_Hom_id *) apply (Hom_comp_assoc_prf (c:=C)). (* Goal: @Hom_comp_unit_r C' fsubcat_Hom fsubcat_Hom_comp fsubcat_Hom_id *) red in |- *. (* Goal: forall (a b : C') (f : Carrier (fsubcat_Hom a b)), @Equal (fsubcat_Hom a b) (@Ap (cart (fsubcat_Hom a b) (fsubcat_Hom a a)) (fsubcat_Hom a b) (fsubcat_Hom_comp a a b) (@couple (fsubcat_Hom a b) (fsubcat_Hom a a) f (fsubcat_Hom_id a))) f *) unfold fsubcat_Hom, fsubcat_Hom_comp, fsubcat_Hom_id in |- *; simpl in |- *. (* Goal: forall (a b : C') (f : Carrier (@Hom C (i a) (i b))), @Equal (@Hom C (i a) (i b)) (@Ap (cart (@Hom C (i a) (i b)) (@Hom C (i a) (i a))) (@Hom C (i a) (i b)) (@Hom_comp C (i a) (i a) (i b)) (@couple (@Hom C (i a) (i b)) (@Hom C (i a) (i a)) f (@Hom_id C (i a)))) f *) intros a b f; try assumption. (* Goal: @Equal (@Hom C (i a) (i b)) (@Ap (cart (@Hom C (i b) (i b)) (@Hom C (i a) (i b))) (@Hom C (i a) (i b)) (@Hom_comp C (i a) (i b) (i b)) (@couple (@Hom C (i b) (i b)) (@Hom C (i a) (i b)) (@Hom_id C (i b)) f)) f *) (* Goal: @Hom_comp_unit_r C' fsubcat_Hom fsubcat_Hom_comp fsubcat_Hom_id *) apply (Hom_comp_unit_l_prf (c:=C)). (* Goal: @Hom_comp_unit_r C' fsubcat_Hom fsubcat_Hom_comp fsubcat_Hom_id *) red in |- *. (* Goal: forall (a b : C') (f : Carrier (fsubcat_Hom a b)), @Equal (fsubcat_Hom a b) (@Ap (cart (fsubcat_Hom a b) (fsubcat_Hom a a)) (fsubcat_Hom a b) (fsubcat_Hom_comp a a b) (@couple (fsubcat_Hom a b) (fsubcat_Hom a a) f (fsubcat_Hom_id a))) f *) unfold fsubcat_Hom, fsubcat_Hom_comp, fsubcat_Hom_id in |- *; simpl in |- *. (* Goal: forall (a b : C') (f : Carrier (@Hom C (i a) (i b))), @Equal (@Hom C (i a) (i b)) (@Ap (cart (@Hom C (i a) (i b)) (@Hom C (i a) (i a))) (@Hom C (i a) (i b)) (@Hom_comp C (i a) (i a) (i b)) (@couple (@Hom C (i a) (i b)) (@Hom C (i a) (i a)) f (@Hom_id C (i a)))) f *) intros a b f; try assumption. (* Goal: @Equal (@Hom C (i a) (i b)) (@Ap (cart (@Hom C (i a) (i b)) (@Hom C (i a) (i a))) (@Hom C (i a) (i b)) (@Hom_comp C (i a) (i a) (i b)) (@couple (@Hom C (i a) (i b)) (@Hom C (i a) (i a)) f (@Hom_id C (i a)))) f *) apply (Hom_comp_unit_r_prf (c:=C)). Defined. End Full_subcat_def. End Category_def. Hint Resolve comp_hom_compatible comp_hom_assoc comp_hom_unit_l comp_hom_unit_r: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Group_util. Require Export Group_quotient. Require Export Parts2. (** Title "Kernel and image of a group homomorphism." *) Section Def. Variable G G' : GROUP. Variable f : Hom G G'. Definition kernel_part : part_set G. apply (Build_Predicate (E:=G) (Pred_fun:=fun x : G => Equal (f x) (monoid_unit G'))). (* Goal: @normal G Ker *) red in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G')))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) x (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) y (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) x y) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G')))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) x (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (group_inverse G' x) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) intros x y H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) *) apply Trans with (Ap (sgroup_map (monoid_sgroup_hom f)) x); auto with algebra. Defined. Definition Ker : subgroup G. (* Goal: subgroup G *) apply (BUILD_SUB_GROUP (G:=G) (H:=kernel_part)). (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@subsgroup_part (monoid_sgroup (group_monoid G')) (@submonoid_subsgroup (group_monoid G') (@subgroup_submonoid G' coKer))) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G')))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) x (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) y (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) x y) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G')))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) x (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (group_inverse G' x) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) intros x y H' H'0; try assumption. apply Trans with (sgroup_law _ (Ap (sgroup_map (monoid_sgroup_hom f)) x) (Ap (sgroup_map (monoid_sgroup_hom f)) y)); (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G Ker))) *) auto with algebra. apply Trans with (sgroup_law G' (monoid_unit G') (monoid_unit G')); (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G Ker))) *) auto with algebra. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@subsgroup_part (monoid_sgroup (group_monoid G')) (@submonoid_subsgroup (group_monoid G') (@subgroup_submonoid G' coKer))) *) simpl in |- *. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G Ker))) *) auto with algebra. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@subsgroup_part (monoid_sgroup (group_monoid G')) (@submonoid_subsgroup (group_monoid G') (@subgroup_submonoid G' coKer))) *) simpl in |- *. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G')))) (_ : @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G'))) x (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0)))), @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (group_inverse G' x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0))) *) intros x H'; try assumption. apply Trans with (group_inverse _ (Ap (sgroup_map (monoid_sgroup_hom f)) x)); (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G Ker))) *) auto with algebra. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G Ker))) *) apply Trans with (group_inverse _ (monoid_unit G')); auto with algebra. Defined. Definition coKer : subgroup G'. (* Goal: subgroup G' *) apply (BUILD_SUB_GROUP (G:=G') (H:=image f (full G))). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G')))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) x (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) y (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) x y) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G')))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) x (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (group_inverse G' x) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) intros x y H' H'0; try assumption. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) x y) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G')))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) x (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (group_inverse G' x) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) elim H'0; intros x0 E; elim E; intros H'1 H'2; try exact H'2; clear E H'0. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) x y) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G')))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) x (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (group_inverse G' x) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) elim H'; intros x1 E; elim E; intros H'0 H'3; try exact H'3; clear E H'. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) x y) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G')))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) x (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (group_inverse G' x) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) exists (sgroup_law _ x1 x0); split; [ try assumption | idtac ]. apply Trans with (sgroup_law G' (Ap (sgroup_map (monoid_sgroup_hom f)) x1) (Ap (sgroup_map (monoid_sgroup_hom f)) x0)); (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G Ker))) *) auto with algebra. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@subsgroup_part (monoid_sgroup (group_monoid G')) (@submonoid_subsgroup (group_monoid G') (@subgroup_submonoid G' coKer))) *) simpl in |- *. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G Ker))) *) exists (monoid_unit G); auto with algebra. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@subsgroup_part (monoid_sgroup (group_monoid G')) (@submonoid_subsgroup (group_monoid G') (@subgroup_submonoid G' coKer))) *) simpl in |- *. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G')))) (_ : @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G'))) x (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0)))), @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (group_inverse G' x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0))) *) intros x H'; try assumption. (* Goal: @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (group_inverse G' x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0))) *) elim H'; intros x0 E; elim E; intros H'0 H'1; try exact H'1; clear E H'. (* Goal: @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (group_inverse G' x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0))) *) exists (group_inverse _ x0); split; [ try assumption | idtac ]. apply Trans with (group_inverse G' (Ap (sgroup_map (monoid_sgroup_hom f)) x0)); (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G Ker))) *) auto with algebra. Defined. Lemma kernel_normal : normal Ker. (* Goal: @normal G Ker *) red in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@subsgroup_part (monoid_sgroup (group_monoid G')) (@submonoid_subsgroup (group_monoid G') (@subgroup_submonoid G' coKer))) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G x)))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) *) intros x y H'; try assumption. apply Trans with (sgroup_law _ (Ap (sgroup_map (monoid_sgroup_hom f)) x) (Ap (sgroup_map (monoid_sgroup_hom f)) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G Ker))) *) (sgroup_law G y (group_inverse G x)))); auto with algebra. apply Trans with (sgroup_law _ (Ap (sgroup_map (monoid_sgroup_hom f)) x) (sgroup_law _ (Ap (sgroup_map (monoid_sgroup_hom f)) y) (Ap (sgroup_map (monoid_sgroup_hom f)) (group_inverse G x)))); (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G Ker))) *) auto with algebra. apply Trans with (sgroup_law _ (Ap (sgroup_map (monoid_sgroup_hom f)) x) (sgroup_law _ (Ap (sgroup_map (monoid_sgroup_hom f)) y) (group_inverse _ (Ap (sgroup_map (monoid_sgroup_hom f)) x)))); (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G Ker))) *) auto with algebra. apply Trans with (sgroup_law _ (Ap (sgroup_map (monoid_sgroup_hom f)) x) (sgroup_law _ (monoid_unit G') (group_inverse _ (Ap (sgroup_map (monoid_sgroup_hom f)) x)))); (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G Ker))) *) auto with algebra. apply Trans with (sgroup_law _ (Ap (sgroup_map (monoid_sgroup_hom f)) x) (group_inverse _ (Ap (sgroup_map (monoid_sgroup_hom f)) x))); (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G Ker))) *) auto with algebra. Qed. Set Strict Implicit. Unset Implicit Arguments. Definition group_quo_ker := group_quo G Ker kernel_normal. Set Implicit Arguments. Unset Strict Implicit. Lemma Ker_prop : forall x : G, in_part x Ker -> Equal (f x) (monoid_unit G'). (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G Ker))) *) auto with algebra. Qed. Lemma Ker_prop_rev : forall x : G, Equal (f x) (monoid_unit G') -> in_part x Ker. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G Ker))) *) auto with algebra. Qed. Lemma coKer_prop : forall x : G, in_part (f x) coKer. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@subsgroup_part (monoid_sgroup (group_monoid G')) (@submonoid_subsgroup (group_monoid G') (@subgroup_submonoid G' coKer))) *) simpl in |- *. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G Ker))) *) intros x; exists x; split; [ idtac | try assumption ]; auto with algebra. Qed. End Def. Hint Resolve kernel_normal Ker_prop coKer_prop: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Parts2. (** Title "Cantor Bernstein theorem" *) Comments "We prove that if there is an injection from A to B, and an injection from B to A". Comments "then there is a bijection between A and B.". Section Cantor_Bernstein. Variable E F : Setoid. Variable f : MAP E F. Variable g : MAP F E. Hypothesis finj : injective f. Hypothesis ginj : injective g. Let h (X : part_set E) := compl (image g (compl (image f X))). Let h_incr : forall A B : part_set E, included A B -> included (h A) (h B). (* Goal: @Equal (part_set E) (h x) (h y) *) unfold h in |- *. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) auto with algebra. Qed. Hint Resolve h_incr: algebra. Let PX : part_set (part_set E). (* Goal: Carrier (part_set (part_set E)) *) apply (Build_Predicate (Pred_fun:=fun A : part_set E => included A (h A))). (* Goal: @surjective E F b *) red in |- *. (* Goal: forall (x y : Carrier (part_set E)) (_ : @included E x (h x)) (_ : @Equal (part_set E) y x), @included E y (h y) *) intros x y H' H'0; try assumption. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply included_comp with x (h x); auto with algebra. (* Goal: @Equal (part_set E) (h x) (h y) *) unfold h in |- *. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) auto with algebra. Defined. Let X := union_part PX. Let XhX : included X (h X). (* Goal: @included E (h X) X *) unfold X in |- *. (* Goal: @included E (@union_part E PX) (h (@union_part E PX)) *) apply union_part_upper_bound. (* Goal: forall (A : Carrier (part_set E)) (_ : @in_part (part_set E) A PX), @included E A (h (@union_part E PX)) *) intros A H'; try assumption. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply included_trans with (h A); auto with algebra. Qed. Let hXX : included (h X) X. (* Goal: @included E (h X) X *) unfold X in |- *. (* Goal: @included E (h (@union_part E PX)) (@union_part E PX) *) apply union_part_included. (* Goal: @Equal F (@Ap F F (@comp_map_map F E F g1 g) x1) (@Ap F F (@comp_map_map F E F g1 g) x0) *) (* Goal: @in_part E y (@image F E g (@compl F (@image E F f X))) *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @surjective E F b *) simpl in |- *. (* Goal: @included E (h (@union_part E PX)) (h (h (@union_part E PX))) *) apply h_incr. (* Goal: @included E X (h X) *) exact XhX. Qed. Let PXeq : Equal (h X) X. (* Goal: @Equal (part_set E) (h X) X *) apply included_antisym. (* Goal: @included E (h X) X *) (* Goal: @included E X (h X) *) exact hXX. (* Goal: @included E X (h X) *) exact XhX. Qed. Hint Resolve PXeq hXX XhX: algebra. Let img : Equal (image g (compl (image f X))) (compl X). (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply Trans with (compl (h X)); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) unfold h in |- *; auto with algebra. Qed. Hint Resolve img: algebra. Hypothesis partial_section : forall (E F : Setoid) (f : MAP E F), injective f -> exists g : MAP F E, Equal (comp_map_map g f) (Id E). Hypothesis map_extend : forall (E F : Setoid) (f g : MAP E F) (A : part_set E), exists b : MAP E F, (forall x : E, in_part x A -> Equal (b x) (f x)) /\ (forall x : E, ~ in_part x A -> Equal (b x) (g x)). Theorem Cantor_Berstein : exists b : MAP E F, bijective b. (* Goal: @ex (Carrier (MAP E F)) (fun b : Carrier (MAP E F) => @bijective E F b) *) case (partial_section ginj). (* Goal: forall (x : Carrier (MAP E F)) (_ : @Equal (MAP F F) (@comp_map_map F E F x g) (Id F)), @ex (Carrier (MAP E F)) (fun b : Carrier (MAP E F) => @bijective E F b) *) intros g1 H'; try assumption. (* Goal: @ex (Carrier (MAP E F)) (fun b : Carrier (MAP E F) => @bijective E F b) *) case (map_extend f g1 X). (* Goal: forall (x : Carrier (MAP E F)) (_ : and (forall (x0 : Carrier E) (_ : @in_part E x0 X), @Equal F (@Ap E F x x0) (@Ap E F f x0)) (forall (x0 : Carrier E) (_ : not (@in_part E x0 X)), @Equal F (@Ap E F x x0) (@Ap E F g1 x0))), @ex (Carrier (MAP E F)) (fun b : Carrier (MAP E F) => @bijective E F b) *) intros b H'1; try assumption. (* Goal: @ex (Carrier (MAP E F)) (fun b : Carrier (MAP E F) => @bijective E F b) *) exists b; try assumption. (* Goal: @bijective E F b *) elim H'1; intros H'2 H'3; try exact H'2; clear H'1. (* Goal: @surjective E F b *) red in |- *. (* Goal: and (@injective E F b) (@surjective E F b) *) split; [ try assumption | idtac ]. (* Goal: @surjective E F b *) red in |- *. (* Goal: forall (x y : Carrier E) (_ : @Equal F (@Ap E F b x) (@Ap E F b y)), @Equal E x y *) (* Goal: @surjective E F b *) intros x y H'0; try assumption. (* Goal: @Equal E x y *) (* Goal: @surjective E F b *) case (compl_not_compl X x); intros. (* Goal: @Equal E x y *) (* Goal: @surjective E F b *) case (compl_not_compl X y); intros. (* Goal: @Equal E x y *) (* Goal: @Equal E x y *) (* Goal: @Equal E x y *) (* Goal: @surjective E F b *) apply finj. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply Trans with (b y); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply Trans with (b x); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply Sym; auto with algebra. (* Goal: forall _ : @in_part E x (@image F E g (@compl F (@image E F f X))), @Equal E x y *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @surjective E F b *) cut (in_part y (image g (compl (image f X)))). (* Goal: forall _ : @in_part E x (@image F E g (@compl F (@image E F f X))), @Equal E x y *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @Equal E x y *) (* Goal: @surjective E F b *) intros H'1; try assumption. (* Goal: @Equal E x y *) (* Goal: @in_part E y (@image F E g (@compl F (@image E F f X))) *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @surjective E F b *) generalize (image_in H'1). (* Goal: forall _ : @ex (Carrier F) (fun x0 : Carrier F => and (@in_part F x0 (@compl F (@image E F f X))) (@Equal E x (@Ap F E g x0))), @Equal E x y *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @Equal E x y *) (* Goal: @surjective E F b *) intros H'4; try assumption. (* Goal: @Equal E x y *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @Equal E x y *) (* Goal: @surjective E F b *) elim H'4; intros x0 E0; try exact E0; clear H'4. (* Goal: @Equal E x y *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @Equal E x y *) (* Goal: @surjective E F b *) elim E0; intros H'4 H'5; try exact H'5; clear E0. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) absurd (in_part x0 (compl (image f X))); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply not_in_comp_l with (Ap (Id F) x0); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply not_in_comp_l with (Ap (comp_map_map g1 g) x0); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply not_in_comp_l with (Ap g1 (Ap g x0)); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply not_in_comp_l with (Ap g1 y); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply not_in_comp_l with (Ap b y); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply not_in_comp_l with (Ap b x); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply not_in_comp_l with (Ap f x); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply Sym; auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply in_part_comp_r with (compl X); auto with algebra. (* Goal: @Equal E x y *) (* Goal: @surjective E F b *) case (compl_not_compl X y); intros. (* Goal: @Equal E x y *) (* Goal: @surjective E F b *) cut (in_part x (image g (compl (image f X)))). (* Goal: forall _ : @in_part E x (@image F E g (@compl F (@image E F f X))), @Equal E x y *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @Equal E x y *) (* Goal: @surjective E F b *) intros H'1; try assumption. (* Goal: @Equal E x y *) (* Goal: @in_part E y (@image F E g (@compl F (@image E F f X))) *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @surjective E F b *) generalize (image_in H'1). (* Goal: forall _ : @ex (Carrier F) (fun x0 : Carrier F => and (@in_part F x0 (@compl F (@image E F f X))) (@Equal E x (@Ap F E g x0))), @Equal E x y *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @Equal E x y *) (* Goal: @surjective E F b *) intros H'4; try assumption. (* Goal: @Equal E x y *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @Equal E x y *) (* Goal: @surjective E F b *) elim H'4; intros x0 E0; try exact E0; clear H'4. (* Goal: @Equal E x y *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @Equal E x y *) (* Goal: @surjective E F b *) elim E0; intros H'4 H'5; try exact H'5; clear E0. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) absurd (in_part x0 (compl (image f X))); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply not_in_comp_l with (Ap (Id F) x0); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply not_in_comp_l with (Ap (comp_map_map g1 g) x0); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply not_in_comp_l with (Ap g1 (Ap g x0)); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply not_in_comp_l with (Ap g1 x); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply not_in_comp_l with (Ap b x); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply not_in_comp_l with (Ap b y); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply not_in_comp_l with (Ap f y); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply Sym; auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply in_part_comp_r with (compl X); auto with algebra. (* Goal: @Equal E x y *) (* Goal: @surjective E F b *) cut (in_part x (image g (compl (image f X)))). (* Goal: forall _ : @in_part E x (@image F E g (@compl F (@image E F f X))), @Equal E x y *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @surjective E F b *) cut (in_part y (image g (compl (image f X)))). (* Goal: forall (_ : @in_part E y (@image F E g (@compl F (@image E F f X)))) (_ : @in_part E x (@image F E g (@compl F (@image E F f X)))), @Equal E x y *) (* Goal: @in_part E y (@image F E g (@compl F (@image E F f X))) *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @surjective E F b *) intros H'1 H'4; try assumption. (* Goal: @Equal E x y *) (* Goal: @in_part E y (@image F E g (@compl F (@image E F f X))) *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @surjective E F b *) generalize (image_in H'1). (* Goal: forall _ : @ex (Carrier F) (fun x : Carrier F => and (@in_part F x (@compl F (@image E F f X))) (@Equal E y (@Ap F E g x))), @Equal E x y *) (* Goal: @in_part E y (@image F E g (@compl F (@image E F f X))) *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @surjective E F b *) generalize (image_in H'4). (* Goal: forall (_ : @ex (Carrier F) (fun x0 : Carrier F => and (@in_part F x0 (@compl F (@image E F f X))) (@Equal E x (@Ap F E g x0)))) (_ : @ex (Carrier F) (fun x : Carrier F => and (@in_part F x (@compl F (@image E F f X))) (@Equal E y (@Ap F E g x)))), @Equal E x y *) (* Goal: @in_part E y (@image F E g (@compl F (@image E F f X))) *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @surjective E F b *) intros H'5 H'6; try assumption. (* Goal: @Equal E x y *) (* Goal: @in_part E y (@image F E g (@compl F (@image E F f X))) *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @surjective E F b *) elim H'6; intros x0 E0; elim E0; intros H'7 H'8; try exact H'7; clear E0 H'6. (* Goal: @Equal E x y *) (* Goal: @in_part E y (@image F E g (@compl F (@image E F f X))) *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @surjective E F b *) elim H'5; intros x1 E0; elim E0; intros H'6 H'9; try exact H'6; clear E0 H'5. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply Trans with (Ap g x1); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply Trans with (Ap g x0); auto with algebra. (* Goal: @Equal E (@Ap F E g x1) (@Ap F E g x0) *) (* Goal: @in_part E y (@image F E g (@compl F (@image E F f X))) *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @surjective E F b *) cut (Equal x1 x0). (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) auto with algebra. (* Goal: @Equal F x1 x0 *) (* Goal: @in_part E y (@image F E g (@compl F (@image E F f X))) *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @surjective E F b *) cut (Equal (Ap (Id F) x1) (Ap (Id F) x0)). (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) auto with algebra. (* Goal: @Equal F (@Ap F F (Id F) x1) (@Ap F F (Id F) x0) *) (* Goal: @in_part E y (@image F E g (@compl F (@image E F f X))) *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @surjective E F b *) cut (Equal (Ap (comp_map_map g1 g) x1) (Ap (comp_map_map g1 g) x0)). (* Goal: forall _ : @Equal F (@Ap F F (@comp_map_map F E F g1 g) x1) (@Ap F F (@comp_map_map F E F g1 g) x0), @Equal F (@Ap F F (Id F) x1) (@Ap F F (Id F) x0) *) (* Goal: @Equal F (@Ap F F (@comp_map_map F E F g1 g) x1) (@Ap F F (@comp_map_map F E F g1 g) x0) *) (* Goal: @in_part E y (@image F E g (@compl F (@image E F f X))) *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @surjective E F b *) intros H'5; try assumption. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply Trans with (Ap (comp_map_map g1 g) x0); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply Trans with (Ap (comp_map_map g1 g) x1); auto with algebra. (* Goal: @Equal F (@Ap F F (@comp_map_map F E F g1 g) x1) (@Ap F F (@comp_map_map F E F g1 g) x0) *) (* Goal: @in_part E y (@image F E g (@compl F (@image E F f X))) *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @surjective E F b *) simpl in |- *. (* Goal: @Equal F (@comp_map_fun F E F g1 g x1) (@comp_map_fun F E F g1 g x0) *) (* Goal: @in_part E y (@image F E g (@compl F (@image E F f X))) *) (* Goal: @in_part E x (@image F E g (@compl F (@image E F f X))) *) (* Goal: @surjective E F b *) unfold comp_map_fun in |- *. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply Trans with (Ap g1 x); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply Trans with (Ap g1 y); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply Trans with (Ap b x); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply Sym; auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply Trans with (Ap b y); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply in_part_comp_r with (compl X); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply in_part_comp_r with (compl X); auto with algebra. (* Goal: @surjective E F b *) red in |- *. (* Goal: forall y : Carrier F, @ex (Carrier E) (fun x : Carrier E => @Equal F y (@Ap E F b x)) *) intros y; try assumption. (* Goal: @ex (Carrier E) (fun x : Carrier E => @Equal F y (@Ap E F b x)) *) case (compl_not_compl (image f X) y); intros. (* Goal: @ex (Carrier E) (fun x : Carrier E => @Equal F y (@Ap E F b x)) *) (* Goal: @ex (Carrier E) (fun x : Carrier E => @Equal F y (@Ap E F b x)) *) generalize (image_in H). (* Goal: forall _ : @ex (Carrier E) (fun x : Carrier E => and (@in_part E x X) (@Equal F y (@Ap E F f x))), @ex (Carrier E) (fun x : Carrier E => @Equal F y (@Ap E F b x)) *) (* Goal: @ex (Carrier E) (fun x : Carrier E => @Equal F y (@Ap E F b x)) *) intros H'0; try assumption. (* Goal: @ex (Carrier E) (fun x : Carrier E => @Equal F y (@Ap E F b x)) *) (* Goal: @ex (Carrier E) (fun x : Carrier E => @Equal F y (@Ap E F b x)) *) elim H'0; intros x E0; elim E0; intros H'1 H'4; try exact H'1; clear E0 H'0. (* Goal: @ex (Carrier E) (fun x : Carrier E => @Equal F y (@Ap E F b x)) *) (* Goal: @ex (Carrier E) (fun x : Carrier E => @Equal F y (@Ap E F b x)) *) exists x; try assumption. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply Trans with (Ap f x); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply Sym; auto with algebra. (* Goal: @ex (Carrier E) (fun x : Carrier E => @Equal F y (@Ap E F b x)) *) exists (g y); try assumption. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply Trans with (Ap g1 (Ap g y)); auto with algebra. (* Goal: @Equal F (@Ap E F g1 (@Ap F E g y)) (@Ap E F b (@Ap F E g y)) *) apply Sym. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply Trans with (Ap (Id F) y); auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply Trans with (Ap (comp_map_map g1 g) y); auto with algebra. (* Goal: @Equal F (@Ap E F g1 (@Ap F E g y)) (@Ap E F b (@Ap F E g y)) *) apply Sym. (* Goal: @Equal F (@Ap E F b (@Ap F E g y)) (@Ap E F g1 (@Ap F E g y)) *) apply H'3. (* Goal: not (@in_part E (@Ap F E g y) X) *) cut (in_part (Ap g y) (compl X)). (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) auto with algebra. (* Goal: forall _ : @in_part E (@Ap F E g y) (@compl E X), not (@in_part E (@Ap F E g y) X) *) (* Goal: @in_part E (@Ap F E g y) (@compl E X) *) apply in_part_comp_r with (image g (compl (image f X))); auto with algebra. Qed. End Cantor_Bernstein.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Group_util. Section Free_group_def. Variable V : SET. Inductive FG : Type := | Var : V -> FG | Law : FG -> FG -> FG | Unit : FG | Inv : FG -> FG. Inductive eqFG : FG -> FG -> Prop := | eqFG_Var : forall x y : V, Equal x y -> (eqFG (Var x) (Var y):Prop) | eqFG_law : forall x x' y y' : FG, eqFG x x' -> eqFG y y' -> (eqFG (Law x y) (Law x' y'):Prop) | eqFG_law_assoc : forall x y z : FG, eqFG (Law (Law x y) z) (Law x (Law y z)):Prop | eqFG_law0r : forall x : FG, eqFG (Law x Unit) x:Prop | eqFG_inv : forall x y : FG, eqFG x y -> eqFG (Inv x) (Inv y) | eqFG_invr : forall x : FG, eqFG (Law x (Inv x)) Unit | eqFG_refl : forall x : FG, eqFG x x:Prop | eqFG_sym : forall x y : FG, eqFG x y -> (eqFG y x:Prop) | eqFG_trans : forall x y z : FG, eqFG x y -> eqFG y z -> (eqFG x z:Prop). Hint Resolve eqFG_Var eqFG_law eqFG_law_assoc eqFG_law0r eqFG_invr eqFG_refl: algebra. Hint Immediate eqFG_sym: algebra. Lemma eqFG_Equiv : equivalence eqFG. (* Goal: @Map_eq V (sgroup_set (monoid_sgroup (group_monoid G))) f (@comp_hom SET V FG_set (sgroup_set (monoid_sgroup (group_monoid G))) (@f2 FreeGroup G FG_lift_fun (fun (x y : FG) (H' : eqFG x y) => @eqFG_ind (fun x0 y0 : FG => @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0)) (fun (x0 y0 : Carrier V) (H : @Equal V x0 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (group_monoid G))) f f x0 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (group_monoid G)))) f)) (fun (x0 x' y0 y' : FG) (_ : eqFG x0 x') (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun x')) (_ : eqFG y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun y0) (FG_lift_fun y')) => @SGROUP_comp (monoid_sgroup (group_monoid G)) (FG_lift_fun x0) (FG_lift_fun x') (FG_lift_fun y0) (FG_lift_fun y') H0 H2) (fun x0 y0 z : FG => @SGROUP_assoc (monoid_sgroup (group_monoid G)) (FG_lift_fun x0) (FG_lift_fun y0) (FG_lift_fun z)) (fun x0 : FG => @MONOID_unit_r (group_monoid G) (FG_lift_fun x0)) (fun (x0 y0 : FG) (_ : eqFG x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0)) => @GROUP_comp G (FG_lift_fun x0) (FG_lift_fun y0) H0) (fun x0 : FG => @GROUP_inverse_r G (FG_lift_fun x0)) (fun x0 : FG => @Refl (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0)) (fun (x0 y0 : FG) (_ : eqFG x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0) H0) (fun (x0 y0 z : FG) (_ : eqFG x0 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0)) (_ : eqFG y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun y0) (FG_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0) (FG_lift_fun z) H'1 H'3) x y H')) FG_var) *) red in |- *. (* Goal: and (@transitive FG eqFG) (@symmetric FG eqFG) *) split; [ try assumption | idtac ]. (* Goal: @reflexive FG eqFG *) (* Goal: @partial_equivalence FG eqFG *) exact eqFG_refl. (* Goal: @Map_eq V (sgroup_set (monoid_sgroup (group_monoid G))) f (@comp_hom SET V FG_set (sgroup_set (monoid_sgroup (group_monoid G))) (@f2 FreeGroup G FG_lift_fun (fun (x y : FG) (H' : eqFG x y) => @eqFG_ind (fun x0 y0 : FG => @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0)) (fun (x0 y0 : Carrier V) (H : @Equal V x0 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (group_monoid G))) f f x0 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (group_monoid G)))) f)) (fun (x0 x' y0 y' : FG) (_ : eqFG x0 x') (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun x')) (_ : eqFG y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun y0) (FG_lift_fun y')) => @SGROUP_comp (monoid_sgroup (group_monoid G)) (FG_lift_fun x0) (FG_lift_fun x') (FG_lift_fun y0) (FG_lift_fun y') H0 H2) (fun x0 y0 z : FG => @SGROUP_assoc (monoid_sgroup (group_monoid G)) (FG_lift_fun x0) (FG_lift_fun y0) (FG_lift_fun z)) (fun x0 : FG => @MONOID_unit_r (group_monoid G) (FG_lift_fun x0)) (fun (x0 y0 : FG) (_ : eqFG x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0)) => @GROUP_comp G (FG_lift_fun x0) (FG_lift_fun y0) H0) (fun x0 : FG => @GROUP_inverse_r G (FG_lift_fun x0)) (fun x0 : FG => @Refl (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0)) (fun (x0 y0 : FG) (_ : eqFG x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0) H0) (fun (x0 y0 z : FG) (_ : eqFG x0 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0)) (_ : eqFG y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun y0) (FG_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0) (FG_lift_fun z) H'1 H'3) x y H')) FG_var) *) red in |- *. (* Goal: and (@transitive FG eqFG) (@symmetric FG eqFG) *) split; [ try assumption | idtac ]. (* Goal: @transitive FG eqFG *) (* Goal: @symmetric FG eqFG *) exact eqFG_trans. (* Goal: @symmetric FG eqFG *) exact eqFG_sym. Qed. Definition FG_set := Build_Setoid eqFG_Equiv. Definition FreeGroup : GROUP. (* Goal: Ob GROUP *) apply (BUILD_GROUP (E:=FG_set) (genlaw:=Law) (e:=Unit) (geninv:=Inv)). (* Goal: forall (x x' y y' : Carrier FG_set) (_ : @Equal FG_set x x') (_ : @Equal FG_set y y'), @Equal FG_set (Law x y) (Law x' y') *) (* Goal: forall x y z : Carrier FG_set, @Equal FG_set (Law (Law x y) z) (Law x (Law y z)) *) (* Goal: forall x : Carrier FG_set, @Equal FG_set (Law x Unit) x *) (* Goal: forall (x y : Carrier FG_set) (_ : @Equal FG_set x y), @Equal FG_set (Inv x) (Inv y) *) (* Goal: forall x : Carrier FG_set, @Equal FG_set (Law x (Inv x)) Unit *) exact eqFG_law. (* Goal: forall x y z : Carrier FG_set, @Equal FG_set (Law (Law x y) z) (Law x (Law y z)) *) (* Goal: forall x : Carrier FG_set, @Equal FG_set (Law x Unit) x *) (* Goal: forall (x y : Carrier FG_set) (_ : @Equal FG_set x y), @Equal FG_set (Inv x) (Inv y) *) (* Goal: forall x : Carrier FG_set, @Equal FG_set (Law x (Inv x)) Unit *) exact eqFG_law_assoc. (* Goal: forall x : Carrier FG_set, @Equal FG_set (Law x Unit) x *) (* Goal: forall (x y : Carrier FG_set) (_ : @Equal FG_set x y), @Equal FG_set (Inv x) (Inv y) *) (* Goal: forall x : Carrier FG_set, @Equal FG_set (Law x (Inv x)) Unit *) exact eqFG_law0r. (* Goal: forall (x y : Carrier FG_set) (_ : @Equal FG_set x y), @Equal FG_set (Inv x) (Inv y) *) (* Goal: forall x : Carrier FG_set, @Equal FG_set (Law x (Inv x)) Unit *) exact eqFG_inv. (* Goal: forall x : Carrier FG_set, @Equal FG_set (Law x (Inv x)) Unit *) exact eqFG_invr. Defined. Section Universal_prop. Variable G : GROUP. Variable f : Hom V G. Fixpoint FG_lift_fun (p : FreeGroup) : G := match p with | Var v => f v | Law p1 p2 => sgroup_law _ (FG_lift_fun p1) (FG_lift_fun p2) | Unit => monoid_unit G | Inv p1 => group_inverse G (FG_lift_fun p1) end. Definition FG_lift : Hom FreeGroup G. (* Goal: Carrier (@Hom GROUP FreeGroup G) *) apply (BUILD_HOM_GROUP (G:=FreeGroup) (G':=G) (ff:=FG_lift_fun)). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid FreeGroup)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid FreeGroup))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x) (FG_lift_fun y) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid FreeGroup))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun (sgroup_law (monoid_sgroup (group_monoid FreeGroup)) x y)) (sgroup_law (monoid_sgroup (group_monoid G)) (FG_lift_fun x) (FG_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun (@monoid_unit (monoid_sgroup (group_monoid FreeGroup)) (monoid_on_def (group_monoid FreeGroup)))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) intros x y H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x) (FG_lift_fun y) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid FreeGroup))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun (sgroup_law (monoid_sgroup (group_monoid FreeGroup)) x y)) (sgroup_law (monoid_sgroup (group_monoid G)) (FG_lift_fun x) (FG_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun (@monoid_unit (monoid_sgroup (group_monoid FreeGroup)) (monoid_on_def (group_monoid FreeGroup)))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) elim H'; simpl in |- *; auto with algebra. (* Goal: forall (x y z : FG) (_ : eqFG x y) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x) (FG_lift_fun y)) (_ : eqFG y z) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun y) (FG_lift_fun z)), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x) (FG_lift_fun z) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid FreeGroup))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun (sgroup_law (monoid_sgroup (group_monoid FreeGroup)) x y)) (sgroup_law (monoid_sgroup (group_monoid G)) (FG_lift_fun x) (FG_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun (@monoid_unit (monoid_sgroup (group_monoid FreeGroup)) (monoid_on_def (group_monoid FreeGroup)))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) intros x0 y0 z H'0 H'1 H'2 H'3; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun z) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid FreeGroup))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun (sgroup_law (monoid_sgroup (group_monoid FreeGroup)) x y)) (sgroup_law (monoid_sgroup (group_monoid G)) (FG_lift_fun x) (FG_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun (@monoid_unit (monoid_sgroup (group_monoid FreeGroup)) (monoid_on_def (group_monoid FreeGroup)))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) apply Trans with (FG_lift_fun y0); auto with algebra. (* Goal: forall (x y : Carrier V) (_ : @Equal V x y), @Equal (sgroup_set (monoid_sgroup (group_monoid FreeGroup))) (Var x) (Var y) *) simpl in |- *; auto with algebra. (* Goal: forall (x y : Carrier V) (_ : @Equal V x y), @Equal (sgroup_set (monoid_sgroup (group_monoid FreeGroup))) (Var x) (Var y) *) simpl in |- *; auto with algebra. Defined. Definition FG_var : Hom V FreeGroup. (* Goal: Carrier (@Hom SET V (sgroup_set (monoid_sgroup (group_monoid FreeGroup)))) *) apply (Build_Map (A:=V) (B:=FreeGroup) (Ap:=Var)). (* Goal: @Map_eq V (sgroup_set (monoid_sgroup (group_monoid G))) f (@comp_hom SET V FG_set (sgroup_set (monoid_sgroup (group_monoid G))) (@f2 FreeGroup G FG_lift_fun (fun (x y : FG) (H' : eqFG x y) => @eqFG_ind (fun x0 y0 : FG => @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0)) (fun (x0 y0 : Carrier V) (H : @Equal V x0 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (group_monoid G))) f f x0 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (group_monoid G)))) f)) (fun (x0 x' y0 y' : FG) (_ : eqFG x0 x') (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun x')) (_ : eqFG y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun y0) (FG_lift_fun y')) => @SGROUP_comp (monoid_sgroup (group_monoid G)) (FG_lift_fun x0) (FG_lift_fun x') (FG_lift_fun y0) (FG_lift_fun y') H0 H2) (fun x0 y0 z : FG => @SGROUP_assoc (monoid_sgroup (group_monoid G)) (FG_lift_fun x0) (FG_lift_fun y0) (FG_lift_fun z)) (fun x0 : FG => @MONOID_unit_r (group_monoid G) (FG_lift_fun x0)) (fun (x0 y0 : FG) (_ : eqFG x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0)) => @GROUP_comp G (FG_lift_fun x0) (FG_lift_fun y0) H0) (fun x0 : FG => @GROUP_inverse_r G (FG_lift_fun x0)) (fun x0 : FG => @Refl (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0)) (fun (x0 y0 : FG) (_ : eqFG x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0) H0) (fun (x0 y0 z : FG) (_ : eqFG x0 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0)) (_ : eqFG y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun y0) (FG_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0) (FG_lift_fun z) H'1 H'3) x y H')) FG_var) *) red in |- *. (* Goal: forall (x y : Carrier V) (_ : @Equal V x y), @Equal (sgroup_set (monoid_sgroup (group_monoid FreeGroup))) (Var x) (Var y) *) simpl in |- *; auto with algebra. Defined. Lemma FG_comp_prop : Equal f (comp_hom (FG_lift:Hom (FreeGroup:SET) G) FG_var). (* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Ap V (sgroup_set (monoid_sgroup (group_monoid G))) f x) (@Ap V (sgroup_set (monoid_sgroup (group_monoid G))) (@comp_hom SET V FG_set (sgroup_set (monoid_sgroup (group_monoid G))) (@f2 FreeGroup G FG_lift_fun (fun (x0 y : FG) (H' : eqFG x0 y) => @eqFG_ind (fun x1 y0 : FG => @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x1) (FG_lift_fun y0)) (fun (x1 y0 : Carrier V) (H : @Equal V x1 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (group_monoid G))) f f x1 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (group_monoid G)))) f)) (fun (x1 x' y0 y' : FG) (_ : eqFG x1 x') (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x1) (FG_lift_fun x')) (_ : eqFG y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun y0) (FG_lift_fun y')) => @SGROUP_comp (monoid_sgroup (group_monoid G)) (FG_lift_fun x1) (FG_lift_fun x') (FG_lift_fun y0) (FG_lift_fun y') H0 H2) (fun x1 y0 z : FG => @SGROUP_assoc (monoid_sgroup (group_monoid G)) (FG_lift_fun x1) (FG_lift_fun y0) (FG_lift_fun z)) (fun x1 : FG => @MONOID_unit_r (group_monoid G) (FG_lift_fun x1)) (fun (x1 y0 : FG) (_ : eqFG x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x1) (FG_lift_fun y0)) => @GROUP_comp G (FG_lift_fun x1) (FG_lift_fun y0) H0) (fun x1 : FG => @GROUP_inverse_r G (FG_lift_fun x1)) (fun x1 : FG => @Refl (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x1)) (fun (x1 y0 : FG) (_ : eqFG x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x1) (FG_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x1) (FG_lift_fun y0) H0) (fun (x1 y0 z : FG) (_ : eqFG x1 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x1) (FG_lift_fun y0)) (_ : eqFG y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun y0) (FG_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x1) (FG_lift_fun y0) (FG_lift_fun z) H'1 H'3) x0 y H')) FG_var) x) *) simpl in |- *. (* Goal: @Map_eq V (sgroup_set (monoid_sgroup (group_monoid G))) f (@comp_hom SET V FG_set (sgroup_set (monoid_sgroup (group_monoid G))) (@f2 FreeGroup G FG_lift_fun (fun (x y : FG) (H' : eqFG x y) => @eqFG_ind (fun x0 y0 : FG => @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0)) (fun (x0 y0 : Carrier V) (H : @Equal V x0 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (group_monoid G))) f f x0 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (group_monoid G)))) f)) (fun (x0 x' y0 y' : FG) (_ : eqFG x0 x') (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun x')) (_ : eqFG y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun y0) (FG_lift_fun y')) => @SGROUP_comp (monoid_sgroup (group_monoid G)) (FG_lift_fun x0) (FG_lift_fun x') (FG_lift_fun y0) (FG_lift_fun y') H0 H2) (fun x0 y0 z : FG => @SGROUP_assoc (monoid_sgroup (group_monoid G)) (FG_lift_fun x0) (FG_lift_fun y0) (FG_lift_fun z)) (fun x0 : FG => @MONOID_unit_r (group_monoid G) (FG_lift_fun x0)) (fun (x0 y0 : FG) (_ : eqFG x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0)) => @GROUP_comp G (FG_lift_fun x0) (FG_lift_fun y0) H0) (fun x0 : FG => @GROUP_inverse_r G (FG_lift_fun x0)) (fun x0 : FG => @Refl (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0)) (fun (x0 y0 : FG) (_ : eqFG x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0) H0) (fun (x0 y0 z : FG) (_ : eqFG x0 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0)) (_ : eqFG y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun y0) (FG_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0) (FG_lift_fun z) H'1 H'3) x y H')) FG_var) *) red in |- *. (* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Ap V (sgroup_set (monoid_sgroup (group_monoid G))) f x) (@Ap V (sgroup_set (monoid_sgroup (group_monoid G))) (@comp_hom SET V FG_set (sgroup_set (monoid_sgroup (group_monoid G))) (@f2 FreeGroup G FG_lift_fun (fun (x0 y : FG) (H' : eqFG x0 y) => @eqFG_ind (fun x1 y0 : FG => @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x1) (FG_lift_fun y0)) (fun (x1 y0 : Carrier V) (H : @Equal V x1 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (group_monoid G))) f f x1 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (group_monoid G)))) f)) (fun (x1 x' y0 y' : FG) (_ : eqFG x1 x') (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x1) (FG_lift_fun x')) (_ : eqFG y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun y0) (FG_lift_fun y')) => @SGROUP_comp (monoid_sgroup (group_monoid G)) (FG_lift_fun x1) (FG_lift_fun x') (FG_lift_fun y0) (FG_lift_fun y') H0 H2) (fun x1 y0 z : FG => @SGROUP_assoc (monoid_sgroup (group_monoid G)) (FG_lift_fun x1) (FG_lift_fun y0) (FG_lift_fun z)) (fun x1 : FG => @MONOID_unit_r (group_monoid G) (FG_lift_fun x1)) (fun (x1 y0 : FG) (_ : eqFG x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x1) (FG_lift_fun y0)) => @GROUP_comp G (FG_lift_fun x1) (FG_lift_fun y0) H0) (fun x1 : FG => @GROUP_inverse_r G (FG_lift_fun x1)) (fun x1 : FG => @Refl (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x1)) (fun (x1 y0 : FG) (_ : eqFG x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x1) (FG_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x1) (FG_lift_fun y0) H0) (fun (x1 y0 z : FG) (_ : eqFG x1 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x1) (FG_lift_fun y0)) (_ : eqFG y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun y0) (FG_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x1) (FG_lift_fun y0) (FG_lift_fun z) H'1 H'3) x0 y H')) FG_var) x) *) simpl in |- *. (* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Ap V (sgroup_set (monoid_sgroup (group_monoid G))) f x) (@Ap V (sgroup_set (monoid_sgroup (group_monoid G))) f x) *) auto with algebra. Qed. End Universal_prop. End Free_group_def. Hint Resolve FG_comp_prop: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Automatic Coercions Import. Set Implicit Arguments. Unset Strict Implicit. Require Export Module_cat. Require Export Monoid_util. Require Export Group_util. (** Title "Tools for building modules." *) Section Module. Variable R : RING. Variable E : Setoid. Variable genlaw : E -> E -> E. Variable e : E. Variable geninv : E -> E. Variable gen_module_op : R -> E -> E. Hypothesis fcomp : forall x x' y y' : E, Equal x x' -> Equal y y' -> Equal (genlaw x y) (genlaw x' y'). Hypothesis genlawassoc : forall x y z : E, Equal (genlaw (genlaw x y) z) (genlaw x (genlaw y z)). Hypothesis eunitgenlawr : forall x : E, Equal (genlaw x e) x. Hypothesis invcomp : forall x y : E, Equal x y -> Equal (geninv x) (geninv y). Hypothesis geninvr : forall x : E, Equal (genlaw x (geninv x)) e. Hypothesis fcom : forall x y : E, Equal (genlaw x y) (genlaw y x). Hypothesis op_comp : forall (a b : R) (x y : E), Equal a b -> Equal x y -> Equal (gen_module_op a x) (gen_module_op b y). Hypothesis oplin_l : forall (a b : R) (x : E), Equal (gen_module_op (sgroup_law R a b) x) (genlaw (gen_module_op a x) (gen_module_op b x)). Hypothesis oplin_r : forall (a : R) (x y : E), Equal (gen_module_op a (genlaw x y)) (genlaw (gen_module_op a x) (gen_module_op a y)). Hypothesis opassoc : forall (a b : R) (x : E), Equal (gen_module_op a (gen_module_op b x)) (gen_module_op (ring_mult a b) x). Hypothesis opunit : forall x : E, Equal (gen_module_op (ring_unit R) x) x. Definition module_util_endo_el : forall a : R, Endo_SET E. (* Goal: forall _ : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), Carrier (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) *) intros a; try assumption. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) x) *) simpl in |- *. (* Goal: Map E E *) apply (Build_Map (A:=E) (B:=E) (Ap:=fun x : E => gen_module_op a x)). (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (gen_module_op (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R))) x) x *) auto with algebra. Defined. Definition module_util_op : operation (ring_monoid R) E. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) x) *) simpl in |- *. apply (BUILD_HOM_MONOID (G:=ring_monoid R) (G':=Endo_SET E) (ff:=module_util_endo_el)). (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) x) *) simpl in |- *. (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) *) intros x y H'; red in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) x) *) simpl in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (gen_module_op (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R))) x) x *) auto with algebra. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) x) *) simpl in |- *. (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) *) intros x y; red in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) x) *) simpl in |- *. (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (gen_module_op (sgroup_law (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) x y) x0) (gen_module_op x (gen_module_op y x0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) (module_util_endo_el2 (@monoid_unit (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_on_def (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))))) (@monoid_unit (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) *) intros x0; try assumption. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (gen_module_op (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R))) x) x *) apply Trans with (gen_module_op (ring_mult x y) x0); auto with algebra. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) x) *) simpl in |- *. (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) x) *) simpl in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (gen_module_op (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R))) x) x *) auto with algebra. Defined. Definition module_util_G : ABELIAN_GROUP. apply (BUILD_ABELIAN_GROUP (E:=E) (genlaw:=genlaw) (e:=e) (geninv:=geninv)); (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (gen_module_op (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R))) x) x *) auto with algebra. Defined. Definition BUILD_MODULE : MODULE R. (* Goal: Ob (MODULE R) *) apply (Build_module (R:=R) (module_carrier:=module_util_G)). (* Goal: module_on R module_util_G *) apply (Build_module_on (R:=R) (M:=module_util_G) (module_op:=module_util_op)). (* Goal: @op_lin_left R module_util_G module_util_op2 *) (* Goal: @op_lin_right R module_util_G module_util_op2 *) abstract exact oplin_l. (* Goal: @op_lin_right R module_util_G module_util_op2 *) abstract exact oplin_r. Defined. End Module. Section Hom. Variable R : RING. Variable Mod Mod' : MODULE R. Variable ff : Mod -> Mod'. Hypothesis ffcomp : forall x y : Mod, Equal x y -> Equal (ff x) (ff y). Hypothesis fflaw : forall x y : Mod, Equal (ff (sgroup_law Mod x y)) (sgroup_law Mod' (ff x) (ff y)). Hypothesis ffunit : Equal (ff (monoid_unit Mod)) (monoid_unit Mod'). Hypothesis ffop : forall (a : R) (x : Mod), Equal (ff (module_mult a x)) (module_mult a (ff x)). Definition BUILD_HOM_MODULE : Hom Mod Mod' := Build_module_hom (module_monoid_hom:=BUILD_HOM_GROUP (G:=Mod) (G':=Mod') (ff:=ff) ffcomp fflaw ffunit) ffop. End Hom. Section Module_on_group. Variable R : RING. Variable module_util_G : ABELIAN_GROUP. Variable gen_module_op : R -> module_util_G -> module_util_G. Hypothesis op_comp : forall (a b : R) (x y : module_util_G), Equal a b -> Equal x y -> Equal (gen_module_op a x) (gen_module_op b y). Hypothesis oplin_l : forall (a b : R) (x : module_util_G), Equal (gen_module_op (sgroup_law R a b) x) (sgroup_law module_util_G (gen_module_op a x) (gen_module_op b x)). Hypothesis oplin_r : forall (a : R) (x y : module_util_G), Equal (gen_module_op a (sgroup_law module_util_G x y)) (sgroup_law module_util_G (gen_module_op a x) (gen_module_op a y)). Hypothesis opassoc : forall (a b : R) (x : module_util_G), Equal (gen_module_op a (gen_module_op b x)) (gen_module_op (ring_mult a b) x). Hypothesis opunit : forall x : module_util_G, Equal (gen_module_op (ring_unit R) x) x. Definition module_util_endo_el2 : forall a : R, Endo_SET module_util_G. (* Goal: forall _ : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), Carrier (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) *) intros a; try assumption. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) x) *) simpl in |- *. apply (Build_Map (A:=module_util_G) (B:=module_util_G) (Ap:=fun x : module_util_G => gen_module_op a x)). (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (gen_module_op (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R))) x) x *) auto with algebra. Defined. Definition module_util_op2 : operation (ring_monoid R) module_util_G. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) x) *) simpl in |- *. apply (BUILD_HOM_MONOID (G:=ring_monoid R) (G':=Endo_SET module_util_G) (ff:=module_util_endo_el2)). (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) x) *) simpl in |- *. (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) *) intros x y H'; red in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) x) *) simpl in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (gen_module_op (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R))) x) x *) auto with algebra. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) x) *) simpl in |- *. (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) *) intros x y; red in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) x) *) simpl in |- *. (* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (gen_module_op (sgroup_law (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) x y) x0) (gen_module_op x (gen_module_op y x0)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) (module_util_endo_el2 (@monoid_unit (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_on_def (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))))) (@monoid_unit (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) *) intros x0; try assumption. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (gen_module_op (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R))) x) x *) apply Trans with (gen_module_op (ring_mult x y) x0); auto with algebra. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) x) *) simpl in |- *. (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) x) *) simpl in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (gen_module_op (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R))) x) x *) auto with algebra. Defined. Definition BUILD_MODULE_GROUP : MODULE R. (* Goal: Ob (MODULE R) *) apply (Build_module (R:=R) (module_carrier:=module_util_G)). apply (Build_module_on (R:=R) (M:=module_util_G) (module_op:=module_util_op2)). (* Goal: @op_lin_left R module_util_G module_util_op2 *) (* Goal: @op_lin_right R module_util_G module_util_op2 *) abstract exact oplin_l. (* Goal: @op_lin_right R module_util_G module_util_op2 *) abstract exact oplin_r. Defined. End Module_on_group.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Categories. Require Export Parts. (** Title "Sub-category." *) Section Subcategory_def. Variable C : category. Variable C' : Type. Variable i : C' -> C. Variable homC' : forall a b : C', subtype_image (Hom (i a) (i b)). Definition subcat_Hom (a b : C') := homC' a b:Setoid. Variable CompC' : forall a b c : C', subcat_Hom b c -> subcat_Hom a b -> subcat_Hom a c. Variable idC' : forall a : C', subcat_Hom a a. Hypothesis idC'ok : forall a : C', Equal (subtype_image_inj (idC' a)) (Hom_id (i a)). Hypothesis CompC'_ok : forall (a b c : C') (g : subcat_Hom b c) (f : subcat_Hom a b), Equal (subtype_image_inj (CompC' g f)) (comp_hom (subtype_image_inj g) (subtype_image_inj f)). Definition subcat_Hom_comp : forall a b c : C', MAP (cart (subcat_Hom b c) (subcat_Hom a b)) (subcat_Hom a c). (* Goal: forall a b c : C', Carrier (MAP (cart (subcat_Hom b c) (subcat_Hom a b)) (subcat_Hom a c)) *) intros a b c; try assumption. apply (Build_Map (A:=cart (subcat_Hom b c) (subcat_Hom a b)) (B:= subcat_Hom a c) (Ap:=fun x : cart (subcat_Hom b c) (subcat_Hom a b) => CompC' (proj1 x) (proj2 x))). (* Goal: @Hom_comp_unit_r C' subcat_Hom subcat_Hom_comp idC' *) red in |- *. (* Goal: forall (x y : Carrier (cart (subcat_Hom b c) (subcat_Hom a b))) (_ : @Equal (cart (subcat_Hom b c) (subcat_Hom a b)) x y), @Equal (subcat_Hom a c) (@CompC' a b c (@proj1 (subcat_Hom b c) (subcat_Hom a b) x) (@proj2 (subcat_Hom b c) (subcat_Hom a b) x)) (@CompC' a b c (@proj1 (subcat_Hom b c) (subcat_Hom a b) y) (@proj2 (subcat_Hom b c) (subcat_Hom a b) y)) *) intros x y H'; try assumption. (* Goal: forall (a b : C') (f : Carrier (subcat_Hom a b)), @Equal (subcat_Hom a b) (@Ap (cart (subcat_Hom a b) (subcat_Hom a a)) (subcat_Hom a b) (@Build_Map (cart (subcat_Hom a b) (subcat_Hom a a)) (subcat_Hom a b) (fun x : Carrier (cart (subcat_Hom a b) (subcat_Hom a a)) => @CompC' a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) x) (@proj2 (subcat_Hom a b) (subcat_Hom a a) x)) (fun (x y : Carrier (cart (subcat_Hom a b) (subcat_Hom a a))) (H' : @Equal (cart (subcat_Hom a b) (subcat_Hom a a)) x y) => @Trans (@Hom C (i a) (i b)) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@CompC' a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) x) (@proj2 (subcat_Hom a b) (subcat_Hom a a) x))) (@comp_hom C (i a) (i a) (i b) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj1 (subcat_Hom a b) (subcat_Hom a a) x)) (@subtype_image_inj (@Hom C (i a) (i a)) (homC' a a) (@proj2 (subcat_Hom a b) (subcat_Hom a a) x))) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@CompC' a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) y) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y))) (@CompC'_ok a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) x) (@proj2 (subcat_Hom a b) (subcat_Hom a a) x)) (@Trans (@Hom C (i a) (i b)) (@comp_hom C (i a) (i a) (i b) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj1 (subcat_Hom a b) (subcat_Hom a a) x)) (@subtype_image_inj (@Hom C (i a) (i a)) (homC' a a) (@proj2 (subcat_Hom a b) (subcat_Hom a a) x))) (@comp_hom C (i a) (i a) (i b) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj1 (subcat_Hom a b) (subcat_Hom a a) y)) (@subtype_image_inj (@Hom C (i a) (i a)) (homC' a a) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y))) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@CompC' a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) y) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y))) (@comp_hom_compatible C (i a) (i a) (i b) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj1 (subcat_Hom a b) (subcat_Hom a a) x)) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj1 (subcat_Hom a b) (subcat_Hom a a) y)) (@subtype_image_inj (@Hom C (i a) (i a)) (homC' a a) (@proj2 (subcat_Hom a b) (subcat_Hom a a) x)) (@subtype_image_inj (@Hom C (i a) (i a)) (homC' a a) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y)) (@proj1_comp (subcat_Hom a b) (subcat_Hom a a) x y H') (@proj2_comp (subcat_Hom a b) (subcat_Hom a a) x y H')) (@Sym (@Hom C (i a) (i b)) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@CompC' a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) y) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y))) (@comp_hom C (i a) (i a) (i b) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj1 (subcat_Hom a b) (subcat_Hom a a) y)) (@subtype_image_inj (@Hom C (i a) (i a)) (homC' a a) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y))) (@CompC'_ok a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) y) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y)))))) (@couple (subcat_Hom a b) (subcat_Hom a a) f (idC' a))) f *) simpl in |- *. (* Goal: forall (a b : C') (f : @subtype_image_carrier (@Hom C (i a) (i b)) (homC' a b)), @subtype_image_equal (@Hom C (i a) (i b)) (@subtype_image_carrier (@Hom C (i a) (i b)) (homC' a b)) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b)) (@CompC' a a b f (idC' a)) f *) unfold subtype_image_equal in |- *. apply Trans with (comp_hom (subtype_image_inj (proj1 x)) (subtype_image_inj (proj2 x))); (* Goal: @Equal (subcat_Hom a b) (@proj2 (subcat_Hom b c) (subcat_Hom a b) x) (@proj2 (subcat_Hom b c) (subcat_Hom a b) y) *) auto with algebra. apply Trans with (comp_hom (subtype_image_inj (proj1 y)) (subtype_image_inj (proj2 y))); (* Goal: @Equal (subcat_Hom a b) (@proj2 (subcat_Hom b c) (subcat_Hom a b) x) (@proj2 (subcat_Hom b c) (subcat_Hom a b) y) *) auto with algebra. (* Goal: @Equal (@Hom C (i a) (i c)) (@comp_hom C (i a) (i b) (i c) (@subtype_image_inj (@Hom C (i b) (i c)) (homC' b c) (@proj1 (subcat_Hom b c) (subcat_Hom a b) x)) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj2 (subcat_Hom b c) (subcat_Hom a b) x))) (@comp_hom C (i a) (i b) (i c) (@subtype_image_inj (@Hom C (i b) (i c)) (homC' b c) (@proj1 (subcat_Hom b c) (subcat_Hom a b) y)) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj2 (subcat_Hom b c) (subcat_Hom a b) y))) *) apply comp_hom_compatible. (* Goal: @Equal (@Hom C (i b) (i c)) (@subtype_image_inj (@Hom C (i b) (i c)) (homC' b c) (@proj1 (subcat_Hom b c) (subcat_Hom a b) x)) (@subtype_image_inj (@Hom C (i b) (i c)) (homC' b c) (@proj1 (subcat_Hom b c) (subcat_Hom a b) y)) *) (* Goal: @Equal (@Hom C (i a) (i b)) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj2 (subcat_Hom b c) (subcat_Hom a b) x)) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj2 (subcat_Hom b c) (subcat_Hom a b) y)) *) cut (Equal (proj1 x) (proj1 y)). (* Goal: @Equal (subcat_Hom a b) (@proj2 (subcat_Hom b c) (subcat_Hom a b) x) (@proj2 (subcat_Hom b c) (subcat_Hom a b) y) *) auto with algebra. (* Goal: @Equal (subcat_Hom a b) (@proj2 (subcat_Hom b c) (subcat_Hom a b) x) (@proj2 (subcat_Hom b c) (subcat_Hom a b) y) *) auto with algebra. (* Goal: @Equal (@Hom C (i a) (i b)) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj2 (subcat_Hom b c) (subcat_Hom a b) x)) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj2 (subcat_Hom b c) (subcat_Hom a b) y)) *) cut (Equal (proj2 x) (proj2 y)). (* Goal: @Equal (subcat_Hom a b) (@proj2 (subcat_Hom b c) (subcat_Hom a b) x) (@proj2 (subcat_Hom b c) (subcat_Hom a b) y) *) auto with algebra. (* Goal: @Equal (subcat_Hom a b) (@proj2 (subcat_Hom b c) (subcat_Hom a b) x) (@proj2 (subcat_Hom b c) (subcat_Hom a b) y) *) auto with algebra. Defined. Definition subcat : category. apply (Build_category (Ob:=C') (Hom:=subcat_Hom) (Hom_comp:=subcat_Hom_comp) (Hom_id:=idC')). (* Goal: @Hom_comp_unit_r C' subcat_Hom subcat_Hom_comp idC' *) red in |- *. (* Goal: forall (a b : C') (f : Carrier (subcat_Hom a b)), @Equal (subcat_Hom a b) (@Ap (cart (subcat_Hom a b) (subcat_Hom a a)) (subcat_Hom a b) (subcat_Hom_comp a a b) (@couple (subcat_Hom a b) (subcat_Hom a a) f (idC' a))) f *) unfold subcat_Hom_comp in |- *. (* Goal: forall (a b : C') (f : Carrier (subcat_Hom a b)), @Equal (subcat_Hom a b) (@Ap (cart (subcat_Hom a b) (subcat_Hom a a)) (subcat_Hom a b) (@Build_Map (cart (subcat_Hom a b) (subcat_Hom a a)) (subcat_Hom a b) (fun x : Carrier (cart (subcat_Hom a b) (subcat_Hom a a)) => @CompC' a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) x) (@proj2 (subcat_Hom a b) (subcat_Hom a a) x)) (fun (x y : Carrier (cart (subcat_Hom a b) (subcat_Hom a a))) (H' : @Equal (cart (subcat_Hom a b) (subcat_Hom a a)) x y) => @Trans (@Hom C (i a) (i b)) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@CompC' a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) x) (@proj2 (subcat_Hom a b) (subcat_Hom a a) x))) (@comp_hom C (i a) (i a) (i b) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj1 (subcat_Hom a b) (subcat_Hom a a) x)) (@subtype_image_inj (@Hom C (i a) (i a)) (homC' a a) (@proj2 (subcat_Hom a b) (subcat_Hom a a) x))) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@CompC' a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) y) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y))) (@CompC'_ok a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) x) (@proj2 (subcat_Hom a b) (subcat_Hom a a) x)) (@Trans (@Hom C (i a) (i b)) (@comp_hom C (i a) (i a) (i b) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj1 (subcat_Hom a b) (subcat_Hom a a) x)) (@subtype_image_inj (@Hom C (i a) (i a)) (homC' a a) (@proj2 (subcat_Hom a b) (subcat_Hom a a) x))) (@comp_hom C (i a) (i a) (i b) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj1 (subcat_Hom a b) (subcat_Hom a a) y)) (@subtype_image_inj (@Hom C (i a) (i a)) (homC' a a) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y))) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@CompC' a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) y) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y))) (@comp_hom_compatible C (i a) (i a) (i b) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj1 (subcat_Hom a b) (subcat_Hom a a) x)) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj1 (subcat_Hom a b) (subcat_Hom a a) y)) (@subtype_image_inj (@Hom C (i a) (i a)) (homC' a a) (@proj2 (subcat_Hom a b) (subcat_Hom a a) x)) (@subtype_image_inj (@Hom C (i a) (i a)) (homC' a a) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y)) (@proj1_comp (subcat_Hom a b) (subcat_Hom a a) x y H') (@proj2_comp (subcat_Hom a b) (subcat_Hom a a) x y H')) (@Sym (@Hom C (i a) (i b)) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@CompC' a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) y) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y))) (@comp_hom C (i a) (i a) (i b) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj1 (subcat_Hom a b) (subcat_Hom a a) y)) (@subtype_image_inj (@Hom C (i a) (i a)) (homC' a a) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y))) (@CompC'_ok a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) y) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y)))))) (@couple (subcat_Hom a b) (subcat_Hom a a) f (idC' a))) f *) simpl in |- *. (* Goal: forall (a b : C') (f : @subtype_image_carrier (@Hom C (i a) (i b)) (homC' a b)), @subtype_image_equal (@Hom C (i a) (i b)) (@subtype_image_carrier (@Hom C (i a) (i b)) (homC' a b)) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b)) (@CompC' a a b f (idC' a)) f *) unfold subtype_image_equal in |- *. (* Goal: forall (a b c d : C') (f : @subtype_image_carrier (@Hom C (i a) (i b)) (homC' a b)) (g : @subtype_image_carrier (@Hom C (i b) (i c)) (homC' b c)) (h : @subtype_image_carrier (@Hom C (i c) (i d)) (homC' c d)), @Equal (@Hom C (i a) (i d)) (@subtype_image_inj (@Hom C (i a) (i d)) (homC' a d) (@CompC' a b d (@CompC' b c d h g) f)) (@subtype_image_inj (@Hom C (i a) (i d)) (homC' a d) (@CompC' a c d h (@CompC' a b c g f))) *) (* Goal: @Hom_comp_unit_l C' subcat_Hom subcat_Hom_comp idC' *) (* Goal: @Hom_comp_unit_r C' subcat_Hom subcat_Hom_comp idC' *) intros a b c d f g h; try assumption. apply Trans with (comp_hom (subtype_image_inj (CompC' h g)) (subtype_image_inj f)); (* Goal: @Equal (subcat_Hom a b) (@proj2 (subcat_Hom b c) (subcat_Hom a b) x) (@proj2 (subcat_Hom b c) (subcat_Hom a b) y) *) auto with algebra. apply Trans with (comp_hom (comp_hom (subtype_image_inj h) (subtype_image_inj g)) (* Goal: @Equal (subcat_Hom a b) (@proj2 (subcat_Hom b c) (subcat_Hom a b) x) (@proj2 (subcat_Hom b c) (subcat_Hom a b) y) *) (subtype_image_inj f)); auto with algebra. apply Trans with (comp_hom (subtype_image_inj h) (subtype_image_inj (CompC' g f))); (* Goal: @Equal (subcat_Hom a b) (@proj2 (subcat_Hom b c) (subcat_Hom a b) x) (@proj2 (subcat_Hom b c) (subcat_Hom a b) y) *) auto with algebra. apply Trans with (comp_hom (subtype_image_inj h) (comp_hom (subtype_image_inj g) (subtype_image_inj f))); (* Goal: @Equal (subcat_Hom a b) (@proj2 (subcat_Hom b c) (subcat_Hom a b) x) (@proj2 (subcat_Hom b c) (subcat_Hom a b) y) *) auto with algebra. (* Goal: @Hom_comp_unit_r C' subcat_Hom subcat_Hom_comp idC' *) red in |- *. (* Goal: forall (a b : C') (f : Carrier (subcat_Hom a b)), @Equal (subcat_Hom a b) (@Ap (cart (subcat_Hom a b) (subcat_Hom a a)) (subcat_Hom a b) (subcat_Hom_comp a a b) (@couple (subcat_Hom a b) (subcat_Hom a a) f (idC' a))) f *) unfold subcat_Hom_comp in |- *. (* Goal: forall (a b : C') (f : Carrier (subcat_Hom a b)), @Equal (subcat_Hom a b) (@Ap (cart (subcat_Hom a b) (subcat_Hom a a)) (subcat_Hom a b) (@Build_Map (cart (subcat_Hom a b) (subcat_Hom a a)) (subcat_Hom a b) (fun x : Carrier (cart (subcat_Hom a b) (subcat_Hom a a)) => @CompC' a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) x) (@proj2 (subcat_Hom a b) (subcat_Hom a a) x)) (fun (x y : Carrier (cart (subcat_Hom a b) (subcat_Hom a a))) (H' : @Equal (cart (subcat_Hom a b) (subcat_Hom a a)) x y) => @Trans (@Hom C (i a) (i b)) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@CompC' a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) x) (@proj2 (subcat_Hom a b) (subcat_Hom a a) x))) (@comp_hom C (i a) (i a) (i b) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj1 (subcat_Hom a b) (subcat_Hom a a) x)) (@subtype_image_inj (@Hom C (i a) (i a)) (homC' a a) (@proj2 (subcat_Hom a b) (subcat_Hom a a) x))) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@CompC' a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) y) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y))) (@CompC'_ok a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) x) (@proj2 (subcat_Hom a b) (subcat_Hom a a) x)) (@Trans (@Hom C (i a) (i b)) (@comp_hom C (i a) (i a) (i b) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj1 (subcat_Hom a b) (subcat_Hom a a) x)) (@subtype_image_inj (@Hom C (i a) (i a)) (homC' a a) (@proj2 (subcat_Hom a b) (subcat_Hom a a) x))) (@comp_hom C (i a) (i a) (i b) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj1 (subcat_Hom a b) (subcat_Hom a a) y)) (@subtype_image_inj (@Hom C (i a) (i a)) (homC' a a) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y))) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@CompC' a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) y) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y))) (@comp_hom_compatible C (i a) (i a) (i b) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj1 (subcat_Hom a b) (subcat_Hom a a) x)) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj1 (subcat_Hom a b) (subcat_Hom a a) y)) (@subtype_image_inj (@Hom C (i a) (i a)) (homC' a a) (@proj2 (subcat_Hom a b) (subcat_Hom a a) x)) (@subtype_image_inj (@Hom C (i a) (i a)) (homC' a a) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y)) (@proj1_comp (subcat_Hom a b) (subcat_Hom a a) x y H') (@proj2_comp (subcat_Hom a b) (subcat_Hom a a) x y H')) (@Sym (@Hom C (i a) (i b)) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@CompC' a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) y) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y))) (@comp_hom C (i a) (i a) (i b) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj1 (subcat_Hom a b) (subcat_Hom a a) y)) (@subtype_image_inj (@Hom C (i a) (i a)) (homC' a a) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y))) (@CompC'_ok a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) y) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y)))))) (@couple (subcat_Hom a b) (subcat_Hom a a) f (idC' a))) f *) simpl in |- *. (* Goal: forall (a b : C') (f : @subtype_image_carrier (@Hom C (i a) (i b)) (homC' a b)), @subtype_image_equal (@Hom C (i a) (i b)) (@subtype_image_carrier (@Hom C (i a) (i b)) (homC' a b)) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b)) (@CompC' a a b f (idC' a)) f *) unfold subtype_image_equal in |- *. (* Goal: forall (a b : C') (f : @subtype_image_carrier (@Hom C (i a) (i b)) (homC' a b)), @Equal (@Hom C (i a) (i b)) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@CompC' a a b f (idC' a))) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) f) *) intros a b f; try assumption. apply Trans with (comp_hom (subtype_image_inj (idC' b)) (subtype_image_inj f)); (* Goal: @Equal (subcat_Hom a b) (@proj2 (subcat_Hom b c) (subcat_Hom a b) x) (@proj2 (subcat_Hom b c) (subcat_Hom a b) y) *) auto with algebra. apply Trans with (comp_hom (Hom_id (i b)) (subtype_image_inj f)); (* Goal: @Equal (subcat_Hom a b) (@proj2 (subcat_Hom b c) (subcat_Hom a b) x) (@proj2 (subcat_Hom b c) (subcat_Hom a b) y) *) auto with algebra. (* Goal: @Hom_comp_unit_r C' subcat_Hom subcat_Hom_comp idC' *) red in |- *. (* Goal: forall (a b : C') (f : Carrier (subcat_Hom a b)), @Equal (subcat_Hom a b) (@Ap (cart (subcat_Hom a b) (subcat_Hom a a)) (subcat_Hom a b) (subcat_Hom_comp a a b) (@couple (subcat_Hom a b) (subcat_Hom a a) f (idC' a))) f *) unfold subcat_Hom_comp in |- *. (* Goal: forall (a b : C') (f : Carrier (subcat_Hom a b)), @Equal (subcat_Hom a b) (@Ap (cart (subcat_Hom a b) (subcat_Hom a a)) (subcat_Hom a b) (@Build_Map (cart (subcat_Hom a b) (subcat_Hom a a)) (subcat_Hom a b) (fun x : Carrier (cart (subcat_Hom a b) (subcat_Hom a a)) => @CompC' a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) x) (@proj2 (subcat_Hom a b) (subcat_Hom a a) x)) (fun (x y : Carrier (cart (subcat_Hom a b) (subcat_Hom a a))) (H' : @Equal (cart (subcat_Hom a b) (subcat_Hom a a)) x y) => @Trans (@Hom C (i a) (i b)) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@CompC' a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) x) (@proj2 (subcat_Hom a b) (subcat_Hom a a) x))) (@comp_hom C (i a) (i a) (i b) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj1 (subcat_Hom a b) (subcat_Hom a a) x)) (@subtype_image_inj (@Hom C (i a) (i a)) (homC' a a) (@proj2 (subcat_Hom a b) (subcat_Hom a a) x))) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@CompC' a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) y) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y))) (@CompC'_ok a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) x) (@proj2 (subcat_Hom a b) (subcat_Hom a a) x)) (@Trans (@Hom C (i a) (i b)) (@comp_hom C (i a) (i a) (i b) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj1 (subcat_Hom a b) (subcat_Hom a a) x)) (@subtype_image_inj (@Hom C (i a) (i a)) (homC' a a) (@proj2 (subcat_Hom a b) (subcat_Hom a a) x))) (@comp_hom C (i a) (i a) (i b) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj1 (subcat_Hom a b) (subcat_Hom a a) y)) (@subtype_image_inj (@Hom C (i a) (i a)) (homC' a a) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y))) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@CompC' a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) y) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y))) (@comp_hom_compatible C (i a) (i a) (i b) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj1 (subcat_Hom a b) (subcat_Hom a a) x)) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj1 (subcat_Hom a b) (subcat_Hom a a) y)) (@subtype_image_inj (@Hom C (i a) (i a)) (homC' a a) (@proj2 (subcat_Hom a b) (subcat_Hom a a) x)) (@subtype_image_inj (@Hom C (i a) (i a)) (homC' a a) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y)) (@proj1_comp (subcat_Hom a b) (subcat_Hom a a) x y H') (@proj2_comp (subcat_Hom a b) (subcat_Hom a a) x y H')) (@Sym (@Hom C (i a) (i b)) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@CompC' a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) y) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y))) (@comp_hom C (i a) (i a) (i b) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@proj1 (subcat_Hom a b) (subcat_Hom a a) y)) (@subtype_image_inj (@Hom C (i a) (i a)) (homC' a a) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y))) (@CompC'_ok a a b (@proj1 (subcat_Hom a b) (subcat_Hom a a) y) (@proj2 (subcat_Hom a b) (subcat_Hom a a) y)))))) (@couple (subcat_Hom a b) (subcat_Hom a a) f (idC' a))) f *) simpl in |- *. (* Goal: forall (a b : C') (f : @subtype_image_carrier (@Hom C (i a) (i b)) (homC' a b)), @subtype_image_equal (@Hom C (i a) (i b)) (@subtype_image_carrier (@Hom C (i a) (i b)) (homC' a b)) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b)) (@CompC' a a b f (idC' a)) f *) unfold subtype_image_equal in |- *. (* Goal: forall (a b : C') (f : @subtype_image_carrier (@Hom C (i a) (i b)) (homC' a b)), @Equal (@Hom C (i a) (i b)) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) (@CompC' a a b f (idC' a))) (@subtype_image_inj (@Hom C (i a) (i b)) (homC' a b) f) *) intros a b f; try assumption. apply Trans with (comp_hom (subtype_image_inj f) (subtype_image_inj (idC' a))); (* Goal: @Equal (subcat_Hom a b) (@proj2 (subcat_Hom b c) (subcat_Hom a b) x) (@proj2 (subcat_Hom b c) (subcat_Hom a b) y) *) auto with algebra. apply Trans with (comp_hom (subtype_image_inj f) (Hom_id (i a))); (* Goal: @Equal (subcat_Hom a b) (@proj2 (subcat_Hom b c) (subcat_Hom a b) x) (@proj2 (subcat_Hom b c) (subcat_Hom a b) y) *) auto with algebra. Defined. End Subcategory_def.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export ZArith. Require Export ZArith. Require Export auxiliary. Require Export ZArith_dec. Require Export Zmisc. Hint Resolve Zle_refl: algebra. Require Export Ring_util. Require Export Integral_domain_facts. Definition Zr_aux : RING. apply (BUILD_RING (E:=Leibnitz_set BinInt.Z) (ringplus:=Zplus) (ringmult:=Zmult) (zero:=0%Z) (un:=1%Z) (ringopp:=Zopp)). (* Goal: forall (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))))) *) simpl in |- *. (* Goal: forall (x x' y y' : Z) (_ : @eq Z x x') (_ : @eq Z y y'), @eq Z (Z.mul x y) (Z.mul x' y') *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *) intros x x' y y' H' H'0; try assumption. (* Goal: @eq Z x Z0 *) rewrite H'0. (* Goal: @eq Z y Z0 *) rewrite H'. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) y x) (@ring_mult (cring_ring Zr) x y) *) auto with algebra. (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *) intros x y z; try assumption. (* Goal: @Equal (Leibnitz_set Z) (Z.add (Z.add x y) z) (Z.add x (Z.add y z)) *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x Z0) x *) (* Goal: forall (x y : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x y), @Equal (Leibnitz_set Z) (Z.opp x) (Z.opp y) *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *) (* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *) (* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *) apply Sym. (* Goal: forall (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))))) *) simpl in |- *. (* Goal: @eq Z (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x Z0) x *) (* Goal: forall (x y : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x y), @Equal (Leibnitz_set Z) (Z.opp x) (Z.opp y) *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *) (* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *) (* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *) generalize BinInt.Zplus_assoc. (* Goal: forall _ : not (@eq Z x Z0), sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *) intros H'; try assumption. (* Goal: @eq Z (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x Z0) x *) (* Goal: forall (x y : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x y), @Equal (Leibnitz_set Z) (Z.opp x) (Z.opp y) *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *) (* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *) (* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *) rewrite (H' x y z). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) y x) (@ring_mult (cring_ring Zr) x y) *) auto with algebra. (* Goal: forall (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))))) *) simpl in |- *. (* Goal: forall x : Z, sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *) intros x; try assumption. (* Goal: @eq Z (Z.add x Z0) x *) (* Goal: forall (x y : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x y), @Equal (Leibnitz_set Z) (Z.opp x) (Z.opp y) *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *) (* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *) (* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *) generalize BinInt.Zplus_0_r. (* Goal: forall _ : not (@eq Z x Z0), sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *) intros H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) y x) (@ring_mult (cring_ring Zr) x y) *) rewrite (H' x); auto with algebra. (* Goal: forall (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))))) *) simpl in |- *. (* Goal: forall (x y : Z) (_ : @eq Z x y), @eq Z (Z.opp x) (Z.opp y) *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *) (* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *) (* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *) intros x y H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) y x) (@ring_mult (cring_ring Zr) x y) *) rewrite H'; auto with algebra. (* Goal: forall (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))))) *) simpl in |- *. (* Goal: forall x : Z, sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *) intros x; try assumption. (* Goal: @eq Z (Z.add x (Z.opp x)) Z0 *) (* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *) (* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *) generalize BinInt.Zplus_opp_r. (* Goal: forall _ : not (@eq Z x Z0), sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *) intros H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) y x) (@ring_mult (cring_ring Zr) x y) *) rewrite (H' x); auto with algebra. (* Goal: forall (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))))) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))))) *) intros x y; try assumption. (* Goal: @eq Z (Z.add x y) (Z.add y x) *) (* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *) generalize BinInt.Zplus_comm. (* Goal: forall _ : not (@eq Z x Z0), sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *) intros H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) y x) (@ring_mult (cring_ring Zr) x y) *) rewrite (H' x y); auto with algebra. (* Goal: forall (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))))) *) simpl in |- *. (* Goal: forall (x x' y y' : Z) (_ : @eq Z x x') (_ : @eq Z y y'), @eq Z (Z.mul x y) (Z.mul x' y') *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *) intros x x' y y' H' H'0; try assumption. (* Goal: @eq Z x Z0 *) rewrite H'0. (* Goal: @eq Z y Z0 *) rewrite H'. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) y x) (@ring_mult (cring_ring Zr) x y) *) auto with algebra. (* Goal: forall (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))))) *) simpl in |- *. (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *) intros x y z; try assumption. (* Goal: @eq Z (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *) generalize BinInt.Zmult_assoc. (* Goal: forall _ : not (@eq Z x Z0), sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *) intros H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) y x) (@ring_mult (cring_ring Zr) x y) *) rewrite (H' x y z); auto with algebra. (* Goal: forall (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))))) *) simpl in |- *. (* Goal: forall x : Z, sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *) intros x; try assumption. (* Goal: @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *) generalize BinInt.Zmult_1_l. (* Goal: forall _ : not (@eq Z x Z0), sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *) intros H'; try assumption. (* Goal: @eq Z (Z.mul x (Zpos xH)) x *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *) replace (x * 1)%Z with (1 * x)%Z. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) y x) (@ring_mult (cring_ring Zr) x y) *) rewrite (H' x); auto with algebra. (* Goal: @eq Z (Z.mul (Zpos xH) x) (Z.mul x (Zpos xH)) *) (* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *) apply BinInt.Zmult_comm. (* Goal: forall x : Z, sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *) intros x; try assumption. (* Goal: @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *) generalize BinInt.Zmult_1_l. (* Goal: forall _ : not (@eq Z x Z0), sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *) intros H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) y x) (@ring_mult (cring_ring Zr) x y) *) rewrite (H' x); auto with algebra. (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *) intros x y z; try assumption. (* Goal: @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *) (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *) generalize BinInt.Zmult_plus_distr_r. (* Goal: forall _ : not (@eq Z x Z0), sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *) intros H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) y x) (@ring_mult (cring_ring Zr) x y) *) rewrite (H' x y z); auto with algebra. (* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *) intros x y z; try assumption. (* Goal: @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *) generalize BinInt.Zmult_plus_distr_l. (* Goal: forall _ : not (@eq Z x Z0), sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *) intros H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) y x) (@ring_mult (cring_ring Zr) x y) *) rewrite (H' x y z); auto with algebra. Defined. Definition Zr : CRING. (* Goal: Ob CRING *) apply (Build_cring (cring_ring:=Zr_aux)). (* Goal: cring_on Zr_aux *) apply (Build_cring_on (R:=Zr_aux)). (* Goal: idomain_prop Zr *) red in |- *. (* Goal: forall (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))))) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))))) *) intros x y; try assumption. (* Goal: @eq Z (Z.mul x y) (Z.mul y x) *) generalize BinInt.Zmult_comm. (* Goal: forall _ : not (@eq Z x Z0), sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *) intros H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) y x) (@ring_mult (cring_ring Zr) x y) *) rewrite (H' x y); auto with algebra. Defined. Definition Zzero_dec : forall x : Zr, {Equal x (monoid_unit Zr)} + {~ Equal x (monoid_unit Zr)}. (* Goal: forall (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))))) *) simpl in |- *. (* Goal: forall x : Z, sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *) intros x; try assumption. (* Goal: sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *) case (Z_eq_dec x 0). (* Goal: forall _ : not (@eq Z x Z0), sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *) intros H'; try assumption. (* Goal: sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *) (* Goal: forall _ : not (@eq Z x Z0), sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *) cut (x = 0%Z :>BinInt.Z). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) y x) (@ring_mult (cring_ring Zr) x y) *) auto with algebra. (* Goal: @eq Z y Z0 *) rewrite H'. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) y x) (@ring_mult (cring_ring Zr) x y) *) auto with algebra. (* Goal: forall _ : not (@eq Z x Z0), sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *) intros H'; try assumption. (* Goal: sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *) cut (x <> 0%Z :>BinInt.Z). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) y x) (@ring_mult (cring_ring Zr) x y) *) auto with algebra. (* Goal: idomain_prop Zr *) red in |- *. (* Goal: forall _ : @eq Z x Z0, False *) intros H'0; try assumption. (* Goal: False *) apply H'. (* Goal: @eq Z x Z0 *) rewrite H'0. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) y x) (@ring_mult (cring_ring Zr) x y) *) auto with algebra. Defined. Definition ZZ : INTEGRAL_DOMAIN. (* Goal: Ob INTEGRAL_DOMAIN *) apply (Build_idomain (idomain_ring:=Zr)). (* Goal: idomain_on Zr *) apply Build_idomain_on. (* Goal: idomain_prop Zr *) red in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))))) *) intros x y; try assumption. (* Goal: forall (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))))) *) simpl in |- *. (* Goal: forall (_ : not (@eq Z x Z0)) (_ : not (@eq Z y Z0)), not (@eq Z (@ring_mult Zr_aux x y) Z0) *) generalize (BinInt.Zmult_integral_l x y). (* Goal: forall (_ : forall (_ : not (@eq Z x Z0)) (_ : @eq Z (Z.mul y x) Z0), @eq Z y Z0) (_ : not (@eq Z x Z0)) (_ : not (@eq Z y Z0)), not (@eq Z (@ring_mult Zr_aux x y) Z0) *) unfold not in |- *. (* Goal: forall (_ : forall (_ : forall _ : @eq Z x Z0, False) (_ : @eq Z (Z.mul y x) Z0), @eq Z y Z0) (_ : forall _ : @eq Z x Z0, False) (_ : forall _ : @eq Z y Z0, False) (_ : @eq Z (@ring_mult Zr_aux x y) Z0), False *) intros H' H'0 H'1 H'2; try assumption. (* Goal: False *) apply H'1. (* Goal: @eq Z y Z0 *) rewrite H'. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) y x) (@ring_mult (cring_ring Zr) x y) *) auto with algebra. (* Goal: forall _ : @eq Z x Z0, False *) (* Goal: @eq Z (Z.mul y x) Z0 *) intros H'3; try assumption. (* Goal: False *) (* Goal: @eq Z (Z.mul y x) Z0 *) apply H'0. (* Goal: @eq Z x Z0 *) (* Goal: @eq Z (Z.mul y x) Z0 *) rewrite H'3. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) y x) (@ring_mult (cring_ring Zr) x y) *) auto with algebra. (* Goal: @eq Z (Z.mul y x) Z0 *) rewrite <- H'2. (* Goal: @eq Z (Z.mul y x) (@ring_mult Zr_aux x y) *) change (Equal (ring_mult y x) (ring_mult x y)) in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) y x) (@ring_mult (cring_ring Zr) x y) *) auto with algebra. Defined.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Automatic Coercions Import. Set Implicit Arguments. Unset Strict Implicit. Unset Standard Proposition Elimination Names. Require Export Zring. Require Export Group_kernel. (** Title "Universal property of integers." *) Section Int_power. Variable G : GROUP. Set Strict Implicit. Unset Implicit Arguments. Definition group_square (x : G) : G := sgroup_law G x x. Set Implicit Arguments. Unset Strict Implicit. End Int_power. Section Zup1. Variable G : GROUP. Variable r : G. Fixpoint nat_to_group (n : nat) : G := match n with | O => monoid_unit G | S n' => sgroup_law G (nat_to_group n') r end. Definition pos_abs : forall x : Z, (x > 0)%Z -> positive. (* Goal: forall (x : Z) (px : Z.gt x Z0), @eq Z x (Zpos (@pos_abs x px)) *) intros x; try assumption. (* Goal: forall _ : Z.gt x Z0, positive *) case x. (* Goal: forall _ : Z.gt Z0 Z0, positive *) (* Goal: forall (p : positive) (_ : Z.gt (Zpos p) Z0), positive *) (* Goal: forall (p : positive) (_ : Z.gt (Zneg p) Z0), positive *) intros H'; red in H'. (* Goal: @eq Z (Z.add (Zpos p) (Zneg q)) (Zneg (Pos.sub q p)) *) simpl in H'. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) r *) inversion H'. (* Goal: forall (p : positive) (_ : Z.gt (Zpos p) Z0), positive *) (* Goal: forall (p : positive) (_ : Z.gt (Zneg p) Z0), positive *) intros p H'. (* Goal: positive *) (* Goal: forall (p : positive) (_ : Z.gt (Zneg p) Z0), positive *) exact p. (* Goal: forall (p : positive) (_ : Z.gt (Zneg p) Z0), positive *) intros p H'; red in H'. (* Goal: @eq Z (Z.add (Zpos p) (Zneg q)) (Zneg (Pos.sub q p)) *) simpl in H'. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) r *) inversion H'. Defined. Lemma pos_abs_ok : forall (x : Z) (px : (x > 0)%Z), x = Zpos (pos_abs px). (* Goal: forall (x : Z) (px : Z.gt x Z0), @eq Z x (Zpos (@pos_abs x px)) *) intros x; try assumption. (* Goal: forall px : Z.gt x Z0, @eq Z x (Zpos (@pos_abs x px)) *) elim x. (* Goal: forall px : Z.gt Z0 Z0, @eq Z Z0 (Zpos (@pos_abs Z0 px)) *) (* Goal: forall (p : positive) (px : Z.gt (Zpos p) Z0), @eq Z (Zpos p) (Zpos (@pos_abs (Zpos p) px)) *) (* Goal: forall (p : positive) (px : Z.gt (Zneg p) Z0), @eq Z (Zneg p) (Zpos (@pos_abs (Zneg p) px)) *) intros px; red in px. (* Goal: @eq Z (Zneg p) (Zpos (@pos_abs (Zneg p) px)) *) simpl in px. (* Goal: @eq Z (Zneg p) (Zpos (@pos_abs (Zneg p) px)) *) inversion px. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g)))) *) simpl in |- *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: forall (p : positive) (px : Z.gt (Zneg p) Z0), @eq Z (Zneg p) (Zpos (@pos_abs (Zneg p) px)) *) intros p px; red in px. (* Goal: @eq Z (Zneg p) (Zpos (@pos_abs (Zneg p) px)) *) simpl in px. (* Goal: @eq Z (Zneg p) (Zpos (@pos_abs (Zneg p) px)) *) inversion px. Qed. Lemma Zlt_reg_l : forall a b c : Z, (a < b)%Z -> (c + a < c + b)%Z. (* Goal: forall (a b c : Z) (_ : Z.lt a b), Z.lt (Z.add c a) (Z.add c b) *) intros a b c; try assumption. (* Goal: forall _ : Z.lt a b, Z.lt (Z.add c a) (Z.add c b) *) unfold Zlt, not in |- *. (* Goal: forall _ : @eq Z (ring_unit (cring_ring (idomain_ring ZZ))) Z0, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) r *) intros H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (Z.add (Zpos p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Pos.to_nat p)) (group_inverse G (nat_to_group (Pos.to_nat p0)))) *) rewrite <- H'. (* Goal: @eq comparison (Z.compare (Z.add c a) (Z.add c b)) (Z.compare a b) *) apply Zcompare_plus_compat; assumption. Qed. Lemma Zlemma1 : forall x : Z, (x < 0)%Z -> (- x > 0)%Z. (* Goal: forall (x : Z) (_ : Z.lt x Z0), Z.gt (Z.opp x) Z0 *) intros x H'; try assumption. (* Goal: Z.gt (Z.opp x) Z0 *) apply Zlt_gt. (* Goal: Z.lt Z0 (Z.opp x) *) replace (- x)%Z with (- x + 0)%Z. (* Goal: Z.lt Z0 (Z.add (Z.opp x) Z0) *) (* Goal: @eq Z (Z.add (Z.opp x) Z0) (Z.opp x) *) pattern 0%Z at 1 in |- *. (* Goal: (fun z : Z => Z.lt z (Z.add (Z.opp x) Z0)) Z0 *) (* Goal: @eq Z (Z.add (Z.opp x) Z0) (Z.opp x) *) replace 0%Z with (- x + x)%Z. (* Goal: Z.lt (Z.add (Z.opp x) x) (Z.add (Z.opp x) Z0) *) (* Goal: @eq Z (Z.add (Z.opp x) x) Z0 *) (* Goal: @eq Z (Z.add (Z.opp x) Z0) (Z.opp x) *) apply Zlt_reg_l. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: @eq Z (Z.add (Z.opp x) x) Z0 *) (* Goal: @eq Z (Z.add (Z.opp x) Z0) (Z.opp x) *) apply Zplus_opp_l. (* Goal: @eq Z (Z.add (Z.opp x) Z0) (Z.opp x) *) apply Zplus_0_r. Qed. Comments "The powers of" r ".". Definition Z_to_group_nat_fun : ZZ -> G. (* Goal: forall _ : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))), Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) intros x. (* Goal: Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) case (Z_gt_le_dec x 0); intros z. (* Goal: Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) (* Goal: Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) exact (nat_to_group (nat_of_P (pos_abs z))). (* Goal: Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) case (Z_le_lt_eq_dec _ _ z); intros. (* Goal: Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) (* Goal: Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) cut (- x > 0)%Z. (* Goal: forall _ : Z.gt (Z.opp x) Z0, Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) intros H'. (* Goal: Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) exact (group_inverse G (nat_to_group (nat_of_P (pos_abs H')))). (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) apply Zlemma1. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) exact (monoid_unit G). Defined. Lemma nat_to_group_com : forall n : nat, Equal (sgroup_law G (nat_to_group n) r) (sgroup_law G r (nat_to_group n)). (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) simple induction n; simpl in |- *; auto with *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) apply Trans with r; auto with *. (* Goal: forall (n : nat) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group n) (group_inverse G r)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G r) (nat_to_group n))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group n) r) (group_inverse G r)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G r) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group n) r)) *) intros n0 H'; try assumption. apply Trans with (sgroup_law G (sgroup_law G r (nat_to_group n0)) r); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. Qed. Hint Resolve nat_to_group_com: algebra. Lemma nat_to_group_add : forall n m : nat, Equal (nat_to_group (n + m)) (sgroup_law G (nat_to_group n) (nat_to_group m)). (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g)))) *) simple induction n; simpl in |- *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: forall (n : nat) (_ : forall m : nat, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group m) (group_inverse G (nat_to_group n))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (nat_to_group n)) (nat_to_group m))) (m : nat), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group m) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group n) r))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group n) r)) (nat_to_group m)) *) intros n0 H' m; try assumption. apply Trans with (sgroup_law G (nat_to_group n0) (sgroup_law G r (nat_to_group m))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. apply Trans with (sgroup_law G (nat_to_group n0) (sgroup_law G (nat_to_group m) r)); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. apply Trans with (sgroup_law G (sgroup_law G (nat_to_group n0) (nat_to_group m)) r); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. Qed. Hint Resolve nat_to_group_add: algebra. Lemma ax1 : ~ (0 > 0)%Z. (* Goal: gt (Pos.to_nat q) (Pos.to_nat p) *) red in |- *. (* Goal: forall _ : @eq Z (ring_unit (cring_ring (idomain_ring ZZ))) Z0, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) r *) intros H'; try assumption. (* Goal: False *) red in H'. (* Goal: @eq Z (Z.add (Zpos p) (Zneg q)) (Zneg (Pos.sub q p)) *) simpl in H'. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) r *) inversion H'. Qed. Hint Resolve ax1: algebra. Lemma ax2 : ~ (0 < 0)%Z. (* Goal: gt (Pos.to_nat q) (Pos.to_nat p) *) red in |- *. (* Goal: forall _ : @eq Z (ring_unit (cring_ring (idomain_ring ZZ))) Z0, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) r *) intros H'; try assumption. (* Goal: False *) red in H'. (* Goal: @eq Z (Z.add (Zpos p) (Zneg q)) (Zneg (Pos.sub q p)) *) simpl in H'. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) r *) inversion H'. Qed. Hint Resolve ax2: algebra. Lemma Zl1 : Equal (Z_to_group_nat_fun 0%Z) (monoid_unit G). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) match Z_gt_le_dec z Z0 with | left z0 => pos_to_group r (@pos_abs z z0) | right z0 => match Z_le_lt_eq_dec z Z0 z0 with | left l => pos_to_group (group_inverse G r) (@pos_abs (Z.opp z) (@Zlemma1 z l)) | right e => @monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)) end end (@Z_to_group_nat_fun G r z) *) unfold Z_to_group_nat_fun in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) match Z_gt_le_dec Z0 Z0 with | left z => nat_to_group (Pos.to_nat (@pos_abs Z0 z)) | right z => match Z_le_lt_eq_dec Z0 Z0 z with | left l => group_inverse G (nat_to_group (Pos.to_nat (@pos_abs (Z.opp Z0) (@Zlemma1 Z0 l)))) | right e => @monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)) end end (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) case (Z_gt_le_dec 0 0). (* Goal: forall l : Z.le (ring_unit (cring_ring (idomain_ring ZZ))) Z0, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) match Z_le_lt_eq_dec (ring_unit (cring_ring (idomain_ring ZZ))) Z0 l with | left l0 => group_inverse G (nat_to_group (Pos.to_nat (@pos_abs (Z.opp (ring_unit (cring_ring (idomain_ring ZZ)))) (@Zlemma1 (ring_unit (cring_ring (idomain_ring ZZ))) l0)))) | right e => @monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)) end r *) intros z; try assumption. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) absurd (0 > 0)%Z; auto with *. (* Goal: forall l : Z.le (ring_unit (cring_ring (idomain_ring ZZ))) Z0, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) match Z_le_lt_eq_dec (ring_unit (cring_ring (idomain_ring ZZ))) Z0 l with | left l0 => group_inverse G (nat_to_group (Pos.to_nat (@pos_abs (Z.opp (ring_unit (cring_ring (idomain_ring ZZ)))) (@Zlemma1 (ring_unit (cring_ring (idomain_ring ZZ))) l0)))) | right e => @monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)) end r *) intros z; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) match Z_le_lt_eq_dec Z0 Z0 z with | left l => group_inverse G (nat_to_group (Pos.to_nat (@pos_abs (Z.opp Z0) (@Zlemma1 Z0 l)))) | right e => @monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)) end (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) case (Z_le_lt_eq_dec 0 0 z). (* Goal: forall l : Z.lt (ring_unit (cring_ring (idomain_ring ZZ))) Z0, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G (nat_to_group (Pos.to_nat (@pos_abs (Z.opp (ring_unit (cring_ring (idomain_ring ZZ)))) (@Zlemma1 (ring_unit (cring_ring (idomain_ring ZZ))) l))))) r *) (* Goal: forall _ : @eq Z (ring_unit (cring_ring (idomain_ring ZZ))) Z0, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) r *) intros z0; try assumption. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) absurd (0 < 0)%Z; auto with *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. Qed. Hint Resolve Zl1: algebra. Lemma ax3 : forall p : positive, (Zpos p > 0)%Z. (* Goal: forall p : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) Z0 (Zneg p))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun Z0) (Z_to_group_nat_fun (Zneg p))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) Z0)) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun Z0)) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) (Zpos p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun (Zpos p0))) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun (Zneg p0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) Z0)) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun Z0)) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) (Zpos p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun (Zpos p0))) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun (Zneg p0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (@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 G)) (monoid_on_def (group_monoid G))) *) intros p; try assumption. (* Goal: gt (Pos.to_nat q) (Pos.to_nat p) *) red in |- *. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g)))) *) simpl in |- *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. Qed. Hint Resolve ax3: algebra. Lemma Zl2 : forall p : positive, Equal (Z_to_group_nat_fun (Zpos p)) (nat_to_group (nat_of_P (pos_abs (ax3 p)))). (* Goal: forall p : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) Z0 (Zneg p))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun Z0) (Z_to_group_nat_fun (Zneg p))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) Z0)) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun Z0)) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) (Zpos p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun (Zpos p0))) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun (Zneg p0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) Z0)) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun Z0)) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) (Zpos p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun (Zpos p0))) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun (Zneg p0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (@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 G)) (monoid_on_def (group_monoid G))) *) intros p; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) match Z_gt_le_dec z Z0 with | left z0 => pos_to_group r (@pos_abs z z0) | right z0 => match Z_le_lt_eq_dec z Z0 z0 with | left l => pos_to_group (group_inverse G r) (@pos_abs (Z.opp z) (@Zlemma1 z l)) | right e => @monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)) end end (@Z_to_group_nat_fun G r z) *) unfold Z_to_group_nat_fun in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) match Z_gt_le_dec (Zpos p) Z0 with | left z => nat_to_group (Pos.to_nat (@pos_abs (Zpos p) z)) | right z => match Z_le_lt_eq_dec (Zpos p) Z0 z with | left l => group_inverse G (nat_to_group (Pos.to_nat (@pos_abs (Z.opp (Zpos p)) (@Zlemma1 (Zpos p) l)))) | right e => @monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)) end end (nat_to_group (Pos.to_nat (@pos_abs (Zpos p) (ax3 p)))) *) case (Z_gt_le_dec (Zpos p) 0); intros z. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) simpl in |- *; auto with *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) match Z_le_lt_eq_dec (Zpos p) Z0 z with | left l => group_inverse G (nat_to_group (Pos.to_nat (@pos_abs (Z.opp (Zpos p)) (@Zlemma1 (Zpos p) l)))) | right e => @monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)) end (nat_to_group (Pos.to_nat (@pos_abs (Zpos p) (ax3 p)))) *) case (Z_le_lt_eq_dec (Zpos p) 0 z); intros. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) absurd (Zpos p < 0)%Z; auto with *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (group_inverse G (nat_to_group (Pos.to_nat (@pos_abs (Zpos p) (ax3 p))))) *) inversion e. Qed. Hint Resolve Zl2: algebra. Lemma ax4 : forall p : positive, ~ (Zneg p > 0)%Z. (* Goal: gt (Pos.to_nat q) (Pos.to_nat p) *) intros p; red in |- *. (* Goal: forall _ : @eq Z (ring_unit (cring_ring (idomain_ring ZZ))) Z0, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) r *) intros H'; try assumption. (* Goal: False *) red in H'. (* Goal: @eq Z (Z.add (Zpos p) (Zneg q)) (Zneg (Pos.sub q p)) *) simpl in H'. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) r *) inversion H'. Qed. Hint Resolve ax4: algebra. Lemma Zl3 : forall p : positive, Equal (Z_to_group_nat_fun (Zneg p)) (group_inverse G (nat_to_group (nat_of_P (pos_abs (ax3 p))))). (* Goal: forall p : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) Z0 (Zneg p))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun Z0) (Z_to_group_nat_fun (Zneg p))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) Z0)) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun Z0)) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) (Zpos p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun (Zpos p0))) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun (Zneg p0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) Z0)) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun Z0)) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) (Zpos p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun (Zpos p0))) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun (Zneg p0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (@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 G)) (monoid_on_def (group_monoid G))) *) intros p; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) match Z_gt_le_dec z Z0 with | left z0 => pos_to_group r (@pos_abs z z0) | right z0 => match Z_le_lt_eq_dec z Z0 z0 with | left l => pos_to_group (group_inverse G r) (@pos_abs (Z.opp z) (@Zlemma1 z l)) | right e => @monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)) end end (@Z_to_group_nat_fun G r z) *) unfold Z_to_group_nat_fun in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) match Z_gt_le_dec (Zneg p) Z0 with | left z => nat_to_group (Pos.to_nat (@pos_abs (Zneg p) z)) | right z => match Z_le_lt_eq_dec (Zneg p) Z0 z with | left l => group_inverse G (nat_to_group (Pos.to_nat (@pos_abs (Z.opp (Zneg p)) (@Zlemma1 (Zneg p) l)))) | right e => @monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)) end end (group_inverse G (nat_to_group (Pos.to_nat (@pos_abs (Zpos p) (ax3 p))))) *) case (Z_gt_le_dec (Zneg p) 0); intros z. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) absurd (Zneg p > 0)%Z; auto with *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) match Z_le_lt_eq_dec (Zneg p) Z0 z with | left l => group_inverse G (nat_to_group (Pos.to_nat (@pos_abs (Z.opp (Zneg p)) (@Zlemma1 (Zneg p) l)))) | right e => @monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)) end (group_inverse G (nat_to_group (Pos.to_nat (@pos_abs (Zpos p) (ax3 p))))) *) case (Z_le_lt_eq_dec (Zneg p) 0 z); intros. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) simpl in |- *; auto with *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (group_inverse G (nat_to_group (Pos.to_nat (@pos_abs (Zpos p) (ax3 p))))) *) inversion e. Qed. Hint Resolve Zl3: algebra. Lemma ax5 : forall p q : positive, (Zpos p > Zpos q)%Z -> (Zpos p + Zneg q)%Z = Zpos (p - q). (* Goal: False *) intros p q H'; red in H'. (* Goal: @eq Z (Z.add (Zpos p) (Zneg q)) (Zneg (Pos.sub q p)) *) simpl in H'. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g)))) *) simpl in |- *. (* Goal: @eq Z (Z.pos_sub p q) (Zneg (Pos.sub q p)) *) rewrite Z.pos_sub_spec. (* Goal: @eq Z match Pos.compare p q with | Eq => Z0 | Lt => Zneg (Pos.sub q p) | Gt => Zpos (Pos.sub p q) end (Zneg (Pos.sub q p)) *) rewrite H'. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. Qed. Lemma ax6 : forall p q : positive, (Zpos p < Zpos q)%Z -> (Zpos p + Zneg q)%Z = Zneg (q - p). (* Goal: False *) intros p q H'; red in H'. (* Goal: @eq Z (Z.add (Zpos p) (Zneg q)) (Zneg (Pos.sub q p)) *) simpl in H'. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g)))) *) simpl in |- *. (* Goal: @eq Z (Z.pos_sub p q) (Zneg (Pos.sub q p)) *) rewrite Z.pos_sub_spec. (* Goal: @eq Z match Pos.compare p q with | Eq => Z0 | Lt => Zneg (Pos.sub q p) | Gt => Zpos (Pos.sub p q) end (Zneg (Pos.sub q p)) *) rewrite H'. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. Qed. Lemma ax7 : forall p : positive, (Zpos p + Zneg p)%Z = 0%Z. (* Goal: forall p : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) Z0 (Zneg p))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun Z0) (Z_to_group_nat_fun (Zneg p))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) Z0)) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun Z0)) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) (Zpos p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun (Zpos p0))) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun (Zneg p0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) Z0)) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun Z0)) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) (Zpos p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun (Zpos p0))) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun (Zneg p0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (@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 G)) (monoid_on_def (group_monoid G))) *) intros p; try assumption. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g)))) *) simpl in |- *. (* Goal: @eq Z (Z.pos_sub p p) Z0 *) rewrite Z.pos_sub_spec; unfold Pos.compare. (* Goal: @eq Z match Pos.compare_cont Eq p p with | Eq => Z0 | Lt => Zneg (Pos.sub p p) | Gt => Zpos (Pos.sub p p) end Z0 *) replace (Pcompare p p Datatypes.Eq) with Datatypes.Eq. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: @eq comparison Eq (Pos.compare_cont Eq p p) *) elim p. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g)))) *) intros p0; simpl in |- *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g)))) *) intros p0; simpl in |- *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g)))) *) simpl in |- *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. Qed. Hint Resolve ax7 ax6 ax5: algebra. Lemma nat_to_group_com2 : forall n m : nat, Equal (sgroup_law G (nat_to_group n) (nat_to_group m)) (sgroup_law G (nat_to_group m) (nat_to_group n)). (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) simple induction n; simpl in |- *; auto with *. (* Goal: forall m : nat, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group m) (group_inverse G (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) (nat_to_group m)) *) (* Goal: forall (n : nat) (_ : forall m : nat, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group m) (group_inverse G (nat_to_group n))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (nat_to_group n)) (nat_to_group m))) (m : nat), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group m) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group n) r))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group n) r)) (nat_to_group m)) *) intros m; try assumption. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) apply Trans with (nat_to_group m); auto with *. (* Goal: forall (n : nat) (_ : forall m : nat, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group m) (group_inverse G (nat_to_group n))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (nat_to_group n)) (nat_to_group m))) (m : nat), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group m) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group n) r))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group n) r)) (nat_to_group m)) *) intros n0 H' m; try assumption. apply Trans with (sgroup_law G (nat_to_group n0) (sgroup_law G r (nat_to_group m))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. apply Trans with (sgroup_law G (nat_to_group n0) (sgroup_law G (nat_to_group m) r)); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. apply Trans with (sgroup_law G (sgroup_law G (nat_to_group n0) (nat_to_group m)) r); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. apply Trans with (sgroup_law G (sgroup_law G (nat_to_group m) (nat_to_group n0)) r); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. Qed. Hint Resolve nat_to_group_com2: algebra. Lemma nat_to_group_minus : forall n m : nat, n > m -> Equal (nat_to_group (n - m)) (sgroup_law G (nat_to_group n) (group_inverse G (nat_to_group m))). (* Goal: forall (n m : nat) (_ : gt n m), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (nat_to_group (Init.Nat.sub n m)) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group n) (group_inverse G (nat_to_group m))) *) intros n m H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (nat_to_group (Init.Nat.sub n m)) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group n) (group_inverse G (nat_to_group m))) *) replace n with (m + (n - m)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (nat_to_group (Init.Nat.sub (Init.Nat.add m (Init.Nat.sub n m)) m)) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Init.Nat.add m (Init.Nat.sub n m))) (group_inverse G (nat_to_group m))) *) (* Goal: @eq nat (Init.Nat.add m (Init.Nat.sub n m)) n *) rewrite minus_plus. apply Trans with (sgroup_law G (sgroup_law G (nat_to_group m) (nat_to_group (n - m))) (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) (group_inverse G (nat_to_group m))); auto with *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) apply GROUP_reg_right with (nat_to_group m); auto with *. apply Trans with (sgroup_law G (sgroup_law G (nat_to_group m) (nat_to_group (n - m))) (sgroup_law G (group_inverse G (nat_to_group m)) (nat_to_group m))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. apply Trans with (sgroup_law G (sgroup_law G (nat_to_group m) (nat_to_group (n - m))) (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) (monoid_unit G)); auto with *. apply Trans with (sgroup_law G (nat_to_group m) (nat_to_group (n - m))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. Qed. Hint Resolve nat_to_group_minus: algebra. Lemma ax8 : forall p q : positive, Pcompare p q Datatypes.Eq = Datatypes.Lt -> Pcompare q p Datatypes.Eq = Datatypes.Gt. (* Goal: forall (p q : positive) (_ : @eq comparison (Pos.compare_cont Eq p q) Lt), @eq comparison (Pos.compare_cont Eq q p) Gt *) intros p q H'; try assumption. (* Goal: @eq comparison (Pos.compare_cont Eq q p) Gt *) apply nat_of_P_gt_Gt_compare_complement_morphism. (* Goal: gt (Pos.to_nat q) (Pos.to_nat p) *) red in |- *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) apply nat_of_P_lt_Lt_compare_morphism; auto with *. Qed. Hint Resolve ax8: algebra. Lemma Zl4 : forall p p0 : positive, Equal (Z_to_group_nat_fun (Zpos p + Zneg p0)%Z) (sgroup_law G (nat_to_group (nat_of_P p)) (group_inverse G (nat_to_group (nat_of_P p0)))). (* Goal: forall p p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (Z.add (Zpos p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Pos.to_nat p)) (group_inverse G (nat_to_group (Pos.to_nat p0)))) *) intros p p0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (Z.add (Zpos p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Pos.to_nat p)) (group_inverse G (nat_to_group (Pos.to_nat p0)))) *) case (Z_gt_le_dec (Zpos p) (Zpos p0)); intros z. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) rewrite ax5; auto with *. apply Trans with (nat_to_group (nat_of_P (pos_abs (ax3 (p - p0))))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g)))) *) simpl in |- *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) rewrite nat_of_P_minus_morphism; auto with *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (nat_to_group (Init.Nat.sub (Pos.to_nat p0) (Pos.to_nat p))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Pos.to_nat p0)) (group_inverse G (nat_to_group (Pos.to_nat p)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Pos.to_nat p0)) (group_inverse G (nat_to_group (Pos.to_nat p))))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Pos.to_nat p)) (group_inverse G (nat_to_group (Pos.to_nat p0)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (Z.add (Zpos p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Pos.to_nat p)) (group_inverse G (nat_to_group (Pos.to_nat p0)))) *) apply nat_to_group_minus. (* Goal: gt (Pos.to_nat p0) (Pos.to_nat p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Pos.to_nat p0)) (group_inverse G (nat_to_group (Pos.to_nat p))))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Pos.to_nat p)) (group_inverse G (nat_to_group (Pos.to_nat p0)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (Z.add (Zpos p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Pos.to_nat p)) (group_inverse G (nat_to_group (Pos.to_nat p0)))) *) apply nat_of_P_gt_Gt_compare_morphism. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) case (Z_le_lt_eq_dec _ _ z); intros. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) rewrite ax6; auto with *. apply Trans with (group_inverse G (nat_to_group (nat_of_P (pos_abs (ax3 (p0 - p)))))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g)))) *) simpl in |- *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) rewrite nat_of_P_minus_morphism; auto with *. apply Trans with (group_inverse G (sgroup_law G (nat_to_group (nat_of_P p0)) (group_inverse G (nat_to_group (nat_of_P p))))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G (nat_to_group (Init.Nat.sub (Pos.to_nat p0) (Pos.to_nat p)))) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Pos.to_nat p0)) (group_inverse G (nat_to_group (Pos.to_nat p))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Pos.to_nat p0)) (group_inverse G (nat_to_group (Pos.to_nat p))))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Pos.to_nat p)) (group_inverse G (nat_to_group (Pos.to_nat p0)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (Z.add (Zpos p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Pos.to_nat p)) (group_inverse G (nat_to_group (Pos.to_nat p0)))) *) apply GROUP_comp. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (nat_to_group (Init.Nat.sub (Pos.to_nat p0) (Pos.to_nat p))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Pos.to_nat p0)) (group_inverse G (nat_to_group (Pos.to_nat p)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Pos.to_nat p0)) (group_inverse G (nat_to_group (Pos.to_nat p))))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Pos.to_nat p)) (group_inverse G (nat_to_group (Pos.to_nat p0)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (Z.add (Zpos p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Pos.to_nat p)) (group_inverse G (nat_to_group (Pos.to_nat p0)))) *) apply nat_to_group_minus. (* Goal: gt (Pos.to_nat p0) (Pos.to_nat p) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Pos.to_nat p0)) (group_inverse G (nat_to_group (Pos.to_nat p))))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Pos.to_nat p)) (group_inverse G (nat_to_group (Pos.to_nat p0)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (Z.add (Zpos p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Pos.to_nat p)) (group_inverse G (nat_to_group (Pos.to_nat p0)))) *) apply nat_of_P_gt_Gt_compare_morphism. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. apply Trans with (sgroup_law G (group_inverse G (group_inverse G (nat_to_group (nat_of_P p)))) (group_inverse G (nat_to_group (nat_of_P p0)))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (Z.add (Zpos p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Pos.to_nat p)) (group_inverse G (nat_to_group (Pos.to_nat p0)))) *) injection e. (* Goal: forall _ : @eq Z (ring_unit (cring_ring (idomain_ring ZZ))) Z0, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) r *) intros H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (Z.add (Zpos p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Pos.to_nat p)) (group_inverse G (nat_to_group (Pos.to_nat p0)))) *) rewrite <- H'. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (Z.add (Zpos p) (Zneg p))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group (Pos.to_nat p)) (group_inverse G (nat_to_group (Pos.to_nat p)))) *) rewrite ax7. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) apply Trans with (monoid_unit G); auto with *. Qed. Hint Resolve Zl4: algebra. Lemma nat_to_group_com3 : forall n : nat, Equal (sgroup_law G (nat_to_group n) (group_inverse G r)) (sgroup_law G (group_inverse G r) (nat_to_group n)). (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) simple induction n; simpl in |- *; auto with *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) apply Trans with (group_inverse G r); auto with *. (* Goal: forall (n : nat) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group n) (group_inverse G r)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G r) (nat_to_group n))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group n) r) (group_inverse G r)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G r) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group n) r)) *) intros n0 H'; try assumption. apply Trans with (sgroup_law G (nat_to_group n0) (sgroup_law G r (group_inverse G r))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. apply Trans with (sgroup_law G (nat_to_group n0) (monoid_unit G)); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) apply Trans with (nat_to_group n0); auto with *. apply Trans with (sgroup_law G (group_inverse G r) (sgroup_law G r (nat_to_group n0))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. apply Trans with (sgroup_law G (sgroup_law G (group_inverse G r) r) (nat_to_group n0)); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. apply Trans with (sgroup_law G (monoid_unit G) (nat_to_group n0)); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. Qed. Hint Resolve nat_to_group_com3: algebra. Lemma Zl5 : Equal (Z_to_group_nat_fun (ring_unit ZZ)) r. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) match Z_gt_le_dec z Z0 with | left z0 => pos_to_group r (@pos_abs z z0) | right z0 => match Z_le_lt_eq_dec z Z0 z0 with | left l => pos_to_group (group_inverse G r) (@pos_abs (Z.opp z) (@Zlemma1 z l)) | right e => @monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)) end end (@Z_to_group_nat_fun G r z) *) unfold Z_to_group_nat_fun in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) match Z_gt_le_dec (ring_unit (cring_ring (idomain_ring ZZ))) Z0 with | left z => nat_to_group (Pos.to_nat (@pos_abs (ring_unit (cring_ring (idomain_ring ZZ))) z)) | right z => match Z_le_lt_eq_dec (ring_unit (cring_ring (idomain_ring ZZ))) Z0 z with | left l => group_inverse G (nat_to_group (Pos.to_nat (@pos_abs (Z.opp (ring_unit (cring_ring (idomain_ring ZZ)))) (@Zlemma1 (ring_unit (cring_ring (idomain_ring ZZ))) l)))) | right e => @monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)) end end r *) case (Z_gt_le_dec (ring_unit ZZ) 0). (* Goal: forall l : Z.le (ring_unit (cring_ring (idomain_ring ZZ))) Z0, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) match Z_le_lt_eq_dec (ring_unit (cring_ring (idomain_ring ZZ))) Z0 l with | left l0 => group_inverse G (nat_to_group (Pos.to_nat (@pos_abs (Z.opp (ring_unit (cring_ring (idomain_ring ZZ)))) (@Zlemma1 (ring_unit (cring_ring (idomain_ring ZZ))) l0)))) | right e => @monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)) end r *) intros z; try assumption. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g)))) *) simpl in |- *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: forall l : Z.le (ring_unit (cring_ring (idomain_ring ZZ))) Z0, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) match Z_le_lt_eq_dec (ring_unit (cring_ring (idomain_ring ZZ))) Z0 l with | left l0 => group_inverse G (nat_to_group (Pos.to_nat (@pos_abs (Z.opp (ring_unit (cring_ring (idomain_ring ZZ)))) (@Zlemma1 (ring_unit (cring_ring (idomain_ring ZZ))) l0)))) | right e => @monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)) end r *) intros z; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) match Z_le_lt_eq_dec (ring_unit (cring_ring (idomain_ring ZZ))) Z0 z with | left l => group_inverse G (nat_to_group (Pos.to_nat (@pos_abs (Z.opp (ring_unit (cring_ring (idomain_ring ZZ)))) (@Zlemma1 (ring_unit (cring_ring (idomain_ring ZZ))) l)))) | right e => @monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)) end r *) case (Z_le_lt_eq_dec (ring_unit ZZ) 0 z). (* Goal: forall l : Z.lt (ring_unit (cring_ring (idomain_ring ZZ))) Z0, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G (nat_to_group (Pos.to_nat (@pos_abs (Z.opp (ring_unit (cring_ring (idomain_ring ZZ)))) (@Zlemma1 (ring_unit (cring_ring (idomain_ring ZZ))) l))))) r *) (* Goal: forall _ : @eq Z (ring_unit (cring_ring (idomain_ring ZZ))) Z0, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) r *) intros z0; try assumption. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) absurd (ring_unit ZZ < 0)%Z; auto with *. (* Goal: forall _ : @eq Z (ring_unit (cring_ring (idomain_ring ZZ))) Z0, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) r *) intros H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) r *) inversion H'. Qed. Hint Resolve Zl5: algebra. Lemma nat_to_group_com4 : forall n m : nat, Equal (sgroup_law G (nat_to_group m) (group_inverse G (nat_to_group n))) (sgroup_law G (group_inverse G (nat_to_group n)) (nat_to_group m)). (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) simple induction n; simpl in |- *; auto with *. (* Goal: forall m : nat, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group m) (group_inverse G (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) (nat_to_group m)) *) (* Goal: forall (n : nat) (_ : forall m : nat, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group m) (group_inverse G (nat_to_group n))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (nat_to_group n)) (nat_to_group m))) (m : nat), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group m) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group n) r))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group n) r)) (nat_to_group m)) *) intros m; try assumption. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) apply Trans with (sgroup_law G (nat_to_group m) (monoid_unit G)); auto with *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) apply Trans with (nat_to_group m); auto with *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) apply Trans with (sgroup_law G (monoid_unit G) (nat_to_group m)); auto with *. (* Goal: forall (n : nat) (_ : forall m : nat, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group m) (group_inverse G (nat_to_group n))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (nat_to_group n)) (nat_to_group m))) (m : nat), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group m) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group n) r))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) (nat_to_group n) r)) (nat_to_group m)) *) intros n0 H' m; try assumption. apply Trans with (sgroup_law G (nat_to_group m) (sgroup_law G (group_inverse G r) (group_inverse G (nat_to_group n0)))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. apply Trans with (sgroup_law G (sgroup_law G (nat_to_group m) (group_inverse G r)) (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) (group_inverse G (nat_to_group n0))); auto with *. apply Trans with (sgroup_law G (sgroup_law G (group_inverse G r) (nat_to_group m)) (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) (group_inverse G (nat_to_group n0))); auto with *. apply Trans with (sgroup_law G (group_inverse G r) (sgroup_law G (nat_to_group m) (group_inverse G (nat_to_group n0)))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. apply Trans with (sgroup_law G (group_inverse G r) (sgroup_law G (group_inverse G (nat_to_group n0)) (nat_to_group m))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. apply Trans with (sgroup_law G (sgroup_law G (group_inverse G r) (group_inverse G (nat_to_group n0))) (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) (nat_to_group m)); auto with *. Qed. Hint Resolve nat_to_group_com4: algebra. Comments "The group morphism from the integers to an arbitrary group.". Definition Z_to_group_nat : Hom (ZZ:GROUP) G. (* Goal: Carrier (@Hom GROUP (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))) : Ob GROUP) G) *) apply (BUILD_HOM_GROUP (G:=ZZ:GROUP) (G':=G) (ff:=Z_to_group_nat_fun)). (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g)))) *) simpl in |- *. (* 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 G))) (Z_to_group_fun x) (Z_to_group_fun 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 G))) (Z_to_group_fun (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) x y)) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_fun x) (Z_to_group_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_fun (@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 G)) (monoid_on_def (group_monoid G))) *) intros x y H'; try assumption. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) rewrite H'; auto with *. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g)))) *) simple induction x; simple induction y; simpl in |- *. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g)))) *) unfold sgroup_law at 1 in |- *; simpl in |- *. apply Trans with (sgroup_law G (Z_to_group_nat_fun 0%Z) (monoid_unit G)); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: forall p : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) Z0 (Zneg p))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun Z0) (Z_to_group_nat_fun (Zneg p))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) Z0)) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun Z0)) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) (Zpos p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun (Zpos p0))) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun (Zneg p0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) Z0)) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun Z0)) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) (Zpos p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun (Zpos p0))) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun (Zneg p0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (@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 G)) (monoid_on_def (group_monoid G))) *) intros p; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) Z0 (Zneg p))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun Z0) (Z_to_group_nat_fun (Zneg p))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) Z0)) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun Z0)) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) (Zpos p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun (Zpos p0))) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun (Zneg p0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) Z0)) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun Z0)) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) (Zpos p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun (Zpos p0))) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun (Zneg p0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (@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 G)) (monoid_on_def (group_monoid G))) *) rewrite Zplus_0_l. apply Trans with (sgroup_law G (monoid_unit G) (Z_to_group_nat_fun (Zpos p))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: forall p : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) Z0 (Zneg p))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun Z0) (Z_to_group_nat_fun (Zneg p))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) Z0)) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun Z0)) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) (Zpos p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun (Zpos p0))) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun (Zneg p0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) Z0)) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun Z0)) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) (Zpos p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun (Zpos p0))) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun (Zneg p0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (@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 G)) (monoid_on_def (group_monoid G))) *) intros p; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) Z0 (Zneg p))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun Z0) (Z_to_group_nat_fun (Zneg p))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) Z0)) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun Z0)) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) (Zpos p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun (Zpos p0))) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun (Zneg p0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) Z0)) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun Z0)) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) (Zpos p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun (Zpos p0))) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun (Zneg p0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (@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 G)) (monoid_on_def (group_monoid G))) *) rewrite Zplus_0_l. apply Trans with (sgroup_law G (monoid_unit G) (Z_to_group_nat_fun (Zneg p))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) Z0)) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun Z0)) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) (Zpos p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun (Zpos p0))) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zpos p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zpos p)) (Z_to_group_nat_fun (Zneg p0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) Z0)) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun Z0)) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) (Zpos p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun (Zpos p0))) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun (Zneg p0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (@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 G)) (monoid_on_def (group_monoid G))) *) rewrite Zplus_0_r. apply Trans with (sgroup_law G (Z_to_group_nat_fun (Zpos p)) (monoid_unit G)); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g)))) *) unfold sgroup_law at 1 in |- *; simpl in |- *. (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (Zneg (Pos.add p p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun (Zneg p0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (@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 G)) (monoid_on_def (group_monoid G))) *) intros p0; try assumption. apply Trans with (nat_to_group (nat_of_P (pos_abs (ax3 (p + p0))))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. apply Trans with (sgroup_law G (nat_to_group (nat_of_P (pos_abs (ax3 p)))) (nat_to_group (nat_of_P (pos_abs (ax3 p0))))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g)))) *) simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G (nat_to_group (Pos.to_nat (Pos.add p p0)))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (nat_to_group (Pos.to_nat p))) (group_inverse G (nat_to_group (Pos.to_nat p0)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (@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 G)) (monoid_on_def (group_monoid G))) *) rewrite nat_of_P_plus_morphism. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (Zneg (Pos.add p p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun (Zneg p0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (@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 G)) (monoid_on_def (group_monoid G))) *) intros p0; try assumption. apply Trans with (sgroup_law G (nat_to_group (nat_of_P (pos_abs (ax3 p)))) (group_inverse G (nat_to_group (nat_of_P (pos_abs (ax3 p0)))))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. apply Trans with (sgroup_law G (Z_to_group_nat_fun (Zneg p)) (monoid_unit G)); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (Zneg (Pos.add p p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun (Zneg p0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (@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 G)) (monoid_on_def (group_monoid G))) *) intros p0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) (Zpos p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun (Zpos p0))) *) (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (sgroup_law (@Group_util.sg (Leibnitz_set Z) Z.add (fun (x x' y y' : Z) (H' : @eq Z x x') (H'0 : @eq Z y y') => @eq_ind_r Z y' (fun y0 : Z => @eq Z (Z.add x y0) (Z.add x' y')) (@eq_ind_r Z x' (fun x0 : Z => @eq Z (Z.add x0 y') (Z.add x' y')) (@eq_refl Z (Z.add x' y')) x H') y H'0) (fun x y z : Z => @Sym (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) (@eq_ind_r Z (Z.add (Z.add x y) z) (fun z0 : Z => @eq Z z0 (Z.add (Z.add x y) z)) (@eq_refl Z (Z.add (Z.add x y) z)) (Z.add x (Z.add y z)) (Z.add_assoc x y z)))) (Zneg p) (Zneg p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun (Zneg p0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (@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 G)) (monoid_on_def (group_monoid G))) *) rewrite Zplus_comm. apply Trans with (sgroup_law G (group_inverse G (nat_to_group (nat_of_P (pos_abs (ax3 p))))) (nat_to_group (nat_of_P (pos_abs (ax3 p0))))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. apply Trans with (sgroup_law G (nat_to_group (nat_of_P (pos_abs (ax3 p0)))) (group_inverse G (nat_to_group (nat_of_P (pos_abs (ax3 p)))))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g)))) *) unfold sgroup_law at 1 in |- *; simpl in |- *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) simpl in |- *; auto with *. (* Goal: forall p0 : positive, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (Zneg (Pos.add p p0))) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_nat_fun (Zneg p)) (Z_to_group_nat_fun (Zneg p0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (@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 G)) (monoid_on_def (group_monoid G))) *) intros p0; try assumption. apply Trans with (group_inverse G (nat_to_group (nat_of_P (pos_abs (ax3 (p + p0)))))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. apply Trans with (sgroup_law G (group_inverse G (nat_to_group (nat_of_P (pos_abs (ax3 p))))) (group_inverse G (nat_to_group (nat_of_P (pos_abs (ax3 p0)))))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g)))) *) simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G (nat_to_group (Pos.to_nat (Pos.add p p0)))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (nat_to_group (Pos.to_nat p))) (group_inverse G (nat_to_group (Pos.to_nat p0)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_nat_fun (@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 G)) (monoid_on_def (group_monoid G))) *) rewrite nat_of_P_plus_morphism. apply Trans with (group_inverse G (sgroup_law G (nat_to_group (nat_of_P p)) (nat_to_group (nat_of_P p0)))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. apply Trans with (group_inverse G (sgroup_law G (nat_to_group (nat_of_P p0)) (nat_to_group (nat_of_P p)))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. Defined. End Zup1. Hint Resolve nat_to_group_com nat_to_group_add nat_to_group_com2 nat_to_group_minus nat_to_group_com3 nat_to_group_com4: algebra. Section Zup2. Variable G : GROUP. Section pos_def. Variable r : G. Fixpoint pos_to_group (p : positive) : G := match p with | xH => r | xO p' => group_square G (pos_to_group p') | xI p' => sgroup_law G (group_square G (pos_to_group p')) r end. Lemma pos_nat_group : forall p : positive, Equal (pos_to_group p) (nat_to_group r (nat_of_P p)). (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g)))) *) simple induction p; simpl in |- *. (* Goal: forall (p : positive) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (pos_to_group p) (@nat_to_group G r (Pos.to_nat p))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (pos_to_group p) (pos_to_group p)) (@nat_to_group G r (Pos.to_nat (xO p))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) r (sgroup_law (monoid_sgroup (group_monoid G)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) r) *) intros p0 H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (pos_to_group p0) (pos_to_group p0)) (@nat_to_group G r (Pos.iter_op nat Init.Nat.add p0 (S (S O)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) r (sgroup_law (monoid_sgroup (group_monoid G)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) r) *) rewrite ZL6. (* Goal: forall (p : positive) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (pos_to_group p) (@nat_to_group G r (Pos.to_nat p))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_square G (pos_to_group p)) (@nat_to_group G r (Pos.to_nat (xO p))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) r (sgroup_law (monoid_sgroup (group_monoid G)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) r) *) unfold group_square in |- *. apply Trans with (sgroup_law G (sgroup_law G (nat_to_group r (nat_of_P p0)) (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) (nat_to_group r (nat_of_P p0))) r); auto with *. (* Goal: forall (p : positive) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (pos_to_group p) (@nat_to_group G r (Pos.to_nat p))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_square G (pos_to_group p)) (@nat_to_group G r (Pos.to_nat (xO p))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) r (sgroup_law (monoid_sgroup (group_monoid G)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) r) *) unfold group_square in |- *. (* Goal: forall (p : positive) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (pos_to_group p) (@nat_to_group G r (Pos.to_nat p))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (pos_to_group p) (pos_to_group p)) (@nat_to_group G r (Pos.to_nat (xO p))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) r (sgroup_law (monoid_sgroup (group_monoid G)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) r) *) intros p0 H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (pos_to_group p0) (pos_to_group p0)) (@nat_to_group G r (Pos.to_nat (xO p0))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) r (sgroup_law (monoid_sgroup (group_monoid G)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) r) *) unfold nat_of_P in |- *. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g)))) *) simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (pos_to_group p0) (pos_to_group p0)) (@nat_to_group G r (Pos.iter_op nat Init.Nat.add p0 (S (S O)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) r (sgroup_law (monoid_sgroup (group_monoid G)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) r) *) rewrite ZL6. apply Trans with (sgroup_law G (nat_to_group r (nat_of_P p0)) (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) (nat_to_group r (nat_of_P p0))); auto with *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. Qed. End pos_def. Hint Resolve pos_nat_group: algebra. Variable r : G. Definition Z_to_group_fun : ZZ -> G. (* Goal: forall _ : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))), Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) intros x. (* Goal: Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) case (Z_gt_le_dec x 0); intros z. (* Goal: Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) (* Goal: Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) exact (pos_to_group r (pos_abs z)). (* Goal: Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) case (Z_le_lt_eq_dec _ _ z); intros. (* Goal: Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) (* Goal: Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) cut (- x > 0)%Z. (* Goal: forall _ : Z.gt (Z.opp x) Z0, Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) intros H'. (* Goal: Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) exact (pos_to_group (group_inverse G r) (pos_abs H')). (* Goal: Z.gt (Z.opp x) Z0 *) (* Goal: Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) apply Zlemma1. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: Carrier (sgroup_set (monoid_sgroup (group_monoid G))) *) exact (monoid_unit G). Defined. Lemma nat_to_group_inverse : forall (n : nat) (r : G), Equal (group_inverse G (nat_to_group r n)) (nat_to_group (group_inverse G r) n). (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) simple induction n; simpl in |- *; auto with *. (* Goal: forall (n : nat) (_ : forall r : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G (@nat_to_group G r n)) (@nat_to_group G (group_inverse G r) n)) (r : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) (@nat_to_group G r n) r)) (sgroup_law (monoid_sgroup (group_monoid G)) (@nat_to_group G (group_inverse G r) n) (group_inverse G r)) *) intros n0 H' r0; try assumption. apply Trans with (sgroup_law G (group_inverse G r0) (group_inverse G (nat_to_group r0 n0))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. apply Trans with (sgroup_law G (group_inverse G r0) (nat_to_group (group_inverse G r0) n0)); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. Qed. Hint Resolve nat_to_group_inverse: algebra. Lemma Z_to_group_fun_eq : forall z : ZZ, Equal (Z_to_group_fun z) (Z_to_group_nat r z). (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g)))) *) intros z; simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_fun z) (@Z_to_group_nat_fun G r z) *) unfold Z_to_group_fun in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) match Z_gt_le_dec z Z0 with | left z0 => pos_to_group r (@pos_abs z z0) | right z0 => match Z_le_lt_eq_dec z Z0 z0 with | left l => pos_to_group (group_inverse G r) (@pos_abs (Z.opp z) (@Zlemma1 z l)) | right e => @monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)) end end (@Z_to_group_nat_fun G r z) *) unfold Z_to_group_nat_fun in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) match Z_gt_le_dec z Z0 with | left z0 => pos_to_group r (@pos_abs z z0) | right z0 => match Z_le_lt_eq_dec z Z0 z0 with | left l => pos_to_group (group_inverse G r) (@pos_abs (Z.opp z) (@Zlemma1 z l)) | right e => @monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)) end end match Z_gt_le_dec z Z0 with | left z0 => @nat_to_group G r (Pos.to_nat (@pos_abs z z0)) | right z0 => match Z_le_lt_eq_dec z Z0 z0 with | left l => group_inverse G (@nat_to_group G r (Pos.to_nat (@pos_abs (Z.opp z) (@Zlemma1 z l)))) | right e => @monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)) end end *) case (Z_gt_le_dec z 0); intros z0. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) match Z_le_lt_eq_dec z Z0 z0 with | left l => pos_to_group (group_inverse G r) (@pos_abs (Z.opp z) (@Zlemma1 z l)) | right e => @monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)) end match Z_le_lt_eq_dec z Z0 z0 with | left l => group_inverse G (@nat_to_group G r (Pos.to_nat (@pos_abs (Z.opp z) (@Zlemma1 z l)))) | right e => @monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)) end *) case (Z_le_lt_eq_dec z 0 z0); intros z1. apply Trans with (nat_to_group (group_inverse G r) (nat_of_P (pos_abs (Zlemma1 z1)))); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. Qed. Hint Resolve Z_to_group_fun_eq: algebra. Definition Z_to_group : Hom (ZZ:GROUP) G. (* Goal: Carrier (@Hom GROUP (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))) : Ob GROUP) G) *) apply (BUILD_HOM_GROUP (G:=ZZ:GROUP) (G':=G) (ff:=Z_to_group_fun)). (* 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 G))) (Z_to_group_fun x) (Z_to_group_fun 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 G))) (Z_to_group_fun (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) x y)) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_fun x) (Z_to_group_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_fun (@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 G)) (monoid_on_def (group_monoid G))) *) intros x y H'; try assumption. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) apply Trans with (Z_to_group_nat r x); auto with *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) apply Trans with (Z_to_group_nat r y); auto with *. (* 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 G))) (Z_to_group_fun (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) x y)) (sgroup_law (monoid_sgroup (group_monoid G)) (Z_to_group_fun x) (Z_to_group_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (Z_to_group_fun (@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 G)) (monoid_on_def (group_monoid G))) *) intros x y; try assumption. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) apply Trans with (Z_to_group_nat r (sgroup_law ZZ x y)); auto with *. apply Trans with (sgroup_law G (Z_to_group_nat r x) (Z_to_group_nat r y)); (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) apply Trans with (Z_to_group_nat r (monoid_unit ZZ)); auto with *. Defined. End Zup2. Set Strict Implicit. Unset Implicit Arguments. Definition group_power (G : GROUP) (x : G) (n : ZZ) := Z_to_group x n. Set Implicit Arguments. Unset Strict Implicit. Definition sgroup_powers (G : GROUP) (g : G) := coKer (Z_to_group g). Lemma sgroup_powers_prop : forall (G : GROUP) (g x : G), in_part x (sgroup_powers g) -> exists n : ZZ, Equal x (group_power G g n). (* Goal: forall (G : Ob GROUP) (g x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g))))), @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))))) (fun n : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) => @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (group_power G g n)) *) intros G g x H'; try assumption. (* Goal: @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))))) (fun n : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) => @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (group_power G g n)) *) elim H'. (* Goal: forall (x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))))) (_ : and (@in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) x0 (full (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))))) (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))) (group_monoid G) (@Z_to_group G g))) x0))), @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))))) (fun n : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) => @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (group_power G g n)) *) intros x0 H'0; try assumption. (* Goal: @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))))) (fun n : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) => @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (group_power G g n)) *) elim H'0; intros H'1 H'2; try exact H'2; clear H'0. (* Goal: @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))))) (fun n : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) => @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (group_power G g n)) *) exists x0; try assumption. Qed. Lemma sgroup_powers_rev : forall (G : GROUP) (g : G) (n : ZZ), in_part (group_power G g n) (sgroup_powers g). (* Goal: forall (G : Ob GROUP) (g : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (n : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g)))) *) intros G g n; try assumption. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@sgroup_powers G g)))) *) simpl in |- *. (* Goal: @ex Z (fun x : Z => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g x))) *) exists n; split; [ idtac | try assumption ]. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) auto with *. (* Goal: True *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (group_power G g n) (@Z_to_group_fun G g n) *) unfold group_power in |- *; auto with *. Qed. Hint Resolve sgroup_powers_prop sgroup_powers_rev: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Monoid_cat. Require Export Sgroup_facts. Require Export Monoid_facts. Require Export Monoid_util. Section Free_monoid_def. Variable V : SET. Inductive FM : Type := | Var : V -> FM | Law : FM -> FM -> FM | Unit : FM. Inductive eqFM : FM -> FM -> Prop := | eqFM_Var : forall x y : V, Equal x y -> (eqFM (Var x) (Var y):Prop) | eqFM_law : forall x x' y y' : FM, eqFM x x' -> eqFM y y' -> (eqFM (Law x y) (Law x' y'):Prop) | eqFM_law_assoc : forall x y z : FM, eqFM (Law (Law x y) z) (Law x (Law y z)):Prop | eqFM_law0r : forall x : FM, eqFM (Law x Unit) x:Prop | eqFM_law0l : forall x : FM, eqFM (Law Unit x) x:Prop | eqFM_refl : forall x : FM, eqFM x x:Prop | eqFM_sym : forall x y : FM, eqFM x y -> (eqFM y x:Prop) | eqFM_trans : forall x y z : FM, eqFM x y -> eqFM y z -> (eqFM x z:Prop). Hint Resolve eqFM_Var eqFM_law eqFM_law_assoc eqFM_law0r eqFM_law0l eqFM_refl: algebra. Hint Immediate eqFM_sym: algebra. Lemma eqFM_Equiv : equivalence eqFM. (* Goal: @Map_eq V (sgroup_set (monoid_sgroup M)) f (@comp_hom SET V FM_set (sgroup_set (monoid_sgroup M)) (@f2 FreeMonoid M FM_lift_fun (fun (x y : FM) (H' : eqFM x y) => @eqFM_ind (fun x0 y0 : FM => @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) (fun (x0 y0 : Carrier V) (H : @Equal V x0 y0) => @Ap_comp V (sgroup_set (monoid_sgroup M)) f f x0 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup M))) f)) (fun (x0 x' y0 y' : FM) (_ : eqFM x0 x') (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun x')) (_ : eqFM y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun y')) => @SGROUP_comp (monoid_sgroup M) (FM_lift_fun x0) (FM_lift_fun x') (FM_lift_fun y0) (FM_lift_fun y') H0 H2) (fun x0 y0 z : FM => @SGROUP_assoc (monoid_sgroup M) (FM_lift_fun x0) (FM_lift_fun y0) (FM_lift_fun z)) (fun x0 : FM => @MONOID_unit_r M (FM_lift_fun x0)) (fun x0 : FM => @MONOID_unit_l M (FM_lift_fun x0)) (fun x0 : FM => @Refl (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0)) (fun (x0 y0 : FM) (_ : eqFM x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0) H0) (fun (x0 y0 z : FM) (_ : eqFM x0 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) (_ : eqFM y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0) (FM_lift_fun z) H'1 H'3) x y H')) FM_var) *) red in |- *. (* Goal: and (@transitive FM eqFM) (@symmetric FM eqFM) *) split; [ try assumption | idtac ]. (* Goal: @reflexive FM eqFM *) (* Goal: @partial_equivalence FM eqFM *) exact eqFM_refl. (* Goal: @Map_eq V (sgroup_set (monoid_sgroup M)) f (@comp_hom SET V FM_set (sgroup_set (monoid_sgroup M)) (@f2 FreeMonoid M FM_lift_fun (fun (x y : FM) (H' : eqFM x y) => @eqFM_ind (fun x0 y0 : FM => @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) (fun (x0 y0 : Carrier V) (H : @Equal V x0 y0) => @Ap_comp V (sgroup_set (monoid_sgroup M)) f f x0 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup M))) f)) (fun (x0 x' y0 y' : FM) (_ : eqFM x0 x') (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun x')) (_ : eqFM y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun y')) => @SGROUP_comp (monoid_sgroup M) (FM_lift_fun x0) (FM_lift_fun x') (FM_lift_fun y0) (FM_lift_fun y') H0 H2) (fun x0 y0 z : FM => @SGROUP_assoc (monoid_sgroup M) (FM_lift_fun x0) (FM_lift_fun y0) (FM_lift_fun z)) (fun x0 : FM => @MONOID_unit_r M (FM_lift_fun x0)) (fun x0 : FM => @MONOID_unit_l M (FM_lift_fun x0)) (fun x0 : FM => @Refl (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0)) (fun (x0 y0 : FM) (_ : eqFM x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0) H0) (fun (x0 y0 z : FM) (_ : eqFM x0 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) (_ : eqFM y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0) (FM_lift_fun z) H'1 H'3) x y H')) FM_var) *) red in |- *. (* Goal: and (@transitive FM eqFM) (@symmetric FM eqFM) *) split; [ try assumption | idtac ]. (* Goal: @transitive FM eqFM *) (* Goal: @symmetric FM eqFM *) exact eqFM_trans. (* Goal: @symmetric FM eqFM *) exact eqFM_sym. Qed. Definition FM_set := Build_Setoid eqFM_Equiv. Definition FreeMonoid : MONOID. (* Goal: Ob MONOID *) apply (BUILD_MONOID (E:=FM_set) (genlaw:=Law) (e:=Unit)). (* Goal: forall (x x' y y' : Carrier FM_set) (_ : @Equal FM_set x x') (_ : @Equal FM_set y y'), @Equal FM_set (Law x y) (Law x' y') *) (* Goal: forall x y z : Carrier FM_set, @Equal FM_set (Law (Law x y) z) (Law x (Law y z)) *) (* Goal: forall x : Carrier FM_set, @Equal FM_set (Law x Unit) x *) (* Goal: forall x : Carrier FM_set, @Equal FM_set (Law Unit x) x *) exact eqFM_law. (* Goal: forall x y z : Carrier FM_set, @Equal FM_set (Law (Law x y) z) (Law x (Law y z)) *) (* Goal: forall x : Carrier FM_set, @Equal FM_set (Law x Unit) x *) (* Goal: forall x : Carrier FM_set, @Equal FM_set (Law Unit x) x *) exact eqFM_law_assoc. (* Goal: forall x : Carrier FM_set, @Equal FM_set (Law x Unit) x *) (* Goal: forall x : Carrier FM_set, @Equal FM_set (Law Unit x) x *) exact eqFM_law0r. (* Goal: forall x : Carrier FM_set, @Equal FM_set (Law Unit x) x *) exact eqFM_law0l. Defined. Section Universal_prop. Variable M : MONOID. Variable f : Hom V M. Fixpoint FM_lift_fun (p : FreeMonoid) : M := match p with | Var v => f v | Law p1 p2 => sgroup_law _ (FM_lift_fun p1) (FM_lift_fun p2) | Unit => monoid_unit M end. Definition FM_lift : Hom FreeMonoid M. (* Goal: Carrier (@Hom MONOID FreeMonoid M) *) apply (BUILD_HOM_MONOID (G:=FreeMonoid) (G':=M) (ff:=FM_lift_fun)). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup FreeMonoid))) (_ : @Equal (sgroup_set (monoid_sgroup FreeMonoid)) x y), @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x) (FM_lift_fun y) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup FreeMonoid)), @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (sgroup_law (monoid_sgroup FreeMonoid) x y)) (sgroup_law (monoid_sgroup M) (FM_lift_fun x) (FM_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (@monoid_unit (monoid_sgroup FreeMonoid) (monoid_on_def FreeMonoid))) (@monoid_unit (monoid_sgroup M) (monoid_on_def M)) *) intros x y H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x) (FM_lift_fun y) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup FreeMonoid)), @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (sgroup_law (monoid_sgroup FreeMonoid) x y)) (sgroup_law (monoid_sgroup M) (FM_lift_fun x) (FM_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (@monoid_unit (monoid_sgroup FreeMonoid) (monoid_on_def FreeMonoid))) (@monoid_unit (monoid_sgroup M) (monoid_on_def M)) *) elim H'; simpl in |- *; auto with algebra. (* Goal: forall (x y z : FM) (_ : eqFM x y) (_ : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x) (FM_lift_fun y)) (_ : eqFM y z) (_ : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y) (FM_lift_fun z)), @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x) (FM_lift_fun z) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup FreeMonoid)), @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (sgroup_law (monoid_sgroup FreeMonoid) x y)) (sgroup_law (monoid_sgroup M) (FM_lift_fun x) (FM_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (@monoid_unit (monoid_sgroup FreeMonoid) (monoid_on_def FreeMonoid))) (@monoid_unit (monoid_sgroup M) (monoid_on_def M)) *) intros x0 y0 z H'0 H'1 H'2 H'3; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun z) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup FreeMonoid)), @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (sgroup_law (monoid_sgroup FreeMonoid) x y)) (sgroup_law (monoid_sgroup M) (FM_lift_fun x) (FM_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (@monoid_unit (monoid_sgroup FreeMonoid) (monoid_on_def FreeMonoid))) (@monoid_unit (monoid_sgroup M) (monoid_on_def M)) *) apply Trans with (FM_lift_fun y0); auto with algebra. (* Goal: forall (x y : Carrier V) (_ : @Equal V x y), @Equal (sgroup_set (monoid_sgroup FreeMonoid)) (Var x) (Var y) *) simpl in |- *; auto with algebra. (* Goal: forall (x y : Carrier V) (_ : @Equal V x y), @Equal (sgroup_set (monoid_sgroup FreeMonoid)) (Var x) (Var y) *) simpl in |- *; auto with algebra. Defined. Definition FM_var : Hom V FreeMonoid. (* Goal: Carrier (@Hom SET V (sgroup_set (monoid_sgroup FreeMonoid))) *) apply (Build_Map (A:=V) (B:=FreeMonoid) (Ap:=Var)). (* Goal: @Map_eq V (sgroup_set (monoid_sgroup M)) f (@comp_hom SET V FM_set (sgroup_set (monoid_sgroup M)) (@f2 FreeMonoid M FM_lift_fun (fun (x y : FM) (H' : eqFM x y) => @eqFM_ind (fun x0 y0 : FM => @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) (fun (x0 y0 : Carrier V) (H : @Equal V x0 y0) => @Ap_comp V (sgroup_set (monoid_sgroup M)) f f x0 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup M))) f)) (fun (x0 x' y0 y' : FM) (_ : eqFM x0 x') (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun x')) (_ : eqFM y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun y')) => @SGROUP_comp (monoid_sgroup M) (FM_lift_fun x0) (FM_lift_fun x') (FM_lift_fun y0) (FM_lift_fun y') H0 H2) (fun x0 y0 z : FM => @SGROUP_assoc (monoid_sgroup M) (FM_lift_fun x0) (FM_lift_fun y0) (FM_lift_fun z)) (fun x0 : FM => @MONOID_unit_r M (FM_lift_fun x0)) (fun x0 : FM => @MONOID_unit_l M (FM_lift_fun x0)) (fun x0 : FM => @Refl (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0)) (fun (x0 y0 : FM) (_ : eqFM x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0) H0) (fun (x0 y0 z : FM) (_ : eqFM x0 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) (_ : eqFM y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0) (FM_lift_fun z) H'1 H'3) x y H')) FM_var) *) red in |- *. (* Goal: forall (x y : Carrier V) (_ : @Equal V x y), @Equal (sgroup_set (monoid_sgroup FreeMonoid)) (Var x) (Var y) *) simpl in |- *; auto with algebra. Defined. Lemma FM_comp_prop : Equal f (comp_hom (FM_lift:Hom (FreeMonoid:SET) M) FM_var). (* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup M)) (@Ap V (sgroup_set (monoid_sgroup M)) f x) (@Ap V (sgroup_set (monoid_sgroup M)) (@comp_hom SET V FM_set (sgroup_set (monoid_sgroup M)) (@f2 FreeMonoid M FM_lift_fun (fun (x0 y : FM) (H' : eqFM x0 y) => @eqFM_ind (fun x1 y0 : FM => @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0)) (fun (x1 y0 : Carrier V) (H : @Equal V x1 y0) => @Ap_comp V (sgroup_set (monoid_sgroup M)) f f x1 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup M))) f)) (fun (x1 x' y0 y' : FM) (_ : eqFM x1 x') (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun x')) (_ : eqFM y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun y')) => @SGROUP_comp (monoid_sgroup M) (FM_lift_fun x1) (FM_lift_fun x') (FM_lift_fun y0) (FM_lift_fun y') H0 H2) (fun x1 y0 z : FM => @SGROUP_assoc (monoid_sgroup M) (FM_lift_fun x1) (FM_lift_fun y0) (FM_lift_fun z)) (fun x1 : FM => @MONOID_unit_r M (FM_lift_fun x1)) (fun x1 : FM => @MONOID_unit_l M (FM_lift_fun x1)) (fun x1 : FM => @Refl (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1)) (fun (x1 y0 : FM) (_ : eqFM x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0) H0) (fun (x1 y0 z : FM) (_ : eqFM x1 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0)) (_ : eqFM y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0) (FM_lift_fun z) H'1 H'3) x0 y H')) FM_var) x) *) simpl in |- *. (* Goal: @Map_eq V (sgroup_set (monoid_sgroup M)) f (@comp_hom SET V FM_set (sgroup_set (monoid_sgroup M)) (@f2 FreeMonoid M FM_lift_fun (fun (x y : FM) (H' : eqFM x y) => @eqFM_ind (fun x0 y0 : FM => @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) (fun (x0 y0 : Carrier V) (H : @Equal V x0 y0) => @Ap_comp V (sgroup_set (monoid_sgroup M)) f f x0 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup M))) f)) (fun (x0 x' y0 y' : FM) (_ : eqFM x0 x') (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun x')) (_ : eqFM y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun y')) => @SGROUP_comp (monoid_sgroup M) (FM_lift_fun x0) (FM_lift_fun x') (FM_lift_fun y0) (FM_lift_fun y') H0 H2) (fun x0 y0 z : FM => @SGROUP_assoc (monoid_sgroup M) (FM_lift_fun x0) (FM_lift_fun y0) (FM_lift_fun z)) (fun x0 : FM => @MONOID_unit_r M (FM_lift_fun x0)) (fun x0 : FM => @MONOID_unit_l M (FM_lift_fun x0)) (fun x0 : FM => @Refl (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0)) (fun (x0 y0 : FM) (_ : eqFM x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0) H0) (fun (x0 y0 z : FM) (_ : eqFM x0 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) (_ : eqFM y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0) (FM_lift_fun z) H'1 H'3) x y H')) FM_var) *) red in |- *. (* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup M)) (@Ap V (sgroup_set (monoid_sgroup M)) f x) (@Ap V (sgroup_set (monoid_sgroup M)) (@comp_hom SET V FM_set (sgroup_set (monoid_sgroup M)) (@f2 FreeMonoid M FM_lift_fun (fun (x0 y : FM) (H' : eqFM x0 y) => @eqFM_ind (fun x1 y0 : FM => @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0)) (fun (x1 y0 : Carrier V) (H : @Equal V x1 y0) => @Ap_comp V (sgroup_set (monoid_sgroup M)) f f x1 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup M))) f)) (fun (x1 x' y0 y' : FM) (_ : eqFM x1 x') (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun x')) (_ : eqFM y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun y')) => @SGROUP_comp (monoid_sgroup M) (FM_lift_fun x1) (FM_lift_fun x') (FM_lift_fun y0) (FM_lift_fun y') H0 H2) (fun x1 y0 z : FM => @SGROUP_assoc (monoid_sgroup M) (FM_lift_fun x1) (FM_lift_fun y0) (FM_lift_fun z)) (fun x1 : FM => @MONOID_unit_r M (FM_lift_fun x1)) (fun x1 : FM => @MONOID_unit_l M (FM_lift_fun x1)) (fun x1 : FM => @Refl (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1)) (fun (x1 y0 : FM) (_ : eqFM x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0) H0) (fun (x1 y0 z : FM) (_ : eqFM x1 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0)) (_ : eqFM y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0) (FM_lift_fun z) H'1 H'3) x0 y H')) FM_var) x) *) simpl in |- *. (* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup M)) (@Ap V (sgroup_set (monoid_sgroup M)) f x) (@Ap V (sgroup_set (monoid_sgroup M)) f x) *) auto with algebra. Qed. End Universal_prop. End Free_monoid_def. Hint Resolve FM_comp_prop: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Sub_group. Require Export Group_util. (** Title "Quotient of a group by a normal sub-group." *) Section Def. Variable G : GROUP. Variable H : subgroup G. Definition normal := forall x y : G, in_part y H -> in_part (sgroup_law _ x (sgroup_law _ y (group_inverse _ x))) H. Hypothesis Hnormal : normal. Definition group_quo_eq (x y : G) := in_part (sgroup_law _ x (group_inverse _ y)) H. Definition group_quo_eqrel : Relation G. (* Goal: Relation (sgroup_set (monoid_sgroup (group_monoid G))) *) apply (Build_Relation (E:=G) (Rel_fun:=group_quo_eq)). (* Goal: @symmetric (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *) red in |- *. (* Goal: group_quo_eq (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)) *) (* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *) (* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *) (* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) unfold app_rel, group_quo_eq in |- *. (* Goal: forall (x x' y y' : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x x') (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) y y') (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G y)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x' (group_inverse G y')) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) intros x x' y y' H' H'0 H'1; try assumption. apply in_part_comp_l with (sgroup_law G x (group_inverse G y)); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. Defined. Lemma group_quo_eqrel_equiv : equivalence group_quo_eqrel. (* Goal: @equivalence (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *) red in Hnormal. (* Goal: @symmetric (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *) red in |- *. (* Goal: and (@transitive (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel)) (@symmetric (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel)) *) split; [ try assumption | idtac ]. (* Goal: @symmetric (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *) red in |- *. (* Goal: @symmetric (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *) intros x; red in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @app_rel (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) x y), @app_rel (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) y x *) simpl in |- *. (* Goal: group_quo_eq (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)) *) (* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *) (* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *) (* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) unfold app_rel, group_quo_eq in |- *. apply in_part_comp_l with (sgroup_law G x (sgroup_law G (monoid_unit G) (group_inverse G x))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. (* Goal: @symmetric (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *) red in |- *. (* Goal: and (@transitive (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel)) (@symmetric (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel)) *) split; [ try assumption | idtac ]. (* Goal: @symmetric (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *) red in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @app_rel (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) x y), @app_rel (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) y x *) simpl in |- *. (* Goal: group_quo_eq (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)) *) (* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *) (* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *) (* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) unfold app_rel, group_quo_eq in |- *. (* Goal: forall (x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G y)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G z)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G z)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: @symmetric (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *) intros x y z H' H'0; try assumption. apply in_part_comp_l with (sgroup_law G (sgroup_law G x (group_inverse G y)) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) (sgroup_law G y (group_inverse G z))); auto with algebra. apply Trans with (sgroup_law G x (sgroup_law G (group_inverse G y) (sgroup_law G y (group_inverse G z)))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. apply Trans with (sgroup_law G x (sgroup_law G (sgroup_law G (group_inverse G y) y) (group_inverse G z))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. apply Trans with (sgroup_law G x (sgroup_law G (monoid_unit G) (group_inverse G z))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. (* Goal: @symmetric (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *) red in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @app_rel (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) x y), @app_rel (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) y x *) simpl in |- *. (* Goal: group_quo_eq (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)) *) (* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *) (* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *) (* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) unfold app_rel, group_quo_eq in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) y x) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) intros x y H'; try assumption. apply in_part_comp_l with (group_inverse G (sgroup_law G x (group_inverse G y))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. apply Trans with (sgroup_law G (group_inverse G (group_inverse G y)) (group_inverse G x)); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. Qed. Definition group_quo_set := quotient G group_quo_eqrel group_quo_eqrel_equiv. Lemma normal_com_in : forall x y : G, in_part (sgroup_law _ x y) H -> in_part (sgroup_law _ y x) H. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) y x) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) intros x y H'; try assumption. apply in_part_comp_l with (sgroup_law G y (sgroup_law G (sgroup_law G x y) (group_inverse G y))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) y x) (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (group_inverse G y))) *) apply SGROUP_comp; auto with algebra. apply Trans with (sgroup_law G x (sgroup_law G y (group_inverse G y))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G y))) *) apply Trans with (sgroup_law G x (monoid_unit G)); auto with algebra. Qed. Hint Immediate normal_com_in: algebra. Set Strict Implicit. Unset Implicit Arguments. Definition group_quo : group. apply (BUILD_GROUP (E:=group_quo_set) (genlaw:=fun x y : G => sgroup_law _ x y) (e:=monoid_unit G) (geninv:=fun x : G => group_inverse _ x)). (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x y, @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) x y *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) simpl in |- *; auto with algebra. (* Goal: group_quo_eq (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)) *) (* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *) (* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *) (* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) unfold app_rel, group_quo_eq in |- *. (* Goal: forall (x x' y y' : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x')) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G y')) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x' y'))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: forall x y z : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)) *) (* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *) (* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *) (* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) intros x x' y y' H' H'0; try assumption. apply in_part_comp_l with (sgroup_law G x (sgroup_law G y (group_inverse G (sgroup_law G x' y')))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G x) (group_inverse G (group_inverse G y))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) apply normal_com_in. apply in_part_comp_l with (sgroup_law G (sgroup_law G y (sgroup_law G (group_inverse G y') (group_inverse G x'))) x); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. apply in_part_comp_l with (sgroup_law G (sgroup_law G (sgroup_law G y (group_inverse G y')) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) (group_inverse G x')) x); auto with algebra. apply in_part_comp_l with (sgroup_law G (sgroup_law G y (group_inverse G y')) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) (sgroup_law G (group_inverse G x') x)); auto with algebra. (* Goal: forall x y z : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)) *) (* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *) (* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *) (* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) intros x y z; try assumption. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x y, @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) x y *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) simpl in |- *; auto with algebra. (* Goal: group_quo_eq (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)) *) (* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *) (* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *) (* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) unfold app_rel, group_quo_eq in |- *. apply in_part_comp_l with (sgroup_law G (sgroup_law G (sgroup_law G x y) z) (sgroup_law G (group_inverse G (sgroup_law G y z)) (group_inverse G x))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. apply in_part_comp_l with (sgroup_law G (sgroup_law G (sgroup_law G x y) z) (sgroup_law G (sgroup_law G (group_inverse G z) (group_inverse G y)) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) (group_inverse G x))); auto with algebra. apply in_part_comp_l with (sgroup_law G (sgroup_law G x (sgroup_law G y z)) (sgroup_law G (group_inverse G z) (sgroup_law G (group_inverse G y) (group_inverse G x)))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. apply in_part_comp_l with (sgroup_law G x (sgroup_law G (sgroup_law G y z) (sgroup_law G (group_inverse G z) (sgroup_law G (group_inverse G y) (group_inverse G x))))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. apply in_part_comp_l with (sgroup_law G x (sgroup_law G y (sgroup_law G z (sgroup_law G (group_inverse G z) (sgroup_law G (group_inverse G y) (group_inverse G x)))))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. apply in_part_comp_l with (sgroup_law G x (sgroup_law G y (sgroup_law G (sgroup_law G z (group_inverse G z)) (sgroup_law G (group_inverse G y) (group_inverse G x))))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. apply in_part_comp_l with (sgroup_law G x (sgroup_law G y (sgroup_law G (monoid_unit G) (sgroup_law G (group_inverse G y) (group_inverse G x))))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. apply in_part_comp_l with (sgroup_law G x (sgroup_law G y (sgroup_law G (group_inverse G y) (group_inverse G x)))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. apply in_part_comp_l with (sgroup_law G (sgroup_law G x y) (sgroup_law G (group_inverse G y) (group_inverse G x))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. apply in_part_comp_l with (sgroup_law G (sgroup_law G x y) (group_inverse G (sgroup_law G x y))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) apply in_part_comp_l with (monoid_unit G); auto with algebra. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x y, @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) x y *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) simpl in |- *; auto with algebra. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x y, group_quo_eq x y *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) unfold cart_eq, group_quo_eq in |- *. (* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) intros x; try assumption. apply in_part_comp_l with (sgroup_law G x (group_inverse G x)); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) apply in_part_comp_l with (monoid_unit G); auto with algebra. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) x y *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) intros x y; try assumption. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x y, @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) x y *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) simpl in |- *; auto with algebra. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x y, group_quo_eq x y *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) unfold cart_eq, group_quo_eq in |- *. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x y, @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G y)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) intros H'; try assumption. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G x) (group_inverse G (group_inverse G y))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) apply normal_com_in. apply in_part_comp_l with (group_inverse G (sgroup_law G x (group_inverse G y))); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. (* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) intros x; try assumption. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x y, @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) x y *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) simpl in |- *; auto with algebra. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x y, group_quo_eq x y *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) unfold cart_eq, group_quo_eq in |- *. apply in_part_comp_l with (sgroup_law G (sgroup_law G x (group_inverse G x)) (monoid_unit G)); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. apply in_part_comp_l with (sgroup_law G x (group_inverse G x)); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) apply in_part_comp_l with (monoid_unit G); auto with algebra. Defined. Set Implicit Arguments. Unset Strict Implicit. Definition group_quo_surj : Hom G group_quo. (* Goal: Carrier (@Hom GROUP G group_quo) *) apply (BUILD_HOM_GROUP (G:=G) (G':=group_quo) (ff:=fun x : G => x)). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) x y *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) intros x y; try assumption. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x y, @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) x y *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) simpl in |- *; auto with algebra. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x y, group_quo_eq x y *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) unfold cart_eq, group_quo_eq in |- *. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x y, @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G y)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) intros H'; try assumption. apply in_part_comp_l with (sgroup_law G x (group_inverse G x)); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) apply in_part_comp_l with (monoid_unit G); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *) auto with algebra. Defined. End Def. Hint Immediate normal_com_in: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Sub_monoid. Require Export Abelian_group_cat. (** Title "Tools for building monoids." *) Section Monoid. Variable E : Setoid. Variable genlaw : E -> E -> E. Variable e : E. Hypothesis fcomp : forall x x' y y' : E, Equal x x' -> Equal y y' -> Equal (genlaw x y) (genlaw x' y'). Hypothesis genlawassoc : forall x y z : E, Equal (genlaw (genlaw x y) z) (genlaw x (genlaw y z)). Hypothesis eunitgenlawr : forall x : E, Equal (genlaw x e) x. Hypothesis eunitgenlawl : forall x : E, Equal (genlaw e x) x. Definition f := uncurry fcomp. Lemma fassoc : associative f. (* Goal: @unit_l E f e *) red in |- *. (* Goal: forall x : Carrier E, @Equal E (@Ap (cart E E) E f (@couple E E e x)) x *) simpl in |- *; auto with algebra. Qed. Lemma eunitr : unit_r f e. (* Goal: @unit_l E f e *) red in |- *. (* Goal: forall x : Carrier E, @Equal E (@Ap (cart E E) E f (@couple E E e x)) x *) simpl in |- *; auto with algebra. Qed. Lemma eunitl : unit_l f e. (* Goal: @unit_l E f e *) red in |- *. (* Goal: forall x : Carrier E, @Equal E (@Ap (cart E E) E f (@couple E E e x)) x *) simpl in |- *; auto with algebra. Qed. Definition sg := Build_sgroup (Build_sgroup_on fassoc). Definition BUILD_MONOID : MONOID := Build_monoid (Build_monoid_on (A:=sg) (monoid_unit:=e) eunitr eunitl). End Monoid. Section Abelian_monoid. Variable E : Setoid. Variable genlaw : E -> E -> E. Variable e : E. Hypothesis fcomp : forall x x' y y' : E, Equal x x' -> Equal y y' -> Equal (genlaw x y) (genlaw x' y'). Hypothesis genlawassoc : forall x y z : E, Equal (genlaw (genlaw x y) z) (genlaw x (genlaw y z)). Hypothesis eunitgenlawr : forall x : E, Equal (genlaw x e) x. Hypothesis eunitgenlawl : forall x : E, Equal (genlaw e x) x. Hypothesis fcom : forall x y : E, Equal (genlaw x y) (genlaw y x). Definition M := BUILD_MONOID fcomp genlawassoc eunitgenlawr eunitgenlawl. Definition asg : abelian_sgroup. (* Goal: abelian_sgroup *) apply (Build_abelian_sgroup (abelian_sgroup_sgroup:=M)). (* Goal: abelian_sgroup_on (monoid_sgroup M) *) apply (Build_abelian_sgroup_on (A:=M)). (* Goal: @commutative (sgroup_set (monoid_sgroup M)) (@sgroup_law_map (sgroup_set (monoid_sgroup M)) (sgroup_on_def (monoid_sgroup M))) *) abstract (red in |- *; simpl in |- *; exact fcom). Defined. Definition BUILD_ABELIAN_MONOID : ABELIAN_MONOID := Build_abelian_monoid (Build_abelian_monoid_on (M:=M) asg). End Abelian_monoid. Section Hom. Variable G G' : MONOID. Variable ff : G -> G'. Hypothesis ffcomp : forall x y : G, Equal x y -> Equal (ff x) (ff y). Hypothesis fflaw : forall x y : G, Equal (ff (sgroup_law _ x y)) (sgroup_law _ (ff x) (ff y)). Hypothesis ffunit : Equal (ff (monoid_unit G)) (monoid_unit G'). Definition f2 := Build_Map ffcomp. Definition fhomsg := Build_sgroup_hom (sgroup_map:=f2) fflaw. Definition BUILD_HOM_MONOID : Hom G G' := Build_monoid_hom (monoid_sgroup_hom:=fhomsg) ffunit. End Hom. Section Build_sub_monoid. Variable G : MONOID. Variable H : part_set G. Hypothesis Hlaw : forall x y : G, in_part x H -> in_part y H -> in_part (sgroup_law _ x y) H. Hypothesis Hunit : in_part (monoid_unit G) H. Definition BUILD_SUB_MONOID : submonoid G := Build_submonoid (G:=G) (submonoid_subsgroup:=Build_subsgroup Hlaw) Hunit. End Build_sub_monoid.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Abelian_group_cat. Require Export Group_facts. (** Title "Lemmas on abelian groups, monoids, semi-groups." *) Section Sgroup. Variable S : ABELIAN_SGROUP. Lemma ABELIAN_SGROUP_com : forall x y : S, Equal (sgroup_law _ x y) (sgroup_law _ y x). (* Goal: forall x y : Carrier (sgroup_set (abelian_sgroup_sgroup S)), @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) x y) (sgroup_law (abelian_sgroup_sgroup S) y x) *) exact (abelian_sgroup_com_prf S). Qed. Lemma ABELIAN_SGROUP_permute : forall x y z : S, Equal (sgroup_law _ x (sgroup_law _ y z)) (sgroup_law _ y (sgroup_law _ x z)). (* Goal: forall x y z : Carrier (sgroup_set (abelian_sgroup_sgroup S)), @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) x (sgroup_law (abelian_sgroup_sgroup S) y z)) (sgroup_law (abelian_sgroup_sgroup S) y (sgroup_law (abelian_sgroup_sgroup S) x z)) *) intros x y z; try assumption. (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) x (sgroup_law (abelian_sgroup_sgroup S) y z)) (sgroup_law (abelian_sgroup_sgroup S) y (sgroup_law (abelian_sgroup_sgroup S) x z)) *) apply Trans with (sgroup_law S (sgroup_law S x y) z); auto with algebra. (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) x y) z) (sgroup_law (abelian_sgroup_sgroup S) y (sgroup_law (abelian_sgroup_sgroup S) x z)) *) apply Trans with (sgroup_law S (sgroup_law S y x) z); auto with algebra. (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) y z) t) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) z y) t) *) (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) x (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) z y) t)) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) x z) (sgroup_law (abelian_sgroup_sgroup S) y t)) *) apply SGROUP_comp; auto with algebra. (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) y z) (sgroup_law (abelian_sgroup_sgroup S) z y) *) (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) x (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) z y) t)) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) x z) (sgroup_law (abelian_sgroup_sgroup S) y t)) *) apply ABELIAN_SGROUP_com. Qed. Lemma ABELIAN_SGROUP4 : forall x y z t : S, Equal (sgroup_law _ (sgroup_law _ x y) (sgroup_law _ z t)) (sgroup_law _ (sgroup_law _ x z) (sgroup_law _ y t)). (* Goal: forall x y z t : Carrier (sgroup_set (abelian_sgroup_sgroup S)), @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) x y) (sgroup_law (abelian_sgroup_sgroup S) z t)) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) x z) (sgroup_law (abelian_sgroup_sgroup S) y t)) *) intros x y z t; try assumption. apply Trans with (sgroup_law S x (sgroup_law S y (sgroup_law S z t))); auto with algebra. apply Trans with (sgroup_law S x (sgroup_law S (sgroup_law S y z) t)); auto with algebra. apply Trans with (sgroup_law S x (sgroup_law S (sgroup_law S z y) t)); auto with algebra. (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) y z) t) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) z y) t) *) (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) x (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) z y) t)) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) x z) (sgroup_law (abelian_sgroup_sgroup S) y t)) *) apply SGROUP_comp; auto with algebra. (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) y z) t) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) z y) t) *) (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) x (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) z y) t)) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) x z) (sgroup_law (abelian_sgroup_sgroup S) y t)) *) apply SGROUP_comp; auto with algebra. (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) y z) (sgroup_law (abelian_sgroup_sgroup S) z y) *) (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) x (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) z y) t)) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) x z) (sgroup_law (abelian_sgroup_sgroup S) y t)) *) apply ABELIAN_SGROUP_com. apply Trans with (sgroup_law S x (sgroup_law S z (sgroup_law S y t))); auto with algebra. Qed. End Sgroup. Hint Immediate ABELIAN_SGROUP_com ABELIAN_SGROUP_permute ABELIAN_SGROUP4: algebra. Section Monoid. Variable M : ABELIAN_MONOID. Lemma ABELIAN_MONOID_com : forall x y : M, Equal (sgroup_law _ x y) (sgroup_law _ y x). change (forall x y : M:ABELIAN_SGROUP, Equal (sgroup_law _ x y) (sgroup_law _ y x)) in |- *; auto with algebra. Qed. Lemma ABELIAN_MONOID_permute : forall x y z : M, Equal (sgroup_law _ x (sgroup_law _ y z)) (sgroup_law _ y (sgroup_law _ x z)). change (forall x y z : M:ABELIAN_SGROUP, Equal (sgroup_law _ x (sgroup_law _ y z)) (sgroup_law _ y (sgroup_law _ x z))) in |- *; auto with algebra. Qed. Lemma ABELIAN_MONOID4 : forall x y z t : M, Equal (sgroup_law _ (sgroup_law _ x y) (sgroup_law _ z t)) (sgroup_law _ (sgroup_law _ x z) (sgroup_law _ y t)). change (forall x y z t : M:ABELIAN_SGROUP, Equal (sgroup_law _ (sgroup_law _ x y) (sgroup_law _ z t)) (sgroup_law _ (sgroup_law _ x z) (sgroup_law _ y t))) in |- *; auto with algebra. Qed. End Monoid. Hint Immediate ABELIAN_MONOID_com ABELIAN_MONOID_permute ABELIAN_MONOID4: algebra. Section Group. Variable G : ABELIAN_GROUP. Lemma ABELIAN_GROUP_com : forall x y : G, Equal (sgroup_law _ x y) (sgroup_law _ y x). change (forall x y : G:ABELIAN_SGROUP, Equal (sgroup_law _ x y) (sgroup_law _ y x)) in |- *; auto with algebra. Qed. Lemma ABELIAN_GROUP_permute : forall x y z : G, Equal (sgroup_law _ x (sgroup_law _ y z)) (sgroup_law _ y (sgroup_law _ x z)). change (forall x y z : G:ABELIAN_SGROUP, Equal (sgroup_law _ x (sgroup_law _ y z)) (sgroup_law _ y (sgroup_law _ x z))) in |- *; auto with algebra. Qed. Lemma ABELIAN_GROUP4 : forall x y z t : G, Equal (sgroup_law _ (sgroup_law _ x y) (sgroup_law _ z t)) (sgroup_law _ (sgroup_law _ x z) (sgroup_law _ y t)). change (forall x y z t : G:ABELIAN_SGROUP, Equal (sgroup_law _ (sgroup_law _ x y) (sgroup_law _ z t)) (sgroup_law _ (sgroup_law _ x z) (sgroup_law _ y t))) in |- *; auto with algebra. Qed. End Group. Hint Immediate ABELIAN_GROUP_com ABELIAN_GROUP_permute ABELIAN_GROUP4: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Sets. (** Title "Parts of a set" *) Comments "We define here the set of parts of a set, inclusion, union of a part,". Comments "and we prove that there is no surjection from a set in its part set". Section Subtype. Comments "In Coq type theory, there is no primitive notion of subtype". Comments "Then we have to define such a notion". Variable E : Setoid. Variable F : Type. Variable i : F -> E. Comments "We have implicitely defined a subset of" E "which is the image of" i ".". Comments "As a setoid, this subset has" F " as carrier, and we identify two elements of" F "which have the same image by" i ":". Definition subtype_image_equal (x y : F) : Prop := Equal (i x) (i y). Lemma subtype_image_equiv : equivalence subtype_image_equal. (* Goal: @pred_compatible E (fun x : Carrier E => not (@in_part E x (@Ap E (part_set E) f x))) *) red in |- *. (* Goal: and (@transitive (Predicate E) eq_part) (@symmetric (Predicate E) eq_part) *) split; [ try assumption | idtac ]. (* Goal: @pred_compatible E (fun x : Carrier E => not (@in_part E x (@Ap E (part_set E) f x))) *) red in |- *. unfold subtype_image_equal in |- *; unfold app_rel in |- *; simpl in |- *; (* Goal: @in_part E x A *) auto with algebra. (* Goal: @pred_compatible E (fun x : Carrier E => not (@in_part E x (@Ap E (part_set E) f x))) *) red in |- *. (* Goal: and (@transitive (Predicate E) eq_part) (@symmetric (Predicate E) eq_part) *) split; [ try assumption | idtac ]. (* Goal: @pred_compatible E (fun x : Carrier E => not (@in_part E x (@Ap E (part_set E) f x))) *) red in |- *. unfold subtype_image_equal in |- *; unfold app_rel in |- *; simpl in |- *; (* Goal: @in_part E x A *) auto with algebra. (* Goal: forall (x y z : F) (_ : @Equal E (i x) (i y)) (_ : @Equal E (i y) (i z)), @Equal E (i x) (i z) *) (* Goal: @symmetric F subtype_image_equal *) intros x y z H' H'0; try assumption. (* Goal: @Equal E (i x) (i z) *) (* Goal: @symmetric F subtype_image_equal *) apply Trans with (i y); auto with algebra. (* Goal: @pred_compatible E (fun x : Carrier E => not (@in_part E x (@Ap E (part_set E) f x))) *) red in |- *. unfold subtype_image_equal in |- *; unfold app_rel in |- *; simpl in |- *; (* Goal: @in_part E x A *) auto with algebra. Qed. Definition subtype_image_set : Setoid := Build_Setoid subtype_image_equiv. End Subtype. Section Part_type. Comments "We define now a general structure for this kind of subset:". Variable E : Setoid. Record subtype_image : Type := {subtype_image_carrier : Type; subtype_image_inj :> subtype_image_carrier -> E}. Definition set_of_subtype_image (S : subtype_image) := subtype_image_set (subtype_image_inj (s:=S)). Comments "Parts of" E "will be nothing more than predicates on" E " which are compatible with equality:". Definition pred_compatible (P : E -> Prop) : Prop := forall x y : E, P x -> Equal y x -> (P y:Prop). Record Predicate : Type := {Pred_fun : E -> Prop; Pred_compatible_prf : pred_compatible Pred_fun:Prop}. Variable P : Predicate. Comments "The type of elements of the subset defined by" P "is the following:". Record subtype : Type := {subtype_elt : E; subtype_prf : Pred_fun P subtype_elt:Prop}. Comments "Then elements of subsets are composed of an element of" E "and a proof that they verify the predicate" "given by" P. Comments "We can now define the subset of" E "defined by the predicate" P ":". Definition part := Build_subtype_image (subtype_image_carrier:=subtype) subtype_elt. End Part_type. Comments "We can see a subset as a set with these coercions:". Coercion set_of_subtype_image : subtype_image >-> Setoid. Coercion part : Predicate >-> subtype_image. Comments "We define" (in_part x A) "for elements of" E ":". Definition in_part (E : Setoid) (x : E) (A : Predicate E) := Pred_fun A x. Section Part_set. Variable E : Setoid. Comments "The equality between parts of" E ":". Definition eq_part (A B : Predicate E) : Prop := forall x : E, (in_part x A -> in_part x B) /\ (in_part x B -> in_part x A). Let eq_part_equiv : equivalence eq_part. (* Goal: @pred_compatible E (fun x : Carrier E => not (@in_part E x (@Ap E (part_set E) f x))) *) red in |- *. (* Goal: and (@transitive (Predicate E) eq_part) (@symmetric (Predicate E) eq_part) *) split; [ try assumption | idtac ]. (* Goal: @pred_compatible E (fun x : Carrier E => not (@in_part E x (@Ap E (part_set E) f x))) *) red in |- *. (* Goal: forall (x y : Predicate E) (_ : @app_rel (Predicate E) eq_part x y), @app_rel (Predicate E) eq_part y x *) unfold eq_part, app_rel in |- *; simpl in |- *. (* Goal: forall (_ : forall _ : @in_part E x A, @in_part E x B) (_ : forall _ : @in_part E x B, @in_part E x A), @in_part E x B *) intuition. (* Goal: @pred_compatible E (fun x : Carrier E => not (@in_part E x (@Ap E (part_set E) f x))) *) red in |- *. (* Goal: and (@transitive (Predicate E) eq_part) (@symmetric (Predicate E) eq_part) *) split; [ try assumption | idtac ]. (* Goal: @pred_compatible E (fun x : Carrier E => not (@in_part E x (@Ap E (part_set E) f x))) *) red in |- *. (* Goal: forall (x y : Predicate E) (_ : @app_rel (Predicate E) eq_part x y), @app_rel (Predicate E) eq_part y x *) unfold eq_part, app_rel in |- *; simpl in |- *. (* Goal: forall (x y z : Predicate E) (_ : forall x0 : Carrier E, and (forall _ : @in_part E x0 x, @in_part E x0 y) (forall _ : @in_part E x0 y, @in_part E x0 x)) (_ : forall x0 : Carrier E, and (forall _ : @in_part E x0 y, @in_part E x0 z) (forall _ : @in_part E x0 z, @in_part E x0 y)) (x0 : Carrier E), and (forall _ : @in_part E x0 x, @in_part E x0 z) (forall _ : @in_part E x0 z, @in_part E x0 x) *) (* Goal: @symmetric (Predicate E) eq_part *) intros x y z H' H'0 x0; try assumption. (* Goal: and (forall _ : @in_part E x0 x, @in_part E x0 z) (forall _ : @in_part E x0 z, @in_part E x0 x) *) (* Goal: @symmetric (Predicate E) eq_part *) elim (H'0 x0); intros H'2 H'3; try exact H'2. (* Goal: and (forall _ : @in_part E x0 x, @in_part E x0 z) (forall _ : @in_part E x0 z, @in_part E x0 x) *) (* Goal: @symmetric (Predicate E) eq_part *) elim (H' x0); intros H'1 H'4; try exact H'1. (* Goal: forall (_ : forall _ : @in_part E x A, @in_part E x B) (_ : forall _ : @in_part E x B, @in_part E x A), @in_part E x B *) intuition. (* Goal: @pred_compatible E (fun x : Carrier E => not (@in_part E x (@Ap E (part_set E) f x))) *) red in |- *. (* Goal: forall (x y : Predicate E) (_ : @app_rel (Predicate E) eq_part x y), @app_rel (Predicate E) eq_part y x *) unfold eq_part, app_rel in |- *; simpl in |- *. (* Goal: forall (x y : Predicate E) (_ : forall x0 : Carrier E, and (forall _ : @in_part E x0 x, @in_part E x0 y) (forall _ : @in_part E x0 y, @in_part E x0 x)) (x0 : Carrier E), and (forall _ : @in_part E x0 y, @in_part E x0 x) (forall _ : @in_part E x0 x, @in_part E x0 y) *) intros x y H' x0; try assumption. (* Goal: and (forall _ : @in_part E x0 y, @in_part E x0 x) (forall _ : @in_part E x0 x, @in_part E x0 y) *) elim (H' x0); intros H'2 H'3; try exact H'2. (* Goal: forall (_ : forall _ : @in_part E x A, @in_part E x B) (_ : forall _ : @in_part E x B, @in_part E x A), @in_part E x B *) intuition. Qed. Comments "We define the set" (part_set E) "of all parts of" E ", with its equality:". Definition part_set : Setoid := Build_Setoid eq_part_equiv. Comments "The empty part" (empty E) ":". Hint Unfold pred_compatible: algebra. Definition empty : part_set. (* Goal: Carrier part_set *) apply (Build_Predicate (E:=E) (Pred_fun:=fun x : E => False)). (* Goal: @in_part E x A *) auto with algebra. Defined. Comments "And the full part:". Definition full : part_set. (* Goal: Carrier part_set *) apply (Build_Predicate (E:=E) (Pred_fun:=fun x : E => True)). (* Goal: @in_part E x A *) auto with algebra. Defined. End Part_set. Hint Unfold pred_compatible: algebra. Section Inclusion. Variable E : Setoid. Comments "The relation of belonging is compatible with equality:". Lemma in_part_comp_l : forall (A : part_set E) (x y : E), in_part x A -> Equal y x -> in_part y A. (* Goal: forall A : Carrier (part_set E), @injective (@set_of_subtype_image E (@part E A)) E (inj_part A) *) intros A; try assumption. (* Goal: forall (x y : Carrier E) (_ : @in_part E x A) (_ : @Equal E y x), @in_part E y A *) exact (Pred_compatible_prf (E:=E) (p:=A)). Qed. Lemma in_part_comp_r : forall (x : E) (A B : part_set E), in_part x A -> Equal A B -> in_part x B. (* Goal: forall (x : Carrier E) (A B : Carrier (part_set E)) (_ : @in_part E x A) (_ : @Equal (part_set E) A B), @in_part E x B *) simpl in |- *; unfold eq_part in |- *. (* Goal: forall (x : Carrier E) (A B : Predicate E) (_ : @in_part E x A) (_ : forall x0 : Carrier E, and (forall _ : @in_part E x0 A, @in_part E x0 B) (forall _ : @in_part E x0 B, @in_part E x0 A)), @in_part E x B *) intros x A B H' H'0; try assumption. (* Goal: @in_part E x B *) elim (H'0 x). (* Goal: forall (_ : forall _ : @in_part E x A, @in_part E x B) (_ : forall _ : @in_part E x B, @in_part E x A), @in_part E x B *) intuition. Qed. Lemma empty_prop : forall x : E, ~ in_part x (empty E). (* Goal: @in_part E x A *) unfold not in |- *; auto with algebra. Qed. Hint Resolve empty_prop: algebra. Lemma full_prop : forall x : E, in_part x (full E). (* Goal: @in_part E x A *) unfold full in |- *; simpl in |- *; auto with algebra. Qed. Hint Resolve full_prop: algebra. Definition full_to_set : MAP (full E) E. (* Goal: Carrier (MAP (@set_of_subtype_image E (@part E (full E))) E) *) apply (Build_Map (Ap:=fun x : full E => full E x)). (* Goal: @pred_compatible E (fun x : Carrier E => not (@in_part E x (@Ap E (part_set E) f x))) *) red in |- *. (* Goal: forall (x y : Carrier (@set_of_subtype_image E (@part E A))) (_ : @Equal (@set_of_subtype_image E (@part E B)) (@Ap (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image E (@part E B)) (@inj_part_included A B p) x) (@Ap (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image E (@part E B)) (@inj_part_included A B p) y)), @Equal (@set_of_subtype_image E (@part E A)) x y *) intros x y; try assumption. (* Goal: forall _ : @Equal (@set_of_subtype_image E (@part E B)) (@Ap (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image E (@part E B)) (@inj_part_included A B p) x) (@Ap (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image E (@part E B)) (@inj_part_included A B p) y), @Equal (@set_of_subtype_image E (@part E A)) x y *) elim x. (* Goal: forall (subtype_elt : Carrier E) (subtype_prf : @Pred_fun E A subtype_elt) (_ : @Equal (@set_of_subtype_image E (@part E B)) (@Ap (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image E (@part E B)) (@inj_part_included A B p) (@Build_subtype E A subtype_elt subtype_prf)) (@Ap (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image E (@part E B)) (@inj_part_included A B p) y)), @Equal (@set_of_subtype_image E (@part E A)) (@Build_subtype E A subtype_elt subtype_prf) y *) elim y. (* Goal: @in_part E x X *) (* Goal: not (@in_part E x X) *) simpl in |- *. (* Goal: forall (subtype_elt0 : Carrier E) (subtype_prf : True) (subtype_elt1 : Carrier E) (subtype_prf0 : True) (_ : @subtype_image_equal E (@subtype E (full E)) (@subtype_elt E (full E)) (@Build_subtype E (full E) subtype_elt1 subtype_prf0) (@Build_subtype E (full E) subtype_elt0 subtype_prf)), @Equal E subtype_elt1 subtype_elt0 *) unfold subtype_image_equal in |- *. (* Goal: @in_part E x A *) simpl in |- *; auto with algebra. Defined. Definition set_to_full : MAP E (full E). apply (Build_Map (A:=E) (B:=full E) (Ap:=fun x : E => Build_subtype (E:=E) (P:=full E) (subtype_elt:=x) (full_prop x))). (* Goal: @pred_compatible E (fun x : Carrier E => not (@in_part E x (@Ap E (part_set E) f x))) *) red in |- *. (* Goal: @in_part E x A *) simpl in |- *; auto with algebra. Defined. Lemma set_full_set : Equal (comp_map_map full_to_set set_to_full) (Id E). (* Goal: @in_part E x A *) simpl in |- *; auto with algebra. (* Goal: @pred_compatible E (fun x : Carrier E => not (@in_part E x (@Ap E (part_set E) f x))) *) red in |- *. (* Goal: @in_part E x A *) simpl in |- *; auto with algebra. Qed. Lemma full_set_full : Equal (comp_map_map set_to_full full_to_set) (Id (full E)). (* Goal: @in_part E x A *) simpl in |- *; auto with algebra. (* Goal: @pred_compatible E (fun x : Carrier E => not (@in_part E x (@Ap E (part_set E) f x))) *) red in |- *. (* Goal: @in_part E x A *) simpl in |- *; auto with algebra. (* Goal: forall x : @subtype E (full E), @subtype_image_equal E (@subtype E (full E)) (@subtype_elt E (full E)) (@Build_subtype E (full E) (@subtype_elt E (full E) x) (full_prop (@subtype_elt E (full E) x))) x *) intros x; try assumption. (* Goal: forall _ : @Equal (@set_of_subtype_image E (@part E B)) (@Ap (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image E (@part E B)) (@inj_part_included A B p) x) (@Ap (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image E (@part E B)) (@inj_part_included A B p) y), @Equal (@set_of_subtype_image E (@part E A)) x y *) elim x. (* Goal: @in_part E x A *) simpl in |- *; auto with algebra. (* Goal: @pred_compatible E (fun x : Carrier E => not (@in_part E x (@Ap E (part_set E) f x))) *) intros subtype_elt' subtype_prf'; red in |- *. (* Goal: @in_part E x A *) simpl in |- *; auto with algebra. Qed. Comments "The inclusion of parts:". Definition included (A B : part_set E) : Prop := forall x : E, in_part x A -> in_part x B. Comments "The relation of inclusion is an order relation:". Lemma included_refl : forall A : part_set E, included A A. (* Goal: @in_part E x A *) simpl in |- *; unfold included in |- *; auto with algebra. Qed. Hint Resolve included_refl: algebra. Lemma included_antisym : forall A B : part_set E, included A B -> included B A -> Equal A B. (* Goal: @in_part E x A *) simpl in |- *; unfold eq_part, included in |- *; auto with algebra. Qed. Lemma included_trans : forall A B C : part_set E, included A B -> included B C -> included A C. (* Goal: @in_part E x A *) simpl in |- *; unfold included in |- *; auto with algebra. Qed. Comments "The inclusion relation is compatible with equality:". Lemma included_comp : forall A A' B B' : part_set E, Equal A A' -> Equal B B' -> included A B -> included A' B'. (* Goal: forall (A B : Carrier (part_set E)) (_ : @Equal (part_set E) A B), included A B *) simpl in |- *; unfold eq_part, included in |- *. (* Goal: forall (A A' B B' : Predicate E) (_ : forall x : Carrier E, and (forall _ : @in_part E x A, @in_part E x A') (forall _ : @in_part E x A', @in_part E x A)) (_ : forall x : Carrier E, and (forall _ : @in_part E x B, @in_part E x B') (forall _ : @in_part E x B', @in_part E x B)) (_ : forall (x : Carrier E) (_ : @in_part E x A), @in_part E x B) (x : Carrier E) (_ : @in_part E x A'), @in_part E x B' *) intros A A' B B' H' H'0 H'1 x H'2; try assumption. (* Goal: @in_part E x B' *) elim (H'0 x); intros H'4 H'5; apply H'4. (* Goal: @in_part E x B *) lapply (H'1 x); [ intros H'6; apply H'6 | idtac ]. (* Goal: @in_part E x A *) elim (H' x); intros H'6 H'7; apply H'7; auto with algebra. Qed. Lemma eq_part_included : forall A B : part_set E, Equal A B -> included A B. (* Goal: forall (A B : Carrier (part_set E)) (_ : @Equal (part_set E) A B), included A B *) simpl in |- *; unfold eq_part, included in |- *. (* Goal: forall (A B : Predicate E) (_ : forall x : Carrier E, and (forall _ : @in_part E x A, @in_part E x B) (forall _ : @in_part E x B, @in_part E x A)) (x : Carrier E) (_ : @in_part E x A), @in_part E x B *) intros A B H' x H'0; try assumption. specialize H' with (x := x); rename H' into H'1; try exact H'1. (* Goal: @in_part E x A *) elim H'1; intros H'2 H'3; try exact H'2; clear H'1; auto with algebra. Qed. Hint Resolve eq_part_included: algebra. Lemma empty_included : forall A : part_set E, included (empty E) A. (* Goal: @in_part E x A *) simpl in |- *; unfold included in |- *; auto with algebra. (* Goal: forall (A : Predicate E) (x : Carrier E) (_ : @in_part E x (empty E)), @in_part E x A *) intros A x H'; try assumption. (* Goal: @in_part E x A *) absurd (in_part x (empty E)); auto with algebra. Qed. Lemma full_included : forall A : part_set E, included A (full E). (* Goal: @in_part E x A *) simpl in |- *; unfold included in |- *; auto with algebra. Qed. Hint Resolve empty_included full_included: algebra. Definition inj_part : forall A : part_set E, MAP A E. (* Goal: forall A : Carrier (part_set E), @injective (@set_of_subtype_image E (@part E A)) E (inj_part A) *) intros A; try assumption. (* Goal: Carrier (MAP (@set_of_subtype_image E (@part E A)) E) *) apply (Build_Map (Ap:=fun x : A => subtype_elt x)). (* Goal: @pred_compatible E (fun x : Carrier E => not (@in_part E x (@Ap E (part_set E) f x))) *) red in |- *. (* Goal: @in_part E x A *) auto with algebra. Defined. Lemma inj_part_injective : forall A : part_set E, injective (inj_part A). (* Goal: forall A : Carrier (part_set E), @injective (@set_of_subtype_image E (@part E A)) E (inj_part A) *) intros A; try assumption. (* Goal: @pred_compatible E (fun x : Carrier E => not (@in_part E x (@Ap E (part_set E) f x))) *) red in |- *. (* Goal: @in_part E x A *) auto with algebra. Qed. Definition inj_part_included : forall A B : part_set E, included A B -> MAP A B. (* Goal: forall (A B : Carrier (part_set E)) (_ : @Equal (part_set E) A B), Carrier (MAP (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image E (@part E B))) *) intros A B H'; try assumption. (* Goal: Carrier (MAP (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image E (@part E B))) *) red in H'. apply (Build_Map (A:=A) (B:=B) (Ap:=fun x : A => Build_subtype (H' (A x) (subtype_prf (E:=E) (P:=A) x)))). (* Goal: @pred_compatible E (fun x : Carrier E => not (@in_part E x (@Ap E (part_set E) f x))) *) red in |- *. (* Goal: @in_part E x A *) simpl in |- *; auto with algebra. Defined. Lemma inj_part_included_prop : forall (A B : part_set E) (p : included A B) (x : A), Equal (B (inj_part_included p x)) (A x). (* Goal: @in_part E x A *) simpl in |- *; auto with algebra. Qed. Lemma inj_part_included_injective : forall (A B : part_set E) (p : included A B), injective (inj_part_included p). (* Goal: @pred_compatible E (fun x : Carrier E => not (@in_part E x (@Ap E (part_set E) f x))) *) intros A B p; red in |- *. (* Goal: forall (x y : Carrier (@set_of_subtype_image E (@part E A))) (_ : @Equal (@set_of_subtype_image E (@part E B)) (@Ap (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image E (@part E B)) (@inj_part_included A B p) x) (@Ap (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image E (@part E B)) (@inj_part_included A B p) y)), @Equal (@set_of_subtype_image E (@part E A)) x y *) intros x y; try assumption. (* Goal: forall _ : @Equal (@set_of_subtype_image E (@part E B)) (@Ap (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image E (@part E B)) (@inj_part_included A B p) x) (@Ap (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image E (@part E B)) (@inj_part_included A B p) y), @Equal (@set_of_subtype_image E (@part E A)) x y *) elim x. (* Goal: forall (subtype_elt : Carrier E) (subtype_prf : @Pred_fun E A subtype_elt) (_ : @Equal (@set_of_subtype_image E (@part E B)) (@Ap (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image E (@part E B)) (@inj_part_included A B p) (@Build_subtype E A subtype_elt subtype_prf)) (@Ap (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image E (@part E B)) (@inj_part_included A B p) y)), @Equal (@set_of_subtype_image E (@part E A)) (@Build_subtype E A subtype_elt subtype_prf) y *) elim y. (* Goal: @in_part E x A *) simpl in |- *; auto with algebra. Qed. Definition id_map_parts_equal : forall A B : part_set E, Equal A B -> MAP A B. (* Goal: forall (A B : Carrier (part_set E)) (_ : @Equal (part_set E) A B), Carrier (MAP (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image E (@part E B))) *) intros A B H'; try assumption. (* Goal: Carrier (MAP (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image E (@part E B))) *) exact (inj_part_included (eq_part_included H')). Defined. Lemma id_map_parts_equal_prop : forall (A B : part_set E) (p : Equal A B) (x : A), Equal (subtype_elt (id_map_parts_equal p x)) (subtype_elt x). (* Goal: @in_part E x A *) simpl in |- *; auto with algebra. Qed. End Inclusion. Section Union_of_part. Variable E : Setoid. Comments "We define the union of a part of" (part_set E). Variable P : part_set (part_set E). Definition union_part : part_set E. apply (Build_Predicate (Pred_fun:=fun x : E => exists A : part_set E, in_part A P /\ in_part x A)). (* Goal: @pred_compatible E (fun x : Carrier E => not (@in_part E x (@Ap E (part_set E) f x))) *) red in |- *. (* Goal: forall (x y : Carrier E) (_ : @ex (Carrier (part_set E)) (fun A : Carrier (part_set E) => and (@in_part (part_set E) A P) (@in_part E x A))) (_ : @Equal E y x), @ex (Carrier (part_set E)) (fun A : Carrier (part_set E) => and (@in_part (part_set E) A P) (@in_part E y A)) *) intros x y H' H'0; try assumption. (* Goal: @ex (Carrier (part_set E)) (fun A : Carrier (part_set E) => and (@in_part (part_set E) A P) (@in_part E y A)) *) elim H'; intros A E0; elim E0; clear H'. (* Goal: forall (_ : @in_part (part_set E) A P) (_ : @in_part E x A), @ex (Carrier (part_set E)) (fun A : Carrier (part_set E) => and (@in_part (part_set E) A P) (@in_part E y A)) *) intros H' H'1; try assumption. (* Goal: and (@transitive (Predicate E) eq_part) (@symmetric (Predicate E) eq_part) *) exists A; split; [ try assumption | idtac ]. (* Goal: @in_part E x A *) apply in_part_comp_l with x; auto with algebra. Defined. Lemma union_part_prop : forall x : E, in_part x union_part -> exists A : part_set E, in_part A P /\ in_part x A. (* Goal: @in_part E x A *) intros x H'; red in H'; auto with algebra. Qed. Lemma union_part_prop_rev : forall A : part_set E, in_part A P -> forall x : E, in_part x A -> in_part x union_part. (* Goal: @in_part E x A *) unfold union_part in |- *; simpl in |- *; auto with algebra. (* Goal: forall (A : Predicate E) (_ : @in_part (part_set E) A P) (x : Carrier E) (_ : @in_part E x A), @ex (Predicate E) (fun A0 : Predicate E => and (@in_part (part_set E) A0 P) (@in_part E x A0)) *) intros A H' x H'0; try assumption. (* Goal: and (@transitive (Predicate E) eq_part) (@symmetric (Predicate E) eq_part) *) exists A; split; [ try assumption | idtac ]. (* Goal: @in_part E x A *) auto with algebra. Qed. Lemma union_part_included : forall A : part_set E, in_part A P -> included A union_part. (* Goal: forall (A : Carrier (part_set E)) (_ : @in_part (part_set E) A P), @included E A union_part *) intros A H'; try assumption. (* Goal: @in_part E x A *) unfold included in |- *; auto with algebra. (* Goal: forall (x : Carrier E) (_ : @in_part E x union_part), @in_part E x Y *) intros x H'0; try assumption. (* Goal: @in_part E x A *) apply union_part_prop_rev with (A := A); auto with algebra. Qed. Lemma union_part_upper_bound : forall Y : part_set E, (forall A : part_set E, in_part A P -> included A Y) -> included union_part Y. (* Goal: forall (Y : Carrier (part_set E)) (_ : forall (A : Carrier (part_set E)) (_ : @in_part (part_set E) A P), @included E A Y), @included E union_part Y *) intros Y H'; try assumption. (* Goal: @included E union_part Y *) unfold included in |- *. (* Goal: forall (x : Carrier E) (_ : @in_part E x union_part), @in_part E x Y *) intros x H'0; try assumption. (* Goal: @in_part E x Y *) case (union_part_prop H'0). (* Goal: forall (x0 : Carrier (part_set E)) (_ : and (@in_part (part_set E) x0 P) (@in_part E x x0)), @in_part E x Y *) intros A H'1; try assumption. (* Goal: @in_part E x Y *) elim H'1. (* Goal: forall (_ : @in_part (part_set E) A P) (_ : @in_part E x A), @in_part E x Y *) intros H'2 H'3; try assumption. (* Goal: @in_part E x Y *) unfold included in H'. (* Goal: @in_part E x A *) apply H' with (A := A); auto with algebra. Qed. End Union_of_part. Section Part_set_greater. Comments "A nice theorem:". Variable E : Setoid. Variable f : MAP E (part_set E). Hypothesis fsurj : surjective f. Let X_def (x : E) : Prop := ~ in_part x (f x). Let X : part_set E. (* Goal: Carrier (part_set E) *) apply (Build_Predicate (E:=E) (Pred_fun:=X_def)). (* Goal: X_def x *) (* Goal: not (@in_part E x X) *) unfold X_def in |- *. (* Goal: @pred_compatible E (fun x : Carrier E => not (@in_part E x (@Ap E (part_set E) f x))) *) red in |- *. (* Goal: not (@in_part E x X) *) unfold not in |- *. (* Goal: forall (x y : Carrier E) (_ : forall _ : @in_part E x (@Ap E (part_set E) f x), False) (_ : @Equal E y x) (_ : @in_part E y (@Ap E (part_set E) f y)), False *) intros x y H' H'0 H'1; try assumption. (* Goal: False *) apply H'. (* Goal: @in_part E x A *) apply in_part_comp_l with y; auto with algebra. (* Goal: @in_part E x A *) apply in_part_comp_r with (Ap f y); auto with algebra. Defined. Let invX : exists x : E, Equal X (f x). (* Goal: @ex (Carrier E) (fun x : Carrier E => @Equal (part_set E) X (@Ap E (part_set E) f x)) *) exact (fsurj X). Qed. Lemma not_inpart_comp_r : forall (E : Setoid) (x : E) (A B : part_set E), ~ in_part x A -> Equal A B -> ~ in_part x B. (* Goal: not (@in_part E x X) *) unfold not in |- *. (* Goal: forall (E : Setoid) (x : Carrier E) (A B : Carrier (part_set E)) (_ : forall _ : @in_part E x A, False) (_ : @Equal (part_set E) A B) (_ : @in_part E x B), False *) intros E0 x A B H' H'0 H'1; try assumption. (* Goal: False *) apply H'. (* Goal: @in_part E x A *) apply in_part_comp_r with B; auto with algebra. Qed. Theorem part_set_is_strictly_greater_than_set1 : False. (* Goal: False *) case invX. (* Goal: forall (x : Carrier E) (_ : @Equal (part_set E) X (@Ap E (part_set E) f x)), False *) intros x H'; try assumption. (* Goal: False *) cut (~ in_part x X). (* Goal: forall _ : @in_part E x X, False *) intros H'0; try assumption. (* Goal: @in_part E x A *) absurd (in_part x X); auto with algebra. (* Goal: @in_part E x X *) (* Goal: not (@in_part E x X) *) simpl in |- *. (* Goal: X_def x *) (* Goal: not (@in_part E x X) *) unfold X_def in |- *. (* Goal: @in_part E x A *) apply not_inpart_comp_r with X; auto with algebra. (* Goal: not (@in_part E x X) *) unfold not in |- *. (* Goal: forall _ : @in_part E x X, False *) intros H'0; try assumption. (* Goal: @in_part E x A *) absurd (in_part x X); auto with algebra. (* Goal: @in_part E x A *) apply not_inpart_comp_r with (Ap f x); auto with algebra. Qed. End Part_set_greater. Theorem part_set_is_strictly_greater_than_set : forall (E : Setoid) (f : MAP E (part_set E)), ~ surjective f. (* Goal: forall (E : Setoid) (f : Carrier (MAP E (part_set E))), not (@surjective E (part_set E) f) *) exact part_set_is_strictly_greater_than_set1. Qed. Hint Unfold pred_compatible: algebra. Hint Resolve empty_prop full_prop included_refl eq_part_included empty_included full_included inj_part_injective inj_part_included_injective id_map_parts_equal_prop union_part_included union_part_upper_bound not_inpart_comp_r: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Automatic Coercions Import. Set Implicit Arguments. Unset Strict Implicit. Require Export Z_group_facts. (** Title "Universal property of integers." *) 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)). (* 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: @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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) 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. apply Trans with (sgroup_law R (nat_to_group (ring_unit R) m) (* 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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) (nat_to_group (ring_unit R) (n0 * m))); auto with algebra. 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))); (* 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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) auto with algebra. 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)); (* 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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) auto with algebra. apply Trans with (sgroup_law R (nat_to_group (ring_unit R) m) (ring_mult (nat_to_group (ring_unit R) n0) (* 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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) (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. 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)))) (@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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_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)))) (@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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_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)))) (@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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) auto with algebra. (* 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)))))) *) (* 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 |- *. (* 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)) *) (* 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) *) intros x y; try assumption. apply Trans with (Z_to_group_nat_fun (ring_unit R) (ring_mult (x:ZZ) 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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) auto with algebra. apply Trans with (ring_mult (Z_to_group_nat_fun (ring_unit R) x) (* 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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_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))))) (@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)) *) (* 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) *) elim x; simpl in |- *; unfold ring_mult at 1 in |- *; simpl in |- *; intros. apply Trans with (ring_mult (monoid_unit R) (Z_to_group_nat_fun (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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_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)))) (@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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) apply Trans with (monoid_unit R); auto with algebra. (* 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))))) (@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) *) 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)))) (@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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) apply Trans with (monoid_unit R); auto with algebra. apply Trans with (ring_mult (Z_to_group_nat_fun (ring_unit R) (Zpos p)) (monoid_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)))) (@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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) auto with algebra. 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))))); (* 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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) auto with algebra. (* 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)))))) *) (* 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 |- *. rewrite (fun (x y : positive) (_ : positive -> positive) => nat_of_P_mult_morphism x y). 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))))); (* 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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) auto with algebra. 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)))))); (* 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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) auto with algebra. (* 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)))))) *) (* 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 |- *. rewrite (fun (x y : positive) (_ : positive -> positive) => nat_of_P_mult_morphism x y). 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)))))); (* 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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) auto with algebra. (* 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)))))) *) (* 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 |- *. 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)))); (* 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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) auto with algebra. (* 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))))) (@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) *) 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)))) (@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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) apply Trans with (monoid_unit R); auto with algebra. apply Trans with (ring_mult (Z_to_group_nat_fun (ring_unit R) (Zneg p)) (monoid_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)))) (@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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) auto with algebra. 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)))))); (* 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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) auto with algebra. (* 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)))))) *) (* 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 |- *. rewrite (fun (x y : positive) (_ : positive -> positive) => nat_of_P_mult_morphism x y). 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))))); (* 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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) auto with algebra. (* 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)))))) *) (* 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 |- *. 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)))); (* 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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) auto with algebra. 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))))); (* 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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) auto with algebra. (* 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)))))) *) (* 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 |- *. rewrite (fun (x y : positive) (_ : positive -> positive) => nat_of_P_mult_morphism x y). 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)))))); (* 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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) auto with algebra. 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))); (* 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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) auto with algebra. (* 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)))))) *) (* 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 |- *. 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))))); (* 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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) auto with algebra. 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))))); (* 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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_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)))) (@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)))) (@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)))) (ring_unit (cring_ring (idomain_ring ZZ)))) (ring_unit R) *) simpl in |- *; auto with algebra. Defined. End Zup1.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Union. Require Export Singleton. Require Export Diff. Require Export Classical_Prop. Section fparts_in_def. Variable E : Setoid. (* Add_part. *) Definition add_part (A : part_set E) (x : E) := union A (single x). Lemma add_part_comp : forall (A A' : part_set E) (x x' : E), Equal A A' -> Equal x x' -> Equal (add_part A x) (add_part A' x'). (* Goal: forall (A A' : Carrier (part_set E)) (x x' : Carrier E) (_ : @Equal (part_set E) A A') (_ : @Equal E x x'), @Equal (part_set E) (add_part A x) (add_part A' x') *) unfold add_part in |- *; auto with algebra. Qed. Hint Resolve add_part_comp: algebra. Lemma add_part_in : forall (A : part_set E) (x : E), in_part x (add_part A x). (* Goal: forall (A : Carrier (part_set E)) (x : Carrier E), @in_part E x (add_part A x) *) simpl in |- *; auto with algebra. Qed. Hint Resolve add_part_in: algebra. Lemma add_part_com : forall (A : part_set E) (x y : E), Equal (add_part (add_part A x) y) (add_part (add_part A y) x). (* Goal: forall x : Carrier E, @Equal (part_set E) (@single E x) (add_part (empty E) x) *) unfold add_part in |- *. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) intros. (* Goal: @Equal (part_set E) (@union E (@union E A (@single E x)) (@single E y)) (@union E (@union E A (@single E y)) (@single E x)) *) apply Trans with (union A (union (single x) (single y))); auto with algebra. (* Goal: @Equal (part_set E) (@union E A (@union E (@single E x) (@single E y))) (@union E (@union E A (@single E y)) (@single E x)) *) apply Trans with (union A (union (single y) (single x))); auto with algebra. Qed. Hint Immediate add_part_com: algebra. Lemma add_in : forall (A : part_set E) (x : E), in_part x A -> Equal (add_part A x) A. (* Goal: forall (A : Predicate E) (x : Carrier E) (_ : not (@in_part E x A)) (x0 : Carrier E), and (forall _ : and (@in_part E x0 A) (not (@Equal E x0 x)), @in_part E x0 A) (forall _ : @in_part E x0 A, and (@in_part E x0 A) (not (@Equal E x0 x))) *) intro A. (* Goal: forall _ : forall x : Carrier E, not (@in_part E x A), @Equal (part_set E) A (empty E) *) case A. simpl in |- *; unfold pred_compatible, eq_part, in_part in |- *; (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) simpl in |- *. (* Goal: forall (_ : forall x : Carrier E, not (a x)) (x : Carrier E), and (forall _ : a x, False) (forall _ : False, a x) *) intuition eauto. Qed. Hint Resolve add_in: algebra. Lemma add_part_in_el_diff : forall (A : part_set E) (x y : E), in_part y (add_part A x) -> ~ Equal y x -> in_part y A. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) simpl in |- *. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) unfold eq_part, add_part, union, single in |- *; simpl in |- *. (* Goal: forall x : Carrier E, cardinal (@single E x) (S O) *) intro. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) case A; simpl in |- *. (* Goal: forall (Pred_fun : forall _ : Carrier E, Prop) (Pred_compatible_prf : @pred_compatible E Pred_fun) (_ : forall x : Carrier E, not (@in_part E x (@Build_Predicate E Pred_fun Pred_compatible_prf))), @Equal (part_set E) (@Build_Predicate E Pred_fun Pred_compatible_prf) (empty E) *) intros a pa. (* Goal: not (@in_part E x (@single E x0)) *) (* Goal: @in_part E x (@single E x0) *) (* Goal: forall (n : nat) (_ : forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S n)), cardinal B n) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S (S n))), cardinal B (S n) *) intuition. Qed. Lemma add_part_in_el_not_in : forall (A : part_set E) (x y : E), in_part y (add_part A x) -> ~ in_part y A -> Equal y x. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) simpl in |- *. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) unfold eq_part, add_part, union, single in |- *; simpl in |- *. (* Goal: forall x : Carrier E, cardinal (@single E x) (S O) *) intro. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) case A; simpl in |- *. (* Goal: forall (Pred_fun : forall _ : Carrier E, Prop) (Pred_compatible_prf : @pred_compatible E Pred_fun) (_ : forall x : Carrier E, not (@in_part E x (@Build_Predicate E Pred_fun Pred_compatible_prf))), @Equal (part_set E) (@Build_Predicate E Pred_fun Pred_compatible_prf) (empty E) *) intros a pa. (* Goal: not (@in_part E x (@single E x0)) *) (* Goal: @in_part E x (@single E x0) *) (* Goal: forall (n : nat) (_ : forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S n)), cardinal B n) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S (S n))), cardinal B (S n) *) intuition. Qed. Lemma add_part_simpl : forall (A B : part_set E) (x : E), ~ in_part x A -> ~ in_part x B -> Equal (add_part A x) (add_part B x) -> Equal A B. (* Goal: forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x A)) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) (add_part A x) (add_part B x)), @Equal (part_set E) A B *) intros A B. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) case A; case B; simpl in |- *. (* Goal: forall (Pred_fun : forall _ : Carrier E, Prop) (Pred_compatible_prf : @pred_compatible E Pred_fun) (Pred_fun0 : forall _ : Carrier E, Prop) (Pred_compatible_prf0 : @pred_compatible E Pred_fun0) (_ : not (Pred_fun0 x)) (_ : @eq_part E (@Build_Predicate E Pred_fun0 Pred_compatible_prf0) (@Build_Predicate E Pred_fun Pred_compatible_prf)), not (Pred_fun x) *) intros a pa b pb. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) unfold eq_part, add_part, union, single in |- *; simpl in |- *. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) intros. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) elim (classic (Equal x x0)); intros. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) split; intros. (* Goal: a x0 *) (* Goal: or (and (a x0) (forall _ : @Equal E x0 x, False)) (@Equal E x0 x) *) apply pa with x; auto with algebra. (* Goal: a x *) (* Goal: b x0 *) (* Goal: and (forall _ : b x0, a x0) (forall _ : a x0, b x0) *) cut (b x). (* Goal: forall x : Carrier E, cardinal (@single E x) (S O) *) intro. (* Goal: a x *) (* Goal: b x *) (* Goal: b x0 *) (* Goal: and (forall _ : b x0, a x0) (forall _ : a x0, b x0) *) absurd (b x); auto with algebra. (* Goal: b x *) (* Goal: b x0 *) (* Goal: and (forall _ : b x0, a x0) (forall _ : a x0, b x0) *) apply pb with x0; auto with algebra. (* Goal: b x0 *) (* Goal: and (forall _ : b x0, a x0) (forall _ : a x0, b x0) *) cut (a x). (* Goal: forall x : Carrier E, cardinal (@single E x) (S O) *) intro. (* Goal: b x0 *) (* Goal: a x *) (* Goal: and (forall _ : b x0, a x0) (forall _ : a x0, b x0) *) absurd (a x); auto with algebra. (* Goal: a x *) apply pa with x0; auto with algebra. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) elim (H1 x0); intros. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) split; intros. (* Goal: a x0 *) (* Goal: b x0 *) lapply H3. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) intros. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) elim H6; intros. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) absurd (Equal x0 x); auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) left; auto with algebra. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) lapply H4; intros. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) elim H6; intros. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) absurd (Equal x0 x); auto with algebra. (* Goal: or (a x0) (@Equal E x0 x) *) left. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) auto with algebra. Qed. (* Minus_part. *) Definition minus_part (A : part_set E) (x : E) := diff A (single x). Lemma minus_part_comp : forall (A A' : part_set E) (x x' : E), Equal A A' -> Equal x x' -> Equal (minus_part A x) (minus_part A' x'). (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) unfold minus_part in |- *; auto with algebra. Qed. Hint Resolve minus_part_comp: algebra. Lemma minus_part_not_in : forall (A : part_set E) (x : E), ~ in_part x (minus_part A x). (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) simpl in |- *. (* Goal: forall x : Carrier E, cardinal (@single E x) (S O) *) intro. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) case A; simpl in |- *. (* Goal: forall (Pred_fun : forall _ : Carrier E, Prop) (Pred_compatible_prf : @pred_compatible E Pred_fun) (_ : forall x : Carrier E, not (@in_part E x (@Build_Predicate E Pred_fun Pred_compatible_prf))), @Equal (part_set E) (@Build_Predicate E Pred_fun Pred_compatible_prf) (empty E) *) intros a pa. (* Goal: not (@in_part E x (@single E x0)) *) (* Goal: @in_part E x (@single E x0) *) (* Goal: forall (n : nat) (_ : forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S n)), cardinal B n) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S (S n))), cardinal B (S n) *) intuition. Qed. Hint Resolve minus_part_not_in: algebra. Lemma minus_part_com : forall (A : part_set E) (x y : E), Equal (minus_part (minus_part A x) y) (minus_part (minus_part A y) x). (* Goal: forall (A : Carrier (part_set E)) (x y : Carrier E), @Equal (part_set E) (minus_part (minus_part A x) y) (minus_part (minus_part A y) x) *) unfold minus_part in |- *. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) intros. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) simpl in |- *. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) unfold eq_part, diff, single in |- *; simpl in |- *. (* Goal: forall x : Carrier E, cardinal (@single E x) (S O) *) intro. (* Goal: not (@in_part E x (@single E x0)) *) (* Goal: @in_part E x (@single E x0) *) (* Goal: forall (n : nat) (_ : forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S n)), cardinal B n) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S (S n))), cardinal B (S n) *) intuition. Qed. Hint Immediate minus_part_com: algebra. Lemma minus_not_in : forall (A : part_set E) (x : E), ~ in_part x A -> Equal (minus_part A x) A. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) simpl in |- *. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) unfold eq_part, minus_part, diff, single in |- *; simpl in |- *. (* Goal: forall (A : Predicate E) (x : Carrier E) (_ : not (@in_part E x A)) (x0 : Carrier E), and (forall _ : and (@in_part E x0 A) (not (@Equal E x0 x)), @in_part E x0 A) (forall _ : @in_part E x0 A, and (@in_part E x0 A) (not (@Equal E x0 x))) *) intro A. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) case A; unfold pred_compatible in |- *; simpl in |- *. (* Goal: forall (Pred_fun : forall _ : Carrier E, Prop) (_ : forall (x y : Carrier E) (_ : Pred_fun x) (_ : @Equal E y x), Pred_fun y) (x : Carrier E) (_ : not (Pred_fun x)) (x0 : Carrier E), and (forall _ : and (Pred_fun x0) (not (@Equal E x0 x)), Pred_fun x0) (forall _ : Pred_fun x0, and (Pred_fun x0) (not (@Equal E x0 x))) *) intros a pa x neg_a_x x0. (* Goal: and (forall _ : and (a x0) (not (@Equal E x0 x)), a x0) (forall _ : a x0, and (a x0) (not (@Equal E x0 x))) *) generalize (pa x0 x). (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) intuition auto with algebra. Qed. Hint Resolve minus_not_in: algebra. Lemma minus_trans_not_in : forall (A : part_set E) (x y : E), ~ in_part y A -> ~ in_part y (minus_part A x). (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) simpl in |- *. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) unfold eq_part, minus_part, diff, single in |- *; simpl in |- *. (* Goal: forall x : Carrier E, cardinal (@single E x) (S O) *) intro. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) case A; simpl in |- *. (* Goal: forall (Pred_fun : forall _ : Carrier E, Prop) (Pred_compatible_prf : @pred_compatible E Pred_fun) (_ : forall x : Carrier E, not (@in_part E x (@Build_Predicate E Pred_fun Pred_compatible_prf))), @Equal (part_set E) (@Build_Predicate E Pred_fun Pred_compatible_prf) (empty E) *) intros a pa. (* Goal: not (@in_part E x (@single E x0)) *) (* Goal: @in_part E x (@single E x0) *) (* Goal: forall (n : nat) (_ : forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S n)), cardinal B n) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S (S n))), cardinal B (S n) *) intuition. Qed. Hint Resolve minus_trans_not_in: algebra. (* Some lemmas. *) Lemma union_unit_l : forall A : part_set E, Equal (union (empty E) A) A. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) simpl in |- *. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) unfold eq_part, union, empty in |- *; simpl in |- *. (* Goal: not (@in_part E x (@single E x0)) *) (* Goal: @in_part E x (@single E x0) *) (* Goal: forall (n : nat) (_ : forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S n)), cardinal B n) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S (S n))), cardinal B (S n) *) intuition. Qed. Hint Resolve union_unit_l: algebra. Lemma single_add : forall x : E, Equal (single x) (add_part (empty E) x). (* Goal: forall x : Carrier E, @Equal (part_set E) (@single E x) (add_part (empty E) x) *) unfold add_part in |- *. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) auto with algebra. Qed. Hint Resolve single_add: algebra. Lemma minus_add : forall (A : part_set E) (x : E), in_part x A -> Equal (add_part (minus_part A x) x) A. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) simpl in |- *. unfold eq_part, add_part, minus_part, union, diff, single in |- *; (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) simpl in |- *. (* Goal: forall x : Carrier E, cardinal (@single E x) (S O) *) intro. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) case A; simpl in |- *. (* Goal: forall (Pred_fun : forall _ : Carrier E, Prop) (Pred_compatible_prf : @pred_compatible E Pred_fun) (_ : forall x : Carrier E, not (@in_part E x (@Build_Predicate E Pred_fun Pred_compatible_prf))), @Equal (part_set E) (@Build_Predicate E Pred_fun Pred_compatible_prf) (empty E) *) intros a pa. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) intros. (* Goal: not (@in_part E x (@single E x0)) *) (* Goal: @in_part E x (@single E x0) *) (* Goal: forall (n : nat) (_ : forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S n)), cardinal B n) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S (S n))), cardinal B (S n) *) intuition. (* Goal: a x0 *) (* Goal: or (and (a x0) (forall _ : @Equal E x0 x, False)) (@Equal E x0 x) *) apply pa with x; auto with algebra. (* Goal: not (@in_part E x (@single E x0)) *) (* Goal: @in_part E x (@single E x0) *) (* Goal: forall (n : nat) (_ : forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S n)), cardinal B n) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S (S n))), cardinal B (S n) *) apply NNPP; intuition. Qed. Hint Resolve minus_add: algebra. Lemma add_minus : forall (A : part_set E) (x : E), ~ in_part x A -> Equal (minus_part (add_part A x) x) A. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) simpl in |- *. unfold eq_part, add_part, minus_part, union, diff, single in |- *; (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) simpl in |- *. (* Goal: forall x : Carrier E, cardinal (@single E x) (S O) *) intro. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) case A; simpl in |- *. (* Goal: forall (Pred_fun : forall _ : Carrier E, Prop) (Pred_compatible_prf : @pred_compatible E Pred_fun) (_ : forall x : Carrier E, not (@in_part E x (@Build_Predicate E Pred_fun Pred_compatible_prf))), @Equal (part_set E) (@Build_Predicate E Pred_fun Pred_compatible_prf) (empty E) *) intros a pa. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) intros. (* Goal: not (@in_part E x (@single E x0)) *) (* Goal: @in_part E x (@single E x0) *) (* Goal: forall (n : nat) (_ : forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S n)), cardinal B n) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S (S n))), cardinal B (S n) *) intuition. (* Goal: False *) apply H. (* Goal: a x *) apply pa with x0; auto with algebra. Qed. Hint Resolve add_minus: algebra. (* Cardinal. *) Inductive cardinal : part_set E -> nat -> Prop := | cardinal_empty : forall A : part_set E, Equal A (empty E) -> cardinal A 0 | cardinal_add : forall (A B : part_set E) (n : nat), cardinal B n -> forall x : E, ~ in_part x B -> Equal A (add_part B x) -> cardinal A (S n). Hint Immediate cardinal_empty: algebra. Lemma cardinal_comp : forall (A B : part_set E) (n m : nat), Equal A B -> n = m -> cardinal A n -> cardinal B m. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) intros. (* Goal: @Equal (part_set E) B (empty E) *) (* Goal: forall (n : nat) (_ : forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S n)), cardinal B n) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S (S n))), cardinal B (S n) *) inversion H1. (* Goal: cardinal B m *) rewrite <- H0. (* Goal: cardinal B n *) (* Goal: cardinal B m *) rewrite <- H4. (* Goal: cardinal B O *) (* Goal: forall (n : nat) (_ : forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S n)), cardinal B n) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S (S n))), cardinal B (S n) *) apply cardinal_empty. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply Trans with A; auto with algebra. (* Goal: cardinal B m *) rewrite <- H0. (* Goal: cardinal B n *) rewrite <- H6. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply cardinal_add with B0 x; auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply Trans with A; auto with algebra. Qed. Hint Resolve cardinal_comp: algebra. Lemma cardinal_comp_l : forall (A B : part_set E) (n : nat), Equal A B -> cardinal A n -> cardinal B n. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) intros. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply cardinal_comp with A n; auto with algebra. Qed. Lemma cardinal_comp_r : forall (A : part_set E) (n m : nat), n = m -> cardinal A n -> cardinal A m. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) intros. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply cardinal_comp with A n; auto with algebra. Qed. Lemma cardinal_empty_O : cardinal (empty E) 0. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) auto with algebra. Qed. Hint Resolve cardinal_empty_O: algebra. Lemma cardinal_single : forall x : E, cardinal (single x) 1. (* Goal: forall x : Carrier E, cardinal (@single E x) (S O) *) intro. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply cardinal_add with (empty E) x; auto with algebra. Qed. Hint Resolve cardinal_single: algebra. Lemma cardinal_pair : forall x y : E, ~ Equal x y -> cardinal (union (single x) (single y)) 2. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) intros. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply cardinal_add with (single x) y; auto with algebra. Qed. Hint Resolve cardinal_pair: algebra. Lemma cardinal_O_empty : forall A : part_set E, cardinal A 0 -> Equal A (empty E). (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) intros. (* Goal: @ex (Carrier E) (fun x : Carrier E => @Equal (part_set E) A (@single E x)) *) inversion H. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) auto with algebra. Qed. Hint Resolve cardinal_O_empty: algebra. Lemma cardinal_1_single : forall A : part_set E, cardinal A 1 -> exists x : E, Equal A (single x). (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) intros. (* Goal: @ex (Carrier E) (fun x : Carrier E => @Equal (part_set E) A (@single E x)) *) inversion H. (* Goal: @ex (Carrier E) (fun x : Carrier E => @Equal (part_set E) A (@single E x)) *) exists x. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply Trans with (add_part B x); auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply Trans with (add_part (empty E) x); auto with algebra. Qed. (* Some lemmas. *) Lemma not_in_empty : forall A : part_set E, (forall x : E, ~ in_part x A) -> Equal A (empty E). (* Goal: forall (A : Carrier (part_set E)) (_ : forall x : Carrier E, not (@in_part E x A)), @Equal (part_set E) A (empty E) *) intros A. (* Goal: forall _ : forall x : Carrier E, not (@in_part E x A), @Equal (part_set E) A (empty E) *) case A. (* Goal: forall (Pred_fun : forall _ : Carrier E, Prop) (Pred_compatible_prf : @pred_compatible E Pred_fun) (_ : forall x : Carrier E, not (@in_part E x (@Build_Predicate E Pred_fun Pred_compatible_prf))), @Equal (part_set E) (@Build_Predicate E Pred_fun Pred_compatible_prf) (empty E) *) intros a pa. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) simpl in |- *. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) unfold eq_part, empty in |- *; simpl in |- *. (* Goal: forall (_ : forall x : Carrier E, not (a x)) (x : Carrier E), and (forall _ : a x, False) (forall _ : False, a x) *) intuition eauto. Qed. Hint Immediate not_in_empty: algebra. Lemma not_in_part_trans : forall (x : E) (A B : part_set E), ~ in_part x A -> Equal A B -> ~ in_part x B. (* Goal: forall (x y : Carrier E) (A : Carrier (part_set E)) (_ : not (@in_part E x A)) (_ : @Equal E x y), not (@in_part E y A) *) unfold in_part in |- *. (* Goal: forall (x : Carrier E) (A B : Carrier (part_set E)) (_ : not (@Pred_fun E A x)) (_ : @Equal (part_set E) A B), not (@Pred_fun E B x) *) intros x A B. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) case A; case B; simpl in |- *. (* Goal: forall (Pred_fun : forall _ : Carrier E, Prop) (Pred_compatible_prf : @pred_compatible E Pred_fun) (Pred_fun0 : forall _ : Carrier E, Prop) (Pred_compatible_prf0 : @pred_compatible E Pred_fun0) (_ : not (Pred_fun0 x)) (_ : @eq_part E (@Build_Predicate E Pred_fun0 Pred_compatible_prf0) (@Build_Predicate E Pred_fun Pred_compatible_prf)), not (Pred_fun x) *) intros a pa b pb. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) unfold eq_part in |- *; simpl in |- *. (* Goal: not (@in_part E x (@single E x0)) *) (* Goal: @in_part E x (@single E x0) *) (* Goal: forall (n : nat) (_ : forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S n)), cardinal B n) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S (S n))), cardinal B (S n) *) intuition. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) elim (H0 x); auto with algebra. Qed. Lemma not_in_part_trans_eq : forall (x y : E) (A : part_set E), ~ in_part x A -> Equal x y -> ~ in_part y A. (* Goal: forall (x y : Carrier E) (A : Carrier (part_set E)) (_ : not (@in_part E x A)) (_ : @Equal E x y), not (@in_part E y A) *) unfold in_part in |- *. (* Goal: forall (x y : Carrier E) (A : Carrier (part_set E)) (_ : not (@Pred_fun E A x)) (_ : @Equal E x y), not (@Pred_fun E A y) *) intros x y A. (* Goal: forall (Pred_fun : forall _ : Carrier E, Prop) (Pred_compatible_prf : @pred_compatible E Pred_fun) (_ : forall x : Carrier E, not (@in_part E x (@Build_Predicate E Pred_fun Pred_compatible_prf))), @Equal (part_set E) (@Build_Predicate E Pred_fun Pred_compatible_prf) (empty E) *) case A; intros a pa. (* Goal: forall (_ : not (@Pred_fun E (@Build_Predicate E a pa) x)) (_ : @Equal E x y), not (@Pred_fun E (@Build_Predicate E a pa) y) *) simpl in |- *. (* Goal: not (@in_part E x (@single E x0)) *) (* Goal: @in_part E x (@single E x0) *) (* Goal: forall (n : nat) (_ : forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S n)), cardinal B n) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S (S n))), cardinal B (S n) *) intuition. (* Goal: False *) apply H. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply (pa y x); auto with algebra. Qed. Lemma cardinal_sup3 : forall (A B C : part_set E) (x y : E), Equal A (add_part B x) -> Equal A (add_part C y) -> ~ in_part x B -> ~ in_part y C -> ~ Equal x y -> exists D : part_set E, Equal B (add_part D y) /\ Equal C (add_part D x) /\ ~ in_part x D /\ ~ in_part y D. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) intros. (* Goal: @ex (Carrier (part_set E)) (fun D : Carrier (part_set E) => and (@Equal (part_set E) B (add_part D y)) (and (@Equal (part_set E) C (add_part D x)) (and (not (@in_part E x D)) (not (@in_part E y D))))) *) exists (minus_part B y). (* Goal: and (not (@in_part E x (minus_part B y))) (not (@in_part E y (minus_part B y))) *) split. (* Goal: @Equal (part_set E) B (add_part (minus_part B y) y) *) (* Goal: and (not (@in_part E x (minus_part B y))) (not (@in_part E y (minus_part B y))) *) apply Sym. (* Goal: @Equal (part_set E) (add_part (minus_part B y) y) B *) (* Goal: and (@Equal (part_set E) C (add_part (minus_part B y) x)) (and (not (@in_part E x (minus_part B y))) (not (@in_part E y (minus_part B y)))) *) apply minus_add. (* Goal: @in_part E y B *) (* Goal: and (@Equal (part_set E) C (add_part (minus_part B y) x)) (and (not (@in_part E x (minus_part B y))) (not (@in_part E y (minus_part B y)))) *) cut (in_part y (add_part B x)). (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) intros. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply add_part_in_el_diff with x; auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply in_part_comp_r with A; auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply in_part_comp_r with (add_part C y); auto with algebra. (* Goal: and (not (@in_part E x (minus_part B y))) (not (@in_part E y (minus_part B y))) *) split. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply add_part_simpl with y; auto with algebra. (* Goal: forall x : Carrier E, cardinal (@single E x) (S O) *) unfold not in |- *; intro. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) absurd (Equal y x); auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply add_part_in_el_not_in with (minus_part B y); auto with algebra. apply Trans with (add_part (add_part (minus_part B y) y) x); (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply Trans with (add_part B x); auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply Trans with A; auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply add_part_comp; auto with algebra. (* Goal: @Equal (part_set E) B (add_part (minus_part B y) y) *) (* Goal: and (not (@in_part E x (minus_part B y))) (not (@in_part E y (minus_part B y))) *) apply Sym. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply minus_add; auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply add_part_in_el_diff with x; auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply in_part_comp_r with (add_part C y); auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply Trans with A; auto with algebra. (* Goal: and (not (@in_part E x (minus_part B y))) (not (@in_part E y (minus_part B y))) *) split. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply minus_trans_not_in; auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) auto with algebra. Qed. Lemma cardinal_ind2 : forall P : forall (n : nat) (A : part_set E), cardinal A n -> Prop, (forall (A : part_set E) (c : cardinal A 0), P 0 A c) -> (forall n : nat, (forall (B : part_set E) (c : cardinal B n), P n B c) -> forall (A B : part_set E) (x : E), ~ in_part x B -> Equal A (add_part B x) -> forall c' : cardinal A (S n), P (S n) A c') -> forall (n : nat) (A : part_set E) (c : cardinal A n), P n A c. (* Goal: forall (n : nat) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S n)), cardinal B n *) simple induction n. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) auto with algebra. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) intros. (* Goal: P (S n0) A c *) inversion c. (* Goal: P (S n0) A c *) apply (H0 n0 H1 A B x H4 H6 c). Qed. Lemma cardinal_S : forall (n : nat) (A B : part_set E) (x : E), ~ in_part x B -> Equal A (add_part B x) -> cardinal A (S n) -> cardinal B n. (* Goal: forall (n : nat) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S n)), cardinal B n *) simple induction n. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) intros. (* Goal: cardinal B O *) (* Goal: forall (n : nat) (_ : forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S n)), cardinal B n) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S (S n))), cardinal B (S n) *) apply cardinal_empty. (* Goal: @Equal (part_set E) B (empty E) *) (* Goal: forall (n : nat) (_ : forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S n)), cardinal B n) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S (S n))), cardinal B (S n) *) inversion H1. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) elim (classic (Equal x0 x)); intros. (* Goal: @Equal (part_set E) B (empty E) *) (* Goal: @Equal (part_set E) B (empty E) *) (* Goal: forall (n : nat) (_ : forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S n)), cardinal B n) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S (S n))), cardinal B (S n) *) apply Trans with B0. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply add_part_simpl with x; auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply not_in_part_trans_eq with x0; auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply Trans with A; auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply Trans with (add_part B0 x0); auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) auto with algebra. (* Goal: @Equal (part_set E) B (empty E) *) (* Goal: forall (n : nat) (_ : forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S n)), cardinal B n) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S (S n))), cardinal B (S n) *) absurd (in_part x (single x0)). (* Goal: not (@in_part E x (@single E x0)) *) (* Goal: @in_part E x (@single E x0) *) (* Goal: forall (n : nat) (_ : forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S n)), cardinal B n) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S (S n))), cardinal B (S n) *) intuition. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply in_part_comp_r with (add_part B0 x0); auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply in_part_comp_r with A; auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply in_part_comp_r with (add_part B x); auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply Trans with (add_part (empty E) x0); auto with algebra. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) intros. (* Goal: cardinal B (S n0) *) inversion H2. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) elim (classic (Equal x x0)); intros. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply cardinal_comp_l with B0; auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply add_part_simpl with x; auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply not_in_part_trans_eq with x0; auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply Trans with A; auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply Trans with (add_part B0 x0); auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) elim (cardinal_sup3 (A:=A) (B:=B) (C:=B0) (x:=x) (y:=x0)); auto with algebra. (* Goal: forall (x1 : Carrier (part_set E)) (_ : and (@Equal (part_set E) B (add_part x1 x0)) (and (@Equal (part_set E) B0 (add_part x1 x)) (and (not (@in_part E x x1)) (not (@in_part E x0 x1))))), cardinal B (S n0) *) intros C H9. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) elim H9; clear H9; intros. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) elim H10; clear H10; intros. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) elim H11; clear H11; intros. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply cardinal_add with C x0; auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply H with B0 x; auto with algebra. Qed. Lemma cardinalO_unique : forall A : part_set E, cardinal A 0 -> forall m : nat, cardinal A m -> 0 = m. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) intros. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) inversion H0; auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) absurd (in_part x (empty E)); auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply in_part_comp_r with A; auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply in_part_comp_r with (add_part B x); auto with algebra. Qed. Lemma cardinal_unique : forall (n : nat) (A : part_set E), cardinal A n -> forall m : nat, cardinal A m -> n = m. (* Goal: forall (n : nat) (A : Carrier (part_set E)) (_ : cardinal A n) (m : nat) (_ : cardinal A m), @eq nat n m *) intros n A c. apply cardinal_ind2 with (P := fun (n : nat) (A : part_set E) (c : cardinal A n) => (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) forall m : nat, cardinal A m -> n = m); auto with algebra. (* Goal: forall (A : Carrier (part_set E)) (_ : cardinal A O) (m : nat) (_ : cardinal A m), @eq nat O m *) (* Goal: forall (n : nat) (_ : forall (B : Carrier (part_set E)) (_ : cardinal B n) (m : nat) (_ : cardinal B m), @eq nat n m) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S n)) (m : nat) (_ : cardinal A m), @eq nat (S n) m *) exact cardinalO_unique. (* Goal: forall (n : nat) (_ : forall (B : Carrier (part_set E)) (_ : cardinal B n) (m : nat) (_ : cardinal B m), @eq nat n m) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (add_part B x)) (_ : cardinal A (S n)) (m : nat) (_ : cardinal A m), @eq nat (S n) m *) intros n0 H A0 B x H0 H1 c' m. (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) case m; intros. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) absurd (in_part x (empty E)); auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply in_part_comp_r with A0; auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply in_part_comp_r with (add_part B x); auto with algebra. (* Goal: @eq nat (S n0) (S n1) *) cut (cardinal B n0). (* Goal: forall _ : cardinal B n0, @eq nat (S n0) (S n1) *) (* Goal: cardinal B n0 *) cut (cardinal B n1). (* Goal: forall (_ : cardinal B n1) (_ : cardinal B n0), @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) intros. (* Goal: @eq nat (S n0) (S n1) *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) cut (n0 = n1). (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply H with B; auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply cardinal_S with A0 x; auto with algebra. (* Goal: forall _ : @eq nat n0 n1, @eq nat (S n0) (S n1) *) (* Goal: @eq nat n0 n1 *) (* Goal: cardinal B n1 *) (* Goal: cardinal B n0 *) apply cardinal_S with A0 x; auto with algebra. Qed. (* OUF! *) End fparts_in_def. Hint Resolve single_law add_part_comp add_part_in add_in minus_part_comp minus_part_not_in minus_not_in minus_trans_not_in union_unit_l single_add minus_add add_minus cardinal_comp cardinal_empty_O cardinal_single cardinal_pair cardinal_O_empty: algebra. Hint Immediate single_prop: algebra. Hint Immediate single_prop_rev: algebra. Hint Immediate add_part_com: algebra. Hint Immediate minus_part_com: algebra. Hint Immediate cardinal_empty: algebra. Hint Immediate not_in_empty: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Sets. (** Title "Cartesian product of two sets." *) Section Def. Variable E F : Setoid. Comments "The type of elements of a cartesian product:". Record cart_type : Type := {cart_l : E; cart_r : F}. Comments "Equality of couples:". Definition cart_eq (x y : cart_type) := Equal (cart_l x) (cart_l y) /\ Equal (cart_r x) (cart_r y). Lemma cart_eq_equiv : equivalence cart_eq. (* Goal: @Map_eq E (cart F G) (map_couple map_proj1 map_proj2) f *) red in |- *. (* Goal: and (@reflexive cart_type cart_eq) (@partial_equivalence cart_type cart_eq) *) split; [ try assumption | idtac ]. (* Goal: @Map_eq E (cart F G) (map_couple map_proj1 map_proj2) f *) red in |- *. (* Goal: @Map_eq E (cart F G) (map_couple map_proj1 map_proj2) f *) intros x; red in |- *. (* Goal: forall _ : @Equal (cart E F) x y, @Equal G (f (@proj1 E F x) (@proj2 E F x)) (f (@proj1 E F y) (@proj2 E F y)) *) elim x. (* Goal: forall (cart_l : Carrier E) (cart_r : Carrier F), cart_eq (Build_cart_type cart_l cart_r) (Build_cart_type cart_l cart_r) *) (* Goal: @partial_equivalence cart_type cart_eq *) unfold cart_eq in |- *; simpl in |- *; auto with algebra. (* Goal: @Map_eq E (cart F G) (map_couple map_proj1 map_proj2) f *) red in |- *. (* Goal: and (@transitive cart_type cart_eq) (@symmetric cart_type cart_eq) *) split; [ idtac | try assumption ]. (* Goal: @Map_eq E (cart F G) (map_couple map_proj1 map_proj2) f *) red in |- *. (* Goal: forall (x y : cart_type) (_ : @app_rel cart_type cart_eq x y), @app_rel cart_type cart_eq y x *) unfold app_rel, cart_eq in |- *. (* Goal: and (@reflexive cart_type cart_eq) (@partial_equivalence cart_type cart_eq) *) intros x y z H' H'0; split; [ try assumption | idtac ]. (* Goal: @Equal E (cart_l x) (cart_l z) *) (* Goal: @Equal F (cart_r x) (cart_r z) *) (* Goal: @symmetric cart_type cart_eq *) apply Trans with (cart_l y); intuition. (* Goal: @Equal F (cart_r x) (cart_r z) *) (* Goal: @symmetric cart_type cart_eq *) apply Trans with (cart_r y); intuition. (* Goal: @Map_eq E (cart F G) (map_couple map_proj1 map_proj2) f *) red in |- *. (* Goal: forall (x y : cart_type) (_ : @app_rel cart_type cart_eq x y), @app_rel cart_type cart_eq y x *) unfold app_rel, cart_eq in |- *. (* Goal: forall (x y : cart_type) (_ : and (@Equal E (cart_l x) (cart_l y)) (@Equal F (cart_r x) (cart_r y))), and (@Equal E (cart_l y) (cart_l x)) (@Equal F (cart_r y) (cart_r x)) *) intuition. Qed. Definition cart : Setoid := Build_Setoid cart_eq_equiv. Comments "We will denote the cartesian product of" E "and" F "with" (cart E F). End Def. Section Projections. Variable E F : Setoid. Definition proj1 (x : cart E F) : E := cart_l x. Definition proj2 (x : cart E F) : F := cart_r x. Comments "We note" (proj1 x) "and" (proj2 x) "the components of a couple" x "in " (cart E F). Lemma proj1_comp : forall x y : cart E F, Equal x y -> Equal (proj1 x) (proj1 y). (* Goal: @Map_eq E (cart F G) (map_couple map_proj1 map_proj2) f *) red in |- *. (* Goal: @Equal (MAP E (cart F G)) (map_couple map_proj1 map_proj2) f *) simpl in |- *. (* Goal: forall (x y : cart_type) (_ : and (@Equal E (cart_l x) (cart_l y)) (@Equal F (cart_r x) (cart_r y))), and (@Equal E (cart_l y) (cart_l x)) (@Equal F (cart_r y) (cart_r x)) *) unfold app_rel, cart_eq in |- *; intuition. Qed. Lemma proj2_comp : forall x y : cart E F, Equal x y -> Equal (proj2 x) (proj2 y). (* Goal: @Map_eq E (cart F G) (map_couple map_proj1 map_proj2) f *) red in |- *. (* Goal: @Equal (MAP E (cart F G)) (map_couple map_proj1 map_proj2) f *) simpl in |- *. (* Goal: forall (x y : cart_type) (_ : and (@Equal E (cart_l x) (cart_l y)) (@Equal F (cart_r x) (cart_r y))), and (@Equal E (cart_l y) (cart_l x)) (@Equal F (cart_r y) (cart_r x)) *) unfold app_rel, cart_eq in |- *; intuition. Qed. Hint Resolve proj1_comp proj2_comp: algebra. Definition proj1_map : MAP (cart E F) E := Build_Map proj1_comp. Definition proj2_map : MAP (cart E F) F := Build_Map proj2_comp. Definition couple (x : E) (y : F) : cart E F := Build_cart_type x y. Lemma couple_comp : forall (x x' : E) (y y' : F), Equal x x' -> Equal y y' -> Equal (couple x y) (couple x' y'). (* Goal: @Equal (MAP E (cart F G)) (map_couple map_proj1 map_proj2) f *) simpl in |- *. (* Goal: forall (x y : cart_type) (_ : and (@Equal E (cart_l x) (cart_l y)) (@Equal F (cart_r x) (cart_r y))), and (@Equal E (cart_l y) (cart_l x)) (@Equal F (cart_r y) (cart_r x)) *) unfold app_rel, cart_eq in |- *; intuition. Qed. Hint Resolve couple_comp: algebra. Lemma coupl_proj : forall x : cart E F, Equal (couple (proj1 x) (proj2 x)) x. (* Goal: @Equal (MAP E (cart F G)) (map_couple map_proj1 map_proj2) f *) simpl in |- *. (* Goal: forall (x y : cart_type) (_ : and (@Equal E (cart_l x) (cart_l y)) (@Equal F (cart_r x) (cart_r y))), and (@Equal E (cart_l y) (cart_l x)) (@Equal F (cart_r y) (cart_r x)) *) unfold app_rel, cart_eq in |- *; intuition. Qed. Hint Resolve coupl_proj: algebra. End Projections. Section Maps. Variable E F G : Setoid. Definition curry (f : MAP (cart E F) G) (x : E) (y : F) := f (couple x y). Definition fun2_compatible (f : E -> F -> G) := forall (x x' : E) (y y' : F), Equal x x' -> Equal y y' -> Equal (f x y) (f x' y'). Definition uncurry : forall f : E -> F -> G, fun2_compatible f -> MAP (cart E F) G. (* Goal: forall (f : forall (_ : Carrier E) (_ : Carrier F), Carrier G) (_ : fun2_compatible f), Carrier (MAP (cart E F) G) *) intros f H'; try assumption. (* Goal: Carrier (MAP (cart E F) G) *) apply (Build_Map (Ap:=fun x : cart E F => f (proj1 x) (proj2 x))). (* Goal: @Map_eq E (cart F G) (map_couple map_proj1 map_proj2) f *) red in |- *. (* Goal: forall (x y : Carrier (cart E F)) (_ : @Equal (cart E F) x y), @Equal G (f (@proj1 E F x) (@proj2 E F x)) (f (@proj1 E F y) (@proj2 E F y)) *) intros x y; try assumption. (* Goal: forall _ : @Equal (cart E F) x y, @Equal G (f (@proj1 E F x) (@proj2 E F x)) (f (@proj1 E F y) (@proj2 E F y)) *) elim x. (* Goal: forall (cart_l : Carrier E) (cart_r : Carrier F) (_ : @Equal (cart E F) (@Build_cart_type E F cart_l cart_r) y), @Equal G (f (@proj1 E F (@Build_cart_type E F cart_l cart_r)) (@proj2 E F (@Build_cart_type E F cart_l cart_r))) (f (@proj1 E F y) (@proj2 E F y)) *) elim y. (* Goal: @Equal (MAP E (cart F G)) (map_couple map_proj1 map_proj2) f *) simpl in |- *. (* Goal: forall (x y : cart_type) (_ : and (@Equal E (cart_l x) (cart_l y)) (@Equal F (cart_r x) (cart_r y))), and (@Equal E (cart_l y) (cart_l x)) (@Equal F (cart_r y) (cart_r x)) *) unfold app_rel, cart_eq in |- *; intuition. Defined. Variable f : MAP E (cart F G). Definition map_proj1 : MAP E F := comp_map_map (proj1_map F G) f. Definition map_proj2 : MAP E G := comp_map_map (proj2_map F G) f. Definition map_couple : MAP E F -> MAP E G -> MAP E (cart F G). (* Goal: forall (_ : Carrier (MAP E F)) (_ : Carrier (MAP E G)), Carrier (MAP E (cart F G)) *) intros g h. (* Goal: Carrier (MAP E (cart F G)) *) apply (Build_Map (Ap:=fun x : E => couple (g x) (h x))). (* Goal: @Map_eq E (cart F G) (map_couple map_proj1 map_proj2) f *) red in |- *. (* Goal: forall (x y : Carrier E) (_ : @Equal E x y), @Equal (cart F G) (@couple F G (@Ap E F g x) (@Ap E G h x)) (@couple F G (@Ap E F g y) (@Ap E G h y)) *) intros x y H'; try assumption. (* Goal: @Equal (cart F G) (@couple F G (@Ap E F g x) (@Ap E G h x)) (@couple F G (@Ap E F g y) (@Ap E G h y)) *) apply couple_comp; auto with algebra. Defined. Lemma map_couple_proj_prop : Equal (map_couple map_proj1 map_proj2) f. (* Goal: @Equal (MAP E (cart F G)) (map_couple map_proj1 map_proj2) f *) simpl in |- *. (* Goal: @Map_eq E (cart F G) (map_couple map_proj1 map_proj2) f *) red in |- *. (* Goal: @Equal (MAP E (cart F G)) (map_couple map_proj1 map_proj2) f *) unfold map_proj1, map_proj2 in |- *; simpl in |- *. (* Goal: forall (x y : cart_type) (_ : and (@Equal E (cart_l x) (cart_l y)) (@Equal F (cart_r x) (cart_r y))), and (@Equal E (cart_l y) (cart_l x)) (@Equal F (cart_r y) (cart_r x)) *) unfold app_rel, cart_eq in |- *; intuition. Qed. End Maps. Hint Resolve proj1_comp proj2_comp couple_comp coupl_proj map_couple_proj_prop: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Group_util. Require Export Abelian_group_facts. Section Free_abelian_group_def. Variable V : SET. Inductive FaG : Type := | Var : V -> FaG | Law : FaG -> FaG -> FaG | Unit : FaG | Inv : FaG -> FaG. Inductive eqFaG : FaG -> FaG -> Prop := | eqFaG_Var : forall x y : V, Equal x y -> (eqFaG (Var x) (Var y):Prop) | eqFaG_law : forall x x' y y' : FaG, eqFaG x x' -> eqFaG y y' -> (eqFaG (Law x y) (Law x' y'):Prop) | eqFaG_law_assoc : forall x y z : FaG, eqFaG (Law (Law x y) z) (Law x (Law y z)):Prop | eqFaG_law0r : forall x : FaG, eqFaG (Law x Unit) x:Prop | eqFaG_inv : forall x y : FaG, eqFaG x y -> eqFaG (Inv x) (Inv y) | eqFaG_invr : forall x : FaG, eqFaG (Law x (Inv x)) Unit | eqFaG_refl : forall x : FaG, eqFaG x x:Prop | eqFaG_sym : forall x y : FaG, eqFaG x y -> (eqFaG y x:Prop) | eqFaG_trans : forall x y z : FaG, eqFaG x y -> eqFaG y z -> (eqFaG x z:Prop) | eqFaG_com : forall x y : FaG, eqFaG (Law x y) (Law y x). Hint Resolve eqFaG_Var eqFaG_law eqFaG_law_assoc eqFaG_law0r eqFaG_invr eqFaG_refl eqFaG_com: algebra. Hint Immediate eqFaG_sym: algebra. Lemma eqFaG_Equiv : equivalence eqFaG. (* Goal: @Map_eq V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) f (@comp_hom SET V FaG_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (@f2 (@Group_util.G FaG_set Law Unit Inv eqFaG_law eqFaG_law_assoc eqFaG_law0r eqFaG_inv eqFaG_invr) (abelian_group_group G) FaG_lift_fun (fun (x y : FaG) (H' : eqFaG x y) => @eqFaG_ind (fun x0 y0 : FaG => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun y0)) (fun (x0 y0 : Carrier V) (H : @Equal V x0 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) f f x0 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G))))) f)) (fun (x0 x' y0 y' : FaG) (_ : eqFaG x0 x') (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun x')) (_ : eqFaG y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun y0) (FaG_lift_fun y')) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G))) (FaG_lift_fun x0) (FaG_lift_fun x') (FaG_lift_fun y0) (FaG_lift_fun y') H0 H2) (fun x0 y0 z : FaG => @SGROUP_assoc (monoid_sgroup (group_monoid (abelian_group_group G))) (FaG_lift_fun x0) (FaG_lift_fun y0) (FaG_lift_fun z)) (fun x0 : FaG => @MONOID_unit_r (group_monoid (abelian_group_group G)) (FaG_lift_fun x0)) (fun (x0 y0 : FaG) (_ : eqFaG x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun y0)) => @GROUP_comp (abelian_group_group G) (FaG_lift_fun x0) (FaG_lift_fun y0) H0) (fun x0 : FaG => @GROUP_inverse_r (abelian_group_group G) (FaG_lift_fun x0)) (fun x0 : FaG => @Refl (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0)) (fun (x0 y0 : FaG) (_ : eqFaG x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun y0) H0) (fun (x0 y0 z : FaG) (_ : eqFaG x0 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun y0)) (_ : eqFaG y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun y0) (FaG_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun y0) (FaG_lift_fun z) H'1 H'3) (fun x0 y0 : FaG => @ABELIAN_GROUP_com G (FaG_lift_fun x0) (FaG_lift_fun y0)) x y H')) FaG_var) *) red in |- *. (* Goal: and (@transitive FaG eqFaG) (@symmetric FaG eqFaG) *) split; [ try assumption | idtac ]. (* Goal: @reflexive FaG eqFaG *) (* Goal: @partial_equivalence FaG eqFaG *) exact eqFaG_refl. (* Goal: @Map_eq V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) f (@comp_hom SET V FaG_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (@f2 (@Group_util.G FaG_set Law Unit Inv eqFaG_law eqFaG_law_assoc eqFaG_law0r eqFaG_inv eqFaG_invr) (abelian_group_group G) FaG_lift_fun (fun (x y : FaG) (H' : eqFaG x y) => @eqFaG_ind (fun x0 y0 : FaG => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun y0)) (fun (x0 y0 : Carrier V) (H : @Equal V x0 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) f f x0 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G))))) f)) (fun (x0 x' y0 y' : FaG) (_ : eqFaG x0 x') (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun x')) (_ : eqFaG y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun y0) (FaG_lift_fun y')) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G))) (FaG_lift_fun x0) (FaG_lift_fun x') (FaG_lift_fun y0) (FaG_lift_fun y') H0 H2) (fun x0 y0 z : FaG => @SGROUP_assoc (monoid_sgroup (group_monoid (abelian_group_group G))) (FaG_lift_fun x0) (FaG_lift_fun y0) (FaG_lift_fun z)) (fun x0 : FaG => @MONOID_unit_r (group_monoid (abelian_group_group G)) (FaG_lift_fun x0)) (fun (x0 y0 : FaG) (_ : eqFaG x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun y0)) => @GROUP_comp (abelian_group_group G) (FaG_lift_fun x0) (FaG_lift_fun y0) H0) (fun x0 : FaG => @GROUP_inverse_r (abelian_group_group G) (FaG_lift_fun x0)) (fun x0 : FaG => @Refl (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0)) (fun (x0 y0 : FaG) (_ : eqFaG x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun y0) H0) (fun (x0 y0 z : FaG) (_ : eqFaG x0 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun y0)) (_ : eqFaG y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun y0) (FaG_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun y0) (FaG_lift_fun z) H'1 H'3) (fun x0 y0 : FaG => @ABELIAN_GROUP_com G (FaG_lift_fun x0) (FaG_lift_fun y0)) x y H')) FaG_var) *) red in |- *. (* Goal: and (@transitive FaG eqFaG) (@symmetric FaG eqFaG) *) split; [ try assumption | idtac ]. (* Goal: @transitive FaG eqFaG *) (* Goal: @symmetric FaG eqFaG *) exact eqFaG_trans. (* Goal: @symmetric FaG eqFaG *) exact eqFaG_sym. Qed. Definition FaG_set := Build_Setoid eqFaG_Equiv. Definition FreeAbelianGroup : ABELIAN_GROUP. apply (BUILD_ABELIAN_GROUP (E:=FaG_set) (genlaw:=Law) (e:=Unit) (geninv:=Inv)). (* Goal: forall (x x' y y' : Carrier FaG_set) (_ : @Equal FaG_set x x') (_ : @Equal FaG_set y y'), @Equal FaG_set (Law x y) (Law x' y') *) (* Goal: forall x y z : Carrier FaG_set, @Equal FaG_set (Law (Law x y) z) (Law x (Law y z)) *) (* Goal: forall x : Carrier FaG_set, @Equal FaG_set (Law x Unit) x *) (* Goal: forall (x y : Carrier FaG_set) (_ : @Equal FaG_set x y), @Equal FaG_set (Inv x) (Inv y) *) (* Goal: forall x : Carrier FaG_set, @Equal FaG_set (Law x (Inv x)) Unit *) (* Goal: forall x y : Carrier FaG_set, @Equal FaG_set (Law x y) (Law y x) *) exact eqFaG_law. (* Goal: forall x y z : Carrier FaG_set, @Equal FaG_set (Law (Law x y) z) (Law x (Law y z)) *) (* Goal: forall x : Carrier FaG_set, @Equal FaG_set (Law x Unit) x *) (* Goal: forall (x y : Carrier FaG_set) (_ : @Equal FaG_set x y), @Equal FaG_set (Inv x) (Inv y) *) (* Goal: forall x : Carrier FaG_set, @Equal FaG_set (Law x (Inv x)) Unit *) (* Goal: forall x y : Carrier FaG_set, @Equal FaG_set (Law x y) (Law y x) *) exact eqFaG_law_assoc. (* Goal: forall x : Carrier FaG_set, @Equal FaG_set (Law x Unit) x *) (* Goal: forall (x y : Carrier FaG_set) (_ : @Equal FaG_set x y), @Equal FaG_set (Inv x) (Inv y) *) (* Goal: forall x : Carrier FaG_set, @Equal FaG_set (Law x (Inv x)) Unit *) (* Goal: forall x y : Carrier FaG_set, @Equal FaG_set (Law x y) (Law y x) *) exact eqFaG_law0r. (* Goal: forall (x y : Carrier FaG_set) (_ : @Equal FaG_set x y), @Equal FaG_set (Inv x) (Inv y) *) (* Goal: forall x : Carrier FaG_set, @Equal FaG_set (Law x (Inv x)) Unit *) (* Goal: forall x y : Carrier FaG_set, @Equal FaG_set (Law x y) (Law y x) *) exact eqFaG_inv. (* Goal: forall x : Carrier FaG_set, @Equal FaG_set (Law x (Inv x)) Unit *) (* Goal: forall x y : Carrier FaG_set, @Equal FaG_set (Law x y) (Law y x) *) exact eqFaG_invr. (* Goal: forall x y : Carrier FaG_set, @Equal FaG_set (Law x y) (Law y x) *) exact eqFaG_com. Defined. Section Universal_prop. Variable G : ABELIAN_GROUP. Variable f : Hom V G. Fixpoint FaG_lift_fun (p : FreeAbelianGroup) : G := match p with | Var v => f v | Law p1 p2 => sgroup_law _ (FaG_lift_fun p1) (FaG_lift_fun p2) | Unit => monoid_unit G | Inv p1 => group_inverse G (FaG_lift_fun p1) end. Definition FaG_lift : Hom FreeAbelianGroup G. (* Goal: Carrier (@Hom ABELIAN_GROUP FreeAbelianGroup G) *) apply (BUILD_HOM_GROUP (G:=FreeAbelianGroup) (G':=G) (ff:=FaG_lift_fun)). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group FreeAbelianGroup))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group FreeAbelianGroup)))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x) (FaG_lift_fun y) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group FreeAbelianGroup)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group FreeAbelianGroup))) x y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G))) (FaG_lift_fun x) (FaG_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group FreeAbelianGroup))) (monoid_on_def (group_monoid (abelian_group_group FreeAbelianGroup))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group G))) (monoid_on_def (group_monoid (abelian_group_group G)))) *) intros x y H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x) (FaG_lift_fun y) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group FreeAbelianGroup)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group FreeAbelianGroup))) x y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G))) (FaG_lift_fun x) (FaG_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group FreeAbelianGroup))) (monoid_on_def (group_monoid (abelian_group_group FreeAbelianGroup))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group G))) (monoid_on_def (group_monoid (abelian_group_group G)))) *) elim H'; simpl in |- *; auto with algebra. (* Goal: forall (x y z : FaG) (_ : eqFaG x y) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x) (FaG_lift_fun y)) (_ : eqFaG y z) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun y) (FaG_lift_fun z)), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x) (FaG_lift_fun z) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group FreeAbelianGroup)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group FreeAbelianGroup))) x y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G))) (FaG_lift_fun x) (FaG_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group FreeAbelianGroup))) (monoid_on_def (group_monoid (abelian_group_group FreeAbelianGroup))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group G))) (monoid_on_def (group_monoid (abelian_group_group G)))) *) intros x0 y0 z H'0 H'1 H'2 H'3; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun z) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group FreeAbelianGroup)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group FreeAbelianGroup))) x y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G))) (FaG_lift_fun x) (FaG_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group FreeAbelianGroup))) (monoid_on_def (group_monoid (abelian_group_group FreeAbelianGroup))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group G))) (monoid_on_def (group_monoid (abelian_group_group G)))) *) apply Trans with (FaG_lift_fun y0); auto with algebra. (* Goal: forall (x y : Carrier V) (_ : @Equal V x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group FreeAbelianGroup)))) (Var x) (Var y) *) simpl in |- *; auto with algebra. (* Goal: forall (x y : Carrier V) (_ : @Equal V x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group FreeAbelianGroup)))) (Var x) (Var y) *) simpl in |- *; auto with algebra. Defined. Definition FaG_var : Hom V FreeAbelianGroup. (* Goal: Carrier (@Hom SET V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group FreeAbelianGroup))))) *) apply (Build_Map (A:=V) (B:=FreeAbelianGroup) (Ap:=Var)). (* Goal: @Map_eq V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) f (@comp_hom SET V FaG_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (@f2 (@Group_util.G FaG_set Law Unit Inv eqFaG_law eqFaG_law_assoc eqFaG_law0r eqFaG_inv eqFaG_invr) (abelian_group_group G) FaG_lift_fun (fun (x y : FaG) (H' : eqFaG x y) => @eqFaG_ind (fun x0 y0 : FaG => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun y0)) (fun (x0 y0 : Carrier V) (H : @Equal V x0 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) f f x0 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G))))) f)) (fun (x0 x' y0 y' : FaG) (_ : eqFaG x0 x') (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun x')) (_ : eqFaG y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun y0) (FaG_lift_fun y')) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G))) (FaG_lift_fun x0) (FaG_lift_fun x') (FaG_lift_fun y0) (FaG_lift_fun y') H0 H2) (fun x0 y0 z : FaG => @SGROUP_assoc (monoid_sgroup (group_monoid (abelian_group_group G))) (FaG_lift_fun x0) (FaG_lift_fun y0) (FaG_lift_fun z)) (fun x0 : FaG => @MONOID_unit_r (group_monoid (abelian_group_group G)) (FaG_lift_fun x0)) (fun (x0 y0 : FaG) (_ : eqFaG x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun y0)) => @GROUP_comp (abelian_group_group G) (FaG_lift_fun x0) (FaG_lift_fun y0) H0) (fun x0 : FaG => @GROUP_inverse_r (abelian_group_group G) (FaG_lift_fun x0)) (fun x0 : FaG => @Refl (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0)) (fun (x0 y0 : FaG) (_ : eqFaG x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun y0) H0) (fun (x0 y0 z : FaG) (_ : eqFaG x0 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun y0)) (_ : eqFaG y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun y0) (FaG_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun y0) (FaG_lift_fun z) H'1 H'3) (fun x0 y0 : FaG => @ABELIAN_GROUP_com G (FaG_lift_fun x0) (FaG_lift_fun y0)) x y H')) FaG_var) *) red in |- *. (* Goal: forall (x y : Carrier V) (_ : @Equal V x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group FreeAbelianGroup)))) (Var x) (Var y) *) simpl in |- *; auto with algebra. Defined. Lemma FaG_comp_prop : Equal f (comp_hom (FaG_lift:Hom (FreeAbelianGroup:SET) G) FaG_var). (* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) f x) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (@comp_hom SET V FaG_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (@f2 (@Group_util.G FaG_set Law Unit Inv eqFaG_law eqFaG_law_assoc eqFaG_law0r eqFaG_inv eqFaG_invr) (abelian_group_group G) FaG_lift_fun (fun (x0 y : FaG) (H' : eqFaG x0 y) => @eqFaG_ind (fun x1 y0 : FaG => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x1) (FaG_lift_fun y0)) (fun (x1 y0 : Carrier V) (H : @Equal V x1 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) f f x1 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G))))) f)) (fun (x1 x' y0 y' : FaG) (_ : eqFaG x1 x') (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x1) (FaG_lift_fun x')) (_ : eqFaG y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun y0) (FaG_lift_fun y')) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G))) (FaG_lift_fun x1) (FaG_lift_fun x') (FaG_lift_fun y0) (FaG_lift_fun y') H0 H2) (fun x1 y0 z : FaG => @SGROUP_assoc (monoid_sgroup (group_monoid (abelian_group_group G))) (FaG_lift_fun x1) (FaG_lift_fun y0) (FaG_lift_fun z)) (fun x1 : FaG => @MONOID_unit_r (group_monoid (abelian_group_group G)) (FaG_lift_fun x1)) (fun (x1 y0 : FaG) (_ : eqFaG x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x1) (FaG_lift_fun y0)) => @GROUP_comp (abelian_group_group G) (FaG_lift_fun x1) (FaG_lift_fun y0) H0) (fun x1 : FaG => @GROUP_inverse_r (abelian_group_group G) (FaG_lift_fun x1)) (fun x1 : FaG => @Refl (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x1)) (fun (x1 y0 : FaG) (_ : eqFaG x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x1) (FaG_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x1) (FaG_lift_fun y0) H0) (fun (x1 y0 z : FaG) (_ : eqFaG x1 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x1) (FaG_lift_fun y0)) (_ : eqFaG y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun y0) (FaG_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x1) (FaG_lift_fun y0) (FaG_lift_fun z) H'1 H'3) (fun x1 y0 : FaG => @ABELIAN_GROUP_com G (FaG_lift_fun x1) (FaG_lift_fun y0)) x0 y H')) FaG_var) x) *) simpl in |- *. (* Goal: @Map_eq V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) f (@comp_hom SET V FaG_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (@f2 (@Group_util.G FaG_set Law Unit Inv eqFaG_law eqFaG_law_assoc eqFaG_law0r eqFaG_inv eqFaG_invr) (abelian_group_group G) FaG_lift_fun (fun (x y : FaG) (H' : eqFaG x y) => @eqFaG_ind (fun x0 y0 : FaG => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun y0)) (fun (x0 y0 : Carrier V) (H : @Equal V x0 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) f f x0 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G))))) f)) (fun (x0 x' y0 y' : FaG) (_ : eqFaG x0 x') (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun x')) (_ : eqFaG y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun y0) (FaG_lift_fun y')) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G))) (FaG_lift_fun x0) (FaG_lift_fun x') (FaG_lift_fun y0) (FaG_lift_fun y') H0 H2) (fun x0 y0 z : FaG => @SGROUP_assoc (monoid_sgroup (group_monoid (abelian_group_group G))) (FaG_lift_fun x0) (FaG_lift_fun y0) (FaG_lift_fun z)) (fun x0 : FaG => @MONOID_unit_r (group_monoid (abelian_group_group G)) (FaG_lift_fun x0)) (fun (x0 y0 : FaG) (_ : eqFaG x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun y0)) => @GROUP_comp (abelian_group_group G) (FaG_lift_fun x0) (FaG_lift_fun y0) H0) (fun x0 : FaG => @GROUP_inverse_r (abelian_group_group G) (FaG_lift_fun x0)) (fun x0 : FaG => @Refl (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0)) (fun (x0 y0 : FaG) (_ : eqFaG x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun y0) H0) (fun (x0 y0 z : FaG) (_ : eqFaG x0 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun y0)) (_ : eqFaG y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun y0) (FaG_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x0) (FaG_lift_fun y0) (FaG_lift_fun z) H'1 H'3) (fun x0 y0 : FaG => @ABELIAN_GROUP_com G (FaG_lift_fun x0) (FaG_lift_fun y0)) x y H')) FaG_var) *) red in |- *. (* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) f x) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (@comp_hom SET V FaG_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (@f2 (@Group_util.G FaG_set Law Unit Inv eqFaG_law eqFaG_law_assoc eqFaG_law0r eqFaG_inv eqFaG_invr) (abelian_group_group G) FaG_lift_fun (fun (x0 y : FaG) (H' : eqFaG x0 y) => @eqFaG_ind (fun x1 y0 : FaG => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x1) (FaG_lift_fun y0)) (fun (x1 y0 : Carrier V) (H : @Equal V x1 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) f f x1 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G))))) f)) (fun (x1 x' y0 y' : FaG) (_ : eqFaG x1 x') (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x1) (FaG_lift_fun x')) (_ : eqFaG y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun y0) (FaG_lift_fun y')) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group G))) (FaG_lift_fun x1) (FaG_lift_fun x') (FaG_lift_fun y0) (FaG_lift_fun y') H0 H2) (fun x1 y0 z : FaG => @SGROUP_assoc (monoid_sgroup (group_monoid (abelian_group_group G))) (FaG_lift_fun x1) (FaG_lift_fun y0) (FaG_lift_fun z)) (fun x1 : FaG => @MONOID_unit_r (group_monoid (abelian_group_group G)) (FaG_lift_fun x1)) (fun (x1 y0 : FaG) (_ : eqFaG x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x1) (FaG_lift_fun y0)) => @GROUP_comp (abelian_group_group G) (FaG_lift_fun x1) (FaG_lift_fun y0) H0) (fun x1 : FaG => @GROUP_inverse_r (abelian_group_group G) (FaG_lift_fun x1)) (fun x1 : FaG => @Refl (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x1)) (fun (x1 y0 : FaG) (_ : eqFaG x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x1) (FaG_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x1) (FaG_lift_fun y0) H0) (fun (x1 y0 z : FaG) (_ : eqFaG x1 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x1) (FaG_lift_fun y0)) (_ : eqFaG y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun y0) (FaG_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (FaG_lift_fun x1) (FaG_lift_fun y0) (FaG_lift_fun z) H'1 H'3) (fun x1 y0 : FaG => @ABELIAN_GROUP_com G (FaG_lift_fun x1) (FaG_lift_fun y0)) x0 y H')) FaG_var) x) *) simpl in |- *. (* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) f x) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) f x) *) auto with algebra. Qed. End Universal_prop. End Free_abelian_group_def. Hint Resolve FaG_comp_prop: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Automatic Coercions Import. Set Implicit Arguments. Unset Strict Implicit. Require Export Ring_facts. Require Export Generated_module. Section ideals. Variable R : RING. Definition is_ideal (I : subgroup R) := forall x : R, in_part x I -> forall a : R, in_part (ring_mult a x) I. Record ideal : Type := {ideal_subgroup :> subgroup R; ideal_prf : is_ideal ideal_subgroup}. Lemma ideal_prop : forall (I : ideal) (x : I) (a : R), in_part (ring_mult a (I x)) I. (* Goal: forall (I : ideal) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (ring_group R)) (ideal_subgroup I)))))) (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R a (@subtype_image_inj (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (ideal_subgroup I))))) x)) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (ideal_subgroup I)))) *) intros I x a; try assumption. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R a (@subtype_image_inj (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (ideal_subgroup I))))) x)) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (ideal_subgroup I)))) *) apply (ideal_prf (i:=I)). (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@subtype_image_inj (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (ideal_subgroup I))))) x) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (ideal_subgroup I)))) *) case x; simpl in |- *; auto with algebra. Qed. Lemma ideal_prop2 : forall (I : ideal) (x a : R), in_part x I -> in_part (ring_mult a x) I. (* Goal: forall (I : ideal) (x a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (ideal_subgroup I))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R a x) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (ideal_subgroup I)))) *) intros I x a H'; try assumption. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R a x) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (ideal_subgroup I)))) *) apply (ideal_prf (i:=I)); auto with algebra. Qed. Lemma ideal_prop3 : forall (I : ideal) (x y : R), in_part x I -> in_part y I -> in_part (sgroup_law R x y) I. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x x *) auto with algebra. Qed. Lemma ideal_prop4 : forall (I : ideal) (x : R), in_part x I -> in_part (group_inverse R x) I. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x x *) auto with algebra. Qed. End ideals. Hint Resolve ideal_prop2: algebra. Section Ring_as_module. Variable R : ring. Definition ring_module : module R. apply (BUILD_MODULE_GROUP (R:=R) (module_util_G:=R) (gen_module_op:=fun a x : R => ring_mult a x)); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x x *) abstract auto with algebra. Defined. End Ring_as_module. Coercion ring_module : ring >-> module. Section Generated_ideal. Variable R : RING. Variable A : part_set R. Definition generated_module_subgroup : subgroup R. apply (BUILD_SUB_GROUP (G:=R) (H:=generated_module (R:=R) (Mod:=R) A)); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x x *) simpl in |- *; auto with algebra. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0)))) (_ : @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) y (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0)))), @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@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)))) x y) (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0))) *) (* Goal: @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@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))))) (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0)))), @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (group_inverse (abelian_group_group (ring_group R)) x) (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0))) *) intros x y H' H'0; try assumption. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) elim H'0; intros x0 E; elim E; intros H'1 H'2; try exact H'2; clear E H'0. (* Goal: @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@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)))) x y) (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0))) *) (* Goal: @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@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))))) (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0)))), @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (group_inverse (abelian_group_group (ring_group R)) x) (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0))) *) elim H'; intros x1 E; elim E; intros H'0 H'3; try exact H'3; clear E H'. (* Goal: @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@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)))) x y) (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0))) *) (* Goal: @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@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))))) (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0)))), @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (group_inverse (abelian_group_group (ring_group R)) x) (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0))) *) exists (Law x1 x0); split; [ try assumption | idtac ]. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) c f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) simpl in |- *. (* 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)))) x y) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x1) (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0)) *) (* Goal: @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@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))))) (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0)))), @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (group_inverse (abelian_group_group (ring_group R)) x) (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0))) *) exact (SGROUP_comp (E:=R) H'3 H'2). (* Goal: @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@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))))) (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0)))), @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (group_inverse (abelian_group_group (ring_group R)) x) (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0))) *) exists (Unit R A); split; [ idtac | try assumption ]. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x x *) auto with algebra. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) c f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x x *) auto with algebra. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0)))), @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (group_inverse (abelian_group_group (ring_group R)) x) (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0))) *) intros x H'; try assumption. (* Goal: @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R a x) (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0))) *) elim H'; intros x0 E; elim E; intros H'0 H'1; try exact H'1; clear E H'. (* Goal: @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (group_inverse (abelian_group_group (ring_group R)) x) (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0))) *) exists (Inv x0); split; [ idtac | try assumption ]. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x x *) auto with algebra. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) c f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (group_inverse (abelian_group_group (ring_group R)) x) (group_inverse (abelian_group_group (ring_group R)) (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0)) *) exact (GROUP_comp (G:=R) H'1). Defined. Definition generated_ideal : ideal R. (* Goal: ideal R *) apply (Build_ideal (R:=R) (ideal_subgroup:=generated_module_subgroup)). (* Goal: @included (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R generated_ideal)))) *) red in |- *. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) c f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) simpl in |- *. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0)))) (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))), @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R a x) (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0))) *) intros x H' a; try assumption. (* Goal: @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R a x) (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0))) *) elim H'; intros x0 E; elim E; intros H'0 H'1; try exact H'1; clear E H'. (* Goal: @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R a x) (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0))) *) exists (Op a x0); split; [ idtac | try assumption ]. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x x *) auto with algebra. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) c f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R a x) (@module_mult R (ring_module R) a (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0)) *) exact (MODULE_comp (R:=R) (Mod:=R:MODULE R) (Refl a) H'1). Defined. Lemma generated_ideal_included : included A generated_ideal. (* Goal: @included (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R generated_ideal)))) *) red in |- *. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) c f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) simpl in |- *. intros x H'; exists (Var R (V:=A) (Build_subtype (E:=R) (P:=A) (subtype_elt:=x) H')); split; [ idtac | try assumption ]. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x x *) auto with algebra. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) c f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x x *) auto with algebra. Qed. Lemma generated_ideal_minimal : forall I : ideal R, included A I -> included generated_ideal I. (* Goal: forall (I : ideal R) (_ : @included (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))), @included (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R generated_ideal)))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) unfold included in |- *. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) c f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) simpl in |- *. (* Goal: forall (I : ideal R) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x A), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) intros I H' x H'0; try assumption. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) elim H'0; intros x0 E; elim E; intros H'1 H'2; try exact H'2; clear E H'0. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) generalize H'2; clear H'2; clear H'1. (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) generalize x; clear x. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) x0)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) elim x0. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) c f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) simpl in |- *. (* Goal: forall (c : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A c)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (f0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f0)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Law R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) f f0))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) c f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) intros c x H'0; try assumption. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (f0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f0)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Law R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) f f0))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) c f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) apply H'. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x x *) apply in_part_comp_l with (subtype_elt c); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x x *) case c; auto with algebra. (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (f0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f0)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Law R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) f f0))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) c f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) intros f H'0 f0 H'1 x H'2; try assumption. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) c f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) simpl in H'2. apply in_part_comp_l with (sgroup_law R (FMd_lift_fun (R:=R) (V:=A) (Mod:=R:MODULE R) (inj_part A) f) (FMd_lift_fun (R:=R) (V:=A) (Mod:=R:MODULE R) (inj_part A) f0)); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x x *) auto with algebra. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) c f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) simpl in |- *. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) c f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) intros x H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x x *) apply in_part_comp_l with (monoid_unit R); auto with algebra. (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) c f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) intros f H'0 x H'1; try assumption. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) simpl in H'1. apply in_part_comp_l with (group_inverse R (FMd_lift_fun (R:=R) (V:=A) (Mod:=R:MODULE R) (inj_part A) f)); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x x *) auto with algebra. (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) f)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) (ring_module R) (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) A)) c f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) intros c f H'0 x H'1; try assumption. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (ring_group R))) (@subgroup_submonoid (abelian_group_group (ring_group R)) (@ideal_subgroup R I)))) *) simpl in H'1. apply in_part_comp_l with (module_mult c (FMd_lift_fun (R:=R) (V:=A) (Mod:=R:MODULE R) (inj_part A) f)); (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x x *) auto with algebra. change (in_part (ring_mult c (FMd_lift_fun (R:=R) (V:=A) (Mod:=R:MODULE R) (inj_part A) f)) (subsgroup_part (submonoid_subsgroup (subgroup_submonoid (ideal_subgroup I))))) in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x x *) apply ideal_prop2; auto with algebra. Qed. End Generated_ideal. Hint Resolve generated_ideal_minimal generated_ideal_included: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Monoid_cat. Require Export Sgroup_facts. Require Export Monoid_facts. Require Export Monoid_util. Require Export Abelian_group_facts. Section Free_abelian_monoid_def. Variable V : SET. Inductive FaM : Type := | Var : V -> FaM | Law : FaM -> FaM -> FaM | Unit : FaM. Inductive eqFaM : FaM -> FaM -> Prop := | eqFaM_Var : forall x y : V, Equal x y -> (eqFaM (Var x) (Var y):Prop) | eqFaM_law : forall x x' y y' : FaM, eqFaM x x' -> eqFaM y y' -> (eqFaM (Law x y) (Law x' y'):Prop) | eqFaM_law_assoc : forall x y z : FaM, eqFaM (Law (Law x y) z) (Law x (Law y z)):Prop | eqFaM_law0r : forall x : FaM, eqFaM (Law x Unit) x:Prop | eqFaM_law0l : forall x : FaM, eqFaM (Law Unit x) x:Prop | eqFaM_refl : forall x : FaM, eqFaM x x:Prop | eqFaM_sym : forall x y : FaM, eqFaM x y -> (eqFaM y x:Prop) | eqFaM_trans : forall x y z : FaM, eqFaM x y -> eqFaM y z -> (eqFaM x z:Prop) | eqFaM_com : forall x y : FaM, eqFaM (Law x y) (Law y x). Hint Resolve eqFaM_Var eqFaM_law eqFaM_law_assoc eqFaM_law0r eqFaM_law0l eqFaM_refl eqFaM_com: algebra. Hint Immediate eqFaM_sym: algebra. Lemma eqFaM_Equiv : equivalence eqFaM. (* Goal: @Map_eq V (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) f (@comp_hom SET V FaM_set (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (@f2 (@Monoid_util.M FaM_set Law Unit eqFaM_law eqFaM_law_assoc eqFaM_law0r eqFaM_law0l) (abelian_monoid_monoid M) FaM_lift_fun (fun (x y : FaM) (H' : eqFaM x y) => @eqFaM_ind (fun x0 y0 : FaM => @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun y0)) (fun (x0 y0 : Carrier V) (H : @Equal V x0 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) f f x0 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (abelian_monoid_monoid M)))) f)) (fun (x0 x' y0 y' : FaM) (_ : eqFaM x0 x') (H0 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun x')) (_ : eqFaM y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun y0) (FaM_lift_fun y')) => @SGROUP_comp (monoid_sgroup (abelian_monoid_monoid M)) (FaM_lift_fun x0) (FaM_lift_fun x') (FaM_lift_fun y0) (FaM_lift_fun y') H0 H2) (fun x0 y0 z : FaM => @SGROUP_assoc (monoid_sgroup (abelian_monoid_monoid M)) (FaM_lift_fun x0) (FaM_lift_fun y0) (FaM_lift_fun z)) (fun x0 : FaM => @MONOID_unit_r (abelian_monoid_monoid M) (FaM_lift_fun x0)) (fun x0 : FaM => @MONOID_unit_l (abelian_monoid_monoid M) (FaM_lift_fun x0)) (fun x0 : FaM => @Refl (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0)) (fun (x0 y0 : FaM) (_ : eqFaM x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun y0) H0) (fun (x0 y0 z : FaM) (_ : eqFaM x0 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun y0)) (_ : eqFaM y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun y0) (FaM_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun y0) (FaM_lift_fun z) H'1 H'3) (fun x0 y0 : FaM => @ABELIAN_MONOID_com M (FaM_lift_fun x0) (FaM_lift_fun y0)) x y H')) FaM_var) *) red in |- *. (* Goal: and (@transitive FaM eqFaM) (@symmetric FaM eqFaM) *) split; [ try assumption | idtac ]. (* Goal: @reflexive FaM eqFaM *) (* Goal: @partial_equivalence FaM eqFaM *) exact eqFaM_refl. (* Goal: @Map_eq V (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) f (@comp_hom SET V FaM_set (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (@f2 (@Monoid_util.M FaM_set Law Unit eqFaM_law eqFaM_law_assoc eqFaM_law0r eqFaM_law0l) (abelian_monoid_monoid M) FaM_lift_fun (fun (x y : FaM) (H' : eqFaM x y) => @eqFaM_ind (fun x0 y0 : FaM => @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun y0)) (fun (x0 y0 : Carrier V) (H : @Equal V x0 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) f f x0 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (abelian_monoid_monoid M)))) f)) (fun (x0 x' y0 y' : FaM) (_ : eqFaM x0 x') (H0 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun x')) (_ : eqFaM y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun y0) (FaM_lift_fun y')) => @SGROUP_comp (monoid_sgroup (abelian_monoid_monoid M)) (FaM_lift_fun x0) (FaM_lift_fun x') (FaM_lift_fun y0) (FaM_lift_fun y') H0 H2) (fun x0 y0 z : FaM => @SGROUP_assoc (monoid_sgroup (abelian_monoid_monoid M)) (FaM_lift_fun x0) (FaM_lift_fun y0) (FaM_lift_fun z)) (fun x0 : FaM => @MONOID_unit_r (abelian_monoid_monoid M) (FaM_lift_fun x0)) (fun x0 : FaM => @MONOID_unit_l (abelian_monoid_monoid M) (FaM_lift_fun x0)) (fun x0 : FaM => @Refl (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0)) (fun (x0 y0 : FaM) (_ : eqFaM x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun y0) H0) (fun (x0 y0 z : FaM) (_ : eqFaM x0 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun y0)) (_ : eqFaM y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun y0) (FaM_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun y0) (FaM_lift_fun z) H'1 H'3) (fun x0 y0 : FaM => @ABELIAN_MONOID_com M (FaM_lift_fun x0) (FaM_lift_fun y0)) x y H')) FaM_var) *) red in |- *. (* Goal: and (@transitive FaM eqFaM) (@symmetric FaM eqFaM) *) split; [ try assumption | idtac ]. (* Goal: @transitive FaM eqFaM *) (* Goal: @symmetric FaM eqFaM *) exact eqFaM_trans. (* Goal: @symmetric FaM eqFaM *) exact eqFaM_sym. Qed. Definition FaM_set := Build_Setoid eqFaM_Equiv. Definition FreeAbelianMonoid : ABELIAN_MONOID. (* Goal: Ob ABELIAN_MONOID *) apply (BUILD_ABELIAN_MONOID (E:=FaM_set) (genlaw:=Law) (e:=Unit)). (* Goal: forall (x x' y y' : Carrier FaM_set) (_ : @Equal FaM_set x x') (_ : @Equal FaM_set y y'), @Equal FaM_set (Law x y) (Law x' y') *) (* Goal: forall x y z : Carrier FaM_set, @Equal FaM_set (Law (Law x y) z) (Law x (Law y z)) *) (* Goal: forall x : Carrier FaM_set, @Equal FaM_set (Law x Unit) x *) (* Goal: forall x : Carrier FaM_set, @Equal FaM_set (Law Unit x) x *) (* Goal: forall x y : Carrier FaM_set, @Equal FaM_set (Law x y) (Law y x) *) exact eqFaM_law. (* Goal: forall x y z : Carrier FaM_set, @Equal FaM_set (Law (Law x y) z) (Law x (Law y z)) *) (* Goal: forall x : Carrier FaM_set, @Equal FaM_set (Law x Unit) x *) (* Goal: forall x : Carrier FaM_set, @Equal FaM_set (Law Unit x) x *) (* Goal: forall x y : Carrier FaM_set, @Equal FaM_set (Law x y) (Law y x) *) exact eqFaM_law_assoc. (* Goal: forall x : Carrier FaM_set, @Equal FaM_set (Law x Unit) x *) (* Goal: forall x : Carrier FaM_set, @Equal FaM_set (Law Unit x) x *) (* Goal: forall x y : Carrier FaM_set, @Equal FaM_set (Law x y) (Law y x) *) exact eqFaM_law0r. (* Goal: forall x : Carrier FaM_set, @Equal FaM_set (Law Unit x) x *) (* Goal: forall x y : Carrier FaM_set, @Equal FaM_set (Law x y) (Law y x) *) exact eqFaM_law0l. (* Goal: forall x y : Carrier FaM_set, @Equal FaM_set (Law x y) (Law y x) *) exact eqFaM_com. Defined. Section Universal_prop. Variable M : ABELIAN_MONOID. Variable f : Hom V M. Fixpoint FaM_lift_fun (p : FreeAbelianMonoid) : M := match p with | Var v => f v | Law p1 p2 => sgroup_law _ (FaM_lift_fun p1) (FaM_lift_fun p2) | Unit => monoid_unit M end. Definition FaM_lift : Hom FreeAbelianMonoid M. (* Goal: Carrier (@Hom ABELIAN_MONOID FreeAbelianMonoid M) *) apply (BUILD_HOM_MONOID (G:=FreeAbelianMonoid) (G':=M) (ff:=FaM_lift_fun)). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (abelian_monoid_monoid FreeAbelianMonoid)))) (_ : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid FreeAbelianMonoid))) x y), @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x) (FaM_lift_fun y) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (abelian_monoid_monoid FreeAbelianMonoid))), @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun (sgroup_law (monoid_sgroup (abelian_monoid_monoid FreeAbelianMonoid)) x y)) (sgroup_law (monoid_sgroup (abelian_monoid_monoid M)) (FaM_lift_fun x) (FaM_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun (@monoid_unit (monoid_sgroup (abelian_monoid_monoid FreeAbelianMonoid)) (monoid_on_def (abelian_monoid_monoid FreeAbelianMonoid)))) (@monoid_unit (monoid_sgroup (abelian_monoid_monoid M)) (monoid_on_def (abelian_monoid_monoid M))) *) intros x y H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x) (FaM_lift_fun y) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (abelian_monoid_monoid FreeAbelianMonoid))), @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun (sgroup_law (monoid_sgroup (abelian_monoid_monoid FreeAbelianMonoid)) x y)) (sgroup_law (monoid_sgroup (abelian_monoid_monoid M)) (FaM_lift_fun x) (FaM_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun (@monoid_unit (monoid_sgroup (abelian_monoid_monoid FreeAbelianMonoid)) (monoid_on_def (abelian_monoid_monoid FreeAbelianMonoid)))) (@monoid_unit (monoid_sgroup (abelian_monoid_monoid M)) (monoid_on_def (abelian_monoid_monoid M))) *) elim H'; simpl in |- *; auto with algebra. (* Goal: forall (x y z : FaM) (_ : eqFaM x y) (_ : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x) (FaM_lift_fun y)) (_ : eqFaM y z) (_ : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun y) (FaM_lift_fun z)), @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x) (FaM_lift_fun z) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (abelian_monoid_monoid FreeAbelianMonoid))), @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun (sgroup_law (monoid_sgroup (abelian_monoid_monoid FreeAbelianMonoid)) x y)) (sgroup_law (monoid_sgroup (abelian_monoid_monoid M)) (FaM_lift_fun x) (FaM_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun (@monoid_unit (monoid_sgroup (abelian_monoid_monoid FreeAbelianMonoid)) (monoid_on_def (abelian_monoid_monoid FreeAbelianMonoid)))) (@monoid_unit (monoid_sgroup (abelian_monoid_monoid M)) (monoid_on_def (abelian_monoid_monoid M))) *) intros x0 y0 z H'0 H'1 H'2 H'3; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun z) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (abelian_monoid_monoid FreeAbelianMonoid))), @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun (sgroup_law (monoid_sgroup (abelian_monoid_monoid FreeAbelianMonoid)) x y)) (sgroup_law (monoid_sgroup (abelian_monoid_monoid M)) (FaM_lift_fun x) (FaM_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun (@monoid_unit (monoid_sgroup (abelian_monoid_monoid FreeAbelianMonoid)) (monoid_on_def (abelian_monoid_monoid FreeAbelianMonoid)))) (@monoid_unit (monoid_sgroup (abelian_monoid_monoid M)) (monoid_on_def (abelian_monoid_monoid M))) *) apply Trans with (FaM_lift_fun y0); auto with algebra. (* Goal: forall (x y : Carrier V) (_ : @Equal V x y), @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid FreeAbelianMonoid))) (Var x) (Var y) *) simpl in |- *; auto with algebra. (* Goal: forall (x y : Carrier V) (_ : @Equal V x y), @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid FreeAbelianMonoid))) (Var x) (Var y) *) simpl in |- *; auto with algebra. Defined. Definition FaM_var : Hom V FreeAbelianMonoid. (* Goal: Carrier (@Hom SET V (sgroup_set (monoid_sgroup (abelian_monoid_monoid FreeAbelianMonoid)))) *) apply (Build_Map (A:=V) (B:=FreeAbelianMonoid) (Ap:=Var)). (* Goal: @Map_eq V (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) f (@comp_hom SET V FaM_set (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (@f2 (@Monoid_util.M FaM_set Law Unit eqFaM_law eqFaM_law_assoc eqFaM_law0r eqFaM_law0l) (abelian_monoid_monoid M) FaM_lift_fun (fun (x y : FaM) (H' : eqFaM x y) => @eqFaM_ind (fun x0 y0 : FaM => @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun y0)) (fun (x0 y0 : Carrier V) (H : @Equal V x0 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) f f x0 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (abelian_monoid_monoid M)))) f)) (fun (x0 x' y0 y' : FaM) (_ : eqFaM x0 x') (H0 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun x')) (_ : eqFaM y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun y0) (FaM_lift_fun y')) => @SGROUP_comp (monoid_sgroup (abelian_monoid_monoid M)) (FaM_lift_fun x0) (FaM_lift_fun x') (FaM_lift_fun y0) (FaM_lift_fun y') H0 H2) (fun x0 y0 z : FaM => @SGROUP_assoc (monoid_sgroup (abelian_monoid_monoid M)) (FaM_lift_fun x0) (FaM_lift_fun y0) (FaM_lift_fun z)) (fun x0 : FaM => @MONOID_unit_r (abelian_monoid_monoid M) (FaM_lift_fun x0)) (fun x0 : FaM => @MONOID_unit_l (abelian_monoid_monoid M) (FaM_lift_fun x0)) (fun x0 : FaM => @Refl (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0)) (fun (x0 y0 : FaM) (_ : eqFaM x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun y0) H0) (fun (x0 y0 z : FaM) (_ : eqFaM x0 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun y0)) (_ : eqFaM y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun y0) (FaM_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun y0) (FaM_lift_fun z) H'1 H'3) (fun x0 y0 : FaM => @ABELIAN_MONOID_com M (FaM_lift_fun x0) (FaM_lift_fun y0)) x y H')) FaM_var) *) red in |- *. (* Goal: forall (x y : Carrier V) (_ : @Equal V x y), @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid FreeAbelianMonoid))) (Var x) (Var y) *) simpl in |- *; auto with algebra. Defined. Lemma FaM_comp_prop : Equal f (comp_hom (FaM_lift:Hom (FreeAbelianMonoid:SET) M) FaM_var). (* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (@Ap V (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) f x) (@Ap V (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (@comp_hom SET V FaM_set (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (@f2 (@Monoid_util.M FaM_set Law Unit eqFaM_law eqFaM_law_assoc eqFaM_law0r eqFaM_law0l) (abelian_monoid_monoid M) FaM_lift_fun (fun (x0 y : FaM) (H' : eqFaM x0 y) => @eqFaM_ind (fun x1 y0 : FaM => @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x1) (FaM_lift_fun y0)) (fun (x1 y0 : Carrier V) (H : @Equal V x1 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) f f x1 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (abelian_monoid_monoid M)))) f)) (fun (x1 x' y0 y' : FaM) (_ : eqFaM x1 x') (H0 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x1) (FaM_lift_fun x')) (_ : eqFaM y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun y0) (FaM_lift_fun y')) => @SGROUP_comp (monoid_sgroup (abelian_monoid_monoid M)) (FaM_lift_fun x1) (FaM_lift_fun x') (FaM_lift_fun y0) (FaM_lift_fun y') H0 H2) (fun x1 y0 z : FaM => @SGROUP_assoc (monoid_sgroup (abelian_monoid_monoid M)) (FaM_lift_fun x1) (FaM_lift_fun y0) (FaM_lift_fun z)) (fun x1 : FaM => @MONOID_unit_r (abelian_monoid_monoid M) (FaM_lift_fun x1)) (fun x1 : FaM => @MONOID_unit_l (abelian_monoid_monoid M) (FaM_lift_fun x1)) (fun x1 : FaM => @Refl (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x1)) (fun (x1 y0 : FaM) (_ : eqFaM x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x1) (FaM_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x1) (FaM_lift_fun y0) H0) (fun (x1 y0 z : FaM) (_ : eqFaM x1 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x1) (FaM_lift_fun y0)) (_ : eqFaM y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun y0) (FaM_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x1) (FaM_lift_fun y0) (FaM_lift_fun z) H'1 H'3) (fun x1 y0 : FaM => @ABELIAN_MONOID_com M (FaM_lift_fun x1) (FaM_lift_fun y0)) x0 y H')) FaM_var) x) *) simpl in |- *. (* Goal: @Map_eq V (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) f (@comp_hom SET V FaM_set (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (@f2 (@Monoid_util.M FaM_set Law Unit eqFaM_law eqFaM_law_assoc eqFaM_law0r eqFaM_law0l) (abelian_monoid_monoid M) FaM_lift_fun (fun (x y : FaM) (H' : eqFaM x y) => @eqFaM_ind (fun x0 y0 : FaM => @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun y0)) (fun (x0 y0 : Carrier V) (H : @Equal V x0 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) f f x0 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (abelian_monoid_monoid M)))) f)) (fun (x0 x' y0 y' : FaM) (_ : eqFaM x0 x') (H0 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun x')) (_ : eqFaM y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun y0) (FaM_lift_fun y')) => @SGROUP_comp (monoid_sgroup (abelian_monoid_monoid M)) (FaM_lift_fun x0) (FaM_lift_fun x') (FaM_lift_fun y0) (FaM_lift_fun y') H0 H2) (fun x0 y0 z : FaM => @SGROUP_assoc (monoid_sgroup (abelian_monoid_monoid M)) (FaM_lift_fun x0) (FaM_lift_fun y0) (FaM_lift_fun z)) (fun x0 : FaM => @MONOID_unit_r (abelian_monoid_monoid M) (FaM_lift_fun x0)) (fun x0 : FaM => @MONOID_unit_l (abelian_monoid_monoid M) (FaM_lift_fun x0)) (fun x0 : FaM => @Refl (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0)) (fun (x0 y0 : FaM) (_ : eqFaM x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun y0) H0) (fun (x0 y0 z : FaM) (_ : eqFaM x0 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun y0)) (_ : eqFaM y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun y0) (FaM_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x0) (FaM_lift_fun y0) (FaM_lift_fun z) H'1 H'3) (fun x0 y0 : FaM => @ABELIAN_MONOID_com M (FaM_lift_fun x0) (FaM_lift_fun y0)) x y H')) FaM_var) *) red in |- *. (* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (@Ap V (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) f x) (@Ap V (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (@comp_hom SET V FaM_set (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (@f2 (@Monoid_util.M FaM_set Law Unit eqFaM_law eqFaM_law_assoc eqFaM_law0r eqFaM_law0l) (abelian_monoid_monoid M) FaM_lift_fun (fun (x0 y : FaM) (H' : eqFaM x0 y) => @eqFaM_ind (fun x1 y0 : FaM => @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x1) (FaM_lift_fun y0)) (fun (x1 y0 : Carrier V) (H : @Equal V x1 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) f f x1 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (abelian_monoid_monoid M)))) f)) (fun (x1 x' y0 y' : FaM) (_ : eqFaM x1 x') (H0 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x1) (FaM_lift_fun x')) (_ : eqFaM y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun y0) (FaM_lift_fun y')) => @SGROUP_comp (monoid_sgroup (abelian_monoid_monoid M)) (FaM_lift_fun x1) (FaM_lift_fun x') (FaM_lift_fun y0) (FaM_lift_fun y') H0 H2) (fun x1 y0 z : FaM => @SGROUP_assoc (monoid_sgroup (abelian_monoid_monoid M)) (FaM_lift_fun x1) (FaM_lift_fun y0) (FaM_lift_fun z)) (fun x1 : FaM => @MONOID_unit_r (abelian_monoid_monoid M) (FaM_lift_fun x1)) (fun x1 : FaM => @MONOID_unit_l (abelian_monoid_monoid M) (FaM_lift_fun x1)) (fun x1 : FaM => @Refl (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x1)) (fun (x1 y0 : FaM) (_ : eqFaM x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x1) (FaM_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x1) (FaM_lift_fun y0) H0) (fun (x1 y0 z : FaM) (_ : eqFaM x1 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x1) (FaM_lift_fun y0)) (_ : eqFaM y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun y0) (FaM_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (FaM_lift_fun x1) (FaM_lift_fun y0) (FaM_lift_fun z) H'1 H'3) (fun x1 y0 : FaM => @ABELIAN_MONOID_com M (FaM_lift_fun x1) (FaM_lift_fun y0)) x0 y H')) FaM_var) x) *) simpl in |- *. (* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (@Ap V (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) f x) (@Ap V (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) f x) *) auto with algebra. Qed. End Universal_prop. End Free_abelian_monoid_def. Hint Resolve FaM_comp_prop: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Sub_sgroup. Require Export Monoid_facts. Section Def. Variable G : MONOID. Section Sub_monoid. Variable H : subsgroup G. Hypothesis Hunit : in_part (monoid_unit G) H. Definition submonoid_monoid : monoid. (* Goal: monoid *) apply (Build_monoid (monoid_sgroup:=H)). (* Goal: monoid_on (@sgroup_of_subsgroup (monoid_sgroup G) H) *) apply (Build_monoid_on (A:=H) (monoid_unit:=Build_subtype Hunit)). (* Goal: @injective (sgroup_set (monoid_sgroup (@monoid_of_submonoid G H))) (sgroup_set (monoid_sgroup G)) (@sgroup_map (monoid_sgroup (@monoid_of_submonoid G H)) (monoid_sgroup G) (@monoid_sgroup_hom (@monoid_of_submonoid G H) G inj_submonoid)) *) red in |- *. (* Goal: forall x : @subtype (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H), @Equal (sgroup_set (monoid_sgroup G)) (@subtype_elt (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) (@Build_subtype (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) (sgroup_law (monoid_sgroup G) (@monoid_unit (monoid_sgroup G) (monoid_on_def G)) (@subtype_elt (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) x)) (@subsgroup_prop (monoid_sgroup G) H (@monoid_unit (monoid_sgroup G) (monoid_on_def G)) (@subtype_elt (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) x) Hunit (@subtype_prf (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) x)))) (@subtype_elt (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) x) *) simpl in |- *. (* Goal: forall x : @subtype (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H), @subtype_image_equal (sgroup_set (monoid_sgroup G)) (@subtype (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H)) (@subtype_elt (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H)) (@Build_subtype (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) (sgroup_law (monoid_sgroup G) (@monoid_unit (monoid_sgroup G) (monoid_on_def G)) (@subtype_elt (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) x)) (@subsgroup_prop (monoid_sgroup G) H (@monoid_unit (monoid_sgroup G) (monoid_on_def G)) (@subtype_elt (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) x) Hunit (@subtype_prf (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) x))) x *) unfold subtype_image_equal in |- *. (* Goal: forall x : @subtype (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H), @Equal (sgroup_set (monoid_sgroup G)) (@subtype_elt (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) (@Build_subtype (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) (sgroup_law (monoid_sgroup G) (@monoid_unit (monoid_sgroup G) (monoid_on_def G)) (@subtype_elt (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) x)) (@subsgroup_prop (monoid_sgroup G) H (@monoid_unit (monoid_sgroup G) (monoid_on_def G)) (@subtype_elt (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) x) Hunit (@subtype_prf (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) x)))) (@subtype_elt (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) x) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (@monoid_of_submonoid G H)))) (_ : @Equal (sgroup_set (monoid_sgroup G)) (@Ap (sgroup_set (monoid_sgroup (@monoid_of_submonoid G H))) (sgroup_set (monoid_sgroup G)) (@sgroup_map (monoid_sgroup (@monoid_of_submonoid G H)) (monoid_sgroup G) (@monoid_sgroup_hom (@monoid_of_submonoid G H) G inj_submonoid)) x) (@Ap (sgroup_set (monoid_sgroup (@monoid_of_submonoid G H))) (sgroup_set (monoid_sgroup G)) (@sgroup_map (monoid_sgroup (@monoid_of_submonoid G H)) (monoid_sgroup G) (@monoid_sgroup_hom (@monoid_of_submonoid G H) G inj_submonoid)) y)), @Equal (sgroup_set (monoid_sgroup (@monoid_of_submonoid G H))) x y *) auto with algebra. (* Goal: @injective (sgroup_set (monoid_sgroup (@monoid_of_submonoid G H))) (sgroup_set (monoid_sgroup G)) (@sgroup_map (monoid_sgroup (@monoid_of_submonoid G H)) (monoid_sgroup G) (@monoid_sgroup_hom (@monoid_of_submonoid G H) G inj_submonoid)) *) red in |- *. (* Goal: forall x : @subtype (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H), @Equal (sgroup_set (monoid_sgroup G)) (@subtype_elt (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) (@Build_subtype (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) (sgroup_law (monoid_sgroup G) (@monoid_unit (monoid_sgroup G) (monoid_on_def G)) (@subtype_elt (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) x)) (@subsgroup_prop (monoid_sgroup G) H (@monoid_unit (monoid_sgroup G) (monoid_on_def G)) (@subtype_elt (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) x) Hunit (@subtype_prf (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) x)))) (@subtype_elt (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) x) *) simpl in |- *. (* Goal: forall x : @subtype (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H), @subtype_image_equal (sgroup_set (monoid_sgroup G)) (@subtype (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H)) (@subtype_elt (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H)) (@Build_subtype (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) (sgroup_law (monoid_sgroup G) (@monoid_unit (monoid_sgroup G) (monoid_on_def G)) (@subtype_elt (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) x)) (@subsgroup_prop (monoid_sgroup G) H (@monoid_unit (monoid_sgroup G) (monoid_on_def G)) (@subtype_elt (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) x) Hunit (@subtype_prf (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) x))) x *) unfold subtype_image_equal in |- *. (* Goal: forall x : @subtype (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H), @Equal (sgroup_set (monoid_sgroup G)) (@subtype_elt (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) (@Build_subtype (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) (sgroup_law (monoid_sgroup G) (@monoid_unit (monoid_sgroup G) (monoid_on_def G)) (@subtype_elt (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) x)) (@subsgroup_prop (monoid_sgroup G) H (@monoid_unit (monoid_sgroup G) (monoid_on_def G)) (@subtype_elt (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) x) Hunit (@subtype_prf (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) x)))) (@subtype_elt (sgroup_set (monoid_sgroup G)) (@subsgroup_part (monoid_sgroup G) H) x) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (@monoid_of_submonoid G H)))) (_ : @Equal (sgroup_set (monoid_sgroup G)) (@Ap (sgroup_set (monoid_sgroup (@monoid_of_submonoid G H))) (sgroup_set (monoid_sgroup G)) (@sgroup_map (monoid_sgroup (@monoid_of_submonoid G H)) (monoid_sgroup G) (@monoid_sgroup_hom (@monoid_of_submonoid G H) G inj_submonoid)) x) (@Ap (sgroup_set (monoid_sgroup (@monoid_of_submonoid G H))) (sgroup_set (monoid_sgroup G)) (@sgroup_map (monoid_sgroup (@monoid_of_submonoid G H)) (monoid_sgroup G) (@monoid_sgroup_hom (@monoid_of_submonoid G H) G inj_submonoid)) y)), @Equal (sgroup_set (monoid_sgroup (@monoid_of_submonoid G H))) x y *) auto with algebra. Defined. End Sub_monoid. Record submonoid : Type := {submonoid_subsgroup : subsgroup G; submonoid_prop : in_part (monoid_unit G) submonoid_subsgroup}. Definition monoid_of_submonoid (H : submonoid) := submonoid_monoid (submonoid_prop H). End Def. Coercion monoid_of_submonoid : submonoid >-> monoid. Coercion submonoid_subsgroup : submonoid >-> subsgroup. Section Injection. Variable G : MONOID. Variable H : submonoid G. Lemma submonoid_in_prop : in_part (monoid_unit G) H. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (@monoid_of_submonoid G H)))) (_ : @Equal (sgroup_set (monoid_sgroup G)) (@Ap (sgroup_set (monoid_sgroup (@monoid_of_submonoid G H))) (sgroup_set (monoid_sgroup G)) (@sgroup_map (monoid_sgroup (@monoid_of_submonoid G H)) (monoid_sgroup G) (@monoid_sgroup_hom (@monoid_of_submonoid G H) G inj_submonoid)) x) (@Ap (sgroup_set (monoid_sgroup (@monoid_of_submonoid G H))) (sgroup_set (monoid_sgroup G)) (@sgroup_map (monoid_sgroup (@monoid_of_submonoid G H)) (monoid_sgroup G) (@monoid_sgroup_hom (@monoid_of_submonoid G H) G inj_submonoid)) y)), @Equal (sgroup_set (monoid_sgroup (@monoid_of_submonoid G H))) x y *) apply (submonoid_prop (G:=G) H); auto with algebra. Qed. Definition inj_submonoid : Hom (H:MONOID) G. (* Goal: Carrier (@Hom MONOID (@monoid_of_submonoid G H : Ob MONOID) G) *) apply (Build_monoid_hom (E:=H) (F:=G) (monoid_sgroup_hom:=inj_subsgroup H)). (* Goal: @injective (sgroup_set (monoid_sgroup (@monoid_of_submonoid G H))) (sgroup_set (monoid_sgroup G)) (@sgroup_map (monoid_sgroup (@monoid_of_submonoid G H)) (monoid_sgroup G) (@monoid_sgroup_hom (@monoid_of_submonoid G H) G inj_submonoid)) *) red in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (@monoid_of_submonoid G H)))) (_ : @Equal (sgroup_set (monoid_sgroup G)) (@Ap (sgroup_set (monoid_sgroup (@monoid_of_submonoid G H))) (sgroup_set (monoid_sgroup G)) (@sgroup_map (monoid_sgroup (@monoid_of_submonoid G H)) (monoid_sgroup G) (@monoid_sgroup_hom (@monoid_of_submonoid G H) G inj_submonoid)) x) (@Ap (sgroup_set (monoid_sgroup (@monoid_of_submonoid G H))) (sgroup_set (monoid_sgroup G)) (@sgroup_map (monoid_sgroup (@monoid_of_submonoid G H)) (monoid_sgroup G) (@monoid_sgroup_hom (@monoid_of_submonoid G H) G inj_submonoid)) y)), @Equal (sgroup_set (monoid_sgroup (@monoid_of_submonoid G H))) x y *) auto with algebra. Defined. Lemma inj_subsmonoid_injective : injective inj_submonoid. (* Goal: @injective (sgroup_set (monoid_sgroup (@monoid_of_submonoid G H))) (sgroup_set (monoid_sgroup G)) (@sgroup_map (monoid_sgroup (@monoid_of_submonoid G H)) (monoid_sgroup G) (@monoid_sgroup_hom (@monoid_of_submonoid G H) G inj_submonoid)) *) red in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (@monoid_of_submonoid G H)))) (_ : @Equal (sgroup_set (monoid_sgroup G)) (@Ap (sgroup_set (monoid_sgroup (@monoid_of_submonoid G H))) (sgroup_set (monoid_sgroup G)) (@sgroup_map (monoid_sgroup (@monoid_of_submonoid G H)) (monoid_sgroup G) (@monoid_sgroup_hom (@monoid_of_submonoid G H) G inj_submonoid)) x) (@Ap (sgroup_set (monoid_sgroup (@monoid_of_submonoid G H))) (sgroup_set (monoid_sgroup G)) (@sgroup_map (monoid_sgroup (@monoid_of_submonoid G H)) (monoid_sgroup G) (@monoid_sgroup_hom (@monoid_of_submonoid G H) G inj_submonoid)) y)), @Equal (sgroup_set (monoid_sgroup (@monoid_of_submonoid G H))) x y *) auto with algebra. Qed. End Injection. Hint Resolve submonoid_in_prop inj_subsmonoid_injective: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Parts2. (** Title "Restrictions, inverse images." *) Section Restrictions1. Variable E F : Setoid. Variable f : MAP E F. Definition restrict : forall A : part_set E, MAP A F. (* Goal: forall A : Carrier (part_set E), Carrier (MAP (@set_of_subtype_image E (@part E A)) F) *) intros A; try assumption. (* Goal: Carrier (MAP (@set_of_subtype_image E (@part E A)) F) *) apply (Build_Map (Ap:=fun x : A => f (A x))). (* Goal: @pred_compatible E (fun x : Carrier E => @in_part F (@Ap E F f x) A) *) red in |- *. (* Goal: forall (x y : Carrier (@set_of_subtype_image E (@part E A))) (_ : @Equal (@set_of_subtype_image E (@part E A)) x y), @Equal F (@Ap E F f (@subtype_image_inj E (@part E A) x)) (@Ap E F f (@subtype_image_inj E (@part E A) y)) *) intros x y; try assumption. (* Goal: forall _ : @Equal (@set_of_subtype_image E (@part E A)) x y, @Equal F (@Ap E F f (@subtype_image_inj E (@part E A) x)) (@Ap E F f (@subtype_image_inj E (@part E A) y)) *) elim y. (* Goal: forall (subtype_elt : Carrier E) (subtype_prf : @Pred_fun E A subtype_elt) (_ : @Equal (@set_of_subtype_image E (@part E A)) x (@Build_subtype E A subtype_elt subtype_prf)), @Equal F (@Ap E F f (@subtype_image_inj E (@part E A) x)) (@Ap E F f (@subtype_image_inj E (@part E A) (@Build_subtype E A subtype_elt subtype_prf))) *) elim x. (* Goal: forall _ : @in_part F x (@image E F f A), @in_part F x (@image E F f (invimage f (@image E F f A))) *) simpl in |- *; auto with algebra. Defined. Lemma restrict_prop : forall (A : part_set E) (x : E) (p : in_part x A), Equal (restrict A (Build_subtype (subtype_elt:=x) p)) (f x). (* Goal: forall _ : @in_part F x (@image E F f A), @in_part F x (@image E F f (invimage f (@image E F f A))) *) simpl in |- *; auto with algebra. Qed. Lemma restrict_prop_in_part : forall (A : part_set E) (x : A), Equal (restrict A x) (f (A x)). (* Goal: forall _ : @in_part F x (@image E F f A), @in_part F x (@image E F f (invimage f (@image E F f A))) *) simpl in |- *; auto with algebra. Qed. End Restrictions1. Hint Resolve restrict_prop: algebra. Section Inverse_image1. Variable E F : Setoid. Section Inverse_image1_1. Variable f : MAP E F. Definition invimage : part_set F -> part_set E. (* Goal: forall _ : Carrier (part_set F), Carrier (part_set E) *) intros A. (* Goal: Carrier (part_set E) *) apply (Build_Predicate (Pred_fun:=fun x : E => in_part (f x) A)). (* Goal: @pred_compatible E (fun x : Carrier E => @in_part F (@Ap E F f x) A) *) red in |- *. (* Goal: forall (x y : Carrier E) (_ : @in_part F (@Ap E F f x) A) (_ : @Equal E y x), @in_part F (@Ap E F f y) A *) intros x y H' H'0; try assumption. (* Goal: @in_part F (@Ap E F f y) A *) apply in_part_comp_l with (Ap f x); auto with algebra. Defined. End Inverse_image1_1. Variable f : MAP E F. Lemma invimage_in : forall (A : part_set F) (x : E), in_part x (invimage f A) -> in_part (f x) A. (* Goal: forall _ : @in_part F x (@image E F f A), @in_part F x (@image E F f (invimage f (@image E F f A))) *) simpl in |- *; auto with algebra. Qed. Lemma in_invimage : forall (A : part_set F) (x : E), in_part (f x) A -> in_part x (invimage f A). (* Goal: forall _ : @in_part F x (@image E F f A), @in_part F x (@image E F f (invimage f (@image E F f A))) *) simpl in |- *; auto with algebra. Qed. Hint Resolve in_invimage: algebra. Lemma invimage_included : forall A B : part_set F, included A B -> included (invimage f A) (invimage f B). (* Goal: forall A : Carrier (part_set E), @included E A (invimage f (@image E F f A)) *) unfold included in |- *. (* Goal: forall _ : @in_part F x (@image E F f A), @in_part F x (@image E F f (invimage f (@image E F f A))) *) simpl in |- *; auto with algebra. Qed. Hint Resolve invimage_included: algebra. Lemma invimage_comp : forall A B : part_set F, Equal A B -> Equal (invimage f A) (invimage f B). (* Goal: forall (A B : Carrier (part_set F)) (_ : @Equal (part_set F) A B), @Equal (part_set E) (invimage f A) (invimage f B) *) intros A B H'; try assumption. (* Goal: @Equal (part_set E) (invimage f A) (invimage f B) *) apply included_antisym; auto with algebra. Qed. Hint Resolve invimage_comp: algebra. Lemma invimage_image : forall A : part_set F, included (image f (invimage f A)) A. (* Goal: forall A : Carrier (part_set E), @included E A (invimage f (@image E F f A)) *) unfold included in |- *. (* Goal: forall _ : @in_part F x (@image E F f A), @in_part F x (@image E F f (invimage f (@image E F f A))) *) simpl in |- *; auto with algebra. (* Goal: forall (A : Predicate F) (x : Carrier F) (_ : @ex (Carrier E) (fun x0 : Carrier E => and (@in_part F (@Ap E F f x0) A) (@Equal F x (@Ap E F f x0)))), @in_part F x A *) intros A x H'; try assumption. (* Goal: @in_part F x A *) elim H'; intros x0 E0; elim E0; intros H'0 H'1; try exact H'1; clear E0 H'. (* Goal: @in_part F (@Ap E F f x) A *) (* Goal: @in_part E x (invimage f (@image E F f (invimage f A))) *) apply in_part_comp_l with (Ap f x0); auto with algebra. Qed. Lemma image_invimage : forall A : part_set E, included A (invimage f (image f A)). (* Goal: forall A : Carrier (part_set E), @included E A (invimage f (@image E F f A)) *) unfold included in |- *. (* Goal: forall _ : @in_part F x (@image E F f A), @in_part F x (@image E F f (invimage f (@image E F f A))) *) simpl in |- *; auto with algebra. (* Goal: forall (A : Predicate E) (x : Carrier E) (_ : @in_part E x A), @ex (Carrier E) (fun x0 : Carrier E => and (@in_part E x0 A) (@Equal F (@Ap E F f x) (@Ap E F f x0))) *) intros A x H'; exists x; split; [ try assumption | idtac ]; auto with algebra. Qed. Hint Resolve invimage_image image_invimage: algebra. Lemma invimage_image_invimage : forall A : part_set F, Equal (invimage f (image f (invimage f A))) (invimage f A). (* Goal: forall A : Carrier (part_set E), @Equal (part_set F) (@image E F f (invimage f (@image E F f A))) (@image E F f A) *) simpl in |- *. (* Goal: forall A : Predicate E, @eq_part F (@image E F f (invimage f (@image E F f A))) (@image E F f A) *) unfold eq_part in |- *. (* Goal: forall (A : Predicate F) (x : Carrier E), and (forall _ : @in_part E x (invimage f (@image E F f (invimage f A))), @in_part E x (invimage f A)) (forall _ : @in_part E x (invimage f A), @in_part E x (invimage f (@image E F f (invimage f A)))) *) intros A x; split; [ idtac | intros H'; try assumption ]. (* Goal: forall A : Carrier (part_set E), @Equal (part_set F) (@image E F f (invimage f (@image E F f A))) (@image E F f A) *) simpl in |- *. (* Goal: forall _ : @ex (Carrier E) (fun x0 : Carrier E => and (@in_part E x0 A) (@Equal F x (@Ap E F f x0))), @ex (Carrier E) (fun x0 : Carrier E => and (@ex (Carrier E) (fun x : Carrier E => and (@in_part E x A) (@Equal F (@Ap E F f x0) (@Ap E F f x)))) (@Equal F x (@Ap E F f x0))) *) intros H'; try assumption. (* Goal: @ex (Carrier E) (fun x0 : Carrier E => and (@ex (Carrier E) (fun x : Carrier E => and (@in_part E x A) (@Equal F (@Ap E F f x0) (@Ap E F f x)))) (@Equal F x (@Ap E F f x0))) *) elim H'; intros x0 E0; elim E0; intros H'0 H'1; try exact H'0; clear E0 H'. (* Goal: @in_part F (@Ap E F f x) A *) (* Goal: @in_part E x (invimage f (@image E F f (invimage f A))) *) apply in_part_comp_l with (Ap f x0); auto with algebra. (* Goal: @in_part E x (invimage f (@image E F f (invimage f A))) *) auto with algebra. Qed. Lemma image_invimage_image : forall A : part_set E, Equal (image f (invimage f (image f A))) (image f A). (* Goal: forall A : Carrier (part_set E), @Equal (part_set F) (@image E F f (invimage f (@image E F f A))) (@image E F f A) *) simpl in |- *. (* Goal: forall A : Predicate E, @eq_part F (@image E F f (invimage f (@image E F f A))) (@image E F f A) *) unfold eq_part in |- *. (* Goal: forall (A : Predicate E) (x : Carrier F), and (forall _ : @in_part F x (@image E F f (invimage f (@image E F f A))), @in_part F x (@image E F f A)) (forall _ : @in_part F x (@image E F f A), @in_part F x (@image E F f (invimage f (@image E F f A)))) *) intros A x; split; [ try assumption | idtac ]. (* Goal: forall _ : @in_part F x (@image E F f A), @in_part F x (@image E F f (invimage f (@image E F f A))) *) simpl in |- *; auto with algebra. (* Goal: forall _ : @ex (Carrier E) (fun x0 : Carrier E => and (@in_part E x0 A) (@Equal F x (@Ap E F f x0))), @ex (Carrier E) (fun x0 : Carrier E => and (@ex (Carrier E) (fun x : Carrier E => and (@in_part E x A) (@Equal F (@Ap E F f x0) (@Ap E F f x)))) (@Equal F x (@Ap E F f x0))) *) intros H'; try assumption. elim H'; intros x0 E0; elim E0; intros H'0 H'1; elim H'0; intros x1 E1; elim E1; intros H'2 H'3; try exact H'2; clear E1 H'0 E0 H'. (* Goal: @in_part E x (invimage f (@image E F f (invimage f A))) *) exists x1; split; [ try assumption | idtac ]; auto with algebra. (* Goal: @in_part E x (invimage f (@image E F f (invimage f A))) *) apply Trans with (Ap f x0); auto with algebra. (* Goal: forall _ : @in_part F x (@image E F f A), @in_part F x (@image E F f (invimage f (@image E F f A))) *) simpl in |- *; auto with algebra. (* Goal: forall _ : @ex (Carrier E) (fun x0 : Carrier E => and (@in_part E x0 A) (@Equal F x (@Ap E F f x0))), @ex (Carrier E) (fun x0 : Carrier E => and (@ex (Carrier E) (fun x : Carrier E => and (@in_part E x A) (@Equal F (@Ap E F f x0) (@Ap E F f x)))) (@Equal F x (@Ap E F f x0))) *) intros H'; try assumption. (* Goal: @ex (Carrier E) (fun x0 : Carrier E => and (@ex (Carrier E) (fun x : Carrier E => and (@in_part E x A) (@Equal F (@Ap E F f x0) (@Ap E F f x)))) (@Equal F x (@Ap E F f x0))) *) elim H'; intros x0 E0; elim E0; intros H'0 H'1; try exact H'0; clear E0 H'. exists x0; split; [ exists x0; split; [ try assumption | idtac ] | idtac ]; (* Goal: @in_part E x (invimage f (@image E F f (invimage f A))) *) auto with algebra. Qed. End Inverse_image1. Hint Resolve invimage_image_invimage image_invimage_image: algebra. Hint Resolve in_invimage: algebra. Hint Resolve invimage_included: algebra. Hint Resolve invimage_comp: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Automatic Coercions Import. Set Implicit Arguments. Unset Strict Implicit. Require Export Module_util. Require Export Ring_facts. Require Export Module_facts. Section Hom_module_def. Variable R : CRING. Variable Mod1 Mod2 : MODULE R. Definition add_hom_module : forall f g : Hom Mod1 Mod2, Hom Mod1 Mod2. (* Goal: forall (_ : Carrier (@Hom (MODULE (cring_ring R)) Mod1 Mod2)) (_ : Carrier (@Hom (MODULE (cring_ring R)) Mod1 Mod2)), Carrier (@Hom (MODULE (cring_ring R)) Mod1 Mod2) *) intros f0 g. apply (BUILD_HOM_MODULE (R:=R) (Mod:=Mod1) (Mod':=Mod2) (ff:=fun x : Mod1 => sgroup_law Mod2 (f0 x) (g x))). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x)) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) y)) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) x y))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x)) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) y))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) *) (* Goal: forall (a0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R))))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@module_mult (cring_ring R) Mod1 a0 x))) (@module_mult (cring_ring R) Mod2 a0 (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x))) *) abstract auto with algebra. abstract (intros x y; apply Trans with (sgroup_law (module_carrier Mod2) (sgroup_law (module_carrier Mod2) (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) x) (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) y)) (sgroup_law (module_carrier Mod2) (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom g))) x) (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom g))) y))); auto with algebra). abstract (apply Trans with (sgroup_law (module_carrier Mod2) (monoid_unit (module_carrier Mod2)) (monoid_unit (module_carrier Mod2))); auto with algebra). abstract (intros a x; apply Trans with (sgroup_law (module_carrier Mod2) (module_mult a (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) x)) (module_mult a (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom g))) x))); auto with algebra). Defined. Definition zero_hom_module : Hom Mod1 Mod2. apply (BUILD_HOM_MODULE (R:=R) (Mod:=Mod1) (Mod':=Mod2) (ff:=fun x : Mod1 => monoid_unit Mod2)); abstract auto with algebra. Defined. Definition opp_hom_module : forall f : Hom Mod1 Mod2, Hom Mod1 Mod2. (* Goal: forall _ : Carrier (@Hom (MODULE (cring_ring R)) Mod1 Mod2), Carrier (@Hom (MODULE (cring_ring R)) Mod1 Mod2) *) intros f0. apply (BUILD_HOM_MODULE (R:=R) (Mod:=Mod1) (Mod':=Mod2) (ff:=fun x : Mod1 => group_inverse Mod2 (f0 x))). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x)) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) y)) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) x y))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x)) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) y))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) *) (* Goal: forall (a0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R))))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@module_mult (cring_ring R) Mod1 a0 x))) (@module_mult (cring_ring R) Mod2 a0 (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x))) *) abstract auto with algebra. abstract (intros x y; apply Trans with (group_inverse (module_carrier Mod2) (sgroup_law (module_carrier Mod2) (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) x) (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) y))); auto with algebra; apply Trans with (group_inverse (module_carrier Mod2) (sgroup_law (module_carrier Mod2) (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) y) (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) x))); auto with algebra). abstract (apply Trans with (group_inverse (module_carrier Mod2) (monoid_unit (module_carrier Mod2))); auto with algebra). abstract (intros a x; apply Trans with (group_inverse (module_carrier Mod2) (module_mult a (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) x))); auto with algebra). Defined. Definition mult_hom_module : forall (a : R) (f : Hom Mod1 Mod2), Hom Mod1 Mod2. (* Goal: forall (_ : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R))))))) (_ : Carrier (@Hom (MODULE (cring_ring R)) Mod1 Mod2)), Carrier (@Hom (MODULE (cring_ring R)) Mod1 Mod2) *) intros a f0. apply (BUILD_HOM_MODULE (R:=R) (Mod:=Mod1) (Mod':=Mod2) (ff:=fun x : Mod1 => module_mult a (f0 x))). (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x)) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) y)) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) x y))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x)) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) y))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) *) (* Goal: forall (a0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R))))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@module_mult (cring_ring R) Mod1 a0 x))) (@module_mult (cring_ring R) Mod2 a0 (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x))) *) abstract auto with algebra. abstract (intros x y; apply Trans with (module_mult a (sgroup_law (module_carrier Mod2) (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) x) (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) y))); auto with algebra). abstract (apply Trans with (module_mult a (monoid_unit (module_carrier Mod2))); auto with algebra). abstract (intros a0 x; apply Trans with (module_mult a (module_mult a0 (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) x))); auto with algebra; apply Trans with (module_mult (ring_mult a a0) (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) x)); auto with algebra; apply Trans with (module_mult (ring_mult a0 a) (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) x)); auto with algebra). Defined. Definition Hom_module : MODULE R. apply (BUILD_MODULE (R:=R) (E:=Hom Mod1 Mod2) (genlaw:=add_hom_module) (e:=zero_hom_module) (geninv:=opp_hom_module) (gen_module_op:=mult_hom_module)); try abstract (simpl in |- *; unfold Map_eq in |- *; simpl in |- *; auto with algebra). Defined. End Hom_module_def.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Classical_Prop. Require Export Parts. (** Title "Complement, images." *) Comments "We define here complement of a part, image of a part by a map.". Section Complement1. Variable E : Setoid. Lemma not_in_comp_l : forall (E : Setoid) (A : part_set E) (x y : E), ~ in_part x A -> Equal y x -> ~ in_part y A. (* Goal: or (@in_part E x A) (not (@in_part E x A)) *) unfold not in |- *. (* Goal: forall (E : Setoid) (A : Carrier (part_set E)) (x y : Carrier E) (_ : forall _ : @in_part E x A, False) (_ : @Equal E y x) (_ : @in_part E y A), False *) intros E0 A x y H' H'0 H'1; try assumption. (* Goal: False *) apply H'. (* Goal: @in_part E0 x A *) apply in_part_comp_l with y; auto with algebra. Qed. Lemma not_in_comp_r : forall (E : Setoid) (A B : part_set E) (x : E), ~ in_part x A -> Equal A B -> ~ in_part x B. (* Goal: or (@in_part E x A) (not (@in_part E x A)) *) unfold not in |- *. (* Goal: forall (E : Setoid) (A B : Carrier (part_set E)) (x : Carrier E) (_ : forall _ : @in_part E x A, False) (_ : @Equal (part_set E) A B) (_ : @in_part E x B), False *) intros E0 A B x H' H'0 H'1; try assumption. (* Goal: False *) apply H'. (* Goal: @in_part E0 x A *) apply in_part_comp_r with B; auto with algebra. Qed. Definition compl : part_set E -> part_set E. (* Goal: forall _ : Carrier (part_set E), Carrier (part_set F) *) intros A. (* Goal: Carrier (part_set E) *) apply (Build_Predicate (Pred_fun:=fun x : E => ~ in_part x A)). (* Goal: forall A : Carrier (part_set E), @surjective (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image F (@part F (image A))) (surj_part_image A) *) red in |- *. (* Goal: forall (x y : Carrier E) (_ : not (@in_part E x A)) (_ : @Equal E y x), not (@in_part E y A) *) intros x y H' H'0; try assumption. (* Goal: not (@in_part E y A) *) apply not_in_comp_l with x; auto with algebra. Defined. Lemma compl_in : forall (A : part_set E) (x : E), ~ in_part x A -> in_part x (compl A). (* Goal: forall (A : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x A), @in_part F (@Ap E F f x) (image A) *) simpl in |- *; auto with algebra. Qed. Hint Resolve compl_in: algebra. Lemma in_compl : forall (A : part_set E) (x : E), in_part x (compl A) -> ~ in_part x A. (* Goal: forall (A : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x A), @in_part F (@Ap E F f x) (image A) *) simpl in |- *; auto with algebra. Qed. Lemma compl_comp : forall A B : part_set E, Equal A B -> Equal (compl A) (compl B). (* Goal: forall (A : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x A), @in_part F (@Ap E F f x) (image A) *) simpl in |- *; auto with algebra. (* Goal: forall A : Predicate E, @eq_part E (compl (compl A)) A *) unfold eq_part in |- *; auto with algebra. (* Goal: forall (A B : Predicate E) (_ : forall x : Carrier E, and (forall (_ : forall _ : @in_part E x A, False) (_ : @in_part E x B), False) (forall (_ : forall _ : @in_part E x B, False) (_ : @in_part E x A), False)) (x : Carrier E), and (forall _ : @in_part E x A, @in_part E x B) (forall _ : @in_part E x B, @in_part E x A) *) intros A B H' x; try assumption. (* Goal: and (forall _ : @in_part E x A, @in_part E x B) (forall _ : @in_part E x B, @in_part E x A) *) elim (H' x). (* Goal: or (@in_part E x A) (not (@in_part E x A)) *) simpl in |- *; unfold not in |- *. (* Goal: forall (_ : forall _ : @in_part E x A, @in_part E x B) (_ : forall _ : @in_part E x B, @in_part E x A), and (forall (_ : forall _ : @in_part E x A, False) (_ : @in_part E x B), False) (forall (_ : forall _ : @in_part E x B, False) (_ : @in_part E x A), False) *) intuition. Qed. Hint Resolve compl_comp: algebra. Lemma compl_comp_rev : forall A B : part_set E, Equal (compl A) (compl B) -> Equal A B. (* Goal: forall (A : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x A), @in_part F (@Ap E F f x) (image A) *) simpl in |- *; auto with algebra. (* Goal: forall A : Predicate E, @eq_part E (compl (compl A)) A *) unfold eq_part in |- *; auto with algebra. (* Goal: or (@in_part E x A) (not (@in_part E x A)) *) simpl in |- *; unfold not in |- *. (* Goal: forall (A B : Predicate E) (_ : forall x : Carrier E, and (forall (_ : forall _ : @in_part E x A, False) (_ : @in_part E x B), False) (forall (_ : forall _ : @in_part E x B, False) (_ : @in_part E x A), False)) (x : Carrier E), and (forall _ : @in_part E x A, @in_part E x B) (forall _ : @in_part E x B, @in_part E x A) *) intros A B H' x; try assumption. (* Goal: and (forall _ : @in_part E x A, @in_part E x B) (forall _ : @in_part E x B, @in_part E x A) *) elim (H' x). (* Goal: forall _ : forall _ : forall _ : @in_part E x A, False, False, @in_part E x A *) (* Goal: forall (_ : @in_part E x A) (_ : forall _ : @in_part E x A, False), False *) apply NNPP. (* Goal: forall (_ : @in_part E x A) (_ : forall _ : @in_part E x A, False), False *) tauto. Qed. Lemma compl_compl : forall A : part_set E, Equal (compl (compl A)) A. (* Goal: forall (A : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x A), @in_part F (@Ap E F f x) (image A) *) simpl in |- *; auto with algebra. (* Goal: forall A : Predicate E, @eq_part E (compl (compl A)) A *) unfold eq_part in |- *; auto with algebra. (* Goal: or (@in_part E x A) (not (@in_part E x A)) *) simpl in |- *; unfold not in |- *. (* Goal: forall (A : Carrier (part_set E)) (_ : Carrier (@set_of_subtype_image E (@part E A))), Carrier (@set_of_subtype_image F (@part F (image A))) *) intros A x; try assumption. (* Goal: and (forall _ : forall _ : forall _ : @in_part E x A, False, False, @in_part E x A) (forall (_ : @in_part E x A) (_ : forall _ : @in_part E x A, False), False) *) split; [ try assumption | idtac ]. (* Goal: forall _ : forall _ : forall _ : @in_part E x A, False, False, @in_part E x A *) (* Goal: forall (_ : @in_part E x A) (_ : forall _ : @in_part E x A, False), False *) apply NNPP. (* Goal: forall (_ : @in_part E x A) (_ : forall _ : @in_part E x A, False), False *) tauto. Qed. Hint Resolve compl_compl: algebra. Lemma compl_not_in : forall (A : part_set E) (x : E), in_part x A -> ~ in_part x (compl A). (* Goal: forall (A : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x A), @in_part F (@Ap E F f x) (image A) *) simpl in |- *; auto with algebra. Qed. Hint Resolve compl_not_in: algebra. Lemma not_in_compl : forall (A : part_set E) (x : E), in_part x (compl A) -> ~ in_part x A. (* Goal: forall (A : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x A), @in_part F (@Ap E F f x) (image A) *) simpl in |- *; auto with algebra. Qed. Lemma compl_included : forall A B : part_set E, included A B -> included (compl B) (compl A). (* Goal: @included F (image A) (image B) *) unfold included in |- *. (* Goal: forall (A : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x A), @in_part F (@Ap E F f x) (image A) *) simpl in |- *; auto with algebra. Qed. Lemma compl_not_compl : forall (A : part_set E) (x : E), in_part x A \/ in_part x (compl A). (* Goal: forall (A : Carrier (part_set E)) (_ : Carrier (@set_of_subtype_image E (@part E A))), Carrier (@set_of_subtype_image F (@part F (image A))) *) intros A x; try assumption. (* Goal: forall (subtype_elt0 : Carrier E) (subtype_prf : @Pred_fun E A subtype_elt0) (subtype_elt1 : Carrier E) (subtype_prf0 : @Pred_fun E A subtype_elt1) (_ : @Equal E (@subtype_elt E A (@Build_subtype E A subtype_elt1 subtype_prf0)) (@subtype_elt E A (@Build_subtype E A subtype_elt0 subtype_prf))), @Equal F (@subtype_elt F (image A) (@surj_part_image_fun A (@Build_subtype E A subtype_elt1 subtype_prf0))) (@subtype_elt F (image A) (@surj_part_image_fun A (@Build_subtype E A subtype_elt0 subtype_prf))) *) simpl in |- *. (* Goal: or (@in_part E x A) (not (@in_part E x A)) *) unfold not in |- *. (* Goal: forall (_ : forall _ : @in_part E x A, @in_part E x B) (_ : forall _ : @in_part E x B, @in_part E x A), and (forall (_ : forall _ : @in_part E x A, False) (_ : @in_part E x B), False) (forall (_ : forall _ : @in_part E x B, False) (_ : @in_part E x A), False) *) apply NNPP; intuition. Qed. End Complement1. Hint Resolve compl_included compl_not_in compl_compl compl_comp compl_in: algebra. Section Images1. Variable E F : Setoid. Variable f : MAP E F. Definition image : part_set E -> part_set F. (* Goal: forall _ : Carrier (part_set E), Carrier (part_set F) *) intros A. apply (Build_Predicate (Pred_fun:=fun y : F => exists x : E, in_part x A /\ Equal y (f x))). (* Goal: forall A : Carrier (part_set E), @surjective (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image F (@part F (image A))) (surj_part_image A) *) red in |- *. (* Goal: forall (x y : Carrier F) (_ : @ex (Carrier E) (fun x0 : Carrier E => and (@in_part E x0 A) (@Equal F x (@Ap E F f x0)))) (_ : @Equal F y x), @ex (Carrier E) (fun x0 : Carrier E => and (@in_part E x0 A) (@Equal F y (@Ap E F f x0))) *) intros y y' H' H'0; try assumption. (* Goal: @ex (Carrier E) (fun x : Carrier E => and (@in_part E x A) (@Equal F y' (@Ap E F f x))) *) elim H'; intros x E0; elim E0; intros H'1 H'2; try exact H'1; clear E0 H'. (* Goal: and (forall _ : forall _ : forall _ : @in_part E x A, False, False, @in_part E x A) (forall (_ : @in_part E x A) (_ : forall _ : @in_part E x A, False), False) *) exists x; split; [ try assumption | idtac ]. (* Goal: @Equal F y' (@Ap E F f x) *) apply Trans with y; auto with algebra. Defined. Lemma image_in : forall (A : part_set E) (y : F), in_part y (image A) -> exists x : E, in_part x A /\ Equal y (f x). (* Goal: forall (A : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x A), @in_part F (@Ap E F f x) (image A) *) simpl in |- *; auto with algebra. Qed. Lemma in_image : forall (A : part_set E) (x : E) (y : F), in_part x A -> Equal y (f x) -> in_part y (image A). (* Goal: forall (A : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x A), @in_part F (@Ap E F f x) (image A) *) simpl in |- *; auto with algebra. (* Goal: forall (A : Predicate E) (x : Carrier E) (y : Carrier F) (_ : @in_part E x A) (_ : @Equal F y (@Ap E F f x)), @ex (Carrier E) (fun x0 : Carrier E => and (@in_part E x0 A) (@Equal F y (@Ap E F f x0))) *) intros A x y H' H'0; try assumption. (* Goal: @ex (Carrier E) (fun x0 : Carrier E => and (@in_part E x0 A) (@Equal F (@Ap E F f x) (@Ap E F f x0))) *) exists x; split; [ try assumption | idtac ]; auto with algebra. Qed. Hint Resolve in_image: algebra. Lemma image_included : forall A B : part_set E, included A B -> included (image A) (image B). (* Goal: forall (A B : Carrier (part_set E)) (_ : @Equal (part_set E) A B), @Equal (part_set F) (image A) (image B) *) intros A B H'; try assumption. (* Goal: @included F (image A) (image B) *) unfold included in |- *. (* Goal: forall (x : Carrier F) (_ : @in_part F x (image A)), @in_part F x (image B) *) intros x H'0; try assumption. (* Goal: @in_part F x (image B) *) elim H'0. (* Goal: forall (x0 : Carrier E) (_ : and (@in_part E x0 A) (@Equal F x (@Ap E F f x0))), @in_part F x (image B) *) intros x0 H'1; try assumption. (* Goal: @in_part F x (image B) *) apply in_image with (x := x0); auto with algebra. (* Goal: @in_part E x0 B *) (* Goal: @Equal F x (@Ap E F f x0) *) red in H'. (* Goal: @in_part E x0 B *) (* Goal: @Equal F x (@Ap E F f x0) *) elim H'1. (* Goal: forall (subtype_elt : Carrier E) (_ : @Pred_fun E A subtype_elt) (subtype_elt0 : Carrier E) (_ : @Pred_fun E A subtype_elt0) (_ : @Equal E subtype_elt0 subtype_elt), @Equal F (@Ap E F f subtype_elt0) (@Ap E F f subtype_elt) *) auto with algebra. (* Goal: forall (subtype_elt : Carrier E) (_ : @Pred_fun E A subtype_elt) (subtype_elt0 : Carrier E) (_ : @Pred_fun E A subtype_elt0) (_ : @Equal E subtype_elt0 subtype_elt), @Equal F (@Ap E F f subtype_elt0) (@Ap E F f subtype_elt) *) elim H'1; auto with algebra. Qed. Hint Resolve image_included: algebra. Lemma image_comp : forall A B : part_set E, Equal A B -> Equal (image A) (image B). (* Goal: forall (A B : Carrier (part_set E)) (_ : @Equal (part_set E) A B), @Equal (part_set F) (image A) (image B) *) intros A B H'; try assumption. (* Goal: forall (subtype_elt : Carrier E) (_ : @Pred_fun E A subtype_elt) (subtype_elt0 : Carrier E) (_ : @Pred_fun E A subtype_elt0) (_ : @Equal E subtype_elt0 subtype_elt), @Equal F (@Ap E F f subtype_elt0) (@Ap E F f subtype_elt) *) apply included_antisym; auto with algebra. Qed. Hint Resolve image_comp: algebra. Lemma image_in_image : forall (A : part_set E) (x : E), in_part x A -> in_part (f x) (image A). (* Goal: forall (A : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x A), @in_part F (@Ap E F f x) (image A) *) simpl in |- *; auto with algebra. (* Goal: forall (A : Predicate E) (x : Carrier E) (_ : @in_part E x A), @ex (Carrier E) (fun x0 : Carrier E => and (@in_part E x0 A) (@Equal F (@Ap E F f x) (@Ap E F f x0))) *) intros A x H'; try assumption. (* Goal: @ex (Carrier E) (fun x0 : Carrier E => and (@in_part E x0 A) (@Equal F (@Ap E F f x) (@Ap E F f x0))) *) exists x; split; [ try assumption | idtac ]; auto with algebra. Qed. Hint Resolve image_in_image: algebra. Definition image_map := image (full E). Let surj_set_image_fun : E -> image_map. (* Goal: forall _ : Carrier E, Carrier (@set_of_subtype_image F (@part F image_map)) *) intros x; try assumption. (* Goal: forall y : @subtype F image_map, @ex (Carrier E) (fun x : Carrier E => @Equal F (@subtype_elt F image_map y) (@Ap E F f x)) *) unfold image_map in |- *. (* Goal: forall (subtype_elt0 : Carrier E) (subtype_prf : @Pred_fun E A subtype_elt0) (subtype_elt1 : Carrier E) (subtype_prf0 : @Pred_fun E A subtype_elt1) (_ : @Equal E (@subtype_elt E A (@Build_subtype E A subtype_elt1 subtype_prf0)) (@subtype_elt E A (@Build_subtype E A subtype_elt0 subtype_prf))), @Equal F (@subtype_elt F (image A) (@surj_part_image_fun A (@Build_subtype E A subtype_elt1 subtype_prf0))) (@subtype_elt F (image A) (@surj_part_image_fun A (@Build_subtype E A subtype_elt0 subtype_prf))) *) simpl in |- *. (* Goal: @subtype F (image (full E)) *) cut (in_part (f x) (image (full E))). (* Goal: forall _ : @in_part F (@Ap E F f x) (image (full E)), @subtype F (image (full E)) *) (* Goal: @in_part F (@Ap E F f x) (image (full E)) *) intros H'; try assumption. (* Goal: @subtype F (image (full E)) *) (* Goal: @in_part F (@Ap E F f x) (image (full E)) *) apply (Build_subtype (P:=image (full E)) (subtype_elt:=f x) H'). (* Goal: forall (subtype_elt : Carrier E) (_ : @Pred_fun E A subtype_elt) (subtype_elt0 : Carrier E) (_ : @Pred_fun E A subtype_elt0) (_ : @Equal E subtype_elt0 subtype_elt), @Equal F (@Ap E F f subtype_elt0) (@Ap E F f subtype_elt) *) auto with algebra. Defined. Definition surj_set_image : MAP E image_map. (* Goal: Carrier (MAP E (@set_of_subtype_image F (@part F image_map))) *) apply (Build_Map (Ap:=surj_set_image_fun)). (* Goal: forall A : Carrier (part_set E), @surjective (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image F (@part F (image A))) (surj_part_image A) *) red in |- *. (* Goal: forall (subtype_elt0 : Carrier E) (subtype_prf : @Pred_fun E A subtype_elt0) (subtype_elt1 : Carrier E) (subtype_prf0 : @Pred_fun E A subtype_elt1) (_ : @Equal E (@subtype_elt E A (@Build_subtype E A subtype_elt1 subtype_prf0)) (@subtype_elt E A (@Build_subtype E A subtype_elt0 subtype_prf))), @Equal F (@subtype_elt F (image A) (@surj_part_image_fun A (@Build_subtype E A subtype_elt1 subtype_prf0))) (@subtype_elt F (image A) (@surj_part_image_fun A (@Build_subtype E A subtype_elt0 subtype_prf))) *) simpl in |- *. (* Goal: forall (x y : @subtype E A) (_ : @subtype_image_equal E (@subtype E A) (@subtype_elt E A) x y), @subtype_image_equal F (@subtype F (image A)) (@subtype_elt F (image A)) (@surj_part_image_fun A x) (@surj_part_image_fun A y) *) unfold subtype_image_equal in |- *. (* Goal: forall (subtype_elt0 : Carrier E) (subtype_prf : @Pred_fun E A subtype_elt0) (subtype_elt1 : Carrier E) (subtype_prf0 : @Pred_fun E A subtype_elt1) (_ : @Equal E (@subtype_elt E A (@Build_subtype E A subtype_elt1 subtype_prf0)) (@subtype_elt E A (@Build_subtype E A subtype_elt0 subtype_prf))), @Equal F (@subtype_elt F (image A) (@surj_part_image_fun A (@Build_subtype E A subtype_elt1 subtype_prf0))) (@subtype_elt F (image A) (@surj_part_image_fun A (@Build_subtype E A subtype_elt0 subtype_prf))) *) simpl in |- *. (* Goal: forall (subtype_elt : Carrier E) (_ : @Pred_fun E A subtype_elt) (subtype_elt0 : Carrier E) (_ : @Pred_fun E A subtype_elt0) (_ : @Equal E subtype_elt0 subtype_elt), @Equal F (@Ap E F f subtype_elt0) (@Ap E F f subtype_elt) *) auto with algebra. Defined. Lemma surj_set_image_surjective : surjective surj_set_image. (* Goal: forall A : Carrier (part_set E), @surjective (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image F (@part F (image A))) (surj_part_image A) *) red in |- *. (* Goal: forall (subtype_elt0 : Carrier E) (subtype_prf : @Pred_fun E A subtype_elt0) (subtype_elt1 : Carrier E) (subtype_prf0 : @Pred_fun E A subtype_elt1) (_ : @Equal E (@subtype_elt E A (@Build_subtype E A subtype_elt1 subtype_prf0)) (@subtype_elt E A (@Build_subtype E A subtype_elt0 subtype_prf))), @Equal F (@subtype_elt F (image A) (@surj_part_image_fun A (@Build_subtype E A subtype_elt1 subtype_prf0))) (@subtype_elt F (image A) (@surj_part_image_fun A (@Build_subtype E A subtype_elt0 subtype_prf))) *) simpl in |- *. (* Goal: forall (x y : @subtype E A) (_ : @subtype_image_equal E (@subtype E A) (@subtype_elt E A) x y), @subtype_image_equal F (@subtype F (image A)) (@subtype_elt F (image A)) (@surj_part_image_fun A x) (@surj_part_image_fun A y) *) unfold subtype_image_equal in |- *. (* Goal: forall (subtype_elt0 : Carrier E) (subtype_prf : @Pred_fun E A subtype_elt0) (subtype_elt1 : Carrier E) (subtype_prf0 : @Pred_fun E A subtype_elt1) (_ : @Equal E (@subtype_elt E A (@Build_subtype E A subtype_elt1 subtype_prf0)) (@subtype_elt E A (@Build_subtype E A subtype_elt0 subtype_prf))), @Equal F (@subtype_elt F (image A) (@surj_part_image_fun A (@Build_subtype E A subtype_elt1 subtype_prf0))) (@subtype_elt F (image A) (@surj_part_image_fun A (@Build_subtype E A subtype_elt0 subtype_prf))) *) simpl in |- *. (* Goal: forall y : @subtype F image_map, @ex (Carrier E) (fun x : Carrier E => @Equal F (@subtype_elt F image_map y) (@Ap E F f x)) *) unfold image_map in |- *. (* Goal: forall y : @subtype F (image (full E)), @ex (Carrier E) (fun x : Carrier E => @Equal F (@subtype_elt F (image (full E)) y) (@Ap E F f x)) *) intros y; try assumption. (* Goal: forall (subtype_elt0 : Carrier E) (subtype_prf : @Pred_fun E A subtype_elt0) (_ : @Equal E (@subtype_elt E A (@Build_subtype E A subtype_elt0 subtype_prf)) (@subtype_elt E A y)), @Equal F (@subtype_elt F (image A) (@surj_part_image_fun A (@Build_subtype E A subtype_elt0 subtype_prf))) (@subtype_elt F (image A) (@surj_part_image_fun A y)) *) elim y. (* Goal: forall (subtype_elt0 : Carrier F) (subtype_prf : @Pred_fun F (image (full E)) subtype_elt0), @ex (Carrier E) (fun x : Carrier E => @Equal F (@subtype_elt F (image (full E)) (@Build_subtype F (image (full E)) subtype_elt0 subtype_prf)) (@Ap E F f x)) *) intros x' subtype_prf; try assumption. (* Goal: @ex (Carrier E) (fun x : Carrier E => @Equal F (@subtype_elt F (image (full E)) (@Build_subtype F (image (full E)) x' subtype_prf)) (@Ap E F f x)) *) elim subtype_prf. (* Goal: forall (x : Carrier E) (_ : and (@in_part E x A) (@Equal F (@subtype_elt F (image A) y) (@Ap E F f x))), @ex (Carrier (@set_of_subtype_image E (@part E A))) (fun x0 : Carrier (@set_of_subtype_image E (@part E A)) => @Equal (@set_of_subtype_image F (@part F (image A))) y (@Ap (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image F (@part F (image A))) (surj_part_image A) x0)) *) intros x H'; try assumption. (* Goal: @ex (Carrier E) (fun x : Carrier E => @Equal F (@subtype_elt F (image (full E)) (@Build_subtype F (image (full E)) x' subtype_prf)) (@Ap E F f x)) *) exists x; try assumption. (* Goal: @ex (Carrier (@set_of_subtype_image E (@part E A))) (fun x : Carrier (@set_of_subtype_image E (@part E A)) => @Equal (@set_of_subtype_image F (@part F (image A))) y (@Ap (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image F (@part F (image A))) (surj_part_image A) x)) *) elim H'; intros H'0 H'1; try exact H'1; clear H'. Qed. Let surj_part_image_fun : forall A : part_set E, A -> image A. (* Goal: forall (A : Carrier (part_set E)) (_ : Carrier (@set_of_subtype_image E (@part E A))), Carrier (@set_of_subtype_image F (@part F (image A))) *) intros A x; try assumption. (* Goal: forall _ : @Equal E (@subtype_elt E A x) (@subtype_elt E A y), @Equal F (@subtype_elt F (image A) (@surj_part_image_fun A x)) (@subtype_elt F (image A) (@surj_part_image_fun A y)) *) elim x. (* Goal: forall (subtype_elt : Carrier E) (_ : @Pred_fun E A subtype_elt), Carrier (@set_of_subtype_image F (@part F (image A))) *) intros x' H'; try assumption. (* Goal: Carrier (@set_of_subtype_image F (@part F (image A))) *) cut (in_part (f x') (image A)). (* Goal: forall _ : @in_part F (@Ap E F f x') (image A), Carrier (@set_of_subtype_image F (@part F (image A))) *) (* Goal: @in_part F (@Ap E F f x') (image A) *) intros H'0; try assumption. (* Goal: forall (subtype_elt0 : Carrier E) (subtype_prf : @Pred_fun E A subtype_elt0) (subtype_elt1 : Carrier E) (subtype_prf0 : @Pred_fun E A subtype_elt1) (_ : @Equal E (@subtype_elt E A (@Build_subtype E A subtype_elt1 subtype_prf0)) (@subtype_elt E A (@Build_subtype E A subtype_elt0 subtype_prf))), @Equal F (@subtype_elt F (image A) (@surj_part_image_fun A (@Build_subtype E A subtype_elt1 subtype_prf0))) (@subtype_elt F (image A) (@surj_part_image_fun A (@Build_subtype E A subtype_elt0 subtype_prf))) *) simpl in |- *. (* Goal: @subtype F (image A) *) (* Goal: @in_part F (@Ap E F f x') (image A) *) apply (Build_subtype (P:=image A) (subtype_elt:=f x') H'0). (* Goal: forall (subtype_elt : Carrier E) (_ : @Pred_fun E A subtype_elt) (subtype_elt0 : Carrier E) (_ : @Pred_fun E A subtype_elt0) (_ : @Equal E subtype_elt0 subtype_elt), @Equal F (@Ap E F f subtype_elt0) (@Ap E F f subtype_elt) *) auto with algebra. Defined. Definition surj_part_image : forall A : part_set E, MAP A (image A). (* Goal: forall A : Carrier (part_set E), Carrier (MAP (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image F (@part F (image A)))) *) intros A; try assumption. (* Goal: Carrier (MAP (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image F (@part F (image A)))) *) apply (Build_Map (Ap:=surj_part_image_fun (A:=A))). (* Goal: forall A : Carrier (part_set E), @surjective (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image F (@part F (image A))) (surj_part_image A) *) red in |- *. (* Goal: forall (subtype_elt0 : Carrier E) (subtype_prf : @Pred_fun E A subtype_elt0) (subtype_elt1 : Carrier E) (subtype_prf0 : @Pred_fun E A subtype_elt1) (_ : @Equal E (@subtype_elt E A (@Build_subtype E A subtype_elt1 subtype_prf0)) (@subtype_elt E A (@Build_subtype E A subtype_elt0 subtype_prf))), @Equal F (@subtype_elt F (image A) (@surj_part_image_fun A (@Build_subtype E A subtype_elt1 subtype_prf0))) (@subtype_elt F (image A) (@surj_part_image_fun A (@Build_subtype E A subtype_elt0 subtype_prf))) *) simpl in |- *. (* Goal: forall (x y : @subtype E A) (_ : @subtype_image_equal E (@subtype E A) (@subtype_elt E A) x y), @subtype_image_equal F (@subtype F (image A)) (@subtype_elt F (image A)) (@surj_part_image_fun A x) (@surj_part_image_fun A y) *) unfold subtype_image_equal in |- *. (* Goal: forall (x y : @subtype E A) (_ : @Equal E (@subtype_elt E A x) (@subtype_elt E A y)), @Equal F (@subtype_elt F (image A) (@surj_part_image_fun A x)) (@subtype_elt F (image A) (@surj_part_image_fun A y)) *) intros x y; try assumption. (* Goal: forall _ : @Equal E (@subtype_elt E A x) (@subtype_elt E A y), @Equal F (@subtype_elt F (image A) (@surj_part_image_fun A x)) (@subtype_elt F (image A) (@surj_part_image_fun A y)) *) elim x. (* Goal: forall (subtype_elt0 : Carrier E) (subtype_prf : @Pred_fun E A subtype_elt0) (_ : @Equal E (@subtype_elt E A (@Build_subtype E A subtype_elt0 subtype_prf)) (@subtype_elt E A y)), @Equal F (@subtype_elt F (image A) (@surj_part_image_fun A (@Build_subtype E A subtype_elt0 subtype_prf))) (@subtype_elt F (image A) (@surj_part_image_fun A y)) *) elim y. (* Goal: forall (subtype_elt0 : Carrier E) (subtype_prf : @Pred_fun E A subtype_elt0) (subtype_elt1 : Carrier E) (subtype_prf0 : @Pred_fun E A subtype_elt1) (_ : @Equal E (@subtype_elt E A (@Build_subtype E A subtype_elt1 subtype_prf0)) (@subtype_elt E A (@Build_subtype E A subtype_elt0 subtype_prf))), @Equal F (@subtype_elt F (image A) (@surj_part_image_fun A (@Build_subtype E A subtype_elt1 subtype_prf0))) (@subtype_elt F (image A) (@surj_part_image_fun A (@Build_subtype E A subtype_elt0 subtype_prf))) *) simpl in |- *. (* Goal: forall (subtype_elt : Carrier E) (_ : @Pred_fun E A subtype_elt) (subtype_elt0 : Carrier E) (_ : @Pred_fun E A subtype_elt0) (_ : @Equal E subtype_elt0 subtype_elt), @Equal F (@Ap E F f subtype_elt0) (@Ap E F f subtype_elt) *) auto with algebra. Defined. Lemma surj_part_image_surjective : forall A : part_set E, surjective (surj_part_image A). (* Goal: forall A : Carrier (part_set E), @surjective (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image F (@part F (image A))) (surj_part_image A) *) red in |- *. (* Goal: forall (A : Carrier (part_set E)) (y : Carrier (@set_of_subtype_image F (@part F (image A)))), @ex (Carrier (@set_of_subtype_image E (@part E A))) (fun x : Carrier (@set_of_subtype_image E (@part E A)) => @Equal (@set_of_subtype_image F (@part F (image A))) y (@Ap (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image F (@part F (image A))) (surj_part_image A) x)) *) intros A y; try assumption. (* Goal: @ex (Carrier (@set_of_subtype_image E (@part E A))) (fun x : Carrier (@set_of_subtype_image E (@part E A)) => @Equal (@set_of_subtype_image F (@part F (image A))) y (@Ap (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image F (@part F (image A))) (surj_part_image A) x)) *) case (image_in (subtype_prf y)). (* Goal: forall (x : Carrier E) (_ : and (@in_part E x A) (@Equal F (@subtype_elt F (image A) y) (@Ap E F f x))), @ex (Carrier (@set_of_subtype_image E (@part E A))) (fun x0 : Carrier (@set_of_subtype_image E (@part E A)) => @Equal (@set_of_subtype_image F (@part F (image A))) y (@Ap (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image F (@part F (image A))) (surj_part_image A) x0)) *) intros x H'; try assumption. (* Goal: @ex (Carrier (@set_of_subtype_image E (@part E A))) (fun x : Carrier (@set_of_subtype_image E (@part E A)) => @Equal (@set_of_subtype_image F (@part F (image A))) y (@Ap (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image F (@part F (image A))) (surj_part_image A) x)) *) elim H'; intros H'0 H'1; try exact H'1; clear H'. (* Goal: @ex (Carrier (@set_of_subtype_image E (@part E A))) (fun x : Carrier (@set_of_subtype_image E (@part E A)) => @Equal (@set_of_subtype_image F (@part F (image A))) y (@Ap (@set_of_subtype_image E (@part E A)) (@set_of_subtype_image F (@part F (image A))) (surj_part_image A) x)) *) exists (Build_subtype H'0); try assumption. Qed. End Images1. Hint Resolve in_image image_included image_comp image_in_image surj_set_image_surjective surj_part_image_surjective: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Module_kernel. Require Export Free_module. Section Generated_module_def. Variable R : RING. Variable Mod : MODULE R. Variable A : part_set Mod. Definition generated_module : submodule Mod := coKer (FMd_lift (inj_part A)). End Generated_module_def. Lemma generated_module_minimal : forall (R : RING) (Mod : MODULE R) (A : part_set Mod) (H : submodule Mod), included A H -> included (generated_module A) H. (* Goal: forall (R : Ob RING) (Mod : Ob (MODULE R)) (A : Carrier (part_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))))), @included (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod (@generated_module R Mod A))))) *) unfold included in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Var R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A x H'))) *) simpl in |- *. (* Goal: forall (R : ring) (Mod : module R) (A : Predicate (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (H : @submodule R Mod) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x A), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) x0)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) intros R Mod A H H' x H'0; try assumption. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) elim H'0; intros x0; clear H'0. (* Goal: forall _ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) x0)), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) generalize x; clear x. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) x0))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) elim x0. (* Goal: forall (c : Carrier (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Var R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (f0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f0))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Law R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f f0)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) intros c; try assumption. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Var R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (f0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f0))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Law R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f f0)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) elim c. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Var R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A x H'))) *) simpl in |- *. intros y subtype_prf x H'0; elim H'0; intros H'1 H'2; try exact H'2; clear H'0. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (f0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f0))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Law R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f f0)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) apply in_part_comp_l with y; auto with algebra. (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (f0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f0))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Law R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f f0)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) intros f H'0 f0 H'1 x H'2; elim H'2; intros H'3 H'4; try exact H'4; clear H'2. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) simpl in H'4. apply in_part_comp_l with (sgroup_law Mod (FMd_lift_fun (inj_part A) f) (* Goal: True *) (FMd_lift_fun (inj_part A) f0)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Var R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A x H'))) *) simpl in |- *. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod))))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) intros x H'0; elim H'0; intros H'1 H'2; try exact H'2; clear H'0. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) apply in_part_comp_l with (monoid_unit Mod); auto with algebra. (* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) intros f H'0 x H'1; try assumption. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) elim H'1; intros H'2 H'3; simpl in H'3; clear H'1. apply in_part_comp_l with (group_inverse Mod (FMd_lift_fun (inj_part A) f)); (* Goal: True *) auto with algebra. (* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) intros c f H'0 x H'1; try assumption. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) simpl in H'1. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod H)))) *) elim H'1; intros H'2 H'3; try exact H'3; clear H'1. apply in_part_comp_l with (module_mult c (FMd_lift_fun (inj_part A) f)); (* Goal: True *) auto with algebra. Qed. Lemma generated_module_prop_included : forall (R : RING) (Mod : MODULE R) (A : part_set Mod), included A (generated_module A). (* Goal: forall (R : Ob RING) (Mod : Ob (MODULE R)) (A : Carrier (part_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))))), @included (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod (@generated_module R Mod A))))) *) unfold included in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Var R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A x H'))) *) simpl in |- *. (* Goal: forall (R : ring) (Mod : module R) (A : Predicate (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x A), @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) x0))) *) intros R Mod A x H'; try assumption. exists (Var R (V:=A) (Build_subtype (E:=Mod) (P:=A) (subtype_elt:=x) H')); split; [ idtac | try assumption ]. (* Goal: True *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Var R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A x H'))) *) simpl in |- *. (* Goal: True *) auto with algebra. Qed. Lemma generated_module_prop : forall (R : RING) (Mod : MODULE R) (A : part_set Mod) (y : Mod), in_part y (generated_module A) -> exists x : FMd R A, Equal y (FMd_lift (inj_part A) x). (* Goal: True *) simpl in |- *; auto with algebra. (* Goal: forall (R : Ob RING) (Mod : Ob (MODULE R)) (A : Carrier (part_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))))) (y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (fun x : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) y (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (FreeModule R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (FreeModule R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (FreeModule R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)))))) (group_monoid (abelian_group_group (@module_carrier R Mod))) (@module_monoid_hom R (FreeModule R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) Mod (@FMd_lift R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))))) x))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) y (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod (@generated_module R Mod A))))) *) intros R Mod A y H'; try assumption. (* Goal: @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (fun x : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) y (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) x)) *) elim H'; intros x E; elim E; intros H'0 H'1; try exact H'1; clear E H'. (* Goal: @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (fun x : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) y (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) x)) *) exists x; try assumption. Qed. Lemma generated_module_prop_rev : forall (R : RING) (Mod : MODULE R) (A : part_set Mod) (y : Mod), (exists x : FMd R A, Equal y (FMd_lift (inj_part A) x)) -> in_part y (generated_module A). (* Goal: forall (R : Ob RING) (Mod : Ob (MODULE R)) (A : Carrier (part_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))))) (y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (fun x : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) y (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (FreeModule R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (FreeModule R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (FreeModule R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)))))) (group_monoid (abelian_group_group (@module_carrier R Mod))) (@module_monoid_hom R (FreeModule R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) Mod (@FMd_lift R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))))) x))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) y (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod (@generated_module R Mod A))))) *) intros R Mod A y H'; try assumption. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) y (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod (@generated_module R Mod A))))) *) elim H'; intros x E; try exact E; clear H'. (* Goal: True *) simpl in |- *; auto with algebra. (* Goal: @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (fun x : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) y (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) x))) *) exists x; split; [ idtac | try assumption ]. (* Goal: True *) auto with algebra. Qed. Hint Resolve generated_module_minimal generated_module_prop_included generated_module_prop_rev: algebra.
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) Set Implicit Arguments. Unset Strict Implicit. Require Export Sgroup_cat. Section Lemmas. Variable E : SGROUP. Lemma SGROUP_assoc : forall x y z : E, Equal (sgroup_law _ (sgroup_law _ x y) z) (sgroup_law _ x (sgroup_law _ y z)). (* Goal: forall x y z : Carrier (sgroup_set E), @Equal (sgroup_set E) (sgroup_law E (sgroup_law E x y) z) (sgroup_law E x (sgroup_law E y z)) *) intros x y z; try assumption. (* Goal: @Equal (sgroup_set E) (sgroup_law E (sgroup_law E x y) z) (sgroup_law E x (sgroup_law E y z)) *) apply (sgroup_assoc_prf E x y z); auto with algebra. Qed. Lemma SGROUP_comp : forall x x' y y' : E, Equal x x' -> Equal y y' -> Equal (sgroup_law _ x y) (sgroup_law _ x' y'). (* Goal: forall (x x' y y' : Carrier (sgroup_set E)) (_ : @Equal (sgroup_set E) x x') (_ : @Equal (sgroup_set E) y y'), @Equal (sgroup_set E) (sgroup_law E x y) (sgroup_law E x' y') *) unfold sgroup_law in |- *; auto with algebra. Qed. Variable F : SGROUP. Variable f : Hom E F. Lemma SGROUP_hom_prop : forall x y : E, Equal (f (sgroup_law _ x y)) (sgroup_law _ (f x) (f y)). (* Goal: forall x y : Carrier (sgroup_set E), @Equal (sgroup_set F) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) (sgroup_law E x y)) (sgroup_law F (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y)) *) intros x y; try assumption. (* Goal: @Equal (sgroup_set F) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) (sgroup_law E x y)) (sgroup_law F (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y)) *) apply (sgroup_hom_prf f). Qed. End Lemmas. Hint Resolve SGROUP_assoc SGROUP_comp SGROUP_hom_prop: algebra.
(* Contribution to the Coq Library V6.3 (July 1999) *) (****************************************************************************) (* The Calculus of Inductive Constructions *) (* *) (* Projet Coq *) (* *) (* INRIA ENS-CNRS *) (* Rocquencourt Lyon *) (* *) (* Coq V5.11 *) (* Feb 2nd 1996 *) (* *) (* (notations and layout updated March 2009) *) (****************************************************************************) (* Setminus_fact.v *) (****************************************************************************) (* This file is distributed under the terms of the *) (* GNU Lesser General Public License Version 2.1 *) (****************************************************************************) Require Import Ensembles. (* Ensemble, In, Included, Setminus *) Section Contravariance_of_Setminus. Variable U : Type. Lemma Setminus_contravariant : forall A B B' : Ensemble U, Included U B' B -> Included U (Setminus U A B) (Setminus U A B'). (* Goal: forall (A B B' : Ensemble U) (_ : Included U B' B), Included U (Setminus U A B) (Setminus U A B') *) intros A B B' B'_Included_B; unfold Setminus in |- *. (* Goal: Included U (fun x : U => and (In U A x) (not (In U B x))) (fun x : U => and (In U A x) (not (In U B' x))) *) red in |- *; intros x x_in_B. (* Goal: In U (fun x : U => and (In U A x) (not (In U B' x))) x *) elim x_in_B; intros x_in_A x_in_nonB. (* Goal: In U (fun x : U => and (In U A x) (not (In U B' x))) x *) split. (* Goal: In U B' x *) assumption. (* Goal: not (In U B' x) *) red in |- *; intro x_in_B'. (* Goal: False *) apply x_in_nonB. (* Goal: In U B x *) apply B'_Included_B. (* Goal: In U B' x *) assumption. Qed. End Contravariance_of_Setminus. (* $Id$ *)
(* Contribution to the Coq Library V6.3 (July 1999) *) (****************************************************************************) (* The Calculus of Inductive Constructions *) (* *) (* Projet Coq *) (* *) (* INRIA ENS-CNRS *) (* Rocquencourt Lyon *) (* *) (* Coq V5.11 *) (* Feb 2nd 1996 *) (* *) (* (notations and layout updated March 2009) *) (****************************************************************************) (* Functions.v *) (****************************************************************************) (* This file is distributed under the terms of the *) (* GNU Lesser General Public License Version 2.1 *) (****************************************************************************) Require Import Ensembles. (* Ensemble, In, Included, Setminus *) Require Import Relations_1. (* Relation *) (****************************************************************************) (** In contrast with the definition of functions in Relations_1, we *) (** consider, here, functions as binary relations *) Section Functions. Variable U : Type. (****************************************************************************) (** Characterization of a relation over two sets *) Inductive Rel (U : Type) (A B : Ensemble U) (R : Relation U) : Prop := Rel_intro : (forall x y : U, R x y -> In U A x) -> (forall x y : U, R x y -> In U B y) -> Rel U A B R. (****************************************************************************) (** Image of a set through a relation *) Section Image. Inductive Im (R : Relation U) (A : Ensemble U) (y : U) : Prop := Im_intro : forall x : U, R x y -> In U A x -> Im R A y. Lemma Im_stable_par_incl : forall (R : Relation U) (A1 A2 : Ensemble U), Included U A1 A2 -> Included U (Im R A1) (Im R A2). do 3 intro; intros A1_Included_A2; red in |- *; red in |- *; intros x x_in_Im_A1. (* Goal: Im R A2 x *) elim x_in_Im_A1. (* Goal: forall (x0 : U) (_ : R x0 x) (_ : In U A1 x0), Im R A2 x *) intros. (* Goal: Im R A2 x *) apply Im_intro with x0; try assumption. (* Goal: In U A2 x0 *) apply A1_Included_A2; assumption. Qed. End Image. Variable A B : Ensemble U. Variable f : Relation U. Definition to_at_most_one_output := forall x y z : U, f x y -> f x z -> y = z. Definition to_at_least_one_output := forall x : U, In U A x -> exists y, f x y. Definition from_at_most_one_input := forall x y z : U, f x z -> f y z -> x = y. Definition from_at_least_one_input := forall y : U, In U B y -> exists x, f x y. Inductive function : Prop := (* fun_in *) function_intro : Rel U A B f -> to_at_most_one_output -> to_at_least_one_output -> function. Inductive surjection : Prop := (* fun_on *) surjection_intro : Rel U A B f -> to_at_most_one_output -> to_at_least_one_output -> from_at_least_one_input -> surjection. Inductive injection : Prop := (* map_in *) injection_intro : Rel U A B f -> to_at_most_one_output -> to_at_least_one_output -> from_at_most_one_input -> injection. Inductive bijection : Prop := (* map_on *) bijection_intro : Rel U A B f -> to_at_most_one_output -> to_at_least_one_output -> from_at_most_one_input -> from_at_least_one_input -> bijection. End Functions. (* $Id$ *)
(* Contribution to the Coq Library V6.3 (July 1999) *) (****************************************************************************) (* The Calculus of Inductive Constructions *) (* *) (* Projet Coq *) (* *) (* INRIA ENS-CNRS *) (* Rocquencourt Lyon *) (* *) (* Coq V5.11 *) (* Feb 2nd 1996 *) (* *) (* (notations and layout updated March 2009) *) (****************************************************************************) (* Schroeder.v *) (****************************************************************************) (* This file is distributed under the terms of the *) (* GNU Lesser General Public License Version 2.1 *) (****************************************************************************) (** If A is of cardinal less than B and conversely, then A and B *) (** are equipollent *) (** In other words, if there is an injective map from A to B and *) (** an injective map from B to A then there exists a map from A onto B. *) (** (based on a proof by Fraenkel) *) Set Nested Proofs Allowed. Require Import Ensembles. (* Ensemble, In, Included, Setminus *) Require Import Relations_1. (* Relation, Transitive *) Require Import Powerset. (* Inclusion_is_transitive *) Require Import Classical_Prop. (* classic *) Require Import Setminus_fact. Require Import Sums. Require Import Functions. Require Import Equipollence. Section Schroeder_Bernstein. (****************************************************************************) (** We need the decidability of the belonging relation on sets *) (** This is equivalent to classical logic *) Definition in_or_not_in (U : Type) (x : U) (A : Ensemble U) := classic (In U A x). (****************************************************************************) (** A and B are sets of elements in the univers U *) Variable U : Type. Let SU := Ensemble U. Variable A B : SU. (* A and B are sets of elements in the univers U *) Section Bijection. (**************************************************************************) (** We now show that if f and g are injections resp from A to B and from *) (** B to A, then there is a subset J of A s.t. h, defined to be f on A *) (** and the converse of g on A\J is a bijection from A to B *) Variable f g : Relation U. (* f and g are relations *) Hypothesis f_inj : injection U A B f. (* f and g are injections *) Hypothesis g_inj : injection U B A g. Let Imf : Ensemble U -> Ensemble U := Im U f. Let Img : Ensemble U -> Ensemble U := Im U g. (** Constructing J s.t. g(B\f(J))=A\J *) (** (Setminus U A C) denotes the difference A\C *) (** (Included U A C) means that A is included in C *) Let F (C : SU) := Setminus U A (Img (Setminus U B (Imf C))). Let D (C : SU) := Included U C (F C). Let J := Set_Sum U D. (** We show that so-built J is the subset we are looking for *) (** J is Tarski's fix-point of F, a function which is growing *) (** w.r.t. inclusion *) (** Lemma: F is growing *) Lemma F_growing : forall C C' : SU, Included U C C' -> Included U (F C) (F C'). Proof. (* Goal: forall (C C' : SU) (_ : Included U C C'), Included U (F C) (F C') *) intros; unfold F in |- *. (* Goal: Included U (Setminus U B (Imf C')) (Setminus U B (Imf C)) *) apply Setminus_contravariant. (* Goal: Included U (Img (Setminus U B (Imf C'))) (Img (Setminus U B (Imf C))) *) unfold Img in |- *. (* Goal: Included U (Im U f C) (Im U f C') *) apply Im_stable_par_incl. (* Goal: Included U (Setminus U B (Imf C')) (Setminus U B (Imf C)) *) apply Setminus_contravariant. (* Goal: Included U (Imf C) (Imf C') *) unfold Imf in |- *. (* Goal: Included U (Im U f C) (Im U f C') *) apply Im_stable_par_incl. (* Goal: Included U C C' *) assumption. Qed. (** We show F(J)=A\Img(B\Imf(J))=J *) (** First left-to-right inclusion *) (** Lemma: J_is_in_FJ (Included U J (F J)) *) Lemma J_is_in_FJ : Included U J (F J). Proof. (* Goal: Included U (F J) J *) unfold J in |- *. apply Set_Sum_is_majoring. intros C C_in_D. cut (Transitive (Ensemble U) (Included U)). 2: apply Inclusion_is_transitive. intro Incl_is_trans. unfold Transitive in Incl_is_trans. apply Incl_is_trans with (F C). (* Show C subset of (F C) *) (* Goal: Included U C C' *) assumption. (* Show (F C) subset of (F (Set_Sum U D)) *) (* Goal: Included U (F (Set_Sum U D)) (F (F (Set_Sum U D))) *) apply F_growing. (* Goal: Included U (F (Set_Sum U D)) (Set_Sum U D) *) apply Set_Sum_is_minoring. (* Goal: Included U C C' *) assumption. Qed. (** Then right-to-left inclusion *) (** Lemma: FJ_is_in_J (Included U (F J) J) *) Lemma FJ_is_in_J : Included U (F J) J. Proof. (* Goal: Included U (F J) J *) unfold J in |- *. (* Goal: Included U (F (Set_Sum U D)) (Set_Sum U D) *) apply Set_Sum_is_minoring. (* Goal: D (F (Set_Sum U D)) *) red in |- *. (* Goal: D (F (Set_Sum U D)) *) red in |- *. (* Goal: Included U (F (Set_Sum U D)) (F (F (Set_Sum U D))) *) apply F_growing. (* Goal: Included U (Set_Sum U D) (F (Set_Sum U D)) *) exact J_is_in_FJ. Qed. (** We show that h, which is f on J and g elsewhere, is a bijection *) Inductive h (x y : U) : Prop := | hl_intro : In U J x -> f x y -> h x y | hr_intro : Setminus U B (Imf J) y -> g y x -> h x y. (** Theorem: h_bij (bijection U A B h) *) Theorem h_bij : bijection U A B h. (** h is from A to B *) Lemma h1 : Rel U A B h. Proof. apply Rel_intro; do 2 intro; intro h_x_y. (* h is on A *) elim h_x_y. (* on J : f is from A to B *) elim f_inj. intro f_Rel; intros. elim f_Rel. intros f_sur_A f_sur_B. (* Goal: Included U C C' *) apply f_sur_A with y; assumption. (* on A\J: g is from B to A *) elim g_inj. intro g_Rel; intros. elim g_Rel. intros g_sur_B g_sur_A. (* Goal: Included U C C' *) apply g_sur_A with y; assumption. (* h is on B *) elim h_x_y. (* On J : f is from A to B *) elim f_inj. intro f_Rel; intros. elim f_Rel. intros f_sur_A f_sur_B. (* Goal: Included U C C' *) apply f_sur_B with x; assumption. (* On A\J: g is from B to A *) elim g_inj. intro g_Rel; intros. elim g_Rel. intros g_sur_B g_sur_A. (* Goal: Included U C C' *) apply g_sur_B with x; assumption. Qed. (** h satisfies to_at_most_one_output *) Lemma h2 : to_at_most_one_output U h. Proof. red in |- *; intros x y z h_x_y h_x_z. elim h_x_y. (* on J *) elim h_x_z. (* case when (h x y) or (h x z) behaves as f: ok *) elim f_inj. unfold to_at_most_one_output in |- *; intros f_Rel f_au_plus_1_im; intros. (* Goal: Included U C C' *) apply f_au_plus_1_im with x; assumption. (* case when (h x y) behaves as f and (h x z) as g: contradiction *) do 2 intro; intro x_in_J; intro. cut (Included U J (F J)). unfold Included in |- *; unfold F in |- *; unfold Setminus in |- *; intro Hyp. elim (Hyp x x_in_J). intros x_in_A x_in_non_Img. elim x_in_non_Img. (* Goal: D (F (Set_Sum U D)) *) red in |- *. (* Goal: D (F (Set_Sum U D)) *) red in |- *. (* Goal: Included U C C' *) apply Im_intro with z; assumption. (* Goal: Included U (Set_Sum U D) (F (Set_Sum U D)) *) exact J_is_in_FJ. (* on A\J *) elim h_x_z. (* case when (h x y) behaves as g and (h x z) as f: contradiction *) intro x_in_J; intros. cut (Included U J (F J)). unfold Included in |- *; unfold F in |- *; unfold Setminus in |- *; intro Hyp. elim (Hyp x x_in_J). intros x_in_A x_in_non_Img. elim x_in_non_Img. (* Goal: D (F (Set_Sum U D)) *) red in |- *. (* Goal: D (F (Set_Sum U D)) *) red in |- *. (* Goal: Included U C C' *) apply Im_intro with y; assumption. (* Goal: Included U (Set_Sum U D) (F (Set_Sum U D)) *) exact J_is_in_FJ. (* case when (h x y) and (h x z) behaves as g: ok *) elim g_inj. unfold from_at_most_one_input in |- *; do 3 intro; intro g_au_plus_1_ant; (* Goal: forall (f : Relation U) (_ : injection U B A f), equipollence U A B *) intros. (* Goal: Included U C C' *) apply g_au_plus_1_ant with x; assumption. Qed. (** h satisfies to_at_least_one_output *) Lemma h3 : to_at_least_one_output U A h. Proof. (* Goal: D (F (Set_Sum U D)) *) red in |- *. (* Goal: forall (f : Relation U) (_ : injection U B A f), equipollence U A B *) intros. elim (in_or_not_in U x (Img (Setminus U B (Imf J)))). (* on A\J *) unfold Img in |- *; intro x_in_Img. elim x_in_Img. intros y g_y_x H1. exists y. (* Goal: Included U C C' *) apply hr_intro; assumption. (* on J *) (* Goal: forall (f : Relation U) (_ : injection U B A f), equipollence U A B *) intros. (* from f function, we deduce that f satisfies to_at_least_one_output *) elim f_inj. unfold to_at_least_one_output in |- *; do 2 intro; intro f_au_moins_1_im; intro. elim (f_au_moins_1_im x H). intros y f_x_y. exists y. apply hl_intro. apply FJ_is_in_J. (* Goal: D (F (Set_Sum U D)) *) red in |- *; red in |- *; red in |- *. (* Goal: Included U C C' *) split; assumption. (* Goal: Included U C C' *) assumption. Qed. (** h satisfies from_at_most_one_input *) Lemma h4 : from_at_most_one_input U h. Proof. red in |- *; do 3 intro; intros h_x_z h_y_z. elim h_x_z. (* on J *) elim h_y_z. (* case when (h x y) and (h x z) behave as f: ok *) elim f_inj. (* Goal: forall (f : Relation U) (_ : injection U B A f), equipollence U A B *) intros. cut (forall x y z : U, f x z -> f y z -> x = y). (* Goal: Included U C C' *) intro Hyp; apply Hyp with z; assumption. (* Goal: Included U C C' *) assumption. (* show that one cannot have (f x z) and (g z y) with x in J and z outside of (Imf J) without contradiction *) (* Goal: forall (f : Relation U) (_ : injection U B A f), equipollence U A B *) unfold Setminus in |- *; intro z_in_Setminus_B_Imf_J; intros. elim z_in_Setminus_B_Imf_J. intros z_in_B z_in_non_Imf_J. elim z_in_non_Imf_J. (* Goal: D (F (Set_Sum U D)) *) red in |- *. (* Goal: D (F (Set_Sum U D)) *) red in |- *. (* Goal: Included U C C' *) apply Im_intro with x; assumption. (* on A\J *) elim h_y_z. (* show that one cannot (f y z) and (g z x) with x in J and z outside (Imf J) without contradiction *) unfold Setminus in |- *; do 2 intro; intro z_in_Setminus_B_Imf_J; (* Goal: forall (f : Relation U) (_ : injection U B A f), equipollence U A B *) intros. elim z_in_Setminus_B_Imf_J. intros z_in_B z_in_non_Imf_J. elim z_in_non_Imf_J. (* Goal: D (F (Set_Sum U D)) *) red in |- *. (* Goal: D (F (Set_Sum U D)) *) red in |- *. (* Goal: Included U C C' *) apply Im_intro with y; assumption. (* from g function, one deduces that g satisfies to_at_most_one_output, which means from_at_most_one_input for h *) elim g_inj. (* Goal: forall (f : Relation U) (_ : injection U B A f), equipollence U A B *) intros. cut (forall z x y : U, g z x -> g z y -> x = y). (* Goal: Included U C C' *) intro Hyp; apply Hyp with z; assumption. (* Goal: Included U C C' *) assumption. Qed. (** h satisfies from_at_least_one_input *) Lemma h5 : from_at_least_one_input U B h. Proof. (* Goal: D (F (Set_Sum U D)) *) red in |- *. (* Goal: forall (f : Relation U) (_ : injection U B A f), equipollence U A B *) intros. elim (in_or_not_in U y (Imf J)). (* on J *) unfold Imf in |- *; intro y_in_Imf. (* from f injective, one deduces that f satisfies from_at_least_one_input *) elim y_in_Imf. intros x f_x_y; intro. exists x. (* Goal: Included U C C' *) apply hl_intro; assumption. (* on A\J *) (* Goal: forall (f : Relation U) (_ : injection U B A f), equipollence U A B *) intros. (* from g injective, one deduces g satisfies to_at_least_one_output, which means from_at_least_one_input for h *) elim g_inj. unfold to_at_least_one_output in |- *; do 2 intro; intro g_au_moins_1_im; intro. elim (g_au_moins_1_im y H). intros x g_y_x. exists x. apply hr_intro. (* Goal: D (F (Set_Sum U D)) *) red in |- *. (* Goal: Included U C C' *) split; assumption. (* Goal: Included U C C' *) assumption. Qed. (** We can now resume the proof of h_bij *) Proof. exact (bijection_intro U A B h h1 h2 h3 h4 h5). Qed. End Bijection. (** Schroeder-Bernstein-Cantor Theorem *) Theorem Schroeder : A <=_card B -> B <=_card A -> A =_card B. Proof. (* Goal: forall (_ : inf_card U A B) (_ : inf_card U B A), equipollence U A B *) intros A_inf_B B_inf_A. (* Goal: equipollence U A B *) elim A_inf_B. (* Goal: forall (f : Relation U) (_ : injection U B A f), equipollence U A B *) intros. (* Goal: equipollence U A B *) elim B_inf_A. (* Goal: forall (f : Relation U) (_ : injection U B A f), equipollence U A B *) intros. (* Goal: equipollence U A B *) apply equipollence_intro with (h f f0). (* Goal: Included U C C' *) apply h_bij; assumption. Qed. End Schroeder_Bernstein. (* The end *) (* $Id$ *)
(* Contribution to the Coq Library V6.3 (July 1999) *) (****************************************************************************) (* The Calculus of Inductive Constructions *) (* *) (* Projet Coq *) (* *) (* INRIA ENS-CNRS *) (* Rocquencourt Lyon *) (* *) (* Coq V5.11 *) (* Feb 2nd 1996 *) (* *) (* (notations and layout updated March 2009) *) (****************************************************************************) (* Sum.v *) (****************************************************************************) (* This file is distributed under the terms of the *) (* GNU Lesser General Public License Version 2.1 *) (****************************************************************************) Require Import Ensembles. (* Ensemble, In, Included, Setminus *) Section Set_Sums. Variable U : Type. Inductive Set_Sum (D : Ensemble (Ensemble U)) : U -> Prop := Set_Sum_intro : forall B : Ensemble U, In (Ensemble U) D B -> forall x : U, In U B x -> Set_Sum D x. Lemma Set_Sum_is_majoring : forall (D : Ensemble (Ensemble U)) (A : Ensemble U), (forall C : Ensemble U, D C -> Included U C A) -> Included U (Set_Sum D) A. (* Goal: forall (D : Ensemble (Ensemble U)) (A : Ensemble U) (_ : forall (C : Ensemble U) (_ : D C), Included U C A), Included U (Set_Sum D) A *) intros. (* Goal: Included U (Set_Sum D) A *) red in |- *; intros x x_in_Set_Sum_D. (* Goal: In U A x *) red in x_in_Set_Sum_D. (* Goal: In U A x *) elim x_in_Set_Sum_D. (* Goal: forall (B : Ensemble U) (_ : In (Ensemble U) D B) (x : U) (_ : In U B x), In U A x *) assumption. Qed. Lemma Set_Sum_is_minoring : forall (D : Ensemble (Ensemble U)) (A : Ensemble U), In (Ensemble U) D A -> Included U A (Set_Sum D). (* Goal: forall (D : Ensemble (Ensemble U)) (A : Ensemble U) (_ : In (Ensemble U) D A), Included U A (Set_Sum D) *) do 2 intro; red in |- *; intros A_in_D x x_in_A. (* Goal: forall (B : Ensemble U) (_ : In (Ensemble U) D B) (x : U) (_ : In U B x), In U A x *) red in |- *; apply Set_Sum_intro with A; assumption. Qed. End Set_Sums. (* $Id$ *)
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) (* Contribution to the Coq Library V6.3 (July 1999) *) (****************************************************************************) (* The Calculus of Inductive Constructions *) (* *) (* Projet Coq *) (* *) (* INRIA ENS-CNRS *) (* Rocquencourt Lyon *) (* *) (* Coq V5.10 *) (* *) (****************************************************************************) (* Alternate.v *) (****************************************************************************) (* G. Huet - V5.8 Nov. 1994 *) (* ported V5.10 June 1995 *) Require Import Bool. Require Import Words. (*********************) (* Alternating words *) (*********************) (* (alt b w) == w = [b ~b b ~b ...] *) Inductive alt : bool -> word -> Prop := | alt_empty : forall b : bool, alt b empty | alt_bit : forall (b : bool) (w : word), alt (negb b) w -> alt b (bit b w). Hint Resolve alt_empty alt_bit. Lemma alt_neg_intro : forall (b b' : bool) (w : word), alt b (bit b' w) -> alt (negb b) w. Proof. (* Goal: forall (b b' : bool) (w : word) (_ : alt b (bit b' w)), @eq bool b b' *) intros b b' w al. (* Goal: @eq bool b b' *) inversion al; trivial. Qed. Lemma alt_neg_elim : forall (b b' : bool) (w : word), alt (negb b) (bit b' w) -> alt b w. Proof. (* Goal: forall (b b' : bool) (w : word) (_ : alt (negb b) (bit b' w)), alt b w *) intros; rewrite (negb_intro b); apply alt_neg_intro with b'; trivial. Qed. Lemma alt_eq : forall (b b' : bool) (w : word), alt b (bit b' w) -> b = b'. Proof. (* Goal: forall (b b' : bool) (w : word) (_ : alt b (bit b' w)), @eq bool b b' *) intros b b' w al. (* Goal: @eq bool b b' *) inversion al; trivial. Qed. Lemma alt_back : forall (b b' : bool) (w : word), alt b (bit b' w) -> b = b' /\ alt (negb b) w. Proof. (* Goal: forall (b b' : bool) (w : word) (_ : alt b (bit b' w)), and (@eq bool b b') (alt (negb b) w) *) intros; split. (* Goal: @eq bool b b' *) (* Goal: alt (negb b) w *) apply alt_eq with w; trivial. (* Goal: alt (negb b) w *) apply alt_neg_intro with b'; trivial. Qed. Inductive alternate (w : word) : Prop := alter : forall b : bool, alt b w -> alternate w. (* (alternate w) iff Exists b (alt b w) *) (*********************************************) (* Subwords of alternate words are alternate *) (*********************************************) Lemma alt_conc_l : forall u v w : word, conc u v w -> forall b : bool, alt b w -> alt b u. Proof. (* Goal: forall (u v w : word) (_ : conc u v w) (b : bool) (_ : alt b w), alt b u *) simple induction 1; auto; intros. (* Goal: alt b0 (bit b u0) *) elim alt_back with b0 b w0. (* Goal: forall (_ : @eq bool b0 b) (_ : alt (negb b0) w0), alt b0 (bit b u0) *) (* Goal: alt b0 (bit b w0) *) intros eq A. (* Goal: alt b0 (bit b u0) *) (* Goal: alt b0 (bit b w0) *) elim eq; auto. (* Goal: alt b0 (bit b w0) *) trivial. Qed. Lemma alt_conc_r : forall u v w : word, conc u v w -> forall b : bool, alt b w -> odd u /\ alt (negb b) v \/ even u /\ alt b v. Proof. (* Goal: forall (u v w : word) (_ : conc u v w) (b : bool) (_ : alt b w), or (and (odd u) (alt (negb b) v)) (and (even u) (alt b v)) *) simple induction 1; intros. (* Goal: or (and (odd empty) (alt (negb b) v0)) (and (even empty) (alt b v0)) *) (* Goal: or (and (odd (bit b u0)) (alt (negb b0) v0)) (and (even (bit b u0)) (alt b0 v0)) *) right; split; intros; auto. (* Goal: or (and (odd (bit b u0)) (alt (negb b0) v0)) (and (even (bit b u0)) (alt b0 v0)) *) elim H1 with (negb b0). (* Goal: forall _ : and (odd u0) (alt (negb (negb b0)) v0), or (and (odd (bit b u0)) (alt (negb b0) v0)) (and (even (bit b u0)) (alt b0 v0)) *) (* Goal: forall _ : and (even u0) (alt (negb b0) v0), or (and (odd (bit b u0)) (alt (negb b0) v0)) (and (even (bit b u0)) (alt b0 v0)) *) (* Goal: alt (negb b0) w0 *) rewrite (negb_elim b0); intro. (* Goal: or (and (odd (bit b u0)) (alt (negb b0) v0)) (and (even (bit b u0)) (alt b0 v0)) *) (* Goal: forall _ : and (even u0) (alt (negb b0) v0), or (and (odd (bit b u0)) (alt (negb b0) v0)) (and (even (bit b u0)) (alt b0 v0)) *) (* Goal: alt (negb b0) w0 *) right; split; elim H3; auto. (* Goal: forall _ : and (even u0) (alt (negb b0) v0), or (and (odd (bit b u0)) (alt (negb b0) v0)) (and (even (bit b u0)) (alt b0 v0)) *) (* Goal: alt (negb b0) w0 *) intro; left; split; elim H3; auto. (* Goal: alt b0 (bit b w0) *) apply alt_neg_intro with b; trivial. Qed. Lemma alt_conc : forall u v w : word, conc u v w -> alternate w -> alternate u /\ alternate v. Proof. (* Goal: forall (u v w : word) (_ : conc u v w) (_ : alternate w), and (alternate u) (alternate v) *) simple induction 2; intros b ab; split. (* Goal: alt b0 (bit b w0) *) apply alter with b; apply alt_conc_l with v w; trivial. (* Goal: alt b0 (bit b w0) *) elim alt_conc_r with u v w b; intros; trivial. (* Goal: alt b0 (bit b w0) *) elim H1; intros; apply alter with (negb b); trivial. (* Goal: alt b0 (bit b w0) *) elim H1; intros; apply alter with b; trivial. Qed. (* unused in Shuffle *)
(* This program is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) (* as published by the Free Software Foundation; either version 2.1 *) (* of the License, or (at your option) any later version. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this program; if not, write to the Free *) (* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) (* 02110-1301 USA *) (* Contribution to the Coq Library V6.3 (July 1999) *) (****************************************************************************) (* The Calculus of Inductive Constructions *) (* *) (* Projet Coq *) (* *) (* INRIA ENS-CNRS *) (* Rocquencourt Lyon *) (* *) (* Coq V5.10 *) (* *) (****************************************************************************) (* Opposite.v *) (****************************************************************************) (* G. Huet - V5.8 Nov. 1994 *) (* ported V5.10 June 1995 *) Require Import Bool. Require Import Words. Require Import Alternate. (************) (* Opposite *) (************) Inductive opposite : word -> word -> Prop := opp : forall (u v : word) (b : bool), opposite (bit b u) (bit (negb b) v). Hint Resolve opp. Lemma not_opp_empty_r : forall u : word, ~ opposite u empty. Proof. (* Goal: forall u : word, not (opposite empty u) *) unfold not in |- *; intros u op. (* Goal: False *) inversion op. Qed. Lemma not_opp_empty_l : forall u : word, ~ opposite empty u. Proof. (* Goal: forall u : word, not (opposite empty u) *) unfold not in |- *; intros u op. (* Goal: False *) inversion op. Qed. Lemma not_opp_same : forall (u v : word) (b : bool), ~ opposite (bit b u) (bit b v). Proof. (* Goal: forall (u v : word) (b : bool), not (opposite (bit b u) (bit b v)) *) unfold not in |- *; intros u v b op. (* Goal: False *) inversion op. (* Goal: False *) apply (no_fixpoint_negb b); trivial. Qed. Lemma alt_neg_opp : forall (u v : word) (b : bool), odd u -> alt b u -> odd v -> alt (negb b) v -> opposite u v. Proof. (* Goal: forall (u v : word) (b : bool) (_ : alt b u) (_ : alt b v), not (opposite u v) *) simple induction u. (* Goal: forall (v : word) (b : bool) (_ : odd empty) (_ : alt b empty) (_ : odd v) (_ : alt (negb b) v), opposite empty v *) (* Goal: forall (b : bool) (w : word) (_ : forall (v : word) (b0 : bool) (_ : odd w) (_ : alt b0 w) (_ : odd v) (_ : alt (negb b0) v), opposite w v) (v : word) (b0 : bool) (_ : odd (bit b w)) (_ : alt b0 (bit b w)) (_ : odd v) (_ : alt (negb b0) v), opposite (bit b w) v *) intros v b odd_empty; absurd (odd empty); trivial. (* Goal: forall (b : bool) (w : word) (_ : forall (v : word) (b0 : bool) (_ : alt b0 w) (_ : alt b0 v), not (opposite w v)) (v : word) (b0 : bool) (_ : alt b0 (bit b w)) (_ : alt b0 v), not (opposite (bit b w) v) *) intros b u' H v; elim v. (* Goal: forall (b0 : bool) (_ : odd (bit b u')) (_ : alt b0 (bit b u')) (_ : odd empty) (_ : alt (negb b0) empty), opposite (bit b u') empty *) (* Goal: forall (b0 : bool) (w : word) (_ : forall (b1 : bool) (_ : odd (bit b u')) (_ : alt b1 (bit b u')) (_ : odd w) (_ : alt (negb b1) w), opposite (bit b u') w) (b1 : bool) (_ : odd (bit b u')) (_ : alt b1 (bit b u')) (_ : odd (bit b0 w)) (_ : alt (negb b1) (bit b0 w)), opposite (bit b u') (bit b0 w) *) intros b' H1 H2 odd_empty. (* Goal: forall _ : alt (negb b') empty, opposite (bit b u') empty *) (* Goal: forall (b0 : bool) (w : word) (_ : forall (b1 : bool) (_ : odd (bit b u')) (_ : alt b1 (bit b u')) (_ : odd w) (_ : alt (negb b1) w), opposite (bit b u') w) (b1 : bool) (_ : odd (bit b u')) (_ : alt b1 (bit b u')) (_ : odd (bit b0 w)) (_ : alt (negb b1) (bit b0 w)), opposite (bit b u') (bit b0 w) *) absurd (odd empty); trivial. (* Goal: forall (b0 : bool) (w : word) (_ : forall (b1 : bool) (_ : odd (bit b u')) (_ : alt b1 (bit b u')) (_ : odd w) (_ : alt (negb b1) w), opposite (bit b u') w) (b1 : bool) (_ : odd (bit b u')) (_ : alt b1 (bit b u')) (_ : odd (bit b0 w)) (_ : alt (negb b1) (bit b0 w)), opposite (bit b u') (bit b0 w) *) intros b' v' H' b'' H1 H2 H3 H4. (* Goal: opposite (bit b u') (bit b' v') *) elim (alt_eq (negb b'') b' v'); trivial. (* Goal: not (opposite (bit b u') (bit b'' v')) *) elim (alt_eq b'' b u'); trivial. Qed. Lemma alt_not_opp : forall (u v : word) (b : bool), alt b u -> alt b v -> ~ opposite u v. Proof. (* Goal: forall (u v : word) (b : bool) (_ : alt b u) (_ : alt b v), not (opposite u v) *) simple induction u. (* Goal: forall (v : word) (b : bool) (_ : alt b empty) (_ : alt b v), not (opposite empty v) *) (* Goal: forall (b : bool) (w : word) (_ : forall (v : word) (b0 : bool) (_ : alt b0 w) (_ : alt b0 v), not (opposite w v)) (v : word) (b0 : bool) (_ : alt b0 (bit b w)) (_ : alt b0 v), not (opposite (bit b w) v) *) intros; apply not_opp_empty_l. (* Goal: forall (b : bool) (w : word) (_ : forall (v : word) (b0 : bool) (_ : alt b0 w) (_ : alt b0 v), not (opposite w v)) (v : word) (b0 : bool) (_ : alt b0 (bit b w)) (_ : alt b0 v), not (opposite (bit b w) v) *) intros b u' H v; elim v. (* Goal: forall (b0 : bool) (_ : alt b0 (bit b u')) (_ : alt b0 empty), not (opposite (bit b u') empty) *) (* Goal: forall (b0 : bool) (w : word) (_ : forall (b1 : bool) (_ : alt b1 (bit b u')) (_ : alt b1 w), not (opposite (bit b u') w)) (b1 : bool) (_ : alt b1 (bit b u')) (_ : alt b1 (bit b0 w)), not (opposite (bit b u') (bit b0 w)) *) intros; apply not_opp_empty_r. (* Goal: forall (b0 : bool) (w : word) (_ : forall (b1 : bool) (_ : alt b1 (bit b u')) (_ : alt b1 w), not (opposite (bit b u') w)) (b1 : bool) (_ : alt b1 (bit b u')) (_ : alt b1 (bit b0 w)), not (opposite (bit b u') (bit b0 w)) *) intros b' v' H1 b'' H2 H3. (* Goal: not (opposite (bit b u') (bit b' v')) *) elim (alt_eq b'' b' v'); trivial. (* Goal: not (opposite (bit b u') (bit b'' v')) *) elim (alt_eq b'' b u'); trivial. (* Goal: not (opposite (bit b'' u') (bit b'' v')) *) apply not_opp_same. Qed.