X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmatita%2Flibrary%2Falgebra%2Fmonoids.ma;h=c3f3cc48e8841b8139a915399030355744755038;hb=771ee8b9d122fa963881c876e86f90531bb7434f;hp=c85d1ebc1842df1e80af57928ca936766ef83f46;hpb=ff81867363f855a3ad5bba6f6bb636f20bf8a969;p=helm.git diff --git a/helm/matita/library/algebra/monoids.ma b/helm/matita/library/algebra/monoids.ma index c85d1ebc1..c3f3cc48e 100644 --- a/helm/matita/library/algebra/monoids.ma +++ b/helm/matita/library/algebra/monoids.ma @@ -16,58 +16,70 @@ 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; - properties: isMonoid ? e + { premonoid:> PreMonoid; + monoid_properties:> isMonoid premonoid }. - -coercion cic:/matita/algebra/monoids/semigroup.con. - -notation "hvbox(! \sub S)" -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 @{ 'semigroup $M }. - -interpretation "Semigroup coercion" 'semigroup M = - (cic:/matita/algebra/monoids/semigroup.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 _). + definition is_left_inverse ≝ λM:Monoid. λopp: M → M. - ∀x:M. op M (opp x) x = ! \sub M. - + ∀x:M. (opp x)·x = 1. + definition is_right_inverse ≝ λM:Monoid. λopp: M → M. - ∀x:M. op M x (opp x) = ! \sub M. + ∀x:M. x·(opp x) = 1. theorem is_left_inverse_to_is_right_inverse_to_eq: - ∀M:Monoid. ∀oppL,oppR. - is_left_inverse M oppL → is_right_inverse M oppR → - ∀x:M. oppL x = oppR x. + ∀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. op M y (oppR x)) ? ? H2); + generalize in match (eq_f ? ? (λy.y·(r x)) ? ? H2); simplify; fold simplify (op M); intro; clear H2; - generalize in match (properties (semigroup 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 ? ? (properties M)) in H3; - rewrite > (e_is_right_unit ? ? (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. -