X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2Flibrary%2Falgebra%2Fmonoids.ma;h=71e9a7c594a609d335a13501695cc657564881b9;hb=73a66cce6e72c654fdcd0ce760c405a74af70d08;hp=fe35eeb6709fea8092269d6035f470f6136c9523;hpb=80ea6f314e89d9d280338c41860cb04949319629;p=helm.git diff --git a/helm/software/matita/library/algebra/monoids.ma b/helm/software/matita/library/algebra/monoids.ma index fe35eeb67..71e9a7c59 100644 --- a/helm/software/matita/library/algebra/monoids.ma +++ b/helm/software/matita/library/algebra/monoids.ma @@ -15,32 +15,35 @@ include "algebra/semigroups.ma". record PreMonoid : Type ≝ - { magma:> Magma; - e: magma - }. +{ pre_semi_group :> PreSemiGroup; + e : pre_semi_group +}. + +interpretation "Monoid unit" 'neutral = (e ?). -record isMonoid (M:PreMonoid) : Prop ≝ - { is_semi_group:> isSemiGroup M; - e_is_left_unit: - is_left_unit (mk_SemiGroup ? is_semi_group) (e M); - e_is_right_unit: - is_right_unit (mk_SemiGroup ? is_semi_group) (e M) +record IsMonoid (M:PreMonoid): Prop ≝ + { is_pre_semi_group :> IsSemiGroup M; + e_is_left_unit : is_left_unit M ⅇ; + e_is_right_unit : is_right_unit M ⅇ }. - + record Monoid : Type ≝ - { premonoid:> PreMonoid; - monoid_properties:> isMonoid premonoid + { pre_monoid :> PreMonoid; + is_monoid :> IsMonoid pre_monoid }. -interpretation "Monoid unit" 'neutral = (e _). - +definition SemiGroup_of_Monoid: Monoid → SemiGroup ≝ + λM. mk_SemiGroup ? (is_monoid M). + +coercion SemiGroup_of_Monoid nocomposites. + definition is_left_inverse ≝ - λM:Monoid. + λM:PreMonoid. λopp: M → M. ∀x:M. (opp x)·x = ⅇ. - + definition is_right_inverse ≝ - λM:Monoid. + λM:PreMonoid. λopp: M → M. ∀x:M. x·(opp x) = ⅇ. @@ -49,15 +52,11 @@ theorem is_left_inverse_to_is_right_inverse_to_eq: is_left_inverse M l → is_right_inverse M r → ∀x:M. l x = r x. intros; - generalize in match (H x); intro; - generalize in match (eq_f ? ? (λy.y·(r x)) ? ? H2); - simplify; fold simplify (op M); - intro; clear H2; - generalize in match (op_associative ? (is_semi_group ? (monoid_properties M))); - intro; - rewrite > H2 in H3; clear H2; + lapply (H x) as H2; + lapply (eq_f ? ? (λy.y·(r x)) ? ? H2) as H3; clear H2; + rewrite > (op_is_associative ? M) in H3. rewrite > H1 in H3; - rewrite > (e_is_left_unit ? (monoid_properties M)) in H3; - rewrite > (e_is_right_unit ? (monoid_properties M)) in H3; + rewrite > (e_is_left_unit ? M) in H3; + rewrite > (e_is_right_unit ? M) in H3; assumption. qed.