X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2Flibrary%2Falgebra%2Fmonoids.ma;h=71e9a7c594a609d335a13501695cc657564881b9;hb=395bcb2796cb9edcdb792579341c2271a8d1adaf;hp=63b6430ec90facf077bfbd3b4b346a9e124d7cc9;hpb=35337934554027181913e87de11ff77745a77ebe;p=helm.git diff --git a/helm/software/matita/library/algebra/monoids.ma b/helm/software/matita/library/algebra/monoids.ma index 63b6430ec..71e9a7c59 100644 --- a/helm/software/matita/library/algebra/monoids.ma +++ b/helm/software/matita/library/algebra/monoids.ma @@ -12,74 +12,51 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/algebra/monoids/". - include "algebra/semigroups.ma". record PreMonoid : Type ≝ - { magma:> Magma; - e: magma - }. +{ pre_semi_group :> PreSemiGroup; + e : pre_semi_group +}. -notation < "M" for @{ 'pmmagma $M }. -interpretation "premonoid magma coercion" 'pmmagma M = - (cic:/matita/algebra/monoids/magma.con M). +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 }. -notation < "M" for @{ 'semigroup $M }. -interpretation "premonoid coercion" 'premonoid M = - (cic:/matita/algebra/monoids/premonoid.con M). - -notation < "M" for @{ 'typeofmonoid $M }. -interpretation "premonoid coercion" 'typeofmonoid M = - (cic:/matita/algebra/monoids/Type_of_Monoid.con M). - -notation < "M" for @{ 'magmaofmonoid $M }. -interpretation "premonoid coercion" 'magmaofmonoid M = - (cic:/matita/algebra/monoids/Magma_of_Monoid.con M). - -notation "1" with precedence 89 -for @{ 'munit }. +definition SemiGroup_of_Monoid: Monoid → SemiGroup ≝ + λM. mk_SemiGroup ? (is_monoid M). + +coercion SemiGroup_of_Monoid nocomposites. -interpretation "Monoid unit" 'munit = - (cic:/matita/algebra/monoids/e.con _). - definition is_left_inverse ≝ - λM:Monoid. + λM:PreMonoid. λopp: M → M. - ∀x:M. (opp x)·x = 1. - + ∀x:M. (opp x)·x = ⅇ. + definition is_right_inverse ≝ - λM:Monoid. + λM:PreMonoid. λopp: M → M. - ∀x:M. x·(opp x) = 1. + ∀x:M. x·(opp x) = ⅇ. theorem is_left_inverse_to_is_right_inverse_to_eq: ∀M:Monoid. ∀l,r. 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.