X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmatita%2Flibrary%2Falgebra%2Fmonoids.ma;h=c3f3cc48e8841b8139a915399030355744755038;hb=a7063fc0997a9d9eae6c329443e67ab92c4b6a0f;hp=7c40db1fd89bffad6aefb0b284c01f10e4f1b169;hpb=1561ac998b6823c9e763617fcb9cf3c063bb5e3b;p=helm.git diff --git a/helm/matita/library/algebra/monoids.ma b/helm/matita/library/algebra/monoids.ma index 7c40db1fd..c3f3cc48e 100644 --- a/helm/matita/library/algebra/monoids.ma +++ b/helm/matita/library/algebra/monoids.ma @@ -16,47 +16,55 @@ set "baseuri" "cic:/matita/algebra/monoids/". include "algebra/semigroups.ma". -record isMonoid (SS:SemiGroup) (e:SS) : Prop ≝ - { e_is_left_unit: is_left_unit SS e; - e_is_right_unit: is_right_unit SS e +record PreMonoid : Type ≝ + { magma:> Magma; + e: magma + }. + +notation < "M" for @{ 'pmmagma $M }. +interpretation "premonoid magma coercion" 'pmmagma M = + (cic:/matita/algebra/monoids/magma.con M). + +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 Monoid : Type ≝ - { semigroup: SemiGroup; - e: semigroup; - monoid_properties: isMonoid ? e + { premonoid:> PreMonoid; + monoid_properties:> isMonoid premonoid }. - -coercion cic:/matita/algebra/monoids/semigroup.con. - -(* too ugly -notation "hvbox(1 \sub S)" with precedence 89 -for @{ 'munit $S }. - -interpretation "Monoid unit" 'munit S = - (cic:/matita/algebra/monoids/e.con S). *) +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 }. interpretation "Monoid unit" 'munit = (cic:/matita/algebra/monoids/e.con _). -notation < "M" -for @{ 'semigroup $M }. - -interpretation "Semigroup coercion" 'semigroup M = - (cic:/matita/algebra/monoids/semigroup.con M). - definition is_left_inverse ≝ λM:Monoid. λopp: M → M. - ∀x:M. op M (opp x) x = 1. + ∀x:M. (opp x)·x = 1. definition is_right_inverse ≝ λM:Monoid. λopp: M → M. - ∀x:M. op M x (opp x) = 1. + ∀x:M. x·(opp x) = 1. theorem is_left_inverse_to_is_right_inverse_to_eq: ∀M:Monoid. ∀l,r. @@ -64,16 +72,14 @@ theorem is_left_inverse_to_is_right_inverse_to_eq: ∀x:M. l x = r x. intros; generalize in match (H x); intro; - generalize in match (eq_f ? ? (λy. op M y (r x)) ? ? H2); + generalize in match (eq_f ? ? (λy.y·(r x)) ? ? H2); simplify; fold simplify (op M); intro; clear H2; - generalize in match (semigroup_properties M); - fold simplify (Type_of_Monoid M); + generalize in match (associative ? (is_semi_group ? (monoid_properties M))); intro; - unfold isSemiGroup in H2; unfold associative in H2; rewrite > H2 in H3; clear H2; 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 ? (monoid_properties M)) in H3; + rewrite > (e_is_right_unit ? (monoid_properties M)) in H3; assumption. qed.